@rbbtsn0w/adg 0.11.1 → 0.11.3

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.
package/README.md CHANGED
@@ -54,7 +54,6 @@ Install the CLI once, then run `adg` from anywhere:
54
54
 
55
55
  ```bash
56
56
  npm install -g @rbbtsn0w/adg # stable channel
57
- npm install -g @rbbtsn0w/adg@beta # pre-release channel
58
57
  brew tap RbBtSn0w/tap
59
58
  brew install adg
60
59
  # or run ad-hoc, no install:
@@ -326,6 +325,17 @@ discovery manifest/projection is cleared. `update` may refresh a disabled
326
325
  plugin's payload but never activates it. `list` groups enabled and disabled
327
326
  entries, and `status` distinguishes intentional disablement from runtime drift.
328
327
 
328
+ `update` also preserves installed plugins that disappear upstream, including
329
+ their last verified payload, enabled/disabled state, and component selections.
330
+ It reports them as missing upstream and exits nonzero until they return or you
331
+ explicitly migrate/remove them. `update --all` installs newly available plugins
332
+ without uninstalling existing ones. For an upstream rename or marketplace
333
+ restructure, use `adg plugins add <source>` to select replacements (or `--all`
334
+ to select everything), keeping the same scope and source ref. Use
335
+ `adg plugins remove <name>` for an explicit uninstall. If an older ADG version
336
+ already removed every plugin from a source, re-add the source; `update` discovers
337
+ sources from installed lock entries and cannot recover an empty source group.
338
+
329
339
  For the local-directory-source flow into Claude's registry/cache, see
330
340
  [docs/local-plugin-registration.md](docs/local-plugin-registration.md).
331
341
 
@@ -502,8 +512,7 @@ it's sanitized.
502
512
 
503
513
  ## Contributing
504
514
 
505
- All feature/fix pull requests target the **`develop`** integration branch; `main`
506
- is reserved for stable releases. See [CONTRIBUTING.md](CONTRIBUTING.md) and
515
+ All feature/fix pull requests target the **`main`** integration branch. See [CONTRIBUTING.md](CONTRIBUTING.md) and
507
516
  [docs/branching-and-release.md](docs/branching-and-release.md).
508
517
 
509
518
  ## License
@@ -24,7 +24,7 @@ import { CACHE_USAGE, MARKETPLACE_USAGE, PLUGIN_ALIASES, PLUGIN_COMMANDS, SCOPE,
24
24
  import { handleCorePluginVerb } from "./core-plugin-handlers.js";
25
25
  import { commandOutcome, mergeCommandOutcomes, agentCommandOutcome } from "../command-outcome.js";
26
26
  export function updateResultCounts(result) {
27
- const failedRemote = result.remote.filter((source) => source.failed !== undefined).length;
27
+ const failedRemote = result.remote.filter((source) => source.failed !== undefined || Boolean(source.missingUpstream?.length)).length;
28
28
  // A failed plugin remains one unit even if several stages report diagnostics.
29
29
  const runtimeFailures = new Set(result.agents.flatMap((agent) => (agent.failures ?? []).map((failure) => JSON.stringify([agent.agent, failure.plugin ?? null, failure.plugin ? null : failure.stage]))));
30
30
  return {
@@ -88,9 +88,11 @@ export const PLUGIN_COMMANDS = {
88
88
  synopsis: "adg plugins update [<source>]",
89
89
  positional: "<source> limit to one source key from `adg plugins marketplace list` (default: all)",
90
90
  blurb: "Re-fetches every remote source and refreshes the plugins installed from it,\n" +
91
- "reporting what changed, what's unchanged, what was deleted upstream, and what's\n" +
91
+ "reporting what changed, what's unchanged, what's missing upstream, and what's\n" +
92
92
  "newly available (install those too with --all). Local-source plugins are\n" +
93
- "rescanned in place. In a terminal, it asks whether to update project, global,\n" +
93
+ "rescanned in place. Missing upstream plugins are retained; migrate or remove\n" +
94
+ "them explicitly. Updates never uninstall plugins, including with --all.\n" +
95
+ "In a terminal, it asks whether to update project, global,\n" +
94
96
  "or both; pass a scope flag to skip the prompt.\n\n" +
95
97
  "This is the plugins-domain twin of `adg skills update`.",
96
98
  flags: ["all", "repair", ...SCOPE],
@@ -98,7 +98,9 @@ export function sameRemoteSource(entry, parsed, ref) {
98
98
  * runtime exports behind.
99
99
  */
100
100
  export function reconcileRemotePlugins(opts, parsed, ref, desired) {
101
- if (parsed.kind === "local")
101
+ // Updating a source is not a new desired-set selection. Upstream renames or
102
+ // removals must not uninstall the last usable payload or erase its origin.
103
+ if (opts.preserveExisting || parsed.kind === "local")
102
104
  return [];
103
105
  // A sparse checkout does not prove the full source shape, so it must not
104
106
  // prune sibling plugins from the same repo that were intentionally excluded.
@@ -133,6 +133,12 @@ export async function addPlugins(opts) {
133
133
  }
134
134
  }
135
135
  if (candidates.size === 0) {
136
+ // Ordinary plugin updates cannot authorize a new structural identity
137
+ // after all explicit manifests disappear. Existing DSL profiles replay
138
+ // separately with their persisted identity and authorization.
139
+ if (opts.preserveExisting && !opts.structuralIdentity) {
140
+ return { order: [], installed: [], removed: [], converted, available: [] };
141
+ }
136
142
  const synthesized = await synthesizeDefaultDslPlugin(opts, parsed, workRoot, resolvedRevision);
137
143
  candidates = synthesized.candidates;
138
144
  converted = synthesized.converted;
@@ -149,7 +155,15 @@ export async function addPlugins(opts) {
149
155
  }
150
156
  };
151
157
  }
152
- const selected = structuralName ? [structuralName] : await selectPluginNames(opts, candidates, converted);
158
+ const installedAtAnotherRef = (name) => {
159
+ const origin = existingLock.plugins[name]?.origin;
160
+ return parsed.kind === "github" && origin?.type === "github"
161
+ && origin.repo === parsed.source && origin.ref !== sourceRef;
162
+ };
163
+ const chosen = structuralName ? [structuralName] : await selectPluginNames(opts, candidates, converted);
164
+ // --all permits additions, but an existing sibling still belongs to its
165
+ // own ref. Explicit add remains the operation that can change that pin.
166
+ const selected = opts.preserveExisting ? chosen.filter((name) => !installedAtAnotherRef(name)) : chosen;
153
167
  // Resolve adapter targets after the plugin choice (lets a CLI agent picker
154
168
  // run once we know what's being installed). undefined → installPlugin's all.
155
169
  const targets = opts.targets ?? (opts.selectTargets ? await opts.selectTargets() : undefined);
@@ -184,6 +198,12 @@ export async function addPlugins(opts) {
184
198
  }
185
199
  }
186
200
  }
201
+ if (opts.preserveExisting) {
202
+ const conflicts = order.filter(installedAtAnotherRef);
203
+ if (conflicts.length > 0) {
204
+ throw new Error(`dependency plugin(s) installed at a different source ref: ${conflicts.join(", ")}; re-add or migrate explicitly`);
205
+ }
206
+ }
187
207
  // A generated Default DSL replay retains its definition profile. Only an
188
208
  // explicit manifest discovered from the source may replace that profile.
189
209
  const definitionSwitches = definition
@@ -12,6 +12,7 @@ import { addPlugins } from "./install.js";
12
12
  import { removePlugin } from "./remove.js";
13
13
  import { syncPlugins } from "./sync.js";
14
14
  import { updateLock } from "./update.js";
15
+ import { recordTelemetryEvent } from "../telemetry.js";
15
16
  /**
16
17
  * A stable key identifying the source a plugin came from. GitHub/git plugins
17
18
  * group by repo/url (the marketplace root, ignoring per-plugin sub-paths);
@@ -108,7 +109,7 @@ export function mergeAgentResults(groups) {
108
109
  /**
109
110
  * The plugins-domain equivalent of `adg skills update`: re-fetch every remote
110
111
  * source (or one named `source`), report which installed plugins changed,
111
- * stayed the same, were deleted upstream, or are newly available, and refresh
112
+ * stayed the same, are missing upstream, or are newly available, and refresh
112
113
  * local-source plugins in place. Failures are recorded per-source rather than
113
114
  * aborting the whole pass, so one unreachable repo doesn't hide the rest.
114
115
  */
@@ -116,12 +117,27 @@ export async function updatePlugins(opts) {
116
117
  const allGroups = marketplaceList({ pluginsDir: opts.pluginsDir });
117
118
  // A named source narrows to just that group (and must be remote); otherwise we
118
119
  // refresh every remote source and rescan the local bucket.
119
- const remoteGroups = opts.source
120
+ const selectedGroups = opts.source
120
121
  ? [requireGroup(opts.pluginsDir, opts.source, opts.scope)]
121
122
  : allGroups.filter((g) => g.remote);
122
- if (opts.source && !remoteGroups[0].remote) {
123
+ if (opts.source && !selectedGroups[0].remote) {
123
124
  throw new Error(`source "${opts.source}" is local and cannot be re-synced; re-run \`adg plugins add\`.`);
124
125
  }
126
+ // The marketplace view aggregates a repository for list/remove/sync. Update
127
+ // must fetch each ref independently so one plugin cannot move a sibling's
128
+ // pin or make it appear absent at the wrong revision.
129
+ const initialLock = readLock(lockPath(opts.pluginsDir));
130
+ const remoteGroups = selectedGroups.flatMap((group) => {
131
+ const refs = new Map();
132
+ for (const name of group.installed) {
133
+ const origin = initialLock.plugins[name].origin;
134
+ const ref = origin.type === "local" ? undefined : origin.ref;
135
+ const member = refs.get(ref) ?? { source: group.source, ...(ref ? { ref } : {}), installed: [], remote: true };
136
+ member.installed.push(name);
137
+ refs.set(ref, member);
138
+ }
139
+ return [...refs.values()];
140
+ });
125
141
  const repairAgent = opts.agents
126
142
  ? opts.agents.find((agent) => agent.id === "codex") ?? null
127
143
  : getAgent("codex");
@@ -193,6 +209,7 @@ export async function updatePlugins(opts) {
193
209
  ref: group.ref,
194
210
  ...(opts.all && request.plugins === undefined ? { all: true } : { plugins: request.plugins }),
195
211
  missingPlugins: "skip",
212
+ preserveExisting: true,
196
213
  skipUnchanged: true,
197
214
  nonInteractive: true,
198
215
  ...(request.authorizedComponents ? { authorizedComponents: request.authorizedComponents } : {}),
@@ -223,14 +240,22 @@ export async function updatePlugins(opts) {
223
240
  rmSync(checkout, { recursive: true, force: true });
224
241
  }
225
242
  const availableSet = available;
226
- const installedNow = new Set(installed.map((r) => r.name));
243
+ const installedNow = new Set(Object.keys(readLock(lockPath(opts.pluginsDir)).plugins));
244
+ const missingUpstream = group.installed.filter((name) => !availableSet.has(name)).sort();
245
+ if (missingUpstream.length > 0) {
246
+ recordTelemetryEvent("adg.plugins.update.missing_upstream", {
247
+ "plugins.retained": missingUpstream.length,
248
+ "update.include_new": Boolean(opts.all),
249
+ }, opts.telemetrySpan);
250
+ }
227
251
  remote.push({
228
252
  source: group.source,
229
253
  ...(group.ref ? { ref: group.ref } : {}),
230
254
  updated: installed.filter((r) => r.changed).map((r) => r.name).sort(),
231
255
  unchanged: installed.filter((r) => !r.changed).map((r) => r.name).sort(),
232
- deleted: group.installed.filter((n) => !availableSet.has(n)).sort(),
233
- available: [...available].filter((n) => !installedNow.has(n) && !group.installed.includes(n)).sort(),
256
+ deleted: [],
257
+ ...(missingUpstream.length > 0 ? { missingUpstream } : {}),
258
+ available: [...available].filter((n) => !installedNow.has(n)).sort(),
234
259
  changes: installed.filter((r) => r.changes).map((r) => ({
235
260
  name: r.name, ...r.changes, runtimeRefreshRequired: r.runtimeRefreshRequired ?? r.changed,
236
261
  })).sort((a, b) => a.name.localeCompare(b.name)),
@@ -124,11 +124,17 @@ export function renderUpdateReport(result) {
124
124
  }
125
125
  else if (r.updated.length > 0)
126
126
  out.push(`${head}: ${ui.ok(`updated ${r.updated.join(", ")}`)}`);
127
+ else if (r.missingUpstream?.length)
128
+ out.push(`${head}: ${ui.warn(`update incomplete (${r.unchanged.length} unchanged)`)}`);
127
129
  else
128
130
  out.push(`${head}: ${ui.meta(`up to date (${r.unchanged.length})`)}`);
129
131
  if (r.deleted.length > 0) {
130
132
  out.push(ui.warn(` removed stale upstream entries: ${r.deleted.join(", ")}`));
131
133
  }
134
+ if (r.missingUpstream?.length) {
135
+ out.push(ui.warn(` retained installed plugins missing upstream: ${r.missingUpstream.join(", ")}`));
136
+ out.push(ui.warn(" explicit migration or removal required: use `adg plugins add` to select replacements or `adg plugins remove` to uninstall; keep the same scope and source ref."));
137
+ }
132
138
  if (r.available.length > 0) {
133
139
  out.push(ui.meta(` ${r.available.length} more available (use --all): ${r.available.join(", ")}`));
134
140
  }
@@ -1,76 +1,257 @@
1
1
  # Branching and release
2
2
 
3
- ADG uses `develop` as the integration branch and `main` as the stable release
4
- branch. Feature and fix pull requests always target `develop`; the only pull
5
- request allowed to target `main` is the release promotion from `develop`.
3
+ `main` is the only integration trunk. Use reviewed, short-lived squash PRs to
4
+ `main`, with strict Conventional Commit title/body checks and breaking declarations.
5
+ The release history guard shares the canonical parser but checks semantics rather
6
+ than PR style. Real merge metadata and the first initialization snapshot are handled
7
+ from commit ancestry; malformed ordinary commits and fake merges still fail. No
8
+ commit SHA exemptions are permitted.
6
9
 
7
- ## Contribution flow
10
+ ## Automated Friday/manual publication
8
11
 
9
- 1. Branch from the latest `develop`.
10
- 2. Open a pull request back to `develop`.
11
- 3. Pass the repository checks and review.
12
- 4. Merge through branch protection; never push directly to `develop` or `main`.
12
+ The existing `.github/workflows/release.yml` runs Friday 07:00 UTC (15:00 UTC+8),
13
+ or manually on `main` with `operation=release` (the default). No release PR or
14
+ recurring approval is required. CI and PRs never publish. Read-only analysis and
15
+ verification run independently of `RELEASE_ENABLED`; every publication path still
16
+ requires that variable to equal `true`. This implementation does not enable it.
13
17
 
14
- Merges to `develop` are published by semantic-release under the `beta` npm
15
- dist-tag (prereleases as `x.y.z-beta.N`).
18
+ Locked tooling installs without lifecycle scripts. `release-analysis.mjs` runs the
19
+ real semantic-release engine in a credential-scrubbed local mirror, with only
20
+ semantic/history and notes plugins. No npm/GitHub service plugin runs there.
21
+ A no-release result skips product builds and packaging. A release candidate runs
22
+ product checks, builds once, packs once without lifecycle scripts, and validates
23
+ the installed archive with publint and the package smoke test. Artifacts carry
24
+ the exact candidate SHA and checksum by immutable same-run artifact ID.
16
25
 
17
- ## Automated Weekly Stable Release
26
+ Publication restores those bytes, checks live main immediately before the engine,
27
+ and checks it again in the last prepare hook before tag creation. An unreadable,
28
+ empty or changed ref fails closed. The payload hook may change only the package
29
+ manifest version, then archives existing files directly. Before any package mutation,
30
+ the hook must read the verified analysis once and match its exact candidate SHA,
31
+ version, tag and complete notes to the current engine decision. Missing analysis
32
+ or changed notes, including a UTC-date rollover, requires fresh analysis and
33
+ verification before publication. npmjs and GitHub Packages receive identical
34
+ final bytes, with SHA512 integrity reconciliation and per-target receipts. GitHub
35
+ attaches the archive and metadata. No version/changelog commit is written to main.
18
36
 
19
- Every Friday at 15:00 Beijing time (UTC+8 / 07:00 UTC), a scheduled automation workflow
20
- (`.github/workflows/scheduled-release-pr.yml`):
37
+ Before normal publication of a missing version, each registry receives a read-only
38
+ channel check. An already newer `latest` stops that write; read errors and malformed
39
+ channel data fail closed. Older, equal or missing `latest` retains the ordinary
40
+ automatic publication path. Matching existing versions receive read-only checks.
41
+ The original engine version and sealed bytes remain fixed.
21
42
 
22
- 1. Checks if `develop` has new commits ahead of `main`.
23
- 2. Automatically opens a `develop -> main` release promotion PR.
24
- 3. Enables native GitHub `auto-merge`.
25
- 4. Once all CI checks (test matrix, audits, smoke tests) pass and there are no conflicts or blockers, GitHub automatically merges the PR into `main`.
26
- 5. Merging to `main` triggers `semantic-release` to cut a stable release (`latest` dist-tag).
43
+ This guarantee assumes one authorized normal writer per package. All authorized
44
+ new issuance uses the scheduled/manual `Release` workflow and its `release-main`
45
+ concurrency group. External owner writes are outside that lock and can occur between
46
+ the channel check and publication. The check is not a compare-and-swap and does
47
+ not provide global atomicity against arbitrary external publishers. Friday normal
48
+ publication remains automatic; no coordinator or recurring approval is introduced.
27
49
 
28
- ## PR Dev Preview Releases
50
+ ADG also updates the Homebrew tap with its existing release App and formula updater.
51
+ The updater compares the npm archive digest to the original final archive, rejects
52
+ a newer tap version and rejects conflicting bytes at the same version.
29
53
 
30
- Each pull request targeting `develop` triggers automated dev preview packaging:
54
+ ## Recovery of partial publication
31
55
 
32
- - Published under the `next` dist-tag on npm and GitHub Packages.
33
- - Formatted as `<BASE>-dev.pr<PR_NUM>.<SHORT_SHA>`.
34
- - The CI bot posts verification instructions directly on the PR with `npx`, `adg update --tag <version>`, or `adg update --dev`.
56
+ Dispatch the same workflow on current `main` with `operation=recover`, the original
57
+ `source_run_id`, and original sealed `release-receipts-*` artifact's `artifact_id`.
58
+ Both IDs are required in recovery mode. This uses current trusted recovery code;
59
+ it does not run semantic-release, rebuild, retag, overwrite assets, or select a new
60
+ version. Main may have advanced. Always reference the original release artifact,
61
+ even when retrying recovery; a recovery artifact is not a new publication source.
35
62
 
36
- ## Back-merge after a stable release
63
+ Recovery validates GitHub repository/workflow/run/event/main association, immutable
64
+ artifact ID/run/candidate, expiry and ZIP digest, sealed repository/run/candidate,
65
+ package version/name, tag, SHA256 and registry integrity. It peels the existing tag
66
+ and requires the original candidate. Missing or unverifiable evidence fails closed.
67
+ Existing registry versions and GitHub assets must match original bytes. Only missing
68
+ targets are written; existing matching targets are observed. Authentication/network
69
+ errors remain failures, never assumed absence or success. Recovery may publish missing original bytes under its exclusive recovery tag,
70
+ then reads the stable `latest` channel. It never calls `npm dist-tag add` or
71
+ `npm dist-tag rm`. Only a verified same/newer `latest` can complete the registry
72
+ target; older, missing or unverifiable channels remain unconfirmed. Any owned
73
+ recovery tag is retained intentionally, with no recurring cleanup requirement.
74
+ Restored bytes are preserved even when channel delivery cannot be confirmed.
75
+ Participating jobs share `release-main`; external manual writers are
76
+ outside that lock. GitHub draft lookup uses paginated release listings, validates
77
+ the original notes/assets and preserves the latest release designation. Expired artifacts and
78
+ conflicting remote bytes require owner investigation; never reconstruct the payload.
37
79
 
38
- The release commit created on `main` must be merged back into `develop` so both
39
- branches share the same release ancestry. The `Sync main to develop` workflow opens
40
- a `main -> develop` pull request after successful main CI:
80
+ `release-result.json` and the Actions summary separate verification from publication
81
+ and list each target, artifacts, failure stage and recovery source. Disabled runs
82
+ still report verification. A successful analysis with no version reports no-release;
83
+ partial publication remains partial until all required targets have receipts.
41
84
 
42
- - A conflict-free pull request is merged automatically with a merge commit.
43
- - A conflicting pull request receives `manual-sync-needed` and must be resolved
44
- by a maintainer before further promotion work.
45
- - Resolve version and changelog conflicts in favor of the stable `main` release
46
- commit while preserving subsequent integration changes from `develop`.
47
- - If `develop` was missing or deleted on `origin` (e.g. removed by repository-level
48
- `delete_branch_on_merge` after promotion), the workflow automatically recreates
49
- `develop` directly from the newly promoted `main` commit, self-healing the release
50
- train without human intervention.
85
+ ## Daily SOP
51
86
 
52
- Under normal operations, the workflow never pushes directly to a protected branch;
53
- all updates land via the auto-merged pull request. The sole exception is the emergency
54
- self-healing path above, which directly recreates `refs/heads/develop` via the GitHub API
55
- only when the branch is completely absent from `origin`. An open `manual-sync-needed`
56
- pull request is an operational action item, not a successful sync.
87
+ 1. Develop on a short-lived branch; retain the breaking footer in the squash body.
88
+ 2. Check normal CI/PR evidence and merge through the normal reviewed PR process.
89
+ 3. Friday publication is automatic after one-time activation; use manual
90
+ `operation=release` for an intentional off-cycle run on main.
91
+ 4. Inspect the Actions summary and `release-result.json`. No-release is normal.
92
+ 5. For partial failure, retain the original run/artifact IDs and dispatch recovery.
93
+ Investigate unknown authorization or digest failures without changing identity.
57
94
 
58
- ## Local release checks
95
+ ## One-time external setup and remaining unknowns
59
96
 
60
- Run the same checks used by CI before opening a pull request:
97
+ Source checks do not prove runtime activation. Before enabling publication once,
98
+ verify the npm trusted publisher binds this repository and exactly `release.yml`,
99
+ the supported Node/npm OIDC setup, GitHub package/tag/release permissions, current
100
+ release baseline/history, PR squash metadata preservation and required checks.
101
+ The selected safe recovery policy performs no `npm dist-tag add` or `npm dist-tag rm`,
102
+ so **Allow npm dist-tag** is not an activation prerequisite for this workflow.
103
+ That optional permission is independent of direct publishing and disabled by
104
+ default; existing package settings are not changed. See
105
+ [npm trusted-publishing dist-tag permissions](https://docs.npmjs.com/trusted-publishers/#managing-dist-tags-with-trusted-publishing).
106
+ Normal scheduled publication still publishes a verified new version through the
107
+ existing trusted-publishing identity. Recovery only observes channel delivery and
108
+ cannot promise to repair an older or missing `latest`.
109
+ Verify the existing release App's private key, installation and write access to
110
+ `RbBtSn0w/homebrew-tap`; no fallback credential is introduced.
111
+ Disable old controllers/timers at the authorized cutover; remote develop remains
112
+ inactive and is not deleted here. GitHub Free is supported with ordinary jobs,
113
+ concurrency and the existing token/OIDC identities; no protected environment or
114
+ paid deployment feature is required. These are one-time configuration checks,
115
+ not a weekly approval process.
116
+
117
+ ## Local verification
61
118
 
62
119
  ```bash
63
- npm ci
64
- npm run check:vendor-deps
65
- npm run check:vendor-upstream
66
- npm run audit:prod
67
- npm run check:docs
68
- npm run typecheck
69
- npm run build
70
- npm test
71
- npm run check:package-smoke
120
+ npm ci --no-audit --no-fund --ignore-scripts
121
+ node --test test/release-*.test.mjs
122
+ node .github/release-train/cli.mjs analyze --profile npm
123
+ # Run the repository's product verification suite and archive smoke check.
124
+ actionlint .github/workflows/release.yml
72
125
  ```
73
126
 
74
- Release automation is defined in `.github/workflows/ci.yml` and
75
- `.releaserc.json`. Optional Homebrew publication only runs for stable releases
76
- when the release-bot GitHub App is configured.
127
+ ## Historical local readiness evidence (2026-11-07)
128
+
129
+ The local real-engine analysis selected `0.11.2` from baseline `0.11.1` at
130
+ candidate `27948a62f969be1d893292c72146df499a72b5da`. Typecheck/build, all 677
131
+ product tests, 15 release behavior/contract tests, doc/test-isolation/vendor checks,
132
+ archive publint and installed-package smoke checks passed. Production audit found
133
+ zero vulnerabilities. This is local evidence, not publication activation.
134
+
135
+ Workflow validation (`actionlint`) and whitespace checks passed. Product/release
136
+ tests used installed Node.js 25.8.2; installed-package smoke and available production
137
+ audits used Node.js 22.22.2. The workflow keeps Node.js 24 for release tooling.
138
+ No remote publication, tag creation, workflow dispatch or configuration activation
139
+ was performed. npm/package configuration and lockfiles are unchanged.
140
+
141
+ ## Historical squash compatibility (2026-11-07)
142
+
143
+ Historical standard GitHub PR squash envelopes are ordinary commits: their full
144
+ Conventional Commit body must validate. Thin `release-commit-analyzer.mjs` and
145
+ `release-notes-generator.mjs` adapters use the same message projection and forward
146
+ all existing options to the official plugins. True multi-parent merges retain
147
+ original messages and complete breaking notes. Empty/malformed/nested bodies and
148
+ invalid skip-marker messages still fail. No SHA exemption, baseline fabrication
149
+ or Git history rewrite is used.
150
+
151
+ ## Current Actions operation and runtime ownership (2026-11-08)
152
+
153
+ The workflow is named **Release**. Run titles distinguish scheduled/manual releases
154
+ from recovery of an original run. Read **Release outcome**, the only final Summary,
155
+ for independent analysis, verification, publication enablement and channel evidence.
156
+ An omitted, stale or incomplete receipt means **Not confirmed**. A concluded
157
+ synchronous run never becomes a pending success. The configured intended targets
158
+ must all have candidate/version/digest, timestamp and remote identity evidence.
159
+ Job success and receipt-file existence cannot confirm publication.
160
+
161
+ For a failed publication, copy the populated recovery command from the original
162
+ outcome only when recovery is available. It includes the original sealed artifact
163
+ ID, run and producer attempt, digest and expiry. Missing/expired artifacts or an
164
+ unverified original tag block this command. A later recovery retains the original
165
+ lineage, even after main advances. **Re-run failed jobs** reuses immutable successful
166
+ producer IDs; it does not switch to current main. **New release run** analyzes a
167
+ fresh main candidate. Recovery reconciles original bytes/notes without rebuilding,
168
+ retagging or moving a newer registry `latest` backward.
169
+
170
+ `.github/release-train.json` owns the npm profile and complete channel list.
171
+ `.github/release-train/` is generated shared runtime, not consumer-owned source.
172
+ The manifest records its selected source revision and SHA-256 hashes. Local
173
+ adapters in `scripts/` own package preparation, registry/GitHub readback and final
174
+ observation merging; obsolete common implementation entrypoints have been removed.
175
+ Semantic-release remains the version/notes authority. Keep the same `release.yml`
176
+ OIDC identity and the existing permissions, selected App and default-off switch.
177
+
178
+ Check generated integrity locally without an upstream checkout:
179
+
180
+ ```bash
181
+ node .github/release-train/sync.mjs check --consumer .
182
+ node --test test/release-*.test.mjs
183
+ actionlint .github/workflows/release.yml
184
+ ```
185
+
186
+ To upgrade, select an authorized upstream source checkout/revision and run its
187
+ `engineering-workflows/skills/repo-release-train/scripts/release-train/sync.mjs`
188
+ with `sync --consumer "$CONSUMER" --revision "$SOURCE_REVISION"`. Review the
189
+ manifest and consumer adapter compatibility, then run integrity, release regression,
190
+ product verification and workflow checks. Generated edits/unknown files stop sync;
191
+ resolve ownership rather than overwriting drift. Do not copy private upstream
192
+ fixtures or expand component visibility. Earlier dated readiness/audit sections are
193
+ historical evidence, not current activation or production acceptance.
194
+
195
+ An all-job rerun conservatively stops at analysis: a prior partial publication may
196
+ already have created its baseline tag. Follow the original attempt's outcome and
197
+ recovery command, or create a new manual release run to validate fresh main.
198
+ Failed-only retries that reuse a successful analyzer/verified producer retain its
199
+ artifact IDs; this guard does not re-run or replace that producer.
200
+
201
+ ## Current local verification (2026-11-08)
202
+
203
+ Using Node.js 22.22.2, the controlled generated-runtime integrity check, all
204
+ 28 release regressions and all 677 product tests passed. The new receipt
205
+ regressions were observed RED before implementation (file-existence false success,
206
+ concluded synchronous pending state and broad artifact selection), then GREEN.
207
+ First-failure recovery, original lineage, conflicting digests, required targets and
208
+ conservative all-job retry handling also pass. Repository type/build checks and applicable lint checks, installed
209
+ archive smoke, workflow actionlint and whitespace checks passed. Production audit
210
+ reported zero vulnerabilities.
211
+
212
+ These are local synthetic/installed-package checks, not an observed Actions screen
213
+ or a registry publication rehearsal. Full local-server product tests required
214
+ normal loopback access. No release dispatch, activation, tag, publication, new
215
+ credential, commit or push was performed by this implementation step. Publication
216
+ remains default-off and existing compatibility/dependency boundaries are retained.
217
+
218
+ The final observer writes JSON and Summary before returning a failing process status
219
+ for failed validation, synchronous partial publication or reporting infrastructure
220
+ failure. Producer downloads and the final outcome/upload use `always()` so failed
221
+ readback cannot hide the retained evidence. Legacy schema1 completion claims remain
222
+ unconfirmed. Recovery availability uses the shared original-run/workflow/event,
223
+ artifact-role/digest/expiry and tag validation; the still-running original report
224
+ is explicitly allowed without accepting another active run.
225
+
226
+ ## Recovery preflight review follow-up (2026-11-08)
227
+
228
+ Recovery instructions require a current read-only GitHub observation of the
229
+ original tag, notes, stable channel and every existing original asset. The sealed
230
+ producer observation retains the original notes and both expected asset SHA-256
231
+ identities. Missing Release/assets and a matching draft remain repairable;
232
+ conflicting notes/bytes/duplicate assets are conflicts, while read errors remain
233
+ unknown. Neither conflict nor unknown provides a recovery command.
234
+
235
+ Actual recovery performs the same preflight before either registry can be written,
236
+ then checks GitHub again before reconciling its assets. A later remote change can
237
+ still interrupt a distributed release; the implementation preserves the resulting
238
+ partial evidence rather than promising atomic cross-service publication.
239
+ `recovery.publication_state` records the readback classification independently
240
+ from artifact availability. The focused release suite passed 33/33, including
241
+ RED/GREEN regressions for conflict instructions and pre-registry side effects.
242
+
243
+ ## Late review: durable outcomes and channel evidence (2026-11-08)
244
+
245
+ Registry completion requires the original sealed checksum plus a legal
246
+ `latest_version` at least as new as the sealed version and an actual
247
+ `channel_observed_at` readback timestamp. Byte confirmation and channel delivery
248
+ remain separate: failed channel readback retains an unknown receipt with confirmed
249
+ byte evidence, without inventing a channel timestamp. The final observer does not
250
+ offer a command that claims recovery can change `latest`.
251
+
252
+ An early recovery failure retains the original dispatch IDs as unverified
253
+ inputs. The final observer reads and verifies the original run, artifact role,
254
+ archive digest, payload and remote effects before offering a retry command.
255
+ Malformed producer JSON becomes a `report-inputs` failure while other valid
256
+ observations, the final JSON and Summary survive. During GitHub asset reconciliation,
257
+ the final readback rechecks the same release ID, original notes and stable visibility.
@@ -105,6 +105,53 @@ review partial failure, explicit recovery, cache recovery, timestamps, and
105
105
  disabled state together. This delivery adds no durable runtime retry queue and
106
106
  no lock-schema migration.
107
107
 
108
+ ### Upstream removals and marketplace restructuring
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.
134
+
135
+ Regression coverage in `test/plugins-update.test.ts` checks full replacement,
136
+ partial disappearance, `--all`, runtime preservation, disabled/partial selections,
137
+ repeated checks, returning identities, replacement failure, explicit-to-DSL
138
+ changes, multiple DSL profiles, and explicit `add` reconciliation.
139
+
140
+ Public regression fixtures must use synthetic payloads. Private repository
141
+ content must stay outside the public repository and its Git history, including
142
+ compressed snapshots. Checks against private upstream releases belong in a
143
+ local or private test environment.
144
+
145
+ `test/plugins-update-e2e.test.ts` generates a synthetic four-to-seven-plugin
146
+ marketplace in a temporary directory and runs the real CLI against replayed
147
+ GitHub responses. It checks installation, disabled state, default/repeated
148
+ updates, additive `--all`, retained source/payload/cache state, and explicit
149
+ migration. Each synthetic plugin includes selected and unselected skills to
150
+ verify that component choices and full-source caches remain distinct. A failed
151
+ download also verifies that the previous installation and marketplace survive.
152
+ This regression uses generated data only and needs no private-repository
153
+ credentials. No upstream content or compressed source fixtures are committed.
154
+
108
155
  ### Explicit synchronization recovery
109
156
 
110
157
  A verified source checkpoint remains valid when a subsequent native refresh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbbtsn0w/adg",
3
- "version": "0.11.1",
3
+ "version": "0.11.3",
4
4
  "description": "Agent Directory Group (ADG) toolkit — two domains: plugins and skills.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -35,7 +35,8 @@
35
35
  "audit:prod": "npm audit --omit=dev",
36
36
  "typecheck": "tsc --noEmit",
37
37
  "prepare": "npm run typecheck",
38
- "prepack": "npm run typecheck && npm run build"
38
+ "prepack": "npm run typecheck && npm run build",
39
+ "test:package": "node scripts/check-package-smoke.mjs"
39
40
  },
40
41
  "files": [
41
42
  "dist",
@@ -62,33 +63,35 @@
62
63
  "yaml": "^2.9.1"
63
64
  },
64
65
  "devDependencies": {
65
- "@semantic-release/changelog": "^7.0.0",
66
66
  "@semantic-release/commit-analyzer": "^13.0.1",
67
- "@semantic-release/git": "^11.0.1",
68
67
  "@semantic-release/github": "^12.0.8",
69
68
  "@semantic-release/npm": "^13.1.5",
70
69
  "@semantic-release/release-notes-generator": "^14.1.1",
71
70
  "@types/node": "^26.6.5",
72
71
  "conventional-changelog-conventionalcommits": "^9.3.1",
73
72
  "semantic-release": "^25.0.5",
74
- "typescript": "^7.0.2"
73
+ "typescript": "^7.0.2",
74
+ "@commitlint/lint": "21.2.4",
75
+ "@commitlint/config-conventional": "21.2.4",
76
+ "import-from-esm": "2.0.0",
77
+ "publint": "0.3.25"
75
78
  },
76
- "comment:overrides": "Security floors for transitive development tooling: keep npm on a patched 11.x release, pin transitive packages to patch security advisories (handlebars, postcss-selector-parser, http-cache-semantics, brace-expansion, ip-address), and pin transitive undici/js-yaml branches to their patched versions.",
79
+ "comment:overrides": "Security floors for transitive development tooling: pin npm to 12.2.2 so its bundled undici is patched. npm 12.2.2 declares engines.node ^22.22.2 || ^24.15.0 || >=26, which is stricter than this repo's >=22.18.0. npm ci on Node 22.18 and 25 emits EBADENGINE warnings but is not engine-strict; those CI jobs stay because they pass. Other floors patch handlebars, postcss-selector-parser, http-cache-semantics, brace-expansion, ip-address, undici, and js-yaml.",
77
80
  "overrides": {
78
- "npm": "^11.21.0",
81
+ "npm": "12.2.2",
79
82
  "handlebars": "^4.7.10",
80
83
  "postcss-selector-parser": "^7.1.6",
81
84
  "http-cache-semantics": "^4.3.0",
82
85
  "brace-expansion": "^5.0.12",
83
86
  "ip-address": "^10.7.1",
84
87
  "@actions/http-client": {
85
- "undici": "^6.29.0"
88
+ "undici": "^6.29.1"
86
89
  },
87
90
  "node-gyp": {
88
- "undici": "^6.29.0"
91
+ "undici": "^6.29.1"
89
92
  },
90
93
  "@semantic-release/github": {
91
- "undici": "^7.30.0"
94
+ "undici": "^7.30.1"
92
95
  },
93
96
  "cosmiconfig": {
94
97
  "js-yaml": "^4.3.1"