diff --git a/.husky/pre-commit b/.husky/pre-commit index e8d39f8..22d1998 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -6,7 +6,10 @@ # 1. lint-staged: format + lint staged files pnpm exec lint-staged || exit 1 -# 2. If any docs/work/ markdown is staged, regenerate _state.json + re-stage it +# 2. Stamp the `updated:` frontmatter field on every staged docs/work/ md file. +node scripts/work/bump-updated-timestamps.mjs || exit 1 + +# 3. If any docs/work/ markdown is staged, regenerate _state.json + re-stage it if git diff --cached --name-only | grep -qE '^docs/work/.*\.md$'; then pnpm work rebuild-state git add docs/work/_state.json diff --git a/docs/work/2026-05-13-binder-wrap-helper/01-wire-use-case-helper/_story.md b/docs/work/2026-05-13-binder-wrap-helper/01-wire-use-case-helper/_story.md index 076fecd..a791f24 100644 --- a/docs/work/2026-05-13-binder-wrap-helper/01-wire-use-case-helper/_story.md +++ b/docs/work/2026-05-13-binder-wrap-helper/01-wire-use-case-helper/_story.md @@ -7,6 +7,8 @@ status: done feature: core-shared depends-on: [] blocks: [02-migrate-feature-binders, 03-update-generator-templates] +created: 2026-05-13T19:17:10+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-13-binder-wrap-helper/02-migrate-feature-binders/_story.md b/docs/work/2026-05-13-binder-wrap-helper/02-migrate-feature-binders/_story.md index 02343b0..f30ecb0 100644 --- a/docs/work/2026-05-13-binder-wrap-helper/02-migrate-feature-binders/_story.md +++ b/docs/work/2026-05-13-binder-wrap-helper/02-migrate-feature-binders/_story.md @@ -7,6 +7,8 @@ status: done feature: auth, blog, media, marketing-pages, navigation depends-on: [01-wire-use-case-helper] blocks: [] +created: 2026-05-13T19:17:10+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-13-binder-wrap-helper/03-update-generator-templates/_story.md b/docs/work/2026-05-13-binder-wrap-helper/03-update-generator-templates/_story.md index 05df4f4..6c85c0a 100644 --- a/docs/work/2026-05-13-binder-wrap-helper/03-update-generator-templates/_story.md +++ b/docs/work/2026-05-13-binder-wrap-helper/03-update-generator-templates/_story.md @@ -7,6 +7,8 @@ status: done feature: core-shared depends-on: [01-wire-use-case-helper] blocks: [] +created: 2026-05-13T19:17:10+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-13-binder-wrap-helper/_epic.md b/docs/work/2026-05-13-binder-wrap-helper/_epic.md index f5e30c0..3911868 100644 --- a/docs/work/2026-05-13-binder-wrap-helper/_epic.md +++ b/docs/work/2026-05-13-binder-wrap-helper/_epic.md @@ -5,7 +5,8 @@ title: Collapse binder duplication via wireUseCase helper type: epic status: done features: [core-shared, auth, blog, media, marketing-pages, navigation] -created: 2026-05-13 +created: 2026-05-13T00:00:00Z +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-ci-security-and-supply-chain/01-trace-schema-extensions/_story.md b/docs/work/2026-05-14-ci-security-and-supply-chain/01-trace-schema-extensions/_story.md index 097a35e..1bf7379 100644 --- a/docs/work/2026-05-14-ci-security-and-supply-chain/01-trace-schema-extensions/_story.md +++ b/docs/work/2026-05-14-ci-security-and-supply-chain/01-trace-schema-extensions/_story.md @@ -12,6 +12,8 @@ blocks: 04-major-bump-reevaluation, 05-trace-revalidation-workflow, ] +created: 2026-05-14T18:59:12+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-ci-security-and-supply-chain/02-socket-integration/_story.md b/docs/work/2026-05-14-ci-security-and-supply-chain/02-socket-integration/_story.md index 6c6046a..782c512 100644 --- a/docs/work/2026-05-14-ci-security-and-supply-chain/02-socket-integration/_story.md +++ b/docs/work/2026-05-14-ci-security-and-supply-chain/02-socket-integration/_story.md @@ -7,6 +7,8 @@ status: done feature: tooling depends-on: [01-trace-schema-extensions] blocks: [08-reviewer-prompt-update] +created: 2026-05-14T18:59:12+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-ci-security-and-supply-chain/03-renovate-adoption/_story.md b/docs/work/2026-05-14-ci-security-and-supply-chain/03-renovate-adoption/_story.md index e8ed542..f8672dd 100644 --- a/docs/work/2026-05-14-ci-security-and-supply-chain/03-renovate-adoption/_story.md +++ b/docs/work/2026-05-14-ci-security-and-supply-chain/03-renovate-adoption/_story.md @@ -7,6 +7,8 @@ status: done feature: tooling depends-on: [] blocks: [09-ci-security-guide-and-docs] +created: 2026-05-14T18:59:12+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-ci-security-and-supply-chain/04-major-bump-reevaluation/_story.md b/docs/work/2026-05-14-ci-security-and-supply-chain/04-major-bump-reevaluation/_story.md index 4870239..1977d14 100644 --- a/docs/work/2026-05-14-ci-security-and-supply-chain/04-major-bump-reevaluation/_story.md +++ b/docs/work/2026-05-14-ci-security-and-supply-chain/04-major-bump-reevaluation/_story.md @@ -7,6 +7,8 @@ status: done feature: scripts depends-on: [01-trace-schema-extensions] blocks: [05-trace-revalidation-workflow] +created: 2026-05-14T18:59:12+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-ci-security-and-supply-chain/05-trace-revalidation-workflow/_story.md b/docs/work/2026-05-14-ci-security-and-supply-chain/05-trace-revalidation-workflow/_story.md index fdae52b..35978de 100644 --- a/docs/work/2026-05-14-ci-security-and-supply-chain/05-trace-revalidation-workflow/_story.md +++ b/docs/work/2026-05-14-ci-security-and-supply-chain/05-trace-revalidation-workflow/_story.md @@ -7,6 +7,8 @@ status: done feature: scripts depends-on: [01-trace-schema-extensions, 04-major-bump-reevaluation] blocks: [09-ci-security-guide-and-docs] +created: 2026-05-14T18:59:12+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-ci-security-and-supply-chain/06-codeql-and-audit-signatures/_story.md b/docs/work/2026-05-14-ci-security-and-supply-chain/06-codeql-and-audit-signatures/_story.md index 6ab71b5..8398f0f 100644 --- a/docs/work/2026-05-14-ci-security-and-supply-chain/06-codeql-and-audit-signatures/_story.md +++ b/docs/work/2026-05-14-ci-security-and-supply-chain/06-codeql-and-audit-signatures/_story.md @@ -7,6 +7,8 @@ status: done feature: tooling depends-on: [] blocks: [08-reviewer-prompt-update] +created: 2026-05-14T18:59:12+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-ci-security-and-supply-chain/07-gitleaks-precommit/_story.md b/docs/work/2026-05-14-ci-security-and-supply-chain/07-gitleaks-precommit/_story.md index c5a1506..9be9fe5 100644 --- a/docs/work/2026-05-14-ci-security-and-supply-chain/07-gitleaks-precommit/_story.md +++ b/docs/work/2026-05-14-ci-security-and-supply-chain/07-gitleaks-precommit/_story.md @@ -7,6 +7,8 @@ status: done feature: tooling depends-on: [] blocks: [09-ci-security-guide-and-docs] +created: 2026-05-14T18:59:12+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-ci-security-and-supply-chain/08-reviewer-prompt-update/_story.md b/docs/work/2026-05-14-ci-security-and-supply-chain/08-reviewer-prompt-update/_story.md index a6fec4f..7e06aba 100644 --- a/docs/work/2026-05-14-ci-security-and-supply-chain/08-reviewer-prompt-update/_story.md +++ b/docs/work/2026-05-14-ci-security-and-supply-chain/08-reviewer-prompt-update/_story.md @@ -7,6 +7,8 @@ status: done feature: tooling depends-on: [02-socket-integration, 06-codeql-and-audit-signatures] blocks: [09-ci-security-guide-and-docs] +created: 2026-05-14T18:59:12+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-ci-security-and-supply-chain/09-ci-security-guide-and-docs/_story.md b/docs/work/2026-05-14-ci-security-and-supply-chain/09-ci-security-guide-and-docs/_story.md index 1f44818..eb3e960 100644 --- a/docs/work/2026-05-14-ci-security-and-supply-chain/09-ci-security-guide-and-docs/_story.md +++ b/docs/work/2026-05-14-ci-security-and-supply-chain/09-ci-security-guide-and-docs/_story.md @@ -17,6 +17,8 @@ depends-on: 08-reviewer-prompt-update, ] blocks: [] +created: 2026-05-14T18:59:12+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-ci-security-and-supply-chain/_epic.md b/docs/work/2026-05-14-ci-security-and-supply-chain/_epic.md index c164364..595bfa0 100644 --- a/docs/work/2026-05-14-ci-security-and-supply-chain/_epic.md +++ b/docs/work/2026-05-14-ci-security-and-supply-chain/_epic.md @@ -5,7 +5,8 @@ title: CI security + supply-chain enforcement stack type: epic status: done features: [scripts, tooling, docs] -created: 2026-05-14 +created: 2026-05-14T00:00:00Z +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-library-evaluation-policy/01-trace-schema-foundation/_story.md b/docs/work/2026-05-14-library-evaluation-policy/01-trace-schema-foundation/_story.md index b397f18..12e5785 100644 --- a/docs/work/2026-05-14-library-evaluation-policy/01-trace-schema-foundation/_story.md +++ b/docs/work/2026-05-14-library-evaluation-policy/01-trace-schema-foundation/_story.md @@ -13,6 +13,8 @@ blocks: 07-generator-pre-shipped-traces, 08-backfill-traces, ] +created: 2026-05-14T06:52:02+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-library-evaluation-policy/02-pre-commit-check-script/_story.md b/docs/work/2026-05-14-library-evaluation-policy/02-pre-commit-check-script/_story.md index 8bece7e..26fc250 100644 --- a/docs/work/2026-05-14-library-evaluation-policy/02-pre-commit-check-script/_story.md +++ b/docs/work/2026-05-14-library-evaluation-policy/02-pre-commit-check-script/_story.md @@ -7,6 +7,8 @@ status: done feature: scripts depends-on: [01-trace-schema-foundation] blocks: [06-sandcastle-reviewer-prompt] +created: 2026-05-14T06:52:02+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-library-evaluation-policy/03-claude-hooks/_story.md b/docs/work/2026-05-14-library-evaluation-policy/03-claude-hooks/_story.md index b4d4a55..0c10dbb 100644 --- a/docs/work/2026-05-14-library-evaluation-policy/03-claude-hooks/_story.md +++ b/docs/work/2026-05-14-library-evaluation-policy/03-claude-hooks/_story.md @@ -7,6 +7,8 @@ status: done feature: tooling depends-on: [] blocks: [] +created: 2026-05-14T06:52:02+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-library-evaluation-policy/04-evaluate-library-skill/_story.md b/docs/work/2026-05-14-library-evaluation-policy/04-evaluate-library-skill/_story.md index e200e36..b9b7c18 100644 --- a/docs/work/2026-05-14-library-evaluation-policy/04-evaluate-library-skill/_story.md +++ b/docs/work/2026-05-14-library-evaluation-policy/04-evaluate-library-skill/_story.md @@ -7,6 +7,8 @@ status: done feature: tooling depends-on: [01-trace-schema-foundation] blocks: [05-human-guide] +created: 2026-05-14T06:52:02+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-library-evaluation-policy/05-human-guide/_story.md b/docs/work/2026-05-14-library-evaluation-policy/05-human-guide/_story.md index 88051aa..93f1493 100644 --- a/docs/work/2026-05-14-library-evaluation-policy/05-human-guide/_story.md +++ b/docs/work/2026-05-14-library-evaluation-policy/05-human-guide/_story.md @@ -7,6 +7,8 @@ status: done feature: docs depends-on: [04-evaluate-library-skill] blocks: [09-claude-md-update] +created: 2026-05-14T06:52:02+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-library-evaluation-policy/06-sandcastle-reviewer-prompt/_story.md b/docs/work/2026-05-14-library-evaluation-policy/06-sandcastle-reviewer-prompt/_story.md index f0dd73a..dc9c327 100644 --- a/docs/work/2026-05-14-library-evaluation-policy/06-sandcastle-reviewer-prompt/_story.md +++ b/docs/work/2026-05-14-library-evaluation-policy/06-sandcastle-reviewer-prompt/_story.md @@ -7,6 +7,8 @@ status: done feature: tooling depends-on: [02-pre-commit-check-script] blocks: [] +created: 2026-05-14T06:52:02+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-library-evaluation-policy/07-generator-pre-shipped-traces/_story.md b/docs/work/2026-05-14-library-evaluation-policy/07-generator-pre-shipped-traces/_story.md index 24846b9..59e31c6 100644 --- a/docs/work/2026-05-14-library-evaluation-policy/07-generator-pre-shipped-traces/_story.md +++ b/docs/work/2026-05-14-library-evaluation-policy/07-generator-pre-shipped-traces/_story.md @@ -7,6 +7,8 @@ status: done feature: tooling depends-on: [01-trace-schema-foundation] blocks: [] +created: 2026-05-14T06:52:02+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-library-evaluation-policy/08-backfill-traces/_story.md b/docs/work/2026-05-14-library-evaluation-policy/08-backfill-traces/_story.md index 272e39e..76241e0 100644 --- a/docs/work/2026-05-14-library-evaluation-policy/08-backfill-traces/_story.md +++ b/docs/work/2026-05-14-library-evaluation-policy/08-backfill-traces/_story.md @@ -7,6 +7,8 @@ status: done feature: docs depends-on: [01-trace-schema-foundation] blocks: [] +created: 2026-05-14T06:52:02+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-library-evaluation-policy/09-claude-md-update/_story.md b/docs/work/2026-05-14-library-evaluation-policy/09-claude-md-update/_story.md index 9649607..b022fec 100644 --- a/docs/work/2026-05-14-library-evaluation-policy/09-claude-md-update/_story.md +++ b/docs/work/2026-05-14-library-evaluation-policy/09-claude-md-update/_story.md @@ -7,6 +7,8 @@ status: done feature: docs depends-on: [05-human-guide] blocks: [] +created: 2026-05-14T06:52:02+02:00 +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/2026-05-14-library-evaluation-policy/_epic.md b/docs/work/2026-05-14-library-evaluation-policy/_epic.md index b326fa7..e640220 100644 --- a/docs/work/2026-05-14-library-evaluation-policy/_epic.md +++ b/docs/work/2026-05-14-library-evaluation-policy/_epic.md @@ -5,7 +5,8 @@ title: Library evaluation policy — skill, traces, enforcement stack type: epic status: done features: [scripts, tooling, docs] -created: 2026-05-14 +created: 2026-05-14T00:00:00Z +updated: 2026-05-14T19:10:35.370Z --- ## Goal diff --git a/docs/work/_state.json b/docs/work/_state.json index a6fc546..7c0e74f 100644 --- a/docs/work/_state.json +++ b/docs/work/_state.json @@ -1,5 +1,5 @@ { - "updated_at": "2026-05-14T19:05:08.479Z", + "updated_at": "2026-05-14T19:10:35.823Z", "epics": { "2026-05-13-binder-wrap-helper": { "status": "done", diff --git a/docs/work/prds/2026-05-13-binder-wrap-helper.prd.md b/docs/work/prds/2026-05-13-binder-wrap-helper.prd.md index d0e339b..b3eadcd 100644 --- a/docs/work/prds/2026-05-13-binder-wrap-helper.prd.md +++ b/docs/work/prds/2026-05-13-binder-wrap-helper.prd.md @@ -5,7 +5,8 @@ type: prd status: approved author: danijel elicitation-session: improve-codebase-architecture-2026-05-13 -created: 2026-05-13 +created: 2026-05-13T00:00:00Z +updated: 2026-05-14T19:10:35.370Z --- ## Problem diff --git a/docs/work/prds/2026-05-13-coverage-architecture.prd.md b/docs/work/prds/2026-05-13-coverage-architecture.prd.md index ba812bb..b20405a 100644 --- a/docs/work/prds/2026-05-13-coverage-architecture.prd.md +++ b/docs/work/prds/2026-05-13-coverage-architecture.prd.md @@ -5,7 +5,8 @@ type: prd status: shipped author: danijel elicitation-session: brainstorm-2026-05-13 -created: 2026-05-13 +created: 2026-05-13T00:00:00Z +updated: 2026-05-14T19:10:35.370Z shipped: 2026-05-13 shipping-commits: - 7eb783a (PRD) diff --git a/docs/work/prds/2026-05-14-ci-security-and-supply-chain.prd.md b/docs/work/prds/2026-05-14-ci-security-and-supply-chain.prd.md index cb95492..439c4b8 100644 --- a/docs/work/prds/2026-05-14-ci-security-and-supply-chain.prd.md +++ b/docs/work/prds/2026-05-14-ci-security-and-supply-chain.prd.md @@ -4,7 +4,8 @@ title: CI security + supply-chain enforcement stack type: prd status: approved author: danijel -created: 2026-05-14 +created: 2026-05-14T00:00:00Z +updated: 2026-05-14T19:10:35.370Z adr: adr-023 builds-on: 2026-05-14-library-evaluation-policy --- diff --git a/docs/work/prds/2026-05-14-library-evaluation-policy.prd.md b/docs/work/prds/2026-05-14-library-evaluation-policy.prd.md index 7c30d6f..07ae85e 100644 --- a/docs/work/prds/2026-05-14-library-evaluation-policy.prd.md +++ b/docs/work/prds/2026-05-14-library-evaluation-policy.prd.md @@ -4,7 +4,8 @@ title: Library evaluation policy — skill, traces, enforcement stack type: prd status: approved author: danijel -created: 2026-05-14 +created: 2026-05-14T00:00:00Z +updated: 2026-05-14T19:10:35.370Z adr: adr-022 --- diff --git a/scripts/work/bump-updated-timestamps.mjs b/scripts/work/bump-updated-timestamps.mjs new file mode 100644 index 0000000..cc7abc4 --- /dev/null +++ b/scripts/work/bump-updated-timestamps.mjs @@ -0,0 +1,78 @@ +#!/usr/bin/env node +/** + * Stamp every staged `docs/work/**\/*.md` file's frontmatter `updated:` field + * to the current ISO 8601 timestamp. Runs from `.husky/pre-commit` before + * `pnpm work rebuild-state`, so `_state.json` sees the fresh value. + * + * Idempotent: re-running produces the same result. The script silently no-ops + * on files without frontmatter or without an `updated:` line to replace — + * adds the field after `created:` if missing. + * + * Only stamps files explicitly listed in the staged diff; never walks the + * tree. That way the timestamp tracks "the last commit that actually + * modified the file," not "the last commit period." + */ +import { execSync } from "node:child_process"; +import fs from "node:fs"; +import path from "node:path"; + +const REPO_ROOT = execSync("git rev-parse --show-toplevel", { + encoding: "utf8", +}).trim(); + +function stagedWorkDocs() { + const out = execSync("git diff --cached --name-only --diff-filter=ACMR", { + cwd: REPO_ROOT, + encoding: "utf8", + }); + return out + .split("\n") + .map((p) => p.trim()) + .filter( + (p) => + p.startsWith("docs/work/") && + p.endsWith(".md") && + !p.endsWith("README.md"), + ); +} + +function stampUpdated(content, isoNow) { + const fmMatch = content.match(/^(---\n)([\s\S]+?)(\n---)/); + if (!fmMatch) return content; + const [full, openDelim, body, closeDelim] = fmMatch; + + let newBody; + if (/^updated:\s*/m.test(body)) { + newBody = body.replace(/^updated:\s*.*$/m, `updated: ${isoNow}`); + } else if (/^created:\s*/m.test(body)) { + // Insert `updated:` immediately after the `created:` line. + newBody = body.replace(/^(created:\s*.*)$/m, `$1\nupdated: ${isoNow}`); + } else { + return content; + } + return content.replace(full, `${openDelim}${newBody}${closeDelim}`); +} + +function main() { + const files = stagedWorkDocs(); + if (files.length === 0) return; + const isoNow = new Date().toISOString(); + let touched = 0; + for (const rel of files) { + const abs = path.join(REPO_ROOT, rel); + if (!fs.existsSync(abs)) continue; + const original = fs.readFileSync(abs, "utf8"); + const next = stampUpdated(original, isoNow); + if (next === original) continue; + fs.writeFileSync(abs, next); + execSync(`git add ${JSON.stringify(rel)}`, { cwd: REPO_ROOT }); + touched++; + } + if (touched > 0) { + console.log( + `bump-updated-timestamps: stamped ${touched} file(s) at ${isoNow}`, + ); + } +} + +main();