[PR #46] Moving the Full Check to GitHub and Guarding main
- What changed: The full check was moved to run on GitHub, and a guard was added that blocks commands sending changes straight to main. The check hook was moved from PowerShell to Node.
- Decision: Branch protection was not available on the free plan, so three layers were used: account permissions, a repository hook, and a human merge check.
- Still unknown: The hook blocks by looking at command text, so a command saved in a script can get around it. Human checks are still needed.
PR #46 is the first step toward letting AI take on more development under human supervision. It built the checks and safety guards first. No feature code changed.
What was done and why
- The plan is for AI to take on most development, with people supervising the progress. This PR is the first step.
- The biggest obstacle was that the full check ran only on one PC. In all three agent-led work runs, each time the full check was run on that PC after returning, a bug appeared.
- So three things were built first.
- An automatic check on GitHub. Every change request (PR) runs the full check in GitHub’s environment. Database tests can run there too.
- The check hook moved to Node. The hook (a script that runs the full check before an action) had been written in PowerShell. It is now a Node script, so it also runs where PowerShell is not installed.
- A hook that blocks commands which send work straight to main. If AI pushes to main, force-pushes, or merges a change request, the command is blocked. Only a person merges.
Options considered
- Branch protection was not available. The repository is private and on a free account, and this feature is limited to paid plans. So a three-layer approach was chosen: separate account permissions, a repository hook that blocks, and a person who reads the automatic check result before merging.
- The hook is not complete, because it blocks based on the command text. A command saved in a script file and run from there can get past it. The limit is recorded in the design memo as a remaining risk.
- Changes that only touch documents still run the automatic check. A script that checks the tracker reads documents, so skipping would hide its failures.
- The GitHub action versions were taken from the official list, not from memory. The Node version was pinned to 24.19.0, the same as my Windows computer.
How it was checked
- The blocking hook was tested with sixteen commands. Ten that should be blocked were blocked, and six that should pass went through.
- The hook was active in this session, so a merge command that appeared in a test command was actually blocked. That confirmed it works as intended.
- The Node check hook was tested in four cases: skipping when configured, blocking a deliberately failing check, allowing a stop after recording a failure, and the full check passing.
- The automatic check ran for the first time on this PR. Its result is confirmed on the PR.
Not yet checked
- The part that stops a check that runs too long, including its child processes, was not tested. If it happens, it will be checked then.
- A workaround cannot be fully blocked by this alone. Human review is still needed.
Lessons
- If a check runs on only one machine, failures show up late after that machine is left behind. Moving the check environment is a precondition for automation.
- A hook takes effect in the same session as soon as the settings file is saved. When testing a hook, do not type the blocked text directly into the command. Put it in a separate test file and run that.