Skip to content

docs(harness): define the minimal harness interface + progressive-enhancement tiers #121

Description

@slowdini

Part of #113 ("Instant magic"). The Epic 1 "instant magic" deliverable — the conservative slice: a documented minimal interface, not yet data-driven descriptors (that's #E).

Why

#113's core goal: stop forever playing catchup on harness compatibility. Today a new harness must be wired across two dispatch mechanisms and a ~20-method HarnessAdapter trait, audited via docs/harness-parity.md. Once the in-session mechanism is gone (#B), the "two parity axes" framing collapses to one, and we can express compatibility as a minimal interface every harness must satisfy + optional capabilities that raise fidelity — and document the known mappings instead of treating every method as required.

Honest floor (must be reflected in the framing): three concerns are genuinely per-harness code, not documentable mappings — transcript parsing (claude -p stream-json vs Codex item.completed), native skill staging/rendering (.claude/skills Skill-tool list vs .agents/skills ## Skills vs .opencode/skills <available_skills> XML), and write-guard hooks. So "any harness via docs alone" applies to the baseline, with fidelity as opt-in code.

Scope

  • Rewrite docs/harness-parity.md around one dispatch mechanism + a baseline/enhancement contract.
  • Define the minimum operating list (zero harness-specific code): (1) a headless exec command template (invoke with a prompt, capture stdout/stderr); (2) the agent writes outputs/final-message.md, or --no-stage inlines the skill into the prompt. This already yields llm_judge grading + the detect-stray-writes post-pass.
  • Define progressive enhancements, each a documented adapter capability with a default/fallback:
    • transcript parser → unlocks transcript_check + token/cost capture;
    • native skill staging dir + skills block (vs --no-stage inlining);
    • model flag;
    • write-guard hook (vs detect-stray-writes fallback).
  • Audit the HarnessAdapter trait: annotate each method baseline-required vs optional-with-default, and add default impls so a baseline harness need not implement the optional ones.
  • Ship the "known mappings" table Instant magic (what a clever name!) #113 envisioned: harness → exec template, events filename, skills dir, skill-block format.
  • README "Harnesses" intro: point at the reframed doc.

Files

docs/harness-parity.md (rewrite), src/adapters/harness.rs (trait doc comments + default impls), README.md ("Harnesses" intro).

Acceptance criteria

  • The doc describes a single mechanism and a clear baseline-vs-enhancement contract.
  • The trait visibly marks baseline-required vs optional-with-default methods.
  • A reader could wire a baseline harness from docs + --no-stage without writing a transcript parser.

Dependencies

Depends on #B; benefits from #C landing first.


Filed from the #113 feasibility/breakdown plan.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions