Skip to content

Route-auth map: typed registrations, Fastify root hooks, operator-aware hook paths; hand-backs wait for a live commit - #2168

Merged
remigiusz-antczak merged 1 commit into
mainfrom
land/wave-16
Oct 31, 2026
Merged

remigiusz-antczak merged 1 commit into
mainfrom
land/wave-16

Conversation

@remigiusz-antczak

Copy link
Copy Markdown
Collaborator

Summary

Two fixes so Perun's checks report what the code does.

  • Route-auth map (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. A startsWith allow-list entry for /acme-api/health also lets /acme-api/healthz through, so that route stays HIGH. === names one path only against a plain name; against a call such as req.url.slice(0, 15) it reads as a prefix test. tenant_scope_check.py no longer crashes on a trailing backslash in an open string.
  • Hand-back hold (handback_cap.py): waits for a lane's running git commit, not only git push. It matches only real git processes and skips its own parents and read-only reviewer types, so a lane brief that mentions git commit no 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.py 7/7, test-tenant-scope-check.sh 15/15, handback_cap.py --selftest 83/83, test_background_work_guard.py 20/20 (1 host skip), changelog fragments 23/23.
  • run-ci-tests.sh --affected: 13 of 294 tests selected, all passed.
  • Size ratchet, privacy, identity and secret checks clean.

🤖 Generated with Claude Code

…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>
@remigiusz-antczak
remigiusz-antczak merged commit adde6b8 into main Oct 31, 2026
11 checks passed
@remigiusz-antczak
remigiusz-antczak deleted the land/wave-16 branch October 31, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant