This is the contract of the modules, the request flow and the stored records. The rationale is in the decision.
NL ─► nl.IntentParser ─► nl.SemanticCache ─► nl.LLMTranslator (optional)
CLI / REST / MCP ─────────────► dsl.DSLCommand ─► engine.Engine.execute
│ registry.ActionRegistry (validate)
▼
code · runtime · pipeline · system analyzers ─► models.Report
▼
ledger.Ledger: events.jsonl + ledger.sqlite3
entity.operation key=value filter:key=value. Arguments
top and min_severity apply to every report action. Filters are severity,
domain and kind. Unknown actions return NOT_FOUND; unknown parameters return
VALIDATION_ERROR.{success, status, data, errors, meta}. status is
one of OK, NOT_FOUND, VALIDATION_ERROR, EXECUTION_ERROR, UNAUTHORIZED or CLARIFY.
meta holds sourceLayer, canonicalDsl, actionUri and the urtlog eventId.read, process (runtime.profile)
or write (plan.*). process and write actions need confirm=true, or --yes
for NL requests.urn:bottlenecks:input:<sha16> with an ni:///sha-256 digest. The outputs are
urn:bottlenecks:report:<run> plus urn:bottlenecks:finding:<fingerprint>.
Fingerprints ignore line numbers, so history.diff reports new, worsened and
resolved findings.plan.schedule writes a PLAN. plan.run_due executes the plan
inside its window, or cancels it as a misfire. It then materialises at + step.pipeline.urtlog reads any urtlog events.jsonl. It reports slow,
tail-latency, failing and critical-path operations, and handoff gaps. The
critical path follows URN_OUT → URN_IN lineage.Schemas: src/bottlenecks/schemas/*.schema.json, also served by GET /schema.
pytest, bottlenecks self-test and bottlenecks registry show the live contract.
The SQLite projection is disposable and is rebuilt from events.jsonl. The NL
lexicon in profiles/nl-lexicon.json is data; extend it with tests.