Skip to content

DD-338 Phase D.5 — marketplace refresh runbook + automation wrapper#31

Merged
piersdd merged 1 commit into
mainfrom
feat/dd-338-d5-build-catalog-republish
May 24, 2026
Merged

DD-338 Phase D.5 — marketplace refresh runbook + automation wrapper#31
piersdd merged 1 commit into
mainfrom
feat/dd-338-d5-build-catalog-republish

Conversation

@piersdd
Copy link
Copy Markdown
Contributor

@piersdd piersdd commented May 24, 2026

Summary

Final substantive Phase D sub-phase: a thin ESM Node wrapper around the existing scripts/build-catalog.js plus 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-renames dist/catalog.json to dist/catalog.json.prev, runs build-catalog.js as a child process with stdio inherited, then diffs across five granularity axes (scope_filtering, field_projection, deterministic_ordering, audit_surface, domain_scope) plus entry-level tier/readiness and presence-level tool add/remove. Output to dist/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 three formatSummary rendering cases.

Behaviour

  • First run (no dist/catalog.json present): summary marks baseline:true, every entry counted as an addition.
  • Steady-state (no source changes): summary reports 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.
  • Build failure: prev snapshot is preserved at dist/catalog.json.prev, exit code propagates from build-catalog.js.

Test plan

  • node --check scripts/dd-338-refresh-catalog.mjs — syntax clean
  • node --test scripts/dd-338-refresh-catalog.test.js — 10/10 pass
  • Wrapper end-to-end on current main — baseline first-run + empty-diff second-run both observed
  • Existing test suite — 188/188 pass after build-forge-context.js regenerates the ignored scripts/generated/ artefact (pre-existing dependency, not introduced here)
  • Architect dry-run against a real D.3 --apply output to confirm the diff matches the proposals (deferred to first live D.3 cycle)

Scope-out

  • R2 / Cloudflare Worker publish — owned by stallari-registry-infra deploy pipeline
  • Daemon-side cache invalidation — stallari-cli registry refresh documented in runbook §4
  • Actually applying tier flips — that's D.3's tier_issuance.py --apply

Closes [[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

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>
@piersdd piersdd merged commit 6e8cd59 into main May 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant