3 Commits
Author SHA1 Message Date
John Smith e8acb05d56 Audit remediation: P0 shell/guard bypasses + P1/P2 fixes (rework 1 re-applied permission-guard) 2026-10-18 02:36:56 -04:00
Claude de9ab5c5db fix: make the plugin work in the real OpenCode V2 host
- Pass tool inputs to the host as plain JSON Schema (toHostInputSchema via
  zod-to-json-schema). The host rejects zod v3 schemas, so every tool was
  silently dropped at registration.
- setup() now awaits every hook/transform registration and resolves to a
  cleanup function that disposes them; returning the doctor report made the
  host crash on unload. setupOpenCodeV2Harness() exposes the report.
- Read plugin options from ctx.options (where the host delivers them).
- MCP server seeding is opt-in (seedRecommendedMcp) and uses the
  Mcp.LocalConfig shape; it no longer runs bunx/npx --yes by default.
- Meta.txt calibration falls back to a one-line matcher if upstream rewords
  the subagent bullet; documented the event.system amendment in README/SPEC.
- Single version source (src/version.ts), bumped to 1.0.7.
- Tests: host contract, partial hashline anchor mismatch, calibration.
- make host-test / scripts/host-test: loads the plugin into anomalyco/opencode
  at a pinned commit via the upstream plugin fixture.
- CI workflow: check, accept, build, and the real-host test on every PR.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_012AuVk4nEvBXaTjs4G6wdW4
2026-10-16 14:58:42 +00:00
John Smith db2672bd8b feat(wave-3): unified OpenCode v2 plugin entrypoint + QA-ready gates
- src/index.ts: activate/createHarnessPlugin registering 5 tools
  (file_hash_read/edit, ast_structural_search/rewrite, ui_geometry_audit)
  and 3 hooks (permission evaluate -> evaluateBoardGuard,
  tool.execute.after -> recordAndEvaluateCircuitBreaker,
  session context -> registerContextBudgetHook with KV-cache invariants);
  getRecommendedMcpConfig re-export; all Wave 1+2 modules re-exported.
- test/plugin.test.ts: 61 tests (registration, zod validation, end-to-end
  tools, guard Rules 1-4, breaker thresholds, KV invariants, MCP shape).
- scripts/accept/wave-3.sh + README.md + docs/reports/wave-3.md.
- 161 pass / 0 fail; make accept all-green.
2026-10-15 18:39:47 -04:00