Commit Graph

20 Commits

Author SHA1 Message Date
7b238e401c docs(architecture): strip Plan-9/superpowers refs from HTML + wire orphan explainers
Closes the last two staleness threads from the docs audit:

1. data-flow-explainer.html had four "Plan-9" / "post-Plan-9"
   references in the masthead, lede, fix-up bullet, and bindDevSeed
   blurb. Stripped — the architecture is now just "vertical-feature".
   No content changes beyond the noun rename.

2. audit-and-compliance-explainer.html had a footer link to
   ../superpowers/specs/2026-05-11-audit-and-compliance-design.md
   (archived to .archive/ earlier). Replaced with a link to
   ADR-018, which is the durable design record.

3. data-flow-explainer.html + di-explainer.html were inter-linked
   with audit + conformance explainers, but had no markdown entry
   point — they were orphans from any guide or architecture doc.
   architecture/overview.md gains a new "Interactive explainers"
   section listing all four single-file HTML walkthroughs with one
   sentence each, so they're discoverable from the documented
   entry point. The four pages already cross-link to each other.

Final state (verified by repo-wide grep): zero "Plan-N" / "Phase-N"
/ "docs/superpowers/" references in docs/ (excluding .archive/ which
is gitignored). Legitimate `superpowers:brainstorming` skill refs
in agent-first-workflow-and-conformance.md are preserved — those
reference an external plugin, not a repo path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 17:02:39 +02:00
841655573b docs(adr): rename ADR-012 — drop Lazar; update title + content + cross-refs
- Rename docs/decisions/adr-012-lazar-conformance.md → adr-012-feature-conventions.md
- Strip "Lazar", "Plan 8/9/10/11", "refactor-logs" refs from all ADRs,
  architecture docs, HTML explainers, and feature/core AGENTS.md files
- Update all incoming links in docs/, packages/*/AGENTS.md, HTML explainers

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-13 10:07:37 +02:00
b76483c4f2 docs(architecture): audit-and-compliance HTML explainer + sibling crosslinks 2026-05-11 17:15:12 +02:00
a1b54ad833 docs: surface core-audit as 5th optional package across discovery points 2026-05-11 16:41:20 +02:00
e43e03cdee docs: refresh architecture references for OTel migration 2026-05-11 12:18:44 +02:00
ae456a5436 docs: ui now optional — prerequisite notes + conditional HTML
- AGENTS.md (root): marks core-ui as optional in the package table and
  boundary rules; points per-package docs to the .hbs template
- apps/storybook/AGENTS.md: rewrites around no-core-ui-by-default;
  stories glob and globals.css import described as post-scaffold steps
- apps/web-next/AGENTS.md: cross-reference updated to template file
- apps/web-tanstack/AGENTS.md: cross-reference updated to template file
- docs/architecture/data-flow-explainer.html: core-ui bullet notes
  optional status + generator command

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 14:23:24 +02:00
1967cb36ec docs: trpc now optional — prerequisite notes + conditional HTML
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 14:13:12 +02:00
3d653666c2 docs: events now optional — Status headers + conditional HTML rendering
- ADR-015: Status → Optional with scaffold command + behavior note (bus absent
  means no-op, IJobQueue unaffected)
- events-and-jobs.md: prerequisite callout block explaining core-events is
  optional, how to scaffold, and which features require it
- data-flow-explainer.html: note bus is optional in BindProductionContext blurb;
  add inline comment in code snippet that bus is scaffoldable

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 14:01:38 +02:00
39fd2a9f80 docs: realtime now optional — Status headers + conditional HTML rendering 2026-05-09 13:46:41 +02:00
723729dd9e fix: address Phase 1 code-quality review findings
- Generator feature templates emit ctx-arg signatures + updated checklist
- signUpUseCase test for bus=undefined path
- di-explainer.html: bind-dev-seed no-arg → ctx
- data-flow-explainer.html: tradeoff card → ctx
- BindContextBase no longer exported
- CLAUDE.md binder bullet: drop vestigial cast guidance

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-09 13:17:04 +02:00
990f641425 docs(html): di + data-flow explainers reflect BindContext 2026-05-09 12:51:15 +02:00
69c445de26 docs: refresh explainers + adding-a-feature with full binder signature
di-explainer and data-flow-explainer narratives still showed the
pre-ADR-014 1-arg bindProductionBlog(config) form. Updated both
explainers to (config, tracer, logger, bus, queue), and adjusted the
narrative arc so the production-swap step mentions the
resolveEventsAndJobs* preamble.

adding-a-feature's Step 16 sketch was the same 1-arg shape; replaced
with the canonical 5-arg signature and a short note that the bus/queue
params are accept-and-forward until gen event consume / gen job
generators inject usage at the anchors. Pointer to a real feature's
bind-production.ts for the complete reference.

Final sweep is clean — no stale (container, config) or 1-arg
bindProduction signatures remain in docs/.
2026-05-08 17:54:11 +02:00
281c7ac941 docs(html): align trace-tree code background with existing code-bg palette
The .trace-tree blocks I added in §06 / §08 used var(--ink-2) (#5b4a3c —
medium brown), which clashed with the page's dedicated --code-bg
(#16110d, deep dark). Switched to --code-bg + --code-paper for text,
plus the same border + inset/drop shadow as pre.code, so the new blocks
read consistently with every other code block on the page.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 00:48:15 +02:00
01707e801b docs(html): update §06 + §08 with verified layer-by-layer instrumentation usage
After the user pushed back on intent-vs-shipped state, I greped each layer
and updated both explainers to reflect actual code, not documented intent.

data-flow-explainer.html §06 — "Tracing & error capture":
- New "Where instrumentation actually lives" table — per-layer breakdown
  of inline span / inline capture / composed-via-wrapper, with a verifiable
  grep showing only repos have inline calls.
- New "The wrapper sandwich" code block showing the actual repo body
  shape next to the bind-time withSpan(withCapture(...)) composition.
- Capture-rules table refined to reflect the R44 fix that just landed:
  use cases capture business-rule errors and output-schema failures
  (not bubbled-from-repo); controllers capture safeParse failures
  (not bubbled-from-use-case); the __sentryReported flag is what makes
  this safe.
- Double-report-guard paragraph now mentions withCapture, SentryLogger,
  and RecordingLogger all check the flag (not just SentryLogger).

di-explainer.html §08 — "Instrumentation symbols":
- Wiring path updated from "withSpan(tracer, ...)" to
  "withSpan(withCapture(...))" to reflect the post-merge wiring.
- New "Two wrappers, applied as a sandwich" table comparing what each
  wrapper does and where it fires; closing note that repos can't use
  the wrapper because they own per-call attributes.

Also bundled: a 1-line aesthetic SVG noise tweak in di-explainer.html
(opacity='0.25', baseFrequency 0.85→0.95) that was sitting in the
working tree before this session — preserved across the Plan 10 merge
via stash/pop and now committed alongside the doc update.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 00:43:42 +02:00
0a248d5be0 docs(html): data-flow-explainer §06 tracing + di-explainer §08 instrumentation symbols
Inserts a new §06 "Tracing & error capture" between the existing
"Tradeoffs by part" (§05) and the verdict (which moves to §07).
Includes the trace tree (HTTP → tRPC → controller → use-case → repo
→ Payload), capture-rules table (where captureException fires per
layer + the no-capture rule for defineErrorMiddleware), the
__sentryReported double-report guard explanation, and the R31–R38
PII rule list. Adds matching CSS (.trace-tree / .capture-rules /
.pii-rules) tuned to the existing dark-paper palette and Fraunces
heading font. Updates the contents nav from 6 → 7 columns.

di-explainer.html gets a new §08 "Instrumentation symbols" with cards
for TRACER and LOGGER, the bindAll() Rule-0 wiring path, and a note
on why feature containers also bind the symbols. Two-column grid
collapses to one on narrow viewports.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 20:37:46 +02:00
b90570b62f docs(arch): add §05 'Tradeoffs by part' to data-flow explainer
Each folder/file in the feature anatomy gets its own card with:
- Brief one-line description
- Two-column pros/cons list (3-4 items each)

Covers 22 parts grouped into 21 cards: entities/models, entities/errors,
application/repositories interfaces, application/services interfaces,
application/use-cases, infrastructure real repo, infrastructure mock
repo, infrastructure services, interface-adapters/controllers, di/
(symbols, module, container, bind-production, bind-dev-seed),
integrations/api/procedures, integrations/api/router, integrations/cms,
ui, __factories__, __contracts__, __seeds__, src/index.ts.

Each card uses the same paper/cream palette as the rest of the page;
pros/cons differentiated by color (forest-green + / oxblood −) and a
JetBrains-Mono leading character.

Verdict section renumbered to §06; contents nav updated to 6-column
grid.
2026-05-06 19:59:16 +02:00
8f34daca36 docs(dev-seed): canonical doc updates + refactor-log entry
- CLAUDE.md Key Conventions: 'App bootstrap' rule rewritten as 'Three
  binding modes per feature' — describes USE_DEV_SEED + NODE_ENV
  resolution order and the new ./di/bind-dev-seed export.
- AGENTS.md (root): exports list now mentions ./ui + ./di/bind-dev-seed;
  Per-feature public-API surface table gains a row; Apps section shows
  the bindAll() dispatcher with three-rule logic.
- docs/architecture/vertical-feature-spec.md §6: file shape now
  includes bind-dev-seed.ts, bind-dev-seed.test.ts, __seeds__/dev.ts;
  package.json exports list updated to include ./di/bind-dev-seed.
- docs/architecture/data-flow-explainer.html: anatomy tree gains
  __seeds__/ row; LAYERS.di description updated with new binders +
  cross-link to di-explainer.html; new LAYERS.seeds entry; public-
  surface card expanded to six subpaths.
- docs/superpowers/refactor-logs/2026-05-06-input-output-unification.md
  §7: new 'Post-Plan-9: dev-seed binders' entry summarizing the rollout
  (commits, per-feature additions, app wiring, tests, turbo, docs).
- bind-production.test.ts: dispatcher tests use vi.stubEnv (typesafe
  way to test process.env in TypeScript 5+ with @types/node read-only
  process.env types). 4 dispatcher tests + 2 bindAllProduction tests
  = 7 tests total.
2026-05-06 19:49:58 +02:00
449a4aedf5 docs(arch): rewrite §04 framing — drop 'mock is the surprising one'
User pushback: 'I already need mock data for dev and for testing at
runtime' — i.e., the dual role of the mock is obvious, not surprising.
Earlier framing was condescending.

Reframe around 'runtime reach':
- Section blurb leads with 'three artifacts at different distances
  from runtime'
- Three-roles card intro: same neighborhood, different reach. Mock is
  reached by runtime; contract + factory only by tests.
- 'The mock has two jobs' → 'The mock is reached from two directions
  — both legitimate, neither is the test version'.
- Contract framing now leads with its real purpose: it tests the mock
  alongside the real impl so you can trust the mock as a runtime
  artifact.
2026-05-06 18:46:23 +02:00
ea17e6f998 docs(arch): expand §04 with mock vs contract vs factory distinction
User asked: 'arent mocks also related to testing?' — yes, but the mock
plays two roles where the contract and factory play one each. §04 now
opens with that framing.

What's new:
- Section title bumped to 'Mocks, contracts & factories'
- New three-roles diagram at the top of §04 visualizing the chain:
  IArticlesRepository → MockArticlesRepository + ArticlesRepository
  → articlesRepositoryContract → articleFactory
- Two ordered lists explaining the mock's dual job (DI default binding
  + direct test fake) and the contract/factory's single test-only roles
- Three new expandable code examples:
  · the mock as DI binding (real BlogModule code)
  · the mock as direct test fake (use-case test, no container)
  · the contract running against both impls (proof-of-parity)
- New CSS for .three-roles-diagram, .role-* boxes, .role-arrow with
  vertical connector lines, .role-jobs lists with counter-leading
  decimal numbering

The existing Contracts and Factories cards stay in place below — they
provide the deeper detail on each individual artifact.
2026-05-06 18:42:06 +02:00
1b7e5eac50 docs(arch): add interactive data-flow explainer page
Single-file HTML at docs/architecture/data-flow-explainer.html.
Self-contained — Google Fonts (Fraunces + JetBrains Mono) is the only
external resource; all interactivity is vanilla JS, all diagrams are
inline SVG/CSS.

Five sections:
  01. Feature anatomy — clickable folder tree, layer detail card swaps
      to explain entities / application / infrastructure / interface-
      adapters / di / integrations / ui / __factories__ / __contracts__
      / public surface.
  02. Request flow — step-through pipeline (12 stages, including the
      success/error fork) with prev/next/play and a feature picker
      (auth, blog, marketing-pages, navigation, media). Each feature
      swaps real code snippets, the procedures.ts error map, and the
      use-case/controller pattern.
  03. Dependency injection — interactive DI canvas with default/prod
      toggle so the user sees the same symbol resolving to mock vs
      real Payload-backed impl. Real module.ts and bind-production.ts
      code blocks below.
  04. Contracts and factories — expandable sections with the actual
      defineContractSuite + defineFactory code from packages/blog.
  05. Verdict — short answer (yes), tradeoffs, badge row.

Editorial aesthetic: cream paper, deep ink, oxblood accent, Fraunces
display + JetBrains Mono code. Subtle paper noise + ruled-line bg.
No CDN scripts beyond fonts.
2026-05-06 17:57:57 +02:00