-
Notifications
You must be signed in to change notification settings - Fork 63
fix(recovery_flow,verify,sweep): fail-closed spec recovery and migration ledger byte binding (DW-308 … DW-316) #797
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
pbean
merged 17 commits into
pbean/wave5-11-target-integration-identity
from
pbean/wave5-12-migration-ledger-byte-binding
Sep 20, 2026
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
25943e0
sweep dw-decision-dw-308: DW-308 via bmad-loop
119d03c
sweep dw-decision-dw-309: DW-309 via bmad-loop
545e3bc
sweep dw2-fail-closed-fallback-spec-restore: DW-310 via bmad-loop
f74eda6
fix(sweep): bind migration ledger publication bytes
8c7e927
sweep dw2-migration-ledger-byte-binding: DW-311, DW-316 via bmad-loop
2f4e64e
docs(changelog): wave5 S12 entries
pbean c371dc8
fix(verify): make wave5 S12 Windows-clean
pbean 4ba72b9
test(verify): bound only the prepared transaction in the S12 timing rows
b0ddd9b
test(sweep): pin post-commit hook rewrite of the live ledger to a ref…
a696368
fix(verify,sweep): refuse bound publication over a committed deletion…
4e17b77
fix(verify): swallow the closed reply stream in the prepared-ref read…
d4d9852
fix(verify): refuse bound replay over a committed deletion of its own…
904fc7a
test(verify): break the prepared abort's command stream without handi…
842f65e
fix(verify): bind the bound ledger candidate to the live file's raw b…
d5dc866
test(runs): hold every dead-pid child so Windows cannot recycle its pid
abdd43c
test(runs): hand back a dead pid only once the liveness probe reads i…
0da39b0
fix(verify): name the bound baseline by its committed blob, not its t…
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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.
When another process edits the ledger after this callback returns but before
adapter.run(spec)begins, the migration session still launches using recovery records built from the old text;SessionSpecconstruction and thesession-startjournal write remain between this check and the launch. The child can then overwrite the concurrent edit, after which validation blesses its output against the stale manifest and the bound publisher sees only the accepted rewrite, so the promised fail-closed behavior is bypassed. Move the validation to the adapter-launch boundary or bind the child's first ledger write with equivalent compare-and-set authority.AGENTS.md reference: AGENTS.md:L81-L81
Useful? React with 👍 / 👎.
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.
Not taking this one — the window it names cannot be closed by moving the check, and it is already the smallest window on the path.
Between
prelaunch_validator()andadapter.run(spec)there are exactly three things:SessionSpec(...)construction (pure),journal.set_active_log, and thesession-startjournal append — both writes land in the run dir, never the ledger. No executable hook runs there, which is what this validator exists to bound (DW-316's contract in FEATURES.md is "after executable pre-session hooks at the actual adapter-launch boundary", and every hook stage sits above it). Beyondadapter.runthe child CLI takes seconds to start and minutes to rewrite the ledger; a rival write anywhere in that span produces the identical outcome the finding describes, and that span is whatvalidate_migrationagainst the durable manifest and the bound publisher's baseline/blob checks are for. A write in the microseconds between the validator and the launch is indistinguishable, from the child's side, from one landing during its startup — it is the same race, and the only guard against it is the post-session one.Moving the call after the
session-startrecord would also break the #157 pairing invariant:_retire_migration_dispatch_authorityraises, and a raise betweensession-startand thetryaroundadapter.runleaves the journal showing a session that never ended. Binding "the child's first ledger write" with compare-and-set authority is not available either — the child is a coding-CLI session that owns the file for its whole run; the orchestrator has no seam in it.