Skip to content

fix(loop): harden CLI surface — drop session-policy + ghost flags, per-flag help, dead-worker sweep on run exit - #487

Merged
huichen merged 2 commits into
mainfrom
claude/loop-cli-supervision
Sep 3, 2026
Merged

huichen merged 2 commits into
mainfrom
claude/loop-cli-supervision

Conversation

@huichen

@huichen huichen commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Loop CLI surface hardening, five changes that all close the gap between what the CLI claims and what it does:

1. Remove --session-policy (run)

Fresh is now the default; resume only via an explicit --resume-session <id> pin. The goal-level session_retention is a single field (whichever run wrote back last), so an implicit "resume the retained session" would hand one worker's session to another under parallel workers.

2. Delete ghost flags

Flags the reject_unknown_flags array accepted but the parse closure never read (silent no-ops):

  • supervisor propose: --outcome --receipt-id --adapter-id --authority-ref --host-capabilities
  • supervisor receipt: --agent-id --kind --summary --target-agent-id --capabilities
  • supervisor events: all but --goal
  • replan ack: --format --json
  • replan obligations: --delta-kind
  • scheduler tick: --cadence-class

3. Per-flag help

<command> --help / <command> <sub> --help now render each flag with its default + constraints, sourced from each handler. agent gains subcommand registrations so agent onboard|list|contract|recipe|succession|collective --help resolve.

4. scheduler tick --progression warns

It is bootstrap-only; once state exists it now warns instead of silently ignoring the flag.

5. Dead-worker sweep on run exit

run now sweeps dead-holder leases (notify_dead_holders) on exit, so a SIGKILL'd/crashed worker surfaces to the supervisor without a scheduler-tick cron.

Verification

  • cargo fmt -p future-loop --check ✅
  • cargo clippy -p future-loop --all-targets ✅ (no warnings)
  • cargo test -p future-loop --lib (392 passed) + integration suites (console_drive_a/b/c/cov100/g12, scheduler_drive/state_contract, run_lifecycle/identity, agent_run_drive/agent_client_executor, cli_registry_contract) ✅

Companion skills bump: future-skills #41 (v3.11.0).

…r-flag help, dead-worker sweep on run exit

- run: remove --session-policy (fresh is the default; resume only via an
  explicit --resume-session <id> pin — the goal-level retention is a single
  field, so an implicit resume would hand one worker's session to another
  under parallel workers)
- delete ghost flags the reject array accepted but parse never read:
  supervisor propose (--outcome/--receipt-id/--adapter-id/--authority-ref/
  --host-capabilities), supervisor receipt (--agent-id/--kind/--summary/
  --target-agent-id/--capabilities), supervisor events (all but --goal),
  replan ack (--format/--json), replan obligations (--delta-kind),
  scheduler tick (--cadence-class)
- scheduler tick --progression now warns it is bootstrap-only instead of
  silently ignoring it once state exists
- render per-flag help (<command> --help / <command> <sub> --help) with
  defaults + constraints sourced from each handler; agent gains subcommand
  registrations so agent onboard|list|contract|recipe|succession|collective
  --help resolve
- run exit now sweeps dead-holder leases (notify_dead_holders) so a crashed
  worker surfaces to the supervisor without a scheduler-tick cron
@huichen
huichen enabled auto-merge (squash) September 3, 2026 15:11
@huichen
huichen merged commit 5904854 into main Sep 3, 2026
12 checks passed
@huichen
huichen deleted the claude/loop-cli-supervision branch September 3, 2026 15:15
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