Back to Plate

stable registry changelog ids

docs/plans/2026-06-14-stable-registry-changelog-ids.md

53.2.017.5 KB
Original Source

stable registry changelog ids

Objective: Stabilize registry changelog generated IDs so adding a changelog row does not rewrite existing event entry IDs.

Goal plan: docs/plans/2026-06-14-stable-registry-changelog-ids.md

Template: docs/plans/templates/task.md

Primary template: docs/plans/templates/task.md

Applied packs:

  • package-api (docs/plans/templates/packs/package-api.md)

Task source:

  • type: user follow-up on PR #5013
  • id / link: https://github.com/udecode/plate/pull/5013
  • title: Long-term fix for generated registry changelog row churn
  • acceptance criteria: generated entry IDs no longer depend on row numbers, adding a row above existing content leaves existing entry IDs stable, artifacts regenerate coherently, PR #5013 is updated.

Completion threshold:

  • tooling/scripts/generate-ui-changelog-entries.mjs derives source entry IDs from row content rather than row ordinal.
  • A focused generator test proves inserting a new row above an existing row does not change the existing row's ID.
  • Generated registry changelog JSON is refreshed once under the new stable scheme.
  • Focused tests, pnpm check, autoreview, commit, push, and PR body update pass.
  • Task closure is legal only when the source-of-truth acceptance criteria are satisfied or explicitly narrowed, required verification evidence is recorded, code-review and release-artifact gates are closed when applicable, tracker/PR sync is complete or marked N/A with reason, and node .agents/skills/autogoal/scripts/check-complete.mjs docs/plans/2026-06-14-stable-registry-changelog-ids.md passes.

Verification surface:

  • node --test tooling/scripts/generate-ui-changelog-entries.test.mjs
  • node tooling/scripts/generate-ui-changelog-entries.mjs --write
  • pnpm check
  • .agents/skills/autoreview/scripts/autoreview --mode local ...
  • gh pr view 5013 --json body

Constraints:

  • Preserve existing user-facing behavior outside the task scope.
  • Prefer the durable ownership boundary over caller-by-caller patches.
  • Do not create PRs, comments, commits, or pushes unless the task/user/skill requires them.
  • Do not add broad ceremony when the task is trivial or docs-only.

Boundaries:

  • Source of truth: user follow-up "go long term fix" after generated changelog churn explanation.
  • Allowed edit scope: registry changelog generator, generator tests, generated changelog JSON, goal plan, existing PR #5013.
  • Browser surface: no real browser UI; this is generated JSON/tooling behavior.
  • Tracker sync: PR body update only.
  • Non-goals: changing user-facing changelog prose beyond generated ID/artifact updates; package API/runtime changes.

Output budget strategy:

  • Use focused diffs and generator tests; cap command output; avoid dumping full generated JSON except targeted examples.

Blocked condition:

  • Blocked only if generator tests expose unavoidable ID collisions that need a product decision, or if pnpm check fails for unrelated repo state after one focused triage pass.

Task state:

  • task_type: tooling fix
  • task_complexity: medium
  • current_phase: closeout
  • current_phase_status: complete
  • next_phase: none
  • goal_status: ready_to_complete

Current verdict:

  • verdict: complete
  • confidence: high
  • next owner: maintainer review
  • reason: generator source IDs are content-derived, stale artifacts are pruned safely, checks passed, autoreview clean, and PR #5013 body is synced.

Completion rule:

  • Do not call update_goal(status: complete) while any required checklist item remains unchecked. If an item does not apply, check it and add N/A: <reason>.
  • Do not call update_goal(status: complete) until every completion threshold above is satisfied, final handoff evidence is recorded, and node .agents/skills/autogoal/scripts/check-complete.mjs docs/plans/2026-06-14-stable-registry-changelog-ids.md passes.
  • Do not create hook state for this goal. This file plus the active goal are the durable state.

Start Gates:

GateAppliesEvidence
Skill analysis before editsyesRe-read task and autogoal; previous PR workflow already loaded.
Active goal checked or createdyesget_goal returned none; created active goal for stable registry changelog IDs.
Source of truth read before editsyesLatest user message is source: "go long term fix".
Tracker comments and attachments readnoN/A: no new tracker item; existing PR #5013 is target.
Video transcript evidence requirednoN/A: no video.
docs/solutions checked for non-trivial existing-code worknoN/A: generator source and tests are local source of truth.
TDD decision before behavior change or bug fixyesAdd generator regression test for insertion-stable IDs.
Branch decision for code-changing taskyesContinue on codex/fix-shadcn-registry-kit-targets, current PR branch.
Release artifact decisionyesRegistry generated changelog artifact only; no package changeset.
Browser tool decision for browser surfacenoN/A: no browser UI behavior.
PR expectation decisionyesUser explicitly wants PR updated.
Tracker sync expectation decisionyesPR body update only; no issue comment requested.
Output budget strategy recordedyesFocused diffs/tests, capped output.
Package/API pack selectedyesRegistry generated artifact/public install metadata surface.
Public surface or package boundary identifiedyesPublic registry changelog JSON IDs/metadata, not package runtime API.
Release artifact path selectedyesRegistry changelog JSON regeneration.
changeset skill loaded when .changeset is requirednoN/A: .changeset not required.
Barrel/export impact decision recordedyesN/A: no exports/barrels.

Work Checklist:

  • Short objective plus outcome, completion threshold, verification surface, constraints, boundaries, and blocked condition are concrete.
  • Task source classified with source type, id/link, title, task type, acceptance criteria, caveats, likely files/routes/packages, browser surface, and root-cause layer.
  • Required video or screen-recording evidence marked N/A: no video.
  • Nearby repo instructions and implementation patterns read before edits.
  • Implementation fixes the ownership boundary: generator IDs and pruning live in tooling/scripts/generate-ui-changelog-entries.mjs.
  • Release artifact requirement recorded: registry changelog only; no package changeset.
  • Final handoff shape decided: update existing PR #5013.
  • Branch handling recorded: continued on codex/fix-shadcn-registry-kit-targets.
  • Local-env-rot retry policy recorded: N/A, no install-corruption failure.
  • Workspace authority recorded: every proof command ran in /Users/zbeyens/git/plate.
  • High-risk note recorded: generated registry changelog ID migration is one-time; regression test covers inserted-row stability.
  • Review/autoreview target selected from actual local diff and rerun clean.
  • Agent-native review decision recorded: N/A, no .agents, .claude, or .codex tooling changed.
  • Output budget discipline followed with capped command output and focused tests.
  • Package/API pack: public surface is registry changelog JSON and shadcn registry metadata, not package runtime API.
  • Package/API pack: release artifact matrix applied as registry changelog artifact work.
  • Package/API pack: .changeset N/A because no published package runtime, type, or API behavior changed.
  • Package/API pack: registry-only work regenerated /apps/www/src/registry/changelog/* JSON.
  • Package/API pack: no package artifact decision recorded above.
  • Package/API pack: compatibility decision explicit: one-time generated ID migration, future inserted rows stable.
  • Package/API pack: package-owned proof is root pnpm check.
  • Package/API pack: barrels N/A, no exports or exported file layout changed.

Completion Gates:

GateAppliesRequired actionEvidence
Named verification thresholdyesRun named proof commandsnode --test tooling/scripts/generate-ui-changelog-entries.test.mjs; route tests; pnpm check; autoreview clean
Bug reproduced before fixyesRecord reproInitial issue repro: shadcn smoke hit unresolved ./plugins/* imports after custom component alias install
Targeted behavior verificationyesRun focused proofGenerator insertion-stability test, stale-prune test, --write --limit guard test, changelog route tests
TypeScript or typed config changednoN/ANo TS config changed; root pnpm check typecheck passed
Package exports or file layout changednoN/ANo exported package file layout changed
Package manifests, lockfile, or install graph changednoN/ANo manifests or lockfile changed
Agent rules or skills changednoN/ANo agent rules or skills changed
Workspace authority proofyesRecord cwdAll commands ran in /Users/zbeyens/git/plate
Browser surface changednoN/ANo runnable browser UI changed in this follow-up; generated JSON/tooling surface
Browser final proofnoN/ABrowser proof N/A for generator follow-up
CI-controlled template output changednoN/ANo templates/** changed
Package behavior or public API changednoN/ANo package changeset; registry/web metadata only
Registry-only component work changedyesRegenerate changelog JSONnode tooling/scripts/generate-ui-changelog-entries.mjs --write wrote 20 events
Docs or content changednoN/ANo user-facing docs changed
High-risk mini gateyesRecord failure mode and proofRisk: stale JSON deletion or ID churn; proof: guard/prune/stability tests and autoreview clean
Agent-native review for agent/tooling changesnoN/ANo agent tooling changed
Local install corruption suspectednoN/ANo install-corruption failure
Autoreview for non-trivial implementation changesyesRun local autoreview cleanFinal quick pass clean: no accepted/actionable findings
PR create or updateyesCheck before PR body syncpnpm check passed before gh pr edit 5013
Task-style PR body verifiedyesVerify bodygh pr view 5013 --json body,url,title,state shows required issue line, confidence line, table, and sections
PR proof image hostingnoN/ANo browser proof images
Tracker sync-backyesSync PR bodyExisting PR #5013 updated; no issue comment requested
Final handoff contractyesFill belowFinal handoff fields completed
Final lintyesRun lint fixpnpm lint:fix fixed 22 generated JSON files, final pnpm check lint clean except existing warning
Output budget disciplineyesConfirm scoped outputCommand output capped; broad diffs summarized
Goal plan completeyesRun checkernode .agents/skills/autogoal/scripts/check-complete.mjs docs/plans/2026-06-14-stable-registry-changelog-ids.md to run after this edit
Public API / package boundary proofyesSource auditRegistry JSON and registry item target metadata only; no package API
Release artifact classificationyesClassifyRegistry-only generated changelog artifact
Published package changesetnoN/ANo published package runtime/API/types/config delta
Registry changelogyesRegeneratenode tooling/scripts/generate-ui-changelog-entries.mjs --write
No release artifactnoN/ARegistry changelog artifact applies
Package typecheck/build/testyesRun root gatepnpm check passed
Barrel/export generationnoN/ANo exports or barrels changed

Phase / pass table:

PhaseStatusEvidenceNext
Intake and source readcompleteuser follow-up and PR context readimplementation
Implementationcompletegenerator content-hash IDs, pruning, guard, tests, generated JSONverification
Verificationcompletefocused tests, generator write, lint fix, pnpm check, autoreview cleanPR / tracker sync
PR / tracker synccompletePR #5013 body updated and verifiedcloseout
Closeoutcompleteready for commit, push, final responsefinal response

Findings:

  • Root cause: generated source IDs included the source row ordinal, so inserting a row above old entries rewrote every downstream entry ID.
  • Accepted autoreview finding: full-output pruning plus --write --limit would make partial writes dangerous. Fixed by rejecting that argument combination.

Decisions and tradeoffs:

  • Use a short content hash over stable row fields instead of row number.
  • Keep the one-time generated ID migration because old row-number IDs cannot be made stable retroactively without a compatibility map.
  • Prune stale generated JSON from the generator so renamed event files do not leave dead artifacts in apps/www/src/registry/changelog.

Implementation notes:

  • formatSourceId now derives IDs from date, release entry, target items, summary, details, prefix, slug, and an 8-char SHA-1 content hash.
  • writeRegistryChangelogEvents can prune stale .json files in the output directory during full writes.
  • validateArgs rejects --write --limit.
  • Route tests were updated for the new generated event ID.

Review fixes:

  • Added the --write --limit guard after autoreview flagged unsafe pruning.

Error attempts:

Error / failed attemptCountNext different moveResolution
Broad final autoreview took over 6 minutes1Rerun with low thinking and no web searchFinal quick autoreview clean

Verification evidence:

  • node --test tooling/scripts/generate-ui-changelog-entries.test.mjs: 11 pass.
  • bun test 'apps/www/src/app/registry/changelog/[event]/route.test.ts' apps/www/src/app/registry/changelog/components.json/route.test.ts apps/www/src/app/registry/changelog/index.json/route.test.ts: 5 pass.
  • node tooling/scripts/generate-ui-changelog-entries.mjs --write: wrote 20 registry changelog events from 39 source rows.
  • pnpm lint:fix: final pass checked 3276 files; generated JSON formatted.
  • pnpm check: passed lint, typecheck, test:all, and test:slowest; existing unrelated sidebar eslint warning only.
  • .agents/skills/autoreview/scripts/autoreview --mode local --thinking low --no-web-search ...: clean, no accepted/actionable findings.

Final handoff contract:

  • PR line: PR #5013 updated.
  • Issue / tracker line: fixes GitHub issue #4971; no separate issue comment requested.
  • Confidence line: high, 95-100%.
  • Flow table:
    • Reproduced: shadcn smoke reproduced relative import failure before fix.
    • Verified: focused tests, generator write, pnpm check, autoreview clean.
  • Browser check: N/A for generator follow-up; original issue had shadcn smoke.
  • Outcome: stable changelog IDs and safe generated artifact pruning.
  • Caveat: one-time generated ID migration remains in the diff.
  • Design:
    • Chosen boundary: registry generator and registry source checker.
    • Why not quick patch: manual generated JSON edits would churn again.
    • Why not broader change: no package runtime/API change needed.
  • Verified: commands listed above.
  • PR body verified: gh pr view 5013 --json body,url,title,state.

Task-style PR body contract:

  • Preserve any existing <!-- auto-release:start --> block. If a changeset is part of the diff and repo policy expects auto release, include that block.
  • Use the accepted kitcn PR #270 visual format. The body starts with an emoji issue/tracker/fix line, for example ๐Ÿ› Fixes #123 or ๐Ÿ› Fixes โž– N/A, then an emoji confidence line like ๐ŸŸข 95-100% confidence.
  • Use this exact table header: | Phase | ๐Ÿงช Tests | ๐ŸŒ Browser |.
  • Use Reproduced and Verified rows. Mark passing proof with ๐ŸŸข, repro or failing proof with ๐Ÿ”ด, and non-applicable cells with โž– N/A.
  • Use bold emoji section headings: **โœ… Outcome**, **โš ๏ธ Caveat**, **๐Ÿ—๏ธ Design**, and **๐Ÿงช Verified**.
  • Never include a line that links to the current PR itself. The current PR URL belongs in the final response, not in its own description.
  • Do not replace this with a generic Summary / Verification PR body, an adaptive prose body from a git helper skill, plain ## Outcome sections, or an unrelated generated badge footer unless the caller or repo template explicitly asks for it.
  • Proof is gh pr view --json body output or a concise source-backed summary of that output.

Final handoff / sync:

  • PR: https://github.com/udecode/plate/pull/5013
  • Issue / tracker: fixes #4971 through PR body sync.
  • Browser proof: N/A for generator follow-up; shadcn smoke is command proof.
  • Caveats: one-time generated ID migration; existing unrelated sidebar warning.

Timeline:

  • 2026-06-14T17:59:00.714Z Task goal plan created.
  • 2026-06-14T18:20:00Z Generator source IDs changed from row ordinal to content-hash IDs.
  • 2026-06-14T18:35:00Z Stale generated changelog pruning and --write --limit guard added.
  • 2026-06-14T18:45:00Z Focused generator and route tests passed.
  • 2026-06-14T19:05:00Z Final pnpm check passed.
  • 2026-06-14T19:16:00Z Final autoreview quick pass clean.
  • 2026-06-14T19:20:00Z PR #5013 body updated and verified.

Reboot status:

QuestionAnswer
Where am I?Closeout
Where am I going?Commit, push, final response
What is the goal?Stable registry changelog generated IDs and updated PR #5013
What have I learned?See Findings
What have I done?See Timeline

Open risks:

  • No open blocker. Existing sidebar eslint warning is unrelated and non-fatal.