feat(receipts): tool-execution receipts + epistemic-source classification (#251) - #254
Merged
Conversation
tcconnally
force-pushed
the
feat/251-spec
branch
from
August 16, 2026 14:32
3875f0e to
3052976
Compare
tcconnally
force-pushed
the
feat/251-spec
branch
from
August 16, 2026 14:34
3052976 to
77581ed
Compare
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
Implements #251: tool-execution receipts + epistemic-source classification (arXiv:2603.10060, NabaOS — "Tool Receipts, Not Zero-Knowledge Proofs"). Runtime-issued, HMAC-signed receipts per tool call (unforgeable by the model), a pramāṇa epistemic classifier, and a claim cross-check engine that flags fabricated executions, count misstatements, and false-absence claims. Extends the #235 evidence-level ladder and #224 external-artifact bindings with a receipt cross-check layer.
What changed
ledger_agent/tool_receipts.py—build_tool_receipt/verify_tool_receipt(HMAC-SHA256 over id|tool_name|input_hash|output_hash|result_count|facts|timestamp, per the paper's field order; key resolution reuses the feat(receipts): evidence levels — separate signature authenticity from durable inclusion #235 key_registry path), a session-scopedToolReceiptLedgerwith completeness (omitted-call) detection, pramāṇa classification (pratyakṣa/anumāna/upamāna/śabda/abhāva/ungrounded), six hallucination-type flags, five trust levels, and markdown epistemic-label rendering.receipt_to_evidence_hash()bridges tool receipts intoevidence_hashes.benchmark/nyaya_verify_bench.py— deterministic 1,800-scenario NyayaVerifyBench adaptation (4 languages × 6 hallucination types × 50 + 150 clean) with per-type detection rates, false-positive rate, and verification-overhead measurement; fails the run below the issue's 90% / 20ms gates.docs/tool-receipts.md— receipt spec, pramāṇa table, 6-stage protocol, threat model, measured benchmark numbers vs the paper's 94.2% / <15ms, and the receipts-over-ZK cost argument (zkLLM ~180s/query vs receipts <20ms).tests/test_tool_receipts.py— signature/tamper/forgery coverage, all six hallucination types, completeness, trust levels, benchmark-generator determinism.Success criteria (#251)
Closes #251