Repository navigation
Closed
Description
Why
conciv init hardcodes a claude-only step and a standalone @conciv/claude-connect package exists to serve it. That is a harness special case in a system whose harness layer is otherwise a capability-typed contract (user ruling 2026-08-06: no harness-specific packages; each harness declares what init needs to do for it, init stays generic). All file:line below verified against origin/main.
What exists today
- The
HarnessAdaptercontract already encodes "capability literal => sidecar required" via intersected discriminated unions (packages/protocol/src/harness-types.ts:179-187:transcriptHistory: truepairs with requiredhistory,slashCommands: 'none'forbidscommandswith?: undefined). An init contribution is one more& (...|...)arm of the same shape. - The init pipeline is step-driven (
packages/cli/src/init/pipeline.ts:44-54:InitStep = {id, title, running, completed, detect, plan, apply, verify, manualCard}) but the step LIST is hardcoded (pipeline.ts:105-113), ending inclaudeStep(...)- the claude plugin install (packages/cli/src/init/steps/harness/claude.ts:84-97), guarded by a hand-written id check (claude.ts:70). - Harness detection in the CLI is a DUPLICATED list disconnected from the harness registry (
packages/cli/src/init/harness-detect.ts:5-16: claude/codex/opencode/pi markers; the registry atpackages/harness/src/registry.ts:31ships five -gemini-cliis silently missing from init). @conciv/claude-connect(packages/claude-connect, 6 files / 317 LOC, deps: protocol + zod only) generates the claude marketplace/plugin/bridge/.mcp.json files (plugin-files.ts:69-87, returning protocolHarnessConnectFile[]), holds the install-state probe (install-state.ts:51-53), and two claude-agnostic utility modules (paths.ts,json.ts) that@conciv/harnessre-exports through shims (packages/harness/src/_shared/{cwd,json}.ts:1).- HARD CONSTRAINT: the CLI depends on
@conciv/claude-connectand NOT@conciv/harness(packages/cli/package.json:39-51), because commit 1b2126f extracted the package precisely sonpx conciv initstops dragging the agent SDKs (@anthropic-ai/claude-agent-sdk,@opencode-ai/sdk,@agentclientprotocol/sdk,@tanstack/ai*-packages/harness/package.json:66-75). npm dependencies are package-granular, so ANY import from@conciv/harnessre-lands that regression. The init-contribution channel must be dependency-light by construction.
Design
- Contract arm (
@conciv/protocol/harness-types): add an init-contribution capability toHarnessAdaptervia the existing union mechanism -{capabilities: ... & {init: 'files'}; init: HarnessInit} | {capabilities: ... & {init: 'none'}; init?: undefined}.initis a REQUIRED literal discriminant onHarnessCapabilities('files' | 'none'), never optional/boolean (codex review: optionality weakens the union guarantee to advisory).HarnessInitand everything contributions reference live in @conciv/protocol; contributions must NOT import CLI types - the CLI owns a translation layer contribution -> InitStep.HarnessInitdescribes what init does for this harness in data + pure functions: detection markers (bin name, config dir - subsuming today'sharnessMarkers), optional AGENTS.md teaching text, and the plugin/file contribution (generate files, install commands, installed-state probe). Exact field shape is the implementer's design, grounded in whatclaudeStepconsumes today (claude.ts:24-39,70-97). - One dependency-light home: a single
@conciv/harness-initpackage (deps: protocol + zod, exactly like claude-connect today) holds every harness's init contribution, keyed by harness id, each in its own module with a per-harness subpath export.@conciv/claude-connect's content moves in as the claude module (bridge, plugin-files, install-state, names);paths.ts/json.tsgo wherever their consumers need them (they are not claude-specific - decide placement, kill the_sharedre-export shims or repoint them). The CLI swaps its dep to@conciv/harness-init;@conciv/harnessimports the same modules so the adapter'sinitfield and attach.ts stay single-sourced. - Pipeline walks the contract:
stepList(pipeline.ts:105-113) dropsclaudeStepand instead maps consented harnesses to a genericharnessInitStep(contribution)for every harness whose contribution declares work.harness-detect.ts's duplicated marker list dies - detection derives from the contributions (fixing the gemini-cli omission or declaring itinit: 'none'explicitly). The claude behavior must come out byte-identical: same files, sameclaudeCLI invocations, same detect/verify probes, proven by the existingpackages/cli/test/steps/harness/claude.test.tsandinit-run.test.tssurviving with only import/wiring updates. - Delete
@conciv/claude-connect: remove fromPUBLIC_PACKAGES(packages/publish/src/guards.ts:26),.fallowrc.json:85, the lockfile, and all import sites (CLI init step, harness attach.ts/blocks.ts, the_sharedshims, tests). Changeset notes the package removal (pre-release, fixed-version group - verify the changesets flow tolerates a removed package; if not, document the release-time step).
Acceptance criteria
-
HarnessAdaptercarries the init-contribution arm via the existing capability-union mechanism; the capability-matrix runtime test extends to cover it - Every harness's init behavior (including "none") is declared on its adapter; no harness id is hand-listed in the CLI
-
conciv initfor claude is equivalent under fixed inputs: identical relative paths + file contents + modes + command argv + detect/verify results + manual-card text (NOT whole-home byte comparison - claude's own cache/marketplace records embed machine paths); existing claude step tests pass with only wiring updates - gemini-cli is either detected like its siblings or explicitly declared init-none - no silent omission
- Dependency direction is one-way by law: cli -> harness-init -> protocol and harness -> harness-init -> protocol;
@conciv/harness-initnever imports@conciv/harness. Guard: a PRODUCTION-CLOSURE test asserting the CLI's packed dependency closure excludes@conciv/harnessand every agent SDK (stronger than a dep-list check) -
@conciv/claude-connectis gone: no directory, no guard/fallow/lockfile entries, no pending-changeset references, no import sites; npm disposition (deprecate vs stop publishing) is a USER decision point at implementation time - Shims:
@conciv/harness/cwdis a public build entry - preserve, repointed at the moved module;_shared/json.tsis internal - retire it and update its import sites - AGENTS.md teaching text can carry optional per-harness content from the contribution (today's flat name-join remains the default)
- fallow audit clean; publint/attw green for the new package
Blocked by
- claude connect: shared plugin cache clobbers across projects #243 (the project-agnostic bridge fix lands in plugin-files/bridge first; this ticket then moves the fixed code, not the buggy code)
Out of scope
- Any new native connect path for codex/opencode/gemini/pi (their contributions start as detection + AGENTS.md teaching only; a future native integration is a new capability value on the same arm)
- The runtime
connect.plan/attachsurfaces (harness-types.ts:54-61) - they stay as-is; this ticket is init-time only
Spec review
- 2026-08-06: codex defensive review NEEDS-REVISION -> all 7 revisions folded above (required literal discriminant, no-CLI-types contract + translation layer, one-way dependency law + closure test, equivalence-not-byte-identity, npm disposition decision, shim disposition, baseline = origin/main at dispatch). Boundary and package-granularity claims verified sound.
Metadata
Metadata
Assignees
Labels
No labels
Activity
omridevk commentedon Aug 6, 2026
Codex defensive spec review: NEEDS-REVISION - boundary sound, no fatal flaw; revisions folded into the body now. The sharpenings adopted:
init: per-harness init contributions in @conciv/harness-init, claude-…