docs(architecture): execution-gateway program map, decisions and contracts (A0, issue #85) #96
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
P1
P2
P3
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Creatidy/scarcity-router!96
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "docs/execution-gateway-a0"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #85 (A0: architecture, decisions, and contracts for the optional execution gateway).
What this is
Documentation and contract work only — A0 of the execution-gateway program. No runtime behavior is implemented or changed. The goal is to make the architecture and contracts sufficiently explicit that M01–M10 (#86–#95) can proceed independently without inventing incompatible assumptions.
Analysis baseline:
develop@fce4311(2026-09-19), as recorded in the issue.Decisions recorded (docs/decisions.md)
verify=false), simple pairing bootstrap, bounded credential-store exception, admission limits, router-loop and SSRF protection, local-adapter isolation, logging/audit hygiene, single-user subscription scope./v1/prefix is the OpenAI convention — disjoint path sets, separate error vocabularies; loopback REST adapter never becomes the execution server; parity requirement extended (amends D-028 non-goals; boundary notes on D-030/D-031).Superseded/amended statuses updated in place on D-001, D-009, D-017, D-028, D-030, D-031 (pointers only; no history rewritten). Codex and ZCode execution uncertainties registered as U-012/U-013 (owned by M06/M07 Stage 1) rather than guessed.
Documents updated
docs/architecture.md— full A0 section: program map, operating modes/topologies, module responsibility table, separation invariants, server vs worker split, contract map (request, route decision, resource state, execution, worker protocol, entitlement/quota pools, compatibility matrix, audit), authorization precedence, recommendation-to-execution binding, durable state, coexistence, migration plan, existing-file → module mapping.docs/product.md,docs/security.md(execution-gateway threat model covering every item of the issue's acceptance list),docs/machine-interfaces.md(coexistence + non-goals amendment),docs/providers.md(execution-adapter discipline),docs/capacity-model.md(observation classes, quota pools, promotions; v3 preserved),docs/selection-policy.md(route-decision inputs, precedence, pinned-target execution),docs/roadmap.md(program map),AGENTS.md(two-mode product boundary, security-invariant pointers),README.md(honest two-mode boundary text; gateway explicitly marked not-yet-implemented).Continuation commit
cb340e3(2026-09-19, post-review coherence pass)After the bounded review (PASS, see comment thread), a residual sweep for contradictory legacy wording outside the original 11 files found and fixed:
docs/llm-operating-policy.md— the "Project-specific overrides" section still asserted D-017 as the accepted override and the "Scarcity Router product boundary" section still carried the single-mode text; both rewritten to the two-mode product with D-017 explicitly marked superseded by D-040.docs/competitive-landscape.md— differentiator text ("differs by not proxying or executing") rewritten to the two-mode framing (default recommendation-only; optional policy-gated gateway)..kilo/rules/40-llm-operating-policy.md— agent rule summary still stated "D-017 excludes local inference"; updated to the D-040 supersession.docs/architecture.md— review DEFER 2 resolved at the A0 level: the D-043 lifecycle now states fail-closed dispatch explicitly — the selected target is never silently replaced before or after stream start; automatic cross-target failover does not exist; the prompt-destination invariant holds from admission. M03 implements this; nothing is left to re-decide.docs/decisions.md— review DEFER 1 resolved early: U-003's status line now points its deferred refresh/staleness remainder at M01 (#86) via D-041; plus the two cosmetic line-wrap splits (server-direct,backwards-compatibility) fixed.docs/security.md— cosmetic line-wrap split (execution-gateway) fixed.Deliberately left untouched:
docs/history/*(historical archive),docs/m3-acceptance.md(milestone evidence record),scarcity_router/mcp.pydocstrings and their tests (frozen v1 MCP surface, statements remain true),examples/agent-routing-prompt.md(describes the MCP recommendation flow, which stays recommendation-only), and all current-behavior tests asserting Ollama's absence from today's catalog/CLI (still true until M01/M04 implement executable resources).Validation
Scope check: two commits (
8f22c91,cb340e3), 14 documentation/rule files, no source/test/artifact changes, no merge commits;origin/develop..HEADcontains only this issue's change. Left open for human review; no merge.Bounded independent review — outcome (2026-09-19)
Frozen reviewed head:
8f22c91845049213e8bf28e2f1b7eee8a51f7782(= PR head; unchanged during review). Reviewer scope: fullfce4311..HEADdiff, issue #85 acceptance criteria, cross-document coherence (decision/module/issue references), security hygiene of the documents, scope discipline.Verdict: PASS. No
MERGE_BLOCKERfindings; no remediation triggered under the bounded review lifecycle. Narrow final verification re-ran clean: reviewed head unchanged, working tree clean,basedpyright0 errors,git diff --checkclean.DEFER findings (tracked for later work, not fixed here per lifecycle):
docs/decisions.mdU-003 still carries only its 2026-09-05 partial-resolution status; the assignment of its deferred remainder to M01 (#86) is recorded in D-041,docs/architecture.mdanddocs/capacity-model.mdbut not in the U-003 entry itself. One-line status update in a later PR (naturally M01/#86).docs/security.md's absolute "prompt goes only to the selected authorized target" invariant vs the lifecycle rule's "backend never silently replaced after a response stream has started" leaves a seam an M03 implementer could misread as permitting pre-stream cross-target failover. The fail-closed reading (dispatch failure → explicit error, never silent re-dispatch to a different target; consistent with D-042's pinned-target rule) is the intended semantics — M03 (#88) should state it explicitly when implementing the execution contract.Cosmetic non-finding (below the meaning threshold): three hyphen-at-line-end splits render with a spurious space (
server- -directin D-040/D-017 note,backwards- compatibilityin D-045,execution- gatewayindocs/security.md); fix opportunistically in a later documentation pass.PR remains open for human review; no merge performed.
Continuation commit pushed:
cb340e3(2026-09-19)Following the bounded review (PASS at frozen head
8f22c91), a fresh acceptance-criteria audit of issue #85 and a residual sweep for contradictory legacy product-boundary wording outside the original 11 files produced one documentation-only continuation commit. No runtime behavior was implemented or changed; recommendation-only operation remains the unchanged default.What changed (6 files, docs/rules only):
docs/llm-operating-policy.md— "Project-specific overrides" no longer presents D-017 as the accepted override (now explicitly superseded by D-040, instability rationale retained as design input); the "Scarcity Router product boundary" section rewritten to the two-mode product, mirroring the updated AGENTS.md.docs/competitive-landscape.md— differentiator no longer claims the product "does not proxy or execute"; reframed as default recommendation-only plus an optional policy-gated gateway under D-040..kilo/rules/40-llm-operating-policy.md— agent rule summary updated to the D-040 supersession.docs/architecture.mdD-043 lifecycle now states fail-closed dispatch explicitly: the selected target is never silently replaced before or after stream start; automatic cross-target failover does not exist; thedocs/security.mdprompt-destination invariant holds from admission, not from the first stream byte. M03 (#88) implements; nothing left to re-decide.docs/decisions.mdU-003 status line now points its deferred refresh/staleness remainder at M01 (#86) via D-041 (one-line amendment; history preserved).server-direct,backwards-compatibility,execution-gateway).Deliberately untouched (with reasons):
docs/history/*anddocs/m3-acceptance.md(historical/acceptance records, never rewritten);scarcity_router/mcp.pydocstrings +tests/test_mcp.py(frozen v1 MCP surface, statements remain true and are contract-asserted);examples/agent-routing-prompt.md(describes the MCP recommendation flow, which stays recommendation-only under the amended D-030/D-031); current-behavior tests asserting Ollama's absence from today's catalog/CLI (still true until M01/M04 land executable resources).Acceptance-criteria audit result for #85: all seven criteria satisfied — decisions recorded with provenance (D-040…D-045, amendments in place, U-012/U-013 registered); no contradictory product-boundary rules remain in current documents (residual sweep re-run clean after this commit); architecture defines every module's responsibility/inputs/outputs/never-does with M01–M10 referenced; local CLI/app risks resolved to explicit M06/M07 Stage-1 evidence tasks; the threat model covers every listed item; the dependency graph is cycle-free with M06/M07 Stage 1 exempt; the program map links #86–#95. The issue's three "evidence still required" items are recorded as evidence requirements (worker transport and durable-state choices gated in M01/M05; compatibility-matrix evidence per adapter in M03/M06/M07), not invented.
Validation (re-run on
cb340e3):uv sync --only-devOK;make check1045 tests OK;uv run basedpyright0 errors/0 warnings/0 notes;git diff --checkclean.origin/develop..HEAD= exactly the two #85 commits, no merge commits.PR remains open for human review; no merge performed.