Repository navigation
Conversation
REVIEW.md and AGENTS.md ask that a new raise/exit names the doc, contract or issue behind it, and a test of new behaviour cites the doc line it checks; an unclear requirement goes in the PR template's new Open questions section. scripts/list_new_error_paths.py lists the added sites for the reviewer. Signed-off-by: Petrov, Nikolay A <nikolay.a.petrov@intel.com>
…, quoted paths Signed-off-by: Petrov, Nikolay A <nikolay.a.petrov@intel.com>
There was a problem hiding this comment.
🟡 Changes recommended
The diff parser silently omits added error paths and tests when hunk content resembles file headers, filenames contain spaces, or Git disables path prefixes.
3 open issues
What changed in this PR
3 findings.
This PR adds contract traceability to dokimi’s author and review guidance, extending the earlier work on explicit error handling. It introduces a standalone listing tool without changing package code or adding a CI gate.
Changes:
- Require new error paths and tests to cite their supporting requirements.
- Add an Open questions section for unclear requirements.
- Add a diff-based listing script and tests for parsing and exit behavior.
| File | Description |
|---|---|
REVIEW.md |
Adds contract-traceability review criteria. |
dokimi/tests/test_list_new_error_paths.py |
Tests diff parsing and command exit behavior. |
dokimi/scripts/list_new_error_paths.py |
Lists added error-path and test lines for review. |
dokimi/changelog.d/20261113_120000_napetrov_contract-trace.md |
Documents the guidance and listing tool. |
AGENTS.md |
Adds author-side traceability and ambiguity checks. |
.github/pull_request_template.md |
Adds open questions and a traceability checklist item. |
Review effort: Balanced
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 4 selected item(s). CI at Review limit reached. This PR has had 6 reviews, so it will only be reviewed again when you ask. Review details
|
Header-like content rows inside a hunk no longer clear the path; tab-terminated headers for paths with spaces are kept; git is called with explicit a/ b/ prefixes and --inter-hunk-context=0; context rows count toward line numbers; 'sys.exit (2)' and 'SystemExit (2)' are listed; the shebang on the non-executable script is dropped; main is tested on a non-empty diff. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
Pushed 1 commit to
Threads: 7 fixed, 0 answered as not a defect. |
An external diff (diff.external, GIT_EXTERNAL_DIFF) or a textconv driver for *.py made git print no unified diff, so the listing was empty with exit 0. Pass --no-ext-diff and --no-textconv, with a real-git test for each. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #732 +/- ##
=======================================
Coverage 95.71% 95.72%
=======================================
Files 415 415
Lines 55346 55362 +16
Branches 9514 9516 +2
=======================================
+ Hits 52977 52993 +16
Misses 1466 1466
Partials 903 903 🚀 New features to boost your workflow:
|
xaleryb
left a comment
There was a problem hiding this comment.
Re-checked on a68aeb4 merged with main: with an external diff driver or a textconv driver configured, the script now lists the same error paths as a plain run (it listed 0 before); the full suite, ruff, mypy, bandit, the docs gate and the growth and comment-block checks pass, and CI is green. Left as a note: cleanup(); raise X on one line is still not listed; main has no such site today.
antonwolfy
left a comment
There was a problem hiding this comment.
The parser holds up: line numbers were right for multi-hunk diffs, renames, new and deleted files, and \ No newline rows, and the docs match the script. The nits inline are both silent omissions from the listing. The merge also waits for the question @xaleryb left to the author on cleanup(); raise X.
What I ran, on a Linux review host at c536fd9:
make ci-local: 31 passed, 1 failed, 14 skipped. The failure isRun tests: 19,961 passed, 2 errors, both pytest timeouts (>60s) intests/test_audit_test_quality.py, a file this PR does not touch. Run alone, that file passes (172 passed). Changed-line coverage passed.- Reproductions of the parser cases and mutations of the script (line counting, header guards, each git flag), against a real git repo.
- Every commit carries a
Signed-off-by.
Checked, no issues
- Usage lines:
python scripts/list_new_error_paths.py --base origin/mainfromdokimi/and thedokimi/scripts/form from the repo root both run. A bad--baseexits 2, an empty listing exits 0, as the changelog says. - Changelog fragment: category and style match the neighbouring fragments.
Bot points I checked that no longer apply at this head (7)
- Copilot's point on the trailing tab in a header for a path with spaces does not apply:
removesuffix("\t")drops it andtest_a_path_with_spaces_keeps_its_sitespins it. - Copilot's point on
--- old/+++ newcontent rows read as file headers does not apply: headers are read only between hunks, using the hunk line counts. - Copilot's point on
diff.noprefixdoes not apply:git diffis called with--src-prefix=a/ --dst-prefix=b/. - exai-bot's point on the shebang in a mode 100644 file does not apply: the shebang is gone and ruff passes.
- exai-bot's point on header-like content rows does not apply at this head: the parser tracks hunk line counts and reads headers only outside hunks.
- exai-bot's point on missing diff prefixes does not apply: the prefixes are passed explicitly.
- exai-bot's point on external diff and textconv drivers does not apply:
--no-ext-diff --no-textconvare passed and a real-git test covers both.
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Address review: a raise after `;` on the same line was not listed. Thread: PRRT_kwDOVBg7g863XCBK Thread: PRRT_kwDOVBg7g863fjv9 Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Address review: a path with a tab, a quote or a backslash arrives C-quoted and its sites were dropped. Thread: PRRT_kwDOVBg7g863b_rQ Thread: PRRT_kwDOVBg7g863fjwB Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g863TV2C: already fixed in 96e265c Thread: PRRT_kwDOVBg7g863TV2n: already fixed in 96e265c Thread: PRRT_kwDOVBg7g863TV3P: already fixed in 96e265c Thread: PRRT_kwDOVBg7g863TkqO: already fixed in 96e265c Thread: PRRT_kwDOVBg7g863Tkqb: already fixed in 96e265c Thread: PRRT_kwDOVBg7g863Tkqh: already fixed in 96e265c Thread: PRRT_kwDOVBg7g863Tzbh: already fixed in 96e265c Thread: PRRT_kwDOVBg7g863XCBV: already fixed in a68aeb4 Thread: IC_kwDOVBg7g88AAAABmXSS7g: already fixed in 4ac7838 Thread: PRR_kwDOVBg7g88AAAABX_t37w: already fixed in e9a13d9 Thread: IC_kwDOVBg7g88AAAABmckoFQ: already fixed in e9a13d9 Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
|
Address review: the parser reads `+` and `-` rows, so an output indicator set by the user's config would hide the added sites. The flags are now explicit; git 2.43 does not read diff.outputIndicatorNew from config, so the test pins the command line rather than a reproduction. Thread: PRRT_kwDOVBg7g863iMGT Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
antonwolfy
left a comment
There was a problem hiding this comment.
LGTM. The three commits since my last review fix both of my earlier nits: cleanup(); raise X is listed, and a git-quoted path such as "b/a\tb.py" is decoded before the b/ check. The explicit --output-indicator-* flags are pinned in the call. Two nits inline.
What I ran, on a Linux review host at abed276:
make ci-local: 31 passed, 2 failed, 14 skipped.Run tests,Coverage of changed lines, ruff, mypy, bandit,Fragment for package changes,Comment blocksand the docs build pass. The two failures areInstall gitleaks(an HTTP 504 on the download) andScan commits, which needs that binary. Neither touches this PR's files.- Real-git reproductions in a temporary repo with the LLM transport not involved: paths with a tab,
",\, a newline, a bell,;, a space,éand CJK all list their sites, and the run exits 0. - A mutation run of the new code: removing the
;alternative, changing the octal decoding or dropping any of the three--output-indicator-*flags is caught by the tests. - Every non-merge commit carries a
Signed-off-by.
Checked, no issues
- Docs against the script: the
scripts/...anddokimi/scripts/...usage lines both run, the exit codes (0, also when empty; 2 when git cannot diff) match the changelog fragment, and the docs-gate tests pass. - PR template,
REVIEW.mdandAGENTS.md: they say the same thing about tracing to a doc, contract or issue and about "Open questions".
Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
antonwolfy
left a comment
There was a problem hiding this comment.
LGTM. I pushed a commit per nit, up to 00f71c0, which fix the two nits from my review:
48092cd:REVIEW.md:30: the sentence now says the script lists a raise, a sys.exit or SystemExit call, or a literal exit_code=N, and that parser.error and return N refusals are not listed;AGENTS.mdand the changelog fragment say the same.00f71c0:dokimi/tests/test_list_new_error_paths.py:94: a parametrized test pins the a, b, n, v, f and r escapes of a git-quoted path.
make ci-local at 00f71c0: 31 passed, 2 failed (host: gitleaks download 504 and the scan that needs it), 14 skipped.

Summary
Codifies "new error paths and tests trace to the contract", taken from carver/unslop-code's min12 prompt (tests come from spec phrases, a new error path only where the spec can be quoted, unclear requirements go to an ambiguities note; erosion fell 0.58 → 0.15 on SlopCodeBench). Follows #729 (ruff BLE001/S110/S112).
Changes
REVIEW.md: a newraise/sys.exit/refusal no doc, contract or issue asks for, or a test of new behaviour that cites no doc line, is a defect to ask about; code built on a guessed requirement too.AGENTS.md"Before opening a PR": the author-side rule.dokimi/scripts/list_new_error_paths.py: lists addedraise,sys.exit,SystemExit(,exit_code=Nanddef test_lines in the--base...--headdiff of*.pyfiles aspath:line: kind: text. It judges nothing: exits 0 (also when empty), 2 when git cannot diff. Not wired into CI, since a listing is not a pass/fail signal.Risk
Docs and a standalone script; no package code changes.
Testing
tests/test_list_new_error_paths.py(diff parsing, deleted file,++-content row not taken as a header (mutation-checked), exit 2),tests/test_docs_code_refs.py,tests/test_audit_test_quality.py, ruff,check_comment_blocks.py. Not run: mypy and fullmake ci-local(no dev venv on this box).Open questions
list_new_error_paths.pybecome a CI step that posts its listing as a job summary? Left out here as it judges nothing.Revert
Plain revert; nothing persisted.
Local self-review (pr-review local mode, 2 passes): one blocking parse bug and two nits found and fixed.
🤖 Generated with Claude Code