You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Request]: Let audit treat methods covered by other tests as intentionally covered #264
Follow-up to #249 (fixed in #250, which added notReadyReasons).
Problem
urlcode audit sets ready: false while any active route/method has no passing fixture (uncovered-route-methods). Fixtures for stateful function routes (create/update/delete) mutate whatever store the function uses, so CRUD apps struggle to satisfy this gate even when those methods are covered by other tests.
Proposed behavior
Design a way to mark specific route/method pairs as intentionally covered elsewhere, so they stop counting as uncovered without weakening the gate silently. Open questions:
Where the marker lives (fixture file, route config, or an audit flag) and whether it needs a reason string.
How the audit reports acknowledged pairs, so ready: true still shows what was waived.
Whether it interacts with the rule that function routes serving only errors cannot satisfy normal-response coverage.
This changes the readiness gate's semantics, so it needs a decision before implementation. Update docs/READINESS.md with whatever is chosen.
Decision: allow a waiver, in the project file only.
A per-route, per-method acknowledgement in urlcode.yaml, for example coveredElsewhere: {POST: "reason"} on the route. The project file is what audit reads, and a reviewer sees the waiver in the diff.
The reason is required and must be non-empty.
Never accept a CLI flag; that would let a single run silently loosen the gate.
audit output lists each waived route/method pair with its reason, so ready: true still shows what was waived.
Open question to settle in the implementation: a function route that only serves errors still cannot satisfy normal-response coverage, and a waiver should not be able to hide that case.
Progress: PR #302 opened: coveredElsewhere waiver, listed in audit as waivedRouteMethods; ignored when a route has no other passing normal fixture. One open question on POST-only routes is in the PR.
Shipped in #302: coveredElsewhere waiver, waivedRouteMethods / ignoredWaivers / redundantWaivers in the audit report, docs/READINESS.md updated. Open question kept from the decision comment: a waiver on a route's only method (e.g. a POST-only route) is ignored, because such a route has no other passing normal fixture; letting it through would also let an error-only function route hide. Keeping this open until that is decided.
Ran the actual audits rather than reasoning in the abstract. Summary and recommendation below.
What I ran
urlcode audit --project <dir> (adding --host-file/--origin for extension projects) across every stateful/CRUD-shaped project in the repo:
recipes/store-crud (/api/todos/*, one route, methods: [GET, HEAD, POST, PUT, PATCH, DELETE]) — multi-method. With the operator host file wired up: ready: true, checks: 14, coveredRouteMethods: 6, uncovered: [], no waiver used at all. Its tests/requests.json runs a steps sequence: POST create → GET → HEAD → PATCH → PUT → GET list → DELETE → GET 404. Every CRUD method is directly, repeatably fixture-tested.
examples/lifecycle (/notes POST-only create, /notes/{id} GET+PUT) — the create route is single-method (POST-only), but it's covered directly (not waived): a steps fixture does POST (capture id + Location) → GET the created resource → PUT an update → restart → GET again to prove persistence survives a restart. ready: true, uncovered: [], no waiver present. This is the [Request]: Multi-step fixtures with captured values, a restart step and quiet test output #256 multi-step fixture mechanism in exactly the shape the issue asks about.
recipes/webhook-receiver (/webhook, POST-only, pure function) — ready: true, checks: 6, uncovered: [], no waiver. A POST-only route with ordinary request/response fixtures (no store involved) needs no waiver either.
examples/coverage-waiver (/notes, methods: [GET, POST] — multi-method) — the shipped waiver example. GET has a real fixture, POST is waived (coveredElsewhere: {POST: "..."}). ready: true, waivedRouteMethods: [{"route":"/notes","method":"POST", ...}]. This is the case the current rule is built for: waiver only kicks in when the route already has independent proof it works.
recipes/json-api, starters/default, starters/page, examples/cookbook (136 checks) — all ready: true with zero waivers; not relevant to the open question but confirms the common path needs nothing special.
To directly test the open question, I built a synthetic project: a single route /notes, methods: [POST] only (the create handler from examples/lifecycle), with coveredElsewhere: {POST: "Creates a note; covered by the store's integration tests, not by a repeatable fixture."} and an empty fixture file (no request exercises the route at all). Result:
{"ready": false, "notReadyReasons": ["uncovered-route-methods"],
"uncovered": [{"route":"/notes","method":"POST"}],
"ignoredWaivers": [{"route":"/notes","method":"POST","reason":"Creates a note; covered by the store's integration tests, not by a repeatable fixture."}]}
Confirms the documented behavior exactly: a waiver on a route's only method is ignored and the route stays uncovered/not-ready.
Does this actually strand real authors?
Less than the motivating case suggested. I could not construct a realistic stateful CRUD project where the current rule leaves an honest author stuck:
Every real single-method mutating route in this repo (webhook-receiver's POST, lifecycle's POST-create) is already fully covered by an ordinary fixture or a steps fixture, with zero waiver. The store extension's full CRUD surface (store-crud) is covered the same way — POST/PUT/PATCH/DELETE all run for real against a throwaway store directory per test run, and restart (used by lifecycle) proves persistence without any special-casing.
Since [Request]: Multi-step fixtures with captured values, a restart step and quiet test output #256 shipped steps with capture/restart, "a POST/PUT/DELETE fixture would mutate a real store" is no longer true as a blocker: urlcode test/audit gives each run a fresh store/data directory, so create→read→update→delete→verify-gone is exactly the repeatable, non-destructive fixture the original issue worried didn't exist. That was the whole motivating case for the waiver, and it's now moot for it.
I could not find or construct a plausible case where a route's sole method both (a) is the only method on the route, and (b) genuinely cannot be exercised by any fixture (including with a fake/sandboxed external target, as examples/egress does for outbound calls). The remaining candidates I considered are irreversible external side effects (a real, non-repeatable charge/send with no safe fake) — the repo doesn't have such an example, and even the webhook/egress examples test against fakes.
Security angle
Allowing a waiver to satisfy a route's only method would mean ready: true can be produced for a route where no automated request has ever hit it — not even to confirm the module imports cleanly, the argument/path mapping works, or the handler doesn't 500 on the first request. That's categorically weaker than today's waiver, which only excuses one method on a route already proven to boot and respond normally through another method. Relaxing this turns coveredElsewhere into "trust me," on exactly the routes (create/delete/state-mutating) where a broken handler is most consequential and least likely to be caught by manual QA before a customer hits it. Given #302's audit already found real value in refusing exactly this, and given #1 above shows the legitimate cases are already solved without a waiver, relaxing the rule buys little and costs the strongest part of the guarantee.
Recommendation: keep the rule exactly as shipped in #302. Do not add an exception for a route's only method. The steps/capture/restart fixture mechanism from #256 already resolves the motivating stateful-CRUD case without a waiver, as demonstrated by recipes/store-crud and examples/lifecycle above, and I couldn't construct a realistic project where the current rule leaves an author with no path to ready: true other than reaching for the waiver.
What would change my mind: a real project (or a convincing synthetic one) with a route whose only method has a side effect that cannot be exercised by any fixture — including against a fake/mocked external target — because the effect is irreversible and there's no safe way to fake it (e.g., a genuinely non-repeatable third-party charge/send with no sandbox mode). If that surfaces, I'd suggest a narrower relaxation than "any sole-method route": require the waived route to also be reachable by a passing negative/error fixture (proving the module loads and validation runs) before the waiver is honored, rather than dropping the "another passing normal-response fixture" requirement entirely.
Closed per research: #256's multi-step fixtures (steps/capture/restart) already let real CRUD routes reach ready:true with zero waivers, so the motivating case (a mutating fixture on a stateful route's sole method) is solved without relaxing the #302 rule. Recommendation: keep it as shipped — a waiver never covers a route's only method, since relaxing that would let ready:true certify a completely unexercised handler. Revisit only if a route with an irreversible, unfakeable side effect as its sole method shows up; none exists in this repo today. Full evidence: #264 (comment)
Activity
Record recommendation for waiving audit coverage of methods tested el…
jimhoyd commentedon Sep 20, 2026
Decision: allow a waiver, in the project file only.
urlcode.yaml, for examplecoveredElsewhere: {POST: "reason"}on the route. The project file is whatauditreads, and a reviewer sees the waiver in the diff.auditoutput lists each waived route/method pair with its reason, soready: truestill shows what was waived.Update
docs/READINESS.mdin the same PR.jimhoyd commentedon Sep 20, 2026
Progress: implementation started by an agent against the maintainer decision on this issue; a PR will be linked here when it opens.
Record decisions for eight benchmark-driven authoring requests (#297)
jimhoyd commentedon Sep 20, 2026
Progress: PR #302 opened:
coveredElsewherewaiver, listed in audit aswaivedRouteMethods; ignored when a route has no other passing normal fixture. One open question on POST-only routes is in the PR.Add a per-route, per-method coveredElsewhere audit waiver (#264)
Add a per-route, per-method coveredElsewhere audit waiver (#264) (#302)
jimhoyd commentedon Sep 20, 2026
Shipped in #302: coveredElsewhere waiver, waivedRouteMethods / ignoredWaivers / redundantWaivers in the audit report, docs/READINESS.md updated. Open question kept from the decision comment: a waiver on a route's only method (e.g. a POST-only route) is ignored, because such a route has no other passing normal fixture; letting it through would also let an error-only function route hide. Keeping this open until that is decided.
jimhoyd commentedon Sep 21, 2026
Progress: an agent has started on this; a PR (or a recommendation comment) will be linked here.
jimhoyd commentedon Sep 21, 2026
Ran the actual audits rather than reasoning in the abstract. Summary and recommendation below.
What I ran
urlcode audit --project <dir>(adding--host-file/--originfor extension projects) across every stateful/CRUD-shaped project in the repo:recipes/store-crud(/api/todos/*, one route,methods: [GET, HEAD, POST, PUT, PATCH, DELETE]) — multi-method. With the operator host file wired up:ready: true,checks: 14,coveredRouteMethods: 6,uncovered: [], no waiver used at all. Itstests/requests.jsonruns astepssequence: POST create → GET → HEAD → PATCH → PUT → GET list → DELETE → GET 404. Every CRUD method is directly, repeatably fixture-tested.examples/lifecycle(/notesPOST-only create,/notes/{id}GET+PUT) — the create route is single-method (POST-only), but it's covered directly (not waived): astepsfixture does POST (capture id + Location) → GET the created resource → PUT an update →restart→ GET again to prove persistence survives a restart.ready: true,uncovered: [], no waiver present. This is the [Request]: Multi-step fixtures with captured values, a restart step and quiet test output #256 multi-step fixture mechanism in exactly the shape the issue asks about.recipes/webhook-receiver(/webhook, POST-only, pure function) —ready: true,checks: 6,uncovered: [], no waiver. A POST-only route with ordinary request/response fixtures (no store involved) needs no waiver either.examples/coverage-waiver(/notes,methods: [GET, POST]— multi-method) — the shipped waiver example. GET has a real fixture, POST is waived (coveredElsewhere: {POST: "..."}).ready: true,waivedRouteMethods: [{"route":"/notes","method":"POST", ...}]. This is the case the current rule is built for: waiver only kicks in when the route already has independent proof it works.recipes/json-api,starters/default,starters/page,examples/cookbook(136 checks) — allready: truewith zero waivers; not relevant to the open question but confirms the common path needs nothing special.To directly test the open question, I built a synthetic project: a single route
/notes,methods: [POST]only (the create handler fromexamples/lifecycle), withcoveredElsewhere: {POST: "Creates a note; covered by the store's integration tests, not by a repeatable fixture."}and an empty fixture file (no request exercises the route at all). Result:{"ready": false, "notReadyReasons": ["uncovered-route-methods"], "uncovered": [{"route":"/notes","method":"POST"}], "ignoredWaivers": [{"route":"/notes","method":"POST","reason":"Creates a note; covered by the store's integration tests, not by a repeatable fixture."}]}Confirms the documented behavior exactly: a waiver on a route's only method is ignored and the route stays uncovered/not-ready.
Does this actually strand real authors?
Less than the motivating case suggested. I could not construct a realistic stateful CRUD project where the current rule leaves an honest author stuck:
webhook-receiver's POST,lifecycle's POST-create) is already fully covered by an ordinary fixture or astepsfixture, with zero waiver. The store extension's full CRUD surface (store-crud) is covered the same way — POST/PUT/PATCH/DELETE all run for real against a throwaway store directory per test run, andrestart(used bylifecycle) proves persistence without any special-casing.stepswithcapture/restart, "a POST/PUT/DELETE fixture would mutate a real store" is no longer true as a blocker:urlcode test/auditgives each run a fresh store/data directory, so create→read→update→delete→verify-gone is exactly the repeatable, non-destructive fixture the original issue worried didn't exist. That was the whole motivating case for the waiver, and it's now moot for it.examples/egressdoes for outbound calls). The remaining candidates I considered are irreversible external side effects (a real, non-repeatable charge/send with no safe fake) — the repo doesn't have such an example, and even the webhook/egress examples test against fakes.Security angle
Allowing a waiver to satisfy a route's only method would mean
ready: truecan be produced for a route where no automated request has ever hit it — not even to confirm the module imports cleanly, the argument/path mapping works, or the handler doesn't 500 on the first request. That's categorically weaker than today's waiver, which only excuses one method on a route already proven to boot and respond normally through another method. Relaxing this turnscoveredElsewhereinto "trust me," on exactly the routes (create/delete/state-mutating) where a broken handler is most consequential and least likely to be caught by manual QA before a customer hits it. Given #302's audit already found real value in refusing exactly this, and given #1 above shows the legitimate cases are already solved without a waiver, relaxing the rule buys little and costs the strongest part of the guarantee.Recommendation: keep the rule exactly as shipped in #302. Do not add an exception for a route's only method. The
steps/capture/restartfixture mechanism from #256 already resolves the motivating stateful-CRUD case without a waiver, as demonstrated byrecipes/store-crudandexamples/lifecycleabove, and I couldn't construct a realistic project where the current rule leaves an author with no path toready: trueother than reaching for the waiver.What would change my mind: a real project (or a convincing synthetic one) with a route whose only method has a side effect that cannot be exercised by any fixture — including against a fake/mocked external target — because the effect is irreversible and there's no safe way to fake it (e.g., a genuinely non-repeatable third-party charge/send with no sandbox mode). If that surfaces, I'd suggest a narrower relaxation than "any sole-method route": require the waived route to also be reachable by a passing negative/error fixture (proving the module loads and validation runs) before the waiver is honored, rather than dropping the "another passing normal-response fixture" requirement entirely.
jimhoyd commentedon Sep 21, 2026
Closed per research: #256's multi-step fixtures (steps/capture/restart) already let real CRUD routes reach ready:true with zero waivers, so the motivating case (a mutating fixture on a stateful route's sole method) is solved without relaxing the #302 rule. Recommendation: keep it as shipped — a waiver never covers a route's only method, since relaxing that would let ready:true certify a completely unexercised handler. Revisit only if a route with an irreversible, unfakeable side effect as its sole method shows up; none exists in this repo today. Full evidence: #264 (comment)