Repository navigation
Refactor bounded work controller for auditability - #3
Merged
Merged
Conversation
Tom-R-Main
marked this pull request as ready for review
October 14, 2026 16:17
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The bounded work controller combines grant and lease checks, evidence validation, and recovery effects in dense methods. Extract these responsibilities into internal modules so their conditions and ordering can be audited directly.
authority.tsowns grant, contract, catalog, path, lease, and receipt checks.attempt-verification.tsselects verification bindings, collects evidence, and checks completion proof.attempt-recovery.tsnames recovery stages and requests ordered effects through an explicit runtime.attempt-state.tspreserves the existing persisted attempt interfaces.Public APIs, persisted JSON shapes, grant bindings, errors, and check/dispatch order are preserved. Private execution handler digests naturally change with extraction; recovery continues to consume existing receipts without rewriting them.
Validation: 269 existing tests, 220 focused tests, 3 compiled grant CLI tests, and 5 actual OpenClaw/Pi host tests passed. Typecheck/build passed; TypeScript 6/7 parity matched 210 artifacts with byte-identical runtime JavaScript. Baseline-built journals reopened for saved proof and unknown-effect recovery, preserving saved receipts, ordered backend/grant traces (19 and 63 calls), and exactly one original effect. A separate agent review found no actionable findings and independently reran the 73 work/output tests and baseline compatibility scenarios.