/** * Archive-reason post-release invariant — first customer of the registry * defined in {@link ./registry}. * * The release-time `RegisteredInvariant` shape consumed below is the * executable counterpart of ADR-056 D5; the central metadata for this * invariant subsystem is catalogued in * `@cleocode/contracts/invariants/adr-056-release.ts` (T10339 — R5). * * Workflow (per ADR-056 D5 step 2): * 1. Read the tag annotation (`git tag -l --format='%(contents)'`) * and every commit between `..` (inclusive of ``). * 2. Extract every `T\d+` reference from subjects + bodies + tag annotation. * 3. For each task ID: * - If `status='pending'` AND verification gates have all passed: * stamp `status='done'`, `archive_reason='verified'`, * `release=''` in one transaction. * - If `status='pending'` AND verification is null/incomplete: * create a follow-up task `T-RECONCILE-FOLLOWUP--` linked * to the unreconciled task ID. * - Otherwise (already done / cancelled / not found): no-op. * 4. Append every mutation to `.cleo/audit/reconcile.jsonl`. * * Tombstone semantics: this invariant NEVER writes * `archive_reason='completed-unverified'`. The tombstone is reserved for * the T1408 backfill migration. We always stamp `verified` (clean reconcile) * or create a follow-up (unreconciled). See contracts SSoT * `packages/contracts/src/tasks/archive.ts`. * * @task T1411 * @epic T1407 * @adr ADR-056 D5 */ import { type ArchiveReasonValue } from '@cleocode/contracts'; /** Relative path within the project root for the reconcile audit log. */ export declare const RECONCILE_AUDIT_FILE = ".cleo/audit/reconcile.jsonl"; /** Stable invariant id surfaced in {@link InvariantResult.id}. */ export declare const ARCHIVE_REASON_INVARIANT_ID = "archive-reason"; /** Audit row appended to `reconcile.jsonl` for every mutation. */ export interface ReconcileAuditRow { /** ISO-8601 timestamp of the mutation. */ timestamp: string; /** Release tag being reconciled. */ tag: string; /** Task ID the mutation targeted. */ taskId: string; /** What was done — see {@link ReconcileAction}. */ action: ReconcileAction; /** Archive reason stamped (only present for `reconciled` action). */ reason?: ArchiveReasonValue; /** Free-text rationale (e.g. "verification gates passed"). */ note: string; /** Optional follow-up task id created for unreconciled cases. */ followUpTaskId?: string; } /** * The four mutation outcomes recorded in `.cleo/audit/reconcile.jsonl`. * * - `reconciled` — task stamped done + archive_reason=verified + release=. * - `followup-created` — follow-up `T-RECONCILE-FOLLOWUP-…` task created. * - `noop-already-closed` — task was already done / cancelled / archived. * - `noop-not-found` — task ID referenced in commits but not in the DB. */ export type ReconcileAction = 'reconciled' | 'followup-created' | 'noop-already-closed' | 'noop-not-found'; /** * Extract every unique `T` task ID from a corpus of text. * * Matches `T1411`, `T-1411` is intentionally NOT matched (the dash form is * reserved for follow-up tasks like `T-RECONCILE-FOLLOWUP-…`). Order is * preserved by first-occurrence so audit rows render predictably. */ export declare function extractTaskIds(text: string): string[]; /** * Register the archive-reason invariant. Called once on module load via * the side-effect import in `./index.ts`. */ export declare function registerArchiveReasonInvariant(): void; //# sourceMappingURL=archive-reason-invariant.d.ts.map