/**
 * PlanArtifact v1 — structured planning document types.
 *
 * Field-level spec: repo-root `PLANNER_SCHEMA.md` (A-SCHEMA).
 * JSON Schema (WP-1.2): `schemas/planning/plan-artifact.v1.schema.json`.
 */
/** Literal envelope version; bump only with a migration story. */
export const PLAN_ARTIFACT_SCHEMA_VERSION = 1;
export function isPlanArtifactSchemaVersion(value) {
    return value === PLAN_ARTIFACT_SCHEMA_VERSION;
}
/** Narrow unknown JSON to PlanArtifact v1 envelope (structural; not full schema validation). */
export function isPlanArtifactV1(value) {
    if (!value || typeof value !== "object" || Array.isArray(value)) {
        return false;
    }
    const doc = value;
    return (isPlanArtifactSchemaVersion(doc.schemaVersion) &&
        typeof doc.planId === "string" &&
        typeof doc.version === "number" &&
        typeof doc.planRef === "string" &&
        typeof doc.status === "string" &&
        doc.identity !== null &&
        typeof doc.identity === "object" &&
        Array.isArray(doc.goals) &&
        Array.isArray(doc.wbs) &&
        doc.provenance !== null &&
        typeof doc.provenance === "object");
}
