Repository navigation
fix: close audit-gap findings from roadmap/code reasoning audit - #60
Merged
Merged
Conversation
Four fixes from the full reasoning audit of roadmap, architecture, and code: - run_dpo now accepts service_client/training_client/close_clients so a meta-recipe can run SFT -> DPO -> export on the SAME LoRA adapter instead of silently training DPO on a fresh one. meta_runners._run_dpo wires the shared client through; new test asserts one adapter id across stages. - Audit log now persists to a JSONL sink by default (~/.anvil/audit.jsonl, override ANVIL_AUDIT_LOG) and replays prior events on startup, so the "audited force" trail survives process restarts. Tests isolate the sink via a temp path + reset_default_log(). - run_sft/run_dpo export now honors the recipe's export_hint (e.g. onnx for edge students) via resolve_export_format() instead of always exporting PEFT. - Web app version is single-sourced from anvil.__version__ (was stale 0.0.1). - Fix broken docs/cluster.md reference in serve docstring (-> org-self-host.md). - Remove dead branch in agent/decide.py step_rows. 266 passed, 3 skipped; ruff clean.
Adds the agent identity line to the session-entry files, as set by the AIOps LLM (2026-08-01).
- run_sft / run_dpo now tested to export the recipe's export_hint (onnx produces an edge bundle with edge_manifest.json) instead of always PEFT. - Web app version asserted to equal anvil.__version__ (guards against a regression to a hardcoded string). 269 passed, 3 skipped; ruff clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the four findings from the full reasoning audit of the roadmap, architecture, and code (plus two small cleanups). All changes are behavior-preserving except where a bug was being fixed.
Changes
1.
run_dposhared-client gap (correctness bug)run_sft,run_vlm_sft, andrun_grpoall acceptservice_client=/training_client=/close_clients=so a meta-recipe can run SFT → DPO → export on the same LoRA adapter.run_dpodid not — it always created and closed its own client, so a meta-recipe with an SFT stage followed by a DPO stage silently trained DPO on a fresh adapter, discarding the SFT result.service_client/training_client/close_clientsparams torun_dpo(mirroringrun_sft).meta_runners._run_dpoto reuse the shared SFT client.test_default_runners_sft_then_dpo_shares_adapterasserts one adapter id across both stages.2. Audit log now persists across restarts
anvil/control/audit.pykept the audit trail in-memory only, so a process restart lost the entire history — undermining the "audited force" promise.~/.anvil/audit.jsonl(overrideANVIL_AUDIT_LOG).AuditEvent.from_public+_load).default_log()+reset_default_log()so tests isolate the sink.3.
export_hintis now honoredrun_sft/run_dpohad a no-opformat=plan.export_hint if ... == "peft" else "peft"that always exported PEFT, ignoring the recipe's edge intent (e.g.onnxfor edge students). Addedresolve_export_format()and used it in both runners.test_run_sft_honors_export_hint/test_run_dpo_honors_export_hintassert anonnxhint produces an edge bundle (edge_manifest.json).4. Version single-sourcing
anvil/web/app.pyhad a stale hardcodedversion="0.0.1"; now readsanvil.__version__(0.0.2).test_app_version_matches_packageguards against a hardcoded-string regression.5. Cleanups
docs/cluster.mdreference inserve/app.pydocstring →docs/org-self-host.md.elif t == "step"branch inagent/decide.pystep_rows.6. Agent identity naming
Agents.mdandstart.md(set by the AIOps LLM, 2026-08-01).Verification
269 passed, 3 skipped(was 263 baseline — 6 new tests).ruff check anvil/ tests/clean.