Skip to content

Commit 1c7b1eb

Browse files
test(delivery): start-per-line proof per C25's own signal — every documented start line executes on its own child with its claims asserted on the wire
The first-start-per-document proof let the second and third lines ride CI unproven. Now each fence's start line spawns its own server, a pinned allowlist must admit the loopback it pins, and a documented limiter sizing is tri-pinned (prose ↔ line ↔ wire) because the wire leg alone is circular. The foreign-allowlist negative control refused to bite until the fences were dumped member by member [C35]: the tokenizer parsed comment apostrophes ("proxy's") as quote state and swallowed the NEXT line — the §hardening start line had been invisible to the harness since birth; comments are now quote-inert as in real bash, the measured set is pinned exactly (7), and losses and additions both fail by name. C25's STATUS records the closure. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent 060f1d2 commit 1c7b1eb

2 files changed

Lines changed: 131 additions & 5 deletions

File tree

‎AGENTS.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ New entries append chronologically and are never renumbered — a gap in the tag
114114
- [C23] **The allowlist is guard 0 — 403 must fire before the rate limiter, and a 200 from an unfiltered endpoint is the OTHER documented posture**: the address gate is checked before anything else, so a rejected peer never consumes rate-limit budget and never reaches `limiter.check` — a flood of disallowed addresses cannot grow the buckets map (the limiter's memory bound covers admitted peers only). The exemption split is deliberate and easy to "fix" wrongly: the limiter exempts `/health` (floods must never lock out liveness probes) but the allowlist does NOT — an unlisted address learns nothing, not even liveness; the two rules protect against different failures (lockout vs enumeration), so exempting `/health` from the allowlist "for consistency" would let any unlisted address confirm the service exists. Near-miss when probing the guard externally: a verifier shaped "fire the probe → expect 403" fails the honest DEFAULT endpoint — with no `allowAddresses` configured the gate is open and `/health` answers `200 OK`; **the absence of 403 is itself the documented contract, not a failure**. Proof shape that actually works: start a second endpoint pinned to a FOREIGN allowlist (`allowAddresses: ["198.51.100.9"]`) and probe it from an unlisted loopback address (the api-ref page's defense-code wire contract does exactly this), while the honest suites keep proving the unfiltered 200 posture; the page's 403 button spells out both postures so a visitor can never read a 200 as a bug.
115115
- [C24] **A factory awaited is still a factory — passing ENGINE_READY itself to callHandler answers HTTP 0, silently**: the boot prelude exposes ENGINE_READY as a FACTORY (an IIFE resolving to `() => mod.createDeliveryRequestHandler()`) so every scenario gets a fresh handler — fresh rate-limit budget, exactly like a fresh server process. The six table scenarios do it right (`const makeHandler = await ENGINE_READY; … callHandler(makeHandler(), …)`), but the peoples-court button did `const handler = await ENGINE_READY` and handed the factory itself to `callHandler`: invoking the factory "worked" (it returned a handler that was never actually driven against req/res), `res.statusCode` never left 0, no exception was thrown, and the catch block had nothing to catch — the visitor saw "HTTP 0" over an empty body. The tell is the signature: **statusCode 0 = the handler never ran** (distinct from every real wire code); anything handed to callHandler must already be `(factory)()`. Why it survived publication: the boot sequence exercises only the six SCENARIOS — runPc is never clicked during boot, the page contract was static-only, and nothing crashed. Locks now: the api-ref page contract asserts the fresh-handler shape at the /peoples-court call site and fails the misfire literal outright — and the general rule stands: a control only a human click reaches is untested until something clicks it (the `#run=` deep links now do).
116116
- [C25] **A documented start line is a wire claim — execute it verbatim on a live port before publishing**: a copy-ready `startDeliveryEndpoint` one-liner in a doc makes a falsifiable claim about real wire behavior; "it obviously works" is how a broken flag order or a port typo ships to every integrator. The doc-curl harness proves only the FIRST start line per document (it needs one live server and re-uses it) and explicitly FILTERS every further start command out of the fences it executes — so each additional copy-ready start line rides CI unproven, invisible to every reviewer. The discipline that closed it: before each of the two new documented lines shipped (the §integration `allowAddresses` line and the §production proxy-posture line), the exact string was executed on an ephemeral live port and its claimed observable was asserted — `200 VERIFIED` with the pinned dual-stack loopback answering, and `x-ratelimit-limit: 600` proving the backstop sizing took. Rule: every documented start one-liner is either (a) executed by the doc-curl contract as THE documented start, or (b) wire-proven verbatim in-session before the commit — and if a third line ever needs regular proving, that is the signal to extend the harness to start-per-line instead of trusting session discipline.
117+
118+
**STATUS (harness extended, 2026-09-30): the signal fired and the harness now proves EVERY documented start line** — each fence's own start line spawns its own child server (the previous child is killed first; no two lines ever share a process), and the line's claims are asserted on that child's wire: a pinned allowlist must admit the loopback it pins, and a documented limiter sizing reads back verbatim as `x-ratelimit-limit` through a **tri-pin (prose ↔ line ↔ wire)** — the wire leg alone is circular, because a corrupted documented line fabricates its own confirming server and the probe reads the corruption back as a match. An exact pin over the measured start-line set fails the push when a line is lost OR unproven, in either direction. The extension was itself caught by its own negative control: the foreign-allowlist mutation refused to bite, and dumping the fences member by member [C35] exposed the real third defect — the fence tokenizer parsed comment apostrophes ("proxy's") as quote state, swallowing the NEXT line, so the §hardening start line had been invisible to the whole harness since birth; comments are now quote-inert as in real bash.
117119
- [C26] **The Pages API has a registration gap — pin every settle to the SHA whose build must finish**: timing evidence (DDE Evidence Cycle 14–21 s; bot commits ~15–20 s after content pushes) showed the trend step's `pages-settle` check ran while the CONTENT commit's build was not yet registered in `/pages/builds/latest` — which still reported the PREVIOUS commit's terminal, aged build — so the guard authorized exactly the push that CANCELLED the content build. That is the recurring "bot race" (15+ autostash treatments; [C18]'s three layers never addressed the gap itself). The fix: `PAGES_SETTLE_SHA=<sha>` pins the settle — the guard settles ONLY when the latest build IS that commit's and is terminal+aged. State logic: (1) build absent + SHA on the remote branch (compare `behind`/`identical`) → registration gap → WAIT; (2) build absent + SHA NOT on the remote → pre-push semantics (the push has not landed; nothing alive to cancel) → settle; (3) latest build is a DIFFERENT commit → same two-way probe (pre-push settles immediately; bot side waits). Probe failure degrades conservatively to wait. Callers: `.githooks/pre-push` passes the NEW main tip from the ref line (all-zero/empty ⇒ unpinned legacy behavior — deletion is nothing to settle); the dde.yml trend step pins the CONTENT commit and defers the median without an autostash when the content build cannot settle. CAUTION learned in production: at the settle call site HEAD is STILL the content commit (the median commit is created only after settle succeeds) — pinning `HEAD~1` there silently re-opened the race for two cycles (the wrong SHA answered "not on branch" and short-circuited the guard) until the pages-build list exposed the returning cancelled pattern; verify the pinned identity from the actual ref state, never from an assumption about what HEAD means at that point in the script. Lesson twice over: a timing-derived "age" guard proves only that SOME build finished — identity, not age, is what a cancel races on; and the first settle design conflated the two sides of the wire (pre-push vs bot) until a test froze each side's semantics separately.
118120

119121
**STATUS (second recurrence, root-caused while monitoring two post-fix cycles, 2026-09-27): the fix shipped with a BLIND guard, and the race never actually closed.** `dde.yml` granted its token `contents: write` only, and the Pages builds API answers a bare **404** to a token without `pages: read` — which `readLatest` maps to `{none:true}` → the SHA pin never got a chance to wait for anything: every cycle settled `no-build-yet` at `waitedMs: 0` (both settle calls, printed verbatim in the DDE run log) and the median push landed blind ~15–19 s after the content push, killing its build. The observed signature CHANGED shape, which is why it hid: old world `cancelled` workflow runs + alternation; blind world green runs, medians recorded every cycle, and `errored` on every content SHA. **A settle that reports "no build yet" while the Pages API demonstrably holds builds means the token cannot SEE, not that the queue is empty — treat any `no-build-yet` at `waitedMs: 0` from a caller with settle stakes as blind-guard until the caller's token is proven to read the API.** Fix: `pages: read` in `dde.yml` + `test/ci/workflow-yaml-contract.test.js` fails any pages-settle caller lacking `pages: read` or leaving ANY settle call unpinned (negative-controlled: flipping the permission to `pages: none` and unpinning one call each turned the contract red, by name). The settle pipeline is now TWO HEAD-pinned calls (pre-commit wait + pre-push confirmation) — with restored sight, an UNPINNED first call would see the content build in flight and defer the median EVERY cycle (trend starvation, the mirror failure of the blind push). Whether the cancellation pattern is truly dead is a wire claim only post-fix cycles can prove — do not re-declare victory from the fix diff alone.

0 commit comments

Comments
 (0)