Skip to content

cmux-tui: derive session effect workflows from journal - #9816

Closed
lawrencecchen wants to merge 4 commits into
task-journal-session-state-machinesfrom
task-journal-session-effect-workflows
Closed

lawrencecchen wants to merge 4 commits into
task-journal-session-state-machinesfrom
task-journal-session-effect-workflows

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Stacked after #9815. Depends on #9726, #9806, #9813, and #9815 landing in order. Do not merge this PR before all predecessors are reliable, gated, and landed.

Successor:

Scope:

  • Adds schema 17 and journal_session_effect_workflows as a journal-derived projection for effect intent and outcome state.
  • Adds closed, trusted-local intent and outcome payloads for session.hibernate, session.recover, session.restore, and session.fork.
  • Applies journal event, projection update, and idempotency receipt in one SQLite transaction for internal source-first recorders.
  • Keeps hibernation default OFF. A hibernate intent while the persisted policy is disabled returns a clear error before any journal mutation.
  • Fences outcomes by attempt generation. Outcomes without intent, stale outcomes, duplicate intents, and unknown extension fields do not become authority.

Out of scope:

  • No public hibernate, recover, restore, or fork command.
  • No process kill, PTY control, Pi launch, provider resume, host-loss classifier, fork runtime creation, hibernation policy UI, or auto recovery.
  • No policy-sensitive orchestration. This PR only supplies durable source state for the later orchestrator slice.

Verification:

  • Red commit: test(tui): require journal effect workflows. It failed at the missing journal_session_effect_workflows table before the implementation.
  • CMUX_ALLOW_LOW_SPACE_BUILD=1 RUSTC=/Users/lawrence/.rustup/toolchains/1.94.0-aarch64-apple-darwin/bin/rustc cargo test -p cmux-tui-core session_effect
  • CMUX_ALLOW_LOW_SPACE_BUILD=1 RUSTC=/Users/lawrence/.rustup/toolchains/1.94.0-aarch64-apple-darwin/bin/rustc cargo test -p cmux-tui-core session_runtime_and_policy_state_machines_rebuild_from_journal
  • CMUX_ALLOW_LOW_SPACE_BUILD=1 RUSTC=/Users/lawrence/.rustup/toolchains/1.94.0-aarch64-apple-darwin/bin/rustc cargo test -p cmux-tui-core default_off_hibernation_policy_and_terminal_close_do_not_hibernate
  • CMUX_ALLOW_LOW_SPACE_BUILD=1 RUSTC=/Users/lawrence/.rustup/toolchains/1.94.0-aarch64-apple-darwin/bin/rustc cargo test -p cmux-tui-core canonical_agent_state_preserves_sequential_roots_children_and_providers
  • CMUX_ALLOW_LOW_SPACE_BUILD=1 RUSTC=/Users/lawrence/.rustup/toolchains/1.94.0-aarch64-apple-darwin/bin/rustc cargo test -p cmux-tui-core canonical_native_payload_rejects_secrets_live_capabilities_and_unknown_extensions
  • CMUX_ALLOW_LOW_SPACE_BUILD=1 RUSTC=/Users/lawrence/.rustup/toolchains/1.94.0-aarch64-apple-darwin/bin/rustc cargo test -p cmux-tui-core agent_projection_is_derived_from_pi_journal_and_reopen_preserves_continuity
  • git diff --check

Owner closeout:
Fixed = no durable effect workflow state -> trusted-local intent and outcome events now derive journal_session_effect_workflows.
How = closed payloads, pure reducer, and one SQLite transaction for journal event, projection update, and idempotency receipt. This is principled because later orchestrators get a source-owned state machine without process control.
Risk = host-loss detector wiring, public commands, provider resume, and fork runtime creation remain deferred to successors.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cc3e8fc6-b611-4704-9cff-0b610d139b4a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@blacksmith-sh

blacksmith-sh Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Found 3 test failures on Blacksmith runners:

Failures

Test View Logs
github.com/manaflow-ai/cmux/cmux-tui/bindings/go/raw/
TestGeneratedInventoryHasTypedMethodForEveryCommand
View Logs
test_orchestrator.PythonDevOrchestratorTests/
test_fake_server_emits_canonical_terminal_snapshot
View Logs
test_protocol.GeneratedProtocolTests/test_protocol_inventory_is_exhaustive View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Closing this obsolete draft because its dependency stack is dead (#9806 and #9813 are closed, and this chain depends on those predecessors). Any remaining intent should be reintroduced in a fresh PR from current main.

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Obsolete stacked draft; see the closing note above.

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