Commit Graph

51 Commits

Author SHA1 Message Date
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
4fa108dd48 docs(work): scaffold visual-regression-v1 epic + stories 2026-05-13 08:24:55 +02:00
06c9fb1823 docs(work): close sandcastle-dispatch-v1 epic 2026-05-13 08:22:08 +02:00
35664f67d5 docs(work): scaffold sandcastle-dispatch-v1 epic + stories 2026-05-13 08:16:09 +02:00
1385219b48 docs(work): close elicitation-prompts-v1 epic 2026-05-13 08:12:28 +02:00
7d08aff089 docs(work): scaffold elicitation-prompts-v1 epic + stories 2026-05-13 08:09:38 +02:00
e92610e7f1 docs(work): close dag-and-readiness-v1 epic 2026-05-13 08:06:21 +02:00
adabb3428d docs(work): scaffold dag-and-readiness-v1 epic + stories 2026-05-13 07:59:53 +02:00
ca006494c5 docs(work): close pre-commit-hooks-v1 epic 2026-05-13 07:56:33 +02:00
a2eeccfd9d docs(work): scaffold pre-commit-hooks-v1 epic + stories 2026-05-13 07:52:29 +02:00
ee315352ff docs(work): close work-system-v1 epic 2026-05-13 07:47:33 +02:00
9858d49787 feat: wire pnpm work CLI + initial _state.json snapshot 2026-05-13 07:47:03 +02:00
eac711ecec docs(work): scaffold work-system-v1 epic + story 2026-05-13 07:44:54 +02:00
c97810015d docs(work): close frontend-conformance-v1 epic
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 07:42:09 +02:00
89c72bd30a docs(work): scaffold frontend-conformance-v1 epic + story
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-13 07:39:50 +02:00
2399f950c2 docs(work): close conformance-hardening-v1 epic 2026-05-13 07:36:39 +02:00
e6d9600fbe docs(work): scaffold conformance-hardening-v1 epic + stories 2026-05-13 07:33:00 +02:00
87da671432 docs(work): close story 01 + agent-workflow-docs-v1 epic 2026-05-13 07:29:06 +02:00
5cc59e79db docs(work): scaffold agent-workflow-docs-v1 epic + story 01 2026-05-13 07:27:04 +02:00
9177d1f1db docs(work): close story 06 + conformance-system-v1 epic 2026-05-13 00:11:32 +02:00
81a075a9b9 docs(work): story 06 — feature migrations 2026-05-13 00:08:37 +02:00
5bf9a140ed docs(work): close story 05 — generator updates 2026-05-13 00:04:56 +02:00
8da21c0405 docs(work): story 05 — generator updates 2026-05-13 00:02:05 +02:00
f374d8b874 docs(work): close story 04 — CI drift gate 2026-05-12 23:58:51 +02:00
a0b2ecee2b docs(work): story 04 — CI drift gate 2026-05-12 23:56:34 +02:00
a07e62befd docs(work): close story 03.b — AST-aware ESLint rules
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 23:53:13 +02:00
bfb2324dd9 docs(work): story 03.b — AST-aware ESLint rules 2026-05-12 23:48:35 +02:00
654f2b2a02 docs(work): close story 03.a — structural ESLint rules 2026-05-12 23:25:30 +02:00
ff83769b30 docs(work): story 03.a — structural ESLint rules 2026-05-12 23:16:52 +02:00
046bd0829e docs(work): close story 02 — assertFeatureConformance + boot wiring 2026-05-12 22:54:45 +02:00
198765ff06 docs(work): story 02 — assertFeatureConformance + boot wiring 2026-05-12 22:36:18 +02:00
0aa5f0633d docs(work): close story 01 — defineFeature + brands + auth.signIn proof 2026-05-12 21:53:17 +02:00
4976352354 docs(work): story 01 — defineFeature helper + brands 2026-05-12 21:25:28 +02:00