Summary
Route registration currently appends routes in order and dispatches by first match. That is simple and useful, but H-awk should warn about duplicate routes and likely shadowing once the framework grows route files/grouping/plugins.
Evidence
core/router.awk stores each route in ROUTES[method, path, ...] and appends registration order to ROUTES_ORDER.
- Dispatch scans
ROUTES_ORDER sequentially and runs the first matching route with the same method.
- Dynamic segments such as
/:id can shadow more specific routes registered later.
Proposed feature
- Detect exact duplicate
method + path registrations.
- Warn when a dynamic route probably shadows a later static route.
- Optionally expose
hawk check diagnostics for route tables.
- Add a debug command to print route order and compiled regex patterns.
Acceptance criteria
- Duplicate route registration is detected.
- Common shadowing cases are reported with file/line info if available.
- Users can intentionally suppress/allow a duplicate route when needed.
- Tests cover exact duplicate, static-before-dynamic, and dynamic-before-static order.
Priority: P2
Area: router/diagnostics
Type: feature
Summary
Route registration currently appends routes in order and dispatches by first match. That is simple and useful, but H-awk should warn about duplicate routes and likely shadowing once the framework grows route files/grouping/plugins.
Evidence
core/router.awkstores each route inROUTES[method, path, ...]and appends registration order toROUTES_ORDER.ROUTES_ORDERsequentially and runs the first matching route with the same method./:idcan shadow more specific routes registered later.Proposed feature
method + pathregistrations.hawk checkdiagnostics for route tables.Acceptance criteria
Priority: P2
Area: router/diagnostics
Type: feature