Skip to content

feat(digest): show Semgrep coverage for repos without Code Security - #218

Merged
twistedmelonman merged 2 commits into
mainfrom
claude/feat-digest-semgrep
Oct 21, 2026
Merged

twistedmelonman merged 2 commits into
mainfrom
claude/feat-digest-semgrep

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

What changes

Code Security is not bought, by decision (Andrew, 2026-10-21). Semgrep CE, through the reusable semgrep-scan.yml workflow in smartwatermelon/github-workflows, is the substitute. The digest's CodeQL section now shows which private repos without Code Security have a Semgrep caller.

standards.sh

For a repo in the no-code-security state, the survey reads .github/workflows/semgrep-scan.yml through the contents API and records codeql.substitute:

  • semgrep: the file decodes, and a job-level or step-level uses: line points at smartwatermelon/github-workflows/.github/workflows/semgrep-scan.yml@. A commented-out reference does not count.
  • none: an HTTP 404 with a 404 body. Also none: the file exists but does not call the reusable workflow. In that case substituteDetail says so. The brief named three states and did not cover this case. I put it in the "no Semgrep caller" list and kept it visible, never in the covered list.
  • unreadable: any other failure (403, 5xx, a non-file response, an encoding other than base64, a decode failure), with its reason. A failed read is never none.

render.sh

The no-Code-Security list splits into three sub-lists under "Without paid Code Security":

  • "Covered by Semgrep (CodeQL substitute)"
  • "No code scanning: paid Code Security not bought, no Semgrep caller"
  • "Semgrep coverage unreadable"

A record without a substitute field (from an older survey) or with an unknown value goes to the unreadable list, never to the covered list. The summary line counts each bucket. The "open cost decision" sentence is replaced. "No gaps" still requires zero repos without Code Security, so Semgrep coverage alone never prints "No gaps".

Tests

  • The gh stub in test-standards.sh gains a .404.json convention that matches real gh output (captured 2026-10-21), plus unset -f gh as in dev-env#215.
  • New fixtures cover semgrep, none (404), none (commented-out caller), unreadable (403), and unreadable (encoding none).
  • fixtures/codeql-semgrep.ndjson adds render cases for all three states, a record with no substitute field, and a record with an unknown value.
  • Known-bad proof: every new assertion fails against the origin/main scripts. Three mutations are each caught: a failed read treated as none, a plain substring match instead of a uses: line, and a missing field rendered as covered.

docs/STATUS.md records the decision and the Semgrep pilot on nightowlstudiollc/reliquarist. Its check fails on new findings but is not required. Code Security also leaves the "Open decisions" line.

Advances #166

Claude Code Bot added 2 commits October 21, 2026 15:57
Code Security is not bought, by decision (2026-10-21). Semgrep CE,
through the reusable semgrep-scan.yml workflow in github-workflows, is
the substitute. The CodeQL section now says so instead of calling the
purchase an open cost decision.

standards.sh: for a private repo whose default-setup read returns the
paid-product 403, read .github/workflows/semgrep-scan.yml with the
contents API and record codeql.substitute:
- semgrep: the file decodes and has a job- or step-level uses: line for
  smartwatermelon/github-workflows/.github/workflows/semgrep-scan.yml@.
  A commented-out reference does not count.
- none: HTTP 404 with a 404 body, or the file exists but does not call
  the reusable workflow (substituteDetail says which).
- unreadable: any other failure, with the reason. Never none.

render.sh: split the no-Code-Security list into "Covered by Semgrep
(CodeQL substitute)", "No code scanning: paid Code Security not bought,
no Semgrep caller" and "Semgrep coverage unreadable". A record with no
substitute field (an older survey) or an unknown value is unreadable,
never covered. The summary line counts each bucket, and "No gaps" still
requires no repo without Code Security.

Tests: the gh stub gains a .404.json convention; fixtures cover all
three states plus a commented-out caller and an undecodable file; a
render fixture adds the older-survey and unknown-value records. Every
new assertion fails against the previous scripts.

Advances #166
The purchase decision is made (not bought, 2026-10-21), so the STATUS
lines that called it open now contradict the new entry. Also rejoin a
CodeQL comment in render.sh with the jq call it describes.

Advances #166
@twistedmelonman
twistedmelonman merged commit 4eadaa3 into main Oct 21, 2026
5 checks passed
@twistedmelonman
twistedmelonman deleted the claude/feat-digest-semgrep branch October 21, 2026 23:02
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