Skip to content

Collapse harness wrappers into burn run <harness> (#154)#157

Merged
willwashburn merged 4 commits intomainfrom
feat/issue-154-burn-run-harness
Apr 28, 2026
Merged

Collapse harness wrappers into burn run <harness> (#154)#157
willwashburn merged 4 commits intomainfrom
feat/issue-154-burn-run-harness

Conversation

@willwashburn
Copy link
Copy Markdown
Member

@willwashburn willwashburn commented Apr 27, 2026

Closes #154.

Summary

  • Replace the three top-level verbs burn claude / burn codex / burn opencode with one burn run <claude|codex|opencode> subcommand backed by a HarnessAdapter registry at packages/cli/src/harnesses/. Adding a fourth harness becomes a one-file addition + one-line registration.
  • The driver at packages/cli/src/commands/run.ts owns spawn / tag merging / exit handling and emits a uniform [burn] <name> ingest: N sessions (+M turns) line for every adapter.
  • The codex and opencode adapters share their pending-stamp + watch-loop shape via createPendingStampAdapter in harnesses/pending-stamp.ts — internal-to-harnesses dedup, invisible to the driver.
  • Help (burn help, burn run) renders the harness list from the registry, so adding a harness updates help automatically.
  • Legacy verbs (burn claude, burn codex, burn opencode) still work for one minor release: each prints a stderr deprecation notice and forwards through runDeprecatedAlias. Slated for removal next minor.

Files

  • New: packages/cli/src/harnesses/{types,registry,pending-stamp,claude,codex,opencode}.ts and matching registry.test.ts
  • New: packages/cli/src/commands/run.ts + run.test.ts
  • Trimmed: packages/cli/src/commands/claude.ts keeps only ingestSession (now returns IngestReport so the driver can fold it). The old codex.ts / opencode.ts command files are gone.
  • Updated: packages/cli/src/cli.ts dispatch, packages/cli/src/index.ts exports, packages/cli/src/spawn-tags.ts comment.
  • Docs: README.md, AGENTS.md (gains an "Adding a harness" section pointing at the adapter skeleton), root CHANGELOG.md, packages/cli/CHANGELOG.md.

Test plan

  • pnpm run build (clean tsc build across the workspace)
  • pnpm run test — 634 tests pass; new coverage:
    • harnesses/registry.test.ts — name lookup, unknown-harness path
    • commands/run.test.ts — driver call sequence (plan → beforeSpawn → spawn → afterExit), optional watcher with report folding, spawn-error propagation (returns 127), runDeprecatedAlias warning + delegation, unknown-harness rejection
  • Manual smoke: burn run (lists harnesses, exits 2), burn run unknown-harness (error message), burn codex --bogus-flag (deprecation notice + forwards through). Real spawning is harness-dependent and was sanity-checked locally.

🤖 Generated with Claude Code


Open in Devin Review

Replace the three top-level verbs `burn claude` / `burn codex` /
`burn opencode` with a single `burn run <harness>` subcommand backed by
a `HarnessAdapter` registry under `packages/cli/src/harnesses/`. Adding
a new harness becomes a one-file addition + one-line registration.

The driver in `commands/run.ts` owns spawn / tag merging / exit handling
and emits a uniform `[burn] <name> ingest: N sessions (+M turns)` line
for all adapters. The codex and opencode adapters share the
pending-stamp + watch-loop shape via `createPendingStampAdapter`.

Legacy verbs continue to work for one minor release: each prints a
stderr deprecation notice and forwards through `runDeprecatedAlias` to
the new dispatcher. Slated for removal next minor.

Tests cover the registry lookup paths, the driver call sequence (with
and without an optional watcher), watcher report folding, spawn-error
propagation, and the deprecation alias.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

willwashburn and others added 3 commits April 27, 2026 16:50
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The trimmed-down `commands/claude.ts` no longer fronted a `burn claude`
command — it only held the single-session ingest helper called by the
claude harness adapter's `afterExit`. Keeping it under `commands/` was
misleading.

Move the helper to `ingest.ts` and rename it `ingestClaudeSession` so it
sits next to `ingestCodexSessions` / `ingestOpencodeSessions` as the
per-harness ingest peer. The claude harness adapter now imports from
`../ingest.js` like the other two adapters. Test moves to
`ingest-claude-session.test.ts` next to `ingest.ts`.
Hard-cut over to `burn run <harness>` — the standalone `burn claude` /
`burn codex` / `burn opencode` verbs are removed, not aliased through a
deprecation shim. `burn claude` now exits as an unknown command. Update
README, CLI CHANGELOG, and root CHANGELOG to land this as a Removed
entry instead of a deprecation notice.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@willwashburn willwashburn merged commit ad322d7 into main Apr 28, 2026
2 checks passed
@willwashburn willwashburn deleted the feat/issue-154-burn-run-harness branch April 28, 2026 03:43
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.

cli: collapse burn claude / burn codex / burn opencode into burn run <harness>

1 participant