feat: junk-file gate, shell gate, and the reusable gate workflow - #1
Merged
scottwueschinski-genpact merged 1 commit intoJul 29, 2026
Merged
Conversation
First deliverable of the uniform-CI plan. One reusable workflow that many repos call, so a rule is fixed once instead of thirty times. WHY A PUBLIC REPO. A private reusable workflow can only be called from inside the same organization or user account, and 4 of the 10 active repos live under the personal scott-wueschinski-GTMify account rather than the GTMify org. An org-private host would have reached 6 of 10 and left the rest on a vendored copy that drifts. Nothing secret lives here: workflow YAML and check scripts only. THE JUNK-FILE GATE is the check that pays for itself. Nothing stopped 33 .claude/worktrees/* gitlinks and 40 .pos-supervisor/* files, one a SQLite analytics.db-wal, from becoming tracked in GTMify/GTMify. A write-ahead log is rewritten on nearly every run, so that repo was permanently dirty, the session-end auto-commit hook turned the dirt into a commit every time, and local master drifted 19 commits off origin carrying no app code at all. gtmify-config has a committed hooks/Icon for the same reason: no gate. Three modes: diff against a base (what a PR would add), --staged (for the pre-commit hook), and --audit (one-time cleanups). Only TRACKED paths can fail, because every mode enumerates through git; a gitignored file on disk is invisible by construction. The gate objects to junk being tracked, not to junk existing. .ci-junk-allowlist is a deliberate escape hatch, since a gate with no legitimate override gets switched off the first time it is wrong. Verified with 35 cases, one throwaway repo each, dirty in exactly one way. The two that carry the most weight: ignored_but_present proves the tracked-only property, and icon_in_a_longer_name pins the exact false-positive class that made auto_commit_on_exit.sh silently drop changes to a file named "My Icon Design.txt". The suite was also observed FAILING, not only passing. Removing the worktree pattern from the gate turns 3 cases red; restoring it returns 35/0. self-test.yml runs that mutation on every PR here, so the tests cannot quietly stop asserting. HOUSE STYLE IS OFF and the input is wired but defaulted false. The linter lives in the private GTMify/claude-house-style repo, which a public workflow cannot read without a token. That needs a decision (make the linter public, or mint a read-only PAT) rather than 10 repos each carrying a secret. ENFORCEMENT LIMIT, stated plainly: the org is on the free plan, where branch protection and rulesets return 403 on private repos. These checks run and show red but cannot be required. Real enforcement for the junk gate comes next, from a local pre-commit hook that blocks junk before it can be committed at all. One incidental finding worth recording: a comment line beginning with the word shellcheck is parsed as a directive and fails the file. shell_gate.sh's own docblock had to be reworded. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
scottwueschinski-genpact
deleted the
feat/junk-gate-and-reusable-workflow
branch
July 29, 2026 06:13
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
First deliverable of the uniform-CI plan. One reusable workflow that many repos call, so a rule gets fixed once instead of thirty times.
Why this repo is public
A private reusable workflow can only be called from inside the same org or user account. Four of the ten active repos live under the personal
scott-wueschinski-GTMifyaccount rather than theGTMifyorg, so an org-private host would have reached six of ten and left the rest on a vendored copy that drifts. Nothing secret lives here: workflow YAML and check scripts only.The junk-file gate
This is the check that pays for itself immediately.
Nothing stopped 33
.claude/worktrees/*gitlinks and 40.pos-supervisor/*files, one of them a SQLiteanalytics.db-wal, from becoming tracked inGTMify/GTMify. A write-ahead log is rewritten on nearly every run, so that repo was permanently dirty, the session-end auto-commit hook turned the dirt into a commit every time, and localmasterdrifted 19 commits off origin carrying no app code at all.gtmify-confighas a committedhooks/Iconfor the same reason.Three modes: diff against a base (what a PR would add),
--staged(for the pre-commit hook landing next),--audit(one-time cleanups).Two properties worth reviewing closely:
Only tracked paths can fail. Every mode enumerates through git, so a gitignored file on disk is invisible by construction. The gate objects to junk being tracked, not to junk existing.
.ci-junk-allowlistis a deliberate escape hatch. A gate with no legitimate override gets switched off the first time it is wrong.Verification
35 cases, one throwaway git repo each, dirty in exactly one way. All pass. The two carrying the most weight:
ignored_but_presentanalytics.db-walon disk does not fail the gateicon_in_a_longer_nameMy Icon Design.txtpasses; this is the exact false-positive class that madeauto_commit_on_exit.shsilently drop real workThe suite was observed failing, not only passing. Removing the worktree pattern turns 3 cases red; restoring it returns 35/0.
self-test.ymlruns that mutation on every PR to this repo, so the tests cannot quietly stop asserting anything. That check has already caught two false greens in the app repo, which is why it is wired in from the start.shellcheck --severity=warningandbash -nare clean on all three scripts.Deliberately not in this PR
House style is off, with the input wired and defaulted
false. The linter lives in the privateGTMify/claude-house-stylerepo, which a public workflow cannot read without a token. That needs your decision (make the linter public, or mint a read-only PAT) rather than ten repos each carrying a secret. Until then the local write-time hook covers the common case.Enforcement has a hard limit. The org is on the free plan, where branch protection and rulesets return
403on private repos, so these checks run and show red but cannot be made required. Real enforcement for the junk gate arrives in the next PR as a local pre-commit hook, which blocks junk before it can be committed at all and does not depend on a GitHub plan.Incidental finding
A comment line beginning with the word
shellcheckis parsed as a directive and fails the whole file.shell_gate.sh's own docblock had to be reworded, which is noted inline so nobody reintroduces it.Next
Tag
v1on merge, then the spike: wire one personal-account repo and confirm a public reusable workflow actually resolves from a private repo in a different account. That assumption is load-bearing for the whole design and I would rather learn it on one repo than ten.🤖 Generated with Claude Code