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>
This commit is contained in:
2026-05-09 13:17:04 +02:00
parent ca2e7d8c10
commit 723729dd9e
8 changed files with 34 additions and 19 deletions

View File

@@ -2209,7 +2209,7 @@ footer .colophon {
<div class="tradeoff-card">
<div class="tag">di/bind-dev-seed.ts</div>
<h3>Dev-seed binder</h3>
<p class="blurb"><code>bindDevSeed&lt;F&gt;()</code> — unbinds the empty mock, rebinds a populated mock (post-Plan-9).</p>
<p class="blurb"><code>bindDevSeed&lt;F&gt;(ctx: BindContext)</code> — unbinds the empty mock, rebinds a populated mock (post-Plan-9).</p>
<div class="pc-cols">
<div class="pros"><h5>Pros</h5><ul>
<li>Dev mode shows realistic data without Payload running — design review, storybook, offline work all just work</li>

View File

@@ -764,7 +764,7 @@ footer .colophon {
<div class="cast-tag">file 05 · seeded mock</div>
<h3>bind-dev-seed.ts</h3>
<p class="role">Replaces the empty mock with a populated mock so the running app shows realistic data without Payload.</p>
<p>Exports <code>bindDevSeedBlog()</code>. Same shape as <code>bind-production</code> — unbind, rebind. The difference: it constructs a fresh <code>MockArticlesRepository</code>, seeds it via <code>buildDevArticles()</code> from <code>src/__seeds__/dev.ts</code>, and binds the populated instance via <code>.toConstantValue(repo)</code>. Mutually exclusive with <code>bindProductionBlog</code> — both operate on the same symbol.</p>
<p>Exports <code>bindDevSeedBlog(ctx)</code>. Same shape as <code>bind-production</code> — unbind, rebind. The difference: it constructs a fresh <code>MockArticlesRepository</code>, seeds it via <code>buildDevArticles()</code> from <code>src/__seeds__/dev.ts</code>, and binds the populated instance via <code>.toConstantValue(repo)</code>. Mutually exclusive with <code>bindProductionBlog</code> — both operate on the same symbol.</p>
<div class="runs-when"><strong>When it runs:</strong> called from app boot when <code>USE_DEV_SEED === "true"</code>. Storybook stories that need data may call this directly.</div>
</div>
@@ -1093,7 +1093,7 @@ footer .colophon {
</div>
<div class="conditions-row">
<div class="scenario">Storybook story that wants populated data</div>
<div class="trigger">await bindDevSeedBlog()</div>
<div class="trigger">await bindDevSeedBlog(ctx)</div>
<div class="outcome">dev seed · populated mock</div>
</div>
<div class="conditions-row">
@@ -1285,7 +1285,7 @@ const MODES = {
scenarioTag: 'when this happens',
title: 'Dev seed binder ran at app boot',
narrative: [
"App's bindAll() saw USE_DEV_SEED=true and dispatched to bindAllDevSeed(), which called bindDevSeedBlog().",
"App's bindAll() saw USE_DEV_SEED=true and dispatched to bindAllDevSeed(), which called bindDevSeedBlog(ctx).",
"That binder unbound IArticlesRepository, constructed a fresh MockArticlesRepository, awaited createArticle for each entity from buildDevArticles(), and rebound the symbol with .toConstantValue(repo).",
"Use case + controller bindings did not change — they still resolve through their .toDynamicValue closures, but now the closure fetches the populated mock and threads it through. The dev server now shows the welcome article, the work-in-progress draft, etc."
],