import type { ScannedSkill } from "./scanner.js"; /** * v0.5 §6.4 — analysis ledger YAML for `/.solosquad/analysis-ledger.yaml`. * * `pending_v0.6_redestination` is the bridge to v0.6 §2.2 receiver-side * automatic re-destination (read by `src/migrations/scripts/0.5.0-to-0.6.0.ts` * once that lands). v0.5 marks `role` + `domain` entries true on apply; the * v0.6 migrator scans for `true` items and moves them to their final homes * (`/agent-profile.yaml` and `/domain/` respectively). * * The dotted property name is preserved in the YAML serialization — TypeScript * can't model the literal identifier, so we treat the property via an indexed * access (`[PENDING_KEY]`) on a plain object shape. */ export declare const LEDGER_SCHEMA_VERSION = 1; export declare const LEDGER_REL_PATH: string; export declare const PENDING_KEY = "pending_v0.6_redestination"; export type ClassificationLabel = "role" | "workflow" | "codebase-fact" | "domain"; /** * Plain object — TypeScript can't declare a property literally named * `pending_v0.6_redestination` (the dot is not a valid identifier character), * so we use an index signature and require callers to read/write via * `PENDING_KEY`. The `boolean | string | null | undefined` value type covers * the flag plus the known siblings. */ export interface LedgerEntry { path: string; hash: string; classification: ClassificationLabel; confidence: number; destination: string; applied: boolean; ambiguous?: boolean; redestinated_at?: string | null; [extra: string]: string | number | boolean | null | undefined; } export interface WorkflowMatchRecord { template: string; cover_rate: number; no_match?: boolean; } export interface Ledger { version: number; analyzed: LedgerEntry[]; workflow_match?: WorkflowMatchRecord; model: { fingerprint: string; }; } export interface LedgerDiff { unchanged: LedgerEntry[]; modified: { entry: LedgerEntry; new_scan: ScannedSkill; }[]; new_files: ScannedSkill[]; removed: LedgerEntry[]; } export declare function emptyLedger(modelFingerprint?: string): Ledger; /** * Decide pending_v0.6_redestination based on classification — only role and * domain entries are subject to v0.6 receiver-side re-destination. Codebase- * fact stays in the repo and workflow lives at `/workflows/` in both * versions. */ export declare function pendingV06ForLabel(label: ClassificationLabel): boolean; export declare function makeEntry(scanned: ScannedSkill, classification: ClassificationLabel, confidence: number, destination: string, opts?: { ambiguous?: boolean; applied?: boolean; }): LedgerEntry; export declare function getPendingV06(entry: LedgerEntry): boolean; export declare function setPendingV06(entry: LedgerEntry, value: boolean): void; export declare function loadLedger(ledgerPath: string): Ledger | null; export declare function saveLedger(ledgerPath: string, ledger: Ledger): void; export declare function diffAgainstScan(ledger: Ledger | null, scanned: ScannedSkill[]): LedgerDiff; /** Compose a fresh ledger from old + diff + new classifications. */ export declare function mergeLedger(previous: Ledger | null, diff: LedgerDiff, freshEntries: LedgerEntry[], modelFingerprint: string, opts?: { prune_orphans?: boolean; }): Ledger;