Repository navigation
Description
Summary
Move from build-only host artifacts to an optional, receipt-backed lifecycle:
preview, install, update, repair, uninstall, rollback, recovery, and Doctor
verification. Preserve unrelated host configuration and apply component sets
atomically.
Problem
Generating valid plugin directories is insufficient for complex integrations.
Hosts may own shared JSON/TOML registries, require their own CLI installer,
prompt for trust, stage a plugin before activation, or use native extension
directories. Updating one component must not remove another or overwrite
third-party settings.
TraceDecay currently implements these guarantees itself. Agent Bundle should
make them a reusable framework capability after the host component compiler
can describe exact ownership.
Lifecycle
inspect observed state
-> preview immutable mutation plan
-> require exact confirmation digest
-> backup owned/shared documents
-> apply component transaction
-> host-specific activation
-> verify native registration and artifact bytes
-> publish receipt
Supported operations:
- install;
- update;
- repair;
- uninstall;
- rollback to the prior confirmed component set;
- recover an interrupted journal.
Safety requirements
- safe, canonical install roots with symlink/path-escape refusal;
- content digests and ownership markers per artifact;
- exact preview/apply revision pairing;
- component-scoped backups and receipts;
- atomic or journaled multi-file writes;
- structured merges that preserve unrelated host keys;
- host CLI registration where the host owns its registry;
- competing-extension detection;
- explicit manual-activation state where automation is unavailable;
- no credentials in manifests, receipts, or logs.
Doctor
Doctor reports each component as installed, missing, repairable, deferred,
conflicted, unavailable, or corrupt. It verifies:
- artifact content and provenance;
- native host registration;
- activation/trust state where observable;
- protocol/runtime compatibility;
- receipt and backup integrity;
- stale or interrupted journal recovery.
Non-goals
- Claiming installation merely because files were generated.
- Replacing a shared host configuration wholesale.
- Remotely distributed third-party bundles without a separate trust model.
- Automatically trusting hooks or extensions on the user's behalf.
Acceptance criteria
- Dry run opens no writer and reports exact planned paths and shared-config
mutations. - Install and update preserve unrelated host configuration.
- An interrupted multi-component install recovers or rolls back safely.
- Repair restores owned artifacts without adopting foreign paths.
- Uninstall removes only receipt-owned artifacts and registrations.
- Doctor distinguishes activation deferred from installed-and-active.
- At least two materially different host registration mechanisms pass real
lifecycle tests.
Design references
- Current Agent Bundle artifact plan boundary
- TraceDecay host-bundle lifecycle design
- TraceDecay receipt-backed host bundle implementation
- TraceDecay capability admission and verification
- VS Code extension model as one native activation surface
Stack position
- Depends on: #100 capability-aware host components.
- Independent of #98 application state; this manages plugin deployment,
not application data.
Full meta-framework stack
- Foundations: #93 routes - #94 identity - #95 context - #96 renderer
- Runtime: #97 events - #98 state - #99 notices
- Host: #100 components - #101 lifecycle
- Surfaces and proof: #102 CLI/scripts - #103 Rstest - #104 proximity example - #105 Workbench
Activity
feat(skills): compile a canonical Skill IR with typed host tokens (#185)
feat(doctor): read-only agent-bundle doctor for host installs and run…
ScriptedAlchemy commentedon Sep 1, 2026
Stage 1 (read-only Doctor) — delivered vs deferred
Per the G4 gate decision in #107 rev 2 (installer deferred; read-only Doctor only), stage 1 landed in PR #236 (merge
cbbaf0e90c1303d037df9cdcbe1b2adff1076a5b).Delivered
agent-bundle doctor [--host <host>…] [--from <bundle-dir>] [--json]— additive CLI surface next toinstall, strictly read-only: doctor only everlstats,readdirs,readFiles, and probes sockets. There is no--fix, no writer, and no mutation path; repair guidance is recovery text only.claude/codexbounded--versionprobes (the feat(claude): validate artifacts with host devtools #193 pattern — ENOENT is an infounavailableskip, a probe that starts but fails/times out is an errorfailed); Cursor via its pinned directory evidence (~/.cursor), since no Cursor version-probe contract is pinned.~/.cursor/plugins/localusing the pinned loader-manifest candidate order, withcorrupt(symlinked entry, manifest-less or unparseable), andinterrupted-install(.name.stage-*leftovers from feat(install): make host bundles directly installable #195's staged copies) findings. Claude/Codex: honestlyunknown— the hosts own their registries and no read-only inventory verb is pinned.--from) — Cursor:installed/missing/drifted(tree-digest mismatch via feat(install): make host bundles directly installable #195'streeHash) /conflicted(version collision) /corrupt(unsafe tree). Claude: registration proof via the pinnedclaude --plugin-dir <dir> plugin list --jsonverb. Codex:unknown(no pinned read-only verb).events/ipc.tsby a regression test):stale-socketwarnings, and claim locks interpreted per fix(events): reclaim provably-dead orphaned endpoint claims instead of failing permanently #229's owner-record semantics — invalid owner record or provably-dead owner →stale-lockwarning (the runtime auto-reclaims provably-dead claims at next start); an owner that cannot be proven dead → reported live with an info note that the runtime fails closed rather than stealing claims. win32 endpoint enumeration is an honest skip.AB7300–AB7315with recovery text, registered indocs/diagnostics.md(also records feat(install): make host bundles directly installable #195'sAB700xfamily, previously undocumented). Exit code is nonzero only on error-severity findings; honest skips and warnings never gate. Minor changeset included.Deferred (with reasons)
--fixflag: deferred per G4 until Compile capability-aware host component bundles #100's ownership model is stable and two real consumers repeatedly need managed installs. Doctor'sdrifted/corrupt/stale-lockfindings name the manual remedy instead.unknownrather than guessing. Revisit if the Track Claude Code plugin contract parity beyond the current adapter #187/Track Codex plugin manifest, hooks, marketplace, and policy parity #188 audits pin one.ScriptedAlchemy commentedon Sep 1, 2026
Host-side evidence for the shared-vs-per-host
skills/tree question (from #100 stage 3 real installs, #242)#108 left the layout decision inspect-visible (
skillTreeLayout.decision:shared|per-host-required, feeding this issue). Real installs against Claude Code 2.1.257, codex-cli 0.147.0, and Cursor's documented local-plugin path now give host-side facts:skills/root.plugin installcopies the whole bundle to<config>/plugins/cache/<marketplace>/<plugin>/<version>/, skills at<installPath>/skills/<name>/SKILL.md;plugin detailsinventories skills from that copy.<CODEX_HOME>/plugins/cache/<marketplace>/<plugin>/<version>/, including per-skillagents/openai.yamlsidecars.~/.cursor/plugins/local/<plugin>/with the manifest pointing atskills: './skills/'relative to the plugin root.${CLAUDE_SKILL_DIR}resolved to<bundle>/skills/<skill>of the loaded plugin (observed 2.1.257, opt-in session proof in feat(test): host-install proof level with real Claude, Codex, and Cursor install proofs (#100 stage 3) #242).shared.skills/as part of the owned component set with no shared-registry merge concerns; version collision semantics are already host-enforced via versioned cache directories (Claude/Codex) and refused fail-closed by the Cursor installer (AB7005).Net: the #108
per-host-requireddecision is confirmed host-side for any skill with tokens/extensions;sharedremains honest only for byte-identical portable documents. The compositeplugintarget's install-time selection (this issue's scope) can rely on hosts isolating each plugin's tree.ScriptedAlchemy commentedon Sep 2, 2026
Decision (2026-09-01): G4 stays — mutation lifecycle (repair/uninstall/rollback/receipts) remains deferred; doctor's read-only suggestions are the supported surface for now.
ScriptedAlchemy commentedon Sep 3, 2026
Status (2026-09-02): intentionally deferred by the maintainer — no lane is implementing this
Per the owner decision recorded on 2026-09-01 ("G4 stays — mutation lifecycle (repair/uninstall/rollback/receipts) remains deferred; doctor's read-only suggestions are the supported surface for now"), this issue stays open and unimplemented on purpose. Nothing here was worked in the current wave beyond verification.
Verified on
origin/main(af1c18551)wave6/101-doctorholds no unmerged work. Its two commits (3a0854362doctor stage 1,b5551722e"report claim-owner liveness per the fix(events): reclaim provably-dead orphaned endpoint claims instead of failing permanently #229 reclaim semantics") were squash-merged as PR #236 (cbbaf0e90);git diff cbbaf0e90 wave6/101-doctor -- packages/agent-bundle/src/install/doctor.ts packages/agent-bundle/tests/doctor.test.tsis empty. The liveness delta is live on main:isEndpointClaimOwnerProvablyDead/linuxProcessStartTimeinpackages/agent-bundle/src/install/doctor.tsand the test "reports a lock with a provably dead owner as a stale lock warning" inpackages/agent-bundle/tests/doctor.test.ts. No follow-up PR was needed.agent-bundle install <host> --from <bundle-dir> --scope <scope>(#195); the read-only Doctor withAB7300–AB7316(#236, durable-state inventory in a later slice) and its Workbench host-discovery page (#285, Add an interactive Agent Workbench with local host discovery and lifecycle replay #105 stage 4); host-side per-plugin tree evidence from the Compile capability-aware host component bundles #100 stage-3 real installs (#242), recorded in the comment above; the fix(events): reclaim provably-dead orphaned endpoint claims instead of failing permanently #229 claim-owner/reclaim semantics Doctor now reports against.Still deferred (unchanged)
Receipts/journal, update/repair/uninstall/rollback, format-preserving merges, any
--fixflag, Claude/Codex installed-inventory discovery (no pinned read-only verb), and Workbench exposure of mutation (permanently out per G6). Revisit only when #100's ownership model is stable and two real consumers repeatedly need managed installs.feat(install): add receipt-owned uninstall lifecycle, format/2 receip…
feat(install): add receipt-owned uninstall lifecycle, format/2 receip…
feat(install): receipt-owned uninstall lifecycle, format/2 receipts, …
feat(install): receipt-owned uninstall lifecycle, format/2 receipts, …
feat(install): receipt-owned uninstall lifecycle, format/2 receipts, …
feat(install): receipt-owned uninstall lifecycle, format/2 receipts, …
ScriptedAlchemy commentedon Sep 4, 2026
Closed by #452 — merged to
mainase647336d7(2026-09-04)Deferral reversal, stated plainly. The 2026-09-01 decision kept the mutation half of this issue behind the G4 gate (read-only Doctor landed in #236). On 2026-09-03 the maintainer asked that every open agent-bundle issue be fixed, which reverses that deferral. #452 ships the mutation half with every mutation opt-in (a separate
uninstallverb; nothing runs on install or doctor), receipt-owned (only what the receipt records is ever removed), and fail-closed (missing/foreign/mismatched receipt, unconfirmed purge, unusable host inventory, dirty staged marketplace all refuse before any change).agent-bundle uninstall <host>— CLI, package-relative installer bin, emittedinstall.mjs --uninstallpackages/agent-bundle/src/install/uninstall.ts,install-entry.ts,surface.ts;tests/uninstall.test.ts,tests/installer-entry.test.ts,tests/install-surface.test.ts--keep-data(default) /--purge-data --confirm-purgestate/, CursorPLUGIN_DATA, Claudeplugins/data/<id>kept behind a remnant receipt or purged;AB7008refuses an unconfirmed or shared purge; Codex's no-keep-data reality typedremoved-by-host--forceAB7009missing,AB7007mismatch/dirty staged tree; foreign and other-plugin receipts refused even with--force--plandry run with exact paths; idempotentnot-installeddoctor(placed → registered → enabled → active, typedunavailable)doctor.tslifecycle, aggregated across Claude scopes;AB7330; datedlifecyclecapability rows per host; adapter revisions advancedreceipt.ts; store receipts<plugin>.<marketplace>.<scope>[.<project digest>].json; format/1 read withmigratedFrom+AB7329, orphaned/unreadable store receiptsAB7328; malformed receipts never crashmarketplace addinstall.ts;tests/install.test.tsrollback cases;AB7004names the manual cleanup commands if rollback also failstests/host-install-proof.test.ts(25 passed),tests/packed-host-install-proof.test.ts(6 passed) on96d31e07b; CIHost install proofsgreen on9e69e8ac9docs/diagnostics.md,docs/framework-mode.md, package README, INSTALL.md template, site en+zhcli.mdx/installation.mdx;.changeset/101-managed-lifecycle.mdGates on the merged head (local + CI): typecheck, lint, unit (3169), route-unit, projection, build + integration (986), host-install proofs, packed proofs, docs site — all green. Codex reviewed rounds 1–6 (all threads fixed in code); the final three
@codex reviewrequests received no response, so the unreviewed SHAs are recorded in the PR body and the merge went on CI green per lane rules.chatgpt-codex-connector commentedon Sep 4, 2026
To use Codex here, create an environment for this repo.