goalpost
Stops an AI agent from making tests pass by weakening the tests.
You ask an agent to make the tests pass. Sometimes it fixes the code. Sometimes it does this instead:
- adds
@pytest.mark.skiporxit(to a failing test - deletes the failing test
- removes the assertion that was failing
- changes the expected value in the test so the bug looks correct
- appends
|| trueor--exit-zeroso a failure stops showing - commits with
--no-verifyto skip the hooks that would have caught it
Then it reports "all tests pass". That's moving the goalposts.
Goalpost sits between the agent and your files. Before an edit to a test file, or a test command that hides failures, runs, it reads the change and decides.
Goalpost blocked this change to tests/test_app.py: it adds a skip marker. Fix the code so the test
passes as written. If the test itself is wrong, say so in your reply and ask the user before changing it.
The blocked call never runs, and the test file stays exactly as it was.
What it catches
| Change | Result |
|---|---|
Adds a skip or xfail marker (pytest.mark.skip, xfail, it.skip, xit, @Ignore, #[ignore]) | Blocked |
| Deletes a test | Blocked |
| Removes an assertion with nothing put in its place | Blocked |
Test command with || true, --exit-zero or --passWithNoTests | Blocked |
Any command with --no-verify | Blocked |
Rewrites an assertion, for example == 3 becomes == 4 | Warning only |
Adds # noqa, # type: ignore, eslint-disable or @ts-ignore | Warning only |
| Fixes the code and leaves the tests alone | Allowed, not even looked at |
| Adds a new passing test | Allowed |
| Renames a test | Allowed |
Runs pytest or npm test normally | Allowed |
Rewritten assertions are warnings, not blocks, because sometimes the expected value really is wrong. A rewrite is recorded in the ledger so a person can check it.
Modes
Set under plugins.entries.goalpost.settings in config.yaml:
| Mode | Behaviour |
|---|---|
block (default) | Stops blocking-level changes before they run, and records every decision |
warn | Lets every change through, but records what it would have blocked |
off | Does nothing |
Run /goalpost status to see the mode and how many changes were blocked or allowed.
How it decides
It compares the text before an edit with the text after it, and counts markers, test definitions and assertion lines. It never calls a model, so it's fast and can't time out.
- Before an edit to an existing file: the current file on disk is the "before".
- For
patch: the old text and the new text are the "before" and "after", because a patch changes only part of a file. - For a new test file: the "before" is empty, so any skip marker in it is blocked.
Limits
- Text-based, not semantic. It counts markers and assertion lines. It won't catch a test that was weakened in a way that doesn't change any of those, such as a loop that stops checking half the cases.
- Deleting an obsolete test is blocked. That's deliberate, because deleting is also how tests get hidden. If you really want to remove one, switch to
warnfor that session, or ask the agent to explain the removal first. - It can't see changes made outside Hermes. An edit made by hand, or by another program, never passes through the hook.
- The test-file pattern is a guess at common layouts (
tests/,test_*.py,*_test.go,*.test.ts,*.spec.*). A project with an unusual layout needs its tests named one of these ways. - Not tested yet on Linux, macOS or Docker.
What it touches
- Reads the file an edit targets, so it can compare before and after.
- Writes only under
<hermes home>/plugin-data/goalpost/: aledger.jsonlfile with one line per decision (time, tool, file or command, decision, and the reasons). It stores no file contents. - No network, no subprocesses, no telemetry, no credentials, no model calls, no dependencies.
Development
pytest tests
47 tests cover the detector (every rule, plus the cases that must stay allowed), the guard (block, warn and off modes, the ledger, and the message text), and the plugin wiring (the hook, the command and the settings).
License
MIT
README from the reviewed commit 00aae8d; it updates when the author re-pins.

salch-cred


