Skip to content

feat(security): surface Dependabot posture in portfolio render surfaces#28

Merged
saagpatel merged 2 commits into
mainfrom
feat/security-render-surfaces
May 31, 2026
Merged

feat(security): surface Dependabot posture in portfolio render surfaces#28
saagpatel merged 2 commits into
mainfrom
feat/security-render-surfaces

Conversation

@saagpatel
Copy link
Copy Markdown
Owner

What

Surfaces the radar's truth-layer security dimension (RiskFields.security_risk, SecurityFields Dependabot counts, the active-high-severity-alerts factor) in the two human-facing render surfaces. The radar was wired into the risk model + weekly digest in #27, but PORTFOLIO-AUDIT-REPORT.md and project-registry.md didn't yet reflect it. This closes that gap, mirroring the digest's Security Posture treatment.

Changes

Portfolio report (render_portfolio_report_markdown)

  • New ## Security Posture section (+ TOC entry) with the same three states as the digest: per-repo open high/critical alerts (critical-first, capped at 5), "all N scanned clear", or "overlay not run".
  • A Security posture line in the Coverage Summary, alongside the existing Risk posture line.

Registry (render_registry_markdown)

  • Pipe-free per-repo security flag in the Notes column (fires only for scanned repos carrying open high/critical alerts).
  • Four aggregate rows in the Portfolio Summary table (scanned / repos-with-open / open critical / open high).

Shared helpers_security_overview and _security_attention_items mirror the digest's _build_security_summary / _build_security_attention_items, operating on the in-memory snapshot instead of JSON.

Safety

  • The Notes flag is pipe-free and the summary rows are digit-valued, so the registry still round-trips through parse_registry with an unchanged project-row count (proven by test).
  • Both markdown validators (validate_registry_markdown, validate_portfolio_report_markdown) stay green — no required section removed.

Tests

  • 5 new tests: all three report states, registry flag + round-trip, unscanned case.
  • Full suite: 2149 passed, 2 skipped; ruff check . clean.

saagpatel added 2 commits May 31, 2026 07:36
The radar's truth-layer security dimension (RiskFields.security_risk,
SecurityFields Dependabot counts, the active-high-severity-alerts factor)
was wired into the risk model and weekly digest in #27, but the two
human-facing render surfaces — PORTFOLIO-AUDIT-REPORT.md and
project-registry.md — did not surface it. This adds that, mirroring the
digest's Security Posture treatment:

- Portfolio report: a Coverage Summary line + a dedicated '## Security
  Posture' section (TOC entry included) with the same three states as the
  digest — per-repo open high/critical (critical-first, capped at 5),
  'all N scanned clear', or 'overlay not run'.
- Registry: a pipe-free per-repo security flag in the Notes column (fires
  only for scanned repos with open high/critical) plus four aggregate rows
  in the Portfolio Summary table.

Shared _security_overview / _security_attention_items helpers mirror the
digest's aggregation on the in-memory snapshot. The Notes flag is pipe-free
and the summary rows are digit-valued, so the registry still round-trips
through parse_registry unchanged; both markdown validators stay green.

5 new tests cover all three report states, the registry flag + round-trip,
and the unscanned case.
…egistry clean path

Addresses code-review findings on the render surfaces:
- validate_portfolio_report_markdown now requires the '## Security Posture'
  header, so the section can't silently vanish in a future refactor (every
  other section header is already guarded).
- New unit test pins _security_attention_items' cap-at-5 and critical-desc /
  high-desc / name-asc sort — the one behavior unique to the attention list.
- Extends the scanned-clear test to assert the registry's per-repo flag is
  absent for a medium-only repo while it still counts as scanned.
@saagpatel saagpatel merged commit 7ac5ef9 into main May 31, 2026
3 checks passed
@saagpatel saagpatel deleted the feat/security-render-surfaces branch May 31, 2026 14:44
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