Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crate/inka-cli/src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ fn evidence_data(evidence: &Evidence) -> EvidenceData<'_> {
// The scheme is spelled out here rather than serialized from the enum:
// it is part of the wire contract, not of the model's spelling.
kind: match evidence.kind {
EvidenceKind::Veriq => "veriq",
EvidenceKind::Calc => "calc",
EvidenceKind::Test => "test",
},
target: &evidence.target,
Expand Down Expand Up @@ -244,7 +244,7 @@ mod tests {
description: "checked by a solver".to_owned(),
tags: Vec::new(),
evidence: Some(Evidence {
kind: EvidenceKind::Veriq,
kind: EvidenceKind::Calc,
target: "aocs.verify_detumble".to_owned(),
}),
deadline: None,
Expand Down Expand Up @@ -363,7 +363,7 @@ mod tests {
let elements = elements();
let bind = data_of(&elements[1]);

assert_eq!(bind["evidence"]["kind"], "veriq");
assert_eq!(bind["evidence"]["kind"], "calc");
assert_eq!(bind["evidence"]["target"], "aocs.verify_detumble");
}

Expand Down
18 changes: 9 additions & 9 deletions crate/inka-cli/src/review.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@ fn current_hash(
) -> Result<ViewHash, String> {
let interface = match (node.mode, node.evidence.as_ref()) {
(Mode::Bind, Some(reference)) => match reference.kind {
EvidenceKind::Veriq => {
EvidenceKind::Calc => {
return Err(format!(
"`{}` is a veriq bind; veriq evidence is not evaluated yet",
"`{}` is a calc bind; calc evidence is not evaluated yet",
node.id
));
}
Expand Down Expand Up @@ -479,7 +479,7 @@ fn write_target(
if let Some(reference) = &node.evidence {
let property = match reference.kind {
EvidenceKind::Test => Property::Test,
EvidenceKind::Veriq => Property::Veriq,
EvidenceKind::Calc => Property::Calc,
};
let quoted = format!("\"{}\"", reference.target);
write_property(comments, property, &quoted, out)?;
Expand Down Expand Up @@ -585,7 +585,7 @@ fn blocked_line(reason: &BlockedReason) -> String {
BlockedReason::MissingEvidence { target } => {
format!("no imported test evidence provides `{}`", sanitize(target))
}
BlockedReason::VeriqNotEvaluated => "veriq evidence is not evaluated yet".to_owned(),
BlockedReason::CalcNotEvaluated => "calc evidence is not evaluated yet".to_owned(),
BlockedReason::UntilExpired { until } => {
format!(
"approvals no longer count: the current phase is past until:{}",
Expand Down Expand Up @@ -801,7 +801,7 @@ fiat leaf {

#[test]
fn an_evidence_reference_is_spelled_with_its_own_scheme_under_its_comment() {
// Arrange: a veriq bind is never queued, so the target is rendered
// Arrange: a calc bind is never queued, so the target is rendered
// directly.
let node = ViewNode {
id: "checked".to_owned(),
Expand All @@ -810,13 +810,13 @@ fiat leaf {
description: "checked by a solver".to_owned(),
tags: Vec::new(),
evidence: Some(Evidence {
kind: EvidenceKind::Veriq,
target: "aocs.check".to_owned(),
kind: EvidenceKind::Calc,
target: "AOCS::?check".to_owned(),
}),
deadline: None,
children: Vec::new(),
comments: NodeComments {
properties: BTreeMap::from([(Property::Veriq, "the shipped check".to_owned())]),
properties: BTreeMap::from([(Property::Calc, "the shipped check".to_owned())]),
..NodeComments::default()
},
};
Expand All @@ -840,7 +840,7 @@ fiat leaf {
let text = String::from_utf8(out).expect("UTF-8");
assert!(
text.ends_with(
" checked by a solver\n // the shipped check\n veriq: \"aocs.check\"\n"
" checked by a solver\n // the shipped check\n calc: \"AOCS::?check\"\n"
),
"{text}"
);
Expand Down
4 changes: 2 additions & 2 deletions crate/inka-cli/tests/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fn path_defaults_to_the_current_directory() {
fn each_failure_kind_is_blamed_on_the_failing_node_alone() {
// Act: the fixture holds one node per failure kind — missing, stale,
// declined, expired, and binds with missing, failing and incomplete
// evidence plus the veriq stub — under one unapproved objective.
// evidence plus the calc stub — under one unapproved objective.
// The declined leaf also has a current approval, exercising the veto.
let assert = inka()
.current_dir(local_fixture("unestablished"))
Expand Down Expand Up @@ -117,7 +117,7 @@ fn the_json_report_matches_the_human_verdict() {
fn the_json_report_spells_every_blame_cause() {
// Act: the fixture exercises every blame cause the JSON contract has —
// missing, stale, declined, expired, missing/failed/incomplete evidence,
// and the veriq stub.
// and the calc stub.
let assert = inka()
.current_dir(local_fixture("unestablished"))
.args(["eval", "--json", "."])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ bind modelled {
```
the controller detumbles
```
veriq: "aocs.verify_detumble"
calc: "AOCS::?verify_detumble"
}

fiat declined_leaf {
Expand Down
2 changes: 1 addition & 1 deletion crate/inka-cli/tests/fixtures/unestablished/inka.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A project in which nothing is established, one failure kind per node:
# a missing approval, a stale approval, a decline, an expired deadline, and
# binds blamed for missing, failing and incomplete evidence plus the veriq stub.
# binds blamed for missing, failing and incomplete evidence plus the calc stub.

[project]
name = "unestablished"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ blame:
bind:failing: no approval covers the current content
bind:failing: required executions failed: default
fiat:leaf: approvals are stale: iwata approved an earlier version
bind:modelled: veriq evidence is not evaluated yet
bind:modelled: calc evidence is not evaluated yet
bind:partial: no approval covers the current content
bind:partial: required executions were skipped, cancelled or missing: macos, windows
objective:root: no approval covers the current content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ expression: stdout
"mode": "bind",
"reasons": [
{
"cause": "veriq_not_evaluated"
"cause": "calc_not_evaluated"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ expression: "export(\"aocs\")"
"tags": [],
"root": false,
"evidence": {
"kind": "veriq",
"target": "aocs.verify_momentum_budget"
"kind": "calc",
"target": "AOCS::?verify_momentum_budget"
},
"comments": {
"block": "actuator_authority_ok is a shared node: also referenced from momentum_ok\n(momentum.inka)."
Expand All @@ -39,8 +39,8 @@ expression: "export(\"aocs\")"
"tags": [],
"root": false,
"evidence": {
"kind": "veriq",
"target": "aocs.verify_attitude_knowledge"
"kind": "calc",
"target": "AOCS::?verify_attitude_knowledge"
}
}
},
Expand All @@ -53,8 +53,8 @@ expression: "export(\"aocs\")"
"tags": [],
"root": false,
"evidence": {
"kind": "veriq",
"target": "aocs.verify_pointing_control"
"kind": "calc",
"target": "AOCS::?verify_pointing_control"
}
}
},
Expand All @@ -67,8 +67,8 @@ expression: "export(\"aocs\")"
"tags": [],
"root": false,
"evidence": {
"kind": "veriq",
"target": "aocs.verify_detumble"
"kind": "calc",
"target": "AOCS::?verify_detumble"
}
}
},
Expand Down Expand Up @@ -205,8 +205,8 @@ expression: "export(\"aocs\")"
"tags": [],
"root": false,
"evidence": {
"kind": "veriq",
"target": "aocs.verify_sun_pointing"
"kind": "calc",
"target": "AOCS::?verify_sun_pointing"
}
}
},
Expand Down
9 changes: 4 additions & 5 deletions crate/inka-core/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,9 @@ pub enum ObjectivePromoteTarget {
/// than to the AST.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SourceRef {
/// A `veriq: "<module>.<name>"` reference.
///
/// The dotted Python name is preserved verbatim.
Veriq(String),
/// A `calc: "<path>"` reference: the target's path in the producer's
/// calculation graph (for veriq, `Scope::?name`), preserved verbatim.
Calc(String),
/// A `test: "<test-id>"` reference, such as `test: "tests/hash_props.rs::roundtrip"`.
Test(String),
}
Expand Down Expand Up @@ -290,7 +289,7 @@ pub struct BindBlock<D = Description> {
pub common: BlockCommon<D>,
pub deadline: Option<Deadline>,
pub source: Spanned<SourceRef>,
/// The comment attached to the `test:` / `veriq:` property.
/// The comment attached to the `test:` / `calc:` property.
pub source_comment: Option<Comment>,
}

Expand Down
12 changes: 6 additions & 6 deletions crate/inka-core/src/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
//! from the interface hash of the imported evidence its `test:` reference
//! names, so approval staleness and evidence failure stay independent causes;
//! a reference no loaded evidence provides is the per-bind missing-evidence
//! cause, not an input error. veriq evidence is not evaluated yet.
//! cause, not an input error. calc evidence is not evaluated yet.
//!
//! Blame lists only nodes whose failure cause is their own — a missing, stale,
//! declined, or expired approval, or missing/failed/incomplete evidence —
Expand Down Expand Up @@ -228,8 +228,8 @@ pub enum BlameReason {
EvidenceFailed { cases: Vec<String> },
/// Required executions were skipped, cancelled or reported no result.
EvidenceIncomplete { cases: Vec<String> },
/// veriq evidence is not evaluated yet.
VeriqNotEvaluated,
/// calc evidence is not evaluated yet.
CalcNotEvaluated,
}

impl fmt::Display for BlameReason {
Expand Down Expand Up @@ -257,7 +257,7 @@ impl fmt::Display for BlameReason {
"required executions were skipped, cancelled or missing: {}",
cases.join(", ")
),
BlameReason::VeriqNotEvaluated => f.write_str("veriq evidence is not evaluated yet"),
BlameReason::CalcNotEvaluated => f.write_str("calc evidence is not evaluated yet"),
}
}
}
Expand Down Expand Up @@ -480,7 +480,7 @@ fn judge(
/// hash, so no current view hash and no record-based judgement. The `until:`
/// deadline needs no hash, so it is still judged: an expired bind is reported
/// as both expired and missing its evidence, and an unknown `until:` phase
/// fails loudly whether or not the evidence has been delivered. veriq
/// fails loudly whether or not the evidence has been delivered. calc
/// references stay unevaluated.
fn judge_bind(
view: &ArgumentView,
Expand All @@ -498,7 +498,7 @@ fn judge_bind(
.into());
};
match reference.kind {
EvidenceKind::Veriq => Ok((false, vec![BlameReason::VeriqNotEvaluated])),
EvidenceKind::Calc => Ok((false, vec![BlameReason::CalcNotEvaluated])),
EvidenceKind::Test => {
let Some(test) = evidence.get(&reference.target) else {
let mut reasons = Vec::new();
Expand Down
2 changes: 1 addition & 1 deletion crate/inka-core/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl Printer {
self.comment(1, comment);
let (key, reference) = match source {
SourceRef::Test(reference) => ("test", reference),
SourceRef::Veriq(reference) => ("veriq", reference),
SourceRef::Calc(reference) => ("calc", reference),
};
self.line(1, &format!("{key}: \"{reference}\""));
}
Expand Down
4 changes: 2 additions & 2 deletions crate/inka-core/src/format/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ fn bind_sources_and_objective_promotion_are_written_in_order() {
"goal\n",
"```\n",
"children: a }\n",
"bind a { veriq: \"aocs.check\" // the check\n",
"bind a { calc: \"AOCS::?check\" // the check\n",
"```\n",
"a\n",
"```\n",
Expand Down Expand Up @@ -196,7 +196,7 @@ fn bind_sources_and_objective_promotion_are_written_in_order() {
" a\n",
" ```\n",
" // the check\n",
" veriq: \"aocs.check\"\n",
" calc: \"AOCS::?check\"\n",
"}\n",
"\n",
"bind b {\n",
Expand Down
2 changes: 1 addition & 1 deletion crate/inka-core/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//! stops there: re-approval cost stays proportional to the edit.
//!
//! What is excluded is equally deliberate. IDs, tags, file comments, and the
//! `test:` / `veriq:` reference strings are not contract content — an approver
//! `test:` / `calc:` reference strings are not contract content — an approver
//! judged the claim, not its name, its filing, or where the evidence lives — so
//! renaming a node or retagging it never asks anyone to approve again. A
//! deadline *is* content: `until:` is a jointly-approved decline placed toward
Expand Down
8 changes: 4 additions & 4 deletions crate/inka-core/src/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,16 +850,16 @@ objective root { // opening comment
}

#[test]
fn lexes_veriq_source_target() {
fn lexes_calc_source_target() {
let tokens =
lex(r#"veriq: "aocs.verify_attitude""#).expect("a quoted veriq target should lex");
lex(r#"calc: "AOCS::?verify_attitude""#).expect("a quoted calc target should lex");

assert_eq!(
kinds(&tokens),
vec![
&TokenKind::Ident("veriq".to_owned()),
&TokenKind::Ident("calc".to_owned()),
&TokenKind::Colon,
&TokenKind::StringLiteral("aocs.verify_attitude".to_owned()),
&TokenKind::StringLiteral("AOCS::?verify_attitude".to_owned()),
]
);
}
Expand Down
Loading
Loading