-
Notifications
You must be signed in to change notification settings - Fork 0
feat(ci): canonical bypass-audit standard + pipeline drift detection #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
|
|
||
| # helmet drift-scan fleet list (operator-specific) | ||
| .helmet-fleet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # helmet fleet list — repos to scan for pipeline drift. | ||
| # Copy to `.helmet-fleet` (gitignored) and edit. One `owner/repo` per line; # comments OK. | ||
| # Used by: scripts/check-pipeline-drift.sh --fleet | ||
| # | ||
| # List ONLY push-time repos that carry the canonical `# helmet-pipeline: vX.Y.Z` stamp. | ||
| # The drift check exits non-zero on any unstamped/behind repo, so do NOT list repos that | ||
| # are intentionally off the push-time standard — they would false-positive forever: | ||
| # • Dive-And-Dev/diveanddev.com — the hand-authored REFERENCE design; carries no helmet | ||
| # stamp by design (ADR-0001 — it needs no change). It IS the standard, not measured against it. | ||
| # • chris-yyau/seatbelt — a scheduled-SWEEP variant (cron + dedup), a documented exception | ||
| # (ADR-0001); structurally divergent from the push-time standard, so it is not scanned here. | ||
| # | ||
| # Example (stamp-bearing push-time repos): | ||
| # chris-yyau/busdriver | ||
| # chris-yyau/helmet | ||
| # Dive-And-Dev/perch | ||
| # Dive-And-Dev/chrisyau.me | ||
| # Dive-And-Dev/jikdak | ||
| # Dive-And-Dev/growth-engine |
75 changes: 75 additions & 0 deletions
75
docs/adr/0001-bypass-audit-standard-and-drift-detection.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # ADR-0001: Single bypass-audit standard + pipeline drift detection | ||
|
|
||
| - **Status:** Accepted | ||
| - **Date:** 2026-06-05 | ||
|
|
||
| ## Context | ||
|
|
||
| helmet generates a `bypass-audit.yml` workflow into each repo it onboards (detects | ||
| direct pushes to `main` that bypassed required checks, opens an `admin-bypass` issue). | ||
| Because helmet **vendors** (copies) the file at onboarding, every repo froze a snapshot | ||
| of whatever helmet generation it adopted. Nothing re-synced them — dependabot bumps | ||
| action SHAs but never the workflow *logic* — so the fleet drifted badly: `chrisyau.me` | ||
| and `jikdak` sat at the **v1.12** generation (April) while a freshly-authored | ||
| `diveanddev.com` (June, via its PR #30) had a materially more secure design. The | ||
| neglected repo was *ahead* of the actively-developed ones, purely because its file was | ||
| written last. | ||
|
|
||
| Three design divergences had accumulated across generations: (a) dedup present/absent | ||
| and, where present, gameable; (b) commit-message-based skip (`[skip ci]`/`chore(release)`) | ||
| that a human bypasser can forge to evade; (c) silent skip vs. fail-the-run on an | ||
| indeterminate API response. | ||
|
|
||
| A code review (codex) also surfaced that any **dedup keyed on issue title/body is an | ||
| insider-editable suppression primitive**: GitHub issue metadata is mutable, and | ||
| `.author.login` stays `github-actions[bot]` even after a human edits the body — so an | ||
| author-filtered dedup can still be defeated by editing a bot-authored issue to pre-load | ||
| a future bypass SHA. `diveanddev.com` had independently reasoned to *no dedup* for | ||
| exactly this reason. | ||
|
|
||
| ## Decision | ||
|
|
||
| 1. **One standard = `diveanddev.com`'s design** for all push-time repos: push-only, | ||
| **identity-based skip only** (no commit-message skip), **fail-the-run** on an | ||
| indeterminate PR-lookup (never silent-skip, never false-positive), and **no dedup** | ||
| (the org audit log is the authoritative trail; a duplicate issue on a rare manual | ||
| re-run is harmless and far safer than a mutable-metadata suppression vector). | ||
| helmet's own `bypass-audit.yml` is the canonical template. | ||
| 2. **Distribution stays vendored (self-contained), not centralized.** Each repo keeps | ||
| its own copy; we do **not** convert to a reusable workflow. Rationale: reusable | ||
| workflows would couple every production app repo to helmet at runtime (and make the | ||
| repo that *authored* the design depend on a copy of itself) — unacceptable for | ||
| self-contained production repos. | ||
| 3. **Prevent future drift with detection, not coupling.** Every generated workflow | ||
| carries a `# helmet-pipeline: vX.Y.Z` stamp; `scripts/check-pipeline-drift.sh` | ||
| compares each repo's stamp to the canonical version and reports repos that are | ||
| behind. Drift becomes visible instead of silent. | ||
| 4. **`seatbelt` is a documented exception.** It is a daily *sweep* (cron) design, which | ||
| structurally requires dedup; it is not converged to the push-only standard. | ||
|
|
||
| ## Alternatives considered | ||
|
|
||
| - **Reusable workflow (centralize):** eliminates drift structurally, but couples every | ||
| repo to helmet at runtime and makes self-contained production repos non-self-contained. | ||
| Rejected — the coupling cost outweighs the "byte-identical forever" guarantee. | ||
| - **Keep author-filtered dedup as the standard:** rejected — codex showed it remains an | ||
| insider-editable suppression primitive; for an audit workflow, no-dedup is safer. | ||
| - **Drop seatbelt's sweep too (full uniformity):** rejected — would delete a deliberate, | ||
| more-thorough capability; a sweep genuinely needs dedup. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - The six in-flight "hardened dedup" PRs are **superseded** (to be closed) — the standard is | ||
| no-dedup. | ||
| - All push-time repos converge on one design; new onboards are born on it and stamped. | ||
| - Drift is now detectable on demand (and via a scheduled scan); re-sync is a manual | ||
| re-onboard when the check flags a repo (acceptable for a vendored model). | ||
| - `diveanddev.com` needs no change — it *is* the reference. | ||
|
|
||
| ## Revisit trigger | ||
|
|
||
| - If manual re-syncs become frequent/annoying, add an auto-re-adoption PR bot. | ||
| - If a repo gains multiple `issues:write` collaborators AND a no-dedup duplicate-issue | ||
| rate becomes a real nuisance, reconsider a non-metadata dedup (e.g. a committed ledger), | ||
| not a metadata one. | ||
| - If GitHub ships first-class org-wide required workflows that fit, reconsider centralizing. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In repos with more than 30 labels where
admin-bypassis not in the first page, this fallback treats an existing label as unavailable and creates the audit issue without the label. The GitHub CLI manual forgh label listdocuments--limit <int> (default 30)(https://cli.github.com/manual/gh_label_list), so the existence check can be a false negative even though the labeledgh issue createwould have worked; this loses the label-based audit filtering the workflow depends on.Useful? React with 👍 / 👎.