A gate by hand
GDD without the skills, with what your repository already has.
A gate by hand is a mandatory check before merging, put together with branch protection, CI, tests and CODEOWNERS. It needs no new tools. Whether it truly blocks, and doesn't just warn, depends on your plan: without protected branches or rulesets, which are paid on private GitHub repositories, CI warns but doesn't block.
Your first gate
- Create the
checks/<change>branch frommainand keep the approved tests on it, which another agent can draft. Only you write to that branch. - Create the
<change>branch from the checks one, for the agent. It can add tests, but it can't change or delete the approved ones, or touchpackage.jsonor CI. - If it needs to touch those files, it stops and asks you. You make that change yourself, on the checks branch.
- Add the
sealworkflow, which compares the two branches, and thegatesworkflow, which runs the tests. - Mark the delicate paths in
CODEOWNERS, CI itself included. - In the settings, require a pull request on
main, passingsealandgate, tied to GitHub Actions, and review by the code owners. Dismiss approvals when a new push comes in. And make sure not even whoever administers the repository skips the rule. - Create a ruleset on
checks/**/*so that only you can create and write. - Give the agent its own credentials, with no permission to touch workflows.
Before relying on the gate, run an incorrect charge and a valid charge. The first must fail for the expected reason and the second must pass. Check which account can change the criteria, the run or its result.
The files
| File | What it does |
|---|---|
.github/workflows/seal.yml | Compares the agent's branch with the checks one and blocks the changes that aren't allowed. |
.github/workflows/gates.yml | Installs with npm ci and runs npm test. |
CODEOWNERS | Gives an owner to /payments/, /.github/ and /CODEOWNERS. |
What it guarantees, and what it doesn't
| It guarantees | It can't guarantee |
|---|---|
| That tests already approved don't change or disappear. | The whole core of GDD. What's missing is in The engine. |
| That nothing gets merged with failing tests. | Catching a solution tailored to the tests: that takes a reviewer and hidden examples. |
| That the agent doesn't change what you approved, if it uses its own credentials. | Anything, if the agent uses your credentials: with them it can do whatever you can. |
| Review by the code owners on the delicate paths. | That whoever administers the repository doesn't change the settings. |
Before you cross: The agent works with your credentials. Does the gate still hold?
That's not it. With your credentials it can do whatever you can, including writing to the checks branch.
That's it. With your credentials it can do whatever you can, including writing to the checks branch.