Skip to content

fix(qd): the default legend defines fix= on a row with no why= - #727

Open
joyful-ii-V-I wants to merge 2 commits into
mainfrom
lane/qd-fix-legend
Open

joyful-ii-V-I wants to merge 2 commits into
mainfrom
lane/qd-fix-legend

Conversation

@joyful-ii-V-I

@joyful-ii-V-I joyful-ii-V-I commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

QD-FIX-LEGEND: the default quality-delta legend now defines fix= on a row that has no why=

Bug

--quality-delta=HEAD~5..HEAD can print a minor complexity row with a repeated-decision facet, for example
<r kind="complexity" sym="bindsVisitNode" … sev="minor" fix="name the decision once: … is tested at lines 7946 and 7961"/>.
The default (compact) legend did not define fix= for that row. So legendcoveragecheck arm (G) failed with
quality-delta-refs-default | r@fix whenever CI's merge-ref window held such a row. This blocked #720 and #722.

Root cause

The full legend was already correct: qdRepeatedDecisionLegendFor sees the row and prints the QD-REPEATED-DECISION
sentence. The default answer uses the compact dictionary in src/compactlegend.h instead. In that dictionary, fix=
was defined only inside the why= reading ({ "why", "r why=: …; fix=: …" } // also defines fix=). That reading
appears only when some r row carries why=, as tangle and clone rows do. A repeated-decision complexity row
carries fix= and no why=, so nothing defined it.

Fix

I added one compact term, r fix=, keyed to quality-delta <r> rows. It uses unlessTag="r" and unlessAttr="why",
so it steps aside wherever an r row carries why=, because that reading already defines fix=. Only answers with
fix= and no why= gain bytes. The term covers both name the decision once and name the loop once.

Evidence

  • Red first: repeateddecisioncheck arm (L2) builds a two-commit range in which one branch added to dropSilent
    gives a sev="minor" row with a decision fix= and no why=. It checks that the default legend defines fix=.
    It fails on main's binary (b576a95, rc=1) and passes on this branch (rc=0). No floor line was added to
    test/legendcoverage_g_baseline.txt.
  • Repro (785143c plus a merge of 1e4a76f): legendcoveragecheck is rc=1 (r@fix) with main's binary and rc=0
    with this branch's. The rows are byte-identical; only the legend comment grows.
  • Touched-file and pin gates: 32 of 32 rc=0. They are the gates that name compactlegend, the quality-delta legend
    gates, and versioncheck, printffmtparity, legenddrift, legendcoverage and compactlegend. The full suite was not
    run locally; it runs once in the train CI.
  • counts_snapshot.py check: all totals equal. scripts/qd_range.sh origin/main: PASS, 0 gating.
  • fire321 against base-cache b576a95: 321 compared, 0 changed (masked and raw). The --for answers do not use the new term. On the repro range the qd document grows by 154 B, all of it in the legend.

Credit: found while landing #720 and #722.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Clarified the compact quality-delta legend’s fix= reading for rows without why=.
  • Tests
    • Added coverage to verify the default legend explains fix= on a two-commit range.

joyful-ii-V-I and others added 2 commits November 22, 2026 19:23
A repeated-decision complexity row ("name the decision once" / "name the
loop once") carries fix= without why=, and the compact quality-delta
dictionary defined fix= only inside the why= reading. A range whose rows
held such a row met an undefined attribute and legendcoveragecheck (G)
failed with quality-delta-refs-default | r@fix (#720, #722).

Add an r fix= term that steps aside wherever an r row carries why=, so
only fix-without-why answers gain bytes. repeateddecisioncheck (L2) pins
it on a two-commit range with a minor row (red on b576a95).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eady right

The previous subject spelled an attribute (a trailing why=), which the
handoff root carries as subject= and legendcoveragecheck (G) then reads
as an undefined handoff@why on a local run; this subject spells none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Walkthrough

The compact quality-delta legend now defines fix= for r rows without why=. A test checks the default legend on a two-commit range, and a changelog entry records the update.

Changes: Quality-delta legend

Layer / File(s) Summary
Add and verify the fix legend
src/compactlegend.h, test/repeateddecisioncheck.sh, changelog.d/qd-fix-legend.md
The legend adds a fix= reading when an r row has no why=. The test checks the default legend on a generated two-commit range. The changelog records the update.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to f2973

This adds a legend reading for fix= on rows without why=, so the legend now defines every field that rows can show. It is a low-risk, narrowly scoped change with a regression test, and no merge-blocking concern remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the default quality-delta legend now defines fix= on a row that has no why=. The changeset adds a compact legend reading for r fix= rows without why=, which matches th…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the default quality-delta legend now defines fix= on a row that has no why=. The changeset adds a compact legend reading for r fix= rows without why=, which matches the title. The title uses the conventional fix(qd): prefix, is a single sentence, and avoids file lists or vague terms.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 785143c and f2973aa.

Files selected for processing: 3

  • changelog.d/qd-fix-legend.md
  • src/compactlegend.h
  • test/repeateddecisioncheck.sh

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@joyful-ii-V-I joyful-ii-V-I mentioned this pull request Nov 23, 2026
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.

1 participant