Files
agentic-dev/docs/work/ci-security-and-supply-chain/04-major-bump-reevaluation/_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.7 KiB

id, epic, title, type, status, feature, depends-on, blocks, created, updated
id epic title type status feature depends-on blocks created updated
04-major-bump-reevaluation ci-security-and-supply-chain Major-bump re-evaluation flow technical-story done scripts
01-trace-schema-extensions
05-trace-revalidation-workflow
2026-05-14T18:59:12+02:00 2026-05-14T19:16:52.691Z

Goal

Extend scripts/library-decisions/check.mjs with a major-bump detection mode: when invoked on a Renovate PR, parse the lockfile diff to find bumped deps, classify each as major/minor/patch, and for any feature- or core-tier major bump require the trace's lastRevalidated field to be fresh (set today); exit non-zero with a pointer to the evaluate-library skill if not.

Why

ADR-022 closes the adoption-time gate; ADR-023 closes the drift gate for major-version changes. A Renovate PR that bumps @sentry/node from 7.x → 8.x is effectively a new adoption decision — the original trace may have evaluated a very different API surface and risk profile. Requiring a fresh lastRevalidated ensures the trace is re-walked before the bump merges. Minor and patch bumps don't trigger re-evaluation (backwards-compatible by semver contract).

External dependency: library-evaluation epic story 02 (pre-commit check script) must be complete — scripts/library-decisions/check.mjs must exist. That epic is marked done.

Done when

  • check.mjs has a new mode (invocable as node scripts/library-decisions/check.mjs --renovate-pr) that:
    • Detects Renovate PRs via renovate/ branch prefix (from GITHUB_HEAD_REF or --branch arg).
    • Parses the lockfile diff (from git diff origin/main -- pnpm-lock.yaml or a --diff arg) to extract bumped deps with from/to versions.
    • Classifies each bump as major / minor / patch using semver comparison.
    • For each feature- or core-tier major bump: reads the corresponding trace from docs/library-decisions/, checks lastRevalidated equals today's ISO date. If not fresh, exits non-zero with a message referencing the evaluate-library skill and the trace path.
    • App-tier deps: pass unconditionally (ADR-022 exemption).
    • Non-Renovate branch: pass unconditionally (the rule is scoped to Renovate PRs only).
    • Multiple bumps in one PR: validated per-dep independently (PRD Q3).
  • Integration tests in check.test.mjs (or equivalent) cover: minor bump on feature-tier dep → pass; major bump + fresh lastRevalidated → pass; major bump + stale lastRevalidated → fail with clear pointer; major bump on app-tier dep → pass; patch bump in Renovate branch → pass; non-Renovate branch with major bump → pass.
  • pnpm typecheck && pnpm lint && pnpm test && pnpm conformance && pnpm fallow:audit && pnpm coverage:diff all pass.

In scope

  • scripts/library-decisions/check.mjs — new --renovate-pr mode only; existing modes unchanged.
  • scripts/library-decisions/check.test.mjs — integration tests for the new mode (use fixture trace files + fixture lockfile diffs; no network calls).

Out of scope

  • Auto-closing library-policy/re-evaluation issues when lastRevalidated is refreshed — Story 05 (revalidation cron) handles this.
  • The CI step that invokes this check on Renovate PRs — the script is the unit; wiring it into CI workflows is part of Story 09's guide and/or the reviewer prompt in Story 08.

Tasks

  • Extend scripts/library-decisions/check.mjs with a --renovate-pr mode: detect Renovate branch prefix, parse lockfile diff for bumped deps, classify semver deltas, require fresh lastRevalidated on feature/core-tier major bumps (fail with evaluate-library pointer if stale), pass app-tier + non-Renovate + minor/patch unconditionally; write integration tests in check.test.mjs with fixture trace files and lockfile diffs covering all six cases; one commit, all gates pass.