Skip to content

(harnesses): CLI harness port and Claude adapter, no behaviour change #820

Open

Description

@devsuitup

First step of the Codex CLI support port (upstream ac72985, f5e38a7; credit Ali Basiri). No visible change.

The fork diverged too far to cherry-pick: upstream moved read-session-file.js/derive-project-path.js into harnesses/claude.js; the fork extended both. Re-implement as adapters around fork code:

  • harnesses/{index,claude}.js with upstream's names, plus harnesses/port.js (JSDoc typedefs: TranscriptStore, TranscriptParser, Launcher, ActivityClassifier required; UsageProvider optional; capabilities flags such as subagents, continuations, liveElsewhere, bgJobs, ideBridge, sandbox, schedule, remote) and test/harness-contract.test.js run against every adapter. UI and main gate on capabilities, never on runtime === 'claude'. Adapters stay pure (no Electron, no DB).
  • Extract a pure Claude argv builder from main.js open-terminal; the fork's worktree/sandbox/pre-launch/MCP wrapping stays outside the adapter. Characterization tests: same argv as today for fork, resume, start-fresh, worktree-not-git, add-dirs.
  • runtime TEXT DEFAULT 'claude' and sessionFile TEXT columns via the writer's column reconcile (ADR 0004: no mustReindex, schema only through the writer); an old schema gains both with no row loss.
  • harnessForFolder composes with parseFolderKey (alias::x).
  • package.json build.files includes harnesses/**.

Activity

  1. devsuitup commented on Oct 29, 2026

    @devsuitup
    OwnerAuthor

    Implementation note (PR #865): the port file is harnesses/contract.js, not harnesses/port.js (ADR 0005 calls it the harness contract).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions