Repository navigation
test: pin review leftovers of #590, #595 and #472; read_json_input names an empty path - #753
antonwolfy wants to merge 9 commits into
Conversation
… a leaf usage error Settles the open mutants of the review of intel#590 (B3.4): the abbreviation check being always true, and `_LeafParser.error` ignoring the flag. No shipped leaf has `--json` next to another `--js*` option, so the ambiguity is pinned on a probe leaf with `--json` and `--jsonl` (`--jso` is no json request and prints no document), and on `catalog check`, whose `--jsonl` alone must not read as `--json`. `repo validate` and `repo validate . --cache-dir` without `--json` reach `_LeafParser.error`: stdout stays empty and the message is on stderr with exit 2. The `repo validate . --bogus` case was already pinned. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
…ng` and `skill routing` Settles the open mutant of the review of intel#595 (B1.1b): the `picks_flag` choice of `_conflict_hint_for` when no directory holds just one copy. Two skills named `review`, one in `review/` and one in `review/review/`, are held by no single directory, so no flag picks either. `catalog routing` says `no --keep-copies-under picks one of its copies` and never names `--against`; `skill routing` says `no --against or --keep-copies-under picks one of its copies`. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
…s veto Settles the open mutants of the review of intel#472 (B4.1): dropping `but`, or `while`, from the clause split of `_negated_before` passed the suite. "Do not use perf script but perf report --stdin" and "Never guess flags while you run perf report --stdin" are vetoed for `--stdin`, because the negation sits in the clause before the word and does not reach the command after it. Two controls with `or` and `when`, which end no clause, stay negated and pass. The tests sit in `tests/test_novelty_checks.py`, next to the other veto tests: `tests/test_reference_checks.py` has none for the identifiers check. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
…entifiers veto Settles the open mutants of the review of intel#472 (B4.2): dropping `avoid\w*`, or `without`, from `_NEGATED` passed the suite. "Avoid perf report --stdin", "Avoiding perf report --stdin is wise" and "Profile it without perf report --stdin" make no claim about `--stdin` and pass. The same sentences with a neutral word ("Try", "Using", "with") are vetoed, so the verdict of each depends on the word alone. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
Settles the open mutants of the review of intel#472 (B4.3): `overruled` comparing with `==`, `decided` not leaving the vetoed runs out, `judge_agreed` comparing with `!=`, and `checked_runs` fixed at 0 passed the suite. One call over seven runs with known verdicts asserts all six fields: a vetoed run the judge had passed, a run a sufficient check rescued, one it confirmed, one where the verdict and the judge differ but sit on the same side of the lenient collapse, a judge-decided run with checks, and a run with no checks and an errored one, which are left out. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
…d inside double quotes Found by a mutation sweep of `bundle_paths.py`: dropping `;` from `_ESCAPE_RE`, or from `_INNER_ESCAPE_RE`, passed the whole suite. A missing `assets/a\;b.svg` is named `assets/a;b.svg` whole, both bare (`_ESCAPE_RE`) and in double quotes (`_INNER_ESCAPE_RE`); without the escape the bare one is cut at the shell operator and the quoted one keeps its backslash. The tests sit next to the escaped-comma test. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
…d a bare submodule name is unresolved Settles the review comments on intel#706 about the L0 verdicts of a pinned repository with an undeclared, uninitialised submodule. On main, a gitlink at `third_party/mod` with no `.gitmodules` and a README claim `mod/` is `unresolved`, as the declared case is: `Scan.submodules` takes every gitlink and the bare-name lookup skips a name that only a submodule matches. `test_a_bare_submodule_name_is_unresolved_like_its_full_path` pins both cases, and breaking the gitlink part of `Scan.submodules` fails `test_a_submodule_without_a_gitmodules_entry_is_still_a_directory`. The contract now states it: a pinned snapshot's submodules are its `.gitmodules` paths and every gitlink, declared or not, and a bare name that matches only a submodule stays `unresolved`. Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
…reads `.` Settles the review comment on intel#637 (`--answers ""` names no path in its error): `Path("")` is `.`, so `eval score reference --answers ""` said `Error: --answers : Is a directory` with nothing after the flag. `read_json_input` now refuses an empty path first, as an `InputError` that quotes it: `--answers "": no file given`, or `cannot read "": no file given` without a flag. Exit stays 2, and every caller of the shared reader gets the same message. A unit test covers both forms and a CLI test runs `eval score reference --answers ""` through `cli.main`. Changelog fragment (Fixed). Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 9 selected item(s). CI at Review details
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #753 +/- ##
==========================================
+ Coverage 95.71% 95.73% +0.01%
==========================================
Files 414 415 +1
Lines 55310 55365 +55
Branches 9509 9517 +8
==========================================
+ Hits 52941 53003 +62
+ Misses 1466 1461 -5
+ Partials 903 901 -2
🚀 New features to boost your workflow:
|
load_questions turned "" into Path('.') before the shared reader saw
it, so --questions "" said 'Is a directory'. The raw value now goes to
read_json_input.
Drops the double-quoted \; case from the path-missing tests: inside
double quotes a backslash before ; is literal in a POSIX shell, so the
test pinned the wrong name.
Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
Pushed 1 commit to
Seen in files outside this PR, not changed here:
The PR description needs these corrections:
|
@vchamarthi (#753 (comment)): No code change. The description line now reads: " The |
|
Ready for another look at Follow-up issues opened:
|
Summary
Follow-up to the reviews of #590, #595, #472, #706 and #637, which left these points open. Each test below was a mutant that passed the whole suite on
main._json_requestedalways true, and_LeafParser.errorignoring the--jsonflag, both passed. No shipped leaf has--jsonnext to another--js*option (catalog checkhas--jsonland no--json), so the ambiguity is pinned on a probe leaf and oncatalog check.repo validate . --bogusis reported by the root parser, not the leaf, so the flag gate is pinned withrepo validateandrepo validate . --cache-dir; the--boguscase was already pinned.picks_flagin_conflict_hint_forflipped (if not all_vs_all) passed, because no test ran the no-holder branch.butorwhilefrom the clause split of_negated_before, droppingavoid\w*orwithoutfrom_NEGATED, and four mutants ofchecks_summarypassed.;in_ESCAPE_REand_INNER_ESCAPE_REofbundle_paths.py. Only the first is pinned here; the second swaps\;inside double quotes, where a shell keeps the backslash, so it is tracked as a defect instead of pinned. A third,len(nodes) > 0for_has_a_nodeinneeds.py, is already killed bytest_the_need_graph_caches_only_a_graph_with_a_node({"nodes": [{"text": ""}]}), so nothing changes there...after a gitlink directory as a checkout does #706 (thread 1, thread 2): onmain, a gitlink atthird_party/modwith no.gitmodulesand a README claimmod/isunresolved, the same as when it is declared. The ok_basename flip the first thread describes was fixed before fix(repo): a pinned source reads a..after a gitlink directory as a checkout does #706 merged, andtest_a_bare_submodule_name_is_unresolved_like_its_full_pathpins both cases. Breaking the gitlink part ofScan.submodulesfailstest_a_submodule_without_a_gitmodules_entry_is_still_a_directory. The contract did not say which paths count as submodules.eval score reference --answers ""readsPath(""), which is., and saysError: --answers : Is a directory, exit 2, with nothing after the flag.Changes
tests/test_cli_output.py: a probe leaf with--jsonand--jsonlreads--jsoas no--jsonrequest and prints no document;catalog check --jsois no request either;repo validateandrepo validate . --cache-dirwithout--jsonprint nothing on stdout, the message on stderr, exit 2.tests/test_novelty_routing_gaps.py: two skills namedreview, one inreview/and one inreview/review/, are held by no single directory.catalog routingsaysno --keep-copies-under picks one of its copiesand never names--against;skill routingsaysno --against or --keep-copies-under picks one of its copies.tests/test_novelty_checks.py: "Do not use perf script but perf report --stdin" and "Never guess flags while you run perf report --stdin" are vetoed, with controls (or,when) that stay negated; "Avoid", "Avoiding" and "without" beforeperf report --stdinmake no claim, and the same sentences with a neutral word are vetoed; onechecks_summarycall over seven runs asserts all six fields. The veto tests sit here, next to the other identifiers-veto tests, becausetests/test_reference_checks.pyhas none.tests/test_catalog_path_missing.py: a missingassets/a\;b.svgis namedassets/a;b.svgwhole when bare.dokimi/docs/repo-evaluation-contract.md: a pinned snapshot's submodules are its.gitmodulespaths and every gitlink, declared or not; a bare name matching only a submodule (mod/) isunresolved.dokimi/dokimi/utils.py:read_json_inputrefuses an empty path first, asInputError--answers "": no file given(cannot read "": no file givenwithout a flag). Exit stays 2.dokimi/dokimi/questions/artifact.py:load_questionshands the raw path toread_json_inputbefore it makes aPath, so--questions ""is refused by name too (--questions "": no file given).tests/test_load_or_fail.pycovers both forms,eval score reference --answers ""throughcli.main, andload_questions("", flag="--questions").read_json_inputchange.Risk
Only
read_json_inputand the wayload_questionscalls it change behaviour: an empty path, which was read as.and failed withIs a directory, is now refused by name; every caller still exits 2 with anInputError. A non-empty path is read unchanged. The other commits are tests and one doc sentence.Testing
On a Linux review host, at
58c79ee(onmainb4bcfa4):make ci-local: 31 passed, 2 failed, 14 skipped (the skips are the jobs that do not run on a PR, the other matrix legs, conda-forge, semgrep, fuzz). 20418 tests passed, 19 skipped; changed-line coverage 100% (2 lines). The 2 failures are the host:Install gitleaks(the download returned HTTP 504 four times) andScan commits(no gitleaks binary).eval score reference --answers "": onmainError: --answers : Is a directory; hereError: --answers "": no file given, exit 2._json_requestedabbreviation test always true (2 tests fail);_LeafParser.errorwithoutand self._json_argv(3);if not all_vs_allforpicks_flag(2);butdropped (1);whiledropped (1);avoid\w*dropped (2);withoutdropped (1);checks_summaryoverruled==,decidedwithoutnot in vetoed,judge_agreed!=,checked_runs0 (1 test, fails for each);;dropped from_ESCAPE_RE(1); the empty-path refusal removed (3).;dropped from_INNER_ESCAPE_REis not pinned: inside double quotes a shell keeps the backslash of\;, so the code's current name there is wrong and no test fixes it. The_ESCAPE_REmutant and_has_a_nodewithlen(nodes) > 0were run against the whole suite first: the escape mutant passed it, the_has_a_nodeone failedtest_the_need_graph_caches_only_a_graph_with_a_node...after a gitlink directory as a checkout does #706: with the gitlink part ofScan.submodulesremoved,test_a_submodule_without_a_gitmodules_entry_is_still_a_directoryfails; with the bare-name submodule filter removed, both cases oftest_a_bare_submodule_name_is_unresolved_like_its_full_pathfail. On the code before fix(repo): a pinned source reads a..after a gitlink directory as a checkout does #706 those tests pass, as the L0 verdicts were meant not to change.fix/run-wide-credentials,fix/url-extraction-delimitedonmainb4bcfa4:pytest -n auto20429 passed, 19 skipped,mypyclean (420 source files),ruff checkclean.Revert
A plain revert restores the old behaviour: an empty path reads as
.again, and the tests and the doc sentence go. Nothing is stored.Checklist
pytestpassesruff,mypy, and schema checks passAGENTS.md.github/.licenserc.yaml)