carlos / platform Public

review: round 1 findings and scoped-check brief, small-fixes-1246-1248

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 96e2df1ce76811595c6d8c94c28a365d52682bfa parent 2209b04
2 files changed, +69 −0
  • docs/superpowers/reviews/CHECK-BRIEF-small-fixes-1246-1248-R1-fix.md +22 −0
  • docs/superpowers/reviews/FINDINGS-small-fixes-1246-1248-R1.md +47 −0

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/reviews/CHECK-BRIEF-small-fixes-1246-1248-R1-fix.md b/docs/superpowers/reviews/CHECK-BRIEF-small-fixes-1246-1248-R1-fix.md
new file mode 100644
index 000000000..95d43413d
--- /dev/null
+++ b/docs/superpowers/reviews/CHECK-BRIEF-small-fixes-1246-1248-R1-fix.md
@@ -0,0 +1,22 @@
+# Scoped check: small-fixes-1246-1248, after round 1 (not a review round)
+
+Repo carlos/platform, branch `small-fixes-1246-1248` (tip in the prompt).
+Round 1 (`docs/superpowers/reviews/FINDINGS-small-fixes-1246-1248-R1.md`) ended
+READY AFTER FIXES with two P2s. The fixes are commits 43b20c17 and 2209b04f.
+Scope: `git show 43b20c17 2209b04f` and the census card
+`docs/superpowers/notes/census-proposal-small-fixes-1246-1248.md`.
+
+Check:
+1. Each round-1 P2: resolved, partly, not.
+2. replicaPlacementWorker.run: the new "read route" and Incarnation
+ diagnostics change logging only? Retry timing, the Incarnation skip,
+ retirement, acquisition and completion rules unchanged? Can a log line
+ carry anything a tenant should not see in the journal?
+3. The stalled-upload test: does it enforce exitLingerBound on all four
+ cases, and is the 2 s tolerance sound on a loaded runner?
+4. Census verdicts for replicaPlacementWorker.run and the internal/host
+ envelope at this tip.
+
+Answer each: OK, or a finding with file:line, failure scenario and fix,
+marked P1 or P2. End with exactly one line: CHECK PASSED, or CHECK FAILED
+with the P1s. Do not edit files, spawn reviewers or run full suites.
diff --git a/docs/superpowers/reviews/FINDINGS-small-fixes-1246-1248-R1.md b/docs/superpowers/reviews/FINDINGS-small-fixes-1246-1248-R1.md
new file mode 100644
index 000000000..2aa2e6625
--- /dev/null
+++ b/docs/superpowers/reviews/FINDINGS-small-fixes-1246-1248-R1.md
@@ -0,0 +1,47 @@
+Reviewed `origin/main...9217723bbce3ef573136b0f90cb53bc80e1c06b5`, round 1 of 3. The brief names `31210ccb`; the requested tip adds only the brief.
+
+No P1 findings.
+
+1. **P2 — Registry failures still leave placement retries silent.**
+ Evidence: [replicaplacement.go:120](/home/paulca/amadan.net/carlos/platform-small-fixes-1246-1248/internal/host/replicaplacement.go:120), with reporting gated at line 155.
+
+ If `reg.Get` fails, neither retirement nor acquisition runs, `failure` remains nil, and the worker advances its backoff without reporting why placement is stuck. Registry query and scan failures are real errors, distinct from an absent route.
+
+ **Fix:** capture this error as a named step and pass it through the existing throttled reporting path. Add a failing-registry test that checks the diagnostic and unchanged retry timing. The `Incarnation` error at lines 109–111 should also receive a suppressed diagnostic if encountered, while preserving its existing skip behavior.
+
+ **Fault family:** placement failures must remain diagnosable without producing a log on every tick.
+
+2. **P2 — The stalled-upload test does not enforce the promised linger bound.**
+ Evidence: [demo_api_duplex_test.go:397](/home/paulca/amadan.net/carlos/platform-small-fixes-1246-1248/internal/edge/demo_api_duplex_test.go:397).
+
+ The test sets a ten-second connection deadline and accepts any connection closure before it expires. Cleanup taking several seconds would pass despite the stated `exitLingerBound` of one second. It also covers only the local path with a declared content length; the backhaul matrix explicitly skips its handler-return cases.
+
+ **Fix:** measure closure after receiving the complete answer and assert `exitLingerBound` plus reasonable scheduling tolerance. Cover stalled chunked uploads and the backhaul path as well. Keep a separate, generous timeout for setup so runner load does not consume the cleanup allowance.
+
+ **Fault family:** early-answer cleanup must release stalled uploads within its stated bound.
+
+No P3 findings.
+
+The request-path fix is sound on inspection. [serveDemoAPIAlias](/home/paulca/amadan.net/carlos/platform-small-fixes-1246-1248/internal/edge/demo_api.go:122) installs tracking before both local and backhaul dispatch, including admission refusals. [WriteHeader](/home/paulca/amadan.net/carlos/platform-small-fixes-1246-1248/internal/edge/demo_api.go:303) adds `Connection: close` after header filtering whenever the HTTP/1 body remains incomplete.
+
+The deferred [finishEarlyAnswer](/home/paulca/amadan.net/carlos/platform-small-fixes-1246-1248/internal/edge/replay.go:179) drains through the underlying synchronized body reader before handler return. Combined with the close header, this prevents unfinished upload bytes from becoming another request. I found no remaining unsafe connection-reuse window on either path. The deadline bounds upload cleanup after response relay finishes; it does not bound the response relay itself.
+
+Fully consumed uploads retain keep-alive, and HTTP/2 bypasses the new tracking. Closing unread-body 503 and 429 responses is appropriate because those paths have already enabled full duplex. The earlier disallowed-path 404 remains outside full duplex.
+
+Placement completion conditions, retry arithmetic, and request deadlines remain unchanged. Reporting occurs outside both locks. One diagnostic during continuously changing `RecordSeq` values satisfies the specified once-per-backoff-step policy, although that step can remain open indefinitely.
+
+The incomplete-upload regression cases should fail against the old implementation through their missing-close assertion. The positive keep-alive and quiet-worker tests appropriately preserve behavior that already worked. The log tests use controlled timestamps and synchronized capture, reducing scheduling sensitivity.
+
+Validation was limited to source inspection and a clean `git diff --check`. The targeted test command stopped before execution because Go attempted to update `go.mod` in the read-only workspace. Network restrictions prevented reading amadan #1246 and #1248. No files were edited.
+
+Census verdicts for the reviewed tip:
+
+| Unit or envelope | Verdict and basis |
+|---|---|
+| `replicaPlacementWorker.run` | **APPROVE**, retaining `legacy / accepted-legacy`. Reviewed [replicaplacement.go:94](/home/paulca/amadan.net/carlos/platform-small-fixes-1246-1248/internal/host/replicaplacement.go:94) through line 175. Existing registry reads, retirement proof, acquisition gates, publication checks, and completion rules remain intact. No new authority or read source. |
+| `internal/host` envelope | **APPROVE.** The added bookkeeping in `replicaPlacementWork` and `observe` controls logging only. The changed worker and new test helpers introduce no production authority expansion. |
+| `internal/edge` envelope | **APPROVE.** The changed alias handler, response writer, and reached cleanup helpers constrain connection lifetime. Destination eligibility, authentication checks, request filtering, and response filtering remain intact. No new root-accessible path or authority. |
+
+These approvals apply to the current diff. The P2 fixes need the scoped census/request-path checks required by the stopping rules, without reopening the whole review. Approval has not been posted to #280.
+
+READY AFTER FIXES
\ No newline at end of file