Fix direct login route #202

Merged
m merged 1 commits from codex/wp-225-login-route-fix into main 2026-08-23 12:21:45 +00:00
4 changed files with 38 additions and 3 deletions
+1 -1
View File
@@ -150,7 +150,7 @@ func (g *gateway) ServeHTTP(w http.ResponseWriter, r *http.Request) {
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
return
}
if r.URL.Path == "/" || r.URL.Path == "/chat" || r.URL.Path == "/chat.html" {
if r.URL.Path == "/" || r.URL.Path == "/login" || r.URL.Path == "/chat" || r.URL.Path == "/chat.html" {
g.serveEmbeddedHTML(w, "chat.html")
return
}
+12
View File
@@ -354,6 +354,18 @@ func TestConsoleAndSecurityHeaders(t *testing.T) {
}
}
func TestLoginRouteServesChatShell(t *testing.T) {
handler, err := newHandler("http://core-runtime:8080", "http://continuity-runtime:8081", "http://commit-runtime:8082", http.DefaultClient)
if err != nil {
t.Fatal(err)
}
response := httptest.NewRecorder()
handler.ServeHTTP(response, httptest.NewRequest(http.MethodGet, "/login", nil))
if response.Code != http.StatusOK || !strings.Contains(response.Body.String(), "id=\"username\"") || !strings.Contains(response.Body.String(), "id=\"password\"") {
t.Fatalf("login response = %d", response.Code)
}
}
func TestAdvisoryModeRejectsInvalidConfiguration(t *testing.T) {
_, err := newHandlerWithAdvisoryMode("http://core.invalid", "http://continuity.invalid", "http://commit.invalid", http.DefaultClient, "browser-selected")
if err == nil || !strings.Contains(err.Error(), "invalid advisory binding mode") {
+2 -2
View File
@@ -1,5 +1,5 @@
{
"task_file": "dev/tasks/DEV-000224-live-fleet-evidence.json",
"task_id": "DEV-000224",
"task_file": "dev/tasks/DEV-000225-login-route-fix.json",
"task_id": "DEV-000225",
"task_revision": 1
}
+23
View File
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000225",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "e080c34a772caa5d256ab9f4ae0d2568bb8a7fb9",
"risk_tier": "E",
"intent": "Serve the existing chat/login shell at the direct /login route so users can reach authentication without a 404.",
"requirement_ids": ["UI login direct route", "authenticated acceptance entrypoint"],
"allowed_change_scope": {"modules": ["creator-web"], "paths": ["cmd/creator-web/server.go", "cmd/creator-web/server_test.go", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000225-login-route-fix.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "modules/**", "LLM-local/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["existing embedded chat/login shell"], "may_change": ["HTTP route mapping only"]},
"semantic_owner": "creator-web route projection",
"canonical_state": ["none"],
"state_transitions": ["GET /login -> existing chat shell"],
"side_effects_and_privileges": ["none; GET only"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["route remains deterministic and stateless"],
"assumptions": ["authentication behavior remains unchanged and is handled by the existing chat shell"],
"acceptance_scenarios": ["GET /login returns 200", "login inputs are present", "root route remains unchanged", "no credential values are added"],
"required_tests": ["go test", "go vet", "preflight", "check-diff", "check-architecture", "independent", "git diff --check", "CI", "production public health and /login check"],
"terminal_gap_states": ["BLOCKED_BY_SPEC_GAP"]
}