Repository navigation
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1558 +/- ##
==========================================
- Coverage 96.45% 96.44% -0.01%
==========================================
Files 575 575
Lines 75872 75902 +30
Branches 13076 13080 +4
==========================================
+ Hits 73179 73204 +25
Misses 1644 1644
- Partials 1049 1054 +5
🚀 New features to boost your workflow:
|
Mutation of changed linesAt f5bc6fb: 29 caught · 6 missed Each row is a small deliberate break (a mutant) of a line this PR changes that every test reaching that line still passes. Add a test that fails on it or, if it cannot change behaviour, put
Not checked:
Warning only: a missed break does not fail the job. Updated on every push; the full report is in the ci run summary. |
A question text, question ID or topic label with a raw `|` added columns to its Markdown row, and a line break ended the row early. Add fmt.cell and apply it to every data cell of the ReportGenerator tables. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…them Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the Markdown table-cell escaping changes.
No open issues 🎉
What changed in this PR
0 new findings; nothing to fix.
This PR protects ReportGenerator Markdown tables from pipes and line breaks in text values.
Changes:
- Adds a shared table-cell formatter.
- Applies escaping to question, topic/source, and failure-analysis tables.
- Adds regression tests and a changelog entry.
| File | Description |
|---|---|
dokimi/tests/test_report_table_cells.py |
Tests escaping and consistent row widths. |
dokimi/dokimi/report/generator.py |
Escapes text cells in affected tables. |
dokimi/dokimi/report/fmt.py |
Adds cell() to escape pipes and normalize line breaks. |
dokimi/changelog.d/20261202_120000_napetrov_report-table-cell-escape.md |
Documents the table-formatting fix. |
Review effort: Balanced
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 4 selected item(s). CI at Review details
|
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g87ACFvu Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
antonwolfy
left a comment
There was a problem hiding this comment.
LGTM. cell() keeps the rows intact for every case I tried, including the backslash-before-pipe case exai-bot raised, which the last commit fixed. One nit on a test gap.
What I ran, on a Linux review host at ec4394c:
make ci-local: 38 passed, 0 failed, 16 skipped (matrix legs on other Pythons and semgrep are not run locally).- Reproductions of
cell()through markdown-it with the table rule on, fora\|b,a|b, code spans with and without\|, an unclosed backtick, double-backtick spans, a trailing backslash, and line breaks inside a code span: every row keeps three cells and shows the original text. - A mutation check of the new tests (below).
Checked, no issues
- Pipes and backslashes:
a\|bbecomesa\\\|band renders asa\|bin one cell; code spans render their pipe literally. - Dependency:
markdown-it-pyis already a runtime dependency indokimi/pyproject.toml. - Scope: the PR text says the other report writers are left for a follow-up, and the diff matches that.
- DCO and changelog: all three non-merge commits carry
Signed-off-by, and the fragment is present.
vchamarthi
left a comment
There was a problem hiding this comment.
@napetrov, could you fix the small thing I've marked fix before merge (in the line comments) and fix what antonwolfy's thread on dokimi/dokimi/report/fmt.py:57 still points out? I'll approve once that's done.
I'll approve once that's done.
What I checked on ec4394c:
- When I changed the code on purpose, the tests still passed for 2 of 12 changes, and no test pins this one down yet (non-blocking):
dokimi/dokimi/report/generator.py:512(the call is dropped). - The 8 changed tests pass, and fail on main as expected.
- The full test suite passes with main merged in (36,076 tests), apart from failures main has too.
- It merges cleanly onto main.
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g87AFVBg Thread: PRR_kwDOVBg7g88AAAABcbSj7Q Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g87ALTgY Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRR_kwDOVBg7g88AAAABceUI-w Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
|
|
All 11 table-cell tests pass. Each new case fails when its corresponding mutation from the reviews is applied. |
vchamarthi
left a comment
There was a problem hiding this comment.
@napetrov, could you fix the small thing I've marked fix before merge (in the line comments)? I'll approve once that's done.
What I checked on 0cb2b98:
- When I changed the code on purpose, the tests still passed for 1 of 12 changes, and no test pins this one down yet (non-blocking):
dokimi/dokimi/report/fmt.py:32(it returns None). - The 11 changed tests pass, and fail on main as expected.
- The full test suite passes with main merged in (36,229 tests), apart from failures main has too.
- It merges cleanly onto main.
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g87AMkpl Thread: PRR_kwDOVBg7g88AAAABcfElzw Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
|
|
Summary
Markdown table cells in
ReportGenerator(Top/Bottom 10, Performance by Topic and Question Source, Failure Analysis) printed question text, question IDs, topic/source labels, diagnosis text and evidence raw. A|added columns to the row; a newline ended it.report/fmt.pygainscell(), which escapes the pipe and turns line breaks into spaces, and every data cell of those tables uses it. Numbers and fixed labels are unchanged.Evidence
tests/test_report_table_cells.py: red before the fix (2 failed,generator.pyunfixed), green after; the failure-row test pins the Failure Analysis escapes.make ci-local: the only failure istests/test_cli_fault_contract.py::test_a_bad_path_is_refused_as_the_quickstart_says[agent run], which fails the same way on the unmodified base. Report-related subset: 2980 passed.Other writers
Other writers with unescaped identifier cells (arm, harness, run and model names in
arms_report,plugin_delta_report,task_runs_report,subject_report,model_compare,delivery,single_condition_report) are not changed here. Their free text is already escaped; a follow-up can applyfmt.cellto them.🤖 Generated with Claude Code