Repository navigation
fork-changes-list: fail closed on unusual forkDefaults rows (#396) - #404
Conversation
The FORK_SETTING_DEFAULTS text reader only counted `scope:`, so a spread,
a helper call or a shorthand `{ scope, ... }` row was skipped without an
error, and a column-0 `];` inside a row ended the table early. Each entry
between rows must now be a `{ ... }` object literal, each row must read
as exactly one scope and key, and a row still open at the `];` throws.
Errors name the line in forkDefaults.ts.
fork-owned-reads.test.py: drop the `"*" not in l` filter on OWNED_DOCS.
Names compare exactly, so it changed nothing for the current list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
lens: state verdict: SAFE (head 51e332b) Lens: correctness + state. Read-only. I ran only (1) Fail-closed: shapes the PR does not list (37 probes)Throw (fail closed):
Pass with the right list:
Pass with a wrong list (the real risk). I found none for a formatted file a person would plausibly write. The ones I found are below as findings. Each is contrived, and none is a regression: main's text count missed more. (2) Today's table
Exact match. The interface's (3) Item 2:
|
| # | Guard broken | Result |
|---|---|---|
| M1 | the non-row-entry throw (:54 → else if (false)) |
red (#396 test) |
| M2 | the row-still-open throw (:60 → if (false)) |
red (#396 test) |
| M3 | the per-row exactly-one check (:68 → if (false)) |
red (2 tests) |
| M3b | drop || scopes !== 1 only |
survived: silent server.a (see minor above) |
| M3c | drop read.length !== 1 only |
red |
| M4 | the head-line remainder (:39 → if (false)) |
red (#396 test) |
| M5 | read one-line rows (:53 → else if (false)) |
red (2 tests) |
| M6 | ROW_CLOSE to /^\s*\},?$/ |
survived: fails closed (false red only), nit above |
| M7 | the empty-table throw (:64 → if (false)) |
red |
No blocker or major. The two minors are a missing test for an existing guard and a contrived fail-open path. Neither is a regression, and either can go in this PR or a follow-up.
) * fork-changes-list: fail closed on unusual forkDefaults rows (#396) The FORK_SETTING_DEFAULTS text reader only counted `scope:`, so a spread, a helper call or a shorthand `{ scope, ... }` row was skipped without an error, and a column-0 `];` inside a row ended the table early. Each entry between rows must now be a `{ ... }` object literal, each row must read as exactly one scope and key, and a row still open at the `];` throws. Errors name the line in forkDefaults.ts. fork-owned-reads.test.py: drop the `"*" not in l` filter on OWNED_DOCS. Names compare exactly, so it changed nothing for the current list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fork-changes-list: keep pinnedIds' doc comment to 4 lines Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
) * fork-changes-list: fail closed on unusual forkDefaults rows (#396) The FORK_SETTING_DEFAULTS text reader only counted `scope:`, so a spread, a helper call or a shorthand `{ scope, ... }` row was skipped without an error, and a column-0 `];` inside a row ended the table early. Each entry between rows must now be a `{ ... }` object literal, each row must read as exactly one scope and key, and a row still open at the `];` throws. Errors name the line in forkDefaults.ts. fork-owned-reads.test.py: drop the `"*" not in l` filter on OWNED_DOCS. Names compare exactly, so it changed nothing for the current list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fork-changes-list: keep pinnedIds' doc comment to 4 lines Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Fixes #396
What and why
Follow-ups from the lens on #389.
1. The settings-table reader fails closed on unusual rows (
.github/scripts/fork-changes-list.cjs).pinnedIdsreadforkDefaults.tsas text and only countedscope:. Four shapes were skipped with no error, so a setting written that way could be missing fromFORK_CHANGES.mdand no test would go red:...EXTRA_ROWS,`...EXTRA_ROWS,` is not a `{ ... }` rowrow("server", "x"),{ ... }row{ scope, key: "x" }(one line or several)0 "scope:" but 0 read];at column 0 inside a rowa row is still open at the table's "];"= [line itself`...` after the table's "["The reader now walks the table line by line. Between rows, a non-blank line must be
{(opening a row that ends at}/},), a whole{ ... }row on one line, or a//comment. Each row must read as exactly onescope: "<scope>", key: "<key>". Each error names the line inforkDefaults.ts. Today's real table still reads 22 of 22 (22scope:inside the table; the 23rdscope:in the file is the interface field, outside the table).2.
fork-owned-reads.test.py:62: dropped the"*" not in lfilter onOWNED_DOCS. A name counts only when it equals a list line exactly, and that is what keeps runbook pointers out. With today's list (onlyFORK_CHANGES.mdends in.md), the filter changed nothing. Two notes:*in a name. So with a future*.mdline, code that writes that same glob (for exampleglob(".github/fork-*.md")) now counts as a read of owned docs. That errs red, which is the safe direction.see .github/fork-fleet.mdcheck still shows that a runbook pointer is not a read.Tests (run as fork-tests runs them)
node --test .github/scripts/fork-changes-list.test.cjs: 8 pass. Changes:["client.after","server.waitFor"]with no error.//comment between rows still read.line N: 1 "scope:" but 0 read).python3 -I -B .github/scripts/fork-owned-reads.test.py: all passed, before and after. Item 2 changes nothing for the current list, so it has no red test.oxfmt --checkandoxlintthat ship with vite-plus, run without a config, pass on both.cjsfiles. Main's copies pass the same command, so it matches the repo's settings.vp checkitself needs the workspace install, which this JS/Python-only change skipped. CI'slintjob runs it.State question
workflowsjob, which goes red. The error names theforkDefaults.tsline and says to write the setting as its own{ ... }object literal. Nothing is skipped silently.= [\n];): throwsno row read(existing test). A one-line= [];followed by another array is no longer misread as that array's rows: it throws`];` after the table's "["(new test).no "export const FORK_SETTING_DEFAULTS ... = [" table. A missing closing];throwsno closing "];" line. Both are existing tests and still pass.General vs project
FORK_SETTING_DEFAULTS(two-space rows,{on its own line or a one-line row).🤖 Generated with Claude Code