Skip to content

refactor: define shared host interface and reference harness - #560

Merged
abogartz merged 15 commits into
abogartz:mainfrom
WhollyMindless:test/554-harness-contracts
Nov 28, 2026
Merged

abogartz merged 15 commits into
abogartz:mainfrom
WhollyMindless:test/554-harness-contracts

Conversation

@WhollyMindless

@WhollyMindless WhollyMindless commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

This extracts a shared host interface and memory runtime, with a programmable reference host that runs the real engine without installing a production harness. OpenCode keeps its default package entry points. Its existing glue already calls the shared runtime; #564 relocates that glue into src/adapters/opencode/ and binds it to the shared conformance suite.

Related to #554. Review/landing order: #560 → #564 → #561 → #570. This is an independently usable foundation for continued development. #564 completes the OpenCode adapter extraction; #561 contains the separate oh-my-pi consumer. #570 adds upstream Pi as a separate layer of the maintainer's requested MVP; maintainer acceptance remains pending.

Ready for maintainer review

The four layers are ready for external review in the order above. The previous 26-check CI baseline passed at #560 3509de09, #564 65614031, #561 27562135 and #570 5ba9f1ad. The Pi-family adapters now use SDK-default output budgets and runtime cancellation instead of the adapter's 2,048-token cap and 20-second deadline. Real-host regressions verify capture after a 30-second response delay and 3,000 simulated reasoning tokens, with existing shutdown tests unchanged. Those historical full-stack measurements were taken on Windows/Bun 1.4.4; they are not counts for this PR alone. Current review-fix validation is listed below.

The remaining single-shot CLI capture expectation is tracked separately in #571; it is an open behavior question for maintainer review. Maintainer acceptance of the architecture, OpenCode parity and full MVP remains pending.

Scope

  • Enforce the core/adapter dependency boundary in the ordinary unit/CI suite (test/host/import-boundary.test.ts). The AST scan covers all shared source directories, including type imports, re-exports, literal dynamic imports and require; the retained OpenCode translator paths are classified as adapters in this foundation, and only those adapters and the explicit src/index.ts entry forwarder are exempt. refactor: isolate OpenCode as a shared-interface adapter #564 removes the old-path exemptions when relocating the implementation.
  • Define normalized tools, identity, lifecycle/context, transcript/generation, usage, capabilities and shutdown in src/host/; assemble the shared engine through setupMemory.
  • Preserve project/global ownership, write gates, relevance selection, capture policy and bounded cleanup. Harness attribution adds per-harness statistics without partitioning memories; historical unattributed activity counts as OpenCode. The model-facing memory_status tool description changes to describe this activity reporting and removes old issue references; it is not byte-identical to main.
  • Keep the reference host and fault scenarios with the interface. Control missing surfaces, command/tool/lifecycle registration, both identity lookups, transcripts, model lookup, generation and disposal; pause, fail or reorder operations.
  • Add a reusable runtime conformance suite covering all fourteen tools, grounding, project/global visibility, automatic injection, identity moves, missing sinks, compaction anchors, usage revisions, delivery receipts, capture and late-answer cleanup. refactor: isolate OpenCode as a shared-interface adapter #564 binds the same assertions to the production OpenCode adapter.
  • Support asynchronous default-model resolution while freezing ownership/turn boundaries before the await. Cancel capture if the session binding changes during model or transcript lookup, including a move away and back; an already-captured transcript retains its original owner. Refuse work after disposal.
  • Keep usage evidence private to its originating session while repository identity is unresolved.
  • Pin transcript privacy against reasoning/thinking-only parts with top-level fallback fields. Preserve source cursor slots while excluding private text from capture renders.
  • Render the most recent 40 user turns after delta selection, retaining full source-message indices and fingerprints for capture cursors. Regression cases cover late turns, subsequent deltas and transcript replacement.
  • Canonicalize Windows short/long project paths while preserving the same directory's legacy keys.

The behavioral contract distinguishes the useful integration baseline from optional capabilities and documents each tool's obligations. The reference host is the local maintenance proxy; CI must still exercise actual adapters and real hosts.

This is an internal interface, not a published adapter SDK. No oh-my-pi extension, dependency, export or integration job is included here.

Current base synchronization

Synced with main 0.38.0 (14df0040). The memory_remember merge preserves the new volatile session-fact lane through the shared tool dependencies. A ninth common runtime contract verifies author-only context, no durable row, peer isolation and expiry at compaction.

Windows/Bun 1.4.4 repair validation: paused model lookup followed by a session move and transcript replacement cancels safely; a move away and back during transcript reading also cancels. Usage emitted before identity resolution is visible to its owner and hidden from another session. The focused runtime/race/privacy suites pass. The complete downstream stack at 69f904ba passes 2,073 unit tests, 34 skipped, zero failures, plus typecheck, lint, formatting and comment policy. Current-head CI validates this foundation separately.

Previous acceptance baseline (before this synchronization)

Includes main 0.37.4 (7aa710ca). Fresh local checks use Bun 1.4.4 / Windows / OpenCode 2.4.2:

  • Comment policy, typecheck, lint and formatting pass.
  • Unit suite: 1,921 passed, 34 skipped, zero failures.
  • OpenCode E2E: 54 passed, three baseline failures.
  • A fresh archive of main with frozen dependencies reproduces the same three E2E failures: standalone asynchronous cleanup and two viewer fixture EBUSY races.

No assertion is disabled or weakened. #564 fixes the viewer fixture races. The standalone Windows failure remains tracked in OpenCode #66868; forced-exit durability is not claimed. An unfinished capture receipt has an unknown outcome, not necessarily a lost write.

CI runs unit tests on Linux/Windows and real OpenCode integration on pinned 2.0.26 and 2.4.1. Check the current head's CI before landing.

Current review-fix validation

At a3b8c735, the #560-only suite on Windows/Bun 1.4.4 passes 1,960 tests, 34 skipped, zero failures. Typecheck, lint/formatting and comment policy pass.

Six privacy regressions cover reasoning/thinking parts under both recorded transcript shapes, top-level text/content fallbacks, retained public answers and cursor slots. Removing hadPrivatePart fails all six for the leaked fallback text; restoring it passes. The exact src/runtime/setup.ts → ../core/host.ts import probe now fails the dependency boundary test. Restoring the source passes.

This follow-up changes tests and documentation only. The tests are carried into #564 at the extracted decoder path and inherited by #561/#570. The complete downstream stack at 69f904ba passes 2,073 tests, 34 skipped, zero failures, with root typecheck, lint/formatting and comment policy passing. The 39 focused OpenCode adapter/boundary tests pass after relocation. New-head CI must complete before landing; the earlier stack-wide 26-check baseline is historical, not the count of checks on #560.

Nonblocking capability validation, model-facing output pins, real-host sharing/attribution evidence, forced-exit behavior and lifecycle runtime-schema questions remain follow-ups. Review acceptance remains pending.

Council review

Rounds: 2. Historical scores for this PR (#560):

Delegate Round 1 Round 2
Claude Opus 9/10 9/10
GPT Sol 7/10 9/10
Qwen Thinking 9/10 9/10

All council-identified MVP blockers and required fixes across #560 → #564 → #561 → #570 have been addressed. Final targeted verification at stack head 9a248e48 passed 31 tests with zero failures, plus the root and both Pi-adapter typechecks. This was a targeted recheck, not a third council round; the historical scores above are unchanged.

The fixes cover capture ownership and evidence privacy, SDK cancellation documentation, command collision and failed-result pulls, valid automatic capture requests, credential-safe provider diagnostics, native Pi compaction behavior, and long-session capture with stable cursors. Optional nonblocking nits remain follow-ups. The earlier review hold is lifted; current-head CI and maintainer acceptance still govern landing.

@WhollyMindless
WhollyMindless force-pushed the test/554-harness-contracts branch from 8681b49 to 72bf6c9 Compare November 27, 2026 21:21
@WhollyMindless WhollyMindless changed the title feat: isolate harness adapters and add experimental oh-my-pi support refactor: define shared host interface and reference harness Nov 27, 2026
@abogartz

Copy link
Copy Markdown
Owner

@WhollyMindless so is the idea that we ship with existing Opencode functionality baked in, and add in the API, then swap the Opencode adaptor for the baked-in implementation? If so, that makes sense since all versions will continue to work as they do now, but we can test the adaptor API with other harnesses without breaking anything that's part of the core.

Let me know if that's your thinking.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Note

🤖 gpt-6-astra responding on behalf of WhollyMindless

@abogartz Yes, that is the intended staging, with OpenCode remaining the default integration throughout:

  1. refactor: define shared host interface and reference harness #560: extract the shared interface/runtime and keep the programmable test harness with it as the reference implementation. The existing OpenCode entry point and integration wiring remain usable.
  2. refactor: isolate OpenCode as a shared-interface adapter #564: move that OpenCode wiring into its own adapter implementing the shared interface, preserving the public entry points and existing behavior.
  3. feat: add oh-my-pi adapter for the shared host interface #561: add oh-my-pi as another consumer of the same runtime.

#560 already centralizes the memory engine; #564 extracts the remaining OpenCode-specific glue. The separate PRs are review/landing units. The packaging intent is one package, with additional adapters included as they become ready. Each harness loads its appropriate entry point through its plugin configuration. I wasn't anticipating a central UI for enabling or disabling integrations.

Sharing memories is a core goal. Both harnesses should use the same store, with project memories available in the same project and explicitly global memories eligible across projects. Ownership, write gates, recall, and relevance selection belong to the shared engine. Harness attribution supports combined and per-harness statistics without partitioning the memories. Equivalent configuration should produce as similar behavior as the host interfaces allow.

There is concrete evidence for this already:

  • A fresh full-stack unit run passed 1,979 tests, with 34 skipped and zero failures.
  • All four real OpenCode/oh-my-pi sharing tests passed: bidirectional remember/recall, automatic context injection, project/global isolation, cross-harness corrections/deletions, and oh-my-pi capture subsequently recalled by OpenCode. These use real hosts with a scripted provider.
  • Auditing refactor: define shared host interface and reference harness #560 + refactor: isolate OpenCode as a shared-interface adapter #564 against main 7aa710ca found the existing test cases retained, including eleven transcript tests moved intact to the adapter suite. Call-site adaptations preserve the behavioral assertions, with explicit changes for stricter post-cleanup inactivity, harness statistics, and Windows path normalization.
  • The last OpenCode adapter E2E run had 61 passes and one failure, the existing Windows standalone shutdown problem tracked in anomalyco/opencode#66868. That assertion remains enabled.

The reference harness is intended to exercise every shared interface used by a production adapter, with controllable failures and timing. Expanding the common conformance scenarios across all adapters is still further work; real-host tests remain necessary to detect host/API drift. Automatic relevant-context delivery is part of the intended baseline.

Does this match the staging you had in mind? What minimum changes or additional evidence would you want before evaluating this direction and the PR split? In particular, it would help to know whether the current boundary is suitable for review or whether you want the contract/conformance coverage tightened first.

@WhollyMindless

WhollyMindless commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Note

🤖 gpt-6-astra responding on behalf of WhollyMindless

To make the completion target and sequencing explicit: our proposed next milestone is to make #560 independently shippable, with its shared contract and reference harness ready for continued development, and #564 complete, with OpenCode's existing functionality implemented and verified against that interface.

Returning to finish the remaining oh-my-pi support in #561 would be contingent on your acceptance that #560 and #564 together are functionally equivalent to the current OpenCode implementation. The existing oh-my-pi work remains useful evidence from a second consumer while we concentrate on establishing that equivalence.

What minimum changes or additional evidence would you need to make that assessment?

@abogartz

Copy link
Copy Markdown
Owner

Note

🤖 gpt-6-astra responding on behalf of WhollyMindless

To make the completion target and sequencing explicit: our proposed next milestone is to make #560 independently shippable, with its shared contract and reference harness ready for continued development, and #564 complete, with OpenCode's existing functionality implemented and verified against that interface.

Returning to finish the remaining oh-my-pi support in #561 would be contingent on your acceptance that #560 and #564 together are functionally equivalent to the current OpenCode implementation. The existing oh-my-pi work remains useful evidence from a second consumer while we concentrate on establishing that equivalence.

What minimum changes or additional evidence would you need to make that assessment?

The MVP for this feature would be A) The API exists. B) The Opencode adaptor exists C) The PI adapter exists D) the original hooks are removed in favor of the API as the only input. This would prove that the adapter architecture works and is flexible enough to scale.

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

Copy link
Copy Markdown
Contributor Author

Hold off on review. Testing and council identified some things that need to be fixed before review.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Note

🤖 gpt-6-astra responding on behalf of WhollyMindless

All council-identified MVP blockers and required fixes across #560 → #564 → #561 → #570 have been addressed. The earlier request to hold off on review can be lifted.

The final targeted recheck passed 31 tests with zero failures, plus the root and both Pi-adapter typechecks. Verified heads: #560 3509de09, #564 65614031, #561 dd19ba56, #570 9a248e48.

This closes the required-fix list, not every optional review suggestion. Minor nonblocking nits remain follow-ups. At this check, #560, #564 and #570 are fully green; only #561's Windows oh-my-pi job is still pending, with no failed checks. Maintainer acceptance remains pending.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

We're getting close.. but identified an issue with the pi based adapters and their 20s timeout when using thinking mode in qwen - the thinking messed with the timeout for auto-capture. Working on it. But sleep first.

@WhollyMindless
WhollyMindless marked this pull request as draft November 28, 2026 06:34
@WhollyMindless
WhollyMindless marked this pull request as ready for review November 28, 2026 16:46
@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Note

🤖 gpt-6-astra responding on behalf of WhollyMindless

@abogartz The four PRs are now out of draft and ready for maintainer review, in this order: #560 (shared interface/reference harness) → #564 (OpenCode through that interface, removing the legacy route) → #561 (oh-my-pi) → #570 (upstream Pi). Each adapter PR links a comparison showing only its own layer.

The Pi-family timeout issue from the last update is fixed: capture uses SDK-default output budgets and runtime cancellation. Real-host regressions verify promotion after a 30-second response delay and 3,000 simulated reasoning tokens; the shutdown tests pass unchanged. All 26 CI checks are green at #560 3509de09, #564 65614031, #561 27562135 and #570 5ba9f1ad.

User testing generally finds the integrations functional, though thinking/non-thinking model configuration has complicated evaluation. Single-shot CLI capture expectations remain open in #571: immediate -p exit does not guarantee capture completion, and we have not changed policy to suppress it. We would like your guidance on that behavior.

Could you review the shared boundary and OpenCode parity first, followed by the Pi-family adapters, and flag anything still missing from your requested MVP?

@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 — measured at 3509de0, re-verified at 928f83c8 (head moved during this review)

Seat main @ 14df0040, clean. The brief's head was 3509de09; at 18:38Z the branch head had moved to 928f83c8 (test(host): enforce the core-to-adapter dependency boundary, +113 lines: one new test file + the contract doc). Nothing outside this loop commented on the PR or #554 after the scan receipt (17:12:36Z); the author hold comment is dated 05:09:56Z, before the receipt. Every measurement below was taken at 3509de0 and re-run at 928f83c8 wherever that commit could change the answer.

Blind pass was sealed before opening the body or any prior review (kept in the evidence folder). Where the body differs from what the code said first: the body describes #564 as the pull that "removes the legacy OpenCode route", but at this head index.ts already carries no direct host wiring — what remains outside the port is only adapter implementation. The body undersells what #560 itself moved. Both of my predicted breakage classes measured half-true: receipt/compaction ordering is genuinely guarded (both mutants killed), while capability declarations and seam enforcement were the live gaps — the seam gap was then fixed mid-review by 928f83c8 with a hole that remains (finding 3).

Blocker (1)

  1. The private-parts fallback invariant ships unpinned, and its mutant leaks reasoning text into a model-facing render. decodeTranscript's hadPrivatePart gate exists at src/capture/transcript.ts:64, but no test in the tree exercises it: a message whose parts are only reasoning/thinking must not fall back to the top-level text/content string. Deleting the gate (if (!text && !hadPrivatePart) → if (!text)) leaves the full suite green — 2020 pass / 23 skip / 0 fail at 3509de0, re-run at 928f83c8 — and produces exactly the leak the deleted test pinned: a reasoning-only message with text: "another private thought" renders assistant: another private thought into the capture-facing transcript. The sibling survivor from the prior review (the userTurnText positive-order pin) is restored — test/host/transcript.test.ts now asserts both inclusion and quote-spoofing refusal — so this is one pin, not two, still missing.
    Unblock: restore the privacy assertion against decodeTranscript (reasoning-only parts + fallback-field present ⇒ empty text), and confirm the mutant dies on it. This is the same blocker the author's hold interrupted; the head moved without it.

Findings, not blockers

  1. memory_status's schema description is still the one changed model-facing string. Delivered-bytes comparison (own driver: identical seeded store, identical three-turn prompt sequence, real plugin entry via each revision's loadPlugin, random receipt-hex normalized): system channel byte-identical (turn 1 32050438f6f28bd5 @ 267 B, turn 2 3cc6e9e182d1dcb0 @ 459 B), recall output identical (228 B), pull channel identical (244 B, block appended). All 14 tool names and input schemas identical; TOOLS hash df0f1c352f6e3880 → c7d028122f1c293b — one description, memory_status (2df9fc1b → d6f0d5fc), unchanged pair since the prior review. The rewrite tracks the disclosed HARNESS ACTIVITY feature and correctly drops the #306/#213 B refs; what's still missing is one body line stating the schema string changed, since it rides the wire every turn. Pinning is #572's surface.
  2. The new boundary rule is real but blind to where the adapter actually lives today. test/host/import-boundary.test.ts (928f83c) AST-scans src/** and blocks imports resolving into src/adapters/** or the index.ts/tui.ts forwarders, with self-tests covering values, types, re-exports, require, dynamic import(), and ../runtime/../adapters/ tricks. Measured: my probe — src/runtime/setup.ts importing createOpenCodeHost from ../core/host.ts — still passes typecheck, lint, and the suite at 928f83c8, because the OpenCode adapter implementation currently lives at src/core/host.ts, src/events.ts, and src/capture/runtime.ts, none of which the rule targets. The rule becomes airtight exactly when #564 relocates the adapters; until then the claim "nothing in the core may depend on an adapter" is held only by the fact that no such import exists. Filed as #575.
  3. Non-capture capability declarations are still unchecked at install; no core behavior keys on them. Probe: a host declaring identityEvents: true, compaction: "split", cooperative: "awaited", and capture booleans true while providing no capture methods installs cleanly; the exported capabilities.capture is corrected to all-false by method presence (that slice is verified and pinned — mutating the derivation is killed by "diagnostic labels cannot invent missing capture capabilities"), while identityEvents: true and compaction: "split" pass through. Grep confirms zero src/ consumers of the non-capture fields, so at this head a lie cannot move core behavior — it is a decorative declaration, which is precisely what contract clause 6 forbids long-term. #573 owns it; naming per the design statement, not blocking staged work.
  4. Two new model-facing strings have no pin. configuration and activity for <harness> (src/status/report.ts:417) and Output includes reasoning where the host supplies no separate split; mixed totals cannot establish the answer/reasoning split. (src/status/harness-stats.ts:189) reach the model through report output; neither string appears in any test. Filed as #576.
  5. The hostile fake is missing the ratchet's "exits without warning" behavior. Omitted declared capabilities ✓ and mid-turn failure ✓ are exercised ("missing generation leaves manual tools available", "failed generation is contained and the next session still captures", "dispose can be held while late hooks are dropped"), but no scenario abandons the runtime mid-capture without dispose; forcedExit: "no-cleanup" is a declaration no test contradicts. Filed as #577.
  6. Minor contract-honesty items. (a) Clause 2 (schema-first) holds for tool inputs (JSON Schema + validator) but lifecycle/capture/usage payloads cross the boundary as bare TypeScript interfaces — no runtime validation failure path; recorded on #554. (b) A host omitting the capture port object entirely dies at setup with a raw TypeError: undefined is not an object (evaluating 'host.turnEndEvents') — an undefined-behavior edge the contract says nothing about (clause 4). (c) Body numbers float: "2,065 unit tests / 34 skipped" is a Windows/Bun-1.4.4 stack-head count — my macOS arm64/Bun 1.4.3 runs below differ by platform — and "All 26 CI checks" is not what gh pr checks 560 reports at the current head (five). (d) Prose audit: the added lines carry one external issue reference (host-contract.md → OpenCode #66868) and four relocated FINDINGS 2026-11-08 comment refs (identical text already on main); README 526 → 542 words; no disabled assertions (the one test.skipIf is a new Windows-only short-path test that runs on test-windows).

Contract completeness (main's host surface → interface member)

ctx.tool.transform→registerTools; execute.before→beforeTool; execute.after→afterTool+appendResult; session.hook("context")→context (appendSystem/observedResults); session.hook("prompt")→prompt; session.hook("compaction")→compact (phase,capture,captureStarted,transcript); event-subscribe identity→identity; usage→usage; capture turn-end→turnEndEvents; ctx.session.context→readTranscript; ctx.generate.text→generateText; ctx.model.default.get→defaultModel; command install→installCommands; teardown→dispose; heartbeat→subscribedEvents+capabilityLabels; options→MemorySetupOptions. No equivalent: zero host hooks lost. (TUI is a package export, never a hook — unchanged.) Conformance exercise ratio: 26/28 boundary members named in suites (incl. capabilityLabels via test/runtime/setup.test.ts:190); the un-named two are SessionDirectories.fromTranscript/fromSession — implemented by the reference host and behaviorally exercised by identity tests, but never asserted by name. Conformance suite exists and runs in CI; the production-adapter binding of the same assertions is #564's surface, and cross-host byte equality (RC2 across harnesses) is therefore still unverified here — only cross-revision equality is measured.

Mutations

# Mutant Result
M3 drop hadPrivatePart gate survives full suite; leaks → blocker 1
M1b src/runtime/setup.ts imports OpenCode adapter (../core/host.ts) survives at both heads (boundary test doesn't cover current locations) → #575
M2 lying capability declarations install survives (non-capture fields; no core consumers) → #573
M4 trust declared capture capabilities instead of deriving from methods killed — "diagnostic labels cannot invent missing capture capabilities"
M5 never notify captureStarted on admitted compaction capture killed — "anchor-only preparation defers capture and exposes admitted work…"
M6 ignore the anchor-only capture: false clause killed — same test, right reason

No mutant was killed only by an unrelated test.

Runs

macOS arm64, Bun 1.4.3, my runs. 3509de0: 2020 pass / 23 skip / 0 fail (2043 tests, 185 files, 143 s). 928f83c8: 2022 pass / 23 skip / 0 fail (2045 tests, 186 files, 161 s) — and with the M3 mutant applied at this head, the full suite still reports 0 fail. Typecheck 0 errors (205 pre-existing infos), biome lint + format clean, lint:comments clean (832 added comment lines). gh pr checks 560 at the queried head (928f83c): lint pass, smoke pass, smoke-stable pass, test pass, test-windows pass — 5/5.

What remains unverified (stated plainly, per the approval-honesty rule)

  • Real-host cross-harness sharing of one store (two different harness processes, project/global ownership with a non-OpenCode writer): #574. My in-process probe (two harness labels, interleaved memory_remember, cross-memory_recall from both) shows sharing intact and no ownership exchange — in-process only.
  • Forced-exit durability — declared no-cleanup, never exercised (#577); #571 tracks the adjacent CLI question.
  • Production OpenCode adapter conformance binding and byte re-measurement: #564 must carry them; nothing here proves the adapter satisfies the suites it will be bound to.
  • Lifecycle-boundary runtime schemas (clause 2): recorded on #554, unproven.
  • Per-harness stats cross-process attribution: HARNESS ACTIVITY renders per-harness groups, but my two-harness in-process probe rendered only the aggregate line; real-host attribution is #574's measurement.

Landing order stays right (#560 → #564 → #561 → #570): criterion A met, B met, D structurally met for OpenCode at this head with zero no-equivalents — which is exactly why #564's binding must land with its byte re-measurement before anything else is removed. Approving everything else would be a misread: this review requests changes for one proven privacy blocker. Not merged; not commented on issues; residuals are the three filed tickets above plus #572/#573/#574, which stay open.

@WhollyMindless

Copy link
Copy Markdown
Contributor Author

Note

🤖 gpt-6-astra responding on behalf of WhollyMindless

The privacy-test blocker is addressed in a3b8c735, and the old-path dependency gap is covered too.

  • Added six direct decodeTranscript regressions for reasoning/thinking-only parts with top-level text/content fallbacks. They assert empty private text, preserved cursor slots, retained public text, and the exact capture render. Removing hadPrivatePart makes all six fail on the leaked fallback; restoring it passes.
  • The boundary scan now classifies the retained OpenCode translators as adapter code. Your exact src/runtime/setup.ts → ../core/host.ts probe fails the boundary test. refactor: isolate OpenCode as a shared-interface adapter #564 removes these source-path exemptions after relocation, while keeping imports of the former paths forbidden.
  • Updated the PR body to disclose the memory_status schema-description change, clarify that refactor: define shared host interface and reference harness #560 already routes through the shared runtime, and separate this PR's test results from historical full-stack counts.

#560-only validation on Windows/Bun 1.4.4: 1,960 pass, 34 skip, zero failures; typecheck, lint/formatting and comment policy pass. These changes are tests/documentation only. The six privacy assertions move unchanged to the extracted decoder in #564 and propagate through #561/#570. The full downstream unit suite passes 2,073 tests, 34 skipped, zero failures at 69f904ba; 39 focused OpenCode adapter/boundary tests pass after relocation. New-head CI is pending.

The remaining nonblocking findings stay tracked; this does not claim capability validation, forced-exit durability, lifecycle runtime schemas, or unmeasured cross-host equivalence. Please recheck the privacy blocker and dependency probe.

@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.

Re-review at a3b8c73 — the blocker is closed, approving

The requested change was one item: the hadPrivatePart gate had no assertion on the surface it protects, and deleting it survived the whole suite while leaking private assistant text into a model-facing transcript. Re-measured on this head, in my own worktree, on macOS arm64.

The blocker is fixed, and the fix is falsifiable. test/capture/transcript-privacy.test.ts adds six cases — two private part types across three fallback shapes — and asserts the flattened delivered transcript, not an internal flag:

user: Use bun for this project.
assistant: Public answer.
assistant: Public fallback.

Mutating if (!text && !hadPrivatePart) to if (!text) fails 6 of 6, and the clean tree passes 6 of 6. That is the assertion this gate needed: it now pins the bytes a model would see rather than the code path that produces them.

The second boundary issue is also closed on this head, without being asked. The deny set in test/host/import-boundary.test.ts now names the current OpenCode translator modules rather than only the future src/adapters/ location. Mutating src/runtime/setup.ts to import { createOpenCodeHost } from "../core/host.ts"; is killed by shared source cannot depend on adapters or their entry forwarders. Same mutation re-run against the relocated layout is killed by the same test, and bun run typecheck still passes with the bad import in place, which is the point: the compiler does not hold this boundary, the test does. The earlier src/core/host.ts bypass is no longer reproducible, so the follow-up filed against it is withdrawn.

Nothing else moved. The delta since the reviewed head is documentation and tests only — src is byte-identical across 928f83c..a3b8c73 — so the earlier delivered-bytes result stands unchanged: injected system channel and pull channel byte-identical to main, 14 tool schemas identical except the disclosed memory_status description.

Check Result
bun test (macOS arm64) 2028 pass, 23 skip, 0 fail
Privacy mutation 6 of 6 fail as expected
Boundary mutations (both layouts) killed by the named test
gh pr checks 560 lint, test, test-windows, smoke, smoke-stable — 5/5 pass
Contract completeness every legacy hook maps to a named interface member; criterion D remains expressible

Landing note, not a defect. Approving here does not clear the family. The adapter-isolation pull carries the same boundary test and its own verdict is separate, and the order still matters: this pull first, then that one, with parity green before the legacy route disappears. The teardown work is deliberately sequenced behind both, since it rewrites cleanup in code that is currently being relocated.

Unverified, stated rather than assumed. Real-host behavior on the two installed harnesses, durability across a forced exit, and the runtime schemas on lifecycle members. Those are tracked as tickets, and none of them blocks this explicitly staged landing.

@abogartz
abogartz merged commit 2dc6bdd 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.1 🎉

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