repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

Keep the security scanners honest as the codebase grows (#40)

3650e19ae17a61ba86c1283ab5d64b5b36bf9459

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

## What forced this
A forward review of CodeQL + DevSkim against what the repo *will* be
(Rust workspace, Lua plugins, an Astro `site/`). One real inconsistency
today: DevSkim has no path exclusion, so it scans the ~75 committed
prototype sources (SPEC §18, disposable) that CodeQL already excludes —
the Security tab would fill with throwaway-code findings.

## The call
Give DevSkim the same prototype exclusion via its `ignore-globs` input
(keeping the action's `.git`/`bin` defaults), and stop both scanners
triggering on prototype-only changes.

## What we deliberately didn't do
Didn't re-add `rust`/`javascript-typescript` to CodeQL — no source
exists to analyze yet. Left a dated re-add checklist inline instead,
including the load-bearing rule that code scanning must stay
**alerts-only**: each language added shifts the produced result-count,
and pairing that with a required-results merge rule re-creates the
"expecting N results" deadlock (#17).

## Evidence
`ignore-globs` confirmed against the action's `action.yml` (default
`**/.git/**,**/bin/**`); `target/` is gitignored so never checked out
(listed defensively). Path negations resolve correctly through the
existing YAML anchors.

## Surface touched
`.github/workflows/codeql.yml` + `.github/workflows/devskim.yml`
(triggers, exclusions, re-add notes).

## If this ages badly
When Rust/site land, follow the inline checklist; if scanner noise
persists, widen `ignore-globs`. Nothing here is a required check, so it
cannot wedge a merge.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01LABEHeVpg74oyZNtWLUWpB)_

Co-authored-by: Claude <noreply@anthropic.com>

Changed files (2)

+27 / −2 text lines

Diff layout

.github/workflows/codeql.yml

Modified

+15 / −2 text lines

2020 branches: [ "main" ]
2121 paths: &scan
2222 - '**/*.rs'
23 - '!prototypes/**' # disposable (SPEC §18) — excluded from analysis anyway; don't even trigger
2324 - '.github/workflows/**'
2425 pull_request:
2526 branches: [ "main" ]
5556 # workflows). `rust` is dropped until production Rust lands: with the
5657 # workspace absent and prototypes excluded, a rust scan finds nothing,
5758 # FAILS, and (with code-scanning merge protection on) blocks every PR.
58 # Re-add `- language: rust` (and `javascript-typescript` for the site)
59 # when there is source for them to analyze.
59 #
60 # RE-ADD CHECKLIST (as of 2026-07-22, no production Rust / no site/ yet):
61 # - Production Rust lands → add `- language: rust` with `build-mode:
62 # none` (CodeQL's Rust extractor is source-based; the workspace need
63 # not compile). Confirm CodeQL Rust is GA — it has been in preview;
64 # if still beta, coverage is thinner than the C/JS packs.
65 # - `site/` (Astro) lands → add `- language: javascript-typescript`.
66 # Note its extractor only partially parses `.astro` SFCs (embedded
67 # JS, not the template DSL); DevSkim + npm-audit/Dependabot carry the
68 # site's real coverage.
69 # - Each language added changes the produced result-count. Keep code
70 # scanning ALERTS-ONLY (never a required merge check — only
71 # `merge-gate` is required) or every such change re-creates the
72 # "expecting N results" merge deadlock. See #17.
6073 - language: actions
6174 build-mode: none
6275 # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'

.github/workflows/devskim.yml

Modified

+12 / −0 text lines

1212on:
1313 push:
1414 branches: [ "main" ]
15 # Extension list is intentionally ahead of the code: it covers everything
16 # smith will hold — Rust (product), Lua (plugins), JS/TS/Astro (site), shell.
17 # None but prototypes exist yet; a positive match on a future extension is a
18 # no-op until that source lands. (2026-07-22.)
1519 paths: &code
1620 - '**/*.rs'
1721 - '**/*.lua'
2024 - '**/*.tsx'
2125 - '**/*.astro'
2226 - '**/*.sh'
27 - '!prototypes/**' # disposable (SPEC §18); also ignore-globbed below — don't even trigger
2328 pull_request:
2429 branches: [ "main" ]
2530 paths: *code
4146 - name: Run DevSkim scanner
4247 uses: microsoft/DevSkim-Action@v1
48 with:
49 # Keep the action's defaults (`**/.git/**,**/bin/**`) and add
50 # prototypes/: disposable spec-validation code (SPEC §18). CodeQL
51 # already excludes it via paths-ignore; without this the Security tab
52 # fills with findings from the ~75 committed throwaway sources. target/
53 # is gitignored (never checked out) but listed defensively.
54 ignore-globs: "**/.git/**,**/bin/**,**/target/**,**/prototypes/**"
4456 - name: Upload DevSkim scan results to GitHub Security tab
4557 uses: github/codeql-action/upload-sarif@v3