Brings over the uncommitted agent-mei work (Mac checkout, Sep 22) plus box follow-ups (Oct 17: agent_mei action namespace in keymap/zed.rs, MEI_BRIDGE.md, RENAME_AGENT_MEI.md, unmetered receipts report 0 uJ). joule_core, JOULE_CODE_* and JouleDB names unchanged. *.bak.* scratch files excluded.
4.9 KiB
Findings — gap remediation (2026-06-14 audit → fixes)
Status of the audit's actionable gaps. Most are addressed; the rest are deferred with reasons. All fixes are committed with 76 panel tests green and the full agent-mei binary building.
P1 — undercuts the core "signed / accountable" claims
- ✅ Op author stamped. Every
CodingOpnow carries the session identity's verifying key as its author (build_coding_opgained anauthorparam;record_multi_edit/captured_opstampsession_key.verifying_key()), replacingauthor: [0u8;32]. Ops are signed by a principal, not anonymous. - ✅ L4 closes seal deterministically. The thread-event handler now matches
AcpThreadEvent::Stopped(_)(turn completion) and seals once, with alast_l4_op_idde-dup guard — no partial/duplicate ops, no lost close. An L4 turn that edits files reliably produces exactly one ledger op + L0 entry, like L0–L3. - ✅
let _ =discards fixed.adopt_from_file,cite_op, spec/ops persistence writes,record_primary_op, sessionset_status/mark_verified, and therelease.jsonwrite now.log_err()per the repo's CLAUDE.md rule.
P2 — real semantic limits
- ✅ L0 keyed on buffer precondition. Every request captures the active buffer's content-id (
pending_prior); the L0 lookup and every close's cache insert use it, andLedgerEntrycarries aserde(default) precondfor cross-session correctness. A cached edit replays only when the same intent meets the same buffer state. New test:l0_precondition_differentiates_buffer_state. - ✅ Session grant enforced. When a background session is active,
authorize_tierchecks the session's (attenuated) grant names the tier and the session is under its own joule ceiling, before the global gate. A delegate that holds only{l0,l1,l2}can no longer reach L3/L4 — delegate-only-what-you-hold, enforced not just declared. - ✅ Ship door — already resolved in the session arc:
certify_releaseuses the live frame-backedcontract_discharged() = !frame.is_empty() && contract_ok, no hardcodedfalse. - ✅ PostTool / SessionEnd hooks fired.
note_closefires PostTool on every tier close;close_sessionfires SessionEnd before teardown. Observe-only (no-op when no hook registered) — the points are now live and extensible. - ✅ "No energy counter" distinct from 0 J. Render shows
⚠ no host energy counter — figures are estimateswhen absent; controlstatereportsenergy_counter: bool. (L4 op energy remains token-estimated, as honestly tagged.)
P3 — hygiene
- ✅
JOULE_CODE.mdcorrected — the stale "path dependencies" description now reflects the actual pinned git deps onTransaction-Science/open-standards. - ✅ Gutting warnings cleared — removed 8 unused imports (
main.rs,zed.rs,remote_connection.rs),_-prefixed two unused vars, and#[allow(dead_code)]'d the kept-for-compattitle_bar.show_sign_in. Binary builds with noagent-meiwarnings. - ⏸
visual-testsfeature left as-is — itsvisual_test_runner.rsis deeply tied to the removedagent_ui/AgentPanel(a test harness for the deleted native agent). Repair = large rewrite, removal = build-config change; dev-only, off the shipped path. Documented, not bulldozed. - ✅ Namespace test fixed —
test_action_namespaceswas actually red: it lacked the newagent_meinamespace and still listedskill_creator+inline_assistant(removed crates). Addedagent_mei, dropped the two dead ones; test green. (agents_sidebarstays — still a livezed_actionsnamespace.) - ⏸ Two near-identical MCP stdio clients — optional refactor, not a correctness issue.
- ⏸
joulecontract-schemanear-vestigial — revisit when per-op contract discharge lands.
CI blind spot (model layer) — ✅ killed
The on-device-model plumbing is now CI-tested with no download and no #[ignore]: two tests build a complete tiny synthetic llama (random weights, embedded vocab) via jouleclaw's public synthetic::synthesize_llama_gguf, write it to a temp .gguf, and load it through the real load_l3_model path —
synthetic_model_loads_generates_and_embeds:l3_generateruns end to end and is deterministic;l3_embedreturns a 16-dim L2-normalized vector.synthetic_model_powers_codebase_index: builds a real index over a small repo with the synthetic embedder and gets ranked search hits.
These assert the pipeline runs (load → generate → embed → retrieve), not edit quality (a 16-dim random model writes nonsense). The five #[ignore]'d real-model tests remain as the quality probes (manual, JOULE_CODE_TEST_MODEL). 78 panel tests green.
Net: all P1 and all actionable P2 items are fixed and tested. The deferred items are P3 hygiene in upstream/David-owned files, optional refactors, or CI-infra — none affect the correctness of the accountability story, which is the audit's core concern.