Commit Graph

365 Commits

Author SHA1 Message Date
bad9543228 docs(compliance): add pre-launch compliance checklist
Two-column table covering all 22 playbook sections organised by 13
groups (Infrastructure, Data, Application, Secrets, Sub-Processors,
Logging, Breach, DSR, Backup, SDLC, Workforce, Legal, Documentation).

Every "Shipped by template" row names a runnable verification command.
Consumer and infra responsibilities are explicitly labelled. ADR-025
deferrals (GDPR Art. 22, MFA/lockout, breach-detection patterns) are
called out inline. Links outward to compliance-overview.md, all seven
policy templates, audit-and-compliance.md, operator-checklist.md, and
ADR-025.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 12:31:07 +00:00
91d1f2a6b1 chore(work): finish 03-policy-templates 2026-05-20 14:21:52 +02:00
d32464c94b docs(compliance): add skeleton policy templates (backup, password, device, onboarding, offboarding)
Five skeleton templates for docs/compliance/templates/. Each has YAML
frontmatter (status: template, playbook-section), a "not code-enforced"
banner, and [FILL IN:] markers throughout. password-policy banner cites
ADR-025 §Deferred items by number (MFA + password policy + lockout
deferral). Cross-template relative links all resolve.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 12:20:35 +00:00
7d831f1d9b chore(work): tick task in 03-policy-templates 2026-05-20 14:16:36 +02:00
e349089b02 docs(compliance): add anchored policy templates (incident-runbook, dsr-procedure)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 12:14:39 +00:00
1387b0dca0 chore(work): finish 02-refresh-operator-checklist 2026-05-20 14:08:19 +02:00
b23b1d0b89 docs(compliance): refresh operator-checklist with ADR-024 and ADR-025 actions
ADR-024: analytics backend is consumer-chosen; operator must decide
whether to wire a vendor and, if so, run /evaluate-library first
(ADR-022 gate applies). Documents IAnalytics wiring, flush() shutdown
hook, and optional React provider.

ADR-025: compliance directory setup — generate and commit compliance/
YAML files as audit evidence; verify drift gate in pre-commit + CI;
schedule retention purge job per custom.retention; hand-author
compliance/sub-processors.manual.yml for non-npm vendors.

All existing ADR-022/023 content preserved unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 12:06:42 +00:00
aa138348a7 chore(docs): track operator-checklist.md verbatim
Land the existing untracked file as a baseline commit so the
"what existed" diff is legible and distinct from story 02's refresh.
2026-05-20 11:59:59 +00:00
96a8554871 chore(work): decompose compliance-docs-scaffolds epic
Generated 1 epic + 6 stories under docs/work/epics/ from the approved
PRD docs/work/prds/compliance-docs-scaffolds.prd.md. Stories cover
landing + refreshing operator-checklist.md, the seven fill-in policy
templates, the pre-launch compliance checklist, the compliance-overview
hub, and doc wiring (CLAUDE.md, README, glossary). Final epic of
ADR-025. Ready for `pnpm work dispatch --execute`.
2026-05-20 13:58:24 +02:00
ee4af9bb96 chore(work): finish epic security-headers-rate-limit-sbom 2026-05-20 13:49:44 +02:00
3bde1fcae8 docs(core-shared): add glossary entries + update conformance refs for rate-limit and security headers
- Add IRateLimit, RateLimited, withRateLimit, SBOM, SecurityHeadersConfig,
  buildSecurityHeaders, nonce (CSP) entries to docs/glossary.md
- Bump conformance rule count 12 → 13 in CLAUDE.md; add rateLimit manifest
  field to description; add no-undeclared-rate-limit to rule list
- Add rateLimit manifest field row + no-undeclared-rate-limit (13th rule)
  to docs/guides/conformance-quickref.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 11:47:00 +00:00
6c4d0cdf6f chore(work): tick task in 11-documentation 2026-05-20 13:41:52 +02:00
1fa11fec83 docs(security): add security-headers and rate-limiting cookbooks
Adds two new consumer-facing guides:
- docs/guides/security-headers.md: per-framework middleware wiring
  (Next.js, TanStack Start, Payload CMS), nonce threading for inline
  scripts, CSP allowlist customisation, Sentry nonce integration, and
  securityheaders.com verification workflow.
- docs/guides/rate-limiting.md: manifest rateLimit field declaration,
  canonical key-naming convention (<feature>:<scope>:<key>),
  multi-budget patterns, InMemoryRateLimit / NoopRateLimit for dev/test,
  and production backend wiring via BindContext.rateLimit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 11:39:56 +00:00
b87a406c96 chore(work): finish 10-sbom-ci-workflow 2026-05-20 13:33:07 +02:00
08bc19293a ci(release): attach CycloneDX SBOM to every GitHub release
Amends release-please.yml with conditional steps that run only when
release-please cuts a release:
- checkout + pnpm install to give @cyclonedx/cyclonedx-npm the full
  resolved workspace graph
- pnpm dlx @cyclonedx/cyclonedx-npm generates a CycloneDX 1.6 JSON SBOM
  named sbom-<tag>.cdx.json; --ignore-npm-errors is required because
  npm ls exits non-zero for dev-deps-of-dev-deps pnpm correctly elides
- softprops/action-gh-release@<SHA> (v3.0.0, Renovate-managed) attaches
  the file to the GitHub release as a downloadable asset

Adds ADR-023 §9 amendment documenting the step shape, rationale for
pnpm dlx (avoids lockfile per ADR-022), --ignore-npm-errors behaviour,
SHA pinning per ADR-023 §1, and the extended failure-mode table.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 11:31:08 +00:00
224a5d78c8 chore(work): finish 09-app-wiring-web-tanstack-and-cms 2026-05-20 13:22:08 +02:00
f0968b7a3c chore(work): tick task in 09-app-wiring-web-tanstack-and-cms 2026-05-20 13:11:05 +02:00
dc718fd9c8 chore(work): finish 08-app-wiring-web-next 2026-05-20 12:14:20 +02:00
de458a6d1e chore(work): finish 07-security-header-adapters 2026-05-20 11:58:22 +02:00
6903c59cc7 chore(work): tick task in 07-security-header-adapters 2026-05-20 11:48:13 +02:00
6575a4857e chore(work): finish 06-security-headers-core-module 2026-05-20 11:35:46 +02:00
dd2af0c902 docs: seed PRD for compliance docs scaffolds epic (ADR-025 Epic D)
Implementation seed for ADR-025 Epic D, the final epic: seven fill-in
policy templates under docs/compliance/templates/ (2 anchored, 5
skeleton with not-code-enforced banner), a two-column pre-launch
compliance checklist mapping playbook obligations to template
mechanisms, a compliance-overview.md hub, and a landed + refreshed
operator-checklist.md. Pure docs — no code, no conformance changes.
Status: approved — ready for pnpm work decompose.
2026-05-20 11:34:29 +02:00
650a97b1bb chore(work): finish 05-auth-signin-rate-limit-backfill 2026-05-20 11:27:19 +02:00
91d7a24ed9 chore(work): finish 04-with-rate-limit-wrapper-and-conformance 2026-05-20 11:05:31 +02:00
24b2490d86 chore(work): finish 03-no-undeclared-rate-limit-eslint-rule 2026-05-20 10:45:02 +02:00
a478a8e6ea chore(work): finish 02-rate-limit-implementations 2026-05-20 10:38:24 +02:00
f2449c9d65 chore(work): tick task in 02-rate-limit-implementations 2026-05-20 10:32:31 +02:00
e2a5278899 chore(work): finish 01-rate-limit-type-primitives 2026-05-20 10:24:32 +02:00
a633561c82 chore(work): decompose security-headers-rate-limit-sbom epic
Generated 1 epic + 11 stories under docs/work/epics/ from the approved
PRD docs/work/prds/security-headers-rate-limit-sbom.prd.md. Stories
cover rate-limit type primitives + implementations + ESLint rule +
withRateLimit wrapper, auth.signIn rate-limit backfill, security
headers core module + framework adapters, app wiring across web-next /
web-tanstack / cms, SBOM CI workflow, and documentation. Ready for
`pnpm work dispatch --execute`.
2026-05-20 10:14:54 +02:00
352a7c64c1 chore(work): finish epic dsr-consent-and-cookie-banner 2026-05-20 00:09:29 +02:00
a3505f2e69 docs(compliance): add DSR guide, consent guide, subject-linkage example, glossary terms
- docs/guides/dsr.md: GDPR Art. 15/16/17/18/20 interface mapping, tRPC
  router wiring, multi-subject handling, soft vs cascade-hard semantics,
  DeletionCertificate format and storage requirements
- docs/guides/consent.md: requiresConsent manifest field, withConsent DI
  wiring, runtime isGranted pattern, IConsent audit trail, anonymous→
  authenticated migration, cookie _v versioning, SSR-safe banner loading,
  CNIL/EDPB equal-prominence requirement
- docs/compliance/subject-linkage.example.md: SubjectLink kind discriminator
  with worked support-ticket example (owner submitter + reference assignee)
- docs/glossary.md: SubjectLink, DeletionCertificate, UserConsentState,
  ConsentChecked entries; Manifest definition updated with requiresConsent
- CLAUDE.md: lint comment 8→12 conformance rules; conformance section notes
  requiresConsent; brand composition order updated to full 5-wrapper chain
- docs/guides/conformance-quickref.md: requiresConsent field added to
  manifest table; component-must-have-story, component-must-have-test,
  atomic-tier-import-direction added to ESLint rules table

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 22:07:50 +00:00
a1587539de chore(work): finish 10-auth-signup-migration 2026-05-19 23:56:58 +02:00
5151454783 chore(work): finish 09-cookie-consent-banner 2026-05-19 23:38:46 +02:00
051bfbf062 test(core-ui): add axe-core a11y assertions to CookieConsentBanner
Previous attempt was rejected because the axe-core a11y requirement
had no test infrastructure — ARIA roles were correct but unverified by
a scanner. This adds jest-axe (approved via library-decision trace) and
asserts toHaveNoViolations() for both modal and banner variants.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 21:36:26 +00:00
de178035bd chore(work): finish 08-core-ui-scaffold 2026-05-19 23:03:57 +02:00
bce9ded915 feat(core-ui): scaffold @repo/core-ui via generator
Runs pnpm turbo gen core-package ui to produce the package shell:
atomic-design components (Button, Input, Label, FormField), vitest
config excluding story files from coverage, and transpilePackages
wiring in web-next. Adds @vitest/coverage-v8 devDep and
label.stories.tsx to satisfy lint/coverage gates.

Also fixes scripts/library-decisions/check.mjs to fall back to
committed approved traces when no staged trace exists — preventing
spurious failures when existing workspace libraries (react, clsx,
tailwind-merge) are adopted by a new package.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 20:59:48 +00:00
81898d9902 chore(work): finish 07-core-api-router-composition 2026-05-19 22:52:11 +02:00
b2bfb5bfce chore(work): finish 06-core-dsr 2026-05-19 22:39:13 +02:00
46e575a5a6 feat(core-dsr): handlers, dsrRouter, integration tests
Add four protocol-agnostic handlers (export, delete, rectify, restrict)
returning normalized { status, body, headers } responses, and a tRPC
dsrRouter via createDsrRouter(binding) following the factory pattern.

Auth checks: requireAuthenticated middleware gates all four procedures;
cascade-hard delete additionally requires admin role. Integration tests
assert happy-path response shapes, UNAUTHORIZED/FORBIDDEN error codes,
and error passthrough from the DSR service layer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 20:34:51 +00:00
6f56a04335 chore(work): tick task in 06-core-dsr 2026-05-19 22:14:15 +02:00
6606b59d1e feat(core-dsr): Payload impls, recording doubles, DI binders, contract tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 20:05:06 +00:00
8068d1bf98 chore(work): tick task in 06-core-dsr 2026-05-19 21:35:10 +02:00
86d949294f chore(work): finish 05-core-consent-react 2026-05-19 21:21:28 +02:00
33e3c093ad chore(work): finish 04-core-consent-implementation 2026-05-19 15:27:07 +02:00
e53f35a0c5 feat(core-consent): add handlers and consentRouter tRPC router
Protocol-agnostic handlers (grant, withdraw, isGranted, getCategories)
in core-consent/handlers/ call IConsent methods and return typed results.

consentRouter uses a consent-specific tRPC context (userId + consentFactory)
so each procedure can resolve the per-user IConsent instance at call time.
Auth middleware guards all four procedures and maps UnauthenticatedError →
UNAUTHORIZED via defineErrorMiddleware from core-shared (no local duplicate).

76 tests passing; new handler and router code at 100% branch coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 13:22:33 +00:00
ae4e0f2680 chore(work): tick task in 04-core-consent-implementation 2026-05-19 15:01:40 +02:00
c346f85bc8 chore(work): tick task in 04-core-consent-implementation 2026-05-19 14:53:51 +02:00
5792b7412a chore(work): finish 03-core-consent-foundation 2026-05-19 13:54:40 +02:00
1cab88916a feat(core-eslint): add no-undeclared-consent-check rule (conformance gate 12)
Extends the conformance ESLint layer with the consent-check rule:

- `no-undeclared-consent-check` (warn): `consent.isGranted("X")` in a
  use-case file must match a category declared in `manifest.requiresConsent`;
  also warns when requiresConsent is declared but no isGranted call is found.
- `_manifest-ast.js`: adds `parseManifestFully` which extracts top-level
  `name`, `requiredCores`, `requiresConsent`, and per-use-case maps from the
  manifest AST; `requiresConsent` extraction tested in `_manifest-ast.test.js`.
- `_rule-context.js` / `_rule-schema.js`: shared helpers extracted from the
  existing per-rule files so the new rule can resolve use-case name + feature
  root without duplication.
- Existing rules (`no-undeclared-audit`, `no-undeclared-event-publish`,
  `no-undeclared-analytics-event`) updated to use the shared helpers.
- `plugin.js` + `base.js` register the rule at warn severity.
- CLAUDE.md + conformance-quickref.md: rule count advanced from 11 → 12.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 11:51:30 +00:00
ef9cfd243e docs: seed PRD for security headers + rate-limit + SBOM (ADR-025 Epic C)
Implementation seed for ADR-025 Epic C: six security headers middleware
with nonce-based CSP in core-shared/security (Next + TanStack adapters),
fourth conformance channel for rate-limit in core-shared/rate-limit
(IRateLimit + RateLimited brand + multi-budget manifest field +
no-undeclared-rate-limit ESLint rule), CycloneDX SBOM step in
release-please.yml. auth.signIn backfilled as canonical rate-limit
reference. ADR-023 amendment for SBOM captured. Status: approved —
ready for pnpm work decompose.
2026-05-19 13:09:20 +02:00