/**
 * Release Plan contracts — canonical Zod schema for `.cleo/release/<version>.plan.json`.
 *
 * The plan file is the source-of-truth state record for a release as it moves
 * through the canonical FSM:
 *
 *   planned → pr-opened → pr-merged → published → reconciled
 *
 * Off-ramp terminal states: `rolled_back`, `failed`, `cancelled`.
 *
 * This module defines the normative shape per SPEC-T9345 §6.1/§6.2. Consumers:
 *
 * - `cleo release plan`      (T9525) — INSERTs status=planned
 * - `cleo release open`      (T9525) — UPDATEs status=pr-opened
 * - `cleo release reconcile` (T9526) — re-validates and UPDATEs status=reconciled
 *
 * The schema is permissive on `evidenceAtoms` (length-zero arrays are
 * structurally valid) — the non-empty invariant (R-301) is enforced by the
 * verb implementations, not the contract, so backfill / migration tooling can
 * load historical plans without contract-level rejection.
 *
 * @task T9527
 * @epic T9492
 * @adr  ADR-T9345 (IVTR-release-overhaul)
 * @spec .cleo/rcasd/T9345/research/SPEC-T9345-release-pipeline-v2.md §6
 */
import { z } from 'zod';
/**
 * Semantic version of the Release Plan contract.
 *
 * Increment the MAJOR component on incompatible field renames or removals.
 * Increment MINOR on additive optional-field changes. The plan JSON `$schema`
 * URL is keyed off the MAJOR component (`/release-plan/v1.json` for `1.x.y`).
 */
export declare const RELEASE_PLAN_SCHEMA_VERSION = "1.0.0";
/**
 * Canonical `$schema` URL embedded in plan files at write time. Consumers MAY
 * use this string to identify the contract version when parsing legacy plans.
 */
export declare const RELEASE_PLAN_SCHEMA_URL = "https://cleocode.io/schemas/release-plan/v1.json";
/**
 * Canonical npm dist-tag channels supported by the release pipeline.
 *
 * Includes `rc` in addition to the legacy `latest|beta|alpha` triple to allow
 * release candidates without conflating with `beta` per SPEC §6.1.
 */
export declare const RELEASE_CHANNEL: readonly ["latest", "beta", "alpha", "rc"];
/**
 * Version-scheme variants. `calver-suffix` is the hotfix grammar
 * `vYYYY.M.DD.N` per SPEC R-402.
 */
export declare const RELEASE_SCHEME: readonly ["calver", "semver", "calver-suffix"];
/**
 * Release-kind classification. `hotfix` triggers the scope-strict completeness
 * path per SPEC R-401; `prerelease` allows non-`latest` channels.
 */
export declare const RELEASE_KIND: readonly ["regular", "hotfix", "prerelease"];
/**
 * Lifecycle FSM states for a release plan. Ordered for documentation only —
 * the runtime FSM enforces monotonic forward progress per SPEC R-302.
 */
export declare const RELEASE_STATUS: readonly ["planned", "pr-opened", "pr-merged", "published", "reconciled", "rolled_back", "failed", "cancelled"];
/**
 * Gate verification status. `unresolved` indicates ADR-061's resolver could
 * not produce a command for the project archetype (SPEC R-304).
 */
export declare const GATE_STATUS: readonly ["passed", "failed", "skipped", "unresolved"];
/**
 * Canonical gate names recognized by the release pipeline. Mirrors the
 * ADR-051 / ADR-061 evidence-atom canonical names (R-310).
 */
export declare const GATE_NAME: readonly ["test", "build", "lint", "typecheck", "audit", "security-scan"];
/**
 * Platform tuples used by the release matrix per T1737 alignment (R-370).
 *
 * `any` collapses single platform-agnostic artifacts (R-371).
 */
export declare const PLATFORM_TUPLE: readonly ["linux-x64", "linux-arm64", "macos-x64", "macos-arm64", "windows-x64", "any"];
/**
 * Supported publisher backends — the registries / distribution channels the
 * release matrix may target.
 */
export declare const PUBLISHER: readonly ["npm", "cargo", "docker", "pypi", "github-release", "binary"];
/**
 * Conventional-commit-aligned task classification used to slot tasks into the
 * changelog `features` / `fixes` / `chores` / `breaking` buckets (§6.1).
 */
export declare const TASK_KIND: readonly ["feat", "fix", "chore", "docs", "refactor", "test", "perf", "revert", "breaking", "hotfix"];
/**
 * SemVer-impact classification per task. The plan-time aggregate determines
 * the release scheme bump when scheme=`semver` (informational under `calver`).
 */
export declare const IMPACT: readonly ["major", "minor", "patch"];
/**
 * Source attribution for resolved tool commands. Mirrors ADR-061 §1 surfaces.
 */
export declare const RESOLVED_SOURCE: readonly ["project-context", "language-default", "legacy-alias"];
/** Zod schema for {@link RELEASE_CHANNEL}. */
export declare const ReleaseChannelSchema: z.ZodEnum<{
    latest: "latest";
    beta: "beta";
    alpha: "alpha";
    rc: "rc";
}>;
/** Zod schema for {@link RELEASE_SCHEME}. */
export declare const ReleaseSchemeSchema: z.ZodEnum<{
    calver: "calver";
    semver: "semver";
    "calver-suffix": "calver-suffix";
}>;
/** Zod schema for {@link RELEASE_KIND}. */
export declare const ReleaseKindSchema: z.ZodEnum<{
    hotfix: "hotfix";
    regular: "regular";
    prerelease: "prerelease";
}>;
/** Zod schema for {@link RELEASE_STATUS}. */
export declare const ReleaseStatusSchema: z.ZodEnum<{
    failed: "failed";
    cancelled: "cancelled";
    planned: "planned";
    reconciled: "reconciled";
    "pr-opened": "pr-opened";
    "pr-merged": "pr-merged";
    published: "published";
    rolled_back: "rolled_back";
}>;
/** Zod schema for {@link GATE_STATUS}. */
export declare const GateStatusSchema: z.ZodEnum<{
    skipped: "skipped";
    failed: "failed";
    passed: "passed";
    unresolved: "unresolved";
}>;
/** Zod schema for {@link GATE_NAME}. */
export declare const GateNameSchema: z.ZodEnum<{
    test: "test";
    lint: "lint";
    build: "build";
    typecheck: "typecheck";
    audit: "audit";
    "security-scan": "security-scan";
}>;
/** Zod schema for {@link PLATFORM_TUPLE}. */
export declare const PlatformTupleSchema: z.ZodEnum<{
    any: "any";
    "linux-x64": "linux-x64";
    "linux-arm64": "linux-arm64";
    "macos-x64": "macos-x64";
    "macos-arm64": "macos-arm64";
    "windows-x64": "windows-x64";
}>;
/** Zod schema for {@link PUBLISHER}. */
export declare const PublisherSchema: z.ZodEnum<{
    binary: "binary";
    cargo: "cargo";
    npm: "npm";
    docker: "docker";
    pypi: "pypi";
    "github-release": "github-release";
}>;
/** Zod schema for {@link TASK_KIND}. */
export declare const TaskKindSchema: z.ZodEnum<{
    test: "test";
    docs: "docs";
    feat: "feat";
    fix: "fix";
    perf: "perf";
    refactor: "refactor";
    chore: "chore";
    breaking: "breaking";
    hotfix: "hotfix";
    revert: "revert";
}>;
/** Zod schema for {@link IMPACT}. */
export declare const ImpactSchema: z.ZodEnum<{
    major: "major";
    minor: "minor";
    patch: "patch";
}>;
/** Zod schema for {@link RESOLVED_SOURCE}. */
export declare const ResolvedSourceSchema: z.ZodEnum<{
    "project-context": "project-context";
    "language-default": "language-default";
    "legacy-alias": "legacy-alias";
}>;
/**
 * Zod schema for one task row in `plan.tasks[]`. Mirrors the SPEC §6.1 task
 * shape exactly. `evidenceAtoms` is a permissive `string[]` — verbs enforce
 * non-empty per R-301; the contract permits empty arrays so legacy plans
 * remain parseable.
 *
 * `epicAncestor` is locked at plan time (R-303) and MUST NOT be re-derived
 * by downstream consumers.
 *
 * `ivtrPhaseAtPlan` is informational only (R-316) — consumers MUST NOT
 * gate decisions on its value.
 */
export declare const ReleasePlanTaskSchema: z.ZodObject<{
    id: z.ZodString;
    kind: z.ZodEnum<{
        test: "test";
        docs: "docs";
        feat: "feat";
        fix: "fix";
        perf: "perf";
        refactor: "refactor";
        chore: "chore";
        breaking: "breaking";
        hotfix: "hotfix";
        revert: "revert";
    }>;
    impact: z.ZodEnum<{
        major: "major";
        minor: "minor";
        patch: "patch";
    }>;
    userFacingSummary: z.ZodString;
    evidenceAtoms: z.ZodArray<z.ZodString>;
    ivtrPhaseAtPlan: z.ZodOptional<z.ZodString>;
    epicAncestor: z.ZodString;
}, z.core.$strip>;
/**
 * Zod schema for one gate row in `plan.gates[]`. Each gate carries the
 * resolved ADR-061 tool command + source attribution for forensic re-runs.
 */
export declare const ReleaseGateSchema: z.ZodObject<{
    name: z.ZodEnum<{
        test: "test";
        lint: "lint";
        build: "build";
        typecheck: "typecheck";
        audit: "audit";
        "security-scan": "security-scan";
    }>;
    atom: z.ZodString;
    status: z.ZodEnum<{
        skipped: "skipped";
        failed: "failed";
        passed: "passed";
        unresolved: "unresolved";
    }>;
    lastVerifiedAt: z.ZodISODateTime;
    resolvedCommand: z.ZodOptional<z.ZodString>;
    resolvedSource: z.ZodOptional<z.ZodEnum<{
        "project-context": "project-context";
        "language-default": "language-default";
        "legacy-alias": "legacy-alias";
    }>>;
}, z.core.$strip>;
/**
 * Zod schema for one row in `plan.platformMatrix[]`. Each entry encodes a
 * (platform-tuple, publisher) pair the release will produce per R-370.
 *
 * `smoke` defaults to `true`; archetypes that produce platform-agnostic
 * artifacts MAY set `false` to skip per-platform smoke tests (R-371).
 */
export declare const ReleasePlatformMatrixEntrySchema: z.ZodObject<{
    platform: z.ZodEnum<{
        any: "any";
        "linux-x64": "linux-x64";
        "linux-arm64": "linux-arm64";
        "macos-x64": "macos-x64";
        "macos-arm64": "macos-arm64";
        "windows-x64": "windows-x64";
    }>;
    publisher: z.ZodEnum<{
        binary: "binary";
        cargo: "cargo";
        npm: "npm";
        docker: "docker";
        pypi: "pypi";
        "github-release": "github-release";
    }>;
    package: z.ZodString;
    smoke: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
}, z.core.$strip>;
/**
 * Zod schema for `plan.preflightSummary`. Captures the four preflight checks
 * runs by `cleo release plan` (R-024 / R-261).
 */
export declare const ReleasePreflightSummarySchema: z.ZodObject<{
    esbuildExternalsDrift: z.ZodBoolean;
    lockfileDrift: z.ZodBoolean;
    epicCompletenessClean: z.ZodBoolean;
    doubleListingClean: z.ZodBoolean;
    preflightWarnings: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
}, z.core.$strip>;
/**
 * Zod schema for `plan.changelog`. Tasks are bucketed by `kind` into the four
 * canonical changelog sections; each section holds an array of task IDs
 * preserving plan-time ordering.
 */
export declare const ReleasePlanChangelogSchema: z.ZodObject<{
    features: z.ZodDefault<z.ZodArray<z.ZodString>>;
    fixes: z.ZodDefault<z.ZodArray<z.ZodString>>;
    chores: z.ZodDefault<z.ZodArray<z.ZodString>>;
    breaking: z.ZodDefault<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
/**
 * Zod schema for `plan.meta` — open-ended bag of informational fields.
 *
 * The catchall is `z.unknown()` (forward-compat: parsers MUST NOT reject
 * fields the contract does not yet recognize) per ADR-039 envelope discipline.
 *
 * Documented keys:
 *
 * - `firstEverRelease` (R-023)         — escape hatch for the first ever
 *   release where `previousVersion` is `null`.
 * - `unresolvedTools` (R-024)          — canonical tool names whose
 *   resolution failed during planning.
 * - `archetype`       (R-361)          — detected project archetype string.
 */
export declare const ReleasePlanMetaSchema: z.ZodObject<{
    firstEverRelease: z.ZodOptional<z.ZodBoolean>;
    unresolvedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
    archetype: z.ZodOptional<z.ZodString>;
}, z.core.$catchall<z.ZodUnknown>>;
/**
 * Canonical Zod schema for the entire `.cleo/release/<version>.plan.json`
 * envelope. Mirrors SPEC-T9345 §6.1 1:1.
 *
 * Schema invariants enforced by this schema:
 *
 * - All enum fields reject unknown literal values (R-302 / R-304).
 * - `tasks[]` MUST contain only fully-typed task rows (R-303 / R-316).
 * - `gates[]` MUST contain only canonical gate names (R-310).
 * - `platformMatrix[]` MUST be a homogeneous array of entry rows (R-370).
 *
 * Schema invariants enforced by VERBS (NOT this schema):
 *
 * - R-300: `previousVersion` non-null unless `meta.firstEverRelease=true`.
 * - R-301: `tasks[*].evidenceAtoms` non-empty.
 * - R-305: `platformMatrix[]` non-empty.
 * - R-306: deterministic re-validation inside `open` and `reconcile`.
 */
export declare const ReleasePlanSchema: z.ZodObject<{
    $schema: z.ZodOptional<z.ZodString>;
    version: z.ZodString;
    resolvedVersion: z.ZodString;
    suffixApplied: z.ZodBoolean;
    scheme: z.ZodEnum<{
        calver: "calver";
        semver: "semver";
        "calver-suffix": "calver-suffix";
    }>;
    channel: z.ZodEnum<{
        latest: "latest";
        beta: "beta";
        alpha: "alpha";
        rc: "rc";
    }>;
    epicId: z.ZodString;
    releaseKind: z.ZodEnum<{
        hotfix: "hotfix";
        regular: "regular";
        prerelease: "prerelease";
    }>;
    createdAt: z.ZodISODateTime;
    createdBy: z.ZodString;
    previousVersion: z.ZodNullable<z.ZodString>;
    previousTag: z.ZodNullable<z.ZodString>;
    previousShippedAt: z.ZodNullable<z.ZodISODateTime>;
    tasks: z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        kind: z.ZodEnum<{
            test: "test";
            docs: "docs";
            feat: "feat";
            fix: "fix";
            perf: "perf";
            refactor: "refactor";
            chore: "chore";
            breaking: "breaking";
            hotfix: "hotfix";
            revert: "revert";
        }>;
        impact: z.ZodEnum<{
            major: "major";
            minor: "minor";
            patch: "patch";
        }>;
        userFacingSummary: z.ZodString;
        evidenceAtoms: z.ZodArray<z.ZodString>;
        ivtrPhaseAtPlan: z.ZodOptional<z.ZodString>;
        epicAncestor: z.ZodString;
    }, z.core.$strip>>;
    changelog: z.ZodObject<{
        features: z.ZodDefault<z.ZodArray<z.ZodString>>;
        fixes: z.ZodDefault<z.ZodArray<z.ZodString>>;
        chores: z.ZodDefault<z.ZodArray<z.ZodString>>;
        breaking: z.ZodDefault<z.ZodArray<z.ZodString>>;
    }, z.core.$strip>;
    gates: z.ZodArray<z.ZodObject<{
        name: z.ZodEnum<{
            test: "test";
            lint: "lint";
            build: "build";
            typecheck: "typecheck";
            audit: "audit";
            "security-scan": "security-scan";
        }>;
        atom: z.ZodString;
        status: z.ZodEnum<{
            skipped: "skipped";
            failed: "failed";
            passed: "passed";
            unresolved: "unresolved";
        }>;
        lastVerifiedAt: z.ZodISODateTime;
        resolvedCommand: z.ZodOptional<z.ZodString>;
        resolvedSource: z.ZodOptional<z.ZodEnum<{
            "project-context": "project-context";
            "language-default": "language-default";
            "legacy-alias": "legacy-alias";
        }>>;
    }, z.core.$strip>>;
    platformMatrix: z.ZodArray<z.ZodObject<{
        platform: z.ZodEnum<{
            any: "any";
            "linux-x64": "linux-x64";
            "linux-arm64": "linux-arm64";
            "macos-x64": "macos-x64";
            "macos-arm64": "macos-arm64";
            "windows-x64": "windows-x64";
        }>;
        publisher: z.ZodEnum<{
            binary: "binary";
            cargo: "cargo";
            npm: "npm";
            docker: "docker";
            pypi: "pypi";
            "github-release": "github-release";
        }>;
        package: z.ZodString;
        smoke: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
    }, z.core.$strip>>;
    preflightSummary: z.ZodObject<{
        esbuildExternalsDrift: z.ZodBoolean;
        lockfileDrift: z.ZodBoolean;
        epicCompletenessClean: z.ZodBoolean;
        doubleListingClean: z.ZodBoolean;
        preflightWarnings: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
    }, z.core.$strip>;
    workflowRunUrl: z.ZodNullable<z.ZodString>;
    prUrl: z.ZodNullable<z.ZodString>;
    mergeCommitSha: z.ZodNullable<z.ZodString>;
    status: z.ZodEnum<{
        failed: "failed";
        cancelled: "cancelled";
        planned: "planned";
        reconciled: "reconciled";
        "pr-opened": "pr-opened";
        "pr-merged": "pr-merged";
        published: "published";
        rolled_back: "rolled_back";
    }>;
    meta: z.ZodOptional<z.ZodObject<{
        firstEverRelease: z.ZodOptional<z.ZodBoolean>;
        unresolvedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
        archetype: z.ZodOptional<z.ZodString>;
    }, z.core.$catchall<z.ZodUnknown>>>;
}, z.core.$strip>;
/** Inferred type for {@link ReleaseChannelSchema}. */
export type ReleaseChannel = z.infer<typeof ReleaseChannelSchema>;
/** Inferred type for {@link ReleaseSchemeSchema}. */
export type ReleaseScheme = z.infer<typeof ReleaseSchemeSchema>;
/** Inferred type for {@link ReleaseKindSchema}. */
export type ReleaseKind = z.infer<typeof ReleaseKindSchema>;
/** Inferred type for {@link ReleaseStatusSchema}. */
export type ReleaseStatus = z.infer<typeof ReleaseStatusSchema>;
/** Inferred type for {@link GateStatusSchema}. */
export type GateStatus = z.infer<typeof GateStatusSchema>;
/** Inferred type for {@link GateNameSchema}. */
export type GateName = z.infer<typeof GateNameSchema>;
/** Inferred type for {@link PlatformTupleSchema}. */
export type PlatformTuple = z.infer<typeof PlatformTupleSchema>;
/** Inferred type for {@link PublisherSchema}. */
export type Publisher = z.infer<typeof PublisherSchema>;
/** Inferred type for {@link TaskKindSchema}. */
export type TaskKind = z.infer<typeof TaskKindSchema>;
/** Inferred type for {@link ImpactSchema}. */
export type Impact = z.infer<typeof ImpactSchema>;
/** Inferred type for {@link ResolvedSourceSchema}. */
export type ResolvedSource = z.infer<typeof ResolvedSourceSchema>;
/** Inferred type for {@link ReleasePlanTaskSchema}. */
export type ReleasePlanTask = z.infer<typeof ReleasePlanTaskSchema>;
/** Inferred type for {@link ReleaseGateSchema}. */
export type ReleaseGate = z.infer<typeof ReleaseGateSchema>;
/** Inferred type for {@link ReleasePlatformMatrixEntrySchema}. */
export type ReleasePlatformMatrixEntry = z.infer<typeof ReleasePlatformMatrixEntrySchema>;
/** Inferred type for {@link ReleasePreflightSummarySchema}. */
export type ReleasePreflightSummary = z.infer<typeof ReleasePreflightSummarySchema>;
/** Inferred type for {@link ReleasePlanChangelogSchema}. */
export type ReleasePlanChangelog = z.infer<typeof ReleasePlanChangelogSchema>;
/** Inferred type for {@link ReleasePlanMetaSchema}. */
export type ReleasePlanMeta = z.infer<typeof ReleasePlanMetaSchema>;
/** Inferred type for the entire {@link ReleasePlanSchema} envelope. */
export type ReleasePlan = z.infer<typeof ReleasePlanSchema>;
/**
 * Parse and validate a raw JSON value as a {@link ReleasePlan}.
 *
 * Throws `ZodError` on any structural mismatch with detailed `.issues[]`
 * pinpointing every offending field path. Callers SHOULD surface those issues
 * via the LAFS `error.details` field for operator triage.
 *
 * Use {@link safeParseReleasePlan} if you prefer the non-throwing variant.
 *
 * @param input — Untyped value loaded from disk / wire / database.
 * @returns The validated, fully-typed plan object.
 * @throws ZodError when validation fails.
 *
 * @example
 * ```ts
 * import { readFileSync } from 'node:fs';
 * import { parseReleasePlan } from '@cleocode/contracts';
 *
 * const raw = JSON.parse(readFileSync('.cleo/release/v2026.6.0.plan.json', 'utf8'));
 * const plan = parseReleasePlan(raw);
 * console.log(plan.status); // type-narrowed to ReleaseStatus
 * ```
 */
export declare function parseReleasePlan(input: unknown): ReleasePlan;
/**
 * Safe variant of {@link parseReleasePlan} that returns a discriminated-union
 * result instead of throwing. Useful when validating user-supplied or
 * persisted plans where structured error reporting is required.
 *
 * @param input — Untyped value to validate.
 * @returns Zod safe-parse result.
 */
export declare function safeParseReleasePlan(input: unknown): ReturnType<typeof ReleasePlanSchema.safeParse>;
//# sourceMappingURL=plan.d.ts.map