Skip to content

feat(router): dispatch explicit HEAD routes before GET fallback - #189

Merged
jonbaldie merged 2 commits into
mainfrom
feat/queue-166-head
Oct 27, 2026
Merged

jonbaldie merged 2 commits into
mainfrom
feat/queue-166-head

Conversation

@jonbaldie

@jonbaldie jonbaldie commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #166. Queue clients keep the same HEAD behavior. Maintainers can register Peek directly instead of checking the HTTP method inside Dequeue.

HEAD /dequeue/:queue
  Router.head -> Peek -> response headers, no body
GET /dequeue/:queue
  Router.get -> Dequeue -> oldest Payload
Other GET routes
  HEAD falls back to GET when no explicit HEAD route matches

The change covers explicit HEAD priority and body removal. It preserves existing Allow values. Extra HTTP methods and middleware changes are out of scope.

Evidence

  • Before: The new router tests report 11 passed | 7 failed because Router.head is absent. Adding registration alone still leaves six dispatch tests failing.
    After: deno test --frozen tests/router_test.ts reports 18 passed | 0 failed. Router and unchanged handler tests together report 162 passed | 0 failed.
  • Before: The production binary preserves the Queue on HEAD and returns Allow: GET for an unsupported Dequeue method.
    After: A live HTTP comparison passes all 16 requests on both production binaries with identical results, including FIFO Dequeue and empty-Queue responses.
  • deno test --frozen --allow-read --allow-write --allow-net --allow-env --allow-run reports 390 passed | 0 failed, including Docker persistence and the real Stryker runner.
  • npm run quality:production passes. CI is green for Test, Production quality, Mutasaurus, and Stryker.

Merge Danger

Door: two-way

A code revert restores the old dispatch. No stored data or configuration changes.

Blast Radius: routing

HEAD dispatch changes inside Router. GET fallback, authentication, Queue preservation, and existing method-error headers have regression coverage.

@jonbaldie

Copy link
Copy Markdown
Owner Author

Verification verdict

PASS+NOTES from the implementing assistant's sequential review fallback. This is not an independent review. The session has no subagent tool.

Reviewed head f46c93d4b2fb38db29c7d3f957d4acd6d0719023 against base 19097c19ed4daa70143ca1e5020052e581d91465. Stable patch-id is 0b6e493f794538be1080b24892ffafbc5c21b711.

  • The full Deno suite passes with 390 tests. The production quality gate passes without policy changes.
  • Both production binaries compile. A live HTTP comparison passes 16 requests per binary with identical results, including Queue preservation on HEAD, FIFO Dequeue, and unchanged Allow values.
  • The new tests fail before implementation and pass afterward. Both registration orders, overlapping patterns, HEAD-only routes, fallback, and response metadata have coverage.
  • No comments or suppressions were added. The diff changes only Router, Dequeue registration, and router tests.

Remote CI must finish successfully at this head before merge. Router-generated HEAD error bodies remain unchanged. Normalizing all error bodies is outside this ticket.

@jonbaldie
jonbaldie merged commit 569e6ef into main Oct 27, 2026
4 checks passed
@jonbaldie
jonbaldie deleted the feat/queue-166-head branch October 27, 2026 05:16
@jonbaldie jonbaldie mentioned this pull request Oct 29, 2026
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.

Architecture: Decouple HTTP HEAD dispatch in Router to eliminate handler-level method sniffing

1 participant