fix T1+T4: wire rollback into pipeline; real Ollama telemetry in metrics

T1 (H7): casan-step.mjs now calls rollback-manager.sh checkpoint before
overwriting plan.md at attempt-2, writes tx-id to plan.checkpoint.txid
sidecar, and executes rollback on REJECTED verdict. rollback-transactions.jsonl
records a real cp restore command. Adversarial test: checkpoint exists,
real cp command recorded, plan hash matches pre-overwrite content.

T4 (H6): casan-harness.sh exports CASAN_STEP_NAME=$ACTION_NAME before
agent-metrics.sh so nested model calls (model-call.py) and the provider-
cost-lookup.py query share the same step label. metrics.jsonl now writes
cost_source=provider_telemetry instead of word_count_estimate when a real
Ollama call is made within the same step. Adversarial test: verified with
CASAN_STEP_NAME=t4-telemetry-test end-to-end.

adversarial-harness-tests.sh: 40 → 44 PASS / 0 FAIL (+3 T1, +1 T4)
security-gate.sh: PASS=10 FAIL=0 SKIP=0 (verified, local ornith:9b)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
thanhnv
2026-07-01 11:25:50 +09:00
co-authored by Claude Sonnet 4.6
parent f74a5b6e42
commit a8edbea534
18 changed files with 284 additions and 159 deletions
@@ -1,3 +1,3 @@
{"timestamp":"2026-07-01T02:01:47Z","trace_id":"70994980-8445-4cb5-8b45-3fefec9a5bba","harness":"L5-model-fallback","primary_exit":9,"route":"fallback","final_exit":0,"output":"/Users/thanhnguyen/Documents/AI/HarnessHkt/Harness_Hakathon/Output_CASAN5_REFINED/AINative_OKR_CASAN5/docs/output/casan/level5-evidence/10-fallback-output.txt"}
{"timestamp":"2026-07-01T02:01:57Z","trace_id":"75dc3933-d816-4736-bf02-ada32695a9f7","harness":"L5-model-fallback","primary_exit":1,"route":"fallback","final_exit":0,"output":"/var/folders/zn/qn8sqwzn18g34ddftsxgyz6r0000gn/T/tmp.LSvLCBzKPC/fb.out"}
{"timestamp":"2026-07-01T02:02:21Z","trace_id":"17747d7b-ed19-4931-a291-80b015ed9131","harness":"L5-model-fallback","primary_exit":2,"route":"fallback","final_exit":0,"output":"/var/folders/zn/qn8sqwzn18g34ddftsxgyz6r0000gn/T/tmp.m33WrEl1XL/fb.out"}
{"timestamp":"2026-07-01T02:23:41Z","trace_id":"bc96150d-082c-4638-86fa-f900ed74acfe","harness":"L5-model-fallback","primary_exit":9,"route":"fallback","final_exit":0,"output":"/Users/thanhnguyen/Documents/AI/HarnessHkt/Harness_Hakathon/Output_CASAN5_REFINED/AINative_OKR_CASAN5/docs/output/casan/level5-evidence/10-fallback-output.txt"}
{"timestamp":"2026-07-01T02:23:51Z","trace_id":"376b5739-6b9e-4c35-9d7a-b076782941e8","harness":"L5-model-fallback","primary_exit":1,"route":"fallback","final_exit":0,"output":"/var/folders/zn/qn8sqwzn18g34ddftsxgyz6r0000gn/T/tmp.ob79Fqjaev/fb.out"}
{"timestamp":"2026-07-01T02:24:10Z","trace_id":"1c8577ef-d844-463a-b2aa-b474fb0144e4","harness":"L5-model-fallback","primary_exit":2,"route":"fallback","final_exit":0,"output":"/var/folders/zn/qn8sqwzn18g34ddftsxgyz6r0000gn/T/tmp.7PmeKM5Blp/fb.out"}