Reviewer: Claude Fable 5.1 (claude-fable-5-1) — review of handoff-start-path at 88e76c6 against origin/main (base e2ec1ab; the diff's "deletions" of implementation/*.md are only the branch predating 23b1ef2 — the real change is handoff/http.go + handoff/start_path_test.go). Review only: nothing edited, committed, merged or deployed.
Verdict: APPROVED
No blockers. The change is minimal, the validation is tight, the freshness argument holds in the store code, and the tests pin the properties rather than the implementation. Notes below are for the record and for the Team-page slice; none needs a change to this branch.
What I checked
Ran it myself (make test-vet test-fmt test-build test-go, then the test-race steps for handoff and connect): all green on darwin — root, handoff, handoff/seal, roster, dashboard, connect, connect/linkstore. internal/provisioner is linux-only; hub CI covered it.
Backward compatibility. Every existing NewConsumer caller builds ConsumerConfig with keyed fields and leaves StartPath unset: home internal/home/directory.go:43, connect connect/bridge.go:72-95 (the copied cfg for the fresh consumer keeps ""), docs internal/docs/home_exchange.go:86-109, slides and calendar (through connect's Bridge). All mount the constant handoff.StartPath. NewConsumer substitutes the constant before validating, and startPath("/auth/start") passes, so behaviour is byte-identical for them. Callback/Finish are untouched. handoff/ on main has not changed since the 481d2d5 pin, so a bump later brings exactly this change and nothing else.
StartPath validation (handoff/http.go:96-106). The combination is sound: /auth/ prefix + path.Clean(s) == s + the closed byte set [a-z0-9/_-] + ≤128 bytes + ≠ CallbackPath, FinishPath. I walked the cases: /auth/ (Clean strips the slash → refused), trailing slash, //, ./.. segments (refused twice: Clean and the byte set), %, ?, #, space, NUL, backslash, uppercase, absolute URL, protocol-relative. Because the only accepted values sit under /auth/, SafePath refuses every one of them as return_to (store.go:135), so no finish can redirect into a start and no return_to can reach one — the SafePath(s) clause in startPath is unreachable today but is the right belt-and-braces: it pins "a start path is never a return target" even if SafePath's exclusion list ever moved. guard still compares r.URL.Path exactly against the configured path (http.go:113), so a request to /auth/fresh/start/ or /auth/fresh 404s, pinned by TestCustomStartPathIsTheOnlyStart. No new query parsing, no new redirect target: Start still redirects only to issuer/authorize and Finish only to the sealed, SafePath-checked path.
Freshness binding — confirmed from store.go. start() prepends freshPathPrefix to the path before sealing it under handoff.path.<secretHash> (store.go:212-218), so the class lives in the pending row and is authenticated by the sealer. Store.Finish derives fresh solely from that sealed value (store.go:353-356), consumes the proof (replay insert + both row deletes + commit), and only then refuses a fresh row whose AuthTime is in the future or older than 300 s against the monotonic fence (store.go:385-388). It takes no consumer, no RequireFreshAuth, no path. Consumer.Finish passes nothing consumer-specific either (http.go:256). So the properties the author claims are real: whichever Finish handles the browser, a fresh row stays fresh, an ordinary row stays ordinary, a stripped max_age on the authorize URL cannot downgrade a fresh row (the row refuses the stale proof and burns it), and the nonce-hash compare (store.go:343) stops a proof minted for one row being paired with another. The new test table pins 10 s / 300 s accepted, 301 s / future refused, through both Finishes, with replay count exactly 1; cross-pairing refused with nothing consumed.
The three uncertain points
1. An ordinary row finished through the fresh consumer completes as ordinary — acceptable. The design never relies on which Finish ran: team-members.md §2 says every Team-page POST checks the directory session's auth_time is within 300 s and not in the future, and team-provisioning-amendment.md §4 step 2 has /operator/confirm do the same on GET and re-check "inside the write". In practice the directory will mount one /auth/finish anyway, so "the fresh consumer's Finish" is nominal — the only authority is the pending row, which is the right place for it. Making Finish refuse a non-fresh row on a RequireFreshAuth consumer would (a) couple Finish to a field it correctly ignores, (b) do nothing the pages must not already do, and (c) be a behaviour change for connect, whose Bridge.Finish dispatches on its own cookies. Keep it as is; the doc comment's last sentence ("code that needs freshness after Finish reads the claims' AuthTime") is the correct contract. The Team-page slice must carry a test that a session minted by /auth/start is refused by a Team-page POST and sent to /auth/fresh/start — that is where the property is enforced.
2. Two consumers on one start path allowed — acceptable, but one factual correction. NewConsumer has no registry and connect legitimately dispatches two consumers at one path, so refusing there is not possible without a store-level registry nobody needs. However the write-up's "chi/ServeMux will catch it" is wrong for chi: in chi v5.3.2 (tree.go setEndpoint) a second r.Get on the same pattern silently replaces the first handler; only Mount() panics (mux.go:294-303). A mis-mount in the directory would therefore not fail at startup. Neither direction is a security downgrade (fresh-over-ordinary makes every sign-in fresh; ordinary-over-fresh makes the Team page's step-up redirect 404, which fails closed because the page checks auth_time itself), but it is a silent usability bug. Requirement on the Team-page slice: mount with r.Get(fresh.StartPath(), fresh.Start), and add a directory-level test that GET /auth/start redirects without max_age and GET /auth/fresh/start redirects with max_age=300. Also note startPath cannot know about other app routes under /auth/ (connect has /auth/local/complete); /auth/fresh/start collides with nothing in home or connect today — I grepped.
3. go.mod pins — what the next slice must do. Root go.mod:10, connect/go.mod:7, roster/go.mod:6 and docs all pin v0.0.0-20260908102137-481d2d57f489; slides and calendar pin …ff16bf56bc4d (same handoff bytes). Only the root module needs the bump for the Team page. After this branch lands on main as commit X, the Team-page slice runs go get amadan.net/oficina/home/handoff@X && go mod tidy in the root and commits the resulting pseudo-version — pin the main commit, not 88e76c6, so the hub serves it regardless of how the branch was merged. That CI run is the first time internal/home compiles against the new handoff on the hub (this branch's CI used the old pin; the go.work check was local only), so treat its green as the real one. The deps target's retry handles the hub's 429 on a cold cache. The branch is based before 23b1ef2 but touches only handoff/, so the merge is clean.
Test quality
Mutation-resistant as claimed: each clause of startPath has at least one case that only it refuses (/auth/Fresh/start → byte set; /auth//fresh/start, trailing slash → Clean; /team/fresh/start → prefix; CallbackPath/FinishPath → equality; 129 bytes → length, with 128 accepted). Reverting the guard to the constant fails TestCustomStartPathIsTheOnlyStart; removing the store's freshness check fails three table rows; removing the nonce compare fails "cross pairing". TestTwoStartPathsOneStoreKeepTheirFreshness uses the real Start → Callback → Finish path with the directory's actual ConsumerID, so it exercises the mount the Team page will use. Existing fresh_test.go and http_test.go are untouched.
AGENTS.md mechanical rules
No log line, error string or metric gains an address or content; the only new error is ErrConfig. No migration, no frontend, no script. Commit carries the Co-Authored-By trailer. Reviewed by the model recorded here, as the Review rule requires.
Non-blocking notes (no change needed)
guard's parameter andStart's local are both namedpathand now shadow thepathimport (http.go:111,:154). Compiles and vets; rename when next touching the file sopath.Cleanstays callable there.startPathaccepts sub-paths of the shared routes (e.g./auth/assertion/x); harmless sinceguardis exact-match and method-gated, but if a stricter rule is ever wanted, refuse theCallbackPath+"/"andFinishPath+"/"prefixes too.- The field comment is long for a field; fine here because this is the one place the "fresh rides the row" contract is stated in code.
Fable 5.1 review: APPROVED, no blockers; three notes for the Team-page slice (chi silently overwrites a duplicate r.Get; pin the main commit; page-level auth_time tests)