Skip to content

refactor(run-mode): remove the in-session dispatch mechanism (#119)#124

Merged
slowdini merged 2 commits into
devfrom
refactor/remove-cli-dispatch
Jun 30, 2026
Merged

refactor(run-mode): remove the in-session dispatch mechanism (#119)#124
slowdini merged 2 commits into
devfrom
refactor/remove-cli-dispatch

Conversation

@slowdini

Copy link
Copy Markdown
Owner

Closes #119. Part of the Instant magic epic (#113).

Makes CLI dispatch the only mechanism end-to-end and deletes all in-session (DispatchMechanism::InSession / RunMode::Interactive) code. Claude Code now defaults to and runs via its claude -p stream-json path, exactly like Codex's codex exec. hybrid and headless are the only run modes (kept as accepted --run-mode values pending the vocabulary collapse in #120).

Net −2237 lines across 40 files — mostly deletion.

What changed

Commit 1 — delete the in-session-only subcommands. switch-condition and reset-batch were referenced only by in-session runbook generation and their own tests.

Commit 2 — remove the mechanism (atomic).

  • DispatchMechanism enum, RunMode::Interactive, RunMode::mechanism() removed; default_for(ClaudeCode) → hybrid; resolve_run_mode ClaudeCode → [hybrid, headless]; HarnessRunCapabilities.mechanism dropped.
  • Single shared env/ layout gone — every run stages one env-<group>-<condition>/ per (group, condition).
  • HarnessAdapter: parse_cli_events* now required; runbook_template / parse_transcript* removed. Codex parses its events file directly; OpenCode errors until ingest is wired. Runbook always uses the shared headless template.
  • Deleted in-session transcript code (subagent resolution by agent_description, resolve_subagents_dir*, SubagentMeta/SubagentEntry), the --subagents-dir / --session-id flags, and CLAUDE_CODE_SESSION_ID auto-resolution. Shared extract_invocations/read_records/TranscriptSummary kept (the stream-json parser reuses them).
  • Pipeline record-runs/fill-transcripts read each task's outputs/<harness>-events.jsonl only.

Per the agreed scope: dead flags removed outright; only broken prose refs fixed (manifest, --help, stray-writes hint). The run-mode vocabulary/docs rewrite — including docs/harness-parity.md, which still describes the removed dispatch-mechanism API — is left for #120 / #121.

Before / after

A bare eval-magic run --harness claude-code (the default):

Before (interactive) After (hybrid)
Env layout single iteration-N/env/ iteration-N/env-<group>-<condition>/ per pair
RUNBOOK inside env/, agent-followed iteration-N/RUNBOOK.md, human-followed CLI recipe
Dispatch in-session Task subagents claude -p stream-json per task
Transcript source subagents dir via CLAUDE_CODE_SESSION_ID each task's outputs/claude-events.jsonl

Verification

  • cargo test468 pass, 0 fail (346 lib + 58 cli + 64 run + doc)
  • cargo fmt --check — clean
  • cargo clippy --all-targets -- -D warnings — clean
  • grep over src/ — no InSession / DispatchMechanism / RunMode::Interactive / deleted-flag references
  • e2e smoke (Claude Code claude -p): run → simulated dispatch (claude-events.jsonl) → ingest (assembled run.json + timing.json with source: transcript from the stream-json result event) → finalize (wrote benchmark.json)

Follow-ups (out of scope here)

🤖 Generated with Claude Code

slowdini and others added 2 commits June 29, 2026 17:00
…-batch subcommands

These fixture-swap/barrier subcommands exist only to serve the in-session
(interactive Claude Code) isolated-run loop: they are referenced solely by
in-session runbook generation and their own test modules, never by any Cli
dispatch path. Removing them is the first step of dropping the in-session
dispatch mechanism (#119).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Make CLI dispatch the only mechanism end-to-end and delete all in-session
(`DispatchMechanism::InSession` / `RunMode::Interactive`) code. Claude Code now
defaults to and runs via its `claude -p` stream-json path, exactly like Codex's
`codex exec`; hybrid and headless are the only run modes (kept as accepted
`--run-mode` values pending the vocabulary collapse in #C).

Removed:
- `DispatchMechanism` enum, `RunMode::Interactive`, `RunMode::mechanism()`;
  `default_for(ClaudeCode)` now → hybrid, `resolve_run_mode` ClaudeCode →
  [hybrid, headless]; `HarnessRunCapabilities.mechanism` field.
- The single-shared-`env/` layout: every run now stages one
  `env-<group>-<condition>/` per (group, condition).
- `HarnessAdapter::{runbook_template, parse_transcript, parse_transcript_full}`;
  `parse_cli_events*` are now required (Codex parses its events file directly,
  OpenCode errors until ingest is wired). The in-session runbook + its profile.
- In-session transcript code (`parse_transcript*`, subagent resolution by
  `agent_description`, `resolve_subagents_dir*`, `SubagentMeta`/`SubagentEntry`)
  and the `--subagents-dir` / `--session-id` flags + `CLAUDE_CODE_SESSION_ID`
  auto-resolution. Shared `extract_invocations`/`read_records`/`TranscriptSummary`
  kept (the stream-json parser reuses them).

All mechanism-keyed branches collapse to the CLI path; surviving harness-specific
behavior keys on the harness/adapter. Pipeline record-runs/fill-transcripts now
read each task's `outputs/<harness>-events.jsonl` only. Broken prose referencing
the deleted flags/commands rewritten in the manifest, help, and stray-writes hint;
the run-mode vocabulary/docs rewrite (incl. docs/harness-parity.md) stays with #C.

Integration tests re-pointed from the single `env/` to the per-(group,condition)
layout; in-session-only tests removed. `cargo test`, `cargo fmt --check`, and
`cargo clippy --all-targets -- -D warnings` are green; Claude Code `claude -p`
run → ingest → finalize smoke produces run.json/timing.json/benchmark.json.

Part of #113. Closes #119. Likely supersedes #34; unblocks #120 and #122.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@slowdini slowdini merged commit fc6fd4f into dev Jun 30, 2026
6 checks passed
@slowdini slowdini deleted the refactor/remove-cli-dispatch branch June 30, 2026 02:26
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.

refactor(run-mode): remove the in-session dispatch mechanism

1 participant