refactor(harnesses): extract the claude launcher behind a Harness interface#342
Draft
tildesrc wants to merge 1 commit into
Draft
refactor(harnesses): extract the claude launcher behind a Harness interface#342tildesrc wants to merge 1 commit into
tildesrc wants to merge 1 commit into
Conversation
…erface Stand up src/panopticon/harnesses/ — a pluggable adapter describing one agent CLI's mechanics (config dirname, auth check, bootstrap file-writes, launch argv) — and re-express the current claude launcher as ClaudeHarness. container/agent.py becomes a thin driver that looks the harness up in a registry and dispatches to it, staying the only place a CLI is executed (the determinism invariant). Behaviour-preserving: the claude golden argv/rendering tests carry over unchanged in substance (only import paths move). The launcher selects the harness from PANOPTICON_HARNESS, defaulting to claude, so an existing claude task is launched exactly as before. This is chunk 1/4 of the M3 harnesses work (PR #339). Chunks 2-4 stack on top: control-plane recording (Task.harness / Repo.credential_dir), runner image/spawn wiring, and the codex harness. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Stand up
src/panopticon/harnesses/— a pluggable adapter describing one agent CLI's mechanics (config dirname, auth check, bootstrap file-writes, launch argv) — and re-express the current claude launcher asClaudeHarness.container/agent.pybecomes a thin driver that looks the harness up in a registry and dispatches to it, staying the only place a CLI is executed (the determinism invariant).This is chunk 1/4 of the M3 harnesses work carved out of #339. It is a behaviour-preserving refactor — nothing an existing claude task does changes. Chunks 2–4 stack on top:
Harnessinterface + claude extraction.Task.harness/Repo.credential_dir, migrations, api/service/store).images.pyharness layer,local_runner.py,spawner.py).codexharness.How
harnesses/base.py— theHarnessABC +BootstrapContext/LaunchContext+ constants.harnesses/claude.py— the Slice-6 launcher, plus the oldcontainer/skills.pyandcontainer/hooks.py, extracted behind the interface.harnesses/config.py— moved fromcontainer/config.py.harnesses/__init__.py— the registry; registers claude only (codex arrives in chunk 4).container/agent.py— rewired toget_harness(...). It selects by name fromPANOPTICON_HARNESS, defaulting to claude, so an existing claude task is launched exactly as before.container/hooks.py/container/skills.py; tests moved undertests/harnesses/.Why it's safe
The claude golden argv/rendering tests (
tests/harnesses/test_claude.py,test_claude_skills.py) carry over unchanged in substance — only import paths moved. That's the proof the extraction preserved behaviour.The full plan lives in the task's
plan.mdartifact.