Commit Graph

83 Commits

Author SHA1 Message Date
1979041197 chore(work): tick task in 06-codeql-and-audit-signatures 2026-05-14 19:54:42 +02:00
331573bc4f chore(work): finish 05-trace-revalidation-workflow 2026-05-14 19:53:07 +02:00
a7a4299213 chore(work): tick task in 05-trace-revalidation-workflow 2026-05-14 19:50:49 +02:00
88d3d4b362 chore(work): finish 04-major-bump-reevaluation 2026-05-14 19:34:44 +02:00
3d98a14e45 chore(work): finish 03-renovate-adoption 2026-05-14 19:18:20 +02:00
0e748ae714 chore(work): finish 02-socket-integration 2026-05-14 19:16:31 +02:00
49619931d5 chore(work): tick task in 02-socket-integration 2026-05-14 19:11:34 +02:00
f704cc5a01 chore(work): finish 01-trace-schema-extensions 2026-05-14 19:06:11 +02:00
c17d3f147d chore(work): decompose 2026-05-14-ci-security-and-supply-chain epic
Decomposer produced 9 stories under docs/work/2026-05-14-ci-
security-and-supply-chain/, ordered to land the schema foundation
first and the cross-referencing content (reviewer prompt, guide)
last:

01 - trace schema extensions (socketRisk + lastRevalidated)
02 - Socket integration (skill + CI)
03 - Renovate adoption
04 - major-bump re-evaluation flow
05 - trace revalidation workflow
06 - CodeQL + audit signatures
07 - gitleaks pre-commit
08 - reviewer prompt update
09 - CI security guide + docs

Also fixes a one-char status typo in the PRD frontmatter
(\`appoved\` -> \`approved\`) that landed with the decompose run.

Anchored by ADR-023 + the approved PRD at
docs/work/prds/2026-05-14-ci-security-and-supply-chain.prd.md.
Sequencing: depends on stories 01/02/04/06 of the in-flight
library-evaluation epic landing first.
2026-05-14 18:59:12 +02:00
90341ff475 docs: introduce CI security + supply-chain stack (ADR-023 + PRD)
- ADR-023 codifies the four-pillar enforcement stack: Renovate for
  bumps + Action SHA pinning via pinGitHubActionDigests, Socket.dev
  as a 9th hard filter in evaluate-library (free App + self-hosted
  socket-cli + reviewer-prompt enforcement), weekly trace
  revalidation cron with two-tier divergence action (rolling
  dashboard issue + per-dep re-evaluation issues), and the baseline
  GitHub-native gates (CodeQL, pnpm audit signatures, gitleaks
  pre-commit + native push protection). Failure-mode hierarchy is
  the single source of truth referenced by the sandcastle reviewer.
- Section 6 amends ADR-022 in place: major-bump re-evaluation
  trigger (minor/patch bumps skip), last-revalidated frontmatter
  field (preserves original date for adoption provenance), and
  Socket as the 9th hard filter. ADR-022 stays unedited; both ADRs
  read as a composed policy.
- PRD at docs/work/prds/2026-05-14-ci-security-and-supply-chain.prd.md
  seeds the implementation epic; explicit sequencing -- depends on
  the in-flight library-evaluation epic's stories 01/02/04/06
  landing first.
- Glossary gains "Trace revalidation" + "Major-bump re-evaluation"
  entries referenced by both ADRs.

Catalyst: 2026-05-14 audit confirmed zero security tooling in the
repo + GitHub Actions pinned to major-version tags (the tj-actions/
changed-files attack class). ADR-022 closes the adoption-time gate;
ADR-023 closes the post-adoption drift gate.
2026-05-14 18:47:25 +02:00
bb9983f10b chore(work): finish epic 2026-05-14-library-evaluation-policy 2026-05-14 12:14:21 +02:00
085bb2ad29 chore(work): finish 08-backfill-traces 2026-05-14 12:12:37 +02:00
b0f1db8151 chore(work): tick task in 08-backfill-traces 2026-05-14 12:03:07 +02:00
112df2cfe7 chore(work): tick task in 08-backfill-traces 2026-05-14 11:57:10 +02:00
68426b83b0 chore(work): tick task in 08-backfill-traces 2026-05-14 11:42:09 +02:00
543412ea42 chore(work): finish 07-generator-pre-shipped-traces 2026-05-14 11:37:37 +02:00
090410e9c3 chore(work): finish 06-sandcastle-reviewer-prompt 2026-05-14 07:58:55 +02:00
6890526ced chore(work): finish 05-human-guide 2026-05-14 07:53:06 +02:00
1c6e0cefaf chore(work): finish 04-evaluate-library-skill 2026-05-14 07:49:48 +02:00
2941122f66 chore(work): finish 03-claude-hooks 2026-05-14 07:36:45 +02:00
22c041fe65 chore(work): finish 02-pre-commit-check-script 2026-05-14 07:29:31 +02:00
99c7a9f1af chore(work): finish 01-trace-schema-foundation 2026-05-14 07:13:34 +02:00
16a03e026b chore(work): decompose 2026-05-14-library-evaluation-policy epic
Decomposer produced 9 stories under docs/work/2026-05-14-library-
evaluation-policy/, ordered to land the schema foundation first and
the cross-referencing content (skill, guide, backfill) last:

01 - trace schema module + docs/library-decisions/ foundation
02 - pre-commit check script
03 - Claude PreToolUse / PostToolUse hooks
04 - evaluate-library skill
05 - human guide (docs/guides/adding-a-library.md)
06 - sandcastle reviewer prompt update
07 - generator pre-shipped traces for optional cores
08 - backfill traces for existing runtime deps
09 - CLAUDE.md Key Conventions bullet

Anchored by ADR-022 + the approved PRD at
docs/work/prds/2026-05-14-library-evaluation-policy.prd.md.
2026-05-14 06:52:02 +02:00
7f1a8d0212 docs: introduce library evaluation policy (ADR-022 + PRD)
- ADR-022 codifies the tiered library-evaluation policy: 8 hard
  auto-reject filters (license, types, maintenance, boundary-fit,
  shadow-check, EU residency, CVE scan, named consumer), 3
  discussion prompts, per-decision trace artifact at
  docs/library-decisions/, and a 4-layer enforcement stack
  (Claude PreToolUse/PostToolUse hook -> evaluate-library skill ->
  pre-commit hook -> sandcastle reviewer prompt). Mirrors the
  conformance-system latency pattern from ADR-012.
- PRD at docs/work/prds/2026-05-14-library-evaluation-policy.prd.md
  seeds the implementation epic; status: approved, ready for
  \`pnpm work decompose\`.
- Glossary gains "Library trace" + "Pre-shipped trace" entries
  referenced by both artifacts.

Catalyst: the 2026-05-14 grill session nearly adopted
trpc-to-openapi + zod-to-json-schema before someone asked who the
HTTP consumer was. Honest answer: none -- all callers are TS via
createCaller. This policy makes that question structurally
unavoidable for any future feature- or core-tier dep.
2026-05-14 06:41:28 +02:00
52af9f1fdd chore(work): finish epic 2026-05-13-binder-wrap-helper 2026-05-13 20:41:18 +02:00
9800fed068 chore(work): finish 02-migrate-feature-binders 2026-05-13 20:25:08 +02:00
57e9d9805d chore(work): tick task in 02-migrate-feature-binders 2026-05-13 20:06:21 +02:00
78a561ac60 chore(work): tick task in 02-migrate-feature-binders 2026-05-13 20:01:32 +02:00
0867efbaae chore(work): tick task in 02-migrate-feature-binders 2026-05-13 19:57:28 +02:00
7406171b0b chore(work): tick task in 02-migrate-feature-binders 2026-05-13 19:53:46 +02:00
e08e0a10c0 chore(work): finish 01-wire-use-case-helper
Catches up the story's checkbox + frontmatter status to reflect that
the slice shipped in commit 1bbe866. The V1 orchestrator landed the
implementer's slice commit on main but had no state-mutation step,
so the bullet stayed unticked and `pnpm work next` would have
redundantly re-dispatched the implementer for a no-op slice.

Bookkeeping-only — no code changes.
2026-05-13 19:43:45 +02:00
317ec518aa docs(work): re-decompose binder-wrap-helper into vertical-slice stories
Re-decomposes the approved binder-wrap-helper PRD after the previous
8-story attempt (dropped in 71c04f5) sliced horizontally — its
"write test" / "write impl" splits would have left intermediate
commits red. The new shape obeys slice = task = PR = commit:

- 01-wire-use-case-helper — 1 task: ship the wireUseCase helper
  (factory composition + container bind + brand stack) with its
  unit tests and barrel export in one green commit. Blocks 02 + 03.
- 02-migrate-feature-binders — 5 tasks, one per feature
  (auth, blog, media, marketing-pages, navigation). Each task
  migrates that feature's bind-production.ts + bind-dev-seed.ts
  together and keeps all gates green.
- 03-update-generator-templates — 1 task: update the feature
  generator's bind-*.hbs so future scaffolds emit wireUseCase
  directly instead of inline withSpan + withCapture.

Output of the now-fixed sandcastle decompose dispatch — depends on
the completionSignal + maxIterations wiring (eadbb7e, 26aa97f).
2026-05-13 19:17:10 +02:00
71c04f521a docs(work): drop binder-wrap-helper epic for re-decomposition
The stories were decomposed by the previous (unconstrained)
decomposer prompt — their Tasks lists were horizontal sub-steps
(read file → write impl → write test → export → run gates) instead
of the slice = task = PR = commit rule now enforced in fd8265c.

Removing the folder clears the way for a fresh `pnpm work
decompose 2026-05-13-binder-wrap-helper --execute` run under the
updated prompt. The PRD itself (status: approved) is unchanged.
2026-05-13 18:41:37 +02:00
6f18075593 docs(work): decompose binder-wrap-helper PRD into epic + 8 stories
Output from `pnpm work decompose 2026-05-13-binder-wrap-helper
--execute` — sandcastle ran the decomposer agent with subscription
auth (after the macOS keychain workaround + Dockerfile fix from
prior commits). The agent wrote files but hit `Max iterations: 1`
before committing, so this commit carries its output unchanged.

Epic: docs/work/binder-wrap-helper/
  - _epic.md links to PRD 2026-05-13-binder-wrap-helper
  - features: [core-shared, auth, blog, media, marketing-pages,
    navigation, tooling]

Stories (8 total, with dependency edges):
  01-wire-use-case-helper           prereq (blocks 02..07)
    Goal: helper at core-shared/conformance/wire-use-case.ts +
    tests covering brand stacking, span/capture/audit composition,
    idempotent bind. depends-on: [], blocks 02..07.
  02-migrate-auth-binders           depends-on [01]
  03-migrate-blog-binders           depends-on [01]
  04-migrate-media-binders          depends-on [01]
  05-migrate-marketing-pages-       depends-on [01]
    binders
  06-migrate-navigation-binders     depends-on [01]
  07-update-feature-generator       depends-on [01]
  08-holistic-validation            depends-on [02..07], blocks: []
    Final gate suite + fallow dupes check to verify the 5 binder-
    pair clone groups have disappeared.

After 01 lands, stories 02..07 are parallelisable; 08 collects them.

Pre-commit hook regenerates _state.json + re-stages it so `pnpm
work next` immediately surfaces the new ready story.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 18:10:31 +02:00
799daa8db5 docs(prds): approve binder-wrap-helper PRD
Status: draft -> approved. Ready for `pnpm work decompose
2026-05-13-binder-wrap-helper --execute` to invoke sandcastle's
decomposer agent.
2026-05-13 17:46:54 +02:00
32002194ca docs(prds): seed binder-wrap-helper PRD (architecture candidate 1)
Materialises the output of the improve-codebase-architecture skill's
grilling loop on Candidate 1 (binder duplication), sub-shape (a)
(helper-inside-binder).

Captured decisions:
  - New wireUseCase helper at @repo/core-shared/conformance/
  - Composes the existing withSpan + withCapture (+ optional
    withAudit) wrappers; doesn't replace them
  - Per-feature binders shrink to decision content + N wireUseCase
    calls instead of N x ~12 lines of inline wrapping
  - All 5 features migrated (10 binder files, ~24 inline wrap sites)
  - Brand attachment stays in the existing wrappers
  - Generator template emits the new shape so future scaffolds
    don't regress

Sub-shape (b) (pre-wired factory exports) explicitly rejected in
favour of (a) — keeps the wrapping a binder concern, preserves
ADR-008's per-feature DI isolation.

Status: draft. Will not pass through pnpm work decompose until a
human reviewer flips status to approved. Expected to land as one
mid-sized epic with the helper + per-feature migrations as separate
stories.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 17:40:35 +02:00
32d20872e3 feat(work): pnpm work prd-ship + auto-flip integration in sandcastle
Closes the PRD-lifecycle gap surfaced by the user: when sandcastle
finishes an epic's last task, the seed PRD should auto-flip from
approved -> shipped. Builds the mechanism, wires it into the work
CLI + state index + reviewer prompt + docs.

scripts/work/prd-ship.mjs (new):
  - parseFrontmatter / serializeFrontmatter — minimal YAML-ish parser
    sufficient for PRD frontmatter (scalar + list shapes)
  - flipPrdStatus — pure function: takes PRD text, returns new text
    with status=shipped + shipped=<date> + optional shipping-commits.
    Refuses to flip draft, idempotent fail-soft on already-shipped,
    rejects unexpected statuses
  - deriveShippingCommits — best-effort git log of the linked epic
    folder for the --auto-commits flag
  - findPrdPath — id -> path lookup under docs/work/prds/
  - runCli — wiring for `pnpm work prd-ship <id> [--commits|--auto-commits]`

scripts/work/prd-ship.test.mjs (new, 17 tests):
  - Frontmatter parser handles scalars + lists + missing frontmatter
  - flipPrdStatus covers all transitions + refusals + body/key preservation
  - findPrdPath + serializeFrontmatter coverage

scripts/work/state-builder.mjs:
  - Epic entries gain a `prd` field
  - New computeNeedsPrdShip surfaces epics done with PRD status not yet
    shipped: state.needs_prd_ship[] with action commands

scripts/work/cli.mjs:
  - New subcommand `pnpm work prd-ship <id>`

.sandcastle/reviewer.prompt.md:
  - "Epic close-out: PRD status flip" section instructing reviewer to
    check _state.json.needs_prd_ship and run the suggested action
  - JSON output extends with prd_shipped: "<id>" | null

docs/work/README.md:
  - "PRD lifecycle" section documenting the 4 statuses + auto-flip

Future PRDs follow the lifecycle automatically: decomposer refuses
draft, human flips to approved, sandcastle ships the epic, reviewer
runs prd-ship on the final task, PRD lands as shipped with its
commit trail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 16:51:48 +02:00
fc27eef6eb docs(coverage): sync docs to shipped state + wire sandcastle prompts
Closes the staleness gap after the 10-commit coverage epic shipped.

Doc sync (item 1 from the user's choice):
  - CLAUDE.md Quick Start: adds pnpm coverage:aggregate / coverage:diff
    / mutate to the command listing
  - CLAUDE.md: new "Sibling architecture: coverage (ADR-020)" section
    after the conformance gate table — captures the 4-layer table +
    points at docs/guides/coverage.md + ADR-020 + says agents must run
    coverage:diff before reporting complete
  - AGENTS.md preamble: now lists coverage as a parallel multi-latency
    quality system alongside conformance, with the same gate / latency
    framing
  - PRD frontmatter: status draft -> shipped + shipped date +
    shipping-commits list (all 10 SHAs anchoring the trace)
  - PRD findings table: each row gets a Resolution column citing the
    commit that closed it; conclusion text updated to past tense
  - ADR-020 implementation phasing: rewritten as a status table with
    each step linked to the commit that shipped it + Boot-time
    assertFeatureConformance explicitly marked Deferred with rationale
  - docs/guides/coverage.md: removed "Boot wiring lands in the next
    story" line; replaced with the deferral rationale + clarified
    that two readers (vitest, coverage:diff) consume the manifest

Sandcastle prompts (item 2 from the user's choice):
  - .sandcastle/implementer.prompt.md: new "Coverage gates" section
    after the conformance-gates list, requiring `pnpm test --coverage`,
    `pnpm coverage:aggregate`, and `pnpm coverage:diff` to all pass
    before reporting `complete`. Machine-readable JSON shape of
    coverage:diff documented (status / uncovered[] / kind enum), with
    explicit instructions on how to interpret each kind. Allowlist
    expansion requires justification + test.
  - .sandcastle/reviewer.prompt.md: AC coverage relabeled to "AC
    coverage (acceptance criteria, not test coverage)" to disambiguate;
    new check #7 "Coverage gates (ADR-020)" requiring CI's
    Coverage — diff (L1) step green + per-layer thresholds met +
    no silent allowlist expansion + manifest band drift detection.

Effect: future agent runs through sandcastle now treat coverage as a
first-class blocking gate, parallel to conformance. PRs no longer
discover coverage failures only via CI; the implementer is required
to check before reporting done, and the reviewer is required to
verify.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 16:47:16 +02:00
7eb783aee1 docs(prds): seed agent-first coverage architecture PRD
Captures the brainstorm convergence (2026-05-13) into a draft PRD that
seeds the implementation epic. Decisions captured:

- 4-layer coverage architecture (L0 vitest thresholds, L1 diff coverage,
  L2 aggregate summary.json, L3 mutation testing on entities + use-cases)
- Manifest-driven coverage band as the single source of truth — vitest
  config, assertFeatureConformance boot check, and pnpm coverage:diff
  all derive expectations from feature.manifest.ts
- Cover-the-diff (every changed line exercised) not cover-the-new-code
- Aggregate trend committed as coverage/summary.json; no SaaS dep
- Stryker for mutation, on-demand only, NOT in default pnpm test

L0 verification findings (also captured in the PRD):
- auth / blog / marketing-pages: green (100% layer bands hold)
- navigation: real test gaps in entities + controllers (~86%)
- media: missing @vitest/coverage-v8 dep + vitest.config has no
  coverage block at all (entirely absent — the most extreme case of
  the duplication problem the manifest-driven keystone eliminates)

Status remains draft until the human review pass. Decomposer will
refuse to run on draft.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 13:37:21 +02:00
e203a9d58e chore(work): close out template-reset-v1 epic — all 12 tasks done
Mark epic + story status done, check all task boxes, rebuild _state.json.
All checks green: typecheck, tests (360 passing), lint, turbo boundaries.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 10:18:29 +02:00
2ceaa08944 chore(template-reset): update snapshots, fix lint, rebuild state
- Regenerate audit + realtime core-package e2e snapshots (template
  Phase-label changes altered file hashes)
- Fix pre-existing lint error in auth authentication.service.ts:
  rename unused params to _user / _sessionId, drop stale eslint-disable
  comments that were on wrong lines
- Mark story tasks 1-9 done; rebuild _state.json

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 10:17:50 +02:00
075b729266 feat: archive setup-history epics + plans + refactor-logs to .archive/ 2026-05-13 09:43:49 +02:00
c7ce0d9819 docs(work): scaffold template-reset-v1 epic 2026-05-13 09:43:09 +02:00
9ca1022f9c docs(work): close sandcastle-subscription-auth-v1 epic 2026-05-13 09:32:14 +02:00
b6948fa881 docs(work): scaffold sandcastle-subscription-auth-v1 epic 2026-05-13 09:27:02 +02:00
244313c914 docs(work): close docs-and-runbook-v1 epic 2026-05-13 09:05:54 +02:00
cf8d69106e docs(work): scaffold docs-and-runbook-v1 epic + stories 2026-05-13 09:03:15 +02:00
072e08d855 docs(work): close fallow-integration-v1 epic 2026-05-13 08:55:50 +02:00
2722305398 docs(work): scaffold fallow-integration-v1 epic + stories 2026-05-13 08:47:30 +02:00
10603bd250 docs(work): close visual-regression-v1 epic 2026-05-13 08:32:58 +02:00