[codex] Fix agent check-in PII access - #1995
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (26)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 371d5dfa52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b630a928f5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The agent check-in filter reduced every entry to its (attendee, listing) pair, so an attendee booked twice on the same listing (different dates or package paths) leaked every matching row when only one row's leg was on the agent's run sheet — Codex review on PR #1995. getAgentRunSheetBookings now returns each matched row's full slot identity (attendee + listing + start_at date + parent_listing_id + package_group_id) and the check-in filter compares each entry against that set with the same key, so a sibling row outside the run sheet never appears. The TokenEntry type now carries parentListingId, completing the unique slot identity alongside attendee.id, listing.id, attendee.date, and attendee.package_group_id — the dimensions a listing_attendees row is uniquely indexed on. A new testTokenEntry factory consolidates the parent-listing default so token-entry fixtures in three view test files pick it up once. Drop the dead `equals: true` branch from scripts/args.ts: codex-security was its only caller, and the option is gone. Add a multi-row regression at the unit layer (test/shared/db/logistics.test.ts) and at the HTTP layer (test/ui/templates/checkin/rendering.test.ts) — the HTTP test fails against the old filter (row B's quantity and date leak into the page) and passes with this change.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 561dd1dccc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Drop orphaned codex-security Python (tomli + shell-hook export) from flake.nix; the scanner that needed it was deleted in b630a92. - Split src/shared/db/logistics.ts (459 lines) into logistics.ts (assignment reads/writes, 162 lines) and logistics-run-sheet.ts (run-sheet access and the agent check-in filter's row-identity query, 305 lines). Callers of run-sheet exports (checkin.ts, deliveries.ts, runsheet.test.ts, no-quantity-audit.test.ts) now import from logistics-run-sheet.ts. - Split test/ui/templates/checkin/rendering.test.ts (412 lines) into rendering.test.ts (256 lines) and auth.test.ts (164 lines), extracting the role-authorization tests (delivery-agent cross-booking, multi-row regression, editor cannot decrypt) into their own focused suite. - Remove 'work/security-finding-1-agent-checkin' from TODO.md's active-jobs list — that work shipped on PR #1995. - Strip review-history prose from the multi-row regression tests; keep only the short explanation the fixture needs.
What changed
Delivery-agent sessions now filter
GET /checkin/:tokensentries through the same delivery assignment rules used by the run sheet before attendee details are decrypted.Agents can still view check-in details for bookings assigned to one of their logistics agents for today or tomorrow. They now get a forbidden response when every token is outside that scope. If a mixed token URL contains both allowed and disallowed bookings, only the allowed rows are shown.
The agent check-in view no longer renders staff-only admin links or check-in forms. Owner and manager check-in behavior stays unchanged. Public unauthenticated check-in behavior also stays unchanged.
Why
The check-in GET route treated any signed-in admin session as allowed to decrypt every token in the URL. Delivery agents could therefore open a valid token for an unrelated attendee and read their personal details.
Validation
nix develop -c deno task test:files test/ui/templates/checkin/rendering.test.ts test/shared/db/logistics.test.ts test/ui/templates/attendee-table/columns/table-definition.test.tsnix develop -c deno task precommit