Skip to content

Filter uncomparable and rejected matched candidates - #116

Merged
andrew merged 1 commit into
mainfrom
filter-uncomparable-candidates
Aug 13, 2026
Merged

Filter uncomparable and rejected matched candidates#116
andrew merged 1 commit into
mainfrom
filter-uncomparable-candidates

Conversation

@p-linnane

Copy link
Copy Markdown
Contributor

Drops uncomparable matched candidates and reviewer-rejected ids from each Ingest run's fresh output before sharding, failing the run if a tracked record loses its comparable range or the denylist is missing. Details in the commit message.

Groundwork for the #52#115 backfill: once this lands, the shard branches can be rebuilt comparable-only from the new main.

Drop from each Ingest run's fresh `brew advisory-match` output:

- Uncomparable candidates (`source: matched`, no `range_state`): their
  `{introduced: "0"}` range with no `fixed` event reads as every version
  being affected in raw OSV, so they are discarded until the matcher can
  emit a shape that does not assert a range.
- Ids in data/rejected-candidates.txt: each run re-derives every match
  from scratch, so a rejected candidate would otherwise be re-proposed.

Only untracked paths are deleted. A tracked matched record that is
uncomparable or denylisted fails the run, as does a missing denylist.

Signed-off-by: Patrick Linnane <patrick@linnane.io>
Copilot AI lite review requested due to automatic review settings August 13, 2026 16:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new “filter” stage to the ingest pipeline so fresh brew advisory-match output is cleaned (uncomparable + reviewer-rejected candidates removed) before snapshotting/sharding, with CI/spec coverage to keep workflow ordering stable.

Changes:

  • Introduce AdvisoryFilter and a rake advisories:filter task to drop uncomparable matched candidates and denylisted IDs, while failing if tracked records violate the policy.
  • Wire the filter step into .github/workflows/ingest.yml between matching and snapshotting, and add a workflow spec asserting the step ordering and commands.
  • Add a durable denylist file plus CONTRIBUTING guidance on rejection behavior, and add unit tests for filtering/denylist parsing.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
spec/workflows_spec.rb Asserts the new ingest filter step exists and is ordered between match and snapshot.
spec/advisory_filter_spec.rb New unit tests for uncomparable/denylisted filtering rules and denylist parsing.
Rakefile Adds advisories:filter task to run the filter over NUL-delimited untracked paths.
lib/advisory_filter.rb Implements matched-candidate filtering + tracked-record policy enforcement.
data/rejected-candidates.txt Adds the durable denylist file referenced by the filter and docs.
CONTRIBUTING.md Documents the comparable-only behavior and how to durably reject candidates.
.github/workflows/ingest.yml Inserts the filter step into the ingest workflow before snapshot/shard steps.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/advisory_filter.rb
@andrew
andrew merged commit 1a44829 into main Aug 13, 2026
6 checks passed
@andrew
andrew deleted the filter-uncomparable-candidates branch August 13, 2026 16:15
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.

3 participants