Files
agentic-dev/docs/work/ci-security-and-supply-chain/01-trace-schema-extensions/_story.md
Danijel Martinek bae4b66fa4 refactor(work): drop date prefixes + move _state.json into _system/
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.
2026-05-14 21:16:51 +02:00

3.1 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-extensions ci-security-and-supply-chain Trace schema extensions (socketRisk + lastRevalidated) technical-story done scripts
02-socket-integration
04-major-bump-reevaluation
05-trace-revalidation-workflow
2026-05-14T18:59:12+02:00 2026-05-14T19:16:52.691Z

Goal

Extend scripts/library-decisions/schema.mjs with two new fields — socketRisk (the 9th filter result) and lastRevalidated (ISO-date or null) — and update docs/library-decisions/_template.md to reflect the expanded schema.

Why

Every downstream enforcement layer (the evaluate-library skill's 9th filter, the check.mjs major-bump mode, the revalidate.mjs weekly cron) depends on these two fields being present and validated at the schema layer first. Landing them here in one green commit before any consumer touches them prevents schema-drift between layers.

External dependency: library-evaluation epic story 01 (trace schema foundation) must be complete before this story — scripts/library-decisions/schema.mjs and docs/library-decisions/_template.md must exist. That epic is marked done.

Done when

  • scripts/library-decisions/schema.mjs exports an updated Zod schema where filter-results includes socketRisk: z.union([z.literal("clean"), z.literal("flagged"), z.string()]) and the trace frontmatter includes lastRevalidated: z.string().nullable() (ISO date or null).
  • docs/library-decisions/_template.md mirrors both new fields with inline documentation of their allowed values.
  • schema.test.mjs covers: socketRisk round-trips for all three variants (clean, flagged, arbitrary string); lastRevalidated accepts ISO date strings and null; a trace missing socketRisk in filter-results fails validation; lastRevalidated: null is valid (default for fresh adoptions).
  • pnpm typecheck && pnpm lint && pnpm test && pnpm conformance && pnpm fallow:audit && pnpm coverage:diff all pass.

In scope

  • scripts/library-decisions/schema.mjs — schema additions only (no new exports, no breaking changes to existing field shapes).
  • scripts/library-decisions/schema.test.mjs — new test cases for the two new fields.
  • docs/library-decisions/_template.md — field documentation additions.

Out of scope

  • socket-cli invocation or Socket CI step — Story 02.
  • check.mjs major-bump mode — Story 04.
  • revalidate.mjs script — Story 05.
  • Backfilling existing traces with the new fields — Story 05 (the revalidation cron handles this on its first run).

Tasks

  • Extend scripts/library-decisions/schema.mjs adding socketRisk (union: "clean" | "flagged" | string) to the filter-results Zod object and lastRevalidated (nullable ISO-date string) to the trace frontmatter schema; update docs/library-decisions/_template.md to document both fields with their enum values; add test cases to schema.test.mjs covering socketRisk round-trips (all three variants), lastRevalidated ISO + null acceptance, and missing-socketRisk rejection; all gates pass on this single commit.