Skip to content

Harden agent cooling: user kill switch, monotonic lease clocks, restore authority, audit, ruleset matching - #28

Merged
Reedtrullz merged 7 commits into
mainfrom
codex/agent-control-hardening
Aug 7, 2026
Merged

Harden agent cooling: user kill switch, monotonic lease clocks, restore authority, audit, ruleset matching#28
Reedtrullz merged 7 commits into
mainfrom
codex/agent-control-hardening

Conversation

@Reedtrullz

Copy link
Copy Markdown
Owner

Part 4 of the 2026-08-07 deep-review remediation (PRs #25-#27 are the release fix, consolidation, and v1.4.2 prep). Implements the review's High/Medium findings H-8, H-9, M-8, M-9, M-15.

Changes

  • User kill switch (H-8): the daemon persists policy-enabled.json (0600, root-owned, same secure-store envelope as the lease); disabling restores Auto if a lease is active. New XPC setAgentControlEnabled, client proxy, AppModel state, and a Settings → Agent Workflows toggle. policy.enabled now truthfully reports the user's choice on every status/capabilities/diagnose readback (previously hardcoded true).
  • Monotonic safety clocks (H-9): lease expiry, cooldown, and monitor scheduling use an uptime-anchored decision clock (injected for tests, wired in DaemonService); startup recovery clamps persisted-lease remaining time so a wall-clock rollback cannot stretch a lease beyond the 30-minute policy cap.
  • Restore authority (M-9): the arbiter refuses authority-less Auto restores over an active manual session; viftyctl restore-auto now defaults to no authority and requires --operator (human) to override a manual session. The app coordinator carries operator authority on all restore paths, so unclean-exit recovery and Auto ticks keep working.
  • Restore audit (M-8): every full-set Auto restore is recorded, with the request transaction ID when no lease exists.
  • Ruleset matching (M-15): check-release-governance.sh now matches refs/tags/<tag> against ruleset include/exclude patterns (fnmatch, FNM_PATHNAME) and fails when any additional active tag ruleset matches the ref, instead of silently skipping non-shape-exact rulesets; contract checker and Ruby mutation tests pin the new behavior.

Verification

  • Targeted suites: 297 tests, 0 failures (arguments, runner, arbiter, coordinator, agent service/store, daemon client, governance).
  • Ruby workflow contract suite: 54 runs, 319 assertions, 0 failures.
  • DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer make verify: pass (fast XCTest suite, warnings-as-errors build, release app bundling, plist lint, codesign, viftyctl identifier checks).

Non-claims

  • No hardware/fan/SMC/Auto operation performed; behavior verified through fixture tests only. No release/tag/GitHub Release mutation.

…re authority, audit, ruleset matching

- Agent cooling kill switch: daemon persists a root-owned policy-enabled
  setting; disabling restores Auto if a lease is active and flips
  policy.enabled to false on every status/capabilities/diagnose readback.
  App Settings gains the Allow agent cooling requests toggle (XPC
  setAgentControlEnabled).
- Monotonic safety clocks: lease expiry, cooldown, and monitor scheduling use
  a system-uptime-anchored decision clock instead of the wall clock, and
  startup recovery clamps persisted-lease remaining time so NTP/manual clock
  rollbacks cannot stretch a lease past the policy cap.
- Restore authority: the arbiter refuses authority-less Auto restores over an
  active manual session; viftyctl restore-auto defaults to no authority and
  gains --operator for human override. The app coordinator carries operator
  authority on all its restore paths so unclean-exit recovery and Auto ticks
  keep working.
- Audit: every full-set Auto restore is now recorded, with the request
  transaction ID when no lease exists.
- Release governance: check-release-governance.sh now matches the release ref
  against ruleset include/exclude patterns (fnmatch, FNM_PATHNAME) and fails
  if any additional active tag ruleset matches, instead of silently skipping
  non-shape-exact rulesets; contract checker and Ruby mutation tests updated.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

The SwiftPM checks job cancels intermittently at the 35-minute timeout when
make verify-full crosses it on slower macos-15 runners; the full gate needs
roughly 29-35 minutes, leaving no margin. Pin the larger timeout in the CI
trust-gate test.
@Reedtrullz
Reedtrullz merged commit 78440b4 into main Aug 7, 2026
1 check passed
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