Repository navigation
impl(027): increment 4, the conformance suite and its CLI cases - #129
Conversation
2e1ab34 to
721be94
Compare
b23449e to
340d33a
Compare
AI review (findings)Group 1 of 2Reviewing the diff for Finding 1 — missing dev-dependency for
Finding 2 — In let mut written = BTreeMap::new();
files(&seen.dir, &seen.dir, &mut written);
for (name, bytes) in written {
if seen.inputs.contains_key(&name) { continue; }
// compare bytes against golden
}Any file written by test code between {"head": "340d33a72c16e02dac0139799a6eb541fc1967dd", "verdict": "findings", "findings": [{"path": "crates/rustev-cli/tests/common/harvest.rs", "line": 13, "summary": "`sha2` is imported and used but `crates/rustev-cli/Cargo.toml` is not modified to add it as a dev-dependency, which will cause a compilation failure if it was not already listed there."}, {"path": "crates/rustev-cli/tests/common/harvest.rs", "line": 99, "summary": "`locate()` scans the scratch directory at golden-registration time rather than immediately after the CLI invocation, so any file written by test code between `harvest::after()` and `cli_golden()` could be falsely attributed as a CLI output."}]}Group 2 of 2Reviewing the group 2 files: fixture definitions, rules, calibrations, the Intentional defects in refusal fixtures (not bugs):
All of the above look intentional and consistent with the naming convention. Real finding — In let normalized = produced
.as_deref()
.and_then(|b| normalize::apply(&o.normalize, b));
if normalized.as_deref() != Some(&golden[..]) {
v.push(format!("{}: {} differs", case.id, o.golden));
}When The same pattern applies when a file output is absent ( {"head": "340d33a72c16e02dac0139799a6eb541fc1967dd", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/src/lib.rs", "line": 120, "summary": "When normalize::apply returns None (unknown normalization name or non-JSON output), the failure is silently reported as 'differs' instead of a normalization error, masking the true root cause and potentially hiding a correct output."}]}Subject: 721be94...340d33a, diff digest 851243860e65e462ff4196a69d6b868dedc3b7eaaf540f5f7c8bb852c379ef21, 2 call(s). An AI comment is not an approval. |
721be94 to
b0e556a
Compare
340d33a to
492eb63
Compare
AI review (findings)Group 1 of 3Reviewing this PR, which adds a conformance suite ( harvest.rs In Case ID derived from first golden name only In No issues found with: SHA-256 encoding (all hashes are valid 64-hex-char), fixture deduplication across cases (intentional), {"head": "492eb631532a31e6bdc672f8672d81432f8af5fd", "verdict": "findings", "findings": [{"path": "crates/rustev-cli/tests/common/harvest.rs", "line": 113, "summary": "locate() only tries hardcoded normalization variants [\"receipt\"] and [\"timing\"]; any golden using a different normalization causes a misleading panic in harvest mode even though the underlying test passes."}]}Group 2 of 3Reviewing the conformance fixture files in this group, I focused on internal consistency, schema correctness, and structural integrity of the fixture data. Finding: duplicate JSON key in refusal-01 fixture
Everything else reviewed:
{"head": "492eb631532a31e6bdc672f8672d81432f8af5fd", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/fixtures/cli/refusal-01/cat-01.definition.json", "line": 1, "summary": "Root JSON object contains duplicate key \"name\" (first value \"x\", second value \"support-routing\"); serde_json resolves this to the last value, so the parsed definition is indistinguishable from a valid one and likely will not trigger the expected compile refusal."}]}Group 3 of 3Reviewing the three source files and two test files in this group. tools/rustev-conformance/src/lib.rs
(None, Some(f)) => std::fs::read(dir.join(f)).ok(),A missing file and an unreadable file produce the same opaque diagnostic. This makes test failures harder to diagnose in CI. tools/rustev-conformance/tests/cli.rs
std::env::set_current_dir(&dir).unwrap();
let exit = rustev_cli::execute(&case.argv, ...);
std::env::set_current_dir(&start).unwrap();Cargo runs test functions within a binary in parallel by default. The comment at the top of the file explains why cases run sequentially inside one test, but it does not protect against concurrent test functions in other files ( tools/rustev-conformance/src/runtime.rs, tests/runtime.rs, tools/rustev-release/release-set.json No issues found. The scripted backend correctly guards against index underflow ( {"head": "492eb631532a31e6bdc672f8672d81432f8af5fd", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/src/lib.rs", "line": 162, "summary": "File-read errors are silently swallowed via `.ok()`, reporting a generic 'no output' message instead of the actual I/O failure and making test diagnostics harder."},{"path": "tools/rustev-conformance/tests/cli.rs", "line": 33, "summary": "`std::env::set_current_dir` is a process-wide side effect; Cargo runs test functions in parallel by default, so any concurrent test that relies on the working directory would race non-deterministically with the repeated directory changes in this function."}]}Subject: b0e556a...492eb63, diff digest 0e04f4aa7468416ad2ab68d1477b78bb7a69e76a1fef61d4f1d01c7c20f0788e, 3 call(s). An AI comment is not an approval. |
b0e556a to
224c026
Compare
492eb63 to
973f512
Compare
AI review (findings)Group 1 of 3Reviewing the harvest infrastructure, conformance case fixtures, and supporting changes.
The The The None of these rise to actual bugs in the current usage pattern.
No Fixture/case JSON consistency Spot-checked SHA-256 values are all 64 hex characters. The case No security issues, correctness bugs, or material inconsistencies found in group 1. {"head": "973f512634321e34b430fb892964d99562380812", "verdict": "no-findings", "findings": []}Group 2 of 3Reviewing the fixtures in group 2. All files are new (no prior baseline), so I'm checking internal consistency and cross-file coherence. Refusal test cases (refusal-01 through refusal-17): Each definition fixture is deliberately malformed to exercise a distinct rejection path:
All these appear intentional and internally consistent with their named purpose. Normal fixtures (lodging., support.):
No bugs, security issues, or meaningful inconsistencies found. {"head": "973f512634321e34b430fb892964d99562380812", "verdict": "no-findings", "findings": []}Group 3 of 3Looking at the three source files and three test files in this review group.
The
No correctness bugs found. The
Two issues:
{"head": "973f512634321e34b430fb892964d99562380812", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/tests/cli.rs", "line": 38, "summary": "set_current_dir is process-global and races with other test threads running in parallel, which can cause flaky failures in any concurrent test that resolves a relative path."}, {"path": "tools/rustev-conformance/tests/cli.rs", "line": 50, "summary": "read_dir(...).count() counts all directory entries regardless of extension, so any non-JSON file or subdirectory added to the golden directory would skew the coverage assertion."}]}Subject: 224c026...973f512, diff digest 0e04f4aa7468416ad2ab68d1477b78bb7a69e76a1fef61d4f1d01c7c20f0788e, 3 call(s). An AI comment is not an approval. |
224c026 to
edcb709
Compare
973f512 to
d3ddd6f
Compare
AI review (findings)Group 1 of 3Reviewing the diff group for bugs, security issues, and inconsistencies.
The for names in [&[][..], &["receipt"][..]] { ... } // stdout
for names in [&[][..], &["timing"][..]] { ... } // written filesIf any future golden requires a normalization other than .unwrap_or_else(|| panic!("golden {name} is no output of {:?}", seen.args))This is an implicit closed-world assumption: adding a third normalization kind anywhere in the CLI tests silently breaks
The case Everything else looks correct: SHA-256 values are 64 hex characters throughout, the {"head": "d3ddd6f7fecfdeea65153a9d152b0add688dfcdf", "verdict": "findings", "findings": [{"path": "crates/rustev-cli/tests/common/harvest.rs", "line": 153, "summary": "locate() hardcodes only [\"receipt\"] and [\"timing\"] as normalizations to probe; any future golden using a different normalization will cause harvest::golden() to panic with a misleading message rather than a compile or schema error."}, {"path": "crates/rustev-cli/tests/common/harvest.rs", "line": 170, "summary": "Case ID for a multi-golden invocation is silently determined by whichever golden() call arrives first; reordering cli_golden calls in a test would regenerate case files with wrong IDs and fixture paths, with no static enforcement of the required ordering."}]}Group 2 of 3Looking at this group of new conformance fixture files, I checked internal consistency of IDs and digests, intentional flaw design in refusal cases, and cross-fixture coherence. Refusal case flaws (intentional by design):
Genuine concern — refusal-01:
Everything else checks out:
{"head": "d3ddd6f7fecfdeea65153a9d152b0add688dfcdf", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/fixtures/cli/refusal-01/cat-01.definition.json", "line": 1, "summary": "The top-level JSON object contains two 'name' keys ('x' then 'support-routing'); with serde_json's default last-value semantics the definition parses as name='support-routing' (identical to a valid definition), so this conformance case would receive a success instead of a refusal and never exercise the intended rejection path."}]}Group 3 of 3Looking at the three source files and two test files in this group:
Some(l) if !l.is_empty() => l[n.min(l.len()) - 1].clone(),When
let goldens =
std::fs::read_dir(rustev_conformance::root().join("crates/rustev-cli/tests/golden"))
.unwrap()
.count();
Everything else looks correct: the SHA-256 pinning, the {"head": "d3ddd6f7fecfdeea65153a9d152b0add688dfcdf", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/src/runtime.rs", "line": 210, "summary": "Scripted::answer computes n.min(l.len()) - 1 which panics on underflow when n == 0; the only call site guards with .max(1) but the function itself does not enforce this precondition."}, {"path": "tools/rustev-conformance/tests/cli.rs", "line": 47, "summary": "read_dir(...).count() counts all directory entries including non-JSON files, making the golden-coverage assertion fragile and inconsistent with the filter applied when building the covered set."}]}Subject: edcb709...d3ddd6f, diff digest 0e04f4aa7468416ad2ab68d1477b78bb7a69e76a1fef61d4f1d01c7c20f0788e, 3 call(s). An AI comment is not an approval. |
edcb709 to
541973e
Compare
4970460 to
ff4477d
Compare
AI review (findings)Group 1 of 3Reviewing group 1 of the PR, which adds
s.written = all
.into_iter()
.filter(|(name, bytes)| s.inputs.get(name) != Some(bytes))
.collect();Any file already present in the scratch directory before the invocation whose name was not passed as a CLI argument — and therefore not captured by
let mut entries: Vec<_> = std::fs::read_dir(path).unwrap().flatten().collect();
The crate lists No security issues, no digest inconsistencies between individual case files and the manifest (spot-checked several), and no structural problems in the Makefile targets. {"head": "ff4477da4bb97bf6cd43cb1dd910436495d619f2", "verdict": "findings", "findings": [{"path": "crates/rustev-cli/tests/common/harvest.rs", "line": 97, "summary": "after() treats every pre-existing scratch-directory file absent from inputs as a CLI-written output, because absence from the inputs map always satisfies the != predicate, making the written-file detection logically incorrect."}, {"path": "crates/rustev-cli/tests/common/harvest.rs", "line": 53, "summary": "files() uses .flatten() on the ReadDir iterator, silently discarding any DirEntry errors and potentially omitting files from both the inputs and written maps without any diagnostic."}]}Group 2 of 3This group is all new conformance fixture files — JSON test data for the Refusal fixtures (01–12, 16–17): Each contains exactly one deliberate defect that should trigger a compile/validation refusal. All are intentional:
Non-refusal fixtures: lodging and support run/show/replay/check bundles are internally consistent. Plan digests, snapshot digests, and supply entries match their embedded Runtime fixtures: The two descriptor files sharing artifact No unintentional bugs found. {"head": "ff4477da4bb97bf6cd43cb1dd910436495d619f2", "verdict": "no-findings", "findings": []}Group 3 of 3Reviewing the three source files, three test files, and the release-set update.
std::env::set_current_dir(&dir).unwrap();
let exit = rustev_cli::execute(&case.argv, &rustev_cli::Context::default());
std::env::set_current_dir(&start).unwrap();
(None, Some(f)) => std::fs::read(dir.join(f)).ok(),
Some(l) if !l.is_empty() => l[n.clamp(1, l.len()) - 1].clone(),The comment says "Attempts count from 1; a 0 reads as the first," but the caller already calls
#[path = "../../../crates/rustev-core/tests/common/mod.rs"]
mod core;Shadowing the built-in {"head": "ff4477da4bb97bf6cd43cb1dd910436495d619f2", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/tests/cli.rs", "line": 32, "summary": "`set_current_dir` mutates process-global CWD without a lock; concurrent test threads can race on it, and a panic in `execute` skips the restore, corrupting CWD for subsequent loop iterations."}, {"path": "tools/rustev-conformance/src/lib.rs", "line": 146, "summary": "`std::fs::read(...).ok()` silently swallows IO errors, reporting a permission-denied or path-error as an uninformative 'no output' message instead of the underlying cause."}, {"path": "tools/rustev-conformance/tests/runtime.rs", "line": 4, "summary": "`#[path]` import of `rustev-core`'s internal test helpers crosses crate boundaries without a Cargo edge, and shadows the built-in `core` crate name throughout the file."}]}Subject: 541973e...ff4477d, diff digest 0bea81b42f416c9d0f9245a1b9c16d185c3a33fc2b480a885c953550d96f49a8, 3 call(s). An AI comment is not an approval. |
541973e to
ce4d0ae
Compare
ff4477d to
1ad8617
Compare
ce4d0ae to
ff95d0a
Compare
1ad8617 to
d5bd2a0
Compare
ff95d0a to
e5ada90
Compare
d5bd2a0 to
88a7b22
Compare
AI review (findings)Group 1 of 3Reviewing the changed files in group 1: the new
At the point where an existing case file is read back before appending a second output (line ~197): let mut case: Json = std::fs::read(&path)
.ok()
.and_then(|b| serde_json::from_slice(&b).ok()) // error silently dropped
.unwrap_or_else(|| { json!({ "id": id, ... }) });If
In the loop at ~line 78: for a in args {
let p = dir.join(a);
if !a.is_empty() && !a.starts_with('-') && p.exists() {
files(dir, &p, &mut inputs);
}
}Values like JSON fixture files — one SHA-256 looks anomalously short In "sha256": "84ae4058639f7be842f15950e19e72a2cfa8758721420cc2ec3314906e884a98"This is 63 hex characters; a SHA-256 digest is always 64. The same truncated hash appears across all six fixture directories that share that plan ( {
"head": "88a7b2278fba48e498818dde3e4b188f0edf83ab",
"verdict": "findings",
"findings": [
{
"path": "crates/rustev-cli/tests/common/harvest.rs",
"line": 197,
"summary": "serde_json::from_slice error is silently swallowed via .ok(), so a malformed existing case file is quietly replaced with a fresh object, discarding all previously harvested outputs for that case."
},
{
"path": "tools/rustev-conformance/cases/cli/actionable.run-needs.json",
"line": 26,
"summary": "The SHA-256 digest for actionable.plan.json is 63 hex characters instead of the required 64, and the same truncated hash is repeated across all six case files and the manifest that reference this fixture."
}
]
}Group 2 of 3Reviewing the fixture files in this group. The content is predominantly intentionally invalid test data (refusal-01 through refusal-12, 16, 17) and reference bundles whose embedded digests and numerical values I've spot-checked for internal consistency. Numerical/logical cross-checks (lodging bundle) Suitability logits, softmax expectations, shortlist ordering, and weighted ranking scores in Intentional refusal fixtures (as expected) Each refusal case introduces one targeted defect (unknown op version in refusal-02, wrong input type in refusal-03, circular dependency in refusal-04, bad binding in refusal-05, uncalibrated threshold without declaration in refusal-06, budget too low in refusal-07, missing Genuine finding
{
"head": "88a7b2278fba48e498818dde3e4b188f0edf83ab",
"verdict": "findings",
"findings": [
{
"path": "tools/rustev-conformance/fixtures/cli/refusal-01/cat-01.definition.json",
"line": 1,
"summary": "Duplicate top-level JSON key 'name' ('x' then 'support-routing'): serde_json last-wins semantics will silently use 'support-routing', likely neutralising the intended refusal condition."
}
]
}Group 3 of 3Reading through the three source files and the release-set entry.
std::fs::read(root().join(path))A case file whose
The same pattern appears for the input let p = dir.join(&i.name);
std::fs::create_dir_all(p.parent().unwrap()).unwrap();
std::fs::write(p, bytes).unwrap();
In let (result, charge) = match answer {
Answer::Output { output, charge } => ...,
Answer::Fail { .. } => ...,
Answer::Gate => std::future::pending().await, // ← reachable
};If
pub fn normalize_receipt(out: &mut Json) {
out["receipt"] = "<normalized>".into();
}
Entry is correctly structured and consistent with the other exclusion entries. No issue. {"head": "88a7b2278fba48e498818dde3e4b188f0edf83ab", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/src/lib.rs", "line": 119, "summary": "pinned() joins a manifest-supplied path string directly to the repo root without sanitization, enabling path traversal to read arbitrary files on the CI runner."}, {"path": "tools/rustev-conformance/tests/cli.rs", "line": 34, "summary": "Input files are written via dir.join(&i.name) where i.name is manifest-controlled, enabling path traversal to write arbitrary files outside the per-case temp directory."}, {"path": "tools/rustev-conformance/src/runtime.rs", "line": 339, "summary": "The inner match on the resolved answer includes an Answer::Gate arm that calls pending().await, which is reachable when on_release maps a task to Gate and silently hangs the task for 30 seconds."}, {"path": "tools/rustev-conformance/src/normalize.rs", "line": 26, "summary": "normalize_receipt inserts the receipt key via serde_json index-assign even when absent, potentially causing a false match for outputs that legitimately have no receipt field."}]}Subject: e5ada90...88a7b22, diff digest 2198a867e57cd86fb7c02f74766e340d888b948ab1bfeb90b72b289eabc06da5, 3 call(s). An AI comment is not an approval. |
AI review (findings)Group 1 of 3Reviewing the group-1 files: Cargo.lock, Makefile, the new Cargo.lock / Cargo.toml — Clean. Makefile — The three-step harvest.rs —
mod.rs
Case and fixture JSON files
spec.md — Removing No bugs, security problems, or inconsistencies found. {"head": "c05f2728e73f7d2fc20c1d3d0f46f66a8843df5c", "verdict": "no-findings", "findings": []}Group 2 of 3Reviewing all the new fixture files in group 2. These are conformance test fixtures for CLI and runtime test cases. Finding: Duplicate JSON key in refusal-01 definition
With Rust's All other changed files look correct: the intentional defects in refusal-02 through refusal-17 are each clearly scoped (wrong op version, wrong list type, cyclic deps, bad binding, out-of-range request limit, missing on_unresolved entry, invalid fallback, missing calibration, duplicate step id, unknown step in execution policy, non-future-window actionability check). The lodging and support fixture data, bundle files, descriptor files, and runtime fixtures are internally consistent. {"head": "c05f2728e73f7d2fc20c1d3d0f46f66a8843df5c", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/fixtures/cli/refusal-01/cat-01.definition.json", "line": 1, "summary": "Duplicate top-level JSON key 'name': object opens with \"name\":\"x\" and later also contains \"name\":\"support-routing\"; serde_json's last-value-wins semantics silently ignores the first, making the definition appear valid and likely preventing the intended refusal from firing."}]}Group 3 of 3Reviewing the three source files, three test files, and the release-set addition.
In
All three print
The
The golden-coverage assertion counts distinct repository paths in manifest outputs against the number of
Temp-dir name for The
Clean exclusion entry; mirrors the existing {"head": "c05f2728e73f7d2fc20c1d3d0f46f66a8843df5c", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/src/lib.rs", "line": 169, "summary": "The wildcard arm in `compare` emits 'an output names one stream or one file' for an unrecognised stream name (e.g. 'stderr'), the both-set case, and the neither-set case, giving no indication of which violation occurred and making a misconfigured case file hard to diagnose."}]}Subject: b3ae816...c05f272, diff digest 542a819572a8c46836a731cfce29ad91319432f39d66f559de08629b5d5084a6, 3 call(s). An AI comment is not an approval. |
c05f272 to
836600a
Compare
AI review (findings)Group 1 of 3Reviewing the files in this group: the new
let probes: Vec<Vec<&str>> = std::iter::once(vec![])
.chain(super::normalize::NAMES.iter().map(|n| vec![*n]))
.collect();
Everything else checks out
{"head": "836600a81e363bc6dbfa3f8e67d74e0eda9dc4e0", "verdict": "findings", "findings": [{"path": "crates/rustev-cli/tests/common/harvest.rs", "line": 127, "summary": "locate() builds probes with only single normalizations; any golden requiring two normalizations applied together (e.g. [\"receipt\", \"timing\"]) will never match and will panic during harvest."}]}Group 2 of 3Reviewing the fixture files in this group for internal consistency, data correctness, and structural issues. refusal-01/cat-01.definition.json — The top-level JSON object has two All other fixture files look internally consistent:
{"head": "836600a81e363bc6dbfa3f8e67d74e0eda9dc4e0", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/fixtures/cli/refusal-01/cat-01.definition.json", "line": 1, "summary": "Top-level JSON object contains duplicate 'name' keys ('x' and 'support-routing' at the same level); serde_json silently discards the first, so the parser sees a valid 'support-routing' definition and the intended invalid condition for this refusal case is never exercised."}]}Group 3 of 3
The The path-safety in
The
The temp directory is removed before the failure assertion is evaluated (line ~60): let _ = std::fs::remove_dir_all(&base);
assert!(failures.is_empty(), "{failures:#?}");If
{"head": "836600a81e363bc6dbfa3f8e67d74e0eda9dc4e0", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/tests/cli.rs", "line": 60, "summary": "Temp directory is removed before the failure assertion fires, destroying actual CLI output files when a case diverges and making the failure unreproducible from the filesystem."}]}Subject: b3ae816...836600a, diff digest 35fc7d8c1eab89f087a37abd5d18027a4a878b093c55c0684475f033340c187d, 3 call(s). An AI comment is not an approval. |
836600a to
c7999ec
Compare
AI review (findings)Group 1 of 3Reviewing the changed files in group 1.
The harvest logic is well-structured for a developer tool. A few observations:
The cross-crate
The Case JSON files SHA-256 hashes are 64-character hex strings throughout. Identical fixture files shared across cases (e.g., the actionable plan) correctly show identical hashes. The Spec update Removing No bugs or security issues found. {"head": "c7999ec2db7e14a4b86edbc50fce9d6e7e41e92a", "verdict": "no-findings", "findings": []}Group 2 of 3Reviewing the fixture files in group 2. These are conformance test data files — most are intentional "bad" fixtures for refusal test cases. Let me verify internal consistency. Verified correct (intentional defects in refusal fixtures):
Verified numerically consistent: lodging-emb bundle — suitability logits, ranking scores, shortlist ordering, eligibility filter, and FX conversion all check out against the rules in Finding: {"head": "c7999ec2db7e14a4b86edbc50fce9d6e7e41e92a", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/fixtures/cli/refusal-01/cat-01.definition.json", "line": 1, "summary": "Duplicate top-level JSON key 'name' ('x' then 'support-routing') — serde_json silently keeps the last value, making the definition identical to a valid one and potentially nullifying whatever refusal this fixture is meant to exercise."}]}Group 3 of 3Two issues found across the reviewed files. 1. Output file path not validated in
(None, Some(f)) => match std::fs::read(dir.join(f)) {A case output with 2. Temp directory deleted before assertion fires ( In let v = compare(c, 0, b"", &dir);
let _ = std::fs::remove_dir_all(&dir); // ← deleted here
assert!(v.is_empty(), "{v:#?}"); // ← already gone on failureThe CLI test ( {"head": "c7999ec2db7e14a4b86edbc50fce9d6e7e41e92a", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/src/lib.rs", "line": 163, "summary": "Output `file` values are joined with `dir` without `contained()` validation, unlike input names, allowing path traversal outside the temp directory."}, {"path": "tools/rustev-conformance/tests/runtime.rs", "line": 415, "summary": "The temp directory is removed before the assertion fires, so produced outputs that differ from the golden are deleted before they can be inspected, unlike the CLI test which preserves them on failure."}]}Subject: b3ae816...c7999ec, diff digest 027afdc93a65ba28a6db3c75258a5167c718546be19ac36d003191585e4bef20, 3 call(s). An AI comment is not an approval. |
c7999ec to
116fbd7
Compare
AI review (findings)Group 1 of 3Reviewing the diff carefully across the harvest infrastructure, case files, and supporting changes.
The if !a.is_empty() && !a.starts_with('-') && p.exists() {This correctly skips flags, non-path tokens (subcommands like The The The multi-golden case (e.g.,
The Case files / manifest SHA-256 values in individual case files match the manifest exactly (spot-checked Makefile The No bugs, security issues, or inconsistencies found in the files assigned to this group. {"head": "116fbd7148012f9debc16eea5d72552053103a25", "verdict": "no-findings", "findings": []}Group 2 of 3Reviewing the fixture files for correctness and internal consistency. Finding: duplicate The file begins Other refusal mutations verified as intentional:
All other fixture data (digests cross-referencing within bundles, calibration artifact hashes matching between plan and calibration files, snapshot contents matching plan inputs) appears internally consistent. {"head": "116fbd7148012f9debc16eea5d72552053103a25", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/fixtures/cli/refusal-01/cat-01.definition.json", "line": 1, "summary": "Top-level JSON object has two 'name' keys ('name':'x' and 'name':'support-routing'); serde_json last-value-wins semantics silently discard the 'name':'x' mutation, rendering this refusal fixture ineffective."}]}Group 3 of 3Looking at the three source files, three test files, and the release-set update.
|
116fbd7 to
a7f99df
Compare
b3ae816 to
d3d5a34
Compare
b22983d to
ed80241
Compare
ed80241 to
f6e9940
Compare
AI review (findings)Group 1 of 2Reviewing the harvest machinery, conformance scaffolding, and case data.
let mut probes: Vec<Vec<&str>> = (0..1usize << names.len())
.map(|m| {
(0..names.len())
.filter(|i| m & (1 << i) != 0)
.map(|i| names[i])
.collect()
})
.collect();With
if !a.is_empty() && !a.starts_with('-') && p.exists() {
files(dir, &p, &mut inputs);
}Any non-flag argument that resolves to an existing file is treated as an input. For
pub fn normalize_timing(record: &mut Json) {
normalize::normalize_timing(record)
}The implementation is now in
{"head": "f6e99404a4b3ca9e08891c11c2834e606178c78e", "verdict": "findings", "findings": [{"path": "crates/rustev-cli/tests/common/harvest.rs", "line": 130, "summary": "locate builds 2^n normalization probes; exponential growth embedded in harvest path as each new normalization name doubles probe count."}, {"path": "crates/rustev-cli/tests/common/harvest.rs", "line": 87, "summary": "before captures any non-flag arg matching an existing file as an input, so an --out destination that already exists is erroneously included in the case inputs array."}, {"path": "crates/rustev-cli/tests/common/mod.rs", "line": 295, "summary": "normalize_timing now delegates to normalize::normalize_timing in group 2; if that implementation differs from the deleted inline code, existing CLI golden tests silently mismatch."}, {"path": "crates/rustev-cli/tests/common/harvest.rs", "line": 185, "summary": "golden re-writes fixture files on every call but does not refresh the case JSON inputs array when the file already exists, so fixture content and case SHA-256 values can diverge if conformance-harvest is run without the leading rm -rf."}]}Group 2 of 2Reviewing the changed files in this group.
// Both directories exist whenever the suite does; a missing one is
// an error naming it, never a silently smaller manifest.
for dir in ["cli"] {The comment says "both directories" but the slice contains only one entry. If a second surface directory is later added here, the comment is already wrong and may cause confusion about the invariant.
pub fn normalize_timing(record: &mut Json) {
record["timing"]["elapsed_ms"] = 0.into();
record["timing"]["queued_ms"] = 0.into();
Refusal fixture internal consistency (fixtures look intentionally mutated)
These are all intentional defects for refusal cases. No issue.
The {"head": "f6e99404a4b3ca9e08891c11c2834e606178c78e", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/src/lib.rs", "line": 111, "summary": "Comment claims 'Both directories exist' but the loop iterates only ['cli'], making the invariant statement factually wrong and likely to mislead when a second surface directory is added."}, {"path": "tools/rustev-conformance/src/normalize.rs", "line": 19, "summary": "normalize_timing uses serde_json IndexMut which silently inserts a 'timing' key (with zeroed sub-fields) when the output JSON does not already have one, causing a misleading 'differs' failure if mistakenly applied to a non-run output."}]}Subject: 1473a77...f6e9940, diff digest 8c9f5b654d45154882b757da77ce568379a7593dbb552acd17dbee8c0b13846e, 2 call(s). An AI comment is not an approval. |
f6e9940 to
bb605b5
Compare
AI review (findings)Group 1 of 2Review
|
bb605b5 to
7eed80e
Compare
AI review (findings)Group 1 of 2Reviewing the harvest infrastructure and conformance case files in group 1.
The The thread-local
The Case JSON files and All 29 cases are present (5 actionable, 6 lodging, 14 refusal, 6 support – with
The
The No bugs or security problems found that would affect runtime correctness. {"head": "7eed80e52193493cc8d950a34d992beea87c5eee", "verdict": "no-findings", "findings": []}Group 2 of 2Looking at the diff, I'll review the new Fixture defects (refusal-03 through refusal-12) are intentional — each Real bug — coverage assertion will fail: assert_eq!(covered.len(), goldens, "every CLI golden is covered");The REPO CONTEXT shows two golden files that have no corresponding conformance case anywhere in this PR's changed paths:
Neither a Minor —
{"head": "7eed80e52193493cc8d950a34d992beea87c5eee", "verdict": "findings", "findings": [{"path": "tools/rustev-conformance/tests/cli.rs", "line": 65, "summary": "assert_eq!(covered.len(), goldens) will fail: crates/rustev-cli/tests/golden/lodging.record.json and support.record.json are not referenced as outputs in any conformance case in this PR, so covered.len() (29) != goldens (31)."}]}Subject: 1473a77...7eed80e, diff digest 6e66e8d05f57c6853bf5c6c108477f617371dae774681c7a0da783556a6e4fad, 2 call(s). An AI comment is not an approval. |
AI review (no-findings)Group 1 of 2Reviewing the diff carefully across the new harvest infrastructure, conformance case files, and supporting changes.
Case files and manifest
No bugs, security issues, or inconsistencies found. {"head": "7c9d25b01a2c91bfaaca187d8b5e929f639d4d2a", "verdict": "no-findings", "findings": []}Group 2 of 2Reviewing the conformance fixture files and library code in group 2. Fixture files (refusal-03 through refusal-17, support. fixtures)* Each refusal fixture has a single intentional defect that distinguishes it from the valid support routing definition:
All support.* fixture files (check, compile, replay, run, show) match the canonical valid definition.
No bugs, security problems, or inconsistencies found. {"head": "7c9d25b01a2c91bfaaca187d8b5e929f639d4d2a", "verdict": "no-findings", "findings": []}Subject: 1473a77...7c9d25b, diff digest 506c66683bcba78ec930fd0c2657240b421b974c28619c24fc2677968d17b0f6, 2 call(s). An AI comment is not an approval. |
Spec 027, increment 4 (first change): the shared conformance suite, its manifest, and the Rust runner over every CLI golden. Stacked on #128.
tools/rustev-conformance(publish = false; excluded from the release set as repository tooling):cases/manifest.json(rustev.conformance-manifest/1) with 29 cases, one per CLI golden, each listing argv, exit code, inputs (repo path, name, SHA-256) and outputs (stdout or a written file, the golden by repo path and SHA-256, normalizations). CLI goldens are referenced in place, never copied.RUSTEV_HARVEST=1;make conformance-harvest): inputs as they were before the invocation, underfixtures/<case>/.receipt,timing), in one file shared by the CLI tests and the runners.make conformance(no Node toolchain) runs every case throughrustev_cli::executein a fresh directory and compares outputs and exit codes; tests also check full golden coverage, digests, thatplan_idis compared as bytes, and that a differing output or exit code is reported.eval/gateon the packaged tasks, and the bindings' surfaces follow in later changes.Second change (runtime cases as data, 3.12.4), folded in: five cases under
cases/runtime/mirroringadmission.rs,budget.rs,retry.rs,time.rsandcancel.rs(each names its test). A case declares plan/descriptor/calibration fixtures (built from spec 002's builders), runtime bounds, a scripted backend per registration (per-task answer sequences, cost, remote end, cancel answer, release answers), requests, and manual-clock driver steps.rustev_conformance::runtimeinterprets it with Rust seams; results and record bytes are committed underexpected/runtime/and compared without normalization, and the test checks each expected record against what the mirrored test asserts. The manifest is now the aggregate ofcases/cli/andcases/runtime/(drift-checked).Review round 1 (3 findings): (1)
sha2is a normal dependency ofrustev-cli, so its tests can use it; the harness says so. (2) Fixed: the files an invocation wrote are read as soon as it ends, so a file the test writes later is never taken for an output. (3) Fixed: a normalization that does not apply is reported as such, not as a difference; test added.Review round 2 (5 findings): fixed: the harvest probes no normalization and then each one
normalize::NAMESlists (one list besideapply); the scripted answer clamps the attempt number to the script; the coverage count counts JSON goldens only. Answered: the first golden a test pins names its case, and a reordering that renames it is reported by the manifest drift check (the harness says so); the refusal fixture with a repeatednamekey is refused by the bounded parser (duplicate keys are a category 1 refusal), which the case's golden shows and the runner reproduces.Review round 3 (5 findings): (1) fixed: the harvest snapshots the whole scratch directory before the invocation and takes as written only files new or changed against it. (2) fixed: a directory entry error panics instead of being skipped. (3) fixed: the CLI call changes the working directory under a process-wide lock through a guard that restores it on drop, panic included. (4) fixed: an output file that cannot be read is reported with its error; only a missing file is "no output". (5) The
#[path]inclusion of spec 002's shared builders is the repository's existing pattern (the CLI's tests include them the same way): source inclusion needs no crate edge and the builders' dependencies are this crate's dev-dependencies; the module is renamedbuildersso it no longer shadowscore, and the code says so. A re-harvest leaves every case unchanged except two replay bundles whose recorded run timing is wall-clock; the committed ones stay. Restacked on #128.Review round 4 (7 findings): (1) fixed: a case file that exists but does not parse fails the harvest instead of being replaced. (2) Every committed digest is 64 hex characters (all 322 checked), including actionable.plan.json's. (3) The duplicate
nameinrefusal-01/cat-01.definition.jsonis the point of that case: it is category 1's parse refusal, and its golden readsbounds: duplicate key "name" at byte 761; the bounded parser refuses duplicate keys rather than taking the last. (4, 5) fixed: a case's paths and input names must be relative paths of normal components (contained), so nothing is read or written outside its directory; tested. (6) fixed: a release answer that gates again is a script error, failed like a missing answer, so a gate never waits forever. (7) fixed: receipt normalization replaces only a receipt the output has.Review round 5 (4 findings): (1) Repeated: the duplicate
nameinrefusal-01/cat-01.definition.jsonis the case: the bounded parser refuses duplicate keys (its golden readsbounds: duplicate key "name"); serde_json's last-wins never runs. (2) fixed: a missing case directory or unreadable entry fails aggregation naming it. (3) fixed: the working-directory guard reports a failed restore while a panic unwinds instead of panicking twice. (4) fixed: each run's scratch directory is unique (process id and time) and created fresh.Review round 6 (2 findings): (1) Repeated a fourth time, so a test now pins it:
the_duplicate_key_case_is_the_parsers_refusal_of_itchecks thatrefusal-01's definition carries the top-levelnametwice (x, thensupport-routing) and that its golden is the bounded parser's refusal (duplicate key \"name\"); serde_json's last-wins never applies, because the bounded scan refuses duplicates first. (2) fixed: an output's stream-or-file error names which rule it broke (an unknown stream, both set, or neither).Review round 7 (3 findings): (1) fixed: the harvest tries every combination of the known normalizations, fewest first, so a golden needing
receiptandtimingtogether is found. (2) Repeated a fifth time, and the test added last round answers it: the bounded parser refuses the duplicate before serde_json would see it, and the case's golden is that refusal (duplicate key \"name\"), pinned bythe_duplicate_key_case_is_the_parsers_refusal_of_it. (3) fixed: on a divergence the scratch directory is kept and its path printed.Review round 8 (3 findings): (1) Repeated a sixth time; unchanged answer: the fixture's duplicate
nameis the case, andthe_duplicate_key_case_is_the_parsers_refusal_of_itpins that its golden is the bounded parser's refusal. (2) fixed: an output'sfilemust be a contained relative path too, like an input name. (3) fixed: the runtime runner's scratch directory is unique per case and run and is kept, with its path printed, when a case diverges.Review round 9 (3 findings, none a defect; the code now says why): (1) Repeated a seventh time: the duplicate
nameis the case under test, pinned bythe_duplicate_key_case_is_the_parsers_refusal_of_it. (2)runtime.deadlinesets no request deadline on purpose: the support plan's owndeadline_ms(2000) applies, and the case passes withdeadline_expiredtrue; the field's documentation says so. (3) An ignoring backend's never-ending future is the behavior under test: the runtime polls a cancelled attempt once (spec 003, 3.7.3), recordsnot_observedand ends the decision without it;runtime.cancelpasses on both runners. A comment at that arm says so.Split (the AI review was cancelled at its 15-minute limit twice): this PR is now increment 4's first change, the suite, its Rust runner and the 29 CLI cases; the runtime cases (
src/runtime.rs,tests/runtime.rs,cases/runtime,fixtures/runtime,expected/runtimeand their dependencies) move to a second PR stacked on this one, and #130 is restacked on that.Review round 10 (6 findings): (1, 6, and a defect they pointed at) fixed: the harvest no longer probes combinations of normalizations; each output gets exactly the normalizations its shape calls for (
normalize::applicable:receiptwhen it has a top-levelreceipt,timingwhen it hastiming). Probing let a run fast enough to time every step at 0 match with no normalization, or with a no-op one, and record a case that later runs would fail. A full re-harvest records every case exactly as committed. Normalizing also sets only fields an output has, never adding atimingkey. (2) By design: an--outthat already exists is an input; the no-clobber cases need it there for the CLI to refuse it, and the code says so. (3) The sharednormalize_timingis the one the CLI goldens now pass with; a difference would fail those tests, not pass silently. (4) fixed: a case file left from an earlier harvest must record the same inputs this harvest copied, or the harvest fails and says to rebuild. (5) fixed: the comment no longer says "both" directories.Review round 11 (4 findings): (1) Repeated: the shared
normalize_timingis in this PR (tools/rustev-conformance/src/normalize.rs) and is what the CLI's timing-normalized goldens pass with; a difference fails those tests by name. (2) fixed: the command words before the first flag are never probed as paths. (3) fixed in what it guards:normalize.rsstates it may use only what both crates depend on, and both crates compile it, so a stray import fails a build at once. (4) Not so: both record goldens are covered as the written outputs of thelodging.runandsupport.runcases, and the coverage test passes. A full re-harvest still records every case as committed.Review round 12 (1 finding, repeated, and wrong): the coverage set holds every golden any output pins, and each
runcase pins two (its printed output and its record), so all 31 goldens are covered by 29 cases; the test passes in CI. It now also asserts by name that both record goldens are covered.