Repository navigation
impl(033): increment 3, check evaluation and actionable outcomes - #122
Conversation
cd13213 to
6b113ef
Compare
AI review (findings)Reviewing the diff carefully across Finding 1 — Silent wrong continuation when In let bytes = rustev_contract::canonical::record_canonical_bytes(&json!({...}))
.unwrap_or_default(); // ← silent fallback to []
let digest = rustev_contract::canonical::tagged_digest(
rustev_contract::actionability::CONTINUATION_TAG,
&bytes,
);
if let Ok(d) = serde_json::from_value(json!(digest)) {
n.continuation = d; // ← skipped silently if parse fails
}If Finding 2 — Silent skip of a failing check when In // status() just returned Ok for c.subject:
let class = match self.input_evidence.get(&c.subject) {
Some(InputStatus::Resolved { provenance, .. }) => *provenance,
_ => continue, // ← silent skip
};After {"head": "6b113ef152904f2bb9757de72c31987c9a5da419", "verdict": "findings", "findings": [{"path": "crates/rustev-core/src/evaluate.rs", "line": null, "summary": "In actionable_outcome() NeedsInput arm, record_canonical_bytes(...).unwrap_or_default() silently replaces a serialization failure with empty bytes, producing a wrong continuation digest with no error surfaced."}, {"path": "crates/rustev-core/src/evaluate.rs", "line": null, "summary": "In run_checks(), after status() returns Ok for the check subject, `_ => continue` silently skips a failing check (emitting no record, notice, or refusal) when input_evidence does not hold Resolved for that subject."}]}Subject: 8222ce9...6b113ef, diff digest 264d9d89a461f2a7fc90428e1cd48596aeeb8a5bd3757845aac92be6ee91f38d, 1 call(s). An AI comment is not an approval. |
9b9e848 to
c080c64
Compare
6b113ef to
da5b8a5
Compare
AI review (findings)Reviewing the implementation of spec 033 increment 3 (checks, consequences, provenance_within, actionable outcomes).
Lines ~387–407: for v1 inputs the
Lines ~2028–2039: _ => (
vec![Cause::Capability { name: name.clone() }],
Remediation::with("provide_capability", ...),
),Every pre-existing
Lines ~2143–2152:
Lines ~168–175: self.read(reference);
self.view.get(reference)?;
self.view.provenance(reference)?
.iter()
.all(|c| classes.contains(c))
When terminal is already {"head": "da5b8a5011533770af21e3ef03b68c85963df6ba", "verdict": "findings", "findings": [{"path": "crates/rustev-core/src/evaluate.rs", "line": 387, "summary": "For v1 inputs, the `observed` map is initialised to all accepted classes but never narrowed to the single resolved provenance after `validate_input()`, so `input_cause()` returns `Accepted` instead of `Observed` causes and computes the wrong party; unreachable today because actionability requires definition/2 (v2=true), but the latent inconsistency remains."}, {"path": "crates/rustev-core/src/evaluate.rs", "line": 2031, "summary": "The catch-all arm of `actionable_notices` assigns `Cause::Capability` and `provide_capability` remediation to every pre-existing non-Truncation notice kind; if any existing `NoticeKind` variant is not capability-related, every `judgment/2` document will carry a wrong cause and remediation for that notice."}, {"path": "crates/rustev-core/src/evaluate.rs", "line": 2143, "summary": "Question IDs absent from `actionability.questions` are silently dropped from `n.questions` but still included in `ids` used for the continuation digest, so the digest would cover question IDs not present in the outcome, violating the reproducibility guarantee of 3.7.4."}]}Subject: c080c64...da5b8a5, diff digest c0e6063c1342d4726d96914efb2a34e3deb24ad57eda6f65b0d591afc65fa629, 1 call(s). An AI comment is not an approval. |
c080c64 to
7a48144
Compare
da5b8a5 to
717316e
Compare
AI review (findings)Reviewing the diff, which adds spec 033 increment 3: check evaluation, consequences, terminal outcomes, and actionable outcomes. General structure looks sound. The check loop in One actual bug — In _ => CauseProvenance::Accepted {
classes: self.compiled.info.inputs.get(field)
.map(|(_, d)| { let mut v = d.provenance.clone(); v.sort(); v })
.unwrap_or_default(),
},
The Other observations (not bugs):
{"head": "717316efd298cc7a881987ff86f134970b040bae", "verdict": "findings", "findings": [{"path": "crates/rustev-core/src/evaluate.rs", "line": null, "summary": "input_cause's fallback arm uses decl.provenance (all declared accepted classes) instead of the actual observed subset when two or more entries with different provenance classes were present but none was selected, over-attributing causes to classes for which no snapshot entry existed, contrary to spec 3.5.2's 'every accepted entry's class when none was used'."}]}Subject: 7a48144...717316e, diff digest 5d17bfa6968b7ac994c046a00f0b0dd8490f4cab976020eccd6c54a5da64a719, 1 call(s). An AI comment is not an approval. |
717316e to
2a0fedd
Compare
AI review (findings)Looking at the diff, this is a substantial implementation of spec 033 increment 3 (checks, consequences, terminal outcomes, Issue 1 — Silent continuation placeholder corruption ( let digest = rustev_contract::canonical::tagged_digest(
rustev_contract::actionability::CONTINUATION_TAG,
&bytes,
);
if let Ok(d) = serde_json::from_value(json!(digest)) {
n.continuation = d;
}If Issue 2 — let mut reads: Vec<String> = refs
.iter()
.filter(|r| r.starts_with("input:"))
.map(|r| crate::expr::base_ref(r))
.collect();
reads.sort();
reads.dedup();
let unresolved = reads.iter().find_map(|r| self.status(r).err());Non- {"head": "2a0fedde992a712e48c62ba5bdd13e48d710b8b8", "verdict": "findings", "findings": [{"path": "crates/rustev-core/src/evaluate.rs", "line": 2181, "summary": "Continuation digest parse failure is silently ignored, leaving the all-zeros placeholder in the NeedsInput outcome instead of surfacing an error."}, {"path": "crates/rustev-core/src/evaluate.rs", "line": 462, "summary": "run_checks filters reads to `input:` refs only, so non-input references in a check test bypass the unresolved probe and produce a misleading InvalidInput fault instead of a clean Unevaluable status."}]}Subject: 7a48144...2a0fedd, diff digest bcf8aac867e9f4f6c549e3ccc61dbf251223ca0b680b16000aaf7ce6b48e4b3e, 1 call(s). An AI comment is not an approval. |
2a0fedd to
02e21fb
Compare
AI review (no-findings)Reviewing the diff carefully: this PR implements spec 033 increment 3, adding evaluation of actionability checks and actionable outcomes to
The new helpers (
The
The check loop correctly handles: skip-if-relaxed, subject-unresolved →
The
The call
The No bugs, security issues, or spec inconsistencies found. {"head": "02e21fb645951e2186613353b642ec7b34de1934", "verdict": "no-findings", "findings": []}Subject: 7a48144...02e21fb, diff digest 6d12edff108f78cec0a31ba3b349833c934e306039af661d0e28d95c6f8597b8, 1 call(s). An AI comment is not an approval. |
7a48144 to
c5d3918
Compare
02e21fb to
cb0bdcd
Compare
AI review (no-findings)Reading through the diff carefully, examining the logic for checks, consequences, terminal outcomes, action computation, and the policy changes.
No bugs, security issues, or spec inconsistencies found. {"head": "cb0bdcddb96fffc6fedbd78579223af93d3f5789", "verdict": "no-findings", "findings": []}Subject: d2a8b42...cb0bdcd, diff digest 330f1432e3f7abb5dd21cacf48e4764f9ca58ac584719ab8e4853f5179e5ecd4, 1 call(s). An AI comment is not an approval. |
Spec 033, increment 4 of 5: the runtime origin (3.9) and the CLI output (3.11, amending 006). Stacked on #122. - `RuntimeBuilder::host_backend` registers a host-implemented backend (origin `host`); `backend` stays `upstream`, the default. Before supplying a failure, the runtime notes the last attempt's backend to the core (`Evaluation::note_failure`, `FailureContext`: origin and declared determinism), which the `backend` cause and `invalid_backend_output`'s transience use. Plans without `actionability` read neither; run records keep their bytes. `rustev_core::transient` exposes 3.6.4's table. - CLI: categories 16 and 17 named; `plan show` adds `caller_controlled`, checks with each branch's classes, consequence and static party, groups, remediations and question ids (other plans unchanged); `run` prints `rustev.judgment/2` whole with top-level `addressed_to`/`transient` (status `judged`, exit 0 for every outcome). The record file sink accepts `rustev.run/3` so a plan 3 runs; capture of a plan 3 decision is refused before any decision runs (spec 032 3.11 defers it to 036). - Tests: core origin/transience (section 5 backend rows, full transience table), runtime origin wiring, CLI goldens `refusal-16.json`, `refusal-17.json`, `actionable.show.json`, `actionable.run-{propose,refused,needs,unresolved}.json`. Existing CLI goldens unchanged. Review round 1 (2 findings): both comments made precise: `addressing` lists each outcome (an unresolved or `needs_input` outcome's action, a refusal's party with `false`, `null` for a proposal or an `escalate`, which carries no action); the capture comment says the runtime refuses capturing a plan 3 decision whatever the sink accepts, and `execute` refuses the combination first.
Spec 033, increment 3 of 5: check evaluation and actionable outcomes (3.3 to 3.7). Stacked on #121. Judgment 2 needs an action on every outcome and notice, so evaluation and actions land together (plan revised in the record).
relaxed,not_evaluated(unresolved/absent subject),unevaluable(unresolved read or fault; the subject becomes unresolved with the reason),passed,failed{class, consequence}.drop_field(absent for every reader, entry kept in evidence withdropped{check}),relax(later checks of the group),downgrade_grade(lowers, never raises),continue_with_notice; each emits its notice. First failing terminal check decides:refusedlists every refusing check;abstain/escalatethat check's; no step, no semantic request, no policy; derivation and lineage from the deciding reads.provenance_within: an input's accepted entry's class, or every class of a plan 3 step value's provenance set.propagate_withcarries its remediation/address;needs_inputits fields and question ids.rustev.judgment/2:unresolved{reason, action};refusedwith one action per refusing check and their combined party;needs_inputwith byte-identical templates,rustev.continuation/1digest and a caller-addressedprovide_fieldsaction; every notice carries an action. Causes per 3.5.6, overrides per 3.5.3, remediations per 3.6 (declared params evaluated;nonewhen one reads an unresolved input), transience per 3.6.4 with the bound backend's determinism. Backend origin isupstreamuntil increment 4 wires the runtime's.actionability_eval.rs(section 5 rows 1, 2, 10, 11, 12, 16, 20, 22, 23 and more).Review round 1 (2 findings, both fixed): a subject that is resolved but has no used entry records its check as
not_evaluatedinstead of skipping it; the continuation's canonical bytes are taken with an explicit expectation rather than a silent empty default. Rebased on #121.Local: full
cargo test --workspacepassed at the previous head (existing goldens unchanged).Review round 2 (3 findings): (1) a version 1 input keeps its accepted classes in
observedbecause only a version 2 definition declaresactionability, the sole reader; the code says so; (2) the notice match is exhaustive:uncalibrated_thresholdandfallbackarecapability{step}withprovide_capability(3.5.4 table), and the check kinds, which never appear among the policy notices, keep their own causes; (3) the continuation digest covers exactly the question ids the outcome carries, computed after filtering (the compiler already refuses undeclared ids, 3.7.1).Review round 3 (1 finding, answered in code): 3.5.2 defines
accepted{classes}as the declared classes, and an input cause carries one class; with several entries of different classes and none used, the cause lists the declared classes, which bound every class the field could have had.conflictlists each entry's observed class itself (3.5.6). The code says so.Review round 4 (2 findings): (1) fixed: a continuation digest that did not parse would be a defect, so it is an
expect(like the canonical bytes beside it), never a placeholder; (2) only inputs can be unresolved in a check's test: the compiler refuses step reads (types) andnowand literals always resolve; the code says so.