Harness-independent execution backend architecture (D-056, #146) #147
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!147
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "arch/harness-independent-backend"
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 #146 (architecture-only child of program #132). READY_FOR_REVIEW — left open for the human merge gate; the owner will have the result reviewed independently with GPT-5.6 Sol before merge. Workers never merge and this PR is not self-approved.
What
Makes explicit in the authoritative documents that Scarcity Router is a harness-independent execution backend — not a backend for ZCode. ZCode is the first demanding representative harness that exposed gaps in the execution contract; the intended client population also includes Kilo, Cline, other coding-agent harnesses, OpenAI-compatible SDK clients, simple scripts and our own future agent/orchestration algorithms. One new decision, D-056 (next free number verified against
docs/decisions.md), amends existing documents; no new design document, no parallel architecture, no production behavior.Documents changed (all amendments in place)
docs/decisions.md— new D-056 with the ten settlement points and explicit reconciliation/boundary notes (see below).docs/architecture.md— Context framing + new section “Harness-independent execution backend (D-056, #146)”: responsibility-boundary table (HARNESS / SCARCITY ROUTER / EXECUTION SOURCE), semantic execution model and protocol-adapter inventory, model/execution identity invariant, effective-capability intersection, client-owned tool lifecycle, transport-tier summary, layered acceptance strategy, and an explicit current-vs-accepted-architecture split.docs/execution-surface.md— new “Harness compatibility contract (D-056)” section: the 16 semantic areas with per-area implementation status (implemented / contract frozen with #137 pending / architecture accepted with #136 pending / partially implemented), the tool lifecycle, and the effective-capability subsection. Listener-defaults bullet reframed: loopback plain HTTP is a supported local transport, not an insecure-debug exception.docs/security.md— new “Client-transport tiers (D-056)” section (A loopback supported/implemented; B same-host container architecturally permitted, not implemented, never a global non-loopback plaintext listener; C cross-host/LAN/VPN TLS required; D public-CA normal path, private CA advanced, no verify=false/TOFU/silent fallback; E worker transport unchanged) + the verified-TLS bullet amended accordingly.docs/product.md— harness-independent positioning, client population, and the normal-configuration target (base URL + API key + logical model id).docs/worker-protocol.md— boundary note only: D-056's local-HTTP tiers govern external inference-API client traffic and deliberately do not weaken worker transport.Architectural decisions made (the PR's twelve settlements)
if zcode/if kilo/if clinein the core (pt 4, execution-surface.md).sr-pin:escape hatch; logical ids normal (pt 3).internal: truenetwork, no published plaintext port), explicit mode required, hard to accidentally expose LAN plaintext (pt 8B).Discipline
Current implemented behavior, newly accepted architecture and deferred implementation are separated everywhere (status table in execution-surface.md; “Current state versus accepted architecture” in architecture.md; D-056 Boundary). Nothing describes a target as already implemented; no Responses implementation; no #136/#137/TLS-automation/worker changes;
mainuntouched.Validation
uv sync --only-dev✓make check— 2100 tests OK ✓ (known pre-existing load flake #143 did not recur)uv run basedpyright— 0 errors / 0 warnings / 0 notes ✓git diff --check✓UX impact
Positive, documentation-level: the architecture now commits to a harness needing only base URL + API key + logical model id, with loopback HTTP a first-class supported local transport — no CA hacks or pins in the normal local path. No user-facing behavior changes in this PR.
Review
Independent review requested (owner will route to GPT-5.6 Sol). Not security-critical: no code, no new trust boundary, no credential path; D-056 tightens rather than relaxes transport semantics everywhere except the explicitly bounded, not-yet-implemented container tier, which is recorded as requiring its own implementation issue before any non-loopback plaintext bind exists.
Remediation + fresh exact-head review record (bounded review lifecycle: one initial review → one remediation → narrow final verification).
Remediation commit:
5d415be(74e6768→5d415be) — resolves all four REQUEST_CHANGES findings and both clarifications: (1) Docker bridge loopback-publish plaintext marked NOT currently supported, loopback support stated precisely (native loopback + host-network containers), bridge support assigned to the accepted container tier; (2) composed-listener boundary settled explicitly — the same-host container tier applies to the ENTIRE composed HTTP listener (D-041 one-process composition), never a per-surface mix; (3) tool-call/tool-result status is source-capability-aware (server-direct PASS/PARTIAL evidence; #137 = Codex worker-source gap only); (4) protocol layering corrected (recommendation/machine/control = consumers of the ONE selection core, not execution-protocol adapters); (5) model-level aggregation of per-route ceilings explicitly deferred to #136; (6) additive scope comment on existing #139 carries the container tier (no new issue).Gates at
5d415be:uv sync --only-dev✓;make check— one transient failure on the first run that did not reproduce in two consecutive full-suite runs (both 2100 OK; consistent with filed load flake #143);uv run basedpyright0/0/0 ✓;git diff --check✓.Independent exact-head review (GLM-5.3-Flash, reviewed
5d415bevsa573af5):VERDICT: APPROVED. All five remediation points verified against code (gateway_server bind/TLS refusal, control_server composed listener, openai_http_evidence PASS/PARTIAL cells, codex evidence UNSUPPORTED cells, m10 Docker notes); all original settlements confirmed present; no new overclaims. UX impact: none.DEFER findings (recorded for the human merge gate, no action required on this PR):
PR left open, not merged, not self-approved; awaiting the owner's independent GPT-5.6 Sol review at the human merge gate.
Round-2 remediation + fresh exact-head review record (bounded review lifecycle: round-2 REQUEST_CHANGES → narrow remediation → fresh exact-head review).
Remediation commit:
7d7ce94(5d415be→7d7ce94) — three consistency fixes plus the recommended D-044 annotation:-p 127.0.0.1:8787:8787) is an allowed target of the explicit local-container mode; LAN/WAN-reachable plaintext publication is forbidden; the implementation may bind a non-loopback address INSIDE the container in that explicit mode (today's code refuses any non-loopback plaintext bind); what is forbidden is a general/default non-loopback plaintext bind with no deployment-boundary enforcement. #139 must prove host-locality and fail closed when the bounded mode is not explicitly selected. The contradictory "no externally published plaintext application port" phrase is removed (D-056 pt 8(B); security.md tier B).Gates at
7d7ce94:uv sync --only-dev✓;make check— one transient failure on the first run that did not reproduce in two consecutive full-suite runs (both 2100 OK), consistent with filed load flake #143;uv run basedpyright0/0/0 ✓;git diff --check✓.Independent exact-head review (GLM-5.3-Flash, reviewed
7d7ce94vsa573af5):VERDICT: APPROVED. All three fixes verified against code (control_server composed listener + separate optional worker listener; gateway_server non-loopback plaintext refusal; openai_http_evidence GENERIC_PRESET all-UNKNOWN); the delta vs round 2 is exactly the three fixes plus the additive D-044 annotation; D-056 substance otherwise unchanged; deferred-vs-implemented honesty confirmed across all documents. UX impact: none.DEFER findings (recorded for the human merge gate; no action on this PR):
PR left open at
7d7ce94, not merged, not self-approved; awaiting the owner's independent GPT-5.6 Sol review at the human merge gate.