Repository navigation
stack: close the two open doors, and make the headline numbers reproducible #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
140c60f
stack: close the two open doors, and make the headline numbers reprod…
itswl 44d191f
hookrelay: claim an inbound signature only after the pipeline answers
itswl 7111245
docs: keep the runnable demo on the front pages, and the draft out of…
itswl d6dbff9
locks: put the two new pins where relock.sh would
itswl 1dfd449
ware: the pipe's ceiling moves 6,400 -> 6,450 for the peek-then-claim…
itswl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
65 changes: 65 additions & 0 deletions
65
...nts/notes/implemented/2026-10-12-the-open-bridge-and-the-replay-window-close.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| --- | ||
| title: The open bridge and the replay window close, both fail-closed | ||
| status: implemented | ||
| date: 2026-10-12 | ||
| scope: stack | ||
| --- | ||
|
|
||
| ## Decision | ||
|
|
||
| Two boundaries that were shaped so an operator had to remember something are now | ||
| shaped so forgetting fails closed. | ||
|
|
||
| 1. **The bridge refuses to start with an empty `BRIDGE_INBOUND_SECRET`.** It used | ||
| to accept every card, and `docs/containment.md` recorded that as the *shipped | ||
| default* — the reason both deployments set the secret. A deployment that | ||
| genuinely has nobody untrusted on the wire now says `BRIDGE_ALLOW_UNSIGNED=1` | ||
| and accepts everything on purpose, out loud. | ||
| 2. **The pipe claims each inbound signature once.** `security.replay_token` + | ||
| `Store.claim_signature` answer the second copy of a signed request as a | ||
| duplicate *before* the fuse and the pipeline, so a capture replayed inside the | ||
| 300-second skew cannot buy a second verdict. `HOOKRELAY_SIGNATURE_REPLAY_SECONDS` | ||
| is the window (default 300; 0 turns the cache off and leaves the old behaviour). | ||
|
|
||
| The `HOOKPROBE_POSTURE_CHECK=enforce` default, which the containment page used to | ||
| read as an opt-in, is now spelled out in the deploy composes. The code already | ||
| defaulted to `enforce`; only the documents disagreed. | ||
|
|
||
| ## Why | ||
|
|
||
| Both rows in `docs/containment.md` named the gap themselves, and a gap that is | ||
| safe only while an operator remembers is one the next deployment will not have. | ||
| That page's own thesis is that a boundary with limits written down is worth more | ||
| than one trusted for more than it holds — but writing the limit down is not the | ||
| same as closing it, and two of these were closable in the schema and a startup | ||
| check. | ||
|
|
||
| The replay cache closes the last hole in the old argument. `verify_signature` | ||
| said a replay "mostly arrives as a duplicate and is skipped as one" — true only | ||
| inside the 120-second content-dedup window. An alert replayed at t=200s is inside | ||
| the 300-second skew and *outside* the content window, and was a fresh judge call. | ||
| The second identity (`replayed_signature`, keyed on the signature) folds exactly | ||
| that case without touching the first (`duplicate`, keyed on content). | ||
|
|
||
| The bridge change is a reversal of a shipped default, which is why it has this | ||
| note rather than a comment: the old behaviour was documented, deliberate, and | ||
| wrong for anyone but the one operator who knew to set the secret. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - Two knobs to know: `HOOKRELAY_SIGNATURE_REPLAY_SECONDS` and | ||
| `BRIDGE_ALLOW_UNSIGNED`. Both are reachable from a compose and documented in | ||
| the reference tables the gate generates. | ||
| - A legitimate sender that retries an identical signed request inside the skew | ||
| now gets `{"outcome": "skipped", "skip_code": "replayed_signature"}` instead of | ||
| a recorded `duplicate` row. Same HTTP shape, one fewer ledger row; the sender's | ||
| view is unchanged. | ||
| - Plugin adapters that speak their own header (`X-Hub-Signature-256`, Stripe) are | ||
| **not** tracked — `replay_token` says so rather than guessing, so those doors | ||
| keep the bounded window. Closing them means teaching the adapter its own replay | ||
| key, not widening this one. | ||
| - The bridge's in-body legacy sign still covers only the timestamp, so its | ||
| five-minute window stays bounded, not closed. The containment page says so. | ||
| - The pipe grew past 6,300 source lines, so `CEILINGS['hookrelay']` moved to | ||
| 6,400 with the doctrine answer recorded beside it: the door is the pipe's job, | ||
| it reads the pipe's own header and never a payload. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The three runnable demo lines and the Chinese feature list left this page, and the targets are English only. Short is right; losing the only runnable commands from both front pages is not. Keep the three lines inline under “10 分钟” and link the rest. — Claude (claude-fable-5-1)