Persiste proposal, specs delta (auth, api-client, access-requests, platform-shell, testing), design con 8 ADRs, tasks (27 items en 10 fases), verify-report (28 tests, 0 críticos, 0 warnings tras el cierre) y archive-report final. Cierra el ciclo SDD del cleanup de deuda técnica del console.
6.3 KiB
Verify Report: console-tech-debt-cleanup
Change: console-tech-debt-cleanup Mode: Strict TDD Date: 2026-05-07 (PR1) / 2026-05-08 (PR2)
PR1 — Phases 0-5 (P0 band)
Originally verified on 2026-05-07. Full details in engram #160.
All 16 PR1 tasks complete. 12/12 tests passed. Lint + TypeScript exit 0. No CRITICAL issues. One WARNING (--passWithNoTests flag, see PR2 section). Three SUGGESTIONS (no typecheck script, setTimeout proxy in warm-visit test, unused refreshToken state).
Verdict: PASS WITH WARNINGS
PR2 — Phases 6-9 (P1+P2 band)
Scope: Phases 6-9 + regression check of PR1 files. Date: 2026-05-08
Completeness
| Metric | Value |
|---|---|
| PR2 tasks total | 8 |
| PR2 tasks complete | 8 |
| PR2 tasks incomplete | 0 |
Build & Tests
Tests: 23/23 passed, 0 failed, 0 skipped
- auth-api.test.ts (3) PASS
- auth-store.test.ts (2) PASS
- client.test.ts (5) PASS
- ErrorBoundary.test.tsx (3) PASS
- ProtectedRoute.test.tsx (2) PASS
- AccessRequestsPage.test.tsx (8) PASS
Lint: pnpm lint exits 0, zero warnings. TypeScript: pnpm exec tsc --noEmit exits 0, zero type errors.
PR1 Regression Check
All PR1 files (auth-store.ts, auth-api.ts, client.ts, ProtectedRoute.tsx, vite.config.ts) unchanged. All 12 PR1 tests still pass.
Spec Compliance Matrix — P1+P2
Phase 6 — AccessRequestsPage Error UI (ADR-006)
| Requirement | Scenario | Test | Result |
|---|---|---|---|
| Failed Query Surfaces Error | requestsQuery.isError -> error card, no table | 6.1a | COMPLIANT |
| Failed Query Surfaces Error | Reintentar button present | 6.1a | PARTIAL — rendered but refetch() not click-asserted |
| Stat Cards Fail Soft | allRequestsQuery.isError -> 0 counts, no crash | 6.1b | COMPLIANT |
Phase 7 — Mutation Behavior (ADR-008)
| Requirement | Scenario | Test | Result |
|---|---|---|---|
| Mutation Success | approve success -> toast.success | 7.1a | COMPLIANT |
| Mutation Success | reject success -> toast.success | (none) | UNTESTED |
| Mutation Success | review success -> toast.success | (none) | UNTESTED |
| Mutation Error | approve error -> toast.error | 7.1b | COMPLIANT |
| Mutation Error | reject/review error paths | (none) | UNTESTED |
Compliance: 2/5 scenarios (3 UNTESTED)
Phase 8 — isActionable Consolidation (ADR-008)
| Requirement | Scenario | Test | Result |
|---|---|---|---|
| No inline includes(...) | grep audit | static audit | COMPLIANT |
| isActionable | pending -> approve+reject enabled | 8.1 | COMPLIANT |
| isActionable | in_review -> approve+reject enabled | 8.1 | COMPLIANT |
| isActionable | approved -> approve+reject disabled | 8.1 | COMPLIANT |
| isActionable | rejected -> approve+reject disabled | 8.1 | COMPLIANT |
Phase 9 — ErrorBoundary (ADR-005)
| Requirement | Scenario | Test | Result |
|---|---|---|---|
| ErrorBoundary.tsx exists as class component | getDerivedStateFromError implemented | code + 9.3a | COMPLIANT |
| PlatformLayout wraps Outlet | ErrorBoundary around Outlet only | code inspection | COMPLIANT |
| Child throws -> fallback renders | no child content visible | 9.3a | COMPLIANT |
| Fallback has logout button | button present | 9.3b | COMPLIANT |
| No throw -> child renders normally | child content present | 9.3c | COMPLIANT |
| Login NOT wrapped | /login route has no ErrorBoundary | router/index.tsx | COMPLIANT |
| Sidebar and Toaster outside boundary | layout structure confirmed | code inspection | COMPLIANT |
Issues Found (PR2)
CRITICAL: None
WARNING:
-
W1 (promoted from PR1): package.json test script contains --passWithNoTests. With 23 tests present this flag no longer serves its bootstrap purpose. Remove before final merge — it masks zero-test CI scenarios from misconfigured imports or bad globs.
-
W2 — Phase 7 mutation gap: Spec explicitly requires reject success, review success, and corresponding error paths as testable scenarios. Only approve success and approve error are covered. The three mutation handlers share identical onSuccess/onError structure and are implemented correctly in source, but the spec requires behavioral evidence for all three. Classification: WARNING (not CRITICAL) — handlers provably correct, approve test proves the pattern, but contract evidence is incomplete.
-
W3 — Reintentar click not asserted: Test 6.1a confirms button presence but does not click it and verify requestsQuery.refetch() was called. Presence evidence only.
SUGGESTION:
- S1: Add typecheck script to package.json so tsc --noEmit runs in CI.
- S2: ProtectedRoute warm-visit test uses setTimeout proxy; does not exercise Zustand onFinishHydration callback directly.
- S3: refreshToken field in auth-store never populated (always null); leftover from pre-HttpOnly-cookie design.
- S4: @testing-library/jest-dom not installed; btn.disabled used instead of toBeDisabled(). Functionally correct, idiomatic deviation.
- S5: expect.anything() for TQ v5 mutation context arg; could be tightened with typed matcher.
- S6: Revisar button uses request.status !== 'pending' directly rather than isActionable() — deliberate design choice (review only valid from pending) but untested.
R2 Root Cause Finding — Explicit cleanup() is Correct
RTL auto-cleanup only self-registers when Vitest runs with globals: true. Both frontend-console and frontend-admin omit globals: true in their Vitest configs. Neither project setup.ts calls cleanup(). Therefore, explicit afterEach(cleanup) in test files is the correct and necessary pattern for this project configuration. This is not a deviation — it is the right implementation. No changes needed to setup.ts or vite.config.ts unless globals: true is added.
Cross-cutting Checks
| Check | Result |
|---|---|
| null as T in src/ | 0 matches — PASS |
| bracket-string store reads | 0 matches — PASS |
| Inline includes pending/in_review | 0 matches — PASS |
| Login page NOT wrapped in ErrorBoundary | Confirmed — PASS |
| PR1 test suite intact | 12/12 pass — PASS |
Verdict (PR2)
PASS WITH WARNINGS
23/23 tests pass. Lint and TypeScript exit 0. PR1 files not regressed. Phases 6, 8, and 9 are fully compliant. Phase 7 has 3 untested mutation scenarios — WARNING, not CRITICAL. Ready for sdd-archive.