Repository navigation
fix(ci): reject quoted-key and inline-table deny.toml exceptions - #1598
Merged
smart-ssh-coordinator[bot] merged 1 commit intoNov 25, 2026
Merged
smart-ssh-coordinator[bot] merged 1 commit into
smart-ssh-coordinator[bot] merged 1 commit into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
7 tasks
7 tasks
There was a problem hiding this comment.
Review
Verdict: approved
Review level: normal
Blocking
None.
Non-blocking
scripts/generate-third-party-notices.mjs:161— a basic-string quoted key that uses an escape sequence is valid TOML, but it still returns[]without a message. Example:licenses."exceptions" = [{ crate = "x", allow = ["GPL-2.0"] }](I ran this locally). The issue only asks for bare keys and keys quoted with"or', so this is outside the acceptance criteria. A fail-closed follow-up could reject any line with a quoted key that contains a\escape in thelicenses/exceptionskey positions.licenseCompatCheck.test.ts:161-171— the 7 spawns run one after another in a single test that shares one 30 s budget. That is fine today, which takes about 1 s locally.it.eachwould give each spawn its own timeout (optional).
Verified
- counter-proof: I put back
scripts/generate-third-party-notices.mjsfromorigin/developand 6 of the new tests failed: the quoted array of tables, quoted licenses, quoted exceptions, spaced dots and inline table cases, pluscheck-license-compat exits non-zero naming the form. With the fix restored, all 37 pass.git statusis clean. (executed:npx vitest run src/licenseCompatCheck.test.ts) - AC1, four forms throw and name the form:
licenseCompatCheck.test.ts: rejects %s, also with comment and CRLFchecksparseExceptions.check-license-compat exits non-zero naming the formchecks the exit status and that stderr names the form. (read and executed) - AC2, trailing comment and CRLF: covered by the same parametrized test, with a comment on the first line and then the whole body converted to CRLF. (read)
- AC3, commented-out forms:
does not throw for commented-out formscovers all 7 bodies. (read and executed) - AC4, repo
deny.toml:node scripts/check-license-compat.mjsexits 0, andreturns the sqlcipher-src entry…passes. The existing block-form tests are unchanged; they only gained timeouts and one stricter stderr assertion. (executed) - AC5, spawn tests: all spawn tests now have a 30 s timeout and assert on the form name with
toMatch(re). (read) - AC7:
npm run lintexits 0 with warnings only, none in the touched files. (executed) - edge cases (executed with a local probe script against
parseExceptions):"exceptions" = [...]under[licenses]→ throws (quoted key)licenses={exceptions=[...]}without spaces → throws (inline table)- inline table with
exceptionsas its second key → throws (inline table) [[ "licenses" . 'exceptions' ]]→ throws (array of tables)[licenses.exceptions]→ throws (dotted key)- CRLF single-quoted key with a comment → throws
- a value string mentioning "exceptions" → no false positive
\uescape key →[](non-blocking, see above)
- callers checked:
parseExceptionsis used by the notices generator and byscripts/check-license-compat.mjs. Its return contract is unchanged, and it only throws in more cases. (read) - tests run locally:
npx vitest run src/licenseCompatCheck.test.ts→ 37 passed (executed) - UI: not a UI change
- data: not touched
- CI: all checks green (
gh pr checks 1598) - files read: 2/2 logic files
- prior review requests in this area (PR #1591/#1596: one-line block, trailing comment after
]], CRLF with comment) are covered and not reintroduced.
Timing analysis
- 1 test file analysed. Possible (non-blocking): 7 sequential
spawnSynccalls in one test under a 30 s timeout, about 1 s locally. The temp files are per call (mkdtempSync), so there is no collision. No likely findings.
Spec
- visible behaviour changed: none (build-tooling error path only)
- spec searched:
rg -il 'license|lizenz' docs/specs/andrg -n exceptions docs/specs/0090-ci-gates-blocking.md. Spec 0090 A12 covers the license compatibility gate, and nothing there describes the parser's accepted spellings. - verdict: not needed, because this is a fail-closed hardening of already specified gate behaviour (Spec 0090 A12). No changelog fragment is needed for build-only tooling.
Security checks
- No security-critical path is touched (
review-level: normal). Nothing is loosened: the old regex cases ([[licenses.exceptions]],licenses.exceptions =) are still rejected and the new rule only adds more rejections. The single skip (^\s*exceptions\s*=\s*\[) is the supported block that the parser reads afterwards, so it is not silently dropped. Threat model note: "no change – build script only" is reasonable.
Manual checks pending
None.
Follow-ups
- Reject escaped quoted keys (e.g.
licenses."exceptions") inparseExceptions(fail closed). No existing issue.
smart-ssh-coordinator
Bot
deleted the
issue-1597-reject-quoted-key-and-inline-table-deny
branch
November 25, 2026 17:57
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1597
Summary
parseExceptionsnow rejects any line usingexceptionsas a key (bare or quoted, with optional whitespace around dots) other than the supportedexceptions = [block. Forms are named in the message: array of tables, dotted key, quoted key, inline table. Spawn tests got a 30 s timeout and assert on the form name.Acceptance Criteria
rejects %s, also with comment and CRLF,check-license-compat exits non-zero naming the form)does not throw for commented-out forms)returns the sqlcipher-src entry…, script exit 0)npm run lintpasses (warnings only, pre-existing).Assumptions
General rule chosen as recommended in the issue.
Spec: none (build tooling only). Threat model: no change – build script only.
Manual test steps: none.
Follow-ups: None.
🤖 Generated with Claude Code