Repository navigation
Route-auth map: typed registrations, Fastify root hooks, operator-aware hook paths; hand-backs wait for a live commit - #2168
Merged
Conversation
…re hook paths; hand-backs wait for a live commit route_auth_map.py reads TypeScript type-argument route registrations, counts a Fastify root onRequest/preHandler hook that can refuse with 401 or 403 as auth=root-hook evidence, and reads what the hook covers from its if statements up to the first refusal. Hook path literals are read by their operator: a startsWith allow-list entry lets through every route whose raw path starts with it (so /acme-api/healthz next to /acme-api/health stays HIGH), === names one path only when the other operand is a plain name or member chain (against req.url.slice(0, 15) or path.dirname(req.url) it reads as a prefix test, so the deeper routes it can let through stay HIGH), and a startsWith scope covers the routes under it by path segment. The changelog names the remaining known limit for includes/endsWith entries. tenant_scope_check.py's masker no longer raises IndexError on a trailing backslash inside an open string. handback_cap.py holds a lane's hand-back while a git commit from its worktree is still running, not only a git push. The match is anchored on a process whose argv[0] is git (alone or behind env or a perl alarm wrapper), so a lane brief, shell string or grep that only names git commit holds nothing; the check skips the hook's own ancestors and descendants; read-only agent types are never held; and the hold text no longer claims the lane owns the running process. Tests: test_route_auth_map 7/7; test-tenant-scope-check 15/15; handback_cap --selftest 83/83; test_background_work_guard 20/20 (1 skipped on this host); test-changelog-fragments 23/23; run-ci-tests --affected selected 13 of 294 registered tests, all passed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <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.
Summary
Two fixes so Perun's checks report what the code does.
route_auth_map.py): reads TypeScript typed route registrations, counts a Fastify root hook that can refuse with 401/403 as auth evidence, and reads each hook path test by its operator. AstartsWithallow-list entry for/acme-api/healthalso lets/acme-api/healthzthrough, so that route stays HIGH.===names one path only against a plain name; against a call such asreq.url.slice(0, 15)it reads as a prefix test.tenant_scope_check.pyno longer crashes on a trailing backslash in an open string.handback_cap.py): waits for a lane's runninggit commit, not onlygit push. It matches only realgitprocesses and skips its own parents and read-only reviewer types, so a lane brief that mentionsgit commitno longer holds hand-backs for 30 minutes.An independent review found no blocker; its three fix-first items are fixed here, the rest queued.
Verification
Run on this head:
test_route_auth_map.py7/7,test-tenant-scope-check.sh15/15,handback_cap.py --selftest83/83,test_background_work_guard.py20/20 (1 host skip), changelog fragments 23/23.run-ci-tests.sh --affected: 13 of 294 tests selected, all passed.🤖 Generated with Claude Code