Skip to main content
← Back to list
01Issue
FeatureOpenSwamp CLIPublic
AssigneesNone

Relationships

#4594 serve: add a fitness test so no serve route is added under the /hooks/ webhook route-file prefix

Opened by skunk-ape · 11/10/2026

Problem

Webhook route files must sit under /hooks/ (WEBHOOK_ROUTE_PREFIX and fileRouteProblem in src/serve/webhook_route.ts, #4547). Webhook routes are matched before serve's own HTTP routes, so a route file can take over any serve path under that prefix.

No serve route lives under /hooks/ today, so nothing collides. But nothing stops one from being added. Route files come in through repo review, not host configuration. If a serve route is ever added under /hooks/, any reviewed route file on that path takes it over, and serve logs nothing.

The existing rules test (integration/serve_webhook_route_files_rules_test.ts) only pins which modules load route files and register routes. It does not check serve's own paths.

Proposed change

Add an architecture fitness test in integration/ that fails if serve answers any path under /hooks/. It must cover:

  • exact path checks in the serve request handler (src/cli/commands/serve.ts) and the handlers it calls (src/serve/);
  • prefix and pattern matchers (for example the datastore, signal and cancel matchers, the data plane roots and the dashboard prefix).

Reference WEBHOOK_ROUTE_PREFIX rather than repeating the literal. Help text and examples that mention /hooks/ routes are exempt.

Out of scope

Restricting serve.yaml or --webhook routes. Operators may define a webhook on any path (#3692 reverted that restriction).

02Bog Flow
◉OPEN○TRIAGED○IN PROGRESS○SHIPPED

Open

11/10/2026, 5:22:28 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.