DD-338 Phase D.5 — marketplace refresh runbook + automation wrapper#31
Merged
Conversation
Final substantive Phase D sub-phase: a thin ESM Node wrapper around the existing `scripts/build-catalog.js` that chains snapshot → regenerate → structured diff → summary emission, plus a five-step operational runbook covering the D.2 → D.3 → D.5 → daemon refresh path. The wrapper at `scripts/dd-338-refresh-catalog.mjs` move-renames the existing `dist/catalog.json` to `dist/catalog.json.prev`, runs `build-catalog.js` as a child process (stdio inherited), then computes a diff across five granularity axes (scope_filtering, field_projection, deterministic_ordering, audit_surface, domain_scope) plus entry-level tier/readiness flips and presence-level tool adds/removes. Output lands at `dist/dd-338-refresh-summary.json` as structured JSON for PR-body pasting; stdout gets a brief human-readable summary. First-run behaviour: when no prior catalog exists the diff is marked `baseline:true` and every entry is reported as an addition. Subsequent runs against an unchanged source tree produce a `No catalog changes detected.` summary. The runbook at `docs/dd-338-marketplace-refresh.md` documents the five operational steps (regenerate → review → commit+push → daemon refresh → verify) and a failure-modes table. The full cross-repo publish path through `stallari-registry-infra` remains out of scope — D.5 owns the plugins-repo half only. Tests: 10 new cases covering the diff logic — baseline run, identical catalogs, single tool-axis flip, entry tier flip, entry add/remove, tool-presence add/remove, plus three formatSummary rendering cases. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Final substantive Phase D sub-phase: a thin ESM Node wrapper around the existing
scripts/build-catalog.jsplus an operational runbook covering the D.2 → D.3 → D.5 → daemon refresh chain.scripts/dd-338-refresh-catalog.mjs(200 LOC) — orchestrates snapshot → regenerate → diff → summary. Move-renamesdist/catalog.jsontodist/catalog.json.prev, runsbuild-catalog.jsas a child process with stdio inherited, then diffs across five granularity axes (scope_filtering,field_projection,deterministic_ordering,audit_surface,domain_scope) plus entry-leveltier/readinessand presence-level tool add/remove. Output todist/dd-338-refresh-summary.json(gitignored) + brief stdout summary.docs/dd-338-marketplace-refresh.md— five-step runbook (regenerate → review → commit+push → daemon refresh → verify) with structured-summary shape example + failure-modes table.scripts/dd-338-refresh-catalog.test.js— 10 new test cases covering baseline run, identical catalogs, single tool-axis flip, entry tier flip, entry add/remove, tool-presence add/remove, plus threeformatSummaryrendering cases.Behaviour
dist/catalog.jsonpresent): summary marksbaseline:true, every entry counted as an addition.No catalog changes detected.— verified end-to-end against current main (6f29143): 59 plugins + 11 packs = 70 entries indexed on baseline, empty-diff on re-run.dist/catalog.json.prev, exit code propagates frombuild-catalog.js.Test plan
node --check scripts/dd-338-refresh-catalog.mjs— syntax cleannode --test scripts/dd-338-refresh-catalog.test.js— 10/10 passbuild-forge-context.jsregenerates the ignoredscripts/generated/artefact (pre-existing dependency, not introduced here)--applyoutput to confirm the diff matches the proposals (deferred to first live D.3 cycle)Scope-out
stallari-registry-infradeploy pipelinestallari-cli registry refreshdocumented in runbook §4tier_issuance.py --applyCloses [[DD-338]] Phase D.5. Final substantive Phase D sub-phase before the ≤10% refuse-envelope gate verification (D.4's territory).
🤖 Generated with Claude Code