Skip to content

fix: allow candidate-level stale reference suppressions#67

Merged
dd3ok merged 3 commits into
mainfrom
fix/candidate-level-ignore-suppressions
Jun 4, 2026
Merged

fix: allow candidate-level stale reference suppressions#67
dd3ok merged 3 commits into
mainfrom
fix/candidate-level-ignore-suppressions

Conversation

@dd3ok

@dd3ok dd3ok commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • add optional candidate matching for stale-reference entries in lucid.ignore.json
  • keep broad rule/path suppressions compatible while allowing reviewed false positives to be suppressed without hiding other missing references in the same file
  • add a regression fixture and suppress Lucid README archive-internal path false positives with candidate-scoped entries

Testing

  • python3 scripts/validate-skill.py
  • python3 scripts/validate-no-dangerous-io.py
  • python3 scripts/validate-evals.py
  • python3 scripts/validate-docs.py
  • python3 scripts/validate-package-skill.py
  • python3 skills/lucid/scripts/lucid.py verify --root . --strict
  • python3 skills/lucid/scripts/lucid.py audit --root . --format terminal

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces candidate-level suppressions for the stale-reference rule, allowing users to narrow down suppressions to specific missing reference candidates rather than suppressing all missing references in a file. This includes updating the documentation, validation scripts, fixtures, and the core suppression matching logic in skills/lucid/scripts/lucid.py. Feedback was provided to optimize the apply_suppressions function; the current implementation performs a linear scan over all suppressions for each finding, resulting in O(N * M) complexity, which can be optimized to O(N + M) by grouping suppressions by (rule, path) in a dictionary lookup.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 1565 to +1575
active: list[dict[str, Any]] = []
suppressed: list[dict[str, Any]] = []
for finding in findings:
suppression = suppression_lookup.get((finding["rule"], finding["path"]))
suppression = next(
(
item
for item in suppressions
if finding_matches_suppression(finding, item)
),
None,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The current implementation of apply_suppressions performs a linear scan (O(M)) over all suppressions for every single finding, resulting in an O(N * M) time complexity.

By grouping the suppressions by (rule, path) in a dictionary lookup, we can reduce the search space to only the relevant suppressions for each finding, optimizing the average-case lookup time to O(1) per finding and overall complexity to O(N + M).

Suggested change
active: list[dict[str, Any]] = []
suppressed: list[dict[str, Any]] = []
for finding in findings:
suppression = suppression_lookup.get((finding["rule"], finding["path"]))
suppression = next(
(
item
for item in suppressions
if finding_matches_suppression(finding, item)
),
None,
)
suppression_lookup: dict[tuple[str, str], list[dict[str, str]]] = {}
for item in suppressions:
suppression_lookup.setdefault((item["rule"], item["path"]), []).append(item)
active: list[dict[str, Any]] = []
suppressed: list[dict[str, Any]] = []
for finding in findings:
candidates = suppression_lookup.get((finding["rule"], finding["path"]), [])
suppression = next(
(
item
for item in candidates
if finding_matches_suppression(finding, item)
),
None,
)

@dd3ok dd3ok merged commit beda6fe into main Jun 4, 2026
1 check passed
@dd3ok dd3ok deleted the fix/candidate-level-ignore-suppressions branch June 4, 2026 04:27
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