Convention shift: epic folders + PRD filenames + frontmatter id
fields are now bare slugs. The created: timestamp (Phase 2) carries
the date; folder names don't repeat it. A future <task-id>-<slug>
shape (e.g. ClickUp) lands cleanly when that integration ships.
Renames (git mv preserves history):
- docs/work/2026-05-13-binder-wrap-helper/
-> docs/work/binder-wrap-helper/
- docs/work/2026-05-14-library-evaluation-policy/
-> docs/work/library-evaluation-policy/
- docs/work/2026-05-14-ci-security-and-supply-chain/
-> docs/work/ci-security-and-supply-chain/
- docs/work/prds/2026-05-13-binder-wrap-helper.prd.md
-> docs/work/prds/binder-wrap-helper.prd.md
- docs/work/prds/2026-05-13-coverage-architecture.prd.md
-> docs/work/prds/coverage-architecture.prd.md
- docs/work/prds/2026-05-14-library-evaluation-policy.prd.md
-> docs/work/prds/library-evaluation-policy.prd.md
- docs/work/prds/2026-05-14-ci-security-and-supply-chain.prd.md
-> docs/work/prds/ci-security-and-supply-chain.prd.md
Frontmatter updates inside the renamed files: epic id, epic prd,
story epic, PRD id, PRD builds-on all drop date prefixes.
System folder + state file move:
- New docs/work/_system/ holds framework-managed state.
- docs/work/_state.json -> docs/work/_system/_state.json.
- state-builder.mjs adds _system to SKIP_FOLDERS.
- cli.mjs + state-sync-guard.mjs + .husky/pre-commit point at the
new path.
template-reset-v1 epic deleted entirely (one-off cleanup epic from
the pre-date-convention era; status was already done).
Generator-template updates (so new artifacts ship in the right
shape):
- .sandcastle/decomposer.prompt.md emits bare-slug folder names +
ISO created: timestamp.
- .claude/skills/to-prd/SKILL.md template uses bare-slug filename +
bare-slug id field + ISO created: timestamp.
Doc reference updates: glossary, runbook, agent-first-workflow-
and-conformance, reviewer prompt, ADR-020, ADR-022, ADR-023 all
point at the new paths/slugs.
3.2 KiB
3.2 KiB
id, epic, title, type, status, feature, depends-on, blocks, created, updated
| id | epic | title | type | status | feature | depends-on | blocks | created | updated | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-trace-schema-foundation | library-evaluation-policy | Trace schema module + docs/library-decisions/ foundation | technical-story | done | scripts |
|
2026-05-14T06:52:02+02:00 | 2026-05-14T19:16:52.691Z |
Goal
Create the shared Zod-validated trace-schema module (scripts/library-decisions/schema.mjs) that every enforcement layer imports, and establish docs/library-decisions/ with a _template.md schema reference that documents the required frontmatter + heading shape for all future traces.
Why
All four enforcement layers (skill, pre-commit check, generator templates, sandcastle reviewer) need a single authoritative definition of what a valid library trace looks like. Without a shared module, each layer would re-implement the parse/validate logic independently and drift. The _template.md gives human contributors and agents a copy-pasteable starting point.
Done when
scripts/library-decisions/schema.mjsexists and exports: (1) a Zod schema validating the full trace frontmatter (all fields from ADR-022 §4 including nestedfilter-resultsobject), (2) aparseTrace(filePath)function that reads + validates a.mdfile's frontmatter, (3) avalidateTrace(raw)function for validating already-parsed objects.scripts/library-decisions/schema.test.mjscovers: valid trace round-trips without error; missing required field throws; unknown filter key rejected; invalid enum value rejected;accepted-cvesoptional field accepted.docs/library-decisions/_template.mdexists with the complete frontmatter schema (all fields, all enums documented) and all required section headings (## Filter: <name>× 8 +## Prompt: <name>× 3) in the machine-checkable order from ADR-022.docs/library-decisions/directory is committed (can be just_template.md+.gitkeepif no traces yet).pnpm typecheck && pnpm lint && pnpm test && pnpm conformance && pnpm fallow:audit && pnpm coverage:diffall pass.
In scope
scripts/library-decisions/schema.mjs— Zod schema + parse/validate exports.scripts/library-decisions/schema.test.mjs— unit tests (vitest or node:test; match the pattern used byscripts/work/tests).docs/library-decisions/_template.md— schema reference document.
Out of scope
- The pre-commit check script (
check.mjs) — Story 02. - The skill itself — Story 04.
- Actual trace files (backfill) — Story 08.
- Generator template changes — Story 07.
Tasks
- Create
scripts/library-decisions/schema.mjswith Zod frontmatter schema (all fields from ADR-022 §4:package,version,tier,decision,date,deciders,adr,filter-resultsnested object with all 8 filter keys and their enum values,verification-commands,accepted-cvesoptional), plusparseTrace(filePath)andvalidateTrace(raw)exports; writeschema.test.mjscovering valid round-trip, missing-field rejection, invalid-enum rejection, and optionalaccepted-cves; createdocs/library-decisions/_template.mdwith full frontmatter schema + all 11 required headings in ADR-022 order; all gates pass on this single commit.