From 647c328ae02170d6433f6976e1590975f306c859 Mon Sep 17 00:00:00 2001 From: joyful-ii-V-I <210578314+joyful-ii-V-I@users.noreply.github.com> Date: Sun, 22 Nov 2026 19:23:51 -0500 Subject: [PATCH 1/2] fix(qd): define fix= in the default legend when no row carries why= 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 b576a95e3). Co-Authored-By: Claude Opus 5.5 --- changelog.d/qd-fix-legend.md | 8 ++++++++ src/compactlegend.h | 3 +++ test/repeateddecisioncheck.sh | 23 ++++++++++++++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 changelog.d/qd-fix-legend.md diff --git a/changelog.d/qd-fix-legend.md b/changelog.d/qd-fix-legend.md new file mode 100644 index 000000000..65674fb0b --- /dev/null +++ b/changelog.d/qd-fix-legend.md @@ -0,0 +1,8 @@ +### Fixed — `--quality-delta` default legend now defines `fix=` on a row with no `why=` + +A complexity row carrying a repeated-decision facet (`fix="name the decision once: …"` or `fix="name the loop once: …"`) +has no `why=`, and the default (compact) legend defined `fix=` only inside the `why=` reading. A range whose printed +rows carried `fix=` without `why=` (for example one minor complexity row) therefore met an undefined attribute, and +`legendcoveragecheck` arm (G) failed with `quality-delta-refs-default | r@fix`. The compact dictionary now has its own +`r fix=` reading, which steps aside wherever an `r` row carries `why=`, so other answers keep their bytes. +`repeateddecisioncheck` arm (L2) pins it on a two-commit range. diff --git a/src/compactlegend.h b/src/compactlegend.h index 3fc39ecdf..b272fd129 100644 --- a/src/compactlegend.h +++ b/src/compactlegend.h @@ -1596,6 +1596,9 @@ inline constexpr CompactCompletenessTerm kCompactAttributeReadings[] = { "monster", "r monster=1: over 5x the ccx bar and grew by now-was (10+): major at any %; put the new branch in a helper", true, "r", MapHeaderRead::No, {}, "quality-delta" }, { "similar", "r similar=N: the params list is new or grew and holds N>=3 adjacent same-typed params (C/C++); a swapped call compiles; pass a named struct; never gates", true, "r", MapHeaderRead::No, {}, "quality-delta" }, { "why", "r why=: a tangle row's risen inputs, a minor clone row's differing operands or shrunk member, an unhandled-arm row's values with no outcome (add the arm or a default); fix=: the shape the row calls for, with lines", true, "r", MapHeaderRead::No, {}, "quality-delta" }, // also defines fix= + // QD-FIX-LEGEND: a repeated-decision row (complexity, sev=minor) carries fix= with no why=, so the row above never fires for it; + // this one steps aside wherever an r row carries why= (that row already defines fix=), so only fix-without-why answers gain bytes. + { "fix", "r fix=: the shape the row calls for, with lines; name the decision/loop once: one condition (6+ tokens) or loop body repeats at those lines; report-only", true, "r", MapHeaderRead::No, {}, "quality-delta", "r", "why" }, { "locals", "r locals=: a tangle row's steering locals (set in one step, read by a branch 10+ statements later)", true, "r", MapHeaderRead::No, {}, "quality-delta" }, { "ratchet", "r ratchet=TAG: a tangle row above its best since TAG (an input rose over its minimum); why= adds best since TAG", true, "r", MapHeaderRead::No, {}, "quality-delta" }, { "n", "improved n= more=: what this change made better, never a row or gating; i kind= sym= was= now= p=: over the kind's bar at baseline, lower now", true, "improved", MapHeaderRead::No, {}, "quality-delta" }, diff --git a/test/repeateddecisioncheck.sh b/test/repeateddecisioncheck.sh index 7fab783dc..3df43b1ad 100644 --- a/test/repeateddecisioncheck.sh +++ b/test/repeateddecisioncheck.sh @@ -18,7 +18,8 @@ # (S) the row's severity and gating are what they are without the facet: every row here is origin="new-symbol" # (C) PREMISE COUNT — all seven rows found; a missing row FAILS # (L) a document with the facet defines it (full legend); one without carries no such sentence -# Red-before: on a binary without the facet, P1 and P2 FAIL. Guard-off (no minimum condition length, no statement test, no +# (L2) the DEFAULT legend of a range whose minor complexity row carries fix= and no why= defines fix= (QD-FIX-LEGEND) +# Red-before: on a binary without the facet, P1 and P2 FAIL; on b576a95e3 (no compact fix= term), L2 FAILS. Guard-off (no minimum condition length, no statement test, no # bracket stop, overlapping repeats allowed): N2, N3, N4 and N5 FAIL. # # Usage: bash test/repeateddecisioncheck.sh [BIN] @@ -270,6 +271,26 @@ if [ "$rc0" != 0 ] && [ "$rc0" != 2 ]; then no "(L) the no-facet run failed (rc= elif ! printf '%s' "$FULL0" | grep -q '= 2 )$/ if( left > 9 \&\& mode == 0 ) { return 9; }\n if( left >= 2 )/' "$TMP/groups.h" >"$G/src/groups.h" +( cd "$G" && git commit -qam grow ) || { echo "git setup failed"; exit 2; } +RG="$( cd "$G" && "$BIN" "$G" --quality-delta=HEAD~1..HEAD --no-cache 2>/dev/null )" # status: exits 0 or 2 by design; the document is the verdict +L2ROW="$( printf '%s' "$RG" | tr '<' '\n' | grep '^r kind="complexity"' | grep 'sym="dropSilent"' | head -1 )" +L2LEG="$( printf '%s' "$RG" | sed -n '1s/-->.*//p' )" +case "$L2ROW" in + *'sev="minor"'*'fix="name the decision once: '*) case "$L2ROW" in *' why='*) no "(L2) premise: the row carries why= (row: $L2ROW)";; + *) case "$L2LEG" in *'fix='*) ok "(L2) the default legend defines fix= for a minor fix-only row";; + *) no "(L2) the default legend leaves fix= undefined (legend: ${L2LEG:0:200}...)";; esac;; esac;; + *) no "(L2) premise: no minor dropSilent row with a decision fix= (row: $L2ROW)";; +esac + echo [ "$fail" = 0 ] && { echo "ALL PASS"; exit 0; } echo "FAILURES"; exit 1 From f2973aa94c0e35ba1205185d4195e9cac9176d66 Mon Sep 17 00:00:00 2001 From: joyful-ii-V-I <210578314+joyful-ii-V-I@users.noreply.github.com> Date: Sun, 22 Nov 2026 19:41:28 -0500 Subject: [PATCH 2/2] docs(changelog): QD-FIX-LEGEND fragment notes the full legend was already 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 --- changelog.d/qd-fix-legend.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.d/qd-fix-legend.md b/changelog.d/qd-fix-legend.md index 65674fb0b..1285dfc5a 100644 --- a/changelog.d/qd-fix-legend.md +++ b/changelog.d/qd-fix-legend.md @@ -5,4 +5,5 @@ has no `why=`, and the default (compact) legend defined `fix=` only inside the ` rows carried `fix=` without `why=` (for example one minor complexity row) therefore met an undefined attribute, and `legendcoveragecheck` arm (G) failed with `quality-delta-refs-default | r@fix`. The compact dictionary now has its own `r fix=` reading, which steps aside wherever an `r` row carries `why=`, so other answers keep their bytes. -`repeateddecisioncheck` arm (L2) pins it on a two-commit range. +The full legend already carried the QD-REPEATED-DECISION sentence. `repeateddecisioncheck` arm (L2) pins the +default legend on a two-commit range.