carlos / platform Public

AGENTS.md: removed is an approval class; envelope retirement

The census section now lists removed among the approvals and quiet among
the decisions, says what census-propose writes for a deleted unit and a
deleted directory (@remove, an absent @removed, @coverage <dir> -), what
the reviewer checks for them, and J4's retirement rule. The card's
removal question points at the removed units' table. Plan: claims
cleanup R0, task 4 (the hostlife experiment's result is in the plan).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 4c85788e3c615506ce49b10b205f247ddf8d8e14 parent b125b77
3 files changed, +52 −20
  • AGENTS.md +35 −5
  • docs/superpowers/plans/2026-10-25-claims-cleanup-r0.md +16 −14
  • internal/provision/census_propose_test.go +1 −1

CI passed — run details

diff --git a/AGENTS.md b/AGENTS.md
index a57f05a58..ce0494a73 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -237,15 +237,30 @@ approved like this:
- `body`: the digest moved and the reads did not;
- `sites`: more or fewer reads of kinds the unit already makes;
- `envelope`: a package was re-pinned;
+ - `removed`: the scan finds neither the unit's declaration nor any of
+ its sites, or an envelope's directory is gone from the tree;
- `reads` (a kind of read the unit did not make before), `new`,
- `removed` or `other` (any census discrepancy none of these explains,
- shown with the census's own message): a decision.
+ `quiet` (a unit still declared that reads nothing now, or a directory
+ still there with no source the census scans) or `other` (any census
+ discrepancy none of these explains, shown with the census's own
+ message): a decision.
2. Write a CLAIMS file with one line per changed unit:
`<file>:<unit><TAB><what changed, and that no read was added or which one was>`.
+ A claim for a removed unit is optional. A branch that only deletes
+ code can pass an empty file.
3. `make census-propose NAME=<branch> CLAIMS=<file>` writes the rest:
- the overlay (`testdata/plan14-root-reads-<NAME>.tsv`), each unit
re-frozen at its existing disposition with the claim appended;
- - the `@legacy` fingerprints, the envelope re-pins and the new seal;
+ - for each removed unit, `@remove` for its row and, if its declaration
+ was frozen, `@removed` with the basis
+ `census-ruling-<NAME>;absent;basis=<claim>`. That removal holds only
+ while the declaration stays out of the tree, even one that reads
+ nothing;
+ - for each deleted directory, `@coverage <dir> -`, which retires its
+ envelope. The census fails while that directory exists, even if it
+ holds only tests;
+ - the `@legacy` fingerprints, the envelope re-pins and the new seal (a
+ deletion alone leaves the seal as it was);
- its line in `testdata/plan14-root-reads-chain.tsv`;
- the approval card, `docs/superpowers/notes/census-proposal-<NAME>.md`.
@@ -263,7 +278,10 @@ approved like this:
the card lists;
- an envelope means every changed function in that package and what
it reaches, since an envelope re-pin is how the census sees reads its
- scanner cannot attribute to a unit.
+ scanner cannot attribute to a unit;
+ - a removed unit or a retired envelope means confirming the code is
+ deleted, not moved, and that no check root relies on goes with it
+ unless its callers' changes on the card account for that.
It escalates if the change lets root open, run, query or follow
anything it did not before from a path or input a tenant, an app or a
@@ -280,7 +298,19 @@ read, not where a read points, so a `body` change can aim an existing
`Open` at a tenant-writable path. Someone other than the author has to
read the diff, but it need not be the owner.
-The tool refuses decisions (`reads`, `new`, `removed`, `other`): a new
+A deletion is an approval, not a decision (Paul, 2026-10-25, ruling 1 on
+#280): a deletion cannot add a read, and the scan, not the claim, proves
+the unit absent. Code that moved is not a deletion. A unit moved whole
+shows as `new`, and a read that moved shows as a change to the unit that
+took it. J4 (`TestPlan14RootInputInventoryCoverage`) follows the same
+rule. A row the chain has removed, for a unit the tree no longer
+declares, is retired. A family whose rows are all retired may lose its
+witness tests in the same change. While one row of the family survives,
+its witnesses stay. A surviving row with no production caller still
+fails, so a deleting branch removes the row or keeps the caller. An
+exemption for a retired unit fails until it is deleted with the unit.
+
+The tool refuses decisions (`reads`, `new`, `quiet`, `other`): a new
kind of read can make a unit's disposition wrong, so it is the owner's
call, not an approval. Write those rows by hand, following the overlays in the
chain, and ask on #280 with the card attached; the census owner decides
diff --git a/docs/superpowers/plans/2026-10-25-claims-cleanup-r0.md b/docs/superpowers/plans/2026-10-25-claims-cleanup-r0.md
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`.
diff --git a/internal/provision/census_propose_test.go b/internal/provision/census_propose_test.go
index 754eee1c8..320877512 100644
--- a/internal/provision/census_propose_test.go
+++ b/internal/provision/census_propose_test.go
@@ -474,7 +474,7 @@ const censusReviewQuestion = "Review: a model from the other family than the aut
// censusRemovalQuestion is what the reviewer answers for removed units and
// retired envelopes on a card: a deletion cannot add a read, but code can
// move, and a check root relied on can go with the code that held it.
-const censusRemovalQuestion = "For a removed unit or a retired envelope, confirm from the diff that the code is deleted and not moved: a read that moved shows on this card as a change to the unit that took it, and a unit moved whole shows as a new unit, a decision. Escalate if a check, refusal or validation that root relies on goes with the deleted code and its callers' changes on this card do not account for that.\n\n"
+const censusRemovalQuestion = "A removed unit's recorded disposition and basis are in its table above. For a removed unit or a retired envelope, confirm from the diff that the code is deleted and not moved: a read that moved shows on this card as a change to the unit that took it, and a unit moved whole shows as a new unit, a decision. Escalate if a check, refusal or validation that root relies on goes with the deleted code and its callers' changes on this card do not account for that.\n\n"
// censusAbsentMark follows the ruling in the basis of an @removed row
// census-propose writes: the declaration must stay out of the tree