feat(standards): codify codegen, ship generic Tier-B infra, add get_app_template + prompts; fix docs:// regressions
P0: fix doc:// -> docs:// across standards src/server/registry and regenerate stale mongo-ops bundle. P1: build recipe + spec-first routing now document the openapi-first codegen fast path (models/routes with --inject-request/--package). P4: CRUD template documents the model-vs-document id rule (BaseDocument owns id). P5: authless guidance (omit security keys). P6: template gains generic infra (http_cache, keyed SSE bus, KV port+in-memory+Redis), interfaces/openapi.py + .dockerignore + generic build test registered as components, and a get_app_template tool; genericity matrix marks LLM pool + human-in-loop as reference-app patterns. P7: intake/build/start_app/trial prompts. P8: template ships tests/integration/test_openapi_app_builds.py. Rebuilt standards + openapi-first bundles and re-collected.
This commit is contained in:
@@ -519,6 +519,15 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#tier-b-patterns-port-from-the-reference-app" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Tier B (patterns) — port from the reference app
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -620,6 +629,15 @@
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#tier-b-patterns-port-from-the-reference-app" class="md-nav__link">
|
||||
<span class="md-ellipsis">
|
||||
Tier B (patterns) — port from the reference app
|
||||
</span>
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
@@ -721,13 +739,16 @@ for its API. Writing a private copy of any of these is a defect.</p>
|
||||
<h2 id="tier-b-template-provided-copy-from-templatesapp-then-adapt">Tier B — Template-provided (copy from <code>templates/app</code>, then adapt)</h2>
|
||||
<p>These are reusable internal components shipped <strong>inside</strong> the template — they are
|
||||
not independent libraries. Copy them as-is, then rename/populate only what is
|
||||
app-specific. They give every app the same wiring shape as the reference app.</p>
|
||||
app-specific. They give every app the same wiring shape as the reference app.
|
||||
Fetch them by kind with <code>get_app_component</code>, or the whole tree with
|
||||
<code>get_app_template</code>.</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Component</th>
|
||||
<th>Template location</th>
|
||||
<th>Action</th>
|
||||
<th>Shipped</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -735,81 +756,114 @@ app-specific. They give every app the same wiring shape as the reference app.</p
|
||||
<td>Layering & dependency rule</td>
|
||||
<td>the package layout + import rules</td>
|
||||
<td>keep</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Composition root shape</td>
|
||||
<td><code>init.py</code> (<code>get_svc</code>/<code>get_db</code>, idempotency)</td>
|
||||
<td>keep</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Spec-first web edge</td>
|
||||
<td><code>interfaces/openapi.py</code>, thin handlers bound to <code>operationId</code></td>
|
||||
<td>keep</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>CRUD slice pattern</td>
|
||||
<td><code>domain/<resource>/{models.py, ports/db.py, ports/service.py, converters.py}</code></td>
|
||||
<td>rename + fill</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Generic CRUD service</td>
|
||||
<td><code>infra/adapters/service.py</code> (<code>CrudsServiceAdaptor</code>)</td>
|
||||
<td>keep</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Repository factory</td>
|
||||
<td><code>infra/db/repos/mongo.py</code> (<code>_repo_factory</code>)</td>
|
||||
<td>keep</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Worker poll + status loop</td>
|
||||
<td><code>worker.py</code></td>
|
||||
<td>keep</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Progress bus + streaming</td>
|
||||
<td>bus port + in-memory adapter + SSE endpoint</td>
|
||||
<td>keep</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Human-in-the-loop</td>
|
||||
<td>durable pause + question document + resolve endpoint + resume map</td>
|
||||
<td>Progress bus</td>
|
||||
<td><code>infra/adapters/sse.py</code> (keyed in-memory bus) + an app SSE endpoint</td>
|
||||
<td>keep</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>HTTP response cache</td>
|
||||
<td><code>cache_response</code> decorator + generation invalidation</td>
|
||||
<td><code>infra/http_cache.py</code> (<code>cache_response</code> + generation invalidation)</td>
|
||||
<td>keep</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Key-value store</td>
|
||||
<td>KV store port + Redis adapter + in-memory fallback</td>
|
||||
<td>keep</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LLM client pool</td>
|
||||
<td>provider-select + retry pool scaffold</td>
|
||||
<td><code>infra/adapters/kv.py</code> (port + in-memory + Redis adaptor)</td>
|
||||
<td>keep</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Pipeline scaffold</td>
|
||||
<td><code>pipelines/shared/{ports,loader,registry}.py</code> + <code>pipelines/<family>/</code></td>
|
||||
<td>rename + fill</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Operator scripts</td>
|
||||
<td><code>scripts/</code> (<code>init()</code> / <code>get_svc()</code> / <code>shutdown()</code>)</td>
|
||||
<td>rename</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Testing harness</td>
|
||||
<td>integration fakes + fixture-parity pattern</td>
|
||||
<td>keep</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Project scaffolding</td>
|
||||
<td><code>pyproject.toml</code>, <code>Dockerfile</code>, <code>docker-compose.yaml</code>, <code>.env.example</code>, <code>openapi.yaml</code></td>
|
||||
<td>rename + fill</td>
|
||||
<td>✅</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h2 id="tier-b-patterns-port-from-the-reference-app">Tier B (patterns) — port from the reference app</h2>
|
||||
<p>A few Tier B capabilities are real and reusable, but are <strong>shaped by the app or
|
||||
the provider</strong>, so the template does not ship them verbatim — copying them
|
||||
blindly would carry app-specific names. Treat them as patterns: lift the shape
|
||||
from the reference app and rename per app.</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Component</th>
|
||||
<th>Reference location</th>
|
||||
<th>Action</th>
|
||||
<th>Shipped</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Human-in-the-loop</td>
|
||||
<td>durable pause + question document + resolve endpoint + resume map</td>
|
||||
<td>port + reshape</td>
|
||||
<td>✗</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LLM client pool</td>
|
||||
<td>provider-select + retry/rotation pool scaffold</td>
|
||||
<td>port + reshape</td>
|
||||
<td>✗</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user