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:
2026-10-13 03:26:51 +05:30
parent ef951a1913
commit fced40af59
109 changed files with 4082 additions and 5885 deletions

View File

@@ -538,7 +538,7 @@ copying Tier B template components.</p>
<blockquote>
<p><strong>Doc model:</strong> this page is the human entry point. The deterministic,
machine-facing checklist lives in the reference page
<a href="../lib/01_build_recipe/">Build Recipe</a>, served as <code>doc://modules/build_recipe</code>.</p>
<a href="../lib/01_build_recipe/">Build Recipe</a>, served as <code>docs://modules/build_recipe</code>.</p>
</blockquote>
<hr />
<h2 id="what-the-agent-needs-from-you">🧾 What the agent needs from you</h2>
@@ -549,7 +549,9 @@ machine-facing checklist lives in the reference page
<code>openapi.yaml</code> if you already have it.</li>
<li><strong>Axis 2 — pipelines.</strong> Only if an input needs a multi-step transformation:
the families and their input formats (or "none").</li>
<li><strong>Auth needed now?</strong> Default no; auth is deferred (<code>py-jwt</code> only).</li>
<li><strong>Auth needed now?</strong> Default <strong>no</strong>. Auth is deferred (<code>py-jwt</code> primitives
only), and an authless app is just a spec with no <code>security</code> keys — see
<a href="../lib/04_spec_first_routing/#authless-apps">Spec-First Routing → Authless apps</a>.</li>
<li><strong>Integrations.</strong> Mongo, ingestion formats, email, LLM provider.</li>
</ol>
<p>If you can state axes 1 and 2, the rest is mechanical.</p>
@@ -557,13 +559,18 @@ machine-facing checklist lives in the reference page
<h2 id="how-to-start">▶️ How to start</h2>
<p>From an MCP client connected to the <code>standards</code> server:</p>
<ol>
<li>Invoke the <strong><code>start_app</code></strong> prompt with no arguments to get the intake
questions.</li>
<li>Answer them, then invoke
<code>start_app(app_name=..., resources=..., pipelines=..., auth=...)</code>.</li>
<li>The prompt hands off to <code>doc://modules/build_recipe</code>; the agent pulls exact
files with <code>get_app_component(kind, resource=..., family=...)</code> and authors
only the app-specific parts.</li>
<li>Invoke the <strong><code>intake</code></strong> prompt (or <code>start_app</code> with no arguments) to get the
intake questions.</li>
<li>Answer them, then invoke <strong><code>build</code></strong>
(<code>build(app_name=..., resources=..., pipelines=..., auth=...)</code>), or use
<strong><code>start_app</code></strong> to intake-and-build in one call.</li>
<li>The prompt hands off to <code>docs://modules/build_recipe</code>; the agent scaffolds
with <code>get_app_template()</code> and pulls exact files with
<code>get_app_component(kind, resource=..., family=...)</code>, authoring only the
app-specific parts.</li>
<li>To validate the standard without touching a real app, invoke <strong><code>trial</code></strong>
(<code>trial(app_name=..., build_path=...)</code>) to build into a scratch directory,
prove it builds, and report findings.</li>
</ol>
<p>Manual alternative — copy the skeleton and follow the reference recipe:</p>
<div class="language-bash highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"><a href="#__codelineno-0-1">1</a></span></pre></div></td><td class="code"><div><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1"></a>cp<span class="w"> </span>-r<span class="w"> </span>&lt;docs&gt;/standards/src/templates/app<span class="w"> </span>apps/&lt;your-app&gt;

View File

@@ -588,8 +588,8 @@ Registry</a>.</p>
<hr />
<h2 id="related-resources">🔗 Related Resources</h2>
<ul>
<li><strong>MCP bundle</strong> — <code>standards</code> server on <code>:8009</code>: read <code>doc://index</code>,
<code>doc://nav</code>, <code>doc://modules/{module}</code>; call <code>find_library(capability)</code></li>
<li><strong>MCP bundle</strong> — <code>standards</code> server on <code>:8009</code>: read <code>docs://index</code>,
<code>docs://nav</code>, <code>docs://modules/{module}</code>; call <code>find_library(capability)</code></li>
<li><strong>Library registry</strong> — the catalog of internal libraries behind every app
(<code>libraries.json</code>, served as <code>registry://libraries</code>)</li>
<li><strong>Template</strong> — the runnable skeleton at <code>standards/src/templates/app/</code></li>

File diff suppressed because one or more lines are too long