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:
18
build.py
18
build.py
@@ -145,7 +145,7 @@ def build_bundle(folder: Path, dry_run: bool = False) -> None:
|
||||
write_module(module, path.read_text(encoding="utf-8"))
|
||||
nav.append({
|
||||
"module": module,
|
||||
"resource": f"doc://modules/{module}",
|
||||
"resource": f"docs://modules/{module}",
|
||||
"title": _read_title(path),
|
||||
})
|
||||
|
||||
@@ -185,10 +185,16 @@ _TEMPLATE_COMPONENTS: list[dict[str, str]] = [
|
||||
"description": "Optional pure converters between domain types."},
|
||||
{"kind": "routes", "path": "interfaces/item/routes.py", "placeholder": "resource",
|
||||
"description": "Thin HTTP handlers bound to operationIds."},
|
||||
{"kind": "openapi-routes", "path": "interfaces/openapi.py", "placeholder": "",
|
||||
"description": "Route registry: flat re-export of every handler namespace."},
|
||||
{"kind": "test-model", "path": "tests/unit/test_item_models.py", "placeholder": "resource",
|
||||
"description": "Unit test for the resource model."},
|
||||
{"kind": "test-routes", "path": "tests/integration/test_item_routes.py", "placeholder": "resource",
|
||||
"description": "Integration test at the HTTP edge."},
|
||||
{"kind": "test-openapi-build", "path": "tests/integration/test_openapi_app_builds.py", "placeholder": "",
|
||||
"description": "Generic test: every spec operationId resolves and the app builds."},
|
||||
{"kind": "test-pipeline", "path": "tests/unit/test_item_sync.py", "placeholder": "",
|
||||
"description": "Unit test for the smallest pipeline form."},
|
||||
# Per-family pipeline scaffold (seed: example/Example).
|
||||
{"kind": "pipeline-abc", "path": "pipelines/example/abc.py", "placeholder": "family",
|
||||
"description": "Port contracts for a pipeline family."},
|
||||
@@ -233,6 +239,8 @@ _TEMPLATE_COMPONENTS: list[dict[str, str]] = [
|
||||
"description": "Packaging + dependency pins."},
|
||||
{"kind": "dockerfile", "path": "Dockerfile", "placeholder": "",
|
||||
"description": "API + worker image with private-index wiring."},
|
||||
{"kind": "dockerignore", "path": ".dockerignore", "placeholder": "",
|
||||
"description": "Docker build-context exclusions."},
|
||||
{"kind": "compose", "path": "docker-compose.yaml", "placeholder": "",
|
||||
"description": "api + worker + mongo compose file."},
|
||||
{"kind": "env-example", "path": ".env.example", "placeholder": "",
|
||||
@@ -243,6 +251,14 @@ _TEMPLATE_COMPONENTS: list[dict[str, str]] = [
|
||||
"description": "Repository factory (base/populating/cached)."},
|
||||
{"kind": "service-adapter", "path": "infra/adapters/service.py", "placeholder": "",
|
||||
"description": "Generic CRUD service adaptor."},
|
||||
{"kind": "http-cache", "path": "infra/http_cache.py", "placeholder": "",
|
||||
"description": "Response cache decorator + Redis store (generation invalidation)."},
|
||||
{"kind": "progress-bus", "path": "infra/adapters/sse.py", "placeholder": "",
|
||||
"description": "In-memory SSE progress bus (keyed by an event attribute)."},
|
||||
{"kind": "kv-store", "path": "infra/adapters/kv.py", "placeholder": "",
|
||||
"description": "KV port + in-memory fallback + optional Redis adaptor."},
|
||||
{"kind": "package-init", "path": "domain/__init__.py", "placeholder": "",
|
||||
"description": "Empty package marker; add an __init__.py to every package dir."},
|
||||
{"kind": "script-seed", "path": "scripts/seed.py", "placeholder": "",
|
||||
"description": "Operator seed script."},
|
||||
{"kind": "script-drop", "path": "scripts/drop.py", "placeholder": "",
|
||||
|
||||
Reference in New Issue
Block a user