/** * Compliance pack drift migrations (compliance-packs/AC-52, AC-91, AC-100, AC-101; * doctor-deregisters-authored-layers/AC-1..AC-19). * * **Provenance is recorded, never inferred.** A pack registration is one carrying * `pack: `, stamped by the installer — the only code that knows which pack a layer * came from. It is emphatically *not* one carrying `always_pointer: true`. That flag is a * rendering instruction: `resolveGuidancePlaceholders` checks it before the * `INLINE_THRESHOLD_BYTES` comparison to force pointer delivery whatever the layer's * size. A pack layer must set it, so `pack ⇒ always_pointer` — and this file used to * assume the converse, which made every project-authored layer that chose pointer * delivery look like an orphaned pack registration. Doctor then reported it, exited 1 on * every run because no pack would ever claim it, and dropped the registration on `--yes` * — so the pressure ran toward the one action that stops the layer reaching agents. * * An entry with no `pack` key is project- or framework-authored and out of scope here. * Ambiguity resolves that way on purpose: a false positive silently stops delivering * guidance an agent was told to always read, while a false negative leaves a stale * pointer, which is visible and cheap to correct. * * Five conditions, and the differences between them matter more than the checks: * * **An index entry an installed pack's record owns but which carries no provenance** — * `safe`. Backfill for repos installed before provenance was recorded. It stamps only * what a record proves and leaves everything else exactly as it found it. * * **A config record whose layer file is present but unregistered** — `safe`. The remedy * re-registers the `index.yaml` entry and nothing else. Deliberately narrow: the obvious * wider remedy, "install the missing layers", would write the *bundled* body, so a * project whose recorded version is older than the shipped one would get its layers * silently replaced with newer content and new hashes recorded. That is a pack upgrade * performed by `aidlc doctor`, which pack policy forbids outright — pack content is what * a buyer is told governs them. * * **A config record whose layer file is missing, at a different version** — `report`. * Doctor states it and applies nothing, because the only fix is a decision: reinstall at * the recorded version, or upgrade. * * **A registered layer claiming a pack that is not installed** — `confirm`. The remedy * drops the `index.yaml` entry so the layer stops reaching agents, and never touches the * file. A layer on disk may be a project's edited copy, which is theirs. This keeps its * tier and its exit code: once provenance is explicit, a leftover pack pointer is not * cosmetic, it keeps feeding an uninstalled pack's constraints to every agent. * * **An installed layer whose unreviewed-draft notice has been edited out** — `report`. * There is no legitimate remedy: re-inserting the notice would write to a file the * framework has promised never to touch, and a no-op `apply` on a `confirm` migration * would leave doctor exiting 1 on every run, turning an edited-away disclaimer into a * permanently red health check. * * The two migrations that act on the *absence* of a record refuse to run at all when the * `compliance:` section is present but unparseable. `readComplianceConfig` degrades such * a section to "no packs installed" so unrelated commands keep working — correct for * every consumer that asks what governs the project, and lethal for one that concludes a * pack is uninstalled and deregisters its layer. `complianceSectionState` is the * distinction. * * No migration here deletes a guidance layer file, under any tier or with `--yes`. */ import type { Migration } from '../types.js'; /** * Backfill `pack: ` onto registrations an installed record proves a pack owns. * * Safe because it adds a provenance key and nothing else: no layer body is written, no * registration is dropped, and no entry the records cannot vouch for is touched. Repos * installed before provenance existed converge on the first run and stay quiet after. * * It cannot enable a deregistration, and that is worth stating because the opposite reads * as obvious: this stamps entries an installed record *owns*, while the drop check selects * entries no installed record owns. The two predicates are complementary, so the registry * order between them changes nothing (AC-20). * * The accepted cost: a registration left by a pre-provenance install whose record is * *already* gone gets no stamp — nothing can prove which pack it came from — so the drop * check will never see it either. That stale pointer is knowingly undetected (AC-21). It * is the right side of the trade, because the alternative is guessing provenance from * `always_pointer` again, and a wrong guess silently stops delivering a layer an agent was * told to always read. */ export declare const compliancePackProvenance: Migration; /** * A config record naming a layer that is present on disk but not registered. * * Safe because the remedy adds an index entry and writes no layer body. */ export declare const compliancePackUnregistered: Migration; /** * A config record whose layer file is gone, where the shipped version differs. * * Report tier: the fix is a decision — reinstall at the recorded version, or take the * newer one — and doctor may not make it silently. */ export declare const compliancePackMissingLayer: Migration; /** * A registered layer whose recorded provenance names a pack that is not installed. * * Confirm tier. The remedy drops the registration only; the file stays, because it may * be a project's edited copy. */ export declare const complianceLayerUnowned: Migration; /** * An installed pack layer whose unreviewed-draft notice is gone. * * Report tier, and the clearest case for that tier existing. Re-inserting the notice * would write to a file the framework has promised never to touch; a no-op apply on a * confirm-tier migration would leave the check pending forever and doctor exiting 1 on * every run, which turns a missing disclaimer into a permanently red health check * nobody can clear. */ export declare const complianceNoticeMissing: Migration; //# sourceMappingURL=compliance-pack-drift.d.ts.map