carlos / platform Public

census: db-region-forward-2 after Astra round 1 (readDBReadBody, BumpSerial, envelopes, seal 087098a2)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev a7dca8364c962b7863af172fca8dd5a141f7c160 parent 803e722
4 files changed, +17 −9
  • docs/superpowers/notes/census-proposal-db-region-forward-2.md +5 −4
  • internal/provision/db_region_forward_2_census_test.go +4 −1
  • internal/provision/plan14_root_reads_test.go +3 −2
  • internal/provision/testdata/plan14-root-reads-db-region-forward-2.tsv +5 −2

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/notes/census-proposal-db-region-forward-2.md b/docs/superpowers/notes/census-proposal-db-region-forward-2.md
index 6fb2edfe3..403531122 100644
--- a/docs/superpowers/notes/census-proposal-db-region-forward-2.md
+++ b/docs/superpowers/notes/census-proposal-db-region-forward-2.md
@@ -40,17 +40,18 @@ stale. Plan 1's census found the same (its ruling R8).
| unit | change | executing identity | proposed disposition |
|---|---|---|---|
| `dbforward.go` `dbQueryForward` | new: reads at most 64 KiB of a refused reads-route answer (`io.ReadAll` over the HTTP response body, not a file) to print the console's sentence | the CLI | legacy, accepted-legacy, J4 (`basis=root-input`, main's footing for `db.go`'s units) |
+| `internal/console/apidbforward.go` `readDBReadBody` | new (Astra round 1, P1): reads the request body to EOF, at most 264 KiB (`io.ReadAll` over `http.MaxBytesReader`, not a file), under the admission read deadline, then requires exactly one JSON value | the console | legacy, accepted-legacy, J4 (`root-input`, as main's console request-body reads) |
| `cmd/console/main.go` `serve` | changed: parses `CARLOS_DB_FORWARD` into `Config.DBForward`; builds its `http.Server` with `console.NewHTTPServer` (the same two timeouts). The same three `/data` literals at the same offsets | the console | re-frozen at main's disposition (`PROPOSED-scan-demand-revival`, `PROPOSED-email-signin`) with this change appended |
| `internal/console/server.go` `NewServer` | changed: sets the forwarded read's open-read limits (`dbReads`) and timing (`dbf`); no goroutine, no store call. The one data-literal is the logs/data route pattern, moved | the console | re-frozen at main's disposition with this change appended |
| `internal/dbdoor/client.go` `doorError` | changed: decodes the forward marker's three additive fields beside `error`, from the same bounded 64 KiB read | the CLI | re-frozen at main's `J4` `root-input` with this change appended |
| `infra/modules/deployment-buckets/main.tf` `external` | changed: the two `db-reads/` lifecycle rules beside `geoip-noncurrent` | an external unit (OpenTofu, applied only on Paul's approval of `docs/superpowers/notes/db-reads-lifecycle-approval.md`) | re-frozen at main's `J4` `root-input` with this change appended |
Envelopes re-pinned: `.`, `cmd/console`, `infra/modules/deployment-buckets`,
-`internal/console`, `internal/dbdoor`, `internal/dbreads`.
+`internal/console`, `internal/dbdoor`, `internal/dbreads`, `internal/release`.
Seal: `fc73854854f9e75d122ebd0eacf330d126201aa9d5c4295c634cc1c204a9168d`
(db-region-forward-1, checked first) to
-`ca596f96df517344fdc64b5833d2476f1ed9b553ea48f51f46d699fb4d33b1a4`.
+`087098a2da6f8c965fe386f5bb3fb73008ddfe8219726c813f7d56bd151fabfd` (after Astra round 1).
## Record writes (9B8)
@@ -59,11 +60,11 @@ Seal: `fc73854854f9e75d122ebd0eacf330d126201aa9d5c4295c634cc1c204a9168d`
| `internal/console/authcli.go` `Server.registerCLIRoutes` | key-site, re-digested | one more route line: the reads route |
| `internal/console/server.go` `NewServer` | key-site, re-digested | the read limits and timing set beside the db door's |
| `internal/console/apidbforward.go` `Server.admitDBRead` | nonrecord, new | `request.json` and the queue entry: conditional creates under `db-reads/` in the deployment bucket |
+| `internal/release/serial.go` `BumpSerial` | nonrecord, re-digested | checks its context before every write of `control/serial`, retries included (Astra round 1, P2) |
| `internal/console/apidbforward.go` `Server.cancelDBRead` | nonrecord, new | `cancel`: a conditional create under `db-reads/` |
No record writer is added and there is no `Delete` site. The serial bump in
-`announceDBRead` goes through `release.BumpSerial`, which the census already
-classifies.
+`announceDBRead` goes through `release.BumpSerial`.
## Claim routes
diff --git a/internal/provision/db_region_forward_2_census_test.go b/internal/provision/db_region_forward_2_census_test.go
index 631db8860..b30aeeb28 100644
--- a/internal/provision/db_region_forward_2_census_test.go
+++ b/internal/provision/db_region_forward_2_census_test.go
@@ -14,7 +14,10 @@ func dbRegionForward2WriteCensusInventory() []censusEntry {
replacements := []censusEntry{
{"internal/console/authcli.go", "Server.registerCLIRoutes", "key-site", "lit:instances,lit:sidecars", "35d3200c17e185d556104b3e2662f3ceea3c862b0b4baeeb9c40753db63a7a2e"},
{"internal/console/server.go", "NewServer", "key-site", "lit:instances", "7493342296b6dfa6bc6d2e68e3789fad49e400dbb32a012cee09e215089aa473"},
- {"internal/console/apidbforward.go", "Server.admitDBRead", "nonrecord", "sel:Put", "27cbe008957792627127820cb496cf939c3d546661dd90eed8141653fb185a45"},
+ {"internal/console/apidbforward.go", "Server.admitDBRead", "nonrecord", "sel:Put", "88e0c06d0210f123d1201642919ac29487053fe1b5225b9e6f65da528b12389c"},
+ // BumpSerial checks its context before every write (Astra round 1, P2);
+ // still a nonrecord Put of control/serial.
+ {"internal/release/serial.go", "BumpSerial", "nonrecord", "sel:Put", "3a85292a5c882fa0d5c10cda06bcef916d033f8adc07db36c6f29bedaed54e72"},
{"internal/console/apidbforward.go", "Server.cancelDBRead", "nonrecord", "sel:Put", "6d98027ee782321cfbc7cb2c45cf856b959b2c4cd27d95dfbb8a5753fdfbd3a8"},
}
for _, r := range replacements {
diff --git a/internal/provision/plan14_root_reads_test.go b/internal/provision/plan14_root_reads_test.go
index 2a0cbb1d0..5305e3958 100644
--- a/internal/provision/plan14_root_reads_test.go
+++ b/internal/provision/plan14_root_reads_test.go
@@ -1348,7 +1348,8 @@ func TestPlan14RootReadCensus(t *testing.T) {
// census owner on #280
// (docs/superpowers/notes/census-proposal-db-region-forward-2.md). The
// CLI's read of a refused reads-route answer (dbforward.go
- // dbQueryForward) is accepted legacy at J4 as main's db.go units are;
+ // dbQueryForward) and the console's read of the request body to EOF
+ // (readDBReadBody) are accepted legacy at J4 as main's units are;
// cmd/console serve, NewServer, dbdoor doorError and the
// deployment-buckets module are re-frozen at main's disposition with
// this branch's change appended. Frozen declarations change, so the
@@ -1359,7 +1360,7 @@ func TestPlan14RootReadCensus(t *testing.T) {
if err = loadRootReadInventory(filepath.Join(root, "internal/provision/testdata/plan14-root-reads-db-region-forward-2.tsv"), &inv, true); err != nil {
t.Fatal(err)
}
- seal = "ca596f96df517344fdc64b5833d2476f1ed9b553ea48f51f46d699fb4d33b1a4"
+ seal = "087098a2da6f8c965fe386f5bb3fb73008ddfe8219726c813f7d56bd151fabfd"
errs := append(compareRootReads(got, inv), checkRootReadLegacy(inv, seal)...)
errs = append(errs, checkRootReadDeclarations(got, inv)...)
if len(errs) > 0 {
diff --git a/internal/provision/testdata/plan14-root-reads-db-region-forward-2.tsv b/internal/provision/testdata/plan14-root-reads-db-region-forward-2.tsv
index 1ac427a1c..f8ad03013 100644
--- a/internal/provision/testdata/plan14-root-reads-db-region-forward-2.tsv
+++ b/internal/provision/testdata/plan14-root-reads-db-region-forward-2.tsv
@@ -1,5 +1,5 @@
# Census overlay db-region-forward-2 (db region forward plan 2: the console and CLI for carlos db query and query --at; spec docs/superpowers/specs/2026-10-22-db-region-forward-design.md rev 6, §13), loaded LAST in TestPlan14RootReadCensus, after db-region-forward-1, the overlay main loads last at 13e2f75f. Every row carries rev3=PROPOSED-db-region-forward-2; the ruling is asked of the census owner on #280 (docs/superpowers/notes/census-proposal-db-region-forward-2.md).
-# The scanner names one new read (dbforward.go dbQueryForward, the CLI reading a refused reads-route answer) and four changed legacy units (cmd/console serve, NewServer, dbdoor doorError, the deployment-buckets module). None of the reads route's own units (handleAPIDBRead, admitDBRead, streamDBRead, the line writer, dbfCall, readDBResult, cancelDBRead, announceDBRead, dbResidency, dbForwardEvidence, NewHTTPServer) is named by the scanner, so they have no rows: an inventory row with no scanned read is stale. The changed units are re-frozen at main's disposition with this branch's change appended. Frozen declarations change, so the seal moves; db-region-forward-1's is checked first.
+# The scanner names two new reads (dbforward.go dbQueryForward, the CLI reading a refused reads-route answer; apidbforward.go readDBReadBody, the console reading the request body to EOF, Astra round 1 P1) and four changed legacy units (cmd/console serve, NewServer, dbdoor doorError, the deployment-buckets module). None of the reads route's own units (handleAPIDBRead, admitDBRead, streamDBRead, the line writer, dbfCall, readDBResult, cancelDBRead, announceDBRead, dbResidency, dbForwardEvidence, NewHTTPServer) is named by the scanner, so they have no rows: an inventory row with no scanned read is stale. The changed units are re-frozen at main's disposition with this branch's change appended. Frozen declarations change, so the seal moves; db-region-forward-1's is checked first.
@legacy d3ce97034a9a2ad5746d1a3cf8b4c4e2f1603b70708f9f8167d1350f58440c92 dbforward.go dbQueryForward legacy accepted-legacy accepted-legacy;rev3=PROPOSED-db-region-forward-2;basis=root-input (J4, as main's db.go units); the carlos CLI on a person's machine, as the person (no box unit): new, reads at most 64 KiB of a refused reads-route answer from the console (io.ReadAll over the HTTP response body, not a file) to print the console's own sentence; decides nothing for root file:ReadAll@1371 f91b8efa4589dda452e7f0afd24ae36ede82d6ca1c2f538d04ae286dd9785f9c
dbforward.go dbQueryForward legacy accepted-legacy accepted-legacy;rev3=PROPOSED-db-region-forward-2;basis=root-input (J4, as main's db.go units); the carlos CLI on a person's machine, as the person (no box unit): new, reads at most 64 KiB of a refused reads-route answer from the console (io.ReadAll over the HTTP response body, not a file) to print the console's own sentence; decides nothing for root file:ReadAll@1371 f91b8efa4589dda452e7f0afd24ae36ede82d6ca1c2f538d04ae286dd9785f9c
@legacy 67879a5435dacee9d32e08607fe3c2c6b8be9fa2f81132bf66a3876ab1cdcfee cmd/console/main.go serve legacy accepted-legacy accepted-legacy;rev3=PROPOSED-scan-demand-revival;basis=Console service wires the optional callback signer and starts the claim-guarded queue worker. The same three data path literals move; it does not add a privileged reader.;rev3=PROPOSED-email-signin;identity=the console (cmd/console serve under console.service, user carlos-console);basis=passes CARLOS_CONSOLE_NAME to NewServer as Config.ConsoleName, the name the console's emails use; the same three /data literals at the same offsets; no read added;rev3=PROPOSED-db-region-forward-2;identity=the console (cmd/console serve under console.service, user carlos-console);basis=parses CARLOS_DB_FORWARD (dbForward) into Config.DBForward and builds its http.Server with console.NewHTTPServer, the same two timeouts; the same three /data literals at the same offsets; no read added data-literal@4077,data-literal@5178,data-literal@5415 e2c7a3f4e5f6ca220f61c243c48da683ae6ef32dfe46346963e6531510d02f84
@@ -10,9 +10,12 @@ internal/console/server.go NewServer legacy accepted-legacy accepted-legacy;rev3
internal/dbdoor/client.go doorError legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=PROPOSED-db-region-forward-2;identity=the carlos CLI on a person's machine, as the person;basis=decodes the db region forward marker's three additive fields (forward, region, forward_ops) beside error, from the same bounded 64 KiB read of a refusal body; no read added file:ReadAll@54 ece2358548f5a71233da653f300a0fe02259ba8e6ee8ece13817c9c9de40311a
@legacy a0a9258029ec2d96a4fdbc7d6b5b301fb268186ddb528cd882463e4342aa2fbf infra/modules/deployment-buckets/main.tf external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=PROPOSED-db-region-forward-2;basis=the db-reads/ lifecycle rules (db region forward spec §5.7, J4): two rules beside geoip-noncurrent on the deployment bucket's lifecycle configuration, prepared and not applied until Paul approves docs/superpowers/notes/db-reads-lifecycle-approval.md; no read, no IAM change file:external@0 a37eced3f29fd23ca8a98192bc1b0cf03cfec3506bd24b7e5a2361bd339fe66a
infra/modules/deployment-buckets/main.tf external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=PROPOSED-db-region-forward-2;basis=the db-reads/ lifecycle rules (db region forward spec §5.7, J4): two rules beside geoip-noncurrent on the deployment bucket's lifecycle configuration, prepared and not applied until Paul approves docs/superpowers/notes/db-reads-lifecycle-approval.md; no read, no IAM change file:external@0 a37eced3f29fd23ca8a98192bc1b0cf03cfec3506bd24b7e5a2361bd339fe66a
+@legacy ef0662b8eec7f53ccbb367ef9718b193aca8e69336742cdb3989f95d8deb45ea internal/console/apidbforward.go readDBReadBody legacy accepted-legacy accepted-legacy;rev3=PROPOSED-db-region-forward-2;basis=root-input (J4, as main's console request-body reads); the console (cmd/console serve under console.service, user carlos-console): new (Astra round 1, P1), reads one forwarded-read request body to EOF, at most 264 KiB (io.ReadAll over http.MaxBytesReader, not a file), under the admission read deadline, then requires exactly one JSON value; decides nothing for root file:ReadAll@352 f8bd84a1b06f080ae412014479fa179e5a412c873d07a61b8f693ea410fc5653
+internal/console/apidbforward.go readDBReadBody legacy accepted-legacy accepted-legacy;rev3=PROPOSED-db-region-forward-2;basis=root-input (J4, as main's console request-body reads); the console (cmd/console serve under console.service, user carlos-console): new (Astra round 1, P1), reads one forwarded-read request body to EOF, at most 264 KiB (io.ReadAll over http.MaxBytesReader, not a file), under the admission read deadline, then requires exactly one JSON value; decides nothing for root file:ReadAll@352 f8bd84a1b06f080ae412014479fa179e5a412c873d07a61b8f693ea410fc5653
@coverage . c6984920eb0d780daa5b38c27d02687837712d889571317d0079a49518755220
@coverage cmd/console 1385008c7209c029e8bc8f965a61ccff409bd601b6ca7b371279a28de6354fa8
@coverage infra/modules/deployment-buckets 5bcd66547eff581fe8d7d6a1b828cb057ecc5aa2cbed728104bc1b0a5e88b8f8
-@coverage internal/console 03f2cec85ec8da130ddf0f2767aaa53268936f501fd282c002543d6dad562c35
+@coverage internal/console be825df84059edc8f5d78efae58f9d8200fd9b6dba208e02b0befa47ccda1cfe
@coverage internal/dbdoor 0a454a4ba2d1c49b6aa73ad2ecbfa63b31e2e5ae8f7e17705760392145fbce34
+@coverage internal/release a5d215eea88daa1b3e7304be5241c19dd24a7f2c20c72909bc333baac1f21f1f
@coverage internal/dbreads 90d668e0638c8e4e4d2345deb0204243d8a6e893c8b53d09d0ec0bc25d7d772d