Repository navigation
feat(core): evaluate calc binds and fill the bind hash's assumption slot - #242
Draft
shunsuke-shimomura wants to merge 1 commit into
Draft
shunsuke-shimomura wants to merge 1 commit into
shunsuke-shimomura wants to merge 1 commit into
Conversation
…lot (#209) A calc bind is now judged like a test bind, with the imported target as its evidence: its view hash folds in the target's interface hash and the assumed nodes' rendered descriptions (sorted bytewise, ids never), it is established only when the approval holds, every required leaf is true, `valid` is true, `xfail` is false and every assumed node is established, and each failure is its own blame cause (false or missing leaves, invalid result, expected failure, `assumed node … is not established`). The resolution of a bind's reference against the imported evidence moves into one shared `bind::resolve`, read by evaluation, the review queue and the recording command, so the `calc_not_evaluated` stub is gone and a missing reference names its kind (`no imported calc evidence provides …`). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
shunsuke-shimomura
force-pushed
the
feat/209-calc-eval
branch
from
November 10, 2026 03:55
0721989 to
d13f7cb
Compare
Member
Author
Review follow-up (2026-11-10)Rebased onto the updated #241 and force-pushed. The review asked for no change to this PR's own commit; |
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 #209 (parent: #40). Stacked on #241 (load-time calc evidence).
Calc binds are evaluated. The closing conditions of #40 that this PR delivers: the veriq export is consumed by
eval, and the bind hash's assumption slot is filled.inka_core::bind::resolve). Evaluation, the review queue and the recording command used to each look up a bind's reference themselves. They now share one function that maps a bind to the imported evidence its reference names:BindEvidence::Test(&TestEvidence)orBindEvidence::Calc { target, assumed }with the assumedViewNodes (sorted by id), orNonefor the per-bind missing evidence.contract()yields what enters the hash.LocalView::of_nodetakes anOption<EvidenceContract { interface, assumptions }>instead of a bare interface hash (From<InterfaceHash>keeps the test-bind case a.into()). For a calc bind the slot holds the assumed nodes' rendered descriptions;view_hashalready sorted and normalized them (calc evidence: shared model, validation and builder in inka-evidence #206's frozen layout), so no vector changes. Test binds keep an empty slot.evaluate(view, phases, records, tests, calcs)adds, for every calc bind whose target is loaded, a dependency on each assumed node, so the bind is judged after them. A calc bind is established iff the approval holds ∧ every required leaf istrue∧valid∧ ¬xfail∧ every assumed node is established.leaves_failed { leaves },leaves_missing { leaves },evidence_invalid,expected_failure,assumption_not_established { node }.missing_evidencegainskind(test|calc) and reads "no imported calc evidence provides…".calc_not_evaluatedis removed from blame and from the review queue's blocked reasons.EvalError::UnknownAssumption; a cycle through an assumption edge isEvalError::Cycle. A checked project trips neither (feat(core): load calc evidence, hash it and check its assumption edges #241 reports both atcheck).derive_queueandinka review <id> --approveresolve calc binds and bind the record to the assumption-bearing hash; a calc bind without evidence is blocked as missing calc evidence. The LSP lens passes the calc evidence through.Test results
cargo test --workspace(adapter tests excluded locally for want of nextest): green. Newcrate/inka-core/tests/eval_calc_evidence.rsmirrors the two evaluation tables ofcalc-evidence.md, 16 tests: established; a false leaf; a leaf without result;valid: falsewith atrueleaf;xfail; absent target → missing calc evidence; passing evidence without approval; an unapproved assumed fiat →assumption_not_establishednaming the node; an edited upstream calculation → stale; an edited assumed description → stale; a renamed assumed node → still established; a new upstreamassumesentry → stale; producer order of assumptions is not content; a different target path → stale; an undefined assumed id →UnknownAssumption; assuming an ancestor →Cycle. Review queue unit tests: a calc bind with evidence is queued on the assumption-bearing hash (≠ the empty-slot hash); without evidence it is blocked as missing calc evidence.unestablishedfixture grows five calc binds (false leaf, missing leaf, invalid, xfail, unestablished assumption) plus the existing absent-target one; both eval snapshots regenerated and reviewed — every cause appears once, no ancestor is blamed. New end-to-end testa_calc_bind_established_through_loaded_evidence_evaluates_clean: a project with[evidence] calcs, a passing target assuming a fiat, and approvals bound to the current hashes evaluatesestablished 3/3.tests/goldenuntouched;eval_evidence.rsrows still pass with the extra argument).cargo clippy --workspace --all-targets(pedantic),cargo fmt --check,inka fmt --checkon the fixture,prekon the changed files: clean.Impact
inka evalnow establishes or blames calc binds. A project that already hadcalc:binds seescalc_not_evaluatedreplaced by the real causes (most commonlymissing_evidencewithkind: calcuntil a calc evidence file is configured).eval --json:missing_evidencecarries a newkindfield; five newcausevalues;calc_not_evaluatedis gone.inka review: calc binds can be approved and declined; blocked lines for missing evidence name the kind.evaluateandderive_queuetake a&CalcEvidenceSet;LocalView::of_nodetakesOption<EvidenceContract>;BlockedReason::MissingEvidenceandBlameReason::MissingEvidencegainkind.Supplementary information
approvals/snapshots/and the review presentation of sources and assumption sets are calc evidence: present assumption sets and their diffs at bind approval #210, next in the stack.🤖 Generated with Claude Code