Skip to content

Refactor bounded work controller for auditability - #3

Merged
Tom-R-Main merged 1 commit into
mainfrom
codex/controller-audit-refactor
Oct 14, 2026
Merged

Tom-R-Main merged 1 commit into
mainfrom
codex/controller-audit-refactor

Conversation

@Tom-R-Main

Copy link
Copy Markdown
Owner

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.ts owns grant, contract, catalog, path, lease, and receipt checks.
  • attempt-verification.ts selects verification bindings, collects evidence, and checks completion proof.
  • attempt-recovery.ts names recovery stages and requests ordered effects through an explicit runtime.
  • attempt-state.ts preserves the existing persisted attempt interfaces.
  • The controller retains state ownership, admission/lifecycle locks, persistence, timers, dispatch, and the final synchronous subject fence. Expand its remaining dense statements and document module responsibilities.

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.

@Tom-R-Main
Tom-R-Main marked this pull request as ready for review October 14, 2026 16:17
@Tom-R-Main
Tom-R-Main merged commit 2754341 into main Oct 14, 2026
6 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T16:18:47.285944Z 523a6f4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant