Repository navigation
072 increment 2: name a missing output directory before reading - #592
Conversation
AI review (no-findings)Reviewing the PR, which adds an output-directory pre-check (
Insertion points All callers insert Test changes
Spec 072 increment 2 The prose accurately describes the implementation; the claim "No golden or conformance case changed" is consistent with the changed paths. No concrete defects found. {"head": "972722b43a9dcc6a397b0143400960613cac604d", "verdict": "no-findings", "findings": []}Subject: 4e575a1...972722b, diff digest 7157e86aa1daa6acf8aa03e3eab2b708e980093b4cf9f96db778b1dd5c42100f, 1 call(s). An AI comment is not an approval. |
972722b to
55056be
Compare
AI review (no-findings)Reviewing the PR which adds output-directory pre-checks to the CLI (
The Call-site ordering Each handler calls
Test updates
Security
No concrete defects found. {"head": "55056be311a54bafd1ae9b32477ef0706d60de95", "verdict": "no-findings", "findings": []}Subject: 589185f...55056be, diff digest 7157e86aa1daa6acf8aa03e3eab2b708e980093b4cf9f96db778b1dd5c42100f, 1 call(s). An AI comment is not an approval. |
55056be to
c5cf056
Compare
AI review (no-findings)Reviewing the PR, which adds an output-directory precheck (
Call site ordering Each call site places Return-type consistency
Test changes
Archive policy and spec
No concrete defects found. {"head": "c5cf056783ad8abd4836c979c8ad3d386c22a634", "verdict": "no-findings", "findings": []}Subject: 694866c...c5cf056, diff digest 3558856fa4e3b31e94fadec9c0dc4d9ba6bad68109399a62cce00d040ea535ce, 1 call(s). An AI comment is not an approval. |
c5cf056 to
1045860
Compare
AI review (no-findings)Reviewing the diff for correctness, security, and consistency with the governance context.
Call-site consistency Commands returning Test changes
Spec and archive-policy The spec increment 2 prose matches the implementation exactly (flags enumerated, ordering guarantee stated, CLI-only placement justified). No concrete defects found. {"head": "1045860d30cef2b497a98f3eb65c8ae4c6ae7652", "verdict": "no-findings", "findings": []}Subject: dc60f26...1045860, diff digest f7e4148283a05faa3c7e51932c0f36e46edc9df6a680857a4e19729d11280d55, 1 call(s). An AI comment is not an approval. |
1045860 to
cf571d9
Compare
AI review (findings)Reviewing the new
One concrete defect in Err(e) if matches!(e.kind(), ErrorKind::NotFound | ErrorKind::NotADirectory) => {
let trimmed = dir.trim_end_matches('/');
match std::fs::metadata(trimmed) {
Ok(m) if !trimmed.is_empty() && !m.is_dir() => fail("is not a directory".into()),
_ => fail("output directory does not exist".into()), // ← line ~88
}
}When No high- or medium-severity bugs, security issues, authority changes, or ratification concerns were found. The spec increment 2 description matches the implementation. The archive-policy addition, the {"head": "cf571d99b4c72ac067c2e831fcd433799e17ec83", "verdict": "findings", "findings": [{"path": "crates/rustev-cli/src/outputs.rs", "line": 88, "severity": "low", "category": "correctness", "summary": "When a path component (not the leaf) is a regular file (e.g. 'somefile/subdir'), the second fs::metadata call also returns NotADirectory, falling through to 'output directory does not exist' rather than the more accurate 'is not a directory'."}]}Subject: aa1225e...cf571d9, diff digest 9cadf05ce89bcbb1c5eb9483769670d971aace7ab0da4131fdb2e690afebab2f, 1 call(s). An AI comment is not an approval. |
cf571d9 to
5317ed8
Compare
AI review (findings)Reviewing the new Core logic (
Call-site patterns Functions returning Ordering The check is inserted after usage-rule validation in every call site (confirmed for One concrete defect In // OUT_DIRECTORY path – filters empty:
dirs.extend(Some(out).filter(|d| !d.is_empty()));
// --store path – no filter:
if path == ["run"] && p.one("retain") == Some("external") {
dirs.extend(p.one("store")); // Some("") passes through
}An empty Other items
{"head": "5317ed8bed32df74920c110e018f8658253824bb", "verdict": "findings", "findings": [{"path": "crates/rustev-cli/src/outputs.rs", "line": 72, "severity": "low", "category": "correctness", "summary": "The --store accumulation in directories() lacks the empty-string filter present for --out, so an empty --store value passes check_directory(\"\") and produces a confusing io_error with an empty path instead of being silently skipped."}]}Subject: e31d409...5317ed8, diff digest 183d670a7decf9723330d519ebe00cf576cfb1f4e645016f99d7be8e850f3047, 1 call(s). An AI comment is not an approval. |
5317ed8 to
7960488
Compare
AI review (findings)Reviewing the diff against the governance context and spec 072. The change adds an output-directory precheck (
When
The module doc states the check runs "before any input is read". In Everything else looks correct: {"head": "7960488bc1f8621525534da3c95bb6ac551b9f1d", "verdict": "findings", "findings": [{"path": "crates/rustev-cli/src/outputs.rs", "line": 73, "severity": "low", "category": "correctness", "summary": "trim_end_matches('/') only strips POSIX forward-slash separators; on Windows, backslash-terminated paths skip the trailing-separator branch and fall through to the OS error message instead of the normalised 'output directory does not exist' wording."}]}Subject: e31d409...7960488, diff digest 83466c62e00b83cf0e4631d02f9d8b7c9d413f3f7d29985f269dfbe94ae3b7b1, 1 call(s). An AI comment is not an approval. |
Spec 072 increment 2 (3.2, R-1). Stacked on #588.
rustev eval --out basewith nobase/used to fail late withio_errornamingbase/dataset.jsonand the operating system's "No such file or directory". Spec 006 3.3.3's rule that output directories must already exist is unchanged; the refusal now comes first and names the directory.crates/rustev-cli/src/outputs.rsworks out, from the parsed flags, every directory a command writes into: the--outdirectory ofeval,eval candidates,eval diff,eval repeat importandcalibrate fit; the parent of every output file (--out,--markdown,--record-out,--bundle-out,--ledger-out);eval live's run directory parent and journal parent (unless--require-existing-journal); andrun --retain external's--store.io_error,paththe directory as given,detailoutput directory does not exist; a regular file in its place isis not a directory.Tests:
tests/io.rsadds the missing and not-a-directory cases foreval,run --bundle-outandplan compile, each checking exit 3, the full stdout, empty stderr and that nothing was created, plus an existing directory still reaching the original input refusal. Three existing tests relied on the old late failure and were adjusted:plan.rsnow expects the directory inpath;run.rs's post-decision bundle failure uses a read-only directory instead of a missing one (unix only);eval.rscreates the directory it writes into. No golden or conformance case changed.Local:
cargo test -p rustev-cli(full crate),cargo test -p rustev-conformance, clippy and fmt pass;make gatepasses;spec-spine couplereports no drift.Review note (cf571d9): d03e1826d39d is a false positive. For
somefile/subdir, the directory named does not exist (it cannot, sincesomefileis a file), sooutput directory does not existis accurate. Spec 072 3.2.2 reservesis not a directoryfor the path given being something other than a directory, which the code reports for bothfileandfile/; a non-directory ancestor is not that path.Review note (7960488): 58c5fc3661a4 does not apply to a shipped target. The
rustevCLI is released for darwin and linux only (thewin32-x64-msvcbuild inrelease.ymlis the Node binding, which does not useoutputs.rs), and on those targets/is the only separator. The trailing-separator branch only refinesfile/tois not a directory; a missing directory still getsoutput directory does not existthroughNotFound.