carlos / platform Public

census: re-propose media-conversion after the ratchet fixes

census-propose NAME=media-conversion again: still no unit, now four
envelopes re-pinned (`.`, internal/clireg, internal/objstore,
internal/plans). The claims file records Task 12b's changes to `.` and
internal/clireg, with no new root read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 201b4952037627a25f7868e8fa216136cf49462b parent 87dfc8e
3 files changed, +19 −5
  • docs/superpowers/notes/census-claims-media-conversion.tsv +15 −2
  • docs/superpowers/notes/census-proposal-media-conversion.md +1 −1
  • internal/provision/testdata/plan14-root-reads-media-conversion.tsv +3 −2
diff --git a/docs/superpowers/notes/census-claims-media-conversion.tsv b/docs/superpowers/notes/census-claims-media-conversion.tsv
index 94cbb126e..a99a5f179 100644
--- a/docs/superpowers/notes/census-claims-media-conversion.tsv
+++ b/docs/superpowers/notes/census-claims-media-conversion.tsv
@@ -1,6 +1,6 @@
# Census claims for media conversion, plan 2 (console side), branch media-conversion. <file>:<unit> TAB <what changed>.
-# No census unit changes: make census-card lists no unit, only three envelopes re-pinned (`.`, internal/objstore,
-# internal/plans), which census-propose takes without a claim (a claim for an envelope is refused as "not a change
+# No census unit changes: make census-card lists no unit, only envelopes re-pinned (`.`, internal/objstore,
+# internal/plans, and since Task 12b internal/clireg), which census-propose takes without a claim (a claim for an envelope is refused as "not a change
# the census sees"). What changed in each, kept here for the reviewer. No new root read in any of them.
# internal/media, internal/mediajobs and internal/storecfg are new and outside the root binary (go list -deps . for
# linux amd64 and arm64 names none of them); only the console imports them.
@@ -34,3 +34,16 @@
# internal/plans catalog.go: Limits gains MediaMinutesMonth (json media_minutes_month, 0 is no limit), carried
# through validate (packs may add it), nonNegative, additive, Effective (a pack never turns no-limit into a limit),
# the ceilings clamp and generous. Pure arithmetic over the catalog already loaded; no I/O.
+#
+# Task 12b (code-health ratchet, no new root read in any of these):
+# `.` main.go: main has one os.Exit, at its end, for a nonzero code; runCommandLine walks the tree with
+# clireg.DispatchErr and maps a returned error through cliExitCode (commands.go): an errExit's code silently,
+# anything else log.Print and 1, the same output log.Fatal gave. Success returns from main as before, after the
+# update hint. Every recorded golden case keeps its exit code and output.
+# commands.go: rawErr (a leaf whose handler returns its error), errExit/exitCode, cliExitCode. Pure control flow.
+# media_cli.go, store_uploads.go: the media, store uploads and system media verbs return errors (and exitCode(1|2)
+# after printing usage, or for --wait on a failed job) instead of log.Fatal/os.Exit; the same messages and codes.
+# media_api.go (new): the uploads and media API client moved unchanged out of apimode.go and media_cli.go.
+# internal/clireg: DispatchErr (Dispatch returning an unhandled leaf error instead of panicking; Dispatch is
+# DispatchErr plus the same panic), Node.FallbackErr (a fallback whose error is routed like a leaf's), and
+# Validate's matching check. The walk and matching are unchanged. No I/O.
diff --git a/docs/superpowers/notes/census-proposal-media-conversion.md b/docs/superpowers/notes/census-proposal-media-conversion.md
index 393558ace..afa4c4fd3 100644
--- a/docs/superpowers/notes/census-proposal-media-conversion.md
+++ b/docs/superpowers/notes/census-proposal-media-conversion.md
@@ -2,7 +2,7 @@
Ruling `census-ruling-media-conversion`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
-Envelopes re-pinned: `.`, `internal/objstore`, `internal/plans`.
+Envelopes re-pinned: `.`, `internal/clireg`, `internal/objstore`, `internal/plans`.
Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject 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 box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
diff --git a/internal/provision/testdata/plan14-root-reads-media-conversion.tsv b/internal/provision/testdata/plan14-root-reads-media-conversion.tsv
index dc42b230b..425064099 100644
--- a/internal/provision/testdata/plan14-root-reads-media-conversion.tsv
+++ b/internal/provision/testdata/plan14-root-reads-media-conversion.tsv
@@ -1,5 +1,6 @@
# Census overlay media-conversion, written by census-propose (#369). census-ruling-media-conversion, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-media-conversion.md.
-# 0 body, 0 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-@coverage . faae2c5b05e4c81b12144525a0ac0d719f402b06185fa5e29a307c14bb8aa554
+# 0 body, 0 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@coverage . d1a773221c299e4930ba05635ca94e81e343d4f3971d5f2a58e8069864528c86
+@coverage internal/clireg 0dc017b7b3c547ef67b328decf65e613a8dc25f43e7d09f5e7144a73e5d325ba
@coverage internal/objstore c82dfa6f554b542bd88a8abd689eebf9c4a898035b3e5172c39f3ab4de09b359
@coverage internal/plans 9d8eda538aaee256421b22df37e64c434680c35df8414abbc1393aae870fe23f