Skip to content

Repository files navigation

OpenCode Harness

A deterministic, policy-driven orchestration harness for OpenCode and OpenChamber. It keeps task truth, routing, contracts, workspace isolation, verification, review, and acceptance outside model conversation state.

Current release: 2.3.1.

Architecture

  • Luna Control is the persistent user-facing router and operator.
  • The deterministic runtime owns task/progress ledgers, state transitions, contracts, path ownership, verification, exports, and acceptance.
  • Contract-scoped evidence, architect, worker, integration, reviewer, and gate roles are disposable.
  • .harness/policy.jsonc defines active policy; runtime code enforces it; templates generate thin OpenCode agents, commands, and skills.
  • AFT is the exact-code layer, Graphify is an optional architecture accelerator, Magic Context supplies advisory history, and native OpenCode Task provides isolated child sessions.

See .harness/architecture.md for the full design.

Requirements

  • Node.js 22 or newer
  • npm
  • OpenChamber 1.19.0 with its managed OpenCode 1.18.21 runtime
  • Windows 10/11 for the supported activation workflow
  • An OpenCode provider configuration that exposes the models selected in .harness/policy.jsonc

The runtime libraries are mostly platform-neutral, but automated OpenChamber discovery and deployment are currently validated on Windows. Set HARNESS_OPENCODE_PATH to override managed OpenCode discovery.

Install and verify

git clone https://github.com/Sandvich1337/Opencode-Harness.git
cd Opencode-Harness
npm ci
npm run check
npm run smoke

Useful commands:

.\scripts\harness.ps1 validate-policy
.\scripts\harness.ps1 render-agents --check
.\scripts\harness.ps1 doctor
.\scripts\harness.ps1 doctor --round-trip

Safe activation

Activation changes the current user's OpenCode configuration and deploys generated agents, commands, and skills. It is deliberately two-step and archives the previous config before deployment.

  1. Preview the exact candidate without changing active configuration:

    .\scripts\activate-master-v2.ps1
  2. Review the returned digests and confirmation prompt.

  3. Deploy only with the fresh confirmation ID:

    .\scripts\activate-master-v2.ps1 -Deploy -ConfirmationId <id>
  4. Restart OpenChamber/OpenCode and run the doctor.

Do not hand-edit .harness/generated/. Change policy or templates, run npm run render-agents, then run npm run check.

Tool policy

  • AFT: authoritative exact inspection, edits, diagnostics, and focused checks.
  • Graphify: conditional orientation for unfamiliar or cross-package architecture.
  • Magic Context: advisory history and context compression, never current task truth.
  • Native Task: fresh child reasoning contexts; writers require isolated workspaces.
  • MCP: enable only route-required servers and avoid secret-bearing raw payloads.

These tools are optional integrations and are not bundled by this repository. The runtime has deterministic fallbacks where declared by policy.

Development

npm ci
npm run check

npm run check runs TypeScript validation, the Node test suite, policy validation, and generated-output drift checks. Please read CONTRIBUTING.md before opening a change.

Security

Do not commit live task artifacts, runtime captures, credentials, or local migration evidence. See SECURITY.md for private vulnerability reporting guidance.

License

MIT

About

Deterministic, policy-driven orchestration harness for OpenCode and OpenChamber

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages