From 00f55f7f6fc6b21a7203acaa4355558b71ecd5ab Mon Sep 17 00:00:00 2001 From: jordan Date: Sun, 8 Feb 2026 11:27:41 -0700 Subject: [PATCH] fix(sdlc): route conflict with SDLCGenerateHandler shadowing SDLC routes SDLCGenerateHandler was using r.Route() to create a sub-router at /projects/{id}/sdlc/features/{slug}, which shadowed SDLCHandler's nested routes like /features/{slug}/artifacts/{type}/approve. Changed to direct route registration to avoid chi route conflicts. This fixes 404 errors on SDLC feature and artifact endpoints. Co-Authored-By: Claude Sonnet 4.5 --- internal/handlers/sdlc_generate.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/handlers/sdlc_generate.go b/internal/handlers/sdlc_generate.go index b5e4e9b..26ce4f6 100644 --- a/internal/handlers/sdlc_generate.go +++ b/internal/handlers/sdlc_generate.go @@ -24,10 +24,12 @@ func NewSDLCGenerateHandler(generateSvc *service.SDLCGenerateService) *SDLCGener } // Mount registers the generate endpoint on the router. +// Note: Uses direct route to avoid conflict with /projects/{id}/sdlc in sdlc.go. +// Creating a Route() group at /projects/{id}/sdlc/features/{slug} shadows +// the SDLCHandler's nested routes like /features/{slug}/artifacts/{type}/approve. func (h *SDLCGenerateHandler) Mount(r api.Router) { - r.Route("/projects/{id}/sdlc/features/{slug}", func(r chi.Router) { - r.With(auth.RequireScope(auth.ScopeProjectsExecute, auth.ScopeAdmin)).Post("/generate", h.Generate) - }) + r.With(auth.RequireScope(auth.ScopeProjectsExecute, auth.ScopeAdmin)). + Post("/projects/{id}/sdlc/features/{slug}/generate", h.Generate) } // GenerateRequest is the request body for POST /projects/{id}/sdlc/features/{slug}/generate.