@rbbtsn0w/adg 0.10.1-dev.pr152.b8c43a6 → 0.10.1-dev.pr163.c74012b

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.
@@ -313,7 +313,7 @@ function translateDocument(pluginDir, pluginName, document) {
313
313
  return { definition, warnings };
314
314
  }
315
315
  /** Materialize a plugin's hooks under Antigravity's required root filename and native schema. */
316
- export function writeAntigravityHooks(pluginDir, manifest, selection) {
316
+ export function writeAntigravityHooks(pluginDir, manifest, selection, runtimeRoot = pluginDir) {
317
317
  const target = join(pluginDir, TARGET_FILE);
318
318
  const sources = hookSources(pluginDir, manifest);
319
319
  const sourceIsTarget = sources.canonical !== undefined && resolve(sources.canonical) === resolve(target);
@@ -333,7 +333,9 @@ export function writeAntigravityHooks(pluginDir, manifest, selection) {
333
333
  return [];
334
334
  }
335
335
  const document = parseJsonFile(sources.canonical, "canonical hooks");
336
- const { definition, warnings } = translateDocument(pluginDir, manifest.name, document);
336
+ // Commands execute after staging is promoted: embed the installed location,
337
+ // while source reads and generated file writes still use the staging folder.
338
+ const { definition, warnings } = translateDocument(runtimeRoot, manifest.name, document);
337
339
  if (Object.keys(definition).length) {
338
340
  const projected = { [manifest.name]: definition };
339
341
  validateNativeDocument(projected);
@@ -11,7 +11,7 @@ import { writeAntigravityHooks } from "../adapters/antigravity-hooks.js";
11
11
  * mapping when present, otherwise falls back to the adapter's default path.
12
12
  * An optional `selection` narrows what the generated manifests expose.
13
13
  */
14
- export function adaptPlugin(pluginDir, targets, selection) {
14
+ export function adaptPlugin(pluginDir, targets, selection, runtimeRoot = pluginDir) {
15
15
  const manifest = readManifest(pluginDir);
16
16
  const results = [];
17
17
  // Surface target event gaps before they become silent no-ops. Antigravity's
@@ -28,7 +28,7 @@ export function adaptPlugin(pluginDir, targets, selection) {
28
28
  writeJson(file, out);
29
29
  if (target === "antigravity") {
30
30
  writeAntigravityMcpConfig(pluginDir, manifest, selection);
31
- for (const warning of writeAntigravityHooks(pluginDir, manifest, selection))
31
+ for (const warning of writeAntigravityHooks(pluginDir, manifest, selection, runtimeRoot))
32
32
  hookWarnings.add(warning);
33
33
  }
34
34
  results.push({ target, file });
@@ -1,4 +1,5 @@
1
- import { existsSync } from "node:fs";
1
+ import { existsSync, mkdtempSync, readdirSync, rmSync } from "node:fs";
2
+ import { tmpdir } from "node:os";
2
3
  import { basename, join, relative, resolve } from "node:path";
3
4
  import { isDeepStrictEqual } from "node:util";
4
5
  import { ADAPTER_TARGETS } from "../../adapters/index.js";
@@ -10,9 +11,10 @@ import { readLock, upsertEntry, writeLock } from "../../lock.js";
10
11
  import { readManifest } from "../../manifest.js";
11
12
  import { recordTelemetryEvent } from "../../telemetry.js";
12
13
  import { readMarketplace, upsertMarketplacePlugin, writeMarketplace } from "../../marketplace.js";
13
- import { normalizePluginSelection, resolveSelectionDependencies, sameSource, } from "../../types.js";
14
+ import { normalizePluginSelection, COMPONENT_TYPES, resolveSelectionDependencies, sameSource, } from "../../types.js";
14
15
  import { pluginContents } from "../../components.js";
15
16
  import { effectivePackageFilter, materializePlugin, withPluginSourceCache } from "../../materialize.js";
17
+ import { pluginComparisonHash } from "../../plugin-changes.js";
16
18
  // Generated runtime projections never count toward a plugin's content hash.
17
19
  const HASH_IGNORE = PROJECTION_DIRS;
18
20
  /** Content hash over a plugin's packaged payload (hooks files are authored content, not generated). */
@@ -78,14 +80,79 @@ export function installPlugin(opts) {
78
80
  }
79
81
  const sourceHash = contentHash(source, manifest);
80
82
  const cacheDir = pluginSourceCacheDir(opts.pluginsDir, name);
83
+ const targets = opts.targets ?? [...ADAPTER_TARGETS];
84
+ const contents = pluginContents(source, manifest);
85
+ const selectedContents = (value) => Object.fromEntries(COMPONENT_TYPES.map((component) => {
86
+ const available = contents[component];
87
+ const selected = component === "skills" ? value?.skills : component === "mcp" ? value?.mcp : undefined;
88
+ return [component, value && !value.components.includes(component) ? [] : available.filter((name) => !selected || selected.includes(name)).sort()];
89
+ }));
90
+ const effectiveSelectionChanged = !isDeepStrictEqual(selectedContents(resolveSelectionDependencies(manifest, prev?.selection)), selectedContents(selection));
91
+ const changes = {
92
+ version: !prev || prev.version !== manifest.version,
93
+ content: true,
94
+ selection: !isDeepStrictEqual(prev?.selection, desiredSelection),
95
+ source: Boolean(prev && opts.resolvedRevision && prev.resolvedRevision !== opts.resolvedRevision),
96
+ };
97
+ // Capture comparison evidence before the cache transaction replaces it.
98
+ if (prev && existsSync(cacheDir)) {
99
+ try {
100
+ const priorManifest = readManifest(cacheDir);
101
+ if (contentHash(cacheDir, priorManifest) === prev.sourceHash) {
102
+ changes.content = pluginComparisonHash(cacheDir, priorManifest) !== pluginComparisonHash(source, manifest);
103
+ }
104
+ }
105
+ catch { /* Missing/invalid comparison evidence requires a conservative update. */ }
106
+ }
107
+ let projectionsIntact = false;
108
+ let installationIntact = false;
109
+ try {
110
+ const installedManifest = readManifest(dest);
111
+ const previousSelection = resolveSelectionDependencies(installedManifest, prev?.selection);
112
+ installationIntact = Boolean(prev && folderHash(dest, PROJECTION_DIRS, effectivePackageFilter(installedManifest, previousSelection)) === prev.installedHash);
113
+ // Generate the complete expected installation, including auxiliary MCP,
114
+ // hooks and runner files that are outside native manifest directories.
115
+ const work = mkdtempSync(join(tmpdir(), "adg-projection-check-"));
116
+ try {
117
+ const expected = join(work, "expected");
118
+ materializePlugin({ source: dest, destination: expected, manifest: installedManifest, selection: previousSelection,
119
+ build: (staging) => { adaptPlugin(staging, targets, previousSelection, dest); } });
120
+ const paths = new Set();
121
+ const collect = (dir, prefix = "") => {
122
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
123
+ const path = prefix ? `${prefix}/${entry.name}` : entry.name;
124
+ paths.add(path);
125
+ if (entry.isDirectory())
126
+ collect(join(dir, entry.name), path);
127
+ }
128
+ };
129
+ collect(expected);
130
+ projectionsIntact = folderHash(expected) === folderHash(dest, [], (path) => paths.has(path));
131
+ }
132
+ finally {
133
+ rmSync(work, { recursive: true, force: true });
134
+ }
135
+ }
136
+ catch { /* Missing or damaged projections must be regenerated. */ }
81
137
  return withPluginSourceCache(source, cacheDir, manifest, (snapshot) => {
82
138
  // Detect-then-update compares the complete source snapshot, never the
83
139
  // selection-pruned runtime installation.
84
140
  if (!opts.forceMaterialize && opts.skipUnchanged && prev
141
+ && !effectiveSelectionChanged && projectionsIntact
85
142
  && prev.sourceHash === sourceHash && prev.version === manifest.version) {
86
143
  const installedIntact = existsSync(dest)
87
144
  && folderHash(dest, PROJECTION_DIRS, effectivePackageFilter(manifest, selection)) === prev.installedHash;
88
145
  if (installedIntact) {
146
+ if (changes.source || changes.selection) {
147
+ // Exact bytes are verified at this revision; this is not an install.
148
+ lock.plugins[name] = {
149
+ ...prev,
150
+ ...(changes.source ? { resolvedRevision: opts.resolvedRevision } : {}),
151
+ ...(desiredSelection ? { selection: desiredSelection } : {}),
152
+ };
153
+ writeLock(lockFile, lock);
154
+ }
155
+ recordTelemetryEvent("adg.install.change", { ...changes, "runtime.refresh_required": false }, opts.telemetrySpan);
89
156
  return {
90
157
  name,
91
158
  version: manifest.version,
@@ -94,10 +161,11 @@ export function installPlugin(opts) {
94
161
  installedHash: prev.installedHash,
95
162
  adapted: [],
96
163
  changed: false,
164
+ changes,
165
+ runtimeRefreshRequired: false,
97
166
  };
98
167
  }
99
168
  }
100
- const targets = opts.targets ?? [...ADAPTER_TARGETS];
101
169
  const adapted = [];
102
170
  let installedHash = "";
103
171
  materializePlugin({
@@ -106,7 +174,7 @@ export function installPlugin(opts) {
106
174
  manifest,
107
175
  selection,
108
176
  build: (staging) => {
109
- adapted.push(...adaptPlugin(staging, targets, selection).map((r) => relative(staging, r.file)));
177
+ adapted.push(...adaptPlugin(staging, targets, selection, dest).map((r) => relative(staging, r.file)));
110
178
  installedHash = folderHash(staging, PROJECTION_DIRS, effectivePackageFilter(manifest, selection));
111
179
  },
112
180
  });
@@ -143,6 +211,9 @@ export function installPlugin(opts) {
143
211
  ...(manifest.category ? { category: manifest.category } : {}),
144
212
  });
145
213
  writeMarketplace(marketFile, market);
146
- return { name, version: manifest.version, installedTo: dest, sourceHash, installedHash, adapted: adaptedFiles, changed };
214
+ const runtimeRefreshRequired = !prev || changes.version || changes.selection || !projectionsIntact || !installationIntact
215
+ || prev.installedHash !== installedHash || Boolean(opts.forceMaterialize);
216
+ recordTelemetryEvent("adg.install.change", { ...changes, "runtime.refresh_required": runtimeRefreshRequired }, opts.telemetrySpan);
217
+ return { name, version: manifest.version, installedTo: dest, sourceHash, installedHash, adapted: adaptedFiles, changed, changes, runtimeRefreshRequired };
147
218
  });
148
219
  }
@@ -70,7 +70,7 @@ async function prepareSource(opts, parsed, sourceRef) {
70
70
  function activateInstalled(opts, targets, installed, existingPlugins) {
71
71
  const updatedLock = readLock(lockPath(opts.pluginsDir));
72
72
  const eligible = installed.filter((result) => pluginState(updatedLock.plugins[result.name]) === "enabled");
73
- const toActivate = opts.skipUnchanged ? eligible.filter((result) => result.changed) : eligible;
73
+ const toActivate = opts.skipUnchanged ? eligible.filter((result) => result.runtimeRefreshRequired ?? result.changed) : eligible;
74
74
  if (!opts.activate || toActivate.length === 0)
75
75
  return undefined;
76
76
  const resolved = opts.agents ?? resolveAgents(targets);
@@ -90,7 +90,15 @@ function activateInstalled(opts, targets, installed, existingPlugins) {
90
90
  parts.push(agent.activate(ctxFor(activateNames)));
91
91
  if (refreshNames.length > 0)
92
92
  parts.push(agent.refresh(ctxFor(refreshNames)));
93
- return parts.reduce((acc, result) => ({ agent: result.agent, affected: [...acc.affected, ...result.affected], skipped: acc.skipped && result.skipped, ...((acc.failures?.length || result.failures?.length) ? { failures: [...(acc.failures ?? []), ...(result.failures ?? [])] } : {}) }), { agent: agent.id, affected: [], skipped: true });
93
+ return parts.reduce((acc, result) => ({
94
+ agent: result.agent,
95
+ affected: [...acc.affected, ...result.affected],
96
+ skipped: acc.skipped && result.skipped,
97
+ ...((acc.failures?.length || result.failures?.length) ? { failures: [...(acc.failures ?? []), ...(result.failures ?? [])] } : {}),
98
+ ...Object.fromEntries(["verified", "unverified", "preservedDisabled"]
99
+ .filter((field) => acc[field] !== undefined || result[field] !== undefined)
100
+ .map((field) => [field, [...new Set([...(acc[field] ?? []), ...(result[field] ?? [])])]])),
101
+ }), { agent: agent.id, affected: [], skipped: true });
94
102
  });
95
103
  }
96
104
  /**
@@ -231,6 +231,9 @@ export async function updatePlugins(opts) {
231
231
  unchanged: installed.filter((r) => !r.changed).map((r) => r.name).sort(),
232
232
  deleted: group.installed.filter((n) => !availableSet.has(n)).sort(),
233
233
  available: [...available].filter((n) => !installedNow.has(n) && !group.installed.includes(n)).sort(),
234
+ changes: installed.filter((r) => r.changes).map((r) => ({
235
+ name: r.name, ...r.changes, runtimeRefreshRequired: r.runtimeRefreshRequired ?? r.changed,
236
+ })).sort((a, b) => a.name.localeCompare(b.name)),
234
237
  });
235
238
  }
236
239
  catch (err) {
@@ -266,7 +269,9 @@ export async function updatePlugins(opts) {
266
269
  scope: opts.agentScope ?? "project",
267
270
  }, false, repairAgent, {
268
271
  initial, observed: true,
269
- changed: [...remote.flatMap((source) => source.updated), ...local.results.filter((plugin) => plugin.changed).map((plugin) => plugin.name)],
272
+ changed: [...remote.flatMap((source) => source.changes
273
+ ? source.changes.filter((plugin) => plugin.runtimeRefreshRequired).map((plugin) => plugin.name)
274
+ : source.updated), ...local.results.filter((plugin) => plugin.runtimeRefreshRequired ?? plugin.changed).map((plugin) => plugin.name)],
270
275
  removed: repairNames.filter((name) => !currentLock.plugins[name]),
271
276
  })] : [];
272
277
  const agents = mergeAgentResults([remoteAgents, local.agents ?? [], repairs]);
@@ -8,6 +8,7 @@ import { installPlugin } from "./install.js";
8
8
  import { resolveDefaultDsl } from "../default-dsl.js";
9
9
  import { ADG_MANIFEST_PATH } from "../manifest.js";
10
10
  import { copyPluginDir, writeJson } from "../fsutil.js";
11
+ import { pluginState } from "../types.js";
11
12
  /**
12
13
  * Refresh local sources and repair effective installations from their complete
13
14
  * source snapshots. Runtime installations are never treated as upstream input.
@@ -80,7 +81,7 @@ export function updateLock(pluginsDir, now = new Date().toISOString(), opts = {}
80
81
  if (staging)
81
82
  rmSync(staging, { recursive: true, force: true });
82
83
  }
83
- if (result.changed)
84
+ if ((result.runtimeRefreshRequired ?? result.changed) && pluginState(entry) === "enabled")
84
85
  changedNames.push(name);
85
86
  results.push({
86
87
  name,
@@ -88,6 +89,8 @@ export function updateLock(pluginsDir, now = new Date().toISOString(), opts = {}
88
89
  version: result.version,
89
90
  sourceHash: result.sourceHash,
90
91
  installedHash: result.installedHash,
92
+ ...(result.changes ? { changes: result.changes } : {}),
93
+ runtimeRefreshRequired: result.runtimeRefreshRequired ?? result.changed,
91
94
  });
92
95
  }
93
96
  const out = { results, missing };
@@ -74,7 +74,7 @@ export function effectivePackageFilter(manifest, selection) {
74
74
  if (rawPath === "")
75
75
  return true;
76
76
  const relPath = toPosix(rawPath);
77
- if (relPath === ".agents" || relPath === ADG_MANIFEST_PATH)
77
+ if (relPath === ".agents" || relPath === toPosix(ADG_MANIFEST_PATH))
78
78
  return true;
79
79
  if (relPath.startsWith("../") || relPath === "..")
80
80
  return false;
@@ -0,0 +1,22 @@
1
+ import { createHash } from "node:crypto";
2
+ import { readFileSync } from "node:fs";
3
+ import { relative } from "node:path";
4
+ import { folderHash } from "./hash.js";
5
+ import { findManifestFile } from "./manifest.js";
6
+ import { packageFilter, PROJECTION_DIRS } from "./package.js";
7
+ function stable(value) {
8
+ return JSON.stringify(value, (_key, item) => item && typeof item === "object" && !Array.isArray(item)
9
+ ? Object.fromEntries(Object.entries(item).sort(([a], [b]) => a.localeCompare(b))) : item);
10
+ }
11
+ /** Comparison only: never replaces exact source/installation integrity digests. */
12
+ export function pluginComparisonHash(dir, manifest) {
13
+ const file = findManifestFile(dir);
14
+ const manifestPath = file && relative(dir, file).replaceAll("\\", "/");
15
+ const include = packageFilter(manifest, { includeProjections: false });
16
+ const payload = folderHash(dir, PROJECTION_DIRS, (path) => path !== manifestPath && include(path));
17
+ // Preserve authored and inherited fields. Only the top-level version is omitted.
18
+ const raw = file ? JSON.parse(readFileSync(file, "utf8")) : manifest;
19
+ const { version: _rawVersion, ...rawContent } = raw;
20
+ const { version: _version, ...resolvedContent } = manifest;
21
+ return `comparison-v1-${createHash("sha256").update(payload).update(stable(rawContent)).update(stable(resolvedContent)).digest("hex")}`;
22
+ }
@@ -28,9 +28,14 @@ export function renderAgentReport(agents, verb) {
28
28
  const name = getAgent(r.agent)?.displayName ?? r.agent;
29
29
  for (const failure of r.failures ?? [])
30
30
  out.push(ui.err(`${name}: ${failure.stage}${failure.plugin ? ` ${failure.plugin}` : ""}: ${failure.message}`));
31
- const completed = r.verified ?? r.affected;
31
+ const failed = new Set((r.failures ?? []).flatMap((failure) => failure.plugin ? [failure.plugin] : []));
32
+ const uncertain = new Set(r.unverified ?? []);
33
+ const globalFailure = r.failures?.some((failure) => !failure.plugin);
34
+ const completed = (r.verified ?? (globalFailure ? [] : r.affected)).filter((plugin) => !failed.has(plugin) && !uncertain.has(plugin));
32
35
  if (completed.length > 0)
33
36
  out.push(`${ui.ok(verb)} in ${ui.name(name)}: ${completed.join(", ")}`);
37
+ if (r.failures?.length || r.unverified?.length)
38
+ out.push(ui.warn(`runtime synchronization pending in ${name}; run \`adg plugins sync --target ${r.agent}\` with the same scope to retry.`));
34
39
  if (r.unverified?.length)
35
40
  out.push(ui.warn(`installed, recovery unverified in ${name}: ${r.unverified.join(", ")}`));
36
41
  if (r.preservedDisabled?.length)
@@ -106,7 +111,18 @@ export function renderUpdateReport(result) {
106
111
  out.push(`${head} ${ui.err("could not be checked")} ${ui.meta(`— ${r.failed}`)}`);
107
112
  continue;
108
113
  }
109
- if (r.updated.length > 0)
114
+ if (r.updated.length > 0 && r.changes) {
115
+ const versionOnly = r.updated.filter((name) => {
116
+ const change = r.changes.find((item) => item.name === name);
117
+ return change?.version && !change.content && !change.selection;
118
+ });
119
+ const content = r.updated.filter((name) => !versionOnly.includes(name));
120
+ if (content.length > 0)
121
+ out.push(`${head}: ${ui.ok(`content/configuration updated ${content.join(", ")}`)}`);
122
+ if (versionOnly.length > 0)
123
+ out.push(`${head}: ${ui.meta(`version only ${versionOnly.join(", ")} (component files unchanged)`)}`);
124
+ }
125
+ else if (r.updated.length > 0)
110
126
  out.push(`${head}: ${ui.ok(`updated ${r.updated.join(", ")}`)}`);
111
127
  else
112
128
  out.push(`${head}: ${ui.meta(`up to date (${r.unchanged.length})`)}`);
@@ -118,7 +134,9 @@ export function renderUpdateReport(result) {
118
134
  }
119
135
  }
120
136
  for (const res of result.local.results) {
121
- out.push(`${res.changed ? ui.ok("updated") : ui.meta("unchanged")} ${ui.name(`${res.name}@${res.version}`)} ${ui.meta("(local)")}`);
137
+ const versionOnly = res.changes?.version && !res.changes.content && !res.changes.selection;
138
+ const label = !res.changed ? ui.meta("unchanged") : versionOnly ? ui.meta("version only") : ui.ok("content/configuration updated");
139
+ out.push(`${label} ${ui.name(`${res.name}@${res.version}`)} ${ui.meta("(local)")}`);
122
140
  }
123
141
  for (const m of result.local.missing)
124
142
  out.push(ui.warn(` ! missing directory for locked plugin: ${m}`));
@@ -123,6 +123,11 @@ The lock records two hashes: `sourceHash` covers the complete cached payload and
123
123
  `installedHash` covers the effective selection. Runtime projections are excluded
124
124
  from both hashes so re-adapting does not churn content identity.
125
125
 
126
+ The approved consumer-side update work separates publisher versions, packaged
127
+ content changes, verified repository checkpoints, and native synchronization.
128
+ See [Plugin Update Semantics and Delivery Tracking](plugin-update-semantics.md)
129
+ for its acceptance matrix and implementation/validation status.
130
+
126
131
  The cache is scoped by a stable store id under the OS-managed
127
132
  system cache tree (`~/Library/Caches/adg/plugins/` on macOS,
128
133
  `$XDG_CACHE_HOME/adg/plugins/` on Linux). `adg plugins cache status` reports
@@ -0,0 +1,152 @@
1
+ # Plugin Update Semantics and Delivery Tracking
2
+
3
+ **Status:** Local implementation verified; native runtime validation tracked separately
4
+
5
+ **Decision date:** 2026-10-30
6
+
7
+ **Delivery owner:** ADG lead; project-management tracking in this document
8
+
9
+ **Tracking issue:** [ADG #161](https://github.com/RbBtSn0w/adg/issues/161)
10
+
11
+ ## Problem and approved direction
12
+
13
+ A repository can publish multiple plugins under one synchronized version or
14
+ version each plugin independently. Both are valid publisher policies. ADG must
15
+ explain whether a release changed plugin content, only its version, or the
16
+ effective installation, without requiring publishers to change their release
17
+ automation.
18
+
19
+ Previously, one `changed` flag combined source, version, lock-record, and runtime
20
+ refresh concerns. A synchronized version bump therefore appeared indistinguishable
21
+ from a skill update. An unchanged plugin could also retain an older checked
22
+ revision, preventing subsequent checks from taking the repository fast path.
23
+
24
+ The approved solution belongs in ADG. The apple-skills selective-version proposal
25
+ in [PR #90](https://github.com/RbBtSn0w/apple-skills/pull/90) is superseded as the
26
+ general fix. The lead's live check found that PR already merged at
27
+ 2026-10-30 10:17:31 UTC (commit `580ee607`) and release `v1.32.1` followed at
28
+ 10:18:21 UTC. It cannot now be closed as an open proposal. Reverting published
29
+ producer behavior is a separate decision; this ADG delivery supports both
30
+ publisher policies without depending on such a revert.
31
+
32
+ ## Required boundaries
33
+
34
+ | Boundary | Contract |
35
+ | --- | --- |
36
+ | Publisher version | Preserve the publisher's version. Accept synchronized and independent version policies without new author configuration. |
37
+ | Source integrity | Preserve exact source and installed digests; a comparison that excludes only the version field must not replace integrity validation. |
38
+ | Change classification | Distinguish version-only changes from other packaged files or normalized manifest changes. Unknown or unavailable comparison input is handled conservatively. |
39
+ | Repository checkpoint | Advance a checked revision only after the relevant source has been successfully examined. A checkpoint-only update must not imply a content update or native refresh. |
40
+ | Effective selection | Keep unselected payload separate from the selected installation. Changes to dependency closure and selected configuration remain significant. |
41
+ | Runtime synchronization | Plan native work separately from human-readable change reasons. A version-only release may still need native refresh to preserve native manifest/cache correctness. |
42
+ | Runtime outcome | A successful source update does not prove native registration, cache replacement, or loading in an existing session. Report unavailable, failed, and unverified outcomes accurately. |
43
+ | Desired state | Preserve disabled plugins and stored selections throughout update and recovery. |
44
+
45
+ Classification must cover canonical manifests, imported native manifests, and
46
+ Default DSL sources. Removing an entire manifest from comparison would hide
47
+ dependency, hook, MCP, component-pointer, and other configuration changes and is
48
+ not an acceptable version-only optimization.
49
+
50
+ ## Scope and ownership
51
+
52
+ | Workstream | Owner | Deliverable | Completion evidence |
53
+ | --- | --- | --- | --- |
54
+ | Core comparison | Core implementation worker | Classification and exact-source comparison with backward-compatible install outcomes | Focused regression tests and implementation diff |
55
+ | Checkpoint and reporting | Update/reporting worker | Repeat-check behavior, classified output, and runtime work selection | Isolated update tests, renderer tests, and clone-count assertions |
56
+ | Runtime boundary | Core/update workers; lead integrates | Conservative native refresh and explicit failure/unavailable results | Lifecycle test doubles; native evidence recorded separately |
57
+ | Project tracking | Project-management worker | Scope, acceptance matrix, risks, and remaining validation | This document and linked ADG issue |
58
+ | Integration | Lead | Combined checks, review, and final acceptance | Commands/results from the integrated working tree |
59
+
60
+ The first delivery retains conservative native behavior where the runtime's
61
+ capabilities have not been demonstrated. Skipping native refresh for version-only
62
+ changes is not a requirement. Content-addressed native caches, synthetic semantic
63
+ versions, a new producer release protocol, and a universal plugin versioning
64
+ strategy are outside this delivery.
65
+
66
+ ## Acceptance matrix
67
+
68
+ Every implementation row requires an automated regression or an explicit existing
69
+ test reference. Native validation rows require their own runtime evidence and must
70
+ not be marked complete using test doubles alone.
71
+
72
+ | ID | Scenario | Expected outcome | Evidence status |
73
+ | --- | --- | --- | --- |
74
+ | A1 | Synchronized repository release changes one skill and all plugin versions | Changed plugin is a content update; peers are version-only updates; all versions remain truthful | Passed: `plugins-update.test.ts` — `updatePlugins distinguishes lockstep release versions from component changes` |
75
+ | A2 | Independently versioned release changes one plugin | Only the affected plugin is reported as changed; peers remain untouched | Passed: `plugins-update.test.ts` — `updatePlugins reports updated when upstream content changed` and activation filtering test |
76
+ | A3 | Payload changes without a version bump | Detect content change and perform required synchronization | Passed: `plugins-update.test.ts` — `updatePlugins refreshes remaining skills after a skill is deleted upstream` |
77
+ | A4 | Manifest metadata, dependencies, component pointers, or selection dependencies change | Classify as more than version-only; preserve existing dependency and authorization checks | Passed: `plugin-changes.test.ts` — `same-version manifest configuration changes remain content updates` and `dependency metadata remains a content change and is persisted`. Existing dependency-closure coverage: `install.test.ts` — `component selection materializes its declared skill dependencies`; complete suite passed (661/661) |
78
+ | A5 | Source changes only outside the current selection | Source update and effective-selection change are not conflated; skip native work only if the effective input is proven unchanged | Passed: `plugins-update.test.ts` — `updatePlugins retains unselected source changes without unnecessary runtime refresh` |
79
+ | A6 | Disabled plugin receives content or version update | Refresh stored source while keeping it disabled; no activation | Passed: `plugins-update.test.ts` — disabled remote payload and disabled local source regression tests |
80
+ | A7 | Repository advances but one plugin's exact bytes remain equal | Record the verified revision without a content update or timestamp/native-refresh churn | Passed: monorepo checkpoint regression and `plugin-changes.test.ts` — `verified identical bytes advance source revision without installation timestamp churn` |
81
+ | A8 | Repeat update against the same verified repository revision | Avoid another clone caused by an unchanged peer's stale checkpoint | Passed: `plugins-update.test.ts` — `updatePlugins checkpoints unchanged monorepo members to avoid a second clone` |
82
+ | A9 | Source or classification fails partway through checking | Do not record an unchecked revision as a successful checkpoint or report a failed source as synchronized | Fetch-failure path passed: `plugins-update.test.ts` — `updatePlugins surfaces a source that cannot be fetched`; checkpoint persistence is confined to each successfully verified plugin; a failed peer cannot receive an unchecked checkpoint (integration code review) |
83
+ | A10 | Native synchronization fails or the runtime is unavailable | Preserve source facts, expose failure/skipped state, and avoid claiming the runtime has loaded the new version | Passed: source-version/runtime-failure test plus three failure/unverified renderer regressions in `render.test.ts`. Real unavailable-runtime behavior remains N1–N3 validation scope |
84
+ | A11 | Previous cache/comparison data is missing or a retained lock format is read | Recover or conservatively refresh; no false unchanged result or publisher burden | Passed: `plugin-changes.test.ts` — `missing comparison cache conservatively avoids a version-only claim`. Existing legacy/native/Default DSL recovery in `source-cache.test.ts` and compatibility-read v3 persistence in `telemetry.test.ts` passed in the complete suite (661/661) |
85
+ | A12 | Canonical, native, and Default DSL manifests are used | Classify normalized metadata correctly without losing exact integrity checks | Passed: canonical lockstep and Default DSL identity regressions in `plugins-update.test.ts`, plus `plugin-changes.test.ts` — `native manifest releases use normalized metadata for version-only classification` |
86
+ | N1 | Native version-only refresh | Observe actual native manifest/version registration and retained enabled/disabled state for each supported runtime | Not run |
87
+ | N2 | Native same-version content refresh | Observe actual replacement/loading behavior; do not infer it from the ADG lock alone | Not run |
88
+ | N3 | Existing session versus a new session | Record whether a reload or new session is needed separately from registration success | Not run |
89
+
90
+ ## Verification and rollout
91
+
92
+ The lead records focused regression results first, then type checking, build, and
93
+ the repository test suite appropriate to the integrated change. New telemetry
94
+ must use bounded change/outcome attributes and must not include paths, user data,
95
+ raw arguments, or secrets. Regression fixtures use temporary caches and explicit
96
+ revision resolvers to avoid touching user installations or making incidental
97
+ network calls.
98
+
99
+ Existing `updated`/`unchanged` consumers must retain a compatible interpretation;
100
+ new detail may refine their meaning but must not silently reverse it. Runtime
101
+ refresh failures continue to follow the command's established exit-code contract.
102
+
103
+ This work changes update decisions and provenance persistence. Before delivery,
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.
107
+
108
+ ### Explicit synchronization recovery
109
+
110
+ A verified source checkpoint remains valid when a subsequent native refresh
111
+ fails. Preserve that source outcome and report the native failure or unverified
112
+ result separately, using the established nonzero failure outcome where
113
+ applicable. The report must provide an actionable pending-sync message.
114
+
115
+ Ordinary `plugins update` may take the already-checked source fast path on the
116
+ next invocation; it is not an automatic retry mechanism for the failed native
117
+ operation. Retry through `adg plugins sync` with the same scope and the intended
118
+ runtime target, for example
119
+ `adg plugins sync --global --target codex <plugin-name>` for one plugin in the
120
+ global Codex store. This is an explicit recovery contract, not a persistent work
121
+ queue. Neither a source checkpoint nor successful command dispatch proves that
122
+ an existing session has loaded the new plugin.
123
+
124
+ ## Delivery record
125
+
126
+ - Architecture decision: consumer-side separation approved by the user.
127
+ - Historical isolated investigation: unchanged peers can retain an older revision
128
+ and cause repeated clone-path execution. This is a decision-path reproduction,
129
+ not a network performance benchmark.
130
+ - Lead-reported focused result: 55/55 tests passed across
131
+ `test/plugins-update.test.ts` and `test/render.test.ts`; type checking passed.
132
+ - Lead-reported core result: 12/12 focused regressions passed, including missing
133
+ comparison cache, dependency metadata, imported native metadata, explicit
134
+ selection policy across future additions, and auxiliary Antigravity MCP repair.
135
+ - Independent review found and verified fixes for selection-policy persistence,
136
+ auxiliary projection integrity, and staging-path leakage in translated hooks.
137
+ The hook regression verifies the final installed runner path and an unchanged
138
+ update that does not request runtime refresh.
139
+ - Lead-reported type checking, build, documentation links, CLI test isolation,
140
+ and diff checks passed.
141
+ - Complete repository suite: `npm test` passed 661/661, zero failures and skips.
142
+ Type checking and build passed on the final implementation. The suite ran
143
+ with permission for the OTLP test to open its localhost listener.
144
+ - Live native runtime validation: not run as part of project-document authoring.
145
+ - Tracking issue: [ADG #161](https://github.com/RbBtSn0w/adg/issues/161).
146
+ - apple-skills PR closure request: blocked by its already-merged and released
147
+ state, confirmed by the lead. No producer revert is included in this delivery.
148
+ - ADG implementation stays local until a separate commit/push/PR instruction.
149
+
150
+ The tracking issue should remain open until its required implementation evidence
151
+ is recorded. Deferred native optimizations must be identified explicitly; a
152
+ conservative, tested refresh path can ship without claiming those optimizations.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbbtsn0w/adg",
3
- "version": "0.10.1-dev.pr152.b8c43a6",
3
+ "version": "0.10.1-dev.pr163.c74012b",
4
4
  "description": "Agent Directory Group (ADG) toolkit — two domains: plugins and skills.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -69,7 +69,7 @@
69
69
  "@semantic-release/npm": "^13.1.5",
70
70
  "@semantic-release/release-notes-generator": "^14.1.1",
71
71
  "@types/node": "^26.6.5",
72
- "conventional-changelog-conventionalcommits": "^10.4.1",
72
+ "conventional-changelog-conventionalcommits": "^9.3.1",
73
73
  "semantic-release": "^25.0.5",
74
74
  "typescript": "^7.0.2"
75
75
  },