Skip to content

refactor: isolate OpenCode as a shared-interface adapter - #564

Merged
abogartz merged 21 commits into
abogartz:mainfrom
WhollyMindless:refactor/554-opencode-adapter
Nov 28, 2026
Merged

abogartz merged 21 commits into
abogartz:mainfrom
WhollyMindless:refactor/554-opencode-adapter

Conversation

@WhollyMindless

@WhollyMindless WhollyMindless commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

This replaces the legacy OpenCode integration with an adapter implementing the shared host API. The default plugin constructs createOpenCodeMemoryHost, calls setupMemory, and returns shared cleanup. Native hooks translate into that interface; there is no parallel legacy route into the engine.

Related to #554. Depends on #560 (interface/runtime/reference host). The separate oh-my-pi consumer remains in #561; upstream Pi is in #570.

Review only this layer: OpenCode changes above #560. All PRs target upstream main because the branches are on the contributor fork, so GitHub's default diff includes the unmerged foundation.

Scope

  • Inherit refactor: define shared host interface and reference harness #560's mechanical core-to-adapter import boundary. The normal unit suite rejects the review's one-line toolIdentity import into shared runtime setup, including type-only, re-export and literal lazy dependency routes.
  • Explicitly document the intentional memory_status description rewrite for harness statistics and reader/store scope; tool metadata is not claimed byte-identical for that tool.
  • Isolate tools/identity, lifecycle/context payload decoding, capture/transcript/model access, capabilities, native commands and terminal UI in src/adapters/opencode/.
  • Remove the original host/hook modules and preserve public ., ./tui and loose-discovery tui.ts entry points through forwarding exports.
  • Run the same reusable behavioral assertions as the reference host through native OpenCode stimuli and the production adapter: tools, write gates, project/global sharing, selected injection, identity moves, compaction, usage, delivery receipts, capture and cleanup.
  • Replace the unchecked SDK context cast with structural type compatibility. Support both asynchronous SDK default-model lookup and the older getter. Offer cancellation options to supporting hosts and reject already-aborted calls locally; pinned @opencode/plugin 2.0.32 drops the request-options argument, so its in-flight requests are not cancelled by this signal.
  • Retain existing behavioral assertions and add real-host shared-store scenarios, cooperative teardown controls and the standalone shutdown reproduction. Await viewer child teardown before removing its files.

Shared runtime/interface/reference files are identical to #560. No oh-my-pi implementation or SDK dependency is included in this layer.

Parity review and boundary map connects preserved behavior to its tests and lists intentional changes and limits.

Current base synchronization

Synced with main 0.38.0 (14df0040) through #560. The new session-only memory behavior passes through the production OpenCode adapter. The common suite now has nine scenarios, including author-only context, no durable row, peer isolation and expiry at compaction.

Windows/Bun 1.4.4 repair validation: 39 adapter and capture-disposal tests passed, including a characterization using the real pinned SDK which resolves a late answer after abort. Separate runtime tests verify that abandoned or disposed capture cannot persist that answer. The complete downstream stack passes 2,067 unit tests, 34 skipped, zero failures, plus typecheck, lint, formatting and comment policy. Shared production/interface/reference files remain identical to #560, including recent-window capture rendering without shifting cursor positions; current-head CI validates this adapter separately.

Previous acceptance baseline (before this synchronization)

Includes main 0.37.4 (7aa710ca) through #560. Fresh Bun 1.4.4 / Windows / OpenCode 2.4.2 checks:

  • Comment policy, typecheck, lint and formatting pass.
  • Unit suite: 1,962 passed, 34 skipped, zero failures.
  • OpenCode E2E: 61 passed, one known failure; source/packed loading and the relocated TUI JSX entry pass.
  • The same common runtime scenarios pass for the reference host and this adapter.
  • A fresh clean-main control has 54 passes and three failures. The two viewer fixture races are resolved here; the same standalone-shutdown failure remains.

The standalone assertion stays enabled. OpenCode can exit before asynchronous plugin cleanup completes on Windows; the independent reproduction is OpenCode #66868. Cooperative server shutdown passes. The runtime prevents late answers from producing writes, but the pinned SDK does not cancel the underlying request. Bounded cleanup establishes neither provider billing cancellation nor forced-exit durability.

CI covers unit/adapter tests on Linux/Windows and real OpenCode integration on Linux with pinned 2.0.26 and 2.4.1. Check the current head's CI before landing. Maintainer review is requested on OpenCode parity and the boundary; #570 supplies the upstream Pi adapter as a separate review layer. Acceptance of the full stack remains pending.

Equivalence review follow-up

At f342f21a, the mechanical boundary blocker is addressed in #560 and inherited here. The exact M1 mutation passes the old layout/lint checks and fails the new AST boundary gate; restoring the file passes. The focused OpenCode/host run passes 37 tests, and the complete downstream unit suite passes 2,067 tests, 34 skipped, zero failures. Typechecks and lint pass; current-head CI is rerunning.

The parity document now distinguishes synchronized main 14df004 (0.38.0) from the historical 0.37.4 run and discloses the changed memory_status description. A quote-aware AST comparison finds 11 moved transcript tests, all with bodies equal modulo whitespace; the single-quoted non-arrays case accounts for the count discrepancy. No production source or dependency file changed relative to reviewed head 65614031. The review's byte/stress measurements remain evidence for that head, not a newly executed measurement here. Maintainer/reviewer re-evaluation remains pending. The 26-check total refers to the previous four-PR stack (5 + 5 + 7 + 9), not this PR alone.

@WhollyMindless
WhollyMindless marked this pull request as ready for review November 28, 2026 02:56

@ocsi-reviewer ocsi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full review — PR #564 at 6561403 (adversarial equivalence pass)

Seat: macOS 15.7.7 arm64, Bun 1.4.3, live checkout main at 14df004 (clean). Base for all
measurements: 14df004 = merge-base with origin/main (head is synced to it).
Reviewer: ocsi-reviewer. This is the T3 full review for MVP criterion B.

Blind pass sealed before the body was read (/private/var/folders/.../564-review/blind-theory.md):
theory = extraction into src/host ports + src/adapters/opencode + shared src/runtime, with
two predicted break axes — (1) delivery-byte drift through the new appendSystem/appendResult
indirection, (2) lifecycle/accounting drift at teardown, restart, compaction. Differences from
the author's stated intent after reading the body: the body discloses axis (2)'s worst parts
(cancellation, forced exit) and matches the delivered structure; axis (1) is not disclosed as
a byte change anywhere, and measurement found one real one (finding 1). The body's structure
claims all matched the code. No surprise delivery surface beyond finding 1.

Governing constraint extraction (issue #554 "Binding design statement", verbatim comment 7242836772)

Testable clauses: C1 async across the boundary wherever the host may be async; C2
schema-first inputs/outputs; C3 lifecycle semantics written down (compaction, session start/end,
prompt, forced exit, mid-turn failure, partial delivery); C4 defined failure behavior (declared
degradation or error); C5 quirks translated, never negotiated — no per-host exemption in a
clause; C6 capability declarations verified, not trusted — a lie must fail at install time;
C7 the seam enforced mechanically — core importing from an adapter fails a rule; C8 the
adapter is the only path by which OpenCode works; C9 same store + same prompt → same bytes
regardless of host; C10 a conformance suite exists and passes unmodified; C11 legacy removal
only with parity green in the same change (safe landing order A→B→D→C).

Clause outcomes: C1 holds (all port methods await or accept promises; async defaultModel
supported and tested). C2 partially — tools carry runtime-validated JSON Schema, but port payload
objects (SessionUsage, CompactionEvent, capability shapes) are TS interfaces only; drift is a
type error at compile time inside this repo, not a runtime validation failure at the boundary
(#560's contract; named, non-blocking). C7 is violated — blocker 1. C6 partially satisfied
(finding 4). C8 holds: src/index.ts forwards to the adapter; no other registration path exists
(grep: no tool.hook/session.hook/tool.transform outside src/adapters/). C11 holds: legacy
removal and parity evidence land in the same diff. C3/C4/C5 hold for what the adapter needs;
promptDependentCache and shutdown declarations are honest ("best-effort"/"no-cleanup").

1. Delivered bytes — head vs current main, same store, same prompt, one driver, both trees

Driver: identical scripted real-surface ctx (tool.transform/hook, session.hook/context/get,
event.subscribe, generate.text, model.default.get), one store copied per tree; stage=write seeds
14 rows via memory_remember, stage=read drives prompt → context → read-result pull → context →
compaction → usage → idle capture → dispose.

Surface base 14df004 head 6561403 verdict
14 tool names 14 14 identical
14 tool schemas (canonical JSON) sha256 d086fe764dfbaef0… sha256 5774361fac88401a… DIFFERS — only memory_status.description; other 13 byte-identical
system digest (context #1) bytes equal identical
post-pull system channel (context #2) bytes equal identical
compaction anchor bytes equal identical
pull block text …\n## Related durable memory (pull) … [607a88ca9f968c01] same text, nonce [fd0c76e73f20d83d] identical; bracket is randomBytes(8) in both trees (base src/events.ts:181, head src/runtime/events.ts:150)
capture prompt + model bytes equal identical
memory_recall reply bytes equal identical
memory_status reply — + HARNESS ACTIVITY section differs, disclosed intentional (parity doc)
seeded store after write 7 files file sets equal; row bodies equal (ts-normalized) identical
read-stage store — evidence/hits/status gain harness=opencode fields additive telemetry, disclosed

Finding 1 (named in full, not disclosed as a byte change): memory_status description was
rewritten. Old: "Plain-text memory report for chat clients … recent blocked writes with gate
reasons (filtered to this reader's evidence visibility, #306) … Aggregate STORE counts are
machine-wide — they count every repository's rows by decision (#213 B) …". New: "Read-only memory
report: … recent blocked writes visible to this reader, STORE stats, and HARNESS ACTIVITY (combined
and per-harness retrievals, reported session tokens, and capture estimates). Aggregate counts cover
the shared store across repositories; memory ownership stays project/global." Dropping the #306
and #213 B refs from a shipped string is a prose-rule improvement and the new promise halves are
pinned by output asserts (test/simulator/harness-stats.test.ts asserts HARNESS ACTIVITY,
per-harness lines, input 300/200/100, not reported), so this is not a behavior break — but the
body never names the description change and nothing pins the description string itself (residual
ticket below).

2. Test-surface audit (against current main, not the 0.37.4 base the parity doc cites)

git diff --name-status 14df004..6561403 -- test/ e2e/: 0 deleted, 0 renamed, 35 added, 25
modified
files. Title-level extraction over both trees: base 1,610 unit tests → head
1,679 (+69, 0 lost titles). Every base title exists at head.

  • "Eleven transcript tests moved intact": measured 10 titles moved from
    test/capture/capture-parse.test.ts (26 → 16) into test/adapters/transcript.test.ts; all 10
    bodies byte-equal modulo whitespace (per-title body compare). The claim of 11 is one off —
    likely counting the new test/host/transcript.test.ts case. Nit; nothing lost.
  • Two modified files changed same-title bodies; both are strengthened:
    test/inject/pull-receipt-hooks.test.ts adds harness to the required evidence key set;
    test/security/security-capture-crop.test.ts now drives the real two-stage path
    (flattenTranscript(decodeTranscript(…))) with identical assertions.
  • e2e changes are strengthening: --server injection, packed ./tui export resolution, stricter
    capture expects. The only added skip is one test.skipIf(process.platform !== "win32") in the
    new test/identity/short-path.test.ts — a legitimately Windows-only platform gate on a new test,
    not a disable of an existing assertion.

3. Public surface

. (index.ts shim) byte-identical; src/index.ts exports the same names
(default, SelfImprovement, resetCaptureCooldowns, resetSessionModels, TURN_END_EVENTS,
CAPTURE_EVENT_TYPES, captureTriggerFor); ./tui specifier unchanged (target moved to
src/adapters/opencode/tui/panel.tsx); loose tui.ts forwards, same default export;
commandsDir() moved out of src/core/config/paths.ts into the adapter (it reads
OPENCODE_COMMANDS_DIR verbatim — my driver confirms the same install behavior). No export
removed or renamed. No public break.

4. Stress outcomes (same stimulus both trees)

Scenario Observation Verdict
write fails mid-turn (store chmod a-w before memory_remember) both throw EACCES … evidence/….logfmt identical
second writer holds the store (two concurrent processes, same store) replies and final jsonl equal (normalized) identical
compaction during a turn (pull held, compaction fires between context calls) all system pushes and placed pull bytes equal identical
forced exit (kill -9 mid-capture, 700ms) store state equal except additive harness fields identical; durability itself is the disclosed OpenCode-side limit (upstream anomalyco/opencode#66868) — unknown outcome, not a loss claim
restart with existing state (second process, same store) delivered system bytes equal identical

5. Design-statement enforcement (measured, head scratch copy, reverted after)

  • M1 — core imports from the adapter (tests clause 7): SURVIVES. Added
    import { toolIdentity } from "../adapters/opencode/identity.ts" to src/runtime/setup.ts:
    tsc --noEmit clean, biome lint exit 0 (1 warning, not an error), focused
    runtime/host/adapters suites 213/213 pass, full suite 2,029 tests, 0 fail. The only
    noRestrictedImports rule in biome.json guards src/capture/** → telemetry/record; there is
    no rule and no import-boundary test covering core → adapters. → blocker 1.
  • M2 — legacy route: src/events.ts is gone; no hook registration exists outside the adapter. C8
    holds.
  • M3 — adapter breaks one contract clause ("True means placed"): flipping writePullIntoResult's
    no-placement return false to true → 2 fails, both on-promise
    (the registered pull hook credits a row only when it can append the block;
    writePullIntoResult > Scenario: a result with nowhere to write reports failure, not delivery). Killed.
  • M4 — lifecycle calls removed: dropping the adapter's session.hook("compaction") subscription →
    21 errors across focused suites; no-oping sessions.prompt in src/runtime/events.ts → multiple
    delivery-byte tests fail. Killed, by named relevant tests.
  • M5 — capability lie (usageReceipts: true declared, usage decoding disabled): 7+ fails including
    the OpenCode shared-runtime contract and the memory_status wiring. Behavior lies are caught by the
    conformance bank — but by test time, not install time; capture availability is the only
    declaration the core derives itself (setupMemory recomputes capture.* from method presence).
    Non-capture declarations are trusted (clause 6, finding 4, ticketed).

6. State/surface matrix (head unless noted; U = uncovered)

Event \ surface delivered bytes recall/status output status+report evidence log counters
legacy hooks present (base) baseline driver baseline baseline baseline (no harness field) baseline
adapter path only (head) equal per §1 equal except disclosed HARNESS ACTIVITY equal + harness lines +harness= fields (additive) unchanged
repeat turn, no store change equal (epoch reuse) equal — equal equal
the write itself equal store rows equal equal equal + harness tag equal
compaction anchor bytes equal equal — equal + tag equal
compaction mid-turn equal (§4) equal — equal equal
restart equal (§4) equal equal append-only rebuild from disk (simulator test)
forced exit store equal modulo harness fields U (no live process after SIGKILL by design) U +tag U
second session, same repo equal equal — equal equal
second harness, same store (real host) U U U U U — simulator covers two hosts in-process; real-host e2e shared-store.test.ts is OpenCode-only (ticket)
capability the host lacks simulator missing generation …, missing sinks tests U on a real host U U U
reader without visibility rule gains a normalize-equality short-circuit in matchesRepository (3 added lines, disclosed Windows-canonicalization change; new test/identity/short-path.test.ts pins it but skips off Windows — runs in test-windows, uncovered on this seat) equal — equal —

Promises row (model-facing text added by this diff): memory_status description —
"reported session tokens" matches the printed line reported session tokens: and the
not reported fallback is asserted; "capture estimates" prints under an explicit
"estimates" heading; "visible to this reader" matches readBlocked filtering.
host/lifecycle.ts "True means placed, not delivered" — pinned by M3's killers.

7. Blockers

  1. Core can import the adapter; nothing catches it (clause 7, proven by M1). The binding
    statement: "The seam is enforced mechanically. Core importing from an adapter fails a rule, not
    a reviewer's memory." At head it fails nothing — typecheck, biome, the full 2,029-test suite, and
    by inspection the CI jobs all stay green. This is the contract bypass the review gate names as a
    blocker: a competent maintainer reintroduces a core→OpenCode dependency silently, which is
    exactly the "semantic breaking" class the statement says only a machine may stop.
    Unblock: a mechanical boundary — e.g. a biome.json noRestrictedImports override for every
    core directory (the repo already uses this mechanism for capture→telemetry) or an import-scan
    layout test, pattern **/adapters/** denied outside src/adapters/** with src/index.ts
    explicitly exempted as the entry forwarder — plus a fail-before proof that the rule kills M1's
    one-line import.

8. Nits (do not hold)

  • Finding 1: body/parity-doc never name the memory_status description rewrite (see ticket).
  • "Eleven transcript tests" measured as ten; the parity doc's baseline still cites 7aa710ca
    (0.37.4) while the branch is synced to 14df004.
  • Prose audit: added lines carry no internal issue refs/dates/narration (the two #66868 mentions
    are external-repro links in docs/tests, as intended); root README.md untouched; docs/README.md
    gains two index lines.

9. Suite / CI

Check Result
bun run test head (my seat, Bun 1.4.3 / macOS arm64) 2,029 tests: 2,006 pass, 23 skip, 0 fail
bun run test base 14df004 (same seat) 1,937 tests: 1,915 pass, 22 skip, 0 fail
bun x tsc --noEmit clean
biome lint / format:check exit 0 (205 infos)
bun run lint:comments clean (389 added comment lines)
gh pr checks 564 lint pass, smoke pass, smoke-stable pass, test pass, test-windows pass (5/5)
e2e (real OpenCode binary) not run at this seat; covered by smoke/smoke-stable CI on Linux pinned 2.0.26/2.4.1

The body's "26 CI checks" claim is not verifiable against this head, which shows 5 checks;
assumed to span the staged family — naming it here as unverified rather than correcting the body.

10. Judging #564 without #560 — and the hold

6561403 is a merge of test/554-harness-contracts at 3509de0 into refactor/554-opencode-adapter:
#564's head is a superset of #560's head, so every measurement above ran against exactly what
#560 would land plus this layer. Review-verdict: #564 is judgable now for OpenCode parity, the
stress battery, and the seam; it is not mergeable independently — shared contract/runtime files
are the #560 surface, the stated order is #560 → #564, and any #560 blocker changes this head and
requires this byte table to be re-run. On the hold: issue #554 carries "Hold off on review"
(comment 7234497606, author WhollyMindless, 2026-11-28T05:09:56Z) — inside the dispatch scan
window but not relayed into the review brief (brief-completeness gap, reported upstream).
#560's body states the hold was lifted; CI is green at both heads; my findings here stand
independently of the hold's status.

11. What remains unverified (named, not hidden)

Windows/Bun 1.4.4 behavior (CI-only here); real-host e2e locally; forced-exit durability (host-side
limit, upstream issue open); provider cache acceptance (promptDependentCache is declared, not
measured by this review); cross-harness real-host shared-store (ticketed); install-time capability
verification for non-capture declarations (ticketed); interactive TUI beyond the packed-entry test.

Residual tickets filed with this review: #572 (description-string pin), #573 (install-time capability
verification), #574 (real-host cross-harness shared-store guard).

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Note

🤖 gpt-6-astra responding on behalf of WhollyMindless

@ocsi-reviewer The mechanical-boundary blocker is addressed in #560 928f83c8 and inherited here at f342f21a, then propagated through #561 and #570.

  • The AST boundary gate runs in the normal unit/CI suite across shared src/ directories. It checks value/type imports, re-exports, literal dynamic imports and require, including routes through entry forwarders. Adapter files and src/index.ts are explicitly exempt.
  • I injected your exact toolIdentity import into src/runtime/setup.ts. Existing layout and lint checks exited 0; the new test exited 1 with src/runtime/setup.ts:1: core imports ../adapters/opencode/identity.ts. After restoring the file, it passed. The focused OpenCode/host run passed 37 tests; the complete downstream suite passed 2,067, with 34 skipped and zero failures. Root/both SDK typechecks and lint pass. CI is rerunning.
  • The parity document now names the memory_status description change and distinguishes the synchronized 0.38.0 baseline from the historical 0.37.4 run.
  • One count differs from your finding: an AST comparison finds 11 moved tests, all with bodies equal modulo whitespace. The single-quoted non-arrays yield "" and the cap is 40 user turns title is included. No normalized-transcript test is counted as moved.

Production source and dependency files are unchanged from 65614031; this follow-up adds only tests/documentation. Your private byte/stress driver was not rerun here. The 26-check figure was the four-PR total, 5 + 5 + 7 + 9, not #564 alone.

The separately ticketed nonblocking items are not claimed resolved. Real-host cross-harness coverage is in the later adapter layers' integration/oh-my-pi/shared-store.test.ts (#561) and integration/pi/shared-store.test.ts (#570). Please recheck the boundary gate at the updated heads.

@ocsi-reviewer ocsi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delta re-check at f3acb39 — blocker M1 resolved; I withdraw the mechanical-boundary blocker

Seat: macOS 15.7.7 arm64, Bun 1.4.4 (38afee6c8), live checkout main at 14df004, clean before and after. Reviewer: ocsi-reviewer. READ-ONLY pass; scratch worktrees only, removed after.

Head movement before this pass. The re-check was scoped to f342f21, but the PR head at my start (2026-11-28T19:16:15Z) was already f3acb39a — f342f21 plus the merge of #560's head a3b8c735 ("legacy adapter boundary") as a second parent. I measured the real head f3acb39 and re-measured f342f21 wherever the two differ. No further movement and no new comments on #560/#561/#554/#575/#564 through posting time.

What changed since reviewed head 6561403

Four commits, and the cumulative tree delta is tests + docs only (docs/internals/host-contract.md, docs/internals/opencode-parity.md, +test/host/import-boundary.test.ts, +test/adapters/transcript-privacy.test.ts) — production src/ is byte-for-byte unchanged from 6561403, as the author's follow-up claims.

1. The blocker mutant, re-run

test/host/import-boundary.test.ts is AST-based (@babel/parser): it scans every src/** file except adapters/** and src/index.ts, resolves every relative specifier appearing in ImportDeclaration, ExportNamedDeclaration, ExportAllDeclaration, ImportExpression, TSExternalModuleReference, TSImportType, and require() calls, and fails on any that lands in src/adapters/, src/tui/, an entry forwarder, or the legacy translator set added in a3b8c735. It self-tests: expect(files).toContain("runtime/setup.ts"), expect(files.length).toBeGreaterThan(100), and 18 synthetic shapes each asserted to produce exactly one violation (values, import type, export *, named re-export, dynamic import(), require, import = require, typeof import(), ../runtime/../ traversal, forwarders, every legacy path, ../core/host extensionless) plus two negative controls.

Mutant Result Killed by
M1 (the blocker, verbatim): import { toolIdentity } from "../adapters/opencode/identity.ts"; in src/runtime/setup.ts Killed shared source cannot depend on adapters or their entry forwarders → src/runtime/setup.ts:2: core imports ../adapters/opencode/identity.ts. Full suite with the mutant: 2013 pass / 23 skip / 1 fail — the single failure is the boundary test citing the import. Not incidental.
M2 (my choice, the "lazy dependencies" claim): export const __m2 = () => import("../adapters/opencode/identity.ts"); appended to src/inject/epochs.ts Killed Same assertion → src/inject/epochs.ts:783: core imports ../adapters/opencode/identity.ts
M3 (residual probe, not the blocker): import * as __m3 from "opencode-self-improvement/tui"; appended to src/inject/epochs.ts — a bare self-package specifier; the exports map resolves ./tui to src/adapters/opencode/tui/panel.tsx Survived Boundary test passes (the rule only inspects specifiers starting with .), typecheck exit 0, lint exit 0, full suite 2014 / 23 / 0 (the import resolves and executes under the suite)

With M1 in place, typecheck and lint still exit 0 — exactly the original failure mode — so the new test is genuinely the enforcement clause 7 demanded ("Core importing from an adapter fails a rule, not a reviewer's memory"), not decoration behind tsc. All mutants reverted; each worktree verified git status --porcelain empty.

2. #575 verdict

Probe as ticketed: import { createOpenCodeHost } from "../core/host.ts"; at line 1 of src/runtime/setup.ts.

Head Boundary test Typecheck Verdict
928f83c (#560 old head) passes (no legacy deny set yet) exit 0 Survives, as ticketed — surviving path verbatim: import { createOpenCodeHost } from "../core/host.ts"; into src/runtime/setup.ts; full suite with it: 1965 / 23 / 0, lint exit 0
f342f21 passes (no legacy deny set) TS2307, src/core/host.ts was deleted by the relocation Dead path only incidentally — the file is gone, the rule still wouldn't name it
a3b8c73 (#560 head) fails (legacyAdapters names src/core/host.ts) exit 0 Killed by the rule — enforcement, not absence
f3acb39 (#564 head) fails TS2307 Killed by the rule (flagged even though the module no longer exists)

Re-creation scenario at f3acb39: recreating src/core/host.ts as export * from "../adapters/opencode/host.ts"; and importing it yields both violations — src/runtime/setup.ts:1: core imports ../core/host.ts and src/core/host.ts:1: core imports ../adapters/opencode/host.ts. #575 is closed at the current heads of both PRs. One correction to the architect's close comment on #575: typecheck does not pass "in both cases" — with the probe present in the relocated layout it fails TS2307; the deny set is what makes the kill topology-independent. And "no surviving import path … that I can construct" holds only for relative specifiers: my M3 above survives on the current f3acb39 head.

3. Delivered bytes, origin/main 14df004 vs f3acb39

Same driver, store, and prompt sequence as the prior review (real plugin entry via test/harness.ts, identical seeded store):

  • TOOLS_SHA df0f1c35… → c7d02812…, N=14; per-tool diff is only memory_status 2df9fc1b… → d6f0d5fc… — 13/14 schemas byte-identical, the single known, now-disclosed description diff.
  • System/pull channels byte-equal on both sides: SYS1 32050438f6f28bd5/267 B, RECALL 6ffc5836d3f0e151/228 B, PULL1 fd44a843453bd1a0/244 B, PULL_APPENDED true, SYS2 3cc6e9e182d1dcb0/459 B, SYS_STABLE false. Unchanged from the prior review.

4. No test deleted or weakened 6561403 → f3acb39

JUnit case sets: 2029 → 2037. Removed: none. Added: exactly the 2 boundary tests + 6 private {reasoning,thinking} parts cannot leak through {parts|content|text}/{content|text} fallback regressions. No existing test file was modified in the delta (git diff --name-status: only 2 docs M, 2 test files A).

5. Suite and CI at f3acb39

  • bun run test (this seat, macOS arm64, Bun 1.4.4): 2014 pass / 23 skip / 0 fail, 2037 cases, 15,962 expect() calls, 48s. (The author's 2,067/34 figures are platform-dependent skip sets; not chased.)
  • typecheck exit 0 · lint (biome lint + format) exit 0, 818-warning baseline · lint:comments clean (392 added comment lines vs merge-base).
  • gh pr checks 564: lint pass (10s), smoke pass (1m20s), smoke-stable pass (1m48s), test pass (57s), test-windows pass (3m6s).

Residuals named (non-blocking, filed nowhere by me — this pass is read-only)

  • R-A (new): the boundary rule skips bare self-package specifiers; import * as x from "opencode-self-improvement/tui" reaches src/adapters/opencode/tui/panel.tsx through the exports map and passes rule, typecheck, lint, and suite. Sibling of #560's exports-map finding; the rule should resolve bare specifiers equal to the package name (or pin the exports map against the adapter deny set).
  • R-B: the AST check fires on StringLiteral only; a template-literal specifier import(`../adapters/…`) is not flagged. Same gate as R-A; no such import exists today.

Verdict

Approving. The named blocker M1 dies on the on-purpose scan assertion (and only there, with typecheck/lint blind exactly as before), the delivered-bytes table is unchanged from the prior review, and no test was deleted or weakened in the delta. I withdraw the mechanical-boundary blocker (mutation M1) by name.

Landing still waits: #560 remains under its open privacy blocker — a3b8c735's six regressions claim to fix it and look real from here, but verifying that fix is #560's own re-review, not this pass — and #564 is explicitly the equivalence proof sequenced after #560's contract is accepted. Nothing merges on this review.

@abogartz
abogartz merged commit 0817b7d into abogartz:main Nov 28, 2026
5 checks passed
@abogartz-opencode-self-improvement

Copy link
Copy Markdown

🎉 This PR is included in version 0.38.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants