core/docs/workbench/phase-a-residue-ledger.md
Shay 471131cabf feat(b4): engine-side leeway producer — populate LeewayEvidence (Wave M B4)
Clears the long-standing B4 block: the leeway decision was already made on the
serving path (chat/runtime.py::_surface_estimate has a real LicenseDecision +
the ReachPolicy) and then DISCARDED — never threaded to the result, and the
workbench can't import reliability_gate. This wires it through.

Producer (observational, never authorizing):
  - core/cognition/leeway.py: LeewayRecord + build_leeway_record(reach_level,
    license_decision) — duck-typed on the decision, zero new cross-package
    coupling. Maps to: no decision -> "unknown" (STRICT, no latitude); denied
    -> "blocked" (gate consulted, said no); licensed SERVE/PROPOSE widening ->
    the real class / theta / "[approximate]" disclosure. "verified" is never
    emitted (RESERVED state). source_digest content-addresses the decision
    (deterministic, no wall-clock).
  - core/cognition/result.py: additive `leeway: LeewayRecord | None = None` on
    CognitiveTurnResult.
  - core/cognition/pipeline.py: build it at result construction from the data
    the runtime ALREADY exposes (response.reach_level +
    runtime.last_turn_accrual().license). chat/runtime.py is UNTOUCHED.
  - workbench/api.py: _leeway_evidence_from_result maps result.leeway ->
    LeewayEvidence (pure projection; no reliability_gate import — firewall
    intact). The journal already persists it; the B4a UI (Replay / Proposals /
    RightInspector) already renders it — no frontend or schema change needed.

Safety (this touches the serving path, so proven, not asserted):
  - trace_hash is a NAMED-field hash (core/cognition/trace.py); `leeway` is not
    in it -> byte-identical serving. All provenance/trace tests pass.
  - response_governance STRICT stays byte-identical (375 governance/serving/
    provenance tests green, incl. the live-wiring + estimation-lane + ADR-0206
    seam tests).
  - core eval cognition: 13 cases, 100% intent / groundedness / versor closure.
  - replay determinism holds (leeway is in CRITICAL_FIELDS; deterministic).

Tests: engine (build_leeway_record: strict/blocked/SERVE/PROPOSE, no "verified",
deterministic digest) + workbench mapping (field-for-field, honest absence,
invalid-enum clamp) + integration (a real turn now carries an honest leeway
record, not the null "No evidence recorded"). 151 workbench/leeway Python + 68
frontend (leeway/replay/proposals/schemaDrift) green; schema-snapshot unchanged.

Docs: gate cleared (b4-leeway-feasibility-gate.md), residue ledger flipped to
implemented, scope brief is b4-leeway-producer-scope-2026-06-13.md.
2026-06-13 20:22:39 -07:00

2 KiB

Wave M B3.5-e — Phase A Residue Ledger

Date: 2026-06-13 Status: active consolidation ledger

Item Status Reason Next PR
Density preferences implemented Settings owns a comfortable / compact mode; Shell publishes data-density, and shared chrome/primitives consume density variables for shell, panel, row, nav, footer, metadata, and button spacing. None.
Command palette route drift implemented Navigate commands derive from WORKBENCH_ROUTES; Demos and Calibration are palette-visible. None.
Landing route drift implemented Landing route ids derive from WORKBENCH_ROUTES; Replay and Calibration are eligible. None.
Deterministic DAG consumers beyond proposal chain implemented Demo runs now expose backend-projected DemoEvidenceDag records for all PCCP proof-promotion scenarios and deductive-entailment traces, rendered by Demo Theater with the shared deterministic DAG primitive. None.
Calibration evidence subject implemented calibration_class is addressable via /calibration?inspect=calibration:<className> and renders in RightInspector/EvidenceChainRail. None.
UI/UX guide implemented docs/workbench/UI-UX-GUIDE.md now records the current 12-route map, evidence grammar, route proofs, and absences. Keep updated when route registry changes.
Route registry implemented workbench-ui/src/app/routes.ts is the route source for App, LeftNav, palette, shortcuts, landing prefs, and route tests. None.
B4 source tuple implemented Engine producer landed (2026-06-13): core/cognition/leeway.py emits an observational LeewayRecord on the turn result from the reach-policy + LicenseDecision the response path already computes; workbench/api.py maps it to LeewayEvidence across the read-only firewall. Every turn now carries an honest record; the existing B4a UI renders it. — (follow-up: a SERVE-licensed fixture to exercise the earned-APPROXIMATE path end-to-end).