Skip to content

feat(harness): v2 host smoke test and config schema validation in CI (issue #27) - #35

Merged
diegohb merged 4 commits into
mainfrom
v2/issue-27-verification-harness
Oct 6, 2026
Merged

diegohb merged 4 commits into
mainfrom
v2/issue-27-verification-harness

Conversation

@diegohb

@diegohb diegohb commented Oct 6, 2026

Copy link
Copy Markdown
Member

C4 of spec #23.

What

  • Verification harness (tests/v2-host.test.ts, tests/fixture-config-schema.test.ts + support classes) that loads the built package entry the way the v2 host does — pinned @opencode/plugin@2.0.23 module loading and Effect activation — and audits registrations against the real @opencode/schema: all ten agents decode against Agent.Info, exactly one permission evaluate hook, hook rewrites bundled external_directory asks end to end. Negative controls prove the audit fails on registration loss.
  • Produced fixture configs (created default, splices into rich v2 configs, legacy-tolerated no-ops, README quick-start snippet) validated against the pinned Config.Info; v1-shaped configs rejected.
  • Dedicated V2 verification harness CI job.

Key finding (facts record §14.6, settled negative)

Under Bun, Host.resolve's root-index fallback is unreachable: Bun.resolveSync throws ResolveMessage, which is not an instanceof Error, so the candidate-miss filter never catches and the core loader disables the plugin at the entry stage. The package had no exports map — consumers were silently registering nothing. exports["./server"] added; generated-package templates flagged in the record (§13 row 9) for the guidance tickets.

Facts write-back

docs/reference/opencode-v2-facts.md: §14.6 settled negative with mechanism; items 1,2,3,4,7,8 recorded as not reachable from a plugin-package harness; item 5 partially confirmed (pinned shapes); §7 amended — every plugin package must declare exports["./server"].

Ref #27

@diegohb
diegohb merged commit 72bb363 into main Oct 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant