Repository navigation
feat(core): load calc evidence, hash it and check its assumption edges - #241
Draft
shunsuke-shimomura wants to merge 2 commits into
Draft
shunsuke-shimomura wants to merge 2 commits into
shunsuke-shimomura wants to merge 2 commits into
Conversation
This was referenced Nov 10, 2026
#208) `inka.toml` names evidence per kind: `[evidence] tests` (formerly `files`) and `calcs`. Calc evidence is read at project load, each target hashed with the frozen `inka:calc-evidence:v1` layout, and every node a loaded target assumes becomes an assumption edge of the graph from the bind that references it. `inka check` and the LSP report an assumption naming no block, and a cycle through an assumption edge (`branch → modelled ⇢ root`), as errors anchored on the bind's `calc:` property. A `calc:` reference no target answers stays evaluation's missing evidence; projects without calc evidence behave exactly as before. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… they are Three reports at project load blamed the wrong thing: - A component holding both a cycle of `children:` alone and a way round through an assumption was reported as "through an assumption" and anchored on the `calc:` reference, whenever the search happened to meet that path first. The children cycle is in the argument as written and stands whatever the evidence says, so it is now the one named. - `[evidence] files`, renamed to `tests`, failed as an unknown field. It is a hard break, but the error now says what to rename. - A target delivered by two entries of `[evidence] calcs`, or a file listed twice, was reported as invalid evidence in the second file. Neither file is defective alone; the error now names the pair. The design doc also claimed an assumption ID resolves like a `children:` reference. It is matched exactly against fully-qualified IDs.
shunsuke-shimomura
force-pushed
the
feat/208-calc-load-check
branch
from
November 10, 2026 03:55
cd2177d to
9ea8bcc
Compare
Member
Author
Review follow-up (2026-11-10)Rebased onto the updated #231 and force-pushed. One commit was added. Where the description above and this comment disagree, this comment is current.
Decisions taken with the author
Left as is
|
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 #208 (parent: #40). Stacked on #231 (veriq producer).
Calc evidence becomes part of what a project is, not only what
evalreads:[evidence]now names files per kind:tests = [...](formerlyfiles) andcalcs = [...], either of which may be left out — the key names the design docs already use.filesis rejected with serde's "unknown fieldfiles, expectedtestsorcalcs"; the dogfood and CLI fixtures are renamed.inka_core::calc_evidence).load_filesreads every configured calc evidence file through the sharedinka-evidenceparser, anchors each defect (unreadable / malformed / unsupported version / semantic) to the file, rejects a target path delivered twice across files, and computes each target's interface hash with the frozeninka:calc-evidence:v1layout.Projectgainscalc_evidence: CalcEvidenceSet;CalcEvidenceSet::from_targetsbuilds the same set from in-memory targets for tests and other producers.Dependencykind,ChildorAssumption.Graph::build_with(blocks, &calc_evidence)(andGraph::of_project) adds an assumption edge from everycalc:bind whose target the loaded evidence provides to each node that target assumes;Graph::build(blocks)is the empty-evidence case and keeps every existing caller and test unchanged.children/parentskeep reading the declared structure only (assumptions/assumed_byread the new edges); topological order, cycle detection and reachability follow both kinds, so a node only an assumption reaches is not an orphan.inka check(viagraph::check) reports, anchored on the bind'scalc:property: an assumption ID no block defines (undefined assumptionmass_properties_valid: the calc evidence forAOCS::?verify_detumbleassumes it, but no block defines it), and a cycle through an assumption edge with the nodes in order and the assumption drawn as a dashed arrow (dependency cycle through an assumption: branch → modelled ⇢ root → branch). Acalc:reference no target answers adds no edge and no error — that stayseval's missing evidence. The CLI'sload_project_viewbuilds the graph with the evidence, soexport/eval/review/serverefuse an argumentcheckwould refuse.graph::check; a broken calc evidence file anchors to that file, like a test evidence file.calc-evidence.md(en/ja) spells out how assumption IDs resolve, that both edge kinds are dependencies for order, cycles and reachability while onlychildren:is structure, the cycle rendering, and that a missing/malformed configured file is an input error.Nothing evaluates calc evidence yet (#209): the bind hash's assumption slot stays empty and calc binds still report
calc_not_evaluated.Test results
cargo test --workspace(adapter tests excluded locally for want of nextest): all green, 269 core unit tests incl. 6 new graph tests (edges resolve; a missing target adds no edge; undefined assumption anchored oncalc:; self-assumption and ancestor-assumption cycles with their rendering; an assumed-only node is not an orphan). New integration tests:tests/calc_evidence.rsloader (valid file exposes the target with its hash; every goldencalc-evidence-v1vector, written out as an evidence file, loads to its frozen hash; unreadable / malformed / v2 / semantic defect / duplicate across files name the file),tests/project.rs(calcs-only manifest loads; missing calc file isLoadError::CalcEvidence),tests/manifest.rs(tests+calcs, calcs-only,filesrejected naming the valid keys).undefined-assumptionandassumption-cyclefreeze the rendered snippets pointing atcalc:,broken-calc-evidencefailscheckandevalbefore any verdict. Existing snapshots unchanged.calc:range; a v2 calc evidence file anchors to that file.cargo clippy --workspace --all-targets(pedantic) andcargo fmt --checkclean;inka fmt --checkclean on the new fixtures;prekclean on docs, fixtures and snapshots.Impact
inka.toml:[evidence] filesmust be renamed totests. The error names the valid keys.[evidence] calcsbehave exactly as before:Graph::buildis unchanged in behaviour, no new edges, no new diagnostics.checkcan newly fail (undefined assumption, assumption cycle) and a missing/invalid file fails every command, as for test evidence.Graph::parentsexcludes assumption edges, soArgumentView::rootsand the exported view are unaffected by assumptions.Supplementary information
children:references do today — by literal block ID, since namespace resolution has not landed. The veriq fixture'spower::eclipse_model_validstyle IDs will resolve once it does; until then an argument that imports such evidence spells its block IDs the same way.🤖 Generated with Claude Code