Add KV/tool-loop stability certification harness - #676
Conversation
|
Very nice. Can we get an agent skill for this too please? |
i386
left a comment
There was a problem hiding this comment.
Codex review comments below.
52a8544 to
c3d3362
Compare
|
I pushed a focused follow-up for the review notes here. The harness now checkpoints I added a repo-local agent skill for this too: Local validation passed, and the updated PR checks are green on the new head. 🙂 |
Validation * Validation tier: Tier 4 - post-review verification tooling correction for PR Mesh-LLM#676; cache certification now validates response correctness and native-log checkpoint scans preserve physical file line numbers. * git fetch --no-tags origin main:refs/remotes/origin/main: PASS, origin/main at d50a468. * git rebase origin/main: PASS. * git diff --check: PASS, no output * git diff --cached --check: PASS, no output * python3 -m unittest scripts.tests.test_qa_kv_tool_loop_stability: PASS, 16 passed * python3 -m py_compile scripts/qa-kv-tool-loop-stability.py scripts/tests/test_qa_kv_tool_loop_stability.py: PASS * python3 scripts/qa-kv-tool-loop-stability.py --models auto,mesh --attempts 1 --pressure-turns 2 --timeout 30 --min-cached-tokens 128 --suffix-prefill-limit 64 --output-dir target/kv-tool-loop-stability/review-smoke --print-plan > /tmp/kv-tool-loop-plan.json && python3 -m json.tool /tmp/kv-tool-loop-plan.json >/dev/null: PASS * Ledger: not applicable - not required for selected validation tier/change family. * Version: not applicable - verification tooling/skill correction only; no release/version sync required. * Not run: live KV/tool-loop endpoint certification - not required for this review correction; deterministic unit coverage proves the changed harness branches. Rollback * git revert HEAD
c3d3362 to
affa268
Compare
Validation * Validation tier: Tier 4 - post-review verification tooling correction for PR Mesh-LLM#676; cache certification now validates response correctness and native-log checkpoint scans preserve physical file line numbers. * git fetch --no-tags origin main:refs/remotes/origin/main: PASS, origin/main at d50a468. * git rebase origin/main: PASS. * git diff --check: PASS, no output * git diff --cached --check: PASS, no output * python3 -m unittest scripts.tests.test_qa_kv_tool_loop_stability: PASS, 16 passed * python3 -m py_compile scripts/qa-kv-tool-loop-stability.py scripts/tests/test_qa_kv_tool_loop_stability.py: PASS * python3 scripts/qa-kv-tool-loop-stability.py --models auto,mesh --attempts 1 --pressure-turns 2 --timeout 30 --min-cached-tokens 128 --suffix-prefill-limit 64 --output-dir target/kv-tool-loop-stability/review-smoke --print-plan > /tmp/kv-tool-loop-plan.json && python3 -m json.tool /tmp/kv-tool-loop-plan.json >/dev/null: PASS * Ledger: not applicable - not required for selected validation tier/change family. * Version: not applicable - verification tooling/skill correction only; no release/version sync required. * Not run: live KV/tool-loop endpoint certification - not required for this review correction; deterministic unit coverage proves the changed harness branches. Rollback * git revert HEAD
affa268 to
da50b6f
Compare
Validation * Validation tier: Tier 4 - verification tooling and testing documentation for KV/tool-loop stability certification; no runtime, protocol, workflow, or CI gate change. * git fetch --no-tags origin main:refs/remotes/origin/main: PASS, origin/main at eed444d. * git diff --check: PASS, no output * git diff --cached --check: PASS, no output * python3 -m unittest scripts.tests.test_qa_kv_tool_loop_stability: PASS, 6 passed * python3 -m unittest discover -s scripts/tests: PASS, 24 passed * python3 -m py_compile scripts/qa-kv-tool-loop-stability.py scripts/tests/test_qa_kv_tool_loop_stability.py: PASS * python3 scripts/qa-kv-tool-loop-stability.py --print-plan --models Qwen/Qwen2.5-3B-Instruct-GGUF:q4_k_m --attempts 2 --native-log /tmp/skippy-native.log --output-dir target/kv-tool-loop-stability/local >/tmp/mesh-kv-tool-loop-plan.json && python3 -m json.tool /tmp/mesh-kv-tool-loop-plan.json >/dev/null: PASS * Ledger: not applicable - not required for selected validation tier/change family. * Version: not applicable - verification tooling/docs only; no release/version sync required. * Not run: cargo check/tests - not required for selected validation tier; no Rust/runtime code changed. * Not run: live direct-model Skippy certification run - no local loaded direct-model endpoint was available; the PR adds the reproducible harness and local unit/plan proof. Rollback * git revert HEAD
Validation * Validation tier: Tier 4 - post-review verification tooling/docs correction for KV/tool-loop stability certification; no runtime, protocol, workflow, or CI gate change. * git fetch --no-tags origin main:refs/remotes/origin/main: PASS, origin/main at cedf9b6. * git rebase origin/main: PASS * git diff --check origin/main...HEAD: PASS, no output * git diff --check: PASS, no output * git diff --cached --check: PASS, no output * python3 -m unittest scripts.tests.test_qa_kv_tool_loop_stability: PASS, 14 passed * python3 -m unittest discover -s scripts/tests: PASS, 34 passed * python3 -m py_compile scripts/qa-kv-tool-loop-stability.py scripts/tests/test_qa_kv_tool_loop_stability.py: PASS * mkdir -p target/kv-tool-loop-stability && python3 scripts/qa-kv-tool-loop-stability.py --print-plan --models Qwen/Qwen2.5-3B-Instruct-GGUF:q4_k_m --attempts 2 --pressure-turns 8 --suffix-prefill-limit 256 --timeout 90 --native-log /tmp/skippy-native.log --output-dir target/kv-tool-loop-stability/local > target/kv-tool-loop-stability/plan.json && python3 -m json.tool target/kv-tool-loop-stability/plan.json >/dev/null: PASS * Ledger: not applicable - not required for selected validation tier/change family. * Version: not applicable - verification tooling/docs only; no release/version sync required. * Not run: cargo check/tests - not required for selected validation tier; no Rust/runtime code changed. * Not run: live direct-model Skippy certification run - no local loaded direct-model endpoint was available; this change hardens harness evidence repeatability and plan metadata. Rollback * git revert HEAD
Validation * Validation tier: Tier 4 - post-review verification tooling correction for PR Mesh-LLM#676; cache certification now validates response correctness and native-log checkpoint scans preserve physical file line numbers. * git fetch --no-tags origin main:refs/remotes/origin/main: PASS, origin/main at d50a468. * git rebase origin/main: PASS. * git diff --check: PASS, no output * git diff --cached --check: PASS, no output * python3 -m unittest scripts.tests.test_qa_kv_tool_loop_stability: PASS, 16 passed * python3 -m py_compile scripts/qa-kv-tool-loop-stability.py scripts/tests/test_qa_kv_tool_loop_stability.py: PASS * python3 scripts/qa-kv-tool-loop-stability.py --models auto,mesh --attempts 1 --pressure-turns 2 --timeout 30 --min-cached-tokens 128 --suffix-prefill-limit 64 --output-dir target/kv-tool-loop-stability/review-smoke --print-plan > /tmp/kv-tool-loop-plan.json && python3 -m json.tool /tmp/kv-tool-loop-plan.json >/dev/null: PASS * Ledger: not applicable - not required for selected validation tier/change family. * Version: not applicable - verification tooling/skill correction only; no release/version sync required. * Not run: live KV/tool-loop endpoint certification - not required for this review correction; deterministic unit coverage proves the changed harness branches. Rollback * git revert HEAD
da50b6f to
b6831e3
Compare
Summary
Adds a standalone KV/tool-loop stability certification harness for live OpenAI-compatible mesh endpoints.
The harness exercises the specific failure shape from recent Skippy KV/tool-loop work: repeated non-streaming tool-result continuations against a long stable prefix, same-prefix/different-tail cache reuse, exact-prefix cache reuse, and optional Skippy native-log scanning for fatal KV/decode signals.
Why
The broad nightly stability harness is useful for trend and endpoint health, but it does not give a focused lab proof for the KV/cache failure modes behind repeated agent tool loops. This PR adds a narrow certification tool maintainers can run against a real direct-model Skippy endpoint before relying on Goose, Pi, OpenCode, or release-candidate agent workloads.
The target regressions are concrete:
llama_decode failed,failed to find a memory slot, unexpectedly lowusage.prompt_tokens_details.cached_tokenson same-prefix/different-tail prompts, proactive eviction errors in native logs, and cached responses that report good cache metrics while returning the wrong completion.Diff scope
scripts/qa-kv-tool-loop-stability.py, a stdlib-only importable CLI probe with--print-plansupport.same_prefix_cacheandexact_prefix_cachechecks using OpenAI usage cache metrics.cached_tokenscannot hide an incorrect cached answer.--native-logscanning for slot exhaustion, decode failures, and proactive eviction errors appended after the certification starts.manifest.json,results.jsonl,summary.json,summary.md, and sanitized transcript JSONL.transcripts/at run start so repeatedlatestruns do not mix stale attempt records into fresh evidence.--print-plan/manifest.json:pressure_turns,timeout_seconds,suffix_prefill_limit, and native-log scan mode..agents/skills/kv-tool-loop-stability/SKILL.md.docs/design/TESTING.md.How to run
--print-planis side-effect-free and emits the exact checks, models, thresholds, runtime options, native-log scan mode, and evidence files before running a live endpoint.Compatibility
Verification tooling and docs only. No runtime behavior, protobuf, gossip, mesh protocol, Skippy ABI, workflow, or required CI gate changes.
This intentionally avoids workflow YAML so it does not collide with active CI optimization work and remains a lab/release-confidence check rather than a new PR blocker.
Branch integrity
mainorigin/main@d50a46830 behind / 3 aheadaffa268fb3652711f0e7dbba0041d142ae006efaValidation
git fetch --no-tags origin main:refs/remotes/origin/main: PASS,origin/mainatd50a4683.git rebase origin/main: PASSgit diff --check origin/main...HEAD: PASS, no outputgit diff --check: PASS, no outputgit diff --cached --check: PASS, no outputpython3 -m unittest scripts.tests.test_qa_kv_tool_loop_stability: PASS, 16 passedpython3 -m unittest discover -s scripts/tests: PASS, 36 passedpython3 -m py_compile scripts/qa-kv-tool-loop-stability.py scripts/tests/test_qa_kv_tool_loop_stability.py: PASSpython3 scripts/qa-kv-tool-loop-stability.py --models auto,mesh --attempts 1 --pressure-turns 2 --timeout 30 --min-cached-tokens 128 --suffix-prefill-limit 64 --output-dir target/kv-tool-loop-stability/review-smoke --print-plan > /tmp/kv-tool-loop-plan.json && python3 -m json.tool /tmp/kv-tool-loop-plan.json >/dev/null: PASSaffa268fb3652711f0e7dbba0041d142ae006efa: PASS forchangesand PR Qualitysummary; Rust/build/live-smoke contexts were skipped by workflow path selection for this scripts/docs-only update.Review status
Pending reviewer re-review after the earlier
CHANGES_REQUESTEDreview. All known actionable review comments have code/test coverage in the updated head.Rollback
Revert this PR.
DB downgrade: not applicable.
Data repair: not applicable.
Operational caveats: none known.
Known residual risks
The live certification should still be run by a maintainer or lab host with the affected direct-model Skippy endpoint and native log path available. Local validation proves the harness behavior, evidence contract, side-effect-free plan output, and post-review evidence repeatability; it does not claim a specific live model endpoint is now stable.