@@ -458,6 +458,64 @@ code it describes.
458458- Canonical report runner: 13 passed, 0 failed; HTML/XML/Markdown artifacts generated under the
459459 ignored artifacts directory.
460460- Bootstrap ` -Check ` : exit 0; winapp, Pester 6.0.1, Dev package, and module import succeeded.
461+
462+ ### Step 13 - OpenCode Native ACP Usage POC
463+
464+ ** Investigation gate**
465+
466+ - Read the OpenCode repository README, native ` opencode acp ` entry point, ACP Usage service, and
467+ existing OpenCode Usage tests. The local ` dev ` source identifies as ` 1.18.4 ` .
468+ - Stopped public package-source access after the corporate policy warning. npm is configured to
469+ ` https://packagefeedproxy.microsoft.io/npm/ ` ; no public npm, PyPI, or NuGet registry was used.
470+ - The source monorepo lockfile contains ` github: ` and ` pkg.pr.new ` direct dependencies, so a full
471+ source ` bun install ` remains blocked until approved internal equivalents are available.
472+ - Installed fixed ` opencode-ai@1.18.3 ` and ` opencode-windows-x64@1.18.3 ` from the Microsoft-protected
473+ npm feed. Both tarball URLs resolved to Microsoft Azure Artifacts.
474+ - Confirmed OpenCode is a native ACP agent (` opencode acp ` ), not a TUI substituted for an ACP server
475+ and not a third-party adapter.
476+
477+ ** Real wire**
478+
479+ - Ran ` initialize ` , ` session/new ` , and ` session/prompt ` against native OpenCode ACP with an isolated
480+ inline OpenAI-compatible provider pointed at local Agent Maestro.
481+ - Handshake reported ` agentInfo.name = OpenCode ` , version ` 1.18.3 ` , protocol version 1.
482+ - Prompt completed with ` end_turn ` , returned the expected marker, and emitted one standard
483+ ` usage_update ` : ` used=6092 ` , ` size=271790 ` , ` cost=0 USD ` .
484+ - Prompt response Usage reported input 460, output 11, thought 15, cached-read 5632, total 6118.
485+ This confirms context occupancy is input + cached-read (` 6092 ` ), not total processed tokens.
486+ - ` 0 USD ` is a deliberate zero-rate custom model result. Maestro exposes AIC rates, while OpenCode
487+ labels ACP cost as USD; the POC does not convert or relabel AICs.
488+ - Raw/pretty wire, stderr, summary, sanitized config, and the PowerShell capture harness remain
489+ local under ignored ` test/e2e/artifacts/opencode-acp/ ` ; the wire scan found no sensitive keys.
490+
491+ ** TDD / characterization**
492+
493+ - Added the verified OpenCode payload as a provider-local Rust characterization test before making
494+ any production change.
495+ - The focused test passed on its first run because the existing standard ACP normalizer already
496+ handles OpenCode correctly. No private parser, runtime provider dispatch, credential access, or
497+ provider API call was added merely to manufacture a RED phase.
498+ - The test also locks ` opencode ` to ` StandardAcpOnly ` with an empty private trusted-reporter
499+ allowlist, preserving the fail-closed provider boundary.
500+
501+ ** Validation**
502+
503+ - Real OpenCode ACP capture: 1 standard Usage update; marker present; sensitive-key hits: 0.
504+ - Focused offline Rust test:
505+ ` normalizes_verified_opencode_1_18_3_standard_usage_capture ` passed (1 passed, 0 failed).
506+ - Offline Usage/provider slice: 10 passed, 0 failed.
507+ - Targeted ` rustfmt --check tools/wta/src/usage/providers/opencode.rs ` : passed.
508+ - Full offline WTA Rust suite: 1144 passed, 0 failed, 0 ignored.
509+ - OpenCode source tests were not run because the monorepo dependency set includes non-CFS direct
510+ URLs; no public-source exception or bypass was attempted.
511+
512+ ** Committed files**
513+
514+ - ` tools/wta/src/usage/providers/opencode.rs `
515+ - ` doc/investigation/acp-price-calc.md `
516+ - ` doc/investigation/acp-price-calc-track.md `
517+ - No package cache, OpenCode binary, raw wire, local capture harness, credentials, or user-global
518+ OpenCode configuration.
461519- Windows PowerShell 5.1 module import was rejected by the 7.2 requirement.
462520- Both policy setup tools rejected Windows PowerShell before UAC or registry work.
463521- ACP mock probe launched through the canonical host and completed initialize, tokens-only Usage,
0 commit comments