Skip to content

Commit c86d86a

Browse files
claude[bot]claude
andauthored
fix(lint): say in the *When skip trailer that a skip is not a to-do item (#11708)
The skip list prints, per entry, why the PARSER could not read a layer. It never says what layer the fragment documents, and those are different questions: only the second decides whether a site could be re-authored. Read as a worklist, the list produced a measurably wrong triage. Three independent passes partitioned seven skips 4 re-authorable / 3 permanent; judging the sites first gave 1 / 6, and one of the "re-authorable" four was byte-identical to a skip the same ruling protected by name as a false red on correct documentation. Adds the framing sentence to the trailer and pins it, plus a guard that no rendered entry ever NAMES a layer the gate did not derive. Verdicts, counts and the discriminator are untouched: 14 admitted / 6 skipped on both sides. Claude-Session: https://claude.ai/code/session_015ahemw8RcTgqtxrj15PEZx Co-authored-by: Claude <noreply@anthropic.com>
1 parent e170b0a commit c86d86a

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

packages/lint/scripts/check-doc-formula-expressions.mjs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,30 @@ export function judgeFieldRule(slot, source) {
855855
/**
856856
* The skip report, as a pure function so "it is printed" is pinnable. Returns
857857
* the empty string only when there is genuinely nothing skipped.
858+
*
859+
* ## Why the trailer says what a skip is NOT (#11673)
860+
*
861+
* Each entry's reason names the structure the PARSER could not read a layer
862+
* off. That is the only thing this gate is entitled to say: the layer a
863+
* fragment DOCUMENTS is not derivable from the tree, and a skip entry that
864+
* confidently named one would be believed — the precise failure #11407 was
865+
* built to refuse. So the list quotes its difficulty and concludes nothing.
866+
*
867+
* The cost of that silence is measured, not hypothetical. Three independent
868+
* passes over #11651 (the report, the PM triage, the dispatch) read this list
869+
* as a WORKLIST and partitioned seven skips 4 re-authorable / 3 permanent;
870+
* judging the sites first gave 1 / 6. One of the "re-authorable" four was
871+
* `layout-dsl.mdx:863`, whose predicate is byte-identical to `pages.mdx:165` —
872+
* a skip the same ruling protected BY NAME as a false red on correct docs. The
873+
* two instructions contradicted each other and the contradiction was invisible.
874+
*
875+
* The failure was a framing error, not an information deficit, and that is why
876+
* the fix is a trailer sentence rather than per-entry context: #11651's own
877+
* report QUOTED the layer comments above `:821` and `:824` (`// e.g. on a
878+
* PageComponent`, `// e.g. on a FormSection / FormField`) and filed both under
879+
* "re-authorable" anyway. Per-entry context would have reprinted what that
880+
* author already had in hand and had already published. What was missing was
881+
* the instruction not to read the list as a worklist.
858882
*/
859883
export function renderFieldRuleSkips(skips) {
860884
if (skips.length === 0) return '';
@@ -868,6 +892,16 @@ export function renderFieldRuleSkips(skips) {
868892
' printed so the skips stay visible: a gate that skips in silence is the false-green this\n' +
869893
' surface exists to prevent, one level up.',
870894
);
895+
lines.push(
896+
'\n A skip is NOT a to-do item. Every reason above answers "why could this scan not read a\n' +
897+
' layer here?" — it never answers "what layer does this fragment document?". Those are\n' +
898+
' different questions, and only the second one decides whether a site could be re-authored,\n' +
899+
' so read the layer off the DOCUMENT before re-authoring anything listed here. Triaging this\n' +
900+
' list FROM the list has already gone wrong once: three independent passes partitioned it\n' +
901+
' 4 re-authorable / 3 permanent, where judging the sites first gave 1 / 6 — and one site in\n' +
902+
' the "re-authorable" half held a predicate that is correct exactly where it is (#11651,\n' +
903+
' #11673).',
904+
);
871905
return lines.join('\n');
872906
}
873907

@@ -1629,6 +1663,35 @@ const FIELD_RULE_REPORT_SELF_TEST_CASES = [
16291663
name: 'REPORT — an empty skip list renders nothing (no phantom section on a corpus with no skips)',
16301664
holds: () => renderFieldRuleSkips([]) === '',
16311665
},
1666+
{
1667+
// The trailer is the whole of #11673's fix, and it is a string nobody else
1668+
// reads — deleting it breaks no other assertion in this file and no gate
1669+
// anywhere goes red. Pin the two load-bearing halves: that a skip is not a
1670+
// to-do item, and that its layer comes from the document.
1671+
name: 'REPORT — the trailer says a skip is NOT a to-do item and that the layer comes from the document',
1672+
holds: () => {
1673+
const out = renderFieldRuleSkips([
1674+
{ where: 'content/docs/x.mdx:12', slot: 'visibleWhen', reason: 'because reasons' },
1675+
]);
1676+
return out.includes('A skip is NOT a to-do item')
1677+
&& /read the layer off the DOCUMENT before re-authoring/.test(out);
1678+
},
1679+
},
1680+
{
1681+
// And that it never becomes a CLAIM. The trailer may describe the list's
1682+
// status; the moment it names a layer for a site it did not derive, it has
1683+
// done the one thing #11407 exists to refuse. This is the guard on the fix
1684+
// itself, not on the gate.
1685+
name: 'REPORT — no rendered skip entry names a layer the gate did not derive',
1686+
holds: () => {
1687+
const out = renderFieldRuleSkips([
1688+
{ where: 'content/docs/x.mdx:12', slot: 'visibleWhen', reason: 'because reasons' },
1689+
]);
1690+
// The reason text and the trailer may DISCUSS layers in the abstract; what
1691+
// must never appear is a verdict sentence binding this site to one.
1692+
return !/\bthis (?:site|fragment|example) (?:is|documents|describes) (?:a|an|the)\b/i.test(out);
1693+
},
1694+
},
16321695
{
16331696
name: 'REPORT — the GREEN summary path still PRINTS the skip list, not merely its count',
16341697
holds: () => {

0 commit comments

Comments
 (0)