Skip to content

Commit ddfe501

Browse files
docs(boundary): Caddy and Traefik equivalents beside nginx — the same proxy posture in each front door's own syntax
Two new sibling sections under the production posture: Caddy (honest build choice spelled out — the standard build has no rate-limit module, so claiming per-client limits there is named as the degenerate shared-budget failure; reverse_proxy to the documented loopback bind, request_body max_size at the 1 MiB cap, ACME/internal/pinned TLS, XFF logging-only) and Traefik (full translation: rateLimit average 10 / burst 20 mirroring the nginx fence, buffering.maxRequestBodyBytes 1048576, entry-point TLS, the app's host/port never retyped). Each with its own "Never do" list. Zero executable fences added: the nginx-conf contract's single-fence pin, the 8-line start-line proof pin, and docs-node's executed set are byte-stable; doc-freshness anchors the new sections to the live socket and cap. Docs-only cycle: 1243/1243 unchanged, 861 files, docsNode 94·56·20. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent 8682560 commit ddfe501

2 files changed

Lines changed: 96 additions & 0 deletions

File tree

‎docs/STATUS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ machine-measured, not estimated. Last verified: **2026-09-26**.
9898
| **v0.5.26 (2026-09-27, this session)** | **A documented freeze gap that was not a gap: the recovery pointer existed, and nothing read it** — AGENTS.md carried a standing warning that deleting a doc pinned by an older freeze record makes that record "unverifiable for those entries", and flagged the whole thing as an open known gap. Both halves were wrong, and the second was wrong in the interesting direction: the two files `freeze-record-4.2.5.json` pins (`v4.2.5-closure/engine-semantics-contract.md`, `external-evidence-model.md`) **were already deleted**, in `5a89f2b` — the very commit that introduced 4.2.6 — yet both recorded SHA-256 values still match the blobs at `5a89f2b~1`. A pinned file's bytes stay verifiable from history whatever happens to the working tree; deletion costs only *tree-reachability*. The genuine risk is the silent one: bytes reachable only through a ref nobody wrote down. A survey of all 136 pins across 5 records put the real number on the table — **134 in the current tree, 2 absent but hash-verifiable, 0 unverifiable** — and the audit script first reported those 2 as dead because it handed `git show` Windows backslashes out of `path.join`, a failure that reads exactly like a missing file. 4.2.6's `scopeGapsClosed` now names both files and the recovery ref, without touching `frozenAtUtc` or a single pin (49/49 still verify), and `test/verifier-c/freeze-record-reachability.test.mjs` turns that note into a contract: every pin in every record is either in the tree or hash-verifiable from a **named** ref, and any pin absent from the tree must be documented in the active record. `scopeGapsClosed` had **no reader at all** until this change, so the note was previously worth nothing. 5 negative controls (delete a file the active record pins · drop the note · point it at a wrong ref · shrink a pin · corrupt a recorded hash) each turn the suite red, and the control harness now restores every mutated file byte-for-byte — after a first draft ran `git checkout -- .` and silently destroyed the uncommitted record edit. Two stale literals fixed in passing: AGENTS.md's own `47 = 28+19` (real: 49 = 30+19) and `1176`, plus the `46/46` frozen into `validate-freeze.test.mjs`'s header table while its assertions were already deriving the count — documentation that lies right beside a check that cannot. Measured: **1180/1180** · **833 files · 0 violations** · docs-node 94/55/20. |
9999
| **v0.5.27 (2026-09-27, this session)** | **A number I fixed by hand was still an unguarded number — and one of them guarded nothing at all** — v0.5.26 hand-corrected two literals in `AGENTS.md` (`1176`→1187-class drift, and `47 = 28+19` → the record's real `49 = 30+19`) and left them exactly as rot-prone as before. That is the [C32] lesson applied to the file that teaches it: the fix was to the value, not to the class. `test/ci/agents-numbers.test.js` now **derives** each live figure in AGENTS.md from the one committed source that owns it and requires it inside the single line whose label names it — engine version ↔ scenario count ↔ test count ↔ validator checks (from `freeze-record-4.2.6.json` + `negative-tests.json` + `state-snapshot.json`, `649` parsed out of the record's own `cycleEvidence.nodeValidator` rather than retyped), the pin count and its release/quarantine split, the SelfTest count (counted from `selftest.tap`'s `ok ` lines, not read from prose), and the payout i18n dictionary size. Two of these had **already rotted** (`919⇄6⇄` and `47 = 28+19`), so this is the second measured instance, not a hypothetical. It also cross-checks the record's own `cycleEvidence` against the artifacts, so the reviewer-facing claim cannot outrun the bytes. **14 negative controls, each red**, and they cover both directions: the doc rotting (`NC1`-`NC5`: stale count, stale split, a chain trimmed to 2 of 4 values, a **duplicate line** planted beside the fresh one, an anchor renamed away) and the *source* rotting so the doc becomes the liar (`NC6`-`NC10`: snapshot count, engine version, a dropped quarantine pin, a record claiming 24 self-test checks against 21 `ok ` lines, 19 scenarios against 16). The last two (`NC11`, `NC12`) delete the array key and every `ok ` line to prove the guard **refuses to derive 0** rather than asserting a confident false number — the [C30] zero-denominator trap, caught live during this build when a wrong key name made the first draft try to state `0` scenarios. **Separately, a cited invariant turned out not to exist:** AGENTS.md told two sessions that a hand-edit "silently breaks the 637/637 node pairing". Nothing in the tree derives or checks 637; the only enforced pairing is `test/p2/governance-dashboard-i18n.test.js` over the `PAYOUT_GATE_I18N` dictionary (**11 keys**), while the full `coreguard-gate41-visual.html` / `-en.html` pair is **unverified by machine** — the AR file carries 278 `data-i18n` attributes and the EN sister carries zero, holding literal English, so no dictionary exists to pair. Both citations are corrected and that pair is now labelled unguarded rather than falsely guaranteed. Measured: **1187/1187** · **834 files · 0 violations** · docs-node 94/55/20. |
100100
| **v0.5.28 (2026-09-27, this session)** | **"Unguarded" is a finding, not an excuse: the real invariant existed and was 277 keys wide** — v0.5.27 corrected AGENTS.md's dead `637/637` pairing claim and labelled the AR/EN dashboard pair **unverified by machine**. That was the honest reading, and stopping there would have repeated the mistake the repo already documents: *"The fix here was to BUILD the surface — not to reword the claim."* Probing the page found the invariant it actually ships with. `docs/coreguard-gate41-visual.html` has **one runtime dictionary**, `D = {"nodes": {"<id>": {ar, en}}, "attrs": …}`, and `apply()` iterates it replacing `[data-i18n="<id>"]` `.innerHTML` — so the contract is a **bijection**, and it holds perfectly: **277 static markup keys ↔ 277 entries, 0 missing, 0 orphan**. Two candidate defects turned out to be **correct behavior**, and the temptation to "fix" either would have damaged a live investor-facing page. Entries 84/93/104 carry an `.ar` with no Arabic because they are the bare RTL arrows `←`/`→` — flipping the glyph is the point. And **29** entries embed a *nested* `data-i18n` inside their own `.ar` value; the outer entry replaces `innerHTML` wholesale so the inner attribute is redundant and order-dependent, yet every inner key also appears in static markup (the bijection proves it), so nothing is orphaned and rendering is correct. `test/p2/gate41-visual-i18n.test.js` therefore pins the **29 as a count, not as zero** — changing it must be a deliberate act, not an edit that lands unnoticed. Per [C27] it also asserts the **mechanism**, not just the data: `apply()` must still iterate `D.nodes` and still select by the iterated key, because the dictionary can be flawless while the switcher no longer reads it. **9 negative controls, and one of them caught a hole in this very contract**: pasting a whole English sentence into the `.ar` slot did **not** fail, because the first "language-neutral" rule allowed letters, spaces and punctuation — i.e. any ASCII. The rule is now **no WORD** (two consecutive ASCII letters), which catches an untranslated English string while still passing the bare arrows. A guard that cannot fail is not a guard ([C32]); the control is what turned this one real. **Left explicitly unguarded, and labelled as such:** the EN sister `coreguard-gate41-visual-en.html` carries 0 `data-i18n` attributes and no dictionary (literal English), so nothing cross-checks that it says the same thing as the AR dictionary's `en` values. Measured: **1193/1193** · **835 files · 0 violations** · docs-node 94/55/20 · freeze 49/49. |
101+
| **v0.5.30 (2026-09-30, this session)** | **The proxy posture now speaks all three front doors** — the boundary doc's production section gained Caddy and Traefik equivalents beside nginx (the section that already carried a structural CI contract): Caddy with its honest build choice spelled out (no standard rate-limit module — claim it and the section names the degenerate shared-budget failure; module build or Traefik are the honest per-client paths), `reverse_proxy` to the documented loopback bind, `request_body max_size` at the 1 MiB cap, ACME/internal/pinned TLS; Traefik with the full translation (`rateLimit` average 10 / burst 20 mirroring the nginx fence, `buffering.maxRequestBodyBytes` = 1048576, entry-point TLS, forwarded headers logging-only) — both with their own "Never do" list. Zero fences executed, zero new start lines, zero nginx fences added: the nginx-conf, doc-curl, and docs-node contracts stay byte-stable, and the doc-freshness contract holds the new sections to the same live-code anchors (loopback socket, the 1 MiB cap, no fresh DNS claims). `npm test` → **1243/1243** (unchanged: docs-only cycle); boundary audit **861 files, 0 violations**; docs-node **94 · 56 · 20** |
101102
| **v0.5.29 (2026-09-27, this session)** | **"The twins are identical" would have been the second dead number in a row** — v0.5.28 pinned the AR page's 277-key dictionary and left the EN sister's cross-file parity unguarded. The obvious fix is to assert the two files match. Measured first, they do **not**, and the divergence is *designed*: the AR page is the interactive twin (it carries the language switcher), the sister is the printable twin (printhead + print button) — which is precisely why the [C5] dictionary walk dropped the EN `printhead` subtree first. So a "they must be equal" test would have been **637 all over again**: a number that reads like a guarantee, matches nothing, and fails the first time a real design decision meets it. `test/p2/gate41-visual-en-parity.test.js` pins the drift that must never happen instead: all **277** dictionary `.en` values appear **verbatim** in the sister (0 absent — the cross-file link is real and it holds); the load-bearing element counts are **identical** (section 10 · h2 10 · h3 12 · tr 30 · td/th 95 · p 19 · a 14 · ids 34), because a row or heading present in one twin only means the sister is a **stale snapshot** — invisible to any per-file test; the only permitted tag differences are `b`/`span`/`div` each **+1** in the sister, pinned **as a set** and re-checked against the `printhead` that causes them, so a new divergence cannot hide beside a sanctioned one; the sister stays **dictionary-free** (0 `data-i18n`, 0 `D.nodes`, 0 `L()`) because it is literal English and a second dictionary would be a second source of truth ([C27]); it leaks **no Arabic** across 539 text runs; and `lang`/`dir` are asserted per twin, since a wrong `dir` silently reverses the whole board's order while every text assertion still passes. Two findings the sweep produced that nobody had asked about: **(a)** **221 of 277** `.ar` values are already literal Arabic in the static markup, so the AR page renders with **JS disabled** — the dictionary is the switcher's payload, not the page's only text source, and that count is now pinned so stripping the literal Arabic (a silent availability regression every dictionary-level check would pass) cannot land unnoticed; **(b)** the role asymmetry (AR `langBtn` ↔ EN `printBtn`) is pinned **as fact**, so a future session neither "fixes" a deliberate difference nor lets a dead button rot. The 12-control battery reports **coverage rather than a count** — all 8 tests had to be *observed failing*, which forced the harness onto `--test-reporter=tap` after the default reporter's glyph output made the extractor silently find zero failures (the ASCII-grep trap, live). Measured: **1201/1201** · **836 files · 0 violations** · docs-node 94/55/20 · freeze 49/49. |
102103
| Channel | State |
103104
|---|---|

‎docs/delivery-dispute-boundary.md‎

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,101 @@ publish the app's port alongside the proxy's · point untrusted third parties
427427
at the app behind the proxy: the proxy **is** the front door, and every app
428428
side guard assumes the door is the proxy.
429429
430+
### Running behind Caddy — the same posture, Caddy's syntax
431+
432+
The nginx rules above are the contract; Caddy changes the mechanism, not one
433+
rule. The differences that matter:
434+
435+
1. **Rate limiting needs a conscious choice.** Caddy's standard build ships
436+
no rate-limit directive — pretending otherwise is a claim with no surface.
437+
Either build Caddy with a rate-limit module and key it on the client, or
438+
accept honestly that per-client limiting moves back to the app — where it
439+
degenerates into ONE shared budget (the classic mistake this posture
440+
exists to prevent: one heavy client locks everyone out). If per-client
441+
limits are a requirement, the module build or Traefik below are the honest
442+
paths; Caddy without the module still gives TLS, body caps, and the
443+
loopback boundary, with the app limiter as a global backstop.
444+
2. **Loopback upstream, app on its default bind.** `reverse_proxy` targets
445+
the app the documented start line already serves — never widen the app's
446+
bind to make the proxy "simpler".
447+
3. **Body cap at the edge.** `request_body max_size` keeps the edge cap ≤
448+
the app's 1 MiB so oversize dies at the proxy.
449+
4. **TLS is automatic or pinned — never assumed.** A public hostname gets
450+
ACME automatically; an internal deployment uses `tls internal`; a pinned
451+
pair uses the certificate files. The app speaks plain HTTP over loopback
452+
either way.
453+
5. **`X-Forwarded-For` arrives automatically and stays logging-only.** The
454+
app never reads it (contract-tested); add the proxy's address to
455+
`trustedForwarders` on the start line if you want the classification
456+
labels.
457+
458+
```caddyfile
459+
# the same posture in Caddy's syntax (rules 2-4; rule 1 is a build choice)
460+
https://<your-hostname> {
461+
tls /etc/ssl/dde.crt /etc/ssl/dde.key # or `tls internal`
462+
request_body {
463+
max_size 1MB
464+
}
465+
reverse_proxy 127.0.0.1:8787
466+
}
467+
```
468+
469+
**Never do (Caddy edition):** ship the standard build and claim per-client
470+
limits · widen the app's bind so Caddy "reaches" it · let automatic HTTPS
471+
become the assumption instead of the configuration.
472+
473+
### Running behind Traefik — the same posture, Traefik's syntax
474+
475+
Traefik has the builtin middlewares the nginx posture needs, so all five
476+
rules translate directly:
477+
478+
1. **Per-client rate limit at the edge.** The `rateLimit` middleware keyed on
479+
the connection (average 10 / burst 20 mirrors the nginx fence above); the
480+
app's limiter stays the backstop sized ABOVE it.
481+
2. **Loopback upstream.** The service points at the documented start line's
482+
bind — the app's host/port live in packages/delivery and are never
483+
retyped into a proxy config.
484+
3. **Body cap.** The `buffering` middleware with `maxRequestBodyBytes`
485+
1048576 (1 MiB) keeps oversize dying at the edge; buffering holds the
486+
body in memory, which is acceptable at this cap precisely because the cap
487+
is small.
488+
4. **TLS terminates at the entry point.** `tls` on the router with your
489+
resolver; the app stays plain HTTP on loopback.
490+
5. **Forwarded headers stay logging-only.** The same contract as every proxy
491+
here: the app never trusts XFF; `trustedForwarders` only adds labels.
492+
493+
```yaml
494+
entryPoints:
495+
websecure:
496+
address: ":443"
497+
http:
498+
routers:
499+
dde:
500+
rule: "PathPrefix(`/`)"
501+
entryPoints: [websecure]
502+
middlewares: [dde-rate, dde-body]
503+
service: dde-app
504+
tls:
505+
certResolver: myresolver
506+
middlewares:
507+
dde-rate:
508+
rateLimit:
509+
average: 10
510+
burst: 20
511+
dde-body:
512+
buffering:
513+
maxRequestBodyBytes: 1048576
514+
services:
515+
dde-app:
516+
loadBalancer:
517+
servers:
518+
- url: "http://127.0.0.1:8787"
519+
```
520+
521+
**Never do (Traefik edition):** publish the app as its own router beside the
522+
edge · raise `maxRequestBodyBytes` past the app's cap · let the entry
523+
point's rate limit replace the app's backstop instead of sitting above it.
524+
430525
### Running in containers — the same posture for Docker and Kubernetes
431526

432527
The proxy posture above is one *process model*: nginx and the app on one host.

0 commit comments

Comments
 (0)