Repository navigation
refactor(063): move the repeatability renderings into rustev-surface (increment 5, part 1) - #522
Conversation
AI review (findings)ReviewWhat the change doesThis PR extracts the file-orchestration logic for Analysis
Double preflight in Scorer-ID filename safety: Missing lower-bound on // crates/rustev-cli/src/repeat.rs – CLI import wrapper
pub fn import(p: &Parsed) -> Result<Res, Usage> {
if p.many("run").len() > 64 { // only checks upper bound
return usage("--run is given 1 to 64 times");
}
Ok(rustev_surface::repeat::import(...))
}The spec (and the surface layer) require 1–64 runs. The CLI wrapper only refuses No other concrete defects found. {"head": "befff33bd8b7ed84b853b35e664b462200e41fe5", "verdict": "findings", "findings": [{"path": "crates/rustev-cli/src/repeat.rs", "line": null, "severity": "low", "category": "correctness", "summary": "The CLI-level import wrapper only checks the upper bound (> 64) on --run count; zero runs bypass the usage-level guard and reach the surface layer, which rejects them with Done::invalid rather than the Usage error produced for the > 64 case, contradicting the '1 to 64 times' message."}]}Subject: 49fac12...befff33, diff digest e0f45b9dbf64f98c43164d2d81091efe250b2a771cb55dee9ad8a335f525457f, 1 call(s). An AI comment is not an approval. |
|
Review note: the finding on |
befff33 to
e64b726
Compare
AI review (no-findings)Reviewing this PR, which moves repeat-command file orchestration from Key areas examined:
The function inserts entries into a
New checks (empty bundles →
The check
Both
The default implementation is not atomic (preflights dirs then calls
Removes Spec 063 increment 5 The prose accurately describes what moved, the new No concrete defects found. {"head": "e64b726726686e82cba406cc5db276f8f4f80bb8", "verdict": "no-findings", "findings": []}Subject: 773d72f...e64b726, diff digest 8420a6f32000f3d7bce8026ce2fc621e2cb57f476b9aabdf05112d0126ce185f, 1 call(s). An AI comment is not an approval. |
e64b726 to
165f1df
Compare
AI review (findings)Reviewing the diff for bugs, security problems, and inconsistencies.
The implementation silently truncates by calling
The function preflights Mutation seeds ( Seeds referencing Spec 063 / archive-policy Increment 5 description matches the diff: two new surface source files, {"head": "165f1df45c5024bf34e5dee61a7026e1c9b1ae72", "verdict": "findings", "findings": [{"path": "crates/rustev-surface/src/repeat.rs", "line": 282, "severity": "low", "category": "correctness", "summary": "directories() calls list(dir, usize::MAX) so the filesystem host reads every directory entry before the 64-candidate cap fires, whereas the old code returned early after the 65th candidate; the redundant files.sort() in dependency_files (entries already arrive sorted from BTreeSet) is a minor redundancy."}, {"path": "crates/rustev-surface/src/repeat/host_sets.rs", "line": 213, "severity": "low", "category": "correctness", "summary": "import() preflights repeat-config.json, config.json, and repeat.json twice—once before computing their bytes and again in the comprehensive preflight loop—inconsistent with every other command's single-pass preflight."}]}Subject: 7fbca56...165f1df, diff digest 253052ae6adca2b3f03196f0ee77fff21771f8ef3e3a55d5189fd4b1e48ac29b, 1 call(s). An AI comment is not an approval. |
|
Review note for head 165f1df. Both findings are low severity and carried over from the code before the move. No code change.
What changed on this head: the dependency caps are public |
165f1df to
dc7a3c2
Compare
AI review (no-findings)Reviewing the diff: this PR moves the repeat/host-sets orchestration from
Archive policy — Mutation seeds — updated targets ( No concrete defects found. {"head": "dc7a3c2667adce369325cff554a91fe7157cef0e", "verdict": "no-findings", "findings": []}Subject: df67bc5...dc7a3c2, diff digest 187ab7831f7f2918d1246f43dced4b27d71c32178bcec395ccc1620601e585a7, 1 call(s). An AI comment is not an approval. |
dc7a3c2 to
ecff2bf
Compare
AI review (no-findings)Reviewing the diff carefully against governance rules, the existing test infrastructure, and the code's own invariants. Summary of changeThe PR moves repeat-command orchestration from Checks performed
Symlink handling: Staged publication: Host-dispatch pattern:
Archive policy / seeds / spec: No concrete bugs, security problems, or rule violations found. {"head": "ecff2bf2a4c09f5386e72369876681a4683133fc", "verdict": "no-findings", "findings": []}Subject: a9eeb9f...ecff2bf, diff digest ad4cbd4822fccd6e124b669fb822521a12cde38d26a8ca8a508acae06160c87b, 1 call(s). An AI comment is not an approval. |
ecff2bf to
5522a0f
Compare
AI review (findings)Reviewing the diff: a large refactor moving spec 029/061 repeat orchestration from
The implementation silently drops the lexicographically largest names when names.insert(name);
if names.len() > max {
names.pop_last();
}For the two callers this is correct:
if p.many("run").len() > 64 {
return usage("--run is given 1 to 64 times");
}The CLI guard checks only the upper bound. With zero
Both Everything else — the routing logic (provenance dispatch in {"head": "5522a0fad4eaa589e0b658c8e8efa7190fb27ab3", "verdict": "findings", "findings": [{"path": "crates/rustev-cli/src/repeat.rs", "line": null, "severity": "low", "category": "correctness", "summary": "The CLI-level import guard only checks the upper bound (> 64 runs) and not the lower bound (0 runs); zero --run arguments passes the CLI guard but then hits the library's !(1..=64) check, producing a Done::invalid error rather than the Usage error the guard was intended to emit."}]}Subject: 96b480c...5522a0f, diff digest 9ff224148b6a927738697d5388c905483443fcefea69bb4ba40ae298a95e9ab7, 1 call(s). An AI comment is not an approval. |
|
Review note: the finding on |
…(increment 5, part 1) The seven repeat renderings (eval and candidates with a repeat configuration, baseline record, reproducibility, diff, gate select and 061's import) move from crates/rustev-cli/src/repeat.rs and host_sets.rs into crates/rustev-surface/src/repeat.rs and src/repeat/host_sets.rs, with file I/O replaced by Host (spec 063 3.9.3, 3.9.4). Host gains list, entry_kind and write_all_in; the defaults refuse. The CLI keeps its usage rules, the live path and the hard-link publication and rollback, now its filesystem host's write_all_in, and calls the moved functions. CLI goldens and the repeat-* conformance bytes are unchanged without re-blessing. The archive lists follow the moved files; rustev-surface packages at 181,899 bytes unpacked (bound 262,144). Part 2 adds the memory host's listing and the Host::list tests.
…at seeds (increment 5, part 1)
rustev_cli::io::{MAX_RULES_FILES, MAX_DESCRIPTOR_FILES,
MAX_CALIBRATION_FILES} are public consts again (cargo-semver-checks does
not see a re-exported const), with their values taken from
rustev_surface::host, so one definition stays the source of truth.
Seven spec 029 seeds in crates/rustev-cli/mutation/seeds.py (run by the
acceptance of specs 006 and 029) anchored in code that moved to
crates/rustev-surface/src/repeat.rs; they now mutate it there and run
the CLI and surface tests. The seed for `eval diff` bypassing staged
publication survived once its anchor moved, because its old unit tests
exercised the publication helper rather than the command: the CLI's
tests/repeat.rs gains a test that runs `eval diff` on a host that
accepts only staged sets and compares the outputs with the diff goldens.
No seed is weakened or removed; no spec changes.
5522a0f to
ac181cf
Compare
AI review (findings)Reviewing the diff for bugs, security problems, and inconsistencies.
The CLI wrapper validates
The implementation keeps the names.insert(name);
if names.len() > max {
names.pop_last();
}The callers that matter are
Both No authority or ratification changes found. The spec 063 increment note is a data edit to a draft spec, not a lifecycle promotion. The archive-policy entries match the file movements. {"head": "ac181cf92b9db4aac82c36e6edf83fd78af41d47", "verdict": "findings", "findings": [{"path": "crates/rustev-cli/src/repeat.rs", "line": null, "severity": "low", "category": "correctness", "summary": "The import CLI wrapper checks only `> 64` for --run count, missing the lower bound; zero --run arguments bypass the usage error and reach the surface, which returns a runtime invalid error instead of a usage error with help text."}, {"path": "crates/rustev-cli/src/io.rs", "line": null, "severity": "low", "category": "correctness", "summary": "The list implementation silently keeps only the max lexicographically smallest names and drops the rest, which is undocumented in the host trait and could mislead a future caller that expects to see every entry up to its limit."}]}Subject: e9fe4c4...ac181cf, diff digest 704b674192a8bb2a2741ac8ce3ac0f8db4a6f3dcbf2a6b199b61f77c2de2468c, 1 call(s). An AI comment is not an approval. |
|
Review note on ac181cf (both findings low):
|
Spec 063 increment 5, part 1 (3.9.3, 3.9.4): the repeatability renderings move from
rustev-cliintorustev-surfacebehindHost. Part 2 (stacked) adds the memory host's listing and theHost::listtests.crates/rustev-cli/src/repeat.rs(the renderings) tocrates/rustev-surface/src/repeat.rs, andcrates/rustev-cli/src/host_sets.rs(061's import and host sets) tocrates/rustev-surface/src/repeat/host_sets.rs. Changed lines are the I/O seam only:joinbecomesHost::join,std::fs::read_dirbecomesHost::listplusHost::entry_kind,Path::existsbecomesentry_kind, the staged publication becomesHost::write_all_in, andParsedgives way to argument structs (EvalArgs,BaselineArgs,CompareArgs,SelectArgs,ImportArgs) withnow_msas an argument. An emptybundlesislive-source-unavailable.Hostgainslist(dir, max)(immediate names in byte order, at mostmax),entry_kind(without following links) andwrite_all_in(a set with its new directories, all or none). Defaults refuse listing and inspection;write_all_indefaults to preflight pluswrite_all.publish_outputswith its rollback tests; the filesystem host'swrite_all_inispublish_outputs. Single-file outputs (baseline record,gate select) still usewrite_allas before; the staged sets (eval,candidates,eval diff, import) usewrite_all_inas before. The dependency file caps now live once inrustev_surface::host.integrations/**untouched). CLI goldens and therepeat-*conformance expected bytes are unchanged, without re-blessing.rustev-surfacelists the two new files andrustev-clidropssrc/host_sets.rs.cargo package -p rustev-surfacegives 181,899 bytes unpacked (bound 262,144 on current main) and 46,568 bytes archived (bound 131,072), so this does not wait on spec(021): run the archive check in pull-request CI with doubled bounds (A-81) #516.The reviewed diff is large because
--no-renamesshows the moved files as whole additions;git diff -M origin/main...HEADshowshost_sets.rsas a rename, anddiffof the old CLIrepeat.rsagainst the new surface file shows only the seam changes above.Checks run locally:
cargo build --workspace --locked;cargo test -p rustev-surface -p rustev-cli -p rustev-conformance -p rustev-release --locked(full crate tests);cargo clippy --workspace --all-targets --locked -- -D warnings;cargo fmt --all --check;make boundaries;make gate.