Wave 6: manner-matrix CI guard (auth×tier×flag×error)#267
Merged
Conversation
Extends the route done-bar guard into a MANNER-matrix guard so "every user/API
interaction, in every manner" is a structural CI guarantee that can't silently
regress (CEO core fear). The route guard asserts every (method,path) has *a*
covering test; this asserts every applicable (auth×tier×flag×error) CELL of a
route is mapped to a named test or a justified exemption.
Design ref: docs/ci/01-CI-INTEGRATION-DESIGN.md §"Every scenario CI must cover"
+ the manner matrix in docs/ci/00-INTERACTION-PATHS.md Part B2. Mirrors the
existing route_donebar_guard_test.go pattern (same package, same live router,
same AST map-rot integrity check) — not a divergent style.
Manner dimensions (each applied only to the routes where it's relevant, derived
from the LIVE route tree + small reverse-drift-checked policy sets, so a new
route/tier/flag auto-expands the required cells — rule 18):
- auth-negative-401 (every authenticated route)
- tier-gate-402 (provisioning / deploy / stack / pause-resume / twin /
domains / vault / make-permanent / ttl / github)
- flag-off-and-on (DEPLOY_SCALE_TO_ZERO_ENABLED wake; RESOURCE_COUNT_CAPS
_ENABLED count-cap) — BOTH arms required + verified
- anon-gate-402-429 (anon-capable /new family: recycle 402 + cross-svc 429)
- backend-failure-503 (provisioning/deploy backend faults + teardown)
- idempotency-replay (+idem routes; proven once at the middleware layer)
The tier axis iterates plans.Default().All() (registry, not a hand-typed list);
TestMannerMatrix_TierDimensionIteratesRegistry binds "tiers in the registry" to
"routes that enforce them". TestMannerMatrix_MapPointsAtRealTests AST-parses
handlers/middleware/e2e and asserts every referenced test (incl. each comma-
separated flag arm) actually exists, closing the map-rot loophole.
Honest gap ledger (TestMannerMatrix_ReportExemptionBacklog) — 4 live-required
cells exempt-with-TODO, the real remaining backlog:
- backend-failure-503 | POST /deploy/new (needs live k8s Kaniko; W4)
- backend-failure-503 | POST /stacks/new (needs live k8s; W4)
- tier-gate-402 | POST /storage/new (per-tier real-backend 402; W3)
- auth-negative-401 | GET /integrations/github/callback (GitHub OAuth; W6)
Guard proven to RED on a missing cell: adding a new tier-gated route OR removing
a map row fails TestMannerMatrix_EveryApplicableCellCovered with an actionable
message naming the exact (route, dimension). Hermetic, -short-safe, no DB/net.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends the registry-iterating route done-bar guard (
route_donebar_guard_test.go) into a manner-matrix guard (internal/router/manner_matrix_guard_test.go). The route guard asserts every(method,path)has a covering test; this asserts every applicable (auth × tier × flag × error) CELL of a route is mapped to a named test or a justified exemption — making "every interaction in every manner" a structural CI guarantee that can't silently regress.Design ref:
docs/ci/01-CI-INTEGRATION-DESIGN.md§"Every scenario CI must cover" + the manner matrix indocs/ci/00-INTERACTION-PATHS.mdPart B2. Mirrors the route guard's pattern (same package, same live router, same AST map-rot integrity check).Manner dimensions (registry-iterating, rule 18)
Each dimension applies only to the routes where it's relevant, derived from the LIVE route tree + small reverse-drift-checked policy sets — so a new route / tier / flag auto-expands the required cells:
auth-negative-401tier-gate-402flag-off-and-onDEPLOY_SCALE_TO_ZERO_ENABLED), count-cap (RESOURCE_COUNT_CAPS_ENABLED)anon-gate-402-429/newfamilybackend-failure-503idempotency-replay+idemroutesThe tier axis iterates
plans.Default().All()(the registry, not a hand-typed list).TestMannerMatrix_TierDimensionIteratesRegistrybinds "tiers in the registry" to "routes that enforce them".TestMannerMatrix_MapPointsAtRealTestsAST-parseshandlers/middleware/e2eand asserts every referenced test (incl. each comma-separated flag arm) exists — closing the map-rot loophole.Honest gap ledger (the real next backlog)
TestMannerMatrix_ReportExemptionBacklogprints the 4 live-required cells that are exempt-with-TODO (not fabricated coverage):backend-failure-503 | POST /deploy/new— needs live k8s Kaniko backend (W4)backend-failure-503 | POST /stacks/new— needs live k8s backend (W4)tier-gate-402 | POST /storage/new— per-tier real-backend 402 wall (W3)auth-negative-401 | GET /integrations/github/callback— real GitHub OAuth (W6)Proof the guard reds on a missing cell
GET /api/v1/team→tierGatedRoutes) →TestMannerMatrix_EveryApplicableCellCovered/tier-gate-402|GET_/api/v1/teamFAILS: "cell ... has NO mapped manner test and NO exemption. Add a covering test + a mannerCoverageMap row, OR ... an exemption with a reason + a TODO wave pointer."(route, dimension).Verify
-short-safe, never flakes.go build ./...+go vetclean;internal/routerpackage green (both guards coexist).make gatered locally is a pre-existinginternal/models/deployment_ttl_test.goNULL-app_idscan drift on the local test DB — reproduces on cleanmasterwithout this file; CI provides a freshly-migrated DB. This PR touchesinternal/routeronly.Test-only change; no runtime/contract change.
🤖 Generated with Claude Code