Skip to content

docs: security contacts adr [CM-1325]#4375

Open
mbani01 wants to merge 2 commits into
mainfrom
docs/security-contacts-adr
Open

docs: security contacts adr [CM-1325]#4375
mbani01 wants to merge 2 commits into
mainfrom
docs/security-contacts-adr

Conversation

@mbani01

@mbani01 mbani01 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

This pull request adds a new architecture decision record (ADR-0009) that documents the design and implementation details for the security-contacts worker, which extracts, scores, and ingests security contact information for critical repositories. The ADR covers the tiered extraction hierarchy, confidence scoring, data reconciliation, GitHub API usage, write semantics, scheduling, and the on-demand ingestion path, as well as alternatives considered and associated risks. Additionally, the ADR is linked in the ADR index.

New ADR documenting security-contacts worker:

  • Added docs/adr/0009-security-contacts-worker.md to comprehensively describe the architecture and decision process for the security-contacts worker, including extraction tiers, scoring, reconciliation, and operational details.
  • Updated docs/adr/README.md to reference ADR-0009 in the ADR index.

mbani01 added 2 commits July 21, 2026 17:59
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
@mbani01
mbani01 requested a review from joanagmaia July 21, 2026 17:06
@mbani01 mbani01 self-assigned this Jul 21, 2026
Copilot AI review requested due to automatic review settings July 21, 2026 17:06
@cursor

cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Documentation-only change; no runtime, schema, or API behavior is modified in this PR.

Overview
Adds ADR-0009 as the consolidated record for the security-contacts worker (Akrites “who to contact” for package vulnerabilities).

The ADR documents the chosen design: Temporal daily batch ingestion plus an on-demand single-purl workflow, a tiered extractor hierarchy (A > B > D) with shared git-tree probing, reconciliation/noise filtering, score.ts confidence formula and bands, handle verification and CDP email resolution, a rate-limited GitHub gateway, soft-delete upsert write semantics with partial-pass merge rules, refresh cadence, and the API distinction between securityContacts: null vs []. It also captures alternatives rejected (polling loop, hard delete/insert, trusting registry usernames, always tier D, GitHub-only email) and operational risks.

docs/adr/README.md is updated to index ADR-0009.

Reviewed by Cursor Bugbot for commit b85fa0b. Bugbot is set up for automated code reviews on this repo. Configure here.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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 ADR-0009 documenting the security-contacts worker architecture and links it from the ADR index.

Changes:

  • Documents extraction, scoring, persistence, scheduling, and reconciliation decisions.
  • Records alternatives, consequences, and risks.
  • Updates the ADR index.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
docs/adr/0009-security-contacts-worker.md Adds the security-contacts ADR.
docs/adr/README.md Links ADR-0009.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +27 to +28
comes back empty, 24 h execution timeout across the chain), plus a separate **on-demand
single-purl workflow** invoked by the akrites API when it hits a never-evaluated repo. Each repo
| A4 | RFC 9116 `security.txt` on the project homepage | `securityTxt.ts` |
| B1 | `SECURITY.md` (root, `.github/`, `docs/`) | `securityMd.ts` |
| B2 | Registry manifests — npm, PyPI, Maven, Cargo, NuGet, RubyGems, Composer | `extractors/registry/` |
| D | Top-3 committers (last 90 days) + repo owner profile; static Go ecosystem fallback | `topCommitters.ts`, `repoOwner.ts`, `registry/go.ts` |
Comment on lines +182 to +184
- **Partial passes merge only**: when an extractor failed, the soft-delete step is skipped — a
source that wasn't consulted cannot wipe contacts it didn't see. Stale rows are cleaned on the
next fully-successful pass.
- Idempotent, self-advancing sweep: failed repos are marked attempted, failed chunks re-extract in
isolation, and re-runs converge instead of duplicating.
- The on-demand path fills coverage for non-critical purls lazily, exactly when the API needs them.
- Pure scoring/reconcile functions are unit-tested in isolation (`__tests__/`).
Comment on lines +278 to +280
- **Single-writer assumption** — `writeContacts` takes no lock; correctness relies on the Temporal
schedule (SKIP overlap) and heartbeat-based supersession keeping one writer per repo. A future
second caller (e.g. a backfill script) must respect this or add locking.
Comment on lines +62 to +65
- **Go packages get a static ecosystem fallback**: Go has no registry manifest carrying contact
metadata (the module proxy and pkg.go.dev expose none), so the Go fetcher makes no HTTP call and
always emits two tier-D `security-team` contacts per the Go security policy —
`security@golang.org` and the `https://g.co/vulnz` report form. At tier D they never outrank a
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