Repository navigation
docs: specify calc evidence contracts and freeze its hash layouts (#211) - #226
Draft
shunsuke-shimomura wants to merge 3 commits into
Draft
shunsuke-shimomura wants to merge 3 commits into
shunsuke-shimomura wants to merge 3 commits into
Conversation
shunsuke-shimomura
marked this pull request as draft
November 9, 2026 02:30
This was referenced Nov 9, 2026
shunsuke-shimomura
force-pushed
the
docs/211-calc-evidence
branch
from
November 10, 2026 00:50
4c0882c to
527fa74
Compare
Add the calc evidence design document (en/ja) and the calc-evidence-v1 JSON Schema, rename the `veriq:` bind property to `calc:` across the specs, describe the filled assumption slot and the implicit assumption dependency, and record the settled open question. Freeze the layouts with golden vectors: the calc-evidence interface hash (new `tests/golden/hash/calc-evidence-v1/`) and a bind view hash with a non-empty assumption slot. inka-core gains the minimal code that replays them: `calc_evidence::interface_hash` and the assumption parameter on `LocalView::bind`. Callers still pass an empty slot; wiring the evidence in is #208/#209. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…d-only Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… and input errors - `kind` is veriq's three node kinds; the contract is veriq-shaped, not producer-neutral - a rename leaves the assumption slot alone but changes a veriq source that names the ID - `@vq.assume` targets are upstream: their sources and assumptions enter the dependent target - list the input errors, and pin "whitespace" to Unicode White_Space in the doc and the schema - a test bind's assumption list is empty, not "currently" empty
shunsuke-shimomura
force-pushed
the
docs/211-calc-evidence
branch
from
November 10, 2026 03:55
527fa74 to
1d4e228
Compare
Member
Author
Review follow-up (2026-11-10)Rebased onto
Nothing from the review is left open on this PR. |
This branch has not been deployed
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.
Description
Closes #211 (parent: #40).
docs/{en,ja}/design/calc-evidence.md: responsibility boundary (producer adapter → capsula → inka, offline, Rust never parses Python), the evidence JSON, assumptions declared in producer node metadata (metadata={"inka": {"assumes": [...]}}) and unioned over the definition-level upstream subgraph, the interface hash preimage, the filled bind assumption slot, assumptions as implicit dependencies, load-time structure withcheckerrors (unknown assumption ID, cycle through assumption edges), the pass condition (all leavestrue∧valid∧ ¬xfail), approval snapshots atapprovals/snapshots/<view_hash>.jsonand the assumption-set diff, capsula delivery, and bind evaluation tables in the style oftest-evidence.md.schemas/calc-evidence-v1.schema.json: per targetpath,definitions[{path, kind, source}],assumes[](fully-qualified inka IDs),leaves[{id, result}],valid,xfail; file-levelprovenanceas for test evidence.veriq:→calc:inspec.mdandformatting.md;calc:references are producer paths (veriq:Scope::?name);[evidence] tests/calcsininka.toml; the bind hash's assumption slot holds the assumed nodes' normalized descriptions sorted bytewise;establishedfor a bind additionally requires every assumed node established; blame gains "unestablished assumption"; a "Calc evidence provider" section.full-plan.mditem 7 rewritten (no AST normalization; the argument is the registry). The open question "veriq contract-hash scope" is removed as settled, and the graphcal item now points at calc evidence.tests/golden/hash/calc-evidence-v1/(minimal, upstream-sorted, CRLF-only normalization, non-ASCII) andtests/golden/hash/v1/bind-assumptions.toml(a bind with a non-empty assumption slot, listed unsorted and un-normalized). Existing vectors are untouched.calc_evidence::interface_hash(target, definitions, leaf_ids)under domain taginka:calc-evidence:v1;LocalView::bindtakes the assumptions, normalizes and sorts them into the slot.LocalView::of_nodeand the two existing callers pass an empty slot, so no runtime behaviour changes; the wiring is calc evidence: load-time consumption, interface hash and assumption edges in check #208/calc evidence: evaluate calc binds and fill the bind hash's assumption slot #209.Confirmed design decisions are listed in #211; this PR is where they become the source of truth.
Test results
cargo test -p inka-core: all pass, including the newcalc_evidencereplay test and the extendedgoldentest (every_recorded_vector_still_hashes_to_its_recorded_valuenow also replaysbind-assumptions.toml).cargo test --workspace: all pass exceptinka-evidence-rust/tests/adapter.rs, which requirescargo-nextestand is not installed in my environment (fails with "these tests need cargo-nextest"); unrelated to this change.field/list/entriesframing) and match the recorded digests.jsonschema(Draft 2020-12): the documentation example validates; emptydefinitions, an assumption ID with whitespace, duplicateassumes, a missingvalidandv: 2are rejected.cargo fmt --check,cargo clippy --workspace --all-targets: clean.prek(typos, markdownlint-cli2, tombi, json/toml checks) passes on the changed files.Impact
LocalView::bindgains a fourth parameter (two callers updated);view_hashoutput is unchanged for an empty slot, as the frozenbind-evidence.tomlvector confirms.calc:while the implementation still parsesveriq:; the rename is calc evidence: rename the veriq: bind property to calc: with Scope::?name references #205, following the precedent of theci:→test:spec-first migration (Test evidence: responsibility boundary and evidence contract #65).tests/goldenonly gains files.Supplementary information
calc:format check is specified generically (non-empty, single line, no whitespace) rather than as a veriq-specificScope::?namegrammar, to keep the evidence kind producer-independent (graphcal, Consider supporting graphcal as an input language #44). I will adjust the wording of calc evidence: rename the veriq: bind property to calc: with Scope::?name references #205 accordingly.kindon a definition is presentation metadata and does not enter the interface hash; the path sigil already distinguishes veriq definitions, and a second producer may not have kinds.🤖 Generated with Claude Code