| index 6d5fe8efd..f528c4a0c 100644 |
| --- a/docs/superpowers/plans/2026-10-25-claims-cleanup-r0.md |
| +++ b/docs/superpowers/plans/2026-10-25-claims-cleanup-r0.md |
| @@ -1,6 +1,6 @@ |
| # Claims cleanup R0: census removal plumbing |
| |
| -> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. |
| +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [x]`) syntax for tracking. |
| |
| **Goal:** A deleted unit, frozen declaration or package directory passes the census with an overlay `make census-propose` writes and a reviewer's approval; changed and new reads still fail. |
| |
| @@ -35,9 +35,9 @@ |
| **Interfaces:** |
| - Produces: `rootReadScan.Dirs map[string]bool` (every walked directory, slash-relative, "." for the root); `rootReadInventory.Retired map[string]bool`; directive `@coverage<TAB><dir><TAB>-` (delta only; refused for an envelope not pinned); compare error `retired root source envelope still present <dir>` when `Dirs == nil || Dirs[dir]`. |
| |
| -- [ ] Test `TestPlan14RetiredEnvelope`: an overlay `@coverage internal/gone -` loaded on an inventory pinning `internal/gone` leaves no discrepancy for a scan without that directory; the same scan with `Dirs["internal/gone"]` fails with "retired root source envelope still present"; the directive in a base file, or for an unpinned directory, fails to load; a later `@coverage internal/gone <hash>` clears the retirement. |
| -- [ ] Run it, see it fail; implement; run it, see it pass. |
| -- [ ] Commit; advance the amadan task. |
| +- [x] Test `TestPlan14RetiredEnvelope`: an overlay `@coverage internal/gone -` loaded on an inventory pinning `internal/gone` leaves no discrepancy for a scan without that directory; the same scan with `Dirs["internal/gone"]` fails with "retired root source envelope still present"; the directive in a base file, or for an unpinned directory, fails to load; a later `@coverage internal/gone <hash>` clears the retirement. |
| +- [x] Run it, see it fail; implement; run it, see it pass. |
| +- [x] Commit; advance the amadan task. |
| |
| ### Task 2: `removed` as an approval in census-propose |
| |
| @@ -45,12 +45,12 @@ |
| |
| **Interfaces:** |
| - Consumes: Task 1's `Dirs`, `Retired`, the `-` directive. |
| -- Produces: class `censusQuiet = "quiet"` (a decision); `censusRemoved` approvable; `censusChange.Absent`; `rootReadAbsentRemoval(removal string) bool`, true for a removal whose basis is `census-ruling-<name>;absent;...`; such a removal fails while the declaration exists, unlike the H3 retire rule. |
| +- Produces: class `censusQuiet = "quiet"` (a decision); `censusRemoved` approvable, used only when the scan proves the unit or directory absent; `rootReadAbsentRemoval(removal string) bool`, true for a removal whose basis is `census-ruling-<name>;absent;...`; such a removal fails while the declaration exists, unlike the H3 retire rule. |
| - Overlay rows for a removed unit: `@remove<TAB>file<TAB>unit` when classified; for a frozen unit not already removed, `@removed<TAB>file<TAB>unit<TAB><owner><TAB>census-ruling-<NAME>;absent;basis=<claim or "deleted: declaration and sites absent from the tree">`, owner the row's task when it is a kept family, else `H3`. A retired directory: `@coverage<TAB>dir<TAB>-`. Claims for removed units are optional. |
| |
| -- [ ] Tests: `TestCensusClassifiesARemovedUnit` keeps `removed` and now also wants `Absent`; `TestCensusClassifiesAQuietUnit` (declared, no reads: `quiet`); `TestCensusProposalRetiresADeletedPackage` (fixture deletes a legacy frozen unit, an authority unit and their directory: the overlay loads, leaves the census clean, keeps the seal, and the card lists both units, their dispositions and the retired envelope); `TestCensusProposalRefusesADeletionWithAChangedRead` (same deletion plus a `reads` change or a new unit elsewhere: refused as a decision); `TestCensusAbsentRemovalNeedsAbsence` (after the generated overlay, the unit's declaration back without reads fails; back with reads fails; the directory back fails). |
| -- [ ] Run, see them fail; implement; run, see them pass, with the existing census-propose tests. |
| -- [ ] Commit; advance the amadan task. |
| +- [x] Tests: `TestCensusClassifiesARemovedUnit` keeps `removed` and now also wants `Absent`; `TestCensusClassifiesAQuietUnit` (declared, no reads: `quiet`); `TestCensusProposalRetiresADeletedPackage` (fixture deletes a legacy frozen unit, an authority unit and their directory: the overlay loads, leaves the census clean, keeps the seal, and the card lists both units, their dispositions and the retired envelope); `TestCensusProposalRefusesADeletionWithAChangedRead` (same deletion plus a `reads` change or a new unit elsewhere: refused as a decision); `TestCensusAbsentRemovalNeedsAbsence` (after the generated overlay, the unit's declaration back without reads fails; back with reads fails; the directory back fails). |
| +- [x] Run, see them fail; implement; run, see them pass, with the existing census-propose tests. |
| +- [x] Commit; advance the amadan task. |
| |
| ### Task 3: J4 retires a family's rows with its witnesses |
| |
| @@ -59,14 +59,16 @@ |
| **Interfaces:** |
| - Produces: `inputRetired(inv, full rootReadInventory, declared map[string]bool, key string) bool`: true when the full chain no longer carries the row and the tree declares no such unit. `TestPlan14RootInputInventoryCoverage` skips retired rows. `rootReadDeclared(root string) (map[string]bool, error)` names every declaration as the census does, without type-checking. |
| |
| -- [ ] Test `TestPlan14J4RetiresAFamily`: family A's every row retired and its witnesses gone: no failure; one surviving A row and a witness gone: fails "missing"; a surviving row with no production caller still fails; a row removed from the chain whose declaration is still in the tree is still checked. |
| -- [ ] Run, see it fail; implement; run it and the J4 coverage test. |
| -- [ ] Commit; advance the amadan task. |
| +- [x] Test `TestPlan14J4RetiresAFamily`: family A's every row retired and its witnesses gone: no failure; one surviving A row and a witness gone: fails "missing"; a surviving row with no production caller still fails; a row removed from the chain whose declaration is still in the tree is still checked. |
| +- [x] Run, see it fail; implement; run it and the J4 coverage test. |
| +- [x] Commit; advance the amadan task. |
| |
| ### Task 4: AGENTS.md, the experiment, and the gate |
| |
| **Files:** Modify `AGENTS.md` ("The census"). |
| |
| -- [ ] Describe `removed` as an approval class, `quiet` as a decision, and the envelope retirement. |
| -- [ ] Experiment (not committed): delete `internal/sim/hostlife`, run census-propose with an empty CLAIMS file, run `TestPlan14RootReadCensus`, restore with `git checkout -- internal/sim/hostlife` plus removing the generated files by exact path, confirm `git status` is clean. |
| -- [ ] `go vet ./internal/provision/`, the census and census-propose tests, `GOOS=darwin` and `GOOS=windows go build ./...`; push; `amadan ci status carlos/platform -branch claims-cleanup-r0`. |
| +- [x] Describe `removed` as an approval class, `quiet` as a decision, and the envelope retirement. |
| +- [x] Experiment (not committed): delete `internal/sim/hostlife`, run census-propose with an empty CLAIMS file, run `TestPlan14RootReadCensus`, restore with `git checkout -- internal/sim/hostlife` plus removing the generated files by exact path, confirm `git status` is clean. |
| +Result (2026-10-25): deleting `internal/sim/hostlife` gave a card with one removed unit (`mutate.sh`, frozen legacy) and one retired envelope, and an overlay of `@remove`, `@removed` (absent) and `@coverage internal/sim/hostlife -` with the seal unchanged. `TestPlan14RootReadCensus` and J4 both passed on the deleted tree. Restored; `git status` clean. J4's new retired-exemption check caught the roster-binding exemption for the deleted `servingPriorRevision`, which the retirement rule now covers, so that exemption was removed. |
| + |
| +- [x] `go vet ./internal/provision/`, the census and census-propose tests, `GOOS=darwin` and `GOOS=windows go build ./...`; push; `amadan ci status carlos/platform -branch claims-cleanup-r0`. |