Maturity and installation
doctor belongs to the setup/activation acceptance tier. It is not a substitute for launching the host, sending a prompt, and observing injection, capture, and permission behavior.Minimal adapter contract
Read the event-model table as a timing map. The prepare event determines which user input becomes the query; the injection event determines how long recalled content lives; the boundary event determines when captured Source can be flushed. If a host has no event for one of those moments, mark that behavior unsupported instead of simulating it with stale state.
Five distinct event models
Do not copy assumptions about Stop events, transcripts, message mutation, or permission UI from one host to another.
Scope and injection
Scope selects a data partition. It is not a credential or authorization decision. Derive it from an authenticated tenant/project mapping when isolation matters. Document the resolver’s precedence chain. Normalize Git or workspace identity without credentials, bound the public value, and keep raw Scope out of diagnostics. Add a cross-Scope test where identical prompts cannot share transient state. PreparedContext is untrusted historical evidence. Validate its exact v1 schema and UTF-8content_bytes, then inject it through the current host’s ephemeral channel. Current system and user instructions still win, and recalled text grants no tool permission.
OpenCode makes stale-turn handling explicit because prepare and inject happen in different events. Its cache key must match the exact latest user turn. The ID gate prevents wrong-turn injection, but concurrent out-of-order preparation can still cause a missed newer injection; that race is Not validated. Every host needs the basic assertion that one prompt’s context never enters a later prompt.
Automatic safety contract
Automatic recall, capture, and optional flush are auxiliary. Expected Server-call, validation, size, and deadline failures normally fail open: omit the PowerContext contribution and preserve the original host task or downstream result.
Claude Code, DSH, OpenCode, and Pi independently guard recall and capture. Codex does so for expected failures, but an unexpected recall exception can skip capture for that invocation. Keep this weaker edge visible.
All five implementations parse the exact
powercontext.prepared-context.v1 shape, enforce UTF-8 byte counts, cap general response bodies at 1 MiB, and reject redirects in transport code. Test depth differs. Codex has a slow-body deadline regression; OpenCode has the strongest direct response-size tests. Equivalent body-overrun or full shared-budget tests are Not validated for every host.
DSH is the transport outlier: current configuration does not enforce the same secure base-URL and bearer-header validation as the other four integrations. Do not infer a shared HTTPS/loopback guarantee from the common contract.
Diagnostics must exclude prompt, raw Scope, PreparedContext, Source content, response body, and authorization token.
Capture is not Memory
- Codex and Claude Code capture the submitted prompt with a 200,000-character bound and no automatic secret-pattern filter.
- DSH recalls from all batch text but captures user-originated blocks only; secret-like text is not captured.
- OpenCode captures eligible prompts with secret-like and UTF-8 byte filters.
- Pi applies secret and UTF-8 byte filters, then flushes immediately or records a pending position.
- DSH, OpenCode, and Pi secret filters affect persistence, not recall transmission.
- None captures the final assistant response or records an automatic Task Outcome.
Flush coordination
A flusher needs a target Source position, a bounded call count or deadline, and a completion check such ascurrent_cursor >= position. Clearing pending state before that comparison loses work; retrying forever blocks the host.
Codex, Claude Code, DSH, and OpenCode support optional immediate flush. Pi also keeps the greatest pending position per Scope and retries at agent_end, session_before_compact, session_before_switch, and session_shutdown. Pi’s compaction retry and immediate-failure retention have committed tests; every lifecycle boundary and the closing deadline are not equally validated.
DSH and OpenCode do not have Pi’s pending flusher. Their immediate flush paths lack the same focused completion/failure test depth, so do not describe them as boundary-flush support.
Explicit mutation and permission
Explicit operations do not inherit automatic fail-open. A Memory write, Handoff commit, Review decision, Task Outcome, or Skill export must return success or visible failure.
Candidate approve/reject/revise should not be a silent model tool. DSH and OpenCode deliberately keep approval off the model surface. MCP tool visibility is not authorization, and permission to attempt an operation does not prove that it succeeded.
Bundled Skill versus managed export
All five integrations ship or register bundled host guidance. That guidance can tell a host when to use MCP or native tools, but it does not prove managed Skill export. Managed export generates a versioned projection with provenance and drift checks. It is Supported for Codex and Claude Code. It is Unsupported for DSH, OpenCode, and Pi. Loading or executing an exported managed Skill in a real Codex or Claude Code session is still Not validated.Setup and doctor contract
A first-class installer should:- gate known host versions and label compatibility evidence honestly;
- install idempotently while preserving foreign configuration;
- record ownership and refuse foreign same-name files;
- roll back or report a clear partial-failure state;
- distinguish installed, activated, Server-ready, and real-host E2E;
- provide a bounded
doctorplus a separate real-host activation probe.
opencode serve process and verifies an activation nonce. None of these checks proves a live recall/capture/permission chain.
Negative experiments
Run these before claiming an adapter complete:- Server down: original host task continues.
- Wrong auth: 401/403 stays distinct from empty Memory.
- Unknown schema: no injection.
- Oversize and deadline: bounded exit.
- Redirect: Authorization is not forwarded.
- Recall/capture split: test both directions, including unexpected Codex recall failure.
- Stale turn: mismatched, deleted, or out-of-order identity cannot inject wrong context.
- No UI or denied permission: no durable mutation.
- Flush lag: bounded retry and no false completion.
- Diagnostics: no content, Scope, or credentials.
Reuse current implementation
The repository has reusable pieces, not one SDK:- transport policy and loopback/redirect vectors;
- Codex and Claude Code PreparedContext parsers;
- host-specific Scope normalization tests;
- Pi pending Source flusher;
- DSH generated operation table;
- Codex and Claude Code Skill projections;
- setup and doctor catalog in
cli/hosts.py.
HostAdapter class to make documentation cleaner.
Currently unsupported or not validated
Completion checklist
Treat the integration as complete only when these results are observable:- Event, identity, injection channel, and stale-state rule match the selected host.
- Scope comes from stable authorized identity and has a cross-Scope negative test.
- PreparedContext remains bounded, transient, and untrusted.
- Recall, capture, flush, Candidate extraction, and Memory commit remain separate observations.
- Automatic fail-open claims match actual exception boundaries.
- Explicit mutation failures and permission denials remain visible.
- Redirect, schema, size, deadline, stale-turn, no-UI, and flush-lag tests cover every promised behavior.
- Diagnostics contain no prompt, Scope, context, Source content, response body, or token.
- Setup preserves foreign files and distinguishes installed, active, Server-ready, and E2E.
doctoris not reported as real-host E2E.- A bundled Skill is not reported as managed Skill export.
- Unsupported and Not validated remain separate.
Do not add a sixth host to the first-class catalog until unit contract, service chain, setup/doctor, real-host E2E, and negative/security tiers have observable evidence.

