feat(lint): per-file allow-list in eigs.json (#455)#524
Merged
Conversation
builtin_args returned argv directly, unwrapped — the last un-taped nondeterminism source reachable by a pure script, and a hole in the closed-world invariant behind deterministic replay. A program that branched on `args` recorded a tape under one invocation and silently diverged when replayed under a different argv — the exact class the #408 task layer's chaos-mode `--seed N` scheduling would hit. The recorded argument list now rides the tape as one N record and replay serves it regardless of the live argv. Because `args` builds its list before returning, it uses the TRACE_NONDET_TAKE / TRACE_NONDET_RECORD pair (not TRACE_NONDET_RET): under replay the early TAKE short-circuits before the list is built, so the live construction is neither run nor leaked. The tape already round-trips a list of strings (parse_value_p), so no serialization work was needed. Regression: tests/test_replay.sh records under `A B`, then replays the same script under `X Y Z` and asserts the recorded args win (and that a live run under `X Y Z` differs, proving the tape actually overrides). docs/TRACE.md gains a Process category and the TAKE/RECORD-for-builders note; CHANGELOG under Unreleased. Full suite green release + ASan (leaks on), 2689/2689, no leak-tally increase. Closes #471 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Residual of #399: a project can now silence a lint code for a whole file via eigs.json, without sprinkling inline `# lint: allow` comments — the escape for generated or vendored modules a project shouldn't edit. { "lint": { "allow": { "lib/generated.eigs": ["W003", "W017"] } } } Keys are project-root-relative paths; "all" silences every code. Resolution walks up from the linted file to the project root (the dir containing eigs.json — the same walk the module resolver stops at), so it applies regardless of the cwd the linter runs from. A code allowed here is filtered exactly like a `# lint: allow-file <code>` in the file. Implementation reuses the public eigs_json_parse_value parser; the allow list is read once per lint (not per warning) and refcount-clean (incref the borrowed codes list before decref'ing the parsed manifest, decref after the filter loop) — ASan leak-clean. Scope is `--lint`; the in-file directives still cover the LSP (noted as a possible follow-up). Regression: tests/test_lint.sh — suppress-listed-code, non-listed-file-still-fires, wrong-code-still-fires, "all", and cwd-independent root discovery. Full suite green release + ASan (leaks on), 2694/2694, no leak-tally increase. Closes #455 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
The last residual of #399: a project can now silence a lint code for a whole file via
eigs.json, without editing the file — the escape for generated or vendored modules a project shouldn't sprinkle# lint: allowcomments through.{ "lint": { "allow": { "lib/generated.eigs": ["W003", "W017"], "vendor/x.eigs": ["all"] } } }"all"silences every code.eigs.json— the same walk the module resolver stops at), so it applies regardless of the cwd the linter runs from.# lint: allow-file <code>in the file.Implementation
Reuses the public
eigs_json_parse_valueparser. The allow-list is read once per lint (not per warning) and is refcount-clean: incref the borrowedcodeslist before decref'ing the parsed manifest, decref after the filter loop — ASan leak-clean. Self-contained insrc/lint.c; freestanding build unaffected (host-CLI-only path).Scope is
--lint. The in-file directives (# lint: allow/allow-file/loaded-by) still cover the LSP; wiring the eigs.json list intoeigenlspis a possible follow-up (the LSP works on in-memory buffers that may lack a saved path/root).Verification
tests/test_lint.sh(5 new cases): suppress-listed-code, non-listed-file-still-fires, wrong-code-still-fires,"all", and cwd-independent root discovery.detect_leaks=1): 2694/2694, 0 failed, no leak-tally increase.Docs
docs/DIAGNOSTICS.md: replaced the "not yet wired up — see --lint: per-file allow-list in eigs.json (residual of #399) #455" placeholder with the real reference.docs/PACKAGE_SPEC.md: noted the optionallint.allowmanifest field.CHANGELOG.md: entry under[Unreleased] → Added.Closes #455
🤖 Generated with Claude Code