Skip to content

Reach ranking: package_reach and cve_priority tables, importer, flagged priority lookup - #55

Merged
widrss merged 3 commits into
mainfrom
reach/pg
Nov 18, 2026
Merged

widrss merged 3 commits into
mainfrom
reach/pg

Conversation

@widrss

@widrss widrss commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Postgres side of the reach ranking in settlebridge-verifier (a2a-settlement/settlebridge-verifier#56).

Changes

  • Migration e8b1c4d72a05 (down_revision d2e5f7a9c1b3, single head).
    • package_reach has one row per (ecosystem, name) with the raw signals and a fetched_at per signal group.
    • cve_priority has one row per CVE with the scores, tier, weights_hash and computed_at, indexed on priority DESC NULLS LAST.
    • Every signal column is nullable.
  • app/models/reach.py: PackageReach and CvePriority.
  • python -m app.cli.import_reach <bundle.jsonl> [--replace-priorities] upserts the bundle written by svf rank push in one transaction. It rejects unknown columns and redacts the DB URL from errors.
  • FIX_VERIFIER_PRIORITY_QUEUE (default False) gates app/services/cve_priority.py:
    • priority_for(db, vuln_id)
    • queued_by_priority(db, limit), which orders queued fix_verifications by priority (NULLs last), then created_at.
    • Nothing in the request path calls these yet, because verifications run inline.

Tests

New tests/test_cve_priority.py and tests/test_reach_migration.py, plus test_fix_verifier_service.py: 30 passed (in-memory SQLite bridge, as in test_verifier_quota.py). alembic upgrade d2e5f7a9c1b3:head --sql checked offline.

Not done

The migration has not been run and the bundle has not been imported into any real database.

Made with Cursor

widrss and others added 2 commits November 17, 2026 20:20
…y lookup, JSONL importer

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@widrss

widrss commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

Added nullable cve_priority.fix_status (String 16) to migration e8b1c4d72a05, the model, and the importer to match settlebridge-verifier#56. The real 1,642-row bundle passes importer validation.

The repository does not track a uv lock file; CI and the image install from
requirements.txt.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@widrss
widrss merged commit 51073ed into main Nov 18, 2026
2 checks passed
@widrss
widrss deleted the reach/pg branch November 18, 2026 21:36
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