Skip to content

Scan alerts: a finding that only moved to another line is not reported again - #296

Merged
fylorn merged 1 commit into
devfrom
fix/scan-stable-fingerprint
Oct 9, 2026
Merged

fylorn merged 1 commit into
devfrom
fix/scan-stable-fingerprint

Conversation

@fylorn

@fylorn fylorn commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Editing ~/.codex/config.toml (adding a line above, changing the model) moved every remote MCP server below it, and the client-config watcher reported all of them again as new, because a finding was recognised by path, rule, line number and the line's text.

  • tw-scan: each Finding carries a subject that does not depend on its position — the server's name and address for remote-mcp, the matched text for a rule hit, the line's text for hidden characters, the skill's name for over-broad-tools.
  • Seen::diff compares path + rule + subject, counted: a finding that only moved is not new; a second identical one, or a different server under the same rule, is. The seen set stores only hashes, so it keeps nothing from the files.
  • Tests: the old "moving to another line counts as new" unit test is reversed; new unit tests for counting and for a different subject; a watcher test edits a Codex config above its MCP server (rescan, no alert), then adds a second remote server (one alert). That watcher test fails if the line number is put back into the fingerprint.

Checks: cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test (900 passed).

🤖 Generated with Claude Code

…d again

Editing ~/.codex/config.toml (a line added above, a model changed) moved every
remote MCP server below it, and the watcher reported all of them again as new:
a finding was recognised by path, rule, line and the line's text.

Each finding now carries a subject that does not depend on where it is in the
file: the server's name and address for a remote MCP server, the matched text
for a rule, the line's text for hidden characters, the skill's name for
over-broad tools. The watcher compares path, rule and subject, counted, so a
second identical finding is still new. The seen set keeps only hashes, so it
holds nothing from the files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit 936d600 into dev Oct 9, 2026
4 checks passed
@fylorn
fylorn deleted the fix/scan-stable-fingerprint branch October 9, 2026 03:04
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.

1 participant