What the PR does. Upstream #13968 (buger; ff77cd02 + b2dae8db, the live head) replaces stripJsonc's two regexes with one string-aware scanner and makes parseMenuJsonc return no rows for an array root. It fixes #13250 (comma before } or ] inside a string was eaten), #13492 (array root became rows "0","1") and #13493 (an inline // emptied the file). b2dae8db also reads every JS whitespace character outside strings (BOM, NBSP, U+2000-200A, U+2028/9, U+3000, VT, FF) as a space. Mirror MenuModel.js = upstream b2dae8db plus trace comments; the other 12 commits are our proof work. This is an advisory audit of an upstream PR, not an approval.
Risk rationale: Small parser change. Each fix has differential and observed test evidence, all 127 differences match a requirement, and the fuzz found nothing worse than the base. But 135 compatibility changes are unapproved (prevents ready), the production QV4 runtime and its parse cost are untested, and upgraded users' previously-ignored extension files will start to apply.
Read the full review (5 more paragraphs)
Is the fix verified? Changed code is fully covered (17/17 decision lines, 34/34 decisions). Test results are current, 54/54 passed, and every obligation cell of the 6 parser requirements is observed_pass. I ran base vs head myself: each issue reproduces at base and is fixed at head. 200k fuzzed JSONC inputs showed no case where the head is worse than the base.
Compatibility. Readiness is not_assessed. Next decision: human_judgement (compat_changes_unapproved), by a reviewer under the approved policy @ 9f3abc10. 135 compat_change_unapproved disclosures prevent readiness. I checked all 127 differences: 123 are data inputs carrying a JS whitespace character, which go from parse error to parsed (BNZG); 4 are the issue reproducers (66FW, C8W1 x2, BMFE). 5 test_diff findings are tests renamed and flipped from expected failure to fixed; their assertions still hold or change as the issues require. All look intended to me. Only a human reviewer can approve them.
Questions for a human. (1) Does Quickshell's QV4 engine match node on /\s/ and on cost? The scanner is about 2.6x slower than the regexes in node, and no test runs it in QV4. (2) User extension files that loaded as empty before (inline comment, BOM, Unicode space) now load and can override shipped entries after an upgrade.
Traceability. stripJsonc and parseMenuJsonc are traced at function level: E4J2, 3T3F, 66FW, C8W1, BNZG, BMFE (4 added, 3 modified with PPDW). 23 requirements are code_changed only through file-level test traces. There are no spec-gap candidates, but change effects were not analyzed (effects_unavailable), so uncodified connections cannot be detected.
Not caused by this PR. KI-MENU-JSONC-CR-LINE-ENDINGS and -STRIP-GAPS stay open (verified: the PR does not change them). No gate fails. 14 checks were skipped by configuration.
AI-generated review opinion derived from the evidence package. It is not a verdict, does not change readiness, and must be confirmed by a human reviewer.
25 context notes (info — not a finding)
- AI · confirmed#13250: a comma is dropped only when the next token outside strings is } or ] (SW-REQ-260927-66FW, added)
The comma branch (MenuModel.js:26-38) looks ahead past whitespace and // comments and keeps the comma unless } or ] follows. String contents are copied verbatim (lines 13-19), so
"x, ]y"andmv f{.bak,}survive. I ran it on base and head: base gives labelx ]y, head givesx, ]y. - AI · confirmed#13493: a // comment outside strings is dropped wherever it starts on the line (SW-REQ-260928-C8W1, added)
Lines 23-25 skip to (not past) the next \n, so the tokens on either side stay apart;
1//c\n2is still rejected. I ran it: base gives 0 rows for{...} // note, head gives 1. The comment ends only at \n, so a CR-only file is unchanged (KI-MENU-JSONC-CR-LINE-ENDINGS stays open). - AI · confirmed#13492: an array root yields no rows (SW-REQ-260928-BMFE, added)
parseMenuJsonc adds
|| Array.isArray(parsed)to the non-object guard (MenuModel.js:100). I ran it: base gives rows0:a,1:b, head gives []. Array.isArray is realm-safe, so the engine's inventory note about instanceof across realms does not apply here. - AI · confirmedb2dae8db: JS whitespace outside strings becomes an ASCII space (SW-REQ-261001-BNZG, added)
Lines 39-42 map every /\s/ character except \n to ' ' (BOM, NBSP, U+1680, U+2000-200A, U+2028/9, U+202F, U+205F, U+3000, VT, FF, and also CR and tab, which JSON already accepts). Characters inside strings are untouched. This is in the live PR head, unlike the older mirror.
- AI · confirmedSW-REQ-260922-E4J2 (JSONC stripping) is reworded from full-line comments to comments outside string literals
The description now says "strips // comments and trailing commas outside string literals". It matches the scanner and the PR's docs/menu.md text.
- AI · confirmedSW-REQ-260922-3T3F (non-object input gives an empty set) changes only its rationale (array root)
Only the rationale changed; the clause text is unchanged.
- AI · confirmedSYS-REQ-260922-PPDW (default + user menu merge) is modified on the mirror
This is the parent of the parser requirements. The edit is our proof work, not upstream code; its nominal, boundary and error_handling cells are observed_pass.
- AI opinion — unverified23 requirements are code_changed only through file-level test traces
menumodel-replay.test.mjs, menu-test.sh and report-reproducers.test.mjs carry whole-file Verifies traces (flagged weak_mapping). These requirements share the test files; their own text did not change. Each shows observed passing tests. Their not_linked obligation cells (27 in all, e.g. CYB9 boundary, N3RM boundary/error_handling) have no tagged test and are NOT tested per class.
- AI opinion — unverifiedPurpose branches are covered and their obligation cells are observed passing
diffCoverage: 17/17 changed decision lines, 34/34 changed decisions, 0 uncovered (mcdc aggregate). testResults: junit, current, 54 passed / 0 failed. 66FW, C8W1, BMFE, BNZG, E4J2 and 3T3F have every obligation cell observed_pass (boundary, error_handling, malformed_input, input_domain, totality).
- AI opinion — unverifiedMirror composition: upstream product change vs dogfood proof work
edc18685 applies upstream b2dae8db (MenuModel.js, docs/menu.md, the PR's menu-test.sh block) onto quattro-proof 9f3abc10. I diffed the evaluated MenuModel.js against upstream b2dae8db: the only differences are
// Implements:and//mcdc:ignorecomment lines. The other 12 commits are our proof work: reworded/added requirements, witnesses, KI closures, re-review stamps, STE100 edits. - AI opinion — unverifiedRemoved whole-line-comment \s quirk is preserved (cf-39627352fe66ab9c, fixed)
At base,
\u00A0// notelines were removed whole by ^\s*. At head, the NBSP becomes a space and the comment is dropped, so the row count is the same. menu-test.sh pins this for BOM, NBSP, LSEP, IDEO, VT and FF before a comment. The older mirror's concern that ff77cd02 alone regressed this case no longer applies: b2dae8db is in the live head. - AI opinion — unverifiedDifferential: all 127 recorded differences checked; none unexplained
I checked every data-partition difference: each of the 123 inputs carries exactly one of VT, FF, NBSP, U+1680, U+2000-200A, U+2028, U+2029, U+202F, U+205F, U+3000 or BOM outside strings, and goes from strip_parse=ERR (0 rows) to object (0/2/344 rows, by seed). CR, CRLF, empty, huge and invalid-UTF-8 inputs showed no difference. The 4 corpus differences are the issue reproducers. Engine classification: intended with requirement (123 BNZG, 2 C8W1, 1 BMFE, 1 66FW). Separately, I fuzzed 200,000 random JSONC files (labels with , } ] / " \\ and Unicode spaces, random comments, trailing commas, CRLF): 165,528 same, 34,472 changed to the correct result, 0 changed to a wrong one. That fuzz is outside the package.
- AI · confirmedIntended difference bd-05efa2fff912da5a: #13493 reproducer (sample extension with inline comment tail): 0 to 3 rows
Base gives strip_parse=ERR or wrong rows; head gives the result SW-REQ-260928-C8W1 specifies. Recorded classification: intended (SW-REQ-260928-C8W1). I reproduced this class of input with node on base 9f3abc10 vs head MenuModel.js. Representative of its group; the other corpus differences follow the same pattern (see the differential finding).
- AI · confirmedIntended difference bd-41c905c2c01b5b15: #13493 reproducer (inline comment rows): 0 to 3 rows
Base gives strip_parse=ERR or wrong rows; head gives the result SW-REQ-260928-C8W1 specifies. Recorded classification: intended (SW-REQ-260928-C8W1). I reproduced this class of input with node on base 9f3abc10 vs head MenuModel.js. Representative of its group; the other corpus differences follow the same pattern (see the differential finding).
- AI · confirmedIntended difference bd-4453e5b664893137: #13492 array root: phantom rows 0,1 to no rows
Base gives strip_parse=ERR or wrong rows; head gives the result SW-REQ-260928-BMFE specifies. Recorded classification: intended (SW-REQ-260928-BMFE). I reproduced this class of input with node on base 9f3abc10 vs head MenuModel.js. Representative of its group; the other corpus differences follow the same pattern (see the differential finding).
- AI · confirmedIntended difference bd-9495f0dcccf57210: #13250 comma before } inside a label/description is kept
Base gives strip_parse=ERR or wrong rows; head gives the result SW-REQ-260927-66FW specifies. Recorded classification: intended (SW-REQ-260927-66FW). I reproduced this class of input with node on base 9f3abc10 vs head MenuModel.js. Representative of its group; the other corpus differences follow the same pattern (see the differential finding).
- AI · confirmedIntended difference bd-9746b2470668a698: BOM on every line of the shipped default menu: 0 to 344 rows
Base gives strip_parse=ERR or wrong rows; head gives the result SW-REQ-261001-BNZG specifies. Recorded classification: intended (SW-REQ-261001-BNZG). I reproduced this class of input with node on base 9f3abc10 vs head MenuModel.js. Representative of its group; the other 122 data differences follow the same pattern (see the differential finding).
- AI · confirmedIntended difference bd-37bfadd5b04e9651: NBSP indenting the shipped default menu: 0 to 344 rows
Base gives strip_parse=ERR or wrong rows; head gives the result SW-REQ-261001-BNZG specifies. Recorded classification: intended (SW-REQ-261001-BNZG). I reproduced this class of input with node on base 9f3abc10 vs head MenuModel.js. Representative of its group; the other 122 data differences follow the same pattern (see the differential finding).
- AI · confirmedIntended difference bd-4aaa4dc6085c50ba: U+2028 indenting the shipped default menu: 0 to 344 rows
Base gives strip_parse=ERR or wrong rows; head gives the result SW-REQ-261001-BNZG specifies. Recorded classification: intended (SW-REQ-261001-BNZG). I reproduced this class of input with node on base 9f3abc10 vs head MenuModel.js. Representative of its group; the other 122 data differences follow the same pattern (see the differential finding).
- AI · confirmedIntended difference bd-013206277c5844ea: vertical tab indenting the shipped default menu: 0 to 344 rows
Base gives strip_parse=ERR or wrong rows; head gives the result SW-REQ-261001-BNZG specifies. Recorded classification: intended (SW-REQ-261001-BNZG). I reproduced this class of input with node on base 9f3abc10 vs head MenuModel.js. Representative of its group; the other 122 data differences follow the same pattern (see the differential finding).
- AI · confirmedIntended difference bd-df933919303826e2: form feed indenting the issue #11211 snippet: 0 to 2 rows
Base gives strip_parse=ERR or wrong rows; head gives the result SW-REQ-261001-BNZG specifies. Recorded classification: intended (SW-REQ-261001-BNZG). I reproduced this class of input with node on base 9f3abc10 vs head MenuModel.js. Representative of its group; the other 122 data differences follow the same pattern (see the differential finding).
- AI · confirmedIntended difference bd-cfd90a4600fd0086: U+3000 indenting the issue #11211 snippet: 0 to 2 rows
Base gives strip_parse=ERR or wrong rows; head gives the result SW-REQ-261001-BNZG specifies. Recorded classification: intended (SW-REQ-261001-BNZG). I reproduced this class of input with node on base 9f3abc10 vs head MenuModel.js. Representative of its group; the other 122 data differences follow the same pattern (see the differential finding).
- AI opinion — unverifiedKI-MENU-JSONC-CR-LINE-ENDINGS and KI-MENU-JSONC-STRIP-GAPS remain open; the PR does not change them
I ran both: a CR-only file with a // comment (
// c\r{...}) and a /* */ block comment give 0 rows at base and at head. The scanner ends a comment only at \n and has no block-comment state. The PR's docs/menu.md now says block comments are not supported. These KIs pre-date the PR. - AI opinion — unverifiedChange effects not analyzed; scope analysis bounds acknowledged
effects_unavailable: review.effects covers C/C++ only, so callers, gained effects, new mutable state and call-level requirement impact are not in the package for this JS change. The scope approximations say no uncodified connection could be detected, so 'No spec-gap candidates' proves nothing here. By reading: stripJsonc/parseMenuJsonc add no callees, no I/O, and no state beyond local variables.
- AI opinion — unverifiedThe next-decision text says '50' compatibility changes; the package discloses 135
nextDecision.question reads "Approve each of the 50 backward-compatibility changes", and its disclosureIds list holds 50 ids. decisionSummary has 135 compat_change_unapproved disclosures (127 differential, 5 test_diff, 3 removed_behavior). The 50 looks like a list cap, not the true count. Every one of the 135 needs a reviewer's decision. (Observation about engine wording.)