Skip to content

[Bug]: audit's gated-route-uncovered note fires when only a refusal case covers one method of a signed-in route #959

Closed

Description

@jimhoyd

From the third agent workflow trial (booking task).

Minimal reproduction

An auth: true store route /api/bookings/* with methods [GET, HEAD, POST, PUT, PATCH, DELETE]. Its fixtures are steps that sign in through /api/auth/sign-in/email. They cover every method with a success case except PATCH, whose only case is a refusal ({"status":"cancelled"} → 422).

Relevant output

$ npm run audit
… "ready":false,"notReadyReasons":["route-count-mismatch","uncovered-route-methods"], … "coveredRouteMethods":7, …
"uncovered":[{"route":"/api/bookings/*","method":"PATCH"}], …
"coverageNotes":[{"code":"gated-route-uncovered","routes":["/api/bookings/*"],"message":"These routes are behind a sign-in gate (auth: true), so an anonymous request only reaches the refusal. Cover them with a steps fixture that signs in through the provider's own endpoint (the fixture's cookie jar keeps the session, and \"origin\": \"{{origin}}\" satisfies the same-origin check), or, where no fixture can sign in, waive the methods with coveredElsewhere and assert the anonymous 401."}]

The note's advice was already followed: six methods of that route were covered by signed-in steps cases. The actual cause was that PATCH had only a 422 case, so the note pointed the wrong way. Adding a successful PATCH step made the audit ready.

Expected: gated-route-uncovered only when the route has no signed-in coverage at all. When other methods of the route are covered by sign-in steps, a note that says the uncovered method has no passing success case (or only refusal cases).

What you could not verify

Whether a refusal-only case is meant never to cover a method. It's reasonable; the note just didn't say so.

Runtime revision and environment

main f850492a (0.6.5), packed install, macOS, Node 26.10.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions