Repository navigation
test(repo-credentials): cover repository-set use checks and retry the held probe - #4246
Conversation
Adds two direct assertions that each fail when one #4098 check is removed: - a selected-repository use request that also names an unselected repository is denied (the use check compares the token's repository set); - the selected-repository sender cannot read an installation-wide family's material (the material read compares the grant profile with the scope). The repository-set journey now retries the held hook probe with one more reconciliation pass per read, bounded by waitFor's deadline, as production enrollment retries on the worker's next pass.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. What this changesThis PR adds repository-set denial assertions and retries the journey’s held hook probe after further reconciliation. Example: A token covers repositories 73 and 74, but a use request also names repository 75.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this PR adds useful credential-boundary coverage, with one test timeout mismatch to repair. Priority: P3 Before merge
Findings
Agent review detailsHow this fits togetherOCC records repository sessions and credential custody in PostgreSQL; the credential owner checks requested scope before returning material or authorizing an OpenShell request. flowchart LR
Selection[Agent repository selection] --> Sessions[OCC repository sessions]
Sessions --> Credentials[Prepared credential owner]
Credentials --> Sender[OpenShell sender]
Sender --> Check[Current scope check]
Check --> Provider[GitHub operations]
Technical reviewBest possible solution: Keep the focused assertions and give the journey’s worker-result wait enough time for the probe and reconciliation budgets. Do we have a high-confidence way to reproduce the issue? Source inspection establishes the nested 20-second probe and 10-second worker-result deadlines; no target code was executed during this read-only review. Is this the best way to solve the issue? Extending existing PostgreSQL cases and retrying through the existing runtime loop is appropriately scoped, but the enclosing deadline must accommodate the new wait. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b08f9006869a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 30, 2026, 4:52 PM ET / 20:52 UTC. |
Problem
Follow-up to #4098. Two of its repository-set checks had no test that fails when the check is removed, and its end-to-end repository-set journey test was flaky:
recordUsecompares the request's repository set with the token's grant. Removing that comparison left every test green.readRecipientMaterialrefuses a family whose grant profile differs from the requested scope. Removing that refusal left every test green.{"pending":"unverified"} ... undefined !== 'held').Change
Test-only. No product code changes.
postgres-protected-git-recipient-custody.test.ts, repository-set retirement cases: after the A+B request is allowed, the same request that also names an unselected repository C is denied.{ absent: "unprepared" }).postgres-repository-set-journey.ts: the held hook probe now runs inwaitFor(20 s). Before each later read it runs one more reconciliation pass, as production enrollment retries on the worker's next pass. The last read happens at the deadline, there are no fixed sleeps, and a blocked route still fails at once.Both new assertions use the fixtures that #4098 added. No new fixture copies.
Verification
recordUsemakes the five repository-set retirement cases fail at the new assertion ('allow' !== 'denied'). Removing the profile/scope refusal inreadRecipientMaterialmakes the scope-change case fail at the new assertion (the installation material is returned). Both new assertions pass on this head.postgres-protected-git-recipient-custody.test.tspasses 50/50 (all 8 tests).postgres-openshell-standing-git-transfer.test.tspasses 50/50 (both tests, including the repository-set journey).92b435c47c: 22/22 jobs pass, including First Agent Smoke.pnpm run typecheckpasses.Risks
Low. The changes are test-only. The journey retry can add up to 20 s (plus one reconciliation pass) to a failing run, which stays inside the test's 90 s timeout.