Repository navigation
Description
Problem
The seam between core and a harness has no declared way to fail. A capability the host can no longer provide either works, or throws during setup and takes the whole plugin with it, or degrades quietly. The interface should say which of those happens for every member, and it should say it in a form a user can read.
This blocks the honest version of the portability claim: when a third-party adapter falls behind a host release, the plugin has to degrade with a named reason and say which adapter needs updating. Without that, an ecosystem of adapters is an ecosystem of silent half-failures attributed to this package.
Current state, measured
- One seam already does it right. The report prints reason-coded degradation lines, for example
auto-capture: invalid_modelandauto-capture: no_capabilities, each naming the cause and the consequence. Capture is the only seam with that vocabulary. - Capture availability is derived from port method presence rather than from trusted prose, so a capture capability lie is structurally impossible. That inference is the fallback mechanism in embryonic form; nothing else uses it.
- The other direction is fatal.
setupMemoryverifies the declared capture lifetime before any tool registration, and the OpenCode and oh-my-pi adapters rethrow the failure. A host release that renames or removes the exported shutdown grant therefore removes the fourteen memory tools and the commands, not just the background pass. - No entry point runs the slow or invasive checks. The install path exercises a live host dispatcher to confirm a declared grant, which is the right instinct in the wrong place: it is launch cost on every session and it is the check that currently kills the plugin.
- There is no user-facing command that reports adapter health. The shipped commands cover the memory report and repository seeding only.
Required
- A seam report produced per adapter: one record per seam with a state of
ok,degradedorunavailable, a stable reason code, and a remedy naming the action that resolves it. - Fallbacks declared as data, never inferred per method. Each seam states which states are acceptable and what each substitute changes, so a substituted implementation is visible rather than merely functional. Distinguish degradable (a feature switches off), substitutable (a different event or path provides the same contract), and fatal-to-feature (never fatal to the plugin).
- Setup applies a degradation ladder instead of aborting. A failing seam must not prevent tools, commands or reads from installing. Verification failure on the capture lifetime resolves to capture off plus a reported reason, which the existing adapter option for an absent lifetime already supports.
- The selected state is recorded per harness so activity reporting can show where two harnesses diverge, and the human report carries the degraded lines for as long as any seam is degraded.
- A doctor entry point, invoked deliberately rather than at startup, that re-resolves the installed host package, runs the deep probes the install path should not run, checks store path, permissions, lock contention, option validity and whether the plugin is wired into the host at all, prints the seam table with remedies, and repairs user-side configuration only with explicit consent.
- The doctor states its own limit in its own output: it diagnoses and quarantines, and cannot repair a host that removed an API. That case needs a new adapter release and the output should name it.
Invariant
Degradation may change when a pass runs. It must never change the shape of what is written: row format, stamping, scoping and identity stay identical in every mode, because the shared store is the promise and a mode-specific writer breaks it in the one place no cross-harness test would notice.
Acceptance
A host stub that omits, renames, or contradicts one capability each yields a working plugin with the affected feature off and a named reason visible to the user; the memory tools and commands install in all three cases. A control stub with every capability present reports every seam ok and no degradation line. Store rows written by an adapter running in every degraded state are byte-compatible with rows written in the full state, checked by reading them back through a different harness. The doctor run against a deliberately broken setup names each fault and its remedy, mutates nothing without consent, and returns a clean report after the consented repair. Every announcement string is pinned by whole-string equality on delivered bytes, and the declared-state set is enumerated by test so a new seam cannot ship without a state.
Non-goals
Not a plugin host, not a discovery mechanism for third-party adapters, not an interface version policy, and not an automatic shim that rewrites adapter code against a changed host. Versioned contract and conformance publishing are tracked separately; this ticket only makes failure legible.
Activity