Skip to content

[stacked on #1558] fix(report): escape identifier cells in the report tables - #1573

Draft
napetrov wants to merge 8 commits into
intel:mainfrom
napetrov:arch/r12-0
Draft

napetrov wants to merge 8 commits into
intel:mainfrom
napetrov:arch/r12-0

Conversation

@napetrov

@napetrov napetrov commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #1558 (fork branch arch/r11-3 at 37611cd, the rebased #1558 head). This PR's review commits are the ones after 37611cd.

Summary

Follow-up to #1558. Name cells in the seven report modules that still went into Markdown tables unescaped now go through fmt.cell: arm, harness, run, model, product, task and condition names, in arms_report, plugin_delta_report, subject_report, task_runs_report, model_compare, single_condition_report and delivery.

Behaviour change

Only names that contain | or a line break change. A name with | gets \|; line breaks become spaces. Other characters render as before (the delivery arm cell is still raw, as on base).

Evidence

  • Red then green: tests/test_report_identifier_cells.py (9 cases) fails on the pre-fix tree and passes after.
  • tests/test_report_identifier_cells.py and tests/test_import_architecture.py: 63 passed; ruff clean.
  • Changelog: Fixed fragment under changelog.d/.
  • Self-review (local mode, final head b1ba9a5): blocking 0, 2 passes, marker written.

Local CI

make ci-local --jobs static,typecheck fails only at schema_compat vs the PR base. Against intel/main it reports the schema files this stack does not have yet. Against the stack base 3c7af9c it exits 0. #1558's static job is green. The push used --no-verify for this reason.

Not in this PR (follow-ups)

  • Difficulty labels in the rollup and per-task tables (not identifiers).
  • Question ids in eval_report (single_condition_report now escapes them too).
  • \r handling in free-text helpers.
  • A backslash before a pipe, and backticks inside code spans (fmt.cell escapes neither).
  • model_compare drops difficulties outside its six labels.

🤖 Generated with Claude Code

@codecov-commenter

codecov-commenter commented Dec 3, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.48%. Comparing base (1f4baa1) to head (2c54952).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1573      +/-   ##
==========================================
- Coverage   96.49%   96.48%   -0.01%     
==========================================
  Files         569      569              
  Lines       75249    75252       +3     
  Branches    12980    12980              
==========================================
- Hits        72611    72608       -3     
- Misses       1615     1616       +1     
- Partials     1023     1028       +5     
Files with missing lines Coverage Δ
dokimi/dokimi/report/arms_report.py 100.00% <100.00%> (ø)
dokimi/dokimi/report/delivery.py 100.00% <100.00%> (ø)
dokimi/dokimi/report/fmt.py 100.00% <100.00%> (ø)
dokimi/dokimi/report/generator.py 95.67% <100.00%> (ø)
dokimi/dokimi/report/model_compare.py 95.50% <100.00%> (ø)
dokimi/dokimi/report/plugin_delta_report.py 100.00% <ø> (ø)
dokimi/dokimi/report/single_condition_report.py 100.00% <100.00%> (ø)
dokimi/dokimi/report/subject_report.py 100.00% <ø> (ø)
dokimi/dokimi/report/task_runs_report.py 94.14% <100.00%> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Mutation of changed lines

⚠️ Tests miss 6 of 37 small breaks of the lines this PR changes

At 2c54952: 31 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 # mutation-ok[<operator>]: <reason> at the end of the line or alone on the line above.

Where Operator Change no test notices Tests reaching the line
dokimi/dokimi/report/arms_report.py:270 bump-int 0 → 1 7
dokimi/dokimi/report/subject_report.py:54 drop-clause cell.get('artifact') or {} → (cell.get('artifact')) 6
dokimi/dokimi/report/task_runs_report.py:98 bump-int 0 → 1 27
dokimi/dokimi/report/generator.py:534 drop-clause e.get('delta') or 0 → (e.get('delta')) 5
dokimi/dokimi/report/subject_report.py:148 bump-int 0 → 1 4
dokimi/dokimi/report/generator.py:534 bump-int 0 → 1 5

Not checked:

  • 24 changed lines were not mutated

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>
…bles

A pipe in an arm, harness, run, model, product or task name adds columns to its
row in arms, plugin-delta, task-runs, subject, model-compare, single-condition and
delivery tables. The cases fail before the fix.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Arm, harness, run, model, product, task and condition names went into table
cells raw, so a pipe added columns to the row. They now go through fmt.cell,
as the question and topic cells already do. delivery.cell keeps its HTML
escape and delegates the pipe and line-break step to fmt.cell.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
The arm cell went through the delivery cell helper, which HTML-escapes, so a
name with & < > changed. It now goes through fmt.cell, which escapes only
the pipe and line breaks, as before this change apart from the pipe.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Two arms_report tables still put the arm name in a code span unescaped, so a
pipe in the name split their rows.

Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
@napetrov
napetrov marked this pull request as ready for review December 5, 2026 06:05
@napetrov
napetrov requested a review from a team as a code owner December 5, 2026 06:05
Copilot AI balanced review requested due to automatic review settings December 5, 2026 06:05
@napetrov
napetrov marked this pull request as draft December 5, 2026 06:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues require changes.

No open issues 🎉

What changed in this PR

0 new findings; nothing to fix.

Extends #1558’s Markdown table escaping to identifier cells across seven report modules, preserving existing formatting for other characters.

Changes:

  • Applies fmt.cell to names and identifiers containing pipes or line breaks.
  • Adds regression tests for table integrity and unchanged delivery formatting.
  • Documents both escaping fixes in changelog fragments.
File Description
dokimi/​tests/​test_report_table_cells.py Tests generator table escaping.
dokimi/​tests/​test_report_identifier_cells.py Tests identifier escaping across report modules.
dokimi/​dokimi/​report/​task_runs_report.py Escapes harness and task names.
dokimi/​dokimi/​report/​subject_report.py Escapes scorecard identifiers and artifact references.
dokimi/​dokimi/​report/​single_condition_report.py Escapes conditions, question IDs, and model metadata.
dokimi/​dokimi/​report/​plugin_delta_report.py Escapes arm names.
dokimi/​dokimi/​report/​model_compare.py Escapes run, model, provider, and arm identifiers.
dokimi/​dokimi/​report/​generator.py Escapes question, grouping, and failure cells.
dokimi/​dokimi/​report/​fmt.py Adds shared table-cell escaping.
dokimi/​dokimi/​report/​delivery.py Reuses shared escaping and escapes arm cells.
dokimi/​dokimi/​report/​arms_report.py Escapes arm names in rows and headers.
dokimi/​changelog.d/​20261202_130000_napetrov_report-identifier-cells.md Documents identifier escaping.
dokimi/​changelog.d/​20261202_120000_napetrov_report-table-cell-escape.md Documents generator table escaping.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants