@rbbtsn0w/adg 0.11.4 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +31 -12
  2. package/dist/src/agents/antigravity.js +218 -45
  3. package/dist/src/agents/claude.js +98 -38
  4. package/dist/src/agents/codex.js +1 -0
  5. package/dist/src/cli/core-plugin-handlers.js +3 -3
  6. package/dist/src/cli/handlers.js +160 -36
  7. package/dist/src/cli/index.js +19 -12
  8. package/dist/src/cli/review-update.js +80 -0
  9. package/dist/src/commands/install/default-dsl.js +1 -1
  10. package/dist/src/commands/install/install-one.js +41 -31
  11. package/dist/src/commands/install.js +38 -23
  12. package/dist/src/commands/marketplace.js +136 -109
  13. package/dist/src/commands/migrate.js +2 -2
  14. package/dist/src/commands/projection.js +3 -1
  15. package/dist/src/commands/remove.js +10 -0
  16. package/dist/src/commands/review-executables.js +106 -0
  17. package/dist/src/commands/select-agents.js +2 -2
  18. package/dist/src/commands/select-components.js +2 -2
  19. package/dist/src/commands/select-plugins.js +15 -2
  20. package/dist/src/commands/select-scope.js +3 -4
  21. package/dist/src/commands/source-upgrade.js +552 -0
  22. package/dist/src/commands/state.js +3 -1
  23. package/dist/src/commands/update.js +3 -1
  24. package/dist/src/lock.js +13 -5
  25. package/dist/src/migration-transaction.js +1011 -0
  26. package/dist/src/native-retry.js +329 -0
  27. package/dist/src/process-identity.js +65 -0
  28. package/dist/src/render/plugins.js +115 -9
  29. package/dist/src/source-history.js +194 -0
  30. package/dist/src/source-intent.js +7 -0
  31. package/dist/src/store-mutex.js +179 -0
  32. package/dist/src/types.js +1 -1
  33. package/dist/src/update-executables.js +193 -0
  34. package/dist/src/upgrade-plan.js +378 -0
  35. package/docs/agents/antigravity.md +5 -0
  36. package/docs/agents-spec.md +10 -0
  37. package/docs/branching-and-release.md +53 -0
  38. package/docs/plugin-update-semantics.md +30 -34
  39. package/docs/plugin-upgrade-migrations.md +349 -0
  40. package/package.json +4 -3
  41. package/schemas/plugin-lock.schema.json +78 -1
@@ -0,0 +1,378 @@
1
+ import { createHash } from "node:crypto";
2
+ import { exposedContents } from "./components.js";
3
+ import { COMPONENT_TYPES } from "./types.js";
4
+ function sameSource(a, b) {
5
+ return a.type === "github" && b.type === "github" && a.repo.toLowerCase() === b.repo.toLowerCase() && a.ref === b.ref;
6
+ }
7
+ const unique = (items) => [...new Set(items)].sort();
8
+ const enabledState = (plugin) => plugin.state ?? "enabled";
9
+ export function historyIdentity(plugin) {
10
+ return "history-" + createHash("sha256").update(JSON.stringify([
11
+ plugin.name, plugin.version, plugin.sourceHash, plugin.contents, plugin.selection,
12
+ ])).digest("hex");
13
+ }
14
+ function historicalSnapshot(plugin) {
15
+ return { name: plugin.name, version: plugin.version, origin: plugin.origin, contents: plugin.contents,
16
+ sourceHash: plugin.sourceHash, selection: plugin.selection, selectionKnown: plugin.selectionKnown,
17
+ effectiveSelection: plugin.effectiveSelection, state: plugin.state, evidence: plugin.evidence };
18
+ }
19
+ /** Resolve existing marketplace identity metadata before touching any installation. */
20
+ export function resolveRenames(renames, names) {
21
+ const result = new Map();
22
+ for (const former of Object.keys(renames)) {
23
+ const seen = new Set();
24
+ let name = former;
25
+ while (name !== null && Object.hasOwn(renames, name)) {
26
+ if (seen.has(name))
27
+ throw new Error(`Marketplace rename cycle: ${former}`);
28
+ seen.add(name);
29
+ name = renames[name];
30
+ }
31
+ if (name !== null && !names.has(name))
32
+ throw new Error(`Missing marketplace rename destination: ${name}`);
33
+ result.set(former, name);
34
+ }
35
+ return result;
36
+ }
37
+ /** Plan from client-owned installation evidence and an ordinary current catalog. */
38
+ export function planMigration(options) {
39
+ const result = { applied: [], destinations: [], retired: [], retained: [], decisions: [], blockers: [], deferredRecovery: [] };
40
+ const current = new Map(options.installed.filter(p => sameSource(p.origin, options.source)).map(p => [p.name, p]));
41
+ const history = new Map((options.history ?? []).filter(p => sameSource(p.origin, options.source)).map(p => [p.name, p]));
42
+ const candidates = new Map(options.candidates.map(p => [p.name, p]));
43
+ let renames;
44
+ try {
45
+ renames = resolveRenames(options.renames ?? {}, new Set(candidates.keys()));
46
+ }
47
+ catch (error) {
48
+ result.blockers.push(error.message);
49
+ return result;
50
+ }
51
+ const destinations = new Map();
52
+ const states = new Map();
53
+ const incoming = new Map();
54
+ const ownSelections = new Map();
55
+ const renamedFrom = new Map();
56
+ const visible = new Set([...current.values()].flatMap(p => exposedContents(p.contents, p.effectiveSelection ?? p.selection).skills));
57
+ const requestedSelectionFor = (name) => {
58
+ const candidate = candidates.get(name);
59
+ if (candidate && Object.hasOwn(candidate, "requestedSelection"))
60
+ return candidate.requestedSelection ?? undefined;
61
+ const existing = current.get(name);
62
+ return existing?.selection ?? (existing?.selectionKnown === false ? existing.effectiveSelection ?? { components: [] } : undefined);
63
+ };
64
+ const ensure = (name, predecessor, full = false) => {
65
+ const unrelated = options.installed.find(p => p.name === name && !sameSource(p.origin, options.source));
66
+ if (unrelated) {
67
+ result.blockers.push(`Destination belongs to a different source: ${name}`);
68
+ return;
69
+ }
70
+ const existing = current.get(name);
71
+ const existingSelection = requestedSelectionFor(name);
72
+ let dest = destinations.get(name);
73
+ if (!dest) {
74
+ dest = { name, state: enabledState(existing ?? predecessor), predecessors: [],
75
+ ...(existingSelection ? { selection: structuredClone(existingSelection) }
76
+ : existing || full ? {} : { selection: { components: ["skills"], skills: [] } }) };
77
+ destinations.set(name, dest);
78
+ states.set(name, new Set(existing ? [enabledState(existing)] : []));
79
+ }
80
+ dest.predecessors = unique([...dest.predecessors, predecessor.name]);
81
+ const contributions = states.get(name);
82
+ contributions.add(enabledState(predecessor));
83
+ if (contributions.size === 1)
84
+ dest.state = enabledState(predecessor);
85
+ return dest;
86
+ };
87
+ const empty = () => ({ skills: [], agents: [], commands: [], hooks: [], apps: [], mcp: [] });
88
+ const work = [...current.values()].map(old => ({ old, basis: history.get(old.name) ?? old, recovery: undefined }));
89
+ for (const recovery of options.deferredRecovery ?? []) {
90
+ const original = recovery.history;
91
+ if (!sameSource(original.origin, options.source))
92
+ continue;
93
+ // Deferred candidates remain evidence even after their former owner retired.
94
+ const skills = unique(recovery.skills.map(address => address.split(":").at(-1))).filter(skill => !visible.has(skill));
95
+ if (!skills.length)
96
+ continue;
97
+ work.push({ old: { ...original, contents: empty(), effectiveSelection: undefined },
98
+ basis: { ...original, contents: { ...empty(), skills }, selection: undefined, effectiveSelection: undefined, uncertain: true }, recovery });
99
+ }
100
+ const handled = new Set();
101
+ for (const { old, basis, recovery } of work) {
102
+ if (recovery && handled.has(recovery.id))
103
+ continue;
104
+ const reference = { ...basis, state: old.state };
105
+ if (!recovery && renames.has(old.name)) {
106
+ const target = renames.get(old.name);
107
+ if (old.evidence === "catalog" && old.selectionKnown !== true) {
108
+ const id = target === null ? `unmapped:${old.name}` : historyIdentity(basis);
109
+ handled.add(id);
110
+ const skills = target === null ? old.contents.skills.map(skill => `${old.name}:${skill}`)
111
+ : candidates.get(target).contents.skills.map(skill => `${target}:${skill}`);
112
+ const choice = options.decisions?.[id];
113
+ if (!choice)
114
+ result.decisions.push({ id, skills, choices: target === null ? ["keep", "drop"] : ["keep", "select", "restore"], uncertain: true });
115
+ if (!choice || choice.action === "keep" || (choice.action === "select" && !choice.skills?.length)) {
116
+ result.retained.push(old.name);
117
+ result.deferredRecovery.push({ id, history: historicalSnapshot(basis), skills: unique(skills) });
118
+ continue;
119
+ }
120
+ if (target !== null) {
121
+ const chosen = choice.action === "restore" ? skills : (choice.skills ?? []).filter(skill => skills.includes(skill));
122
+ if (chosen.length) {
123
+ const dest = ensure(target, old);
124
+ if (dest)
125
+ incoming.set(target, new Set([
126
+ ...(incoming.get(target) ?? []), ...chosen.map(address => address.slice(target.length + 1)),
127
+ ]));
128
+ }
129
+ }
130
+ result.retired.push(old.name);
131
+ result.applied.push(id);
132
+ continue;
133
+ }
134
+ if (target !== null && ensure(target, old, true)) {
135
+ renamedFrom.set(target, [...(renamedFrom.get(target) ?? []), old]);
136
+ }
137
+ result.retired.push(old.name);
138
+ result.applied.push(historyIdentity(basis));
139
+ continue;
140
+ }
141
+ const historical = exposedContents(basis.contents, basis.uncertain && basis.selectionKnown !== true ? undefined : basis.effectiveSelection ?? basis.selection);
142
+ const actual = exposedContents(old.contents, old.effectiveSelection ?? old.selection);
143
+ const requested = exposedContents(basis.contents, basis.selection);
144
+ const policy = basis.uncertain ? old : basis;
145
+ const candidatePolicy = candidates.get(old.name);
146
+ const policySelection = candidatePolicy && Object.hasOwn(candidatePolicy, "requestedSelection")
147
+ ? candidatePolicy.requestedSelection ?? undefined
148
+ : policy.selectionKnown === false ? policy.effectiveSelection ?? { components: [] } : policy.selection;
149
+ const exposed = { ...actual, skills: unique([...historical.skills, ...actual.skills]) };
150
+ const moves = [];
151
+ const explicitMoves = new Set();
152
+ const unavailable = new Set();
153
+ const dropped = new Set();
154
+ const relinquished = new Set();
155
+ let unresolved = false;
156
+ for (const skill of exposed.skills) {
157
+ // New manifests recalculate mandatory dependencies from requested policy.
158
+ // A previously derived skill is not a request to install another plugin.
159
+ if (basis.selection && basis.selectionKnown !== false && !requested.skills.includes(skill))
160
+ continue;
161
+ if (!recovery && old.evidence !== "catalog" && candidates.get(old.name)?.contents.skills.includes(skill))
162
+ continue;
163
+ const owners = options.candidates.filter(p => p.contents.skills.includes(skill));
164
+ if (owners.length === 0) {
165
+ if (recovery)
166
+ unavailable.add(skill);
167
+ else if (!candidates.has(old.name))
168
+ unresolved = true;
169
+ else if (old.evidence !== "catalog" && policySelection?.skills?.includes(skill)
170
+ && (!basis.uncertain || actual.skills.includes(skill))) {
171
+ const id = `drop:${old.name}:${skill}`;
172
+ const choice = options.decisions?.[id];
173
+ if (choice?.action === "drop")
174
+ dropped.add(skill);
175
+ else {
176
+ unresolved = true;
177
+ if (choice?.action === "keep")
178
+ result.retained.push(old.name);
179
+ else
180
+ result.decisions.push({ id, skills: [`${old.name}:${skill}`], choices: ["keep", "drop"] });
181
+ }
182
+ }
183
+ continue;
184
+ }
185
+ const sharedPeers = recovery ? [] : [...current.values()].filter(peer => {
186
+ if (peer.name === old.name)
187
+ return false;
188
+ const proof = history.get(peer.name) ?? peer;
189
+ const selection = proof.selectionKnown === false || (proof.evidence === "catalog" && proof.selectionKnown !== true)
190
+ ? proof.effectiveSelection ?? { components: [] } : proof.effectiveSelection ?? proof.selection;
191
+ return exposedContents(proof.contents, selection).skills.includes(skill);
192
+ });
193
+ const sharedBefore = sharedPeers.some(peer => {
194
+ const candidate = candidates.get(peer.name);
195
+ return candidate && exposedContents(candidate.contents, candidate.effectiveSelection ?? undefined).skills.includes(skill);
196
+ });
197
+ // A derived dependency cannot carry another owner's explicit request after that dependency changes.
198
+ const directlyRequestedByPeer = sharedPeers.some(peer => {
199
+ const candidate = candidates.get(peer.name);
200
+ return candidate && exposedContents(candidate.contents, requestedSelectionFor(peer.name)).skills.includes(skill);
201
+ });
202
+ if (sharedBefore && candidates.has(old.name) && (!policySelection?.skills?.includes(skill) || directlyRequestedByPeer)) {
203
+ if (policySelection?.skills?.includes(skill))
204
+ relinquished.add(skill);
205
+ continue;
206
+ }
207
+ if (sharedBefore && !candidates.has(old.name)) {
208
+ const historicallyShared = !history.size || sharedPeers.some(peer => history.has(peer.name));
209
+ const formerSelectionKnown = old.selectionKnown === true || (old.selection !== undefined && old.selectionKnown !== false);
210
+ // Known historical sharing retains whole-plugin review. A newly observed peer
211
+ // authorizes skill transfer only with the former owner's own selection or installed proof.
212
+ if (historicallyShared || (!formerSelectionKnown && old.evidence !== "installed")) {
213
+ unresolved = true;
214
+ continue;
215
+ }
216
+ }
217
+ if (!candidates.has(old.name) && sharedPeers.length && owners.length > 1) {
218
+ // Historical sharing cannot identify one successor after the old owners retire.
219
+ unresolved = true;
220
+ continue;
221
+ }
222
+ if (owners.length > 1) {
223
+ const uncertain = Boolean(recovery) || Boolean(basis.uncertain && !visible.has(skill));
224
+ const id = uncertain ? `ownership:${historyIdentity(recovery?.history ?? basis)}:${skill}` : `ownership:${old.name}:${skill}`;
225
+ const decision = options.decisions?.[id];
226
+ const addresses = owners.map(p => `${p.name}:${skill}`).sort();
227
+ const chosen = decision?.skills?.filter(address => addresses.includes(address));
228
+ if (decision?.action === "select" && chosen?.length === 1) {
229
+ moves.push({ skill, owner: chosen[0].split(":")[0] });
230
+ if (uncertain)
231
+ explicitMoves.add(chosen[0]);
232
+ }
233
+ else if (decision?.action === "keep") {
234
+ if (uncertain) {
235
+ result.deferredRecovery.push({ id, history: recovery?.history ?? historicalSnapshot(basis), skills: addresses });
236
+ if (!recovery && old.evidence === "catalog")
237
+ result.retained.push(old.name);
238
+ }
239
+ else {
240
+ unresolved = true;
241
+ if (!candidates.has(old.name))
242
+ result.retained.push(old.name);
243
+ else
244
+ result.blockers.push(`Ambiguous skill owner retained: ${old.name}:${skill}`);
245
+ }
246
+ }
247
+ else
248
+ result.decisions.push({ id, skills: addresses, choices: ["keep", "select"], ...(uncertain ? { uncertain: true } : {}) });
249
+ continue;
250
+ }
251
+ moves.push({ skill, owner: owners[0].name });
252
+ }
253
+ if (recovery && unavailable.size)
254
+ result.deferredRecovery.push({ ...recovery,
255
+ skills: recovery.skills.filter(address => unavailable.has(address.split(":").at(-1))) });
256
+ if ((!moves.length && !dropped.size && !relinquished.size) || unresolved) {
257
+ continue;
258
+ }
259
+ const retiring = !recovery && !candidates.has(old.name);
260
+ if (retiring && COMPONENT_TYPES.some(component => component !== "skills" && exposed[component].length > 0)) {
261
+ result.blockers.push(`Unmapped native components in retired plugin: ${old.name}`);
262
+ continue;
263
+ }
264
+ const missing = basis.uncertain ? moves.filter(move => !visible.has(move.skill) && !explicitMoves.has(`${move.owner}:${move.skill}`)) : [];
265
+ const id = recovery?.id ?? historyIdentity(basis);
266
+ if (recovery && handled.has(id))
267
+ continue;
268
+ handled.add(id);
269
+ const choice = options.decisions?.[id];
270
+ if (missing.length && !choice)
271
+ result.decisions.push({
272
+ id, skills: missing.map(move => `${move.owner}:${move.skill}`).sort(), choices: ["keep", "restore", "select"],
273
+ });
274
+ if (missing.length && choice?.action === "keep")
275
+ result.deferredRecovery.push({
276
+ id, history: recovery?.history ?? historicalSnapshot(basis),
277
+ skills: missing.map(move => `${move.owner}:${move.skill}`).sort(),
278
+ });
279
+ if (!recovery && missing.length && choice?.action === "keep" && old.evidence === "catalog")
280
+ result.retained.push(old.name);
281
+ for (const move of moves) {
282
+ const address = `${move.owner}:${move.skill}`;
283
+ if (missing.includes(move) && choice?.action !== "restore" && !(choice?.action === "select" && choice.skills?.includes(address)))
284
+ continue;
285
+ const dest = ensure(move.owner, reference);
286
+ if (dest) {
287
+ const skills = incoming.get(move.owner) ?? new Set();
288
+ skills.add(move.skill);
289
+ incoming.set(move.owner, skills);
290
+ }
291
+ }
292
+ if (retiring && !result.retained.includes(old.name))
293
+ result.retired.push(old.name);
294
+ else if (!recovery && (!basis.uncertain || dropped.size || relinquished.size)) {
295
+ const dest = ensure(old.name, reference);
296
+ if (dest && !(policy.selectionKnown === true && policySelection?.skills === undefined)) {
297
+ const selected = basis.uncertain || policy.selectionKnown === false ? exposedContents(policy.contents, policySelection).skills
298
+ : basis.selection && basis.selectionKnown !== false ? requested.skills : exposed.skills;
299
+ const remaining = selected
300
+ .filter(skill => !dropped.has(skill) && !relinquished.has(skill) && !moves.some(move => move.skill === skill));
301
+ ownSelections.set(old.name, { ...policySelection, components: [...(policySelection?.components ?? COMPONENT_TYPES)], skills: remaining });
302
+ }
303
+ }
304
+ if (!recovery || choice?.action === "restore" || choice?.action === "select")
305
+ result.applied.push(id);
306
+ }
307
+ for (const [name, dest] of destinations) {
308
+ if (result.retained.includes(name)) {
309
+ result.blockers.push(`Migration destination requires retaining its existing installation: ${name}`);
310
+ continue;
311
+ }
312
+ const existing = current.get(name);
313
+ const existingSelection = requestedSelectionFor(name);
314
+ let selection = ownSelections.get(name) ?? (existingSelection ? structuredClone(existingSelection) : dest.selection);
315
+ const renamed = renamedFrom.get(name) ?? [];
316
+ if (renamed.length === 1 && !existing) {
317
+ const former = renamed[0];
318
+ const requested = former.selection ?? (former.selectionKnown === false ? former.effectiveSelection : undefined);
319
+ selection = requested ? structuredClone(requested) : undefined;
320
+ }
321
+ if (renamed.length > 1 && !existing)
322
+ selection = { components: [], skills: [], mcp: [] };
323
+ if (selection && (existing || renamed.length > 1)) {
324
+ for (const former of renamed) {
325
+ const members = exposedContents(former.contents, former.selectionKnown === false ? former.effectiveSelection : former.selection);
326
+ for (const component of COMPONENT_TYPES.filter(component => members[component].length)) {
327
+ if (!selection.components.includes(component)) {
328
+ selection.components.push(component);
329
+ if (component === "skills")
330
+ selection.skills = [];
331
+ if (component === "mcp")
332
+ selection.mcp = [];
333
+ }
334
+ if (component === "skills" && selection.skills)
335
+ selection.skills = unique([...selection.skills, ...members.skills.filter(skill => candidates.get(name).contents.skills.includes(skill))]);
336
+ if (component === "mcp" && selection.mcp)
337
+ selection.mcp = unique([...selection.mcp, ...members.mcp.filter(server => candidates.get(name).contents.mcp.includes(server))]);
338
+ }
339
+ }
340
+ }
341
+ const skills = incoming.get(name);
342
+ if (selection && skills?.size) {
343
+ if (!selection.components.includes("skills")) {
344
+ selection.components.push("skills");
345
+ selection.skills = [];
346
+ }
347
+ if (selection.skills)
348
+ selection.skills = unique([...selection.skills, ...skills]);
349
+ }
350
+ if (selection)
351
+ selection.components = COMPONENT_TYPES.filter(component => selection.components.includes(component));
352
+ dest.selection = selection;
353
+ }
354
+ for (const [name, values] of states) {
355
+ if (values.size < 2)
356
+ continue;
357
+ const id = `state:${name}`;
358
+ const choice = options.decisions?.[id];
359
+ if (choice?.action === "enabled" || choice?.action === "disabled") {
360
+ destinations.get(name).state = choice.action;
361
+ destinations.get(name).stateResolved = true;
362
+ }
363
+ else
364
+ result.decisions.push({ id, skills: [], choices: ["enabled", "disabled"] });
365
+ }
366
+ result.applied = unique(result.applied);
367
+ result.retained = unique(result.retained);
368
+ result.blockers = unique(result.blockers);
369
+ const deferred = new Map();
370
+ for (const item of result.deferredRecovery) {
371
+ const previous = deferred.get(item.id);
372
+ deferred.set(item.id, { ...item, skills: unique([...(previous?.skills ?? []), ...item.skills]) });
373
+ }
374
+ result.deferredRecovery = [...deferred.values()].sort((a, b) => a.id.localeCompare(b.id));
375
+ result.destinations = [...destinations.values()].filter(p => !result.retired.includes(p.name) && !result.retained.includes(p.name)).sort((a, b) => a.name.localeCompare(b.name));
376
+ result.retired = result.blockers.length || result.decisions.length ? [] : unique(result.retired);
377
+ return result;
378
+ }
@@ -154,3 +154,8 @@ plugin root. The ADG adapter materializes files at these conventional locations.
154
154
 
155
155
  **Note**: These are injected by the generated `hook-runner.mjs`, not by the Antigravity
156
156
  runtime itself. The runner bridges Claude-format command scripts to Antigravity's I/O.
157
+
158
+ ADG places an owned physical plugin directory in the scan directory when the
159
+ store entry lives elsewhere. Native discovery skips a symlink at the plugin
160
+ root. Component aliases inside a physical root are supported. Ordinary update
161
+ repairs an older symlink exposure even when the source revision is unchanged.
@@ -341,3 +341,13 @@ When support for a new agent runtime is needed:
341
341
  4. **Update cross-agent matrices** (§8–§11) to include the new agent column.
342
342
  5. **Add hook event support** in [`src/hooks.ts`](../src/hooks.ts) `SUPPORTED_EVENTS`.
343
343
  6. **Test** via `adg plugins adapt --target <agent>` and `adg plugins validate`.
344
+
345
+ ## Updating plugin layouts
346
+
347
+ Keep plugin and skill identities stable when reorganizing source files. ADG
348
+ tracks verified installed inventories and follows unambiguous same-source
349
+ skill moves. Existing marketplace `renames` metadata can describe plugin name
350
+ changes or removals. Publishers maintain their current ordinary manifests and
351
+ catalog; recovery history belongs to the client store. The
352
+ [update and recovery plan](plugin-upgrade-migrations.md) documents decisions,
353
+ retirement and legacy recovery.
@@ -34,6 +34,13 @@ verification before publication. npmjs and GitHub Packages receive identical
34
34
  final bytes, with SHA512 integrity reconciliation and per-target receipts. GitHub
35
35
  attaches the archive and metadata. No version/changelog commit is written to main.
36
36
 
37
+ Before prepare or tag creation, the normal npm publisher checks the package's
38
+ publication history. A known previously used version is rejected even if its
39
+ version endpoint now returns E404; withdrawn npm version numbers cannot be reused.
40
+ Unreadable or ambiguous history fails closed. Preserve an already created failed
41
+ tag and its original receipts; semantic-release selects the next version from
42
+ that history. Recovery keeps its separate original-version contract.
43
+
37
44
  Before normal publication of a missing version, each registry receives a read-only
38
45
  channel check. An already newer `latest` stops that write; read errors and malformed
39
46
  channel data fail closed. Older, equal or missing `latest` retains the ordinary
@@ -294,3 +301,49 @@ If the next registry lookup temporarily returns E404, recovery waits within the
294
301
  shared budget without creating another request intent or publishing again.
295
302
  Finalization checks complete payload, remote identity and channel observations;
296
303
  it cannot declare delivery from the receipt status alone.
304
+
305
+ ## Node support and CI package manager
306
+
307
+ The supported runtime range is `^22.22.2 || ^24.15.0 || >=26`, aligned with the
308
+ selected npm 12.2.2 toolchain. Node 22.18, Node 23 and Node 25 are no longer
309
+ supported. This compatibility change is recorded as breaking release metadata;
310
+ semantic-release remains responsible for the next version. Existing releases
311
+ retain their original runtime declarations.
312
+
313
+ All CI matrix entries, PR commit validation and release jobs select npm 12.2.2
314
+ from a runner-temporary installation. The matrix covers exact Node 22.22.2 and
315
+ 24.15.0 minimums plus Node 26, with current Node 24/26 on macOS and Windows.
316
+ No old-runtime package-manager exception remains.
317
+
318
+ ## Pipeline capability configuration
319
+
320
+ `.github/release-train.json` owns configuration schema v2 / pipeline protocol v1,
321
+ required goals, existing execution bindings and cadence. The current explicit
322
+ schedule preserves Friday 15:00 Asia/Singapore (07:00 UTC). A new explicit empty
323
+ cadence uses Friday 15:00 Asia/Shanghai; changing cadence is a normal configuration
324
+ change, not a release approval. Runtime dispatch inputs do not change the schedule.
325
+
326
+ With isolated `yaml@2.9.1` provisioned in `RELEASE_TOOLS`, run the read-only checks:
327
+
328
+ ```bash
329
+ node .github/release-train/pipeline-contract.mjs check
330
+ node .github/release-train/cadence.mjs check
331
+ ```
332
+
333
+ An explicit maintenance `cadence.mjs update` changes only the native schedule
334
+ projection; review that diff. Original plans retain exact identity, notes and goals.
335
+ Reports/recovery use those original goals after configuration or main advances; old
336
+ plans remain compatible and never acquire invented receipts. Public capability
337
+ coordination stays separate from product/platform implementations and existing CI
338
+ job permissions. Activation, credentials and existing delivery destinations are
339
+ unchanged by configuration migration.
340
+
341
+ ## Ordinary CI release contracts
342
+
343
+ PR/main CI checks generated integrity, actual pipeline job bindings and configured
344
+ cadence in the existing Ubuntu Node 24.15.0 package-smoke matrix entry. CI and release candidate verification share `npm run test:release`, which automatically includes new release test files.
345
+ These checks do not depend on publication enablement or version changes. Product
346
+ test matrices remain independent; the contract environment selects npm 12 explicitly.
347
+ No publishing credentials, OIDC grant or private upstream checkout is needed.
348
+ A green check is evidence only when its log shows the applicable commands and
349
+ release tests ran; source/CI success does not prove channel delivery.
@@ -102,35 +102,36 @@ refresh failures continue to follow the command's established exit-code contract
102
102
 
103
103
  This work changes update decisions and provenance persistence. Before delivery,
104
104
  review partial failure, explicit recovery, cache recovery, timestamps, and
105
- disabled state together. This delivery adds no durable runtime retry queue and
106
- no lock-schema migration.
105
+ disabled state together. Source subscriptions, ownership migrations and retry behavior are specified in
106
+ [Plugin update and recovery](plugin-upgrade-migrations.md).
107
107
 
108
108
  ### Upstream removals and marketplace restructuring
109
109
 
110
- An update does not authorize a new desired plugin set. Keep installed plugins
111
- that are missing from the fetched source, including their payload, source cache,
112
- lock entry, component selection, and enabled/disabled state. This applies to
113
- `update --all` as well: that flag permits additions, not uninstalls. Continue
114
- updating plugins that still exist upstream. Do not silently derive a new Default
115
- DSL identity when explicit manifests disappear; migration requires an explicit
116
- `add` selection.
117
-
118
- Report retained names in `missingUpstream`, separately from actual removals in
119
- `deleted`, and count the incomplete source as failed so the CLI exits nonzero.
120
- Do not present an empty update as `up to date (0)`. Keep retained entries at
121
- their last verified revision so repeat checks can detect an upstream return.
122
- Plugins from one repository may follow different refs. Update checks each ref
123
- independently, including source-scoped updates, while list/remove/sync keep the
124
- repository-level view. `--all` preserves sibling pins; a dependency that would
125
- change another installed plugin's ref requires explicit migration.
126
- The `adg.plugins.update.missing_upstream` telemetry event records only the
127
- retained count and whether additions were requested.
128
-
129
- Use `adg plugins add <source>` with the original scope/ref to select replacements,
130
- or `adg plugins remove <name>` to explicitly remove a retired plugin. Explicit
131
- `add` retains its desired-set reconciliation behavior. Once an older release
132
- has deleted all installed entries for a source, `update` can no longer discover
133
- that source; recovery requires re-adding it.
110
+ ADG's verified installation history can transfer an installed capability to a
111
+ unique current owner at the same source and ref. Existing marketplace `renames`
112
+ metadata handles plugin identity changes. Legacy installations without a
113
+ trustworthy selection history get an in-command restoration choice. When no
114
+ replacement can be established, the user
115
+ can keep the old payload or explicitly retire it in the same update. Until that
116
+ decision, the old owner and cache stay available. The report distinguishes
117
+ `missingUpstream` from completed retirements in `deleted`. A one-time
118
+ `update --all` selection does not imply consent to remove old plugins or
119
+ subscribe to future additions. Each source ref is evaluated independently.
120
+
121
+ An explicit partial skill selection follows the same capabilities through a
122
+ split or merge. The effective mandatory dependencies are recalculated from the
123
+ current manifest; they do not become independently requested skills. Verified
124
+ source inventories establish availability, while independently verified
125
+ installed contents establish effective presence. An absent legacy selection
126
+ field alone cannot establish a full installation policy.
127
+
128
+ Unknown historical candidates default to keeping the current selection, with
129
+ no unproven candidates preselected. Deferral is stored locally, separately from
130
+ explicit exclusions. Unchanged cases do not prompt again; `update --repair`
131
+ reopens them, including after the original plugin retired. Non-interactive
132
+ updates preserve uncertain contents and report `deferredRecovery`, while
133
+ independently verifiable updates continue. An up-to-date installed selection
134
+ with deferred recovery is reported with both facts.
134
135
 
135
136
  Regression coverage in `test/plugins-update.test.ts` checks full replacement,
136
137
  partial disappearance, `--all`, runtime preservation, disabled/partial selections,
@@ -159,14 +160,9 @@ fails. Preserve that source outcome and report the native failure or unverified
159
160
  result separately, using the established nonzero failure outcome where
160
161
  applicable. The report must provide an actionable pending-sync message.
161
162
 
162
- Ordinary `plugins update` may take the already-checked source fast path on the
163
- next invocation; it is not an automatic retry mechanism for the failed native
164
- operation. Retry through `adg plugins sync` with the same scope and the intended
165
- runtime target, for example
166
- `adg plugins sync --global --target codex <plugin-name>` for one plugin in the
167
- global Codex store. This is an explicit recovery contract, not a persistent work
168
- queue. Neither a source checkpoint nor successful command dispatch proves that
169
- an existing session has loaded the new plugin.
163
+ A pending migration replays its recorded operations locally before fetching
164
+ another source revision. Verified native registration is distinct from the
165
+ behavior of an already running agent session.
170
166
 
171
167
  ## Delivery record
172
168