#1092
RFC: single-source manifests + codegen + contract tests (tools / events / env / CI gates)
Problem
The 40-agent friction audit (report: .agents/plans/shipping-friction-analysis.md) found that most of our worst shipping friction traces back to one structural cause: load-bearing cross-app contracts exist only as prose or hand-synced lists. Violations produce zero in-loop signal until something breaks at runtime — which is exactly the class of failure small models die on (hallucinated schemas, tools that silently never bind) and a recurring tax on frontier models and humans too.
Verified live divergences (receipts)
-
Tool-name union drifted across three self-labeled-"canonical" registries
apps/api/app/models/chat_models.py(tool_fields, ~L56)libs/shared/ts/src/chat/types.ts(~L796–836)apps/web/src/config/registries/toolRegistry.ts(~L115+)- Audit-time counts: 31 vs 35 vs 36 names.
-
Analytics split-funnel bug (live right now)
- API emits
"workflow:created"—apps/api/app/services/analytics_service.py:34 - Web emits
"workflows:created"—apps/web/src/lib/analytics.ts:54 - Directly violates the repo's own one-event-one-emitter PostHog rule (AGENTS.md); cross-surface funnels silently stop joining. Same class: client-side capture double-counting server-side events.
- API emits
-
Env-var registration requires 4 hand-synced places
- Pydantic field + validator group +
.env.example+ TS regex parser; audit measured ~112 registered vs ~94 documented. Drift yields warnings, not gate failures.
- Pydantic field + validator group +
Proposal
Single-source manifests consumed by codegen + enforced by contract tests:
- Manifests:
tools.yaml,analytics-events.yaml,env-vars.yaml,ci-gates.yaml— one authoritative definition per domain. - Codegen emits every derived artifact: TS unions, Python enums, registry stubs, docs tables. Hand-editing generated files fails a check.
- Contract tests in CI assert: generated outputs are fresh; cross-system invariants hold (byte-identical queue names, Pydantic↔zod envelope mirror, event-name parity api↔web↔bots↔voice).
- Generators (
nx g tool|event|env-var) scaffold every touchpoint from the manifest — makes the current 6-place new-tool checklist ("forget one = silent non-binding") structurally impossible. - Gates manifest feeds local verification (companion
mise verifyeffort): lane names/versions/scopes become data, killing the local-vs-CI version skew (bare uvx ruffvs pinned CI was yesterday's instance of this) and the dual change-detection truths (code-quality.ymlextension matching vsmain.ymlnx-affected).
Why this collapses multiple top themes at once
- Verification theater (agents claiming done without executing): contract failures become loud, mechanical, local.
- Small-model cliff: the fatal class is prose-contracts-without-signal; manifests convert them into compile/test failures exactly where cheap models are strong.
- Split-funnel/double-count analytics bugs: event-name parity becomes a tested invariant instead of a convention.
Open questions
- First domain: tools/events (worst observed divergence) or ci-gates (largest time sink)?
- Ownership: which team/domain owns manifest schema evolution?
Activity
0No activity yet.