Repository navigation
Settings-table reader: comments, spreads, two rows on a line, unclosed rows - #571
Conversation
…d rows The FORK_SETTING_DEFAULTS reader (fork-changes-list.cjs) now strips comments before counting a row's "scope:", refuses a spread anywhere in a row and more than one top-level object on a row's line, and names an unrecognised closing line instead of reporting two rows read as one. Tests cover the scopes !== 1 check, each new refusal, and the two-space indent of a row's "},". Fixes #417 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review (#417 fix): SAFEVerdict: SAFE. All five items from #417 are handled. Anything the reader cannot parse throws; it is never read as "no row" or as a shorter list. One minor gap is left (a string can still stand in for a row's What the reader decides: Checked
Blocking: none. Major: none. Minor
|
…417) Review minor on #571: count scope: outside strings and require exactly one scope/key pair outside strings, so a row whose own scope is shorthand or a quoted key is refused instead of read from a string. Clearer message for a nested spread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fix for the review minors (ec65d79):
All 10 tests pass. |
Fixes #417
The reader of the fork settings pin table (
.github/scripts/fork-changes-list.cjs, used by theFORK_CHANGES.mdcheck) gets the five minors from the #404 lens.scopes !== 1had no test. New case:{ scope: SCOPE, key: "x", note: { scope: "server", key: "a" } }must throw (2 "scope:" but 1 read). With the check removed it reads asserver.a, and the test fails.scope:. A row's text now has its comments stripped (string-aware, so a//in a URL inside a string is kept) beforescope:is counted andscope: "..", key: ".."is read. A spread anywhere in a row (outside strings and comments) is refused.{per line. That would also refuse a valid one-line row with a nested object (default: { mode: "dark" }), so instead the row's text (strings and comments removed) must be exactly one top-level{ ... }.{ scope: "client", key: "b" }, { scope: "server", key: "c" },now throws.},. While a row is open, any other line at the rows' two-space indent now throws, naming the line and the row it was meant to close, for example:`}, // end` at the rows' indent, but the row opened on line 12 has not closed. Before, it went on to the next row's close and reported2 "scope:" but 2 read.},. New passing case: a row with a nested multi-line object whose},sits at four spaces. IfROW_CLOSEis loosened to any indent, it fails.Tests
node --test .github/scripts/fork-changes-list.test.cjs: 10 pass. Both new tests fail on the old code (checked). Mutation checks: removing each guard on its own (scopes !== 1, the comment strip, the spread refusal, the one-object check, the indent check, and looseningROW_CLOSE) makes a new test fail. The realforkDefaults.tstable still reads cleanly.State question: the reader is a pure function of the file's text, so a second run gives the same result and there is no half-finished state. Missing or empty input (no table, an empty table, no closing
];) was already tested and still throws.General vs project
General: a fork CI check of the fork's own settings table. No project facts.
🤖 Generated with Claude Code