Program integration: M02 routing core (#87) + M06 Stage 1 (#91) + M07 Stage 1 (#92) #100

Merged
adrian.tkacz merged 9 commits from program/m02-m06-m07-parallel into develop 2026-09-19 23:46:10 +00:00
Member

Program slice: M02 (full) + M06 Stage 1 + M07 Stage 1 — three parallel workstreams, integrated

Baseline: 383572249da2d629a1e2dc2d9bbaf1f2b1e505d2 (develop at program start; unchanged — verified by fetch at integration time). This branch contains three no-ff merges of independently reviewed task branches. No integration conflicts occurred; nothing here is merged to develop by this PR — it is left open for owner review.

Contents

  • #87 — M02 complete implementation (m02/routing-core @ 7523eee, merged in 648e3e3): new pure, deterministic route-decision core scarcity_router/routing_core.py implementing the D-042 contract — frozen authorization precedence with narrowing-only layers, explicit-target pin semantics, five-dimension target separation (ModelIdentity, execution channel, entitlement, confirmed quota pools, routing profile), content-addressed decision_id, M01 RegistrySnapshot read-model consumption, D-039 typed eligibility gates, fail-closed stale/unknown/unhealthy state, admit_pinned_target admission-only binding, 49 new tests. Existing selector machinery reused unmodified (select_model is the single scoring system); no second selector. Additive only: errors.py (+1 error family), __init__.py exports, docs references.
  • #91 — M06 Stage 1 evidence only (m06/codex-stage1 @ bc541e5, merged in cdec00b): docs/codex-adapter-stage1-evidence.md (official App Server protocol verification against rust-v0.155.1 schemas + sanitized local probes on codex-cli 0.154.0-alpha.6.2) and the U-012 Stage-1 status block in docs/decisions.md. Stage 2 remains open/deferred (Forgejo dependency edges: A0 #85, M05). Issue #91 must not be closed by this PR.
  • #92 — M07 Stage 1 evidence only (m07/zcode-stage1 @ 1ce0c00, merged in 1b8db98): docs/zcode-adapter-stage1-evidence.md and the U-013 Stage-1 status block. Stage 1 bottom line: NO-GO for a supported ZCode execution adapter as of 2026-09-19 — no official stable headless path exists; Stage 2 remains open/deferred and is not recommended absent vendor consent. Issue #92 must not be closed by this PR.

Independent review record

Each workstream was reviewed by a fresh independent GLM-5.3 (maximum reasoning effort) session that inspected the actual diffs and re-verified evidence (URL fetches, protocol-source checks, local bundle re-probes, test re-runs) — not the implementers' summaries. Verdicts: #87 APPROVE · #91 APPROVE · #92 APPROVE, zero blocking findings; make check and git diff --check were additionally run deterministically by the review harness per branch.

Non-blocking reviewer notes carried for the owner (none block merge):

  • Codex evidence doc: CODEX_NON_INTERACTIVE=1 is documented in the official installer script rather than the quickstart page (two line references); minor prerelease-count and model-slug imprecision.
  • ZCode evidence doc: night-Flash promotion should cite D-035's owner-provided campaign text rather than two vendor pages; Context limits: PASS is provider-documented, not surface-tested (surface fails closed regardless); OpenAI/Anthropic-compatible endpoints verified at docs.z.ai/devpack/tool/others.
  • M02: docstring/behavior wording gaps in routing_core.py (canonical-identity ordering for variant-less resources, promotion-scope semantics, metered-cost edge, unroutable_identities phrasing, future-validity promotions); U-012/U-013 status-line phrasing asymmetry.

Integration audit

Independent cross-workstream audit (GLM-5.3 max): PASS — M02 assumes no capability contradicted by M06/M07 evidence (all UNKNOWN/UNSUPPORTED cells fail closed; no ZCode/Codex routability assumed); research branches modified no runtime code; no duplicate/contradictory decision entries (U-012/U-013 each appear once, additive only); no Stage-2 leak; recommendation-only modules byte-identical to baseline; M01 resource_state.py unchanged; documentation keeps implemented / evidenced / experimental / unknown / deferred distinct.

Validation on the combined branch (all green)

  • uv sync --only-dev — OK
  • make check — 1176 tests OK
  • uv run basedpyright — 0 errors, 0 warnings, 0 notes
  • git diff --check — clean
  • make package-check — OK (wheel/sdist build, artifact inspection, isolated install smoke)

No test requires personal credentials, live paid inference, private infrastructure or provider secrets; research probes remain documented research actions outside CI.

## Program slice: M02 (full) + M06 Stage 1 + M07 Stage 1 — three parallel workstreams, integrated **Baseline:** `383572249da2d629a1e2dc2d9bbaf1f2b1e505d2` (`develop` at program start; unchanged — verified by fetch at integration time). This branch contains three no-ff merges of independently reviewed task branches. No integration conflicts occurred; nothing here is merged to `develop` by this PR — it is left open for owner review. ### Contents - **#87 — M02 complete implementation** (`m02/routing-core` @ `7523eee`, merged in `648e3e3`): new pure, deterministic route-decision core `scarcity_router/routing_core.py` implementing the D-042 contract — frozen authorization precedence with narrowing-only layers, explicit-target pin semantics, five-dimension target separation (ModelIdentity, execution channel, entitlement, confirmed quota pools, routing profile), content-addressed `decision_id`, M01 `RegistrySnapshot` read-model consumption, D-039 typed eligibility gates, fail-closed stale/unknown/unhealthy state, `admit_pinned_target` admission-only binding, 49 new tests. Existing selector machinery reused unmodified (`select_model` is the single scoring system); no second selector. Additive only: `errors.py` (+1 error family), `__init__.py` exports, docs references. - **#91 — M06 Stage 1 evidence only** (`m06/codex-stage1` @ `bc541e5`, merged in `cdec00b`): `docs/codex-adapter-stage1-evidence.md` (official App Server protocol verification against `rust-v0.155.1` schemas + sanitized local probes on `codex-cli 0.154.0-alpha.6.2`) and the U-012 Stage-1 status block in `docs/decisions.md`. **Stage 2 remains open/deferred** (Forgejo dependency edges: A0 #85, M05). Issue #91 must **not** be closed by this PR. - **#92 — M07 Stage 1 evidence only** (`m07/zcode-stage1` @ `1ce0c00`, merged in `1b8db98`): `docs/zcode-adapter-stage1-evidence.md` and the U-013 Stage-1 status block. **Stage 1 bottom line: NO-GO for a supported ZCode execution adapter as of 2026-09-19** — no official stable headless path exists; Stage 2 remains open/deferred and is not recommended absent vendor consent. Issue #92 must **not** be closed by this PR. ### Independent review record Each workstream was reviewed by a fresh independent GLM-5.3 (maximum reasoning effort) session that inspected the actual diffs and re-verified evidence (URL fetches, protocol-source checks, local bundle re-probes, test re-runs) — not the implementers' summaries. Verdicts: **#87 APPROVE · #91 APPROVE · #92 APPROVE**, zero blocking findings; `make check` and `git diff --check` were additionally run deterministically by the review harness per branch. Non-blocking reviewer notes carried for the owner (none block merge): - Codex evidence doc: `CODEX_NON_INTERACTIVE=1` is documented in the official installer script rather than the quickstart page (two line references); minor prerelease-count and model-slug imprecision. - ZCode evidence doc: night-Flash promotion should cite D-035's owner-provided campaign text rather than two vendor pages; `Context limits: PASS` is provider-documented, not surface-tested (surface fails closed regardless); OpenAI/Anthropic-compatible endpoints verified at `docs.z.ai/devpack/tool/others`. - M02: docstring/behavior wording gaps in `routing_core.py` (canonical-identity ordering for variant-less resources, promotion-scope semantics, metered-cost edge, `unroutable_identities` phrasing, future-validity promotions); U-012/U-013 status-line phrasing asymmetry. ### Integration audit Independent cross-workstream audit (GLM-5.3 max): **PASS** — M02 assumes no capability contradicted by M06/M07 evidence (all UNKNOWN/UNSUPPORTED cells fail closed; no ZCode/Codex routability assumed); research branches modified no runtime code; no duplicate/contradictory decision entries (U-012/U-013 each appear once, additive only); no Stage-2 leak; recommendation-only modules byte-identical to baseline; M01 `resource_state.py` unchanged; documentation keeps implemented / evidenced / experimental / unknown / deferred distinct. ### Validation on the combined branch (all green) - `uv sync --only-dev` — OK - `make check` — 1176 tests OK - `uv run basedpyright` — 0 errors, 0 warnings, 0 notes - `git diff --check` — clean - `make package-check` — OK (wheel/sdist build, artifact inspection, isolated install smoke) No test requires personal credentials, live paid inference, private infrastructure or provider secrets; research probes remain documented research actions outside CI.
Record dated, versioned Stage 1 evidence for the Codex execution
adapter: official app-server/auth/installation documentation (retrieved
2026-09-19), rust-v0.155.1 protocol schemas and experimental gating,
local structural probes on codex-cli 0.154.0-alpha.6.2, draft
compatibility-matrix cells for M03, installation scenarios
(Desktop/CLI/VS Code/Windows/WSL), isolation and quota-scope findings
against D-044/D-039, and explicit not-tested items. Update U-012 with
per-bullet answered/narrowed statuses. No code, test, Makefile or CI
changes.
Pure, deterministic routing core that selects an authorized executable
target per D-042: typed authorization/profile/request layers, fail-closed
execution-surface gates over the M01 registry snapshot, typed D-043
compatibility-matrix cells, D-039 eligibility reports, shared quota-pool
and promotion-preference provenance, explicit pin semantics and the
admission-only recommendation-to-execution binding. The unmodified
balanced selector remains the single scoring system; adds no public
surface wiring.
Covers determinism and content-addressed decision ids, the five D-042
target dimensions, authorization non-expansion (administrator constraints,
client authorization, spending limits), fail-closed stale/never-observed/
unhealthy worker state, D-039 gating with absence-never-means-eligible,
tool-calling and context compatibility, shared quota pools, active and
expired promotions, honored and explicitly failing target/model/effort
pins, quota-never-raises-capability, explicit no-solution results and the
admission binding without re-ranking.
References the #87 implementation of the route-decision contract in the
A0 architecture section and the existing-file ownership table, and
documents the implemented routing semantics (gate stages, pin and
admission behavior, promotion and quota-pool provenance) in the selection
policy.
Merge M07 ZCode Stage 1 evidence (issue #92) into program integration branch
All checks were successful
ci / check (pull_request) Successful in 50s
1b8db98098
fix(m02): exact executable-target reference in pinned admission (issue #87)
All checks were successful
ci / check (pull_request) Successful in 53s
4c8b8cc52f
A resource without a variant qualifier binds several calibrated variants,
so the old resource_id-only PinnedTarget could be admitted as a different
variant than the route decision selected (the canonically first bound
identity) — silently changing a target dimension without re-ranking.

PinnedTarget now carries the exact selected ModelIdentity (provider,
model, variant) alongside resource_id; PinnedTarget.from_route_target /
from_route_target_dict convert a RouteDecision's selected target (typed or
serialized) into a valid pin without any target dimension supplied from
outside the decision. admit_pinned_target takes the typed pin, verifies
the pinned identity is one of the identities the resource currently binds
after the unchanged authorization/limits/availability/compatibility gates,
and approves exactly that resource and variant; a no-longer-bound identity
is an explicit typed rejection (pinned_model_not_bound) — never a
substitution, repair or re-ranking. decision_id remains audit provenance
only. Pre-release contract correction ordered by the owner; route-time pin
narrowing and every existing re-check semantic are unchanged.

Docs: architecture.md and selection-policy.md now state the exact
reference semantics; the canonically-first wording is gone.
adrian.tkacz deleted branch program/m02-m06-m07-parallel 2026-09-19 23:46:10 +00:00
Sign in to join this conversation.
No description provided.