Skip to content

fix(gates): author the glob-recursion fixtures, and read logs where the runner puts them - #707

Merged
rubenvdlinde merged 2 commits into
mainfrom
fix/glob-recursion-fixtures-that-were-never-committed
Sep 8, 2026
Merged

rubenvdlinde merged 2 commits into
mainfrom
fix/glob-recursion-fixtures-that-were-never-committed

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

The blocker

Package invariants is a required status check on main and is red on main today, blocking every pull request to this repository. This PR is one of the two causes. The other is the gate-111 registration.

Cause 1: the fixtures were never committed

test_gate_glob_recursion_fixtures.sh has never passed. It was committed without the fixture app it drives:

=== running real gates against  ===
FAIL: gate-8 reaches lib/Service/Object/ — gate did not run
... 7 FAILURE(S)

cd .../test-fixtures/glob-recursion failed, FIXTURE resolved to the empty string, and the suite ran the real gates against nothing. git log --all -- hydra-gates/scripts/test-fixtures/glob-recursion returns nothing: that directory was never in any commit, on any branch.

Seven fixtures are authored here, one per assertion, each at the depth the suite exists to prove is reachable and each with no shallow twin, so a gate that re-acquires a non-recursive glob finds nothing and the suite fails as designed:

gate fixture defect
8 lib/Service/Object/PermissionHandler.php fail-open auth resolver
6 lib/Service/Object/NestedOrphanHandler.php uncalled auth predicate
7 lib/Controller/Api/V1/NestedThingController.php unguarded #[NoAdminRequired]
9 lib/Controller/Api/V1/NestedThingController.php attribute contradicts body
3 lib/BackgroundJob/Nested/NestedStubJob.php empty run()
18 lib/Settings/register.d/10-nested-notifications.json legacy dialect, in a fragment
38 src/views/deep/deeper/deepest/NestedRoot.vue depth 5, past the old -maxdepth 4

Gate-8's fixture is deliberately the shape and the path of the real defect: openregister's lib/Service/Object/PermissionHandler.php, which that gate missed for months because it globbed lib/Service/*.php and never opened the file.

Neither the Vue nor the PHP fixtures quote the pattern their gate greps for, including in their comments. A fixture that names the thing it is meant to defeat defeats itself instead.

Cause 2: the suite looked in the wrong place

It read /tmp/hydra-gate-<name>.log. The runner writes to ${HYDRA_GATE_LOG_DIR}, a mktemp directory so parallel runs across repos cannot clobber each other, and announces it on its first line.

So the assertions reported "gate did not run" for gates that had run and had written their findings. That is the worse of the two failure modes this file's own _assert_found comment warns about, and it would have hidden the missing fixtures behind a plausible-looking message. It now reads the announced directory, keeping /tmp as a fallback so an older runner still works.

Verification

test_gate_glob_recursion_fixtures.sh: 7 FAILURE(S) to ALL PASS, exit 0, with every gate finding its nested file.

🤖 Generated with Claude Code

…he runner puts them

`test_gate_glob_recursion_fixtures.sh` has never passed. It was committed
without the fixture app it drives, so `cd .../test-fixtures/glob-recursion`
failed, FIXTURE resolved to the empty string, and the suite ran the real gates
against nothing:

    === running real gates against  ===
    FAIL: gate-8 reaches lib/Service/Object/ — gate did not run
    ... 7 FAILURE(S)

`git log --all -- hydra-gates/scripts/test-fixtures/glob-recursion` returns
nothing: the directory was never in any commit on any branch. That failure
fails `test_gate_acceptance_matrix.sh`, which fails the `Package invariants`
job, which is a REQUIRED check on main. Every PR to this repository has been
blocked by it.

TWO CAUSES, BOTH FIXED HERE.

1. The fixtures did not exist. Seven are authored, one per assertion, each at
   the depth the suite exists to prove is reachable and each with NO shallow
   twin, so a gate that re-acquires a non-recursive glob finds nothing:

     gate-8   lib/Service/Object/PermissionHandler.php       fail-open resolver
     gate-6   lib/Service/Object/NestedOrphanHandler.php     uncalled predicate
     gate-7   lib/Controller/Api/V1/NestedThingController    unguarded IDOR
     gate-9   lib/Controller/Api/V1/NestedThingController    attribute vs body
     gate-3   lib/BackgroundJob/Nested/NestedStubJob.php     empty run()
     gate-18  lib/Settings/register.d/10-nested-*.json       legacy dialect
     gate-38  src/views/deep/deeper/deepest/NestedRoot.vue   depth 5

   gate-8's fixture is deliberately the shape and the path of the real defect:
   openregister's lib/Service/Object/PermissionHandler.php, which this gate
   missed for months because it globbed lib/Service/*.php and never opened it.

   Neither Vue nor PHP fixture quotes the pattern its gate greps for, including
   in its comments. A fixture that names the thing it is meant to defeat
   defeats itself instead.

2. The suite looked in the wrong place. It read /tmp/hydra-gate-<name>.log,
   and the runner writes to ${HYDRA_GATE_LOG_DIR} -- a mktemp directory, so
   parallel runs across repos cannot clobber each other -- which it announces
   on its first line. So the assertions reported "gate did not run" for gates
   that HAD run and HAD written their findings. That is the worse of the two
   failure modes this file's own `_assert_found` comment warns about, and it
   would have hidden the missing fixtures behind a plausible-looking message.

   It now reads the announced directory, keeping the /tmp path as a fallback
   so an older runner still works.

Verified: the suite goes from 7 FAILURE(S) to ALL PASS, exit 0, with every
gate finding its nested file.
@rubenvdlinde
rubenvdlinde force-pushed the fix/glob-recursion-fixtures-that-were-never-committed branch from 5cdc6f3 to fad126d Compare September 8, 2026 10:19
The quarantine list carries its own integrity check, and it is the check that
demanded this commit:

    FAIL — quarantined suite 'test_gate_glob_recursion_fixtures.sh' now
           PASSES. Un-quarantine it: delete its entry.

A quarantined suite that passes is a hard failure, deliberately, so a suite
cannot be fixed and left sitting on the list where the next reader still
reads it as known-broken. Its entry named exactly what was missing -- "fixtures
absent — 7 assertions red; needs the nested lib/ + src/ fixture tree authored"
-- and this branch authors that tree, so the entry has to go with it.

test_gate_orphaned_capability_fixtures.sh stays quarantined: its three fixture
directories still do not exist, and its "pass fixture: 0 finding(s)"
assertions are still green-because-empty.
@rubenvdlinde
rubenvdlinde merged commit ca038c3 into main Sep 8, 2026
40 checks passed
@rubenvdlinde
rubenvdlinde deleted the fix/glob-recursion-fixtures-that-were-never-committed branch September 8, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant