Skip to content

fix: remediate repository audit findings across CI, harness, modules, and docs - #14

Merged
kyle-sexton merged 1 commit into
mainfrom
chore/audit-remediation
Jun 22, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
chore/audit-remediation

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Full per-file audit of the repo, every config validated against official tool docs and verified empirically (harness suite, shellcheck, markdownlint, editorconfig-checker, typos — all green locally).

CI / gating

  • Close the ci-status coverage gap. editorconfig, gitleaks, typos, and the harness self-test now run as lanes in ci.yml feeding the ci-status gateway; the four standalone workflow files are deleted. needs: can't cross workflow files, so the documented "single required check" design required consolidation. link-check.yml stays separate (intentionally advisory/scheduled).
  • Pin runner to ubuntu-24.04, add concurrency (cancel superseded runs) and per-job timeout-minutes.
  • Dependabot: add the npm ecosystem so markdownlint-cli2 gets bump PRs.

Harness

  • Bug fix: assert_row_count used grep -c … || echo 0, producing "0\n0" on zero matches so a zero-row assertion never matched. Now || true.
  • Funnel every assertion through pass()/fail() (was duplicated PASS/FAIL printf).
  • Guard run-tests.sh's empty-array expansion under set -u (bash ≤ 4.3 / macOS 3.2).
  • Expand the self-test to cover every assertion incl. the zero-match path; correct the param-order comment.

Modules / accuracy

  • typos: exit-code contract corrected (no documented exit 1; any non-zero ≠ 2 is an error — verified, observed exit 64).
  • gitleaks: fingerprint format clarified (gitleaks dir vs gitleaks git commit prefix).
  • shellcheck test: assert an rcfile-only code (SC2292) so the test proves the .shellcheckrc actually loaded (was SC2086, a default check).
  • lychee: anchor exclude_path bin/obj as (^|/)…; assert the missing-file error too; single canonical tool URL.
  • markdown test: assert specific style rule IDs (MD004/MD049) not just MD0; drop the redundant MD055 default (verified default is consistent); make the MD060 comment accurate.
  • powershell: rename pssa.test.sh → powershell.test.sh (matches <module>.test.sh across the org; pssa isn't a test-naming convention anywhere); clarify PSScriptAnalyzer settings auto-discovery is root-only.
  • editorconfig: fix stale workflow path in the config comment; drop a cross-reference per house style.

Meta / docs

  • package.json: license: UNLICENSED + engines.node: ">=24" (lockfile synced); fix lint:md to exclude all fixtures/*/bad (was markdown-only — broke npm run lint:md locally on the lychee bad fixture).
  • README / migration-plan / fixtures: remove the nonexistent "Pester" runner, correct "future scanners"/Phase-2 framing to reflect shipped modules, note the gitleaks good-only fixture exception and the .gitignore base/overlay intent.

Decisions driven by research + cross-repo consistency

  • No LICENSE file (every sibling repo lacks one; an OSS license would mislead on a private repo; org license policy is being designed in medley). Only the npm license: UNLICENSED field was set.
  • Runner pinning makes this repo the exemplar; recommend the constellation (esp. ci-workflows, where execution lives) adopt it. Note: Dependabot does not bump runs-on, so the image needs occasional manual bumps.

Deliberately NOT changed

  • MD040 left disabled (an audit agent had flipped it to enabled — a standard-policy change, reverted).
  • .gitattributes and PSScriptAnalyzerSettings.psd1 left as published (agent edits removing a verified-true precedent / adding an unverified claim were reverted).

🤖 Generated with Claude Code

… and docs

Outcome of a full per-file audit validated against official tool docs and
verified empirically on this machine (harness suite, shellcheck, markdownlint,
editorconfig-checker, typos all green).

CI / gating:
- Fold editorconfig, gitleaks, typos, and the harness self-test into ci.yml as
  lanes feeding the ci-status gateway, and delete the four standalone workflow
  files. needs: cannot cross workflows, so the "single required check" design
  required consolidation; link-check stays separate (advisory/scheduled).
- Pin runner to ubuntu-24.04, add concurrency (cancel superseded runs) and a
  per-job timeout-minutes.
- Dependabot: add the npm ecosystem so markdownlint-cli2 is kept current.

Harness:
- Fix assert_row_count: `grep -c ... || echo 0` produced "0\n0" on zero matches,
  so a zero-row assertion never matched; use `|| true` (grep -c already prints 0).
- Funnel every assertion through pass()/fail() (was duplicated PASS/FAIL printf).
- Guard run-tests.sh empty-array expansion under set -u (bash <= 4.3 / macOS 3.2).
- Expand the self-test to cover every assertion incl. the zero-match path, and
  correct the param-order comment.

Modules / accuracy:
- typos: exit-code contract corrected (no documented exit 1; non-zero on error).
- gitleaks: fingerprint format clarified (dir vs git-history commit prefix).
- shellcheck test: assert an rcfile-only code (SC2292), proving the rc loaded.
- lychee: anchor exclude_path bin/obj as (^|/)…; assert the missing-file error;
  single canonical tool URL.
- markdown test: assert specific style rule IDs (MD004/MD049) not just "MD0";
  drop the redundant MD055 default; make the MD060 comment accurate.
- powershell: rename pssa.test.sh -> powershell.test.sh (module-name convention);
  clarify PSScriptAnalyzer settings auto-discovery is root-only.
- editorconfig: fix stale workflow path; drop a cross-reference per house style.

Meta / docs:
- package.json: license UNLICENSED + engines.node ">=24" (lockfile synced);
  fix lint:md to exclude all fixtures/*/bad (was markdown-only, broke locally).
- README / migration-plan / fixtures: drop the nonexistent "Pester" runner,
  correct "future scanners" / Phase-2 framing to reflect shipped modules, note
  the gitleaks good-only fixture exception, and the .gitignore base/overlay note.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@kyle-sexton
kyle-sexton merged commit 1f2ef4e into main Jun 22, 2026
1 check passed
@kyle-sexton
kyle-sexton deleted the chore/audit-remediation branch June 22, 2026 21:59
kyle-sexton added a commit that referenced this pull request Jun 22, 2026
Follow-up to the audit remediation (#14), reconciling standards' CI with the
patterns medley (the mature reference) and ci-workflows already use.

- Float the runner: revert runs-on to ubuntu-latest. medley and ci-workflows
  deliberately pin toolchains and float the OS image; standards already pins
  every tool version, so #14's ubuntu-24.04 pin only made standards the lone
  diverger for no reproducibility gain. Runner pinning is a stability choice,
  not supply-chain hardening (that is the SHA-pinned uses:, unchanged).
- Eliminate the push/pull_request double-run: scope push to branches:[main]
  (post-merge validation) and let pull_request validate PRs. ci-status still
  reports on every PR via pull_request; no path/branch filter, so no stuck-
  pending risk. Matches medley's trigger pattern.
- Least privilege: move issues: write from workflow-level to the link-check job
  (OpenSSF Scorecard token-permissions guidance); workflow default stays read.
- persist-credentials: false on checkouts (constellation convention; the token
  is unused post-checkout in these read-only lanes).

Kept: concurrency, per-job timeout-minutes (a safety net with no coherent reason
to omit; recommend medley/ci-workflows adopt timeouts too).

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
kyle-sexton added a commit that referenced this pull request Nov 18, 2026
Refs: #805

## Summary

Changes the katex override from `~0.18.2` to `>=0.18.2`. The floor keeps
[GHSA-238p-pmpm-9mq7](GHSA-238p-pmpm-9mq7)
patched; without the 0.18.x cap, katex keeps updating as a normal
dependency instead of staying at 0.18 after upstream
(`micromark-extension-math`, [PR
#14](micromark/micromark-extension-math#14))
widens its range.

## Fix

- `package.json`: `"katex": "~0.18.2"` → `"katex": ">=0.18.2"`.
- `package-lock.json`: katex resolves 0.19.1.

## Verification

- `npm ls katex --all` → `[email protected] └──
[email protected]`.
- `markdownlint-cli2 README.md` → `0 issues`, with markdownlint loading
katex 0.19.1. markdownlint imports only the math parser
(`markdownlint/lib/micromark-parse.mjs:7`), never katex's
`renderToString`.

## Related

- Same change in claude-code-plugins, dotfiles, github-iac, songwriting,
provisioning, medley, claude-code-proxy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
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