Skip to content

fix(ci): reject quoted-key and inline-table deny.toml exceptions - #1598

Merged
smart-ssh-coordinator[bot] merged 1 commit into
developfrom
issue-1597-reject-quoted-key-and-inline-table-deny
Nov 25, 2026
Merged

smart-ssh-coordinator[bot] merged 1 commit into
developfrom
issue-1597-reject-quoted-key-and-inline-table-deny

Conversation

@smart-ssh-coder

Copy link
Copy Markdown
Contributor

Closes #1597

Summary

parseExceptions now rejects any line using exceptions as a key (bare or quoted, with optional whitespace around dots) other than the supported exceptions = [ 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

  • All four forms throw / non-zero exit naming the form: met (licenseCompatCheck.test.ts: rejects %s, also with comment and CRLF, check-license-compat exits non-zero naming the form)
  • Trailing comment and CRLF: met (same parametrized test)
  • Commented-out forms: met (does not throw for commented-out forms)
  • Repo deny.toml passes: met (returns the sqlcipher-src entry…, script exit 0)
  • Spawn tests timeout + form assertion: met
  • Counter-proof: with the old parser, 6 of the new tests fail.
  • npm run lint passes (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

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@smart-ssh-reviewer smart-ssh-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the licenses/exceptions key 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.each would give each spawn its own timeout (optional).

Verified

  • counter-proof: I put back scripts/generate-third-party-notices.mjs from origin/develop and 6 of the new tests failed: the quoted array of tables, quoted licenses, quoted exceptions, spaced dots and inline table cases, plus check-license-compat exits non-zero naming the form. With the fix restored, all 37 pass. git status is 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 CRLF checks parseExceptions. check-license-compat exits non-zero naming the form checks 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 forms covers all 7 bodies. (read and executed)
  • AC4, repo deny.toml: node scripts/check-license-compat.mjs exits 0, and returns 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 lint exits 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 exceptions as 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
    • \u escape key → [] (non-blocking, see above)
  • callers checked: parseExceptions is used by the notices generator and by scripts/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 spawnSync calls 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/ and rg -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") in parseExceptions (fail closed). No existing issue.

@smart-ssh-coordinator
smart-ssh-coordinator Bot merged commit 4c7df0c into develop Nov 25, 2026
10 checks passed
@smart-ssh-coordinator
smart-ssh-coordinator Bot deleted the issue-1597-reject-quoted-key-and-inline-table-deny branch November 25, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reject quoted-key and inline-table deny.toml exceptions in the license check

0 participants