Repository navigation
feat(events): a Registrations tab for the event's own manager - #1073
Conversation
Registration rows are admin-only, so the `registrations` join renders empty for every manager and a program manager's only view of their own signups was the digest email. This adds a document view on `events` at `/registrations` that the event's named manager, and an admin, can open. A collection edit view sits behind `Root`'s own `canAccessAdmin` redirect — `isCustomAdminView` reads the root `views` map alone — so the view's own gate is the narrower one: admin, or `event.manager === user.id`. A region manager holds `update` on the row through its subtree and is still refused, which is why the gate cannot read the collection's own access config. `answersFrom` moves to the collection that owns `submissionData`, beside `readSubmissionValue`: it had two consumers in two different job folders already, and this is a third outside `src/jobs/` entirely. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXeWziyUPFizPTu17e
`answersFrom` handed `buildRegistrationAnswers` every `submissionData` pair, and that function labels an unconfigured key by the key itself — so the manager notification and the daily digest both rendered `userAgent: Mozilla/5.0 …`, `locale`, `path` and the registrant's own `name` as things the visitor had been asked. `BASE_SUBMISSION_KEYS` is already the list of what a client writes about itself, so the fix drops those and nothing else; the mailing-list opt-in and any legacy question key still come through. `formatDate` defaulted its timezone, which covers `undefined` and not `null` — and both columns a caller reads it from (`startingAt_tz`, `schedule.firstDate_tz`) are generated as non-nullable and left null by Postgres. An event with no schedule timezone therefore threw `RangeError: Invalid time zone specified: null` out of `Intl`, mid-send, inside the digest job. The two parameter types that were lying about it say `| null` now. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXeWziyUPFizPTu17e
One case per acceptance criterion, driving the view's loader directly: the event's own manager, a region manager who holds `update` on the same row and is still refused, a stranger, an admin, and a document id that resolves to no event. Nested in the atlas-manager suite so it shares the one test environment that file may create, and declared last so its fixtures cannot reach the dashboard cases above. The registrant's name is asserted against a renamed `users` row, so the case fails if the page ever reads the join instead of the submission's own pair. `admin.condition` on the `registrations` join spells its sibling parameter `_siblingData`: it reads none, and `admin-condition-fields.spec.ts` refuses a condition that takes `siblingData` without reading one. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXeWziyUPFizPTu17e
The earlier commit on this branch excluded `BASE_SUBMISSION_KEYS` by hand, and that is an exclusion list where the question is an inclusion one: `subscribe` is a declared registration key too, so the manager email, the digest and the new table still rendered an answer row labelled `subscribe` → "Yes". Deriving the set from `BASE_SUBMISSION_KEYS` plus `TYPE_SUBMISSION_KEYS.registration`, less the configured question names, excludes a reserved key the day it is declared rather than the day someone remembers the list. What survives is a configured question or a legacy key the Atlas dump carried, which is the only thing `buildRegistrationAnswers`' extras branch is for. `registrationAnswers` replaces the `buildRegistrationAnswers(answersFrom(x))` pairing at all three call sites, so no caller re-derives which map feeds the labeller — the one thing that could reopen this. It also drops the `string | null` timezone widening. `formatDate`'s default is right, and the repo already resolves this at the call site in nine places, `eventDetails.ts` itself among them — so the three callers that could produce a null now spell `|| 'UTC'` like every other, and the module stops being the one that accepts a zone no other accepts. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXeWziyUPFizPTu17e
The `/simplify` pass found the asymmetry: this branch lifted the URL writer (`useSetQuery`) out of the manager dashboard and then duplicated the reader beside it, along with the tab-button row and its accessibility contract. `firstParam` / `pageParam` replace three copies of "Next hands a repeated key over as an array, take the first" — the dashboard's, the sign-in view's and this branch's. `FilterTabs` owns the convention that a selected tab is `subtle` rather than `tab` and carries `aria-pressed` plus an `aria-controls` naming the region it filters, which had two definitions a fix to either would have drifted. In the new view: the payload carries the filter alone, since the table pages off `PaginatedDocs` and never read the query's page; the two tables keyed by the same union became one; and the page size is a local in the loader that consumes it. The join's condition stops forwarding two arguments `adminOnlyCondition` ignores, and says what it does and does not do — it hides the field, and the subquery still runs. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXeWziyUPFizPTu17e
`admin-ui.md` said an event's registrations are read through its join, which `user-submissions` being restricted has never made true for a manager. It now says which half each surface owns, and carries the opposite of the #1030 rule: a `path` under a collection's `views.edit` is not what `isCustomAdminView` reads, so `Root` does gate it — what such a view owes is whatever is narrower than admin access, plus the two routes that reach it with no document. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXeWziyUPFizPTu17e
…cline Three findings from the review pass, all in the new tab: An archived class is a trashed row, and Payload hides one from every read that does not ask for it — so the gate read its own manager's event as absent and answered the unauthorized redirect. `trash: true`, and an integration case that fails without it. `failed` is in `INACTIVE_STATUSES` because the confirmation never sent, not because anyone withdrew. The filter's copy said the rows there were declined or refused, which for that status tells a manager the opposite of what happened. The empty notice now turns on `totalDocs` rather than this page's rows: a page past the end has none, so it claimed the event had no registrants at all and hid the pager that gets you back. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXeWziyUPFizPTu17e
|
🚅 Deployed to the SahajCloud-pr-1073 environment in sahajcloud
1 service not affected by this PR
|
sydevs-bot
left a comment
There was a problem hiding this comment.
1 question for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The shape matches the ticket: the gate is the loader, the tab is a document view, and the ticket's reuse targets are reused rather than rebuilt.
The joined work earns its place. Deriving NON_ANSWER_KEYS from the two key declarations beats the hand-listed exclusion it replaces, and the leak it fixes is in the path the ticket said to reuse.
Two of the three new helpers do not. searchParams.ts re-solves what req.searchParams already answers, and the pager — the one piece both views still duplicate — stayed outside the folder this diff built for exactly that. Neither holds the PR.
Findings
- should-fix —
helpers/searchParams.ts:12: duplicatesreq.searchParams.get(), which Payload hands all three callers. - should-fix —
EventRegistrationsView.tsx:39: the Withdrawn legend renders only when the filter is empty, so aFailedrow reaches a manager unexplained. - consider —
EventRegistrationsView.tsx:120: the pager is duplicated verbatim between the two views this diff just gave a shared owner.
What was checked
- #1069's four criteria against
atlas-manager.int.spec.ts: one case each, plus the archived event anddocID: 'create'. - Read whole on the branch: the four
EventRegistrations/modules, the fourhelpers/,active.ts,questions.ts,submissionData.ts,AtlasManagerView.tsx. - Ladder:
req.searchParamsis the one named answer;FilterTabsanduseSetQueryhave two consumers each. NON_ANSWER_KEYSresolves to name, locale, path, hostUrl, userAgent, error, subscribe — no question name collides.INACTIVE_STATUSESis rejected, spam, failed, and the twoWheres partition it.- No
contractSyncsource is touched. Preview answers 200, but with noPREVIEW_ADMIN_EMAILthe tab was not opened.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
The review asked whether `helpers/searchParams.ts` duplicates
`req.searchParams.get()`, which Payload hands all three callers. It does
not: `Root` builds the request URL from this same `searchParams` object
with `qs.stringify`, and that writes a repeated key as `page[0]=2&page[1]=9`
— so `req.searchParams.get('page')` answers null precisely where
`firstParam` takes the first value.
Record the constraint at the module, so the next reader does not re-derive
it from @payloadcms/next.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVDVHWCcHkdUvg6iLh
The sentence naming all three reasons a registration is withdrawn lived in `CenteredNotice`, which renders only when nothing matches the filter — so a manager read it exactly when there was nothing to explain, and a `Failed` row, whose confirmation never sent, reached them unexplained. It now sits above the list for both filters, inside the live region so a filter switch announces it. The empty notice keeps its icon and title. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVDVHWCcHkdUvg6iLh
The pager was `AtlasManagerView` verbatim in `EventRegistrationsView` — the same seven props, the same `?? undefined` mapping, and a `.pageControls` rule in each CSS module — while the diff that built `admin/helpers/` moved the filter row and the query readers into it and left this behind. `PageControls` takes the `PaginatedDocs` and a page callback, with `PerPage` as an optional slot, and owns both rules a caller was restating: the nullable-neighbour mapping `Pagination` refuses, and offering a page size only once the list outgrows the smallest one. `Pagination` already renders nothing on a single page, so the dashboard's unconditional wrapper and the Registrations view's `totalPages > 1` were two spellings of one rule; the component returns null instead, which keeps an empty row out of its parent's gap. The dashboard's pager gains `margin-top` from the shared rule. Nothing in `@payloadcms/ui` spaces a `.paginator`, so it sat flush against the table. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVDVHWCcHkdUvg6iLh
|
Three critic threads settled, and Adopted
Rebutted
Open
Gate: ✓ lint, format, typecheck ×2, 3004 unit tests, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
#630 made `senderEmail` a `virtual: 'user.email'` field on main while this branch was open. The loader's two comments still claimed the opposite — that the column is authoritative and the `users` join is the derived copy `prepareUserSubmission` seeds — which would invite the next reader to drop the relationship the value now resolves through. The query itself is already right: `depth: 0` with `senderEmail` in the `select` is the shape both notification jobs use on main, where Payload resolves the relationship-path virtual in the query. Only the prose was inverted, so this is comment-only. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjXhiETAYtCznnsP6oT
|
Merged One semantic drift the merge could not see: #630 made Gate green on the merged tree: lint, format, both typechecks, 236 unit files / 3058 tests. Integration: 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
…ab' into claude/feat-1069-registrations-tab # Conflicts: # src/app/(payload)/admin/importMap.js # src/components/admin/EventRegistrations/data.ts
|
Your answer is built already — your own two commits are it. Nothing to push. Answered
Verified on
Written
🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Six conflicts, three kinds. Four were the same measurement — the unit-lane file and test counts in AGENTS.md, tests/AGENTS.md, tests/PERF.md and docs/rules/testing-reqs.md. Both sides had re-counted, so neither number is right on the merged tree: re-measured here as 239 files / 3079 tests, which perf-figures-pinned now confirms. testing-reqs.md takes main's shape, which moved the counts off the dated measurement sentence onto the "Locally" bullet. Events.ts was an import list, and both imports are used. One unconflicted line of main's needed a word with it: its comment said no manager role reads `user-submissions`, which this branch makes false — a derived role reads `contact` and `proposal` rows, never a `registration` row, so the join that comment explains still renders empty for every manager. atlas-manager.int.spec.ts needed both sides. main's `env` hoist and its whole Registrations-tab block are kept; the fixtures are this branch's. `stranger` held `atlas-manager`, which no longer exists, so it is now a manager listed on a region of its own — the same Atlas authority, still not reaching the tab event's region, which is what those refusals are about. `admin` and the inactive manager go through testData.authUser for the same reason. Nothing semantic: #1073's code names no Atlas role. Gate: lean gate green (239 files / 3079 tests, 140 s). atlas-manager and role-based-access integration specs: 109 tests passed. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYG97mnkGLAnzjV8dk
Six conflicts, three kinds. Four were the same measurement — the unit-lane file and test counts in AGENTS.md, tests/AGENTS.md, tests/PERF.md and docs/rules/testing-reqs.md. Both sides had re-counted, so neither number is right on the merged tree: re-measured here as 239 files / 3079 tests, which perf-figures-pinned now confirms. testing-reqs.md takes main's shape, which moved the counts off the dated measurement sentence onto the "Locally" bullet. Events.ts was an import list, and both imports are used. One unconflicted line of main's needed a word with it: its comment said no manager role reads `user-submissions`, which this branch makes false — a derived role reads `contact` and `proposal` rows, never a `registration` row, so the join that comment explains still renders empty for every manager. atlas-manager.int.spec.ts needed both sides. main's `env` hoist and its whole Registrations-tab block are kept; the fixtures are this branch's. `stranger` held `atlas-manager`, which no longer exists, so it is now a manager listed on a region of its own — the same Atlas authority, still not reaching the tab event's region, which is what those refusals are about. `admin` and the inactive manager go through testData.authUser for the same reason. Nothing semantic: #1073's code names no Atlas role. Gate: lean gate green (239 files / 3079 tests, 140 s). atlas-manager and role-based-access integration specs: 109 tests passed. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYG97mnkGLAnzjV8dk
Reverts the restore. An Atlas manager reads their event's registrants on the Registrations view (#1073), and a contact's sender address arrives in its delivery mail; both read with `overrideAccess`, so neither needs the Registrants collection. The cost is deliberate and now pinned: a manager's read of a submission carries no `senderEmail`, since that is `virtual: 'user.email'` (#1060). Main's contact-scope cases identify rows by form instead, and the Registrant-block case asserts the manager can read no Registrant at all. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* feat(lib): decide how a session reaches a gated PR preview `workflow/lib/preview-auth.mjs` turns a repo's own `previewUrl` block and a PR number into the host, the sign-in request to send, the Access headers to attach by env-var name, and one verdict both `finalize-pr` and `review-pr` read: whether this repo seeds previews at all. It decides and never fetches, like `railway.mjs` beside it — a routine cannot reach an API from a script, so the session sends the request and this file holds no credential. Each token variable is reported only as set or unset, and the headers are shell references, so a plan can be logged. The two token env-var names go in `loop-config.json` as `previewAccess`, beside `railway.tokenEnvVar`: a name typed into a skill is a tuning change nobody can review on its own. `ceilings` is untouched. The route and the account are the producing repo's, carried in its `.auth` block, so nothing here knows either and nothing here goes stale when they change. The test fixture deliberately uses a `.invalid` host for the same reason: a copy of another repo's config value is a second definition, in a fixture as much as in a skill. The failure this prevents: `review-pr` reads no repo config today, so without one answer in one place each skill would re-derive "does this repo seed previews" on every dispatch — 25 to 40 times a day — and the two are then free to disagree. Refs #241 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjX5KDEbK7EeiEzbPvZ * feat(finalize-pr): give previewUrl.auth a meaning Step 7's *Every link opens on data* now asks the helper first, and signs in with what it answers where a repo declares `previewUrl.auth`. The configuration table gains the key beside `.pattern` and `.seed`. The example Preview block stops naming a real host. The pair it used names SahajCloud's Railway address, which sydevs/SahajCloud#1081 shuts — so the example would have told the next reader to write a link that 403s, and a host spelled in this skill is a copy of a config value either way. The failure this prevents: a run that holds a preview-only Access token still had nowhere to read the route, the account or the header names from, so it would have written `Data: not seeded yet` beside a preview it could have filled. ⚠ No step assumes `previewUrl.seed` is set. SahajCloud's copy carries only `.pattern` today, and the same hand-edit that adds `.auth` adds `.seed`; the `Cannot seed` case still covers an unset one. Refs #241 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjX5KDEbK7EeiEzbPvZ * fix(review-pr): a red seed check outranks a line in the body Two places let a change admit it has no data and pass anyway. Where a repo's own CI goes red on a preview that exists and could not be filled, the red check is the gate and a sentence cannot stand in for it. ⚠ **Conditional, never a removal.** That text is correct for the other four repos, which have no seeding check and no gate — there the line is still the only honest thing to write. Each edit decides from the helper's verdict, so neither skill names a number, a label or a repo. `rule-delta.mjs` reports no dropped rule. The failure this prevents is the one the written rule has already accepted twice: sydevs/SahajCloud#1073 shipped its Registrations page with `Data: not seeded` and a console snippet to paste, and sydevs/SahajCloud#874 linked three pages nobody saw anything on — filling that one by hand afterwards found three defects in a minute. The story goes behind one new `docs/why.md` anchor, beside the rule it extends. Each edit still reads as an instruction with the citation removed. Refs #241 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjX5KDEbK7EeiEzbPvZ * docs(routine-setup): write down both preview Access tokens They live in two different places, so the doc needs a row in each: the `github-ci` pair as an org-level GitHub secret, read by SahajCloud CI's seed and smoke steps, and the `claude-loop` pair as a Claude cloud-environment variable, read only by `workflow/lib/preview-auth.mjs`. The ⚠ on "There is no secret store" now says what a preview-only Access token reaches — every preview of the gated repo, as a service identity whose every use Cloudflare logs — and what it does not: anything on the live site, whose address it cannot change. The failure this prevents is a person setting up the loop with one Service Auth policy on "any service token", which reads like the simpler choice and makes switching one token off a deletion of both. Two named policies are what let the loop's be switched off while CI keeps running, and the other way round. Nothing here names a stopgap variable: sydevs/SahajCloud#1081 retires it, and this doc never carried a row for it. Refs #241 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjX5KDEbK7EeiEzbPvZ * chore(plugin): 5.3.0 → 5.4.0 Every skill change in this PR reaches a cloud routine on its next run, and an installed plugin on no run at all until this string moves: `installed_plugins.json` records a `gitCommitSha` and never revisits it, and the cache directory is named after `version`. A skill change without a bump is the one failure this repo has already paid eight days of stale skills for. `.claude-plugin/marketplace.json` still parses and still points at `./workflow`. Refs #241 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjX5KDEbK7EeiEzbPvZ * fix(why): the 874 anonymisation was a hand seed, and no code does it That passage read as though the seed itself replaced coordinator identities with `preview.invalid` addresses. It did not: `grep -rn 'preview\.invalid'` over sydevs/SahajCloud returns zero hits, and nothing writes that address. The anonymisation was done by hand, once, on one preview. Left as it was, the passage stated the opposite of the parent goal's whole premise — that the content system has nothing safe to fill a preview with, since its only data scripts import real people's names and addresses. A reader who trusted it would have concluded the problem was already solved. What makes made-up preview data true in code is the committed fixture sydevs/SahajCloud#1081 adds, and that is structural rather than tested: the real-data files left that checkout in sydevs/SahajCloud#1079, so no CI run holds a real name to leak. It remains no promise about a preview somebody filled by hand. Replaced in place, not appended. Refs #241 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjX5KDEbK7EeiEzbPvZ * fix(lib): refuse a plan that would leave the preview host or carry half a token Four defects found reviewing the helper, each the kind a prose rule cannot hold and a script can. A sign-in route came from config and was concatenated onto the host with no check, so `@evil.example/x` or a bare `.evil.example/x` moved the origin while `finalize-pr` attached the Access service token to the request. The route is joined, then the composed origin is compared against the host's; anything else plans no sign-in. For the same reason `{pr}` now takes digits only — the slot sits inside the hostname — and a pattern must be `https:`, since `http:` would put the pair on the wire in cleartext and `file:` would read the disk. `headers` was built from the variable NAMES, so an environment holding no token still handed the session two headers that expand to empty. Cloudflare logs a blank client id as a failed service-token attempt, and the run reads two headers as a working credential. Both halves must now be set. SahajCloud's `accessTokenHeaders` already answered this question the same way; two answers were one too many. The pair also rides only with a gated request now: a repo declaring no `.auth` has no Access in front of it, and a preview host a repo has since moved is a name anyone may claim. `seedsPreviews` was true for any truthy `auth`, `{}` included. That verdict tells `review-pr` to raise a `should-fix` on every empty preview in a repo where no run can sign in or seed — a finding no author can comply with. It now reads a usable plan. `accountsPage` is gone. The seed route accepts only an admin manager, so a run that picked another account from that page could not then seed, and the field widened what the credential was used for while adding nothing. The suite caught none of this: 7 of 7 mutations survived it, the "opens no connection" assertion grepped for `fetch(` alone and passed a module importing `node:https`, and neither field-name override was exercised. It now asserts the import list against an allowlist, and 11 mutations were watched failing against it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjX5KDEbK7EeiEzbPvZ * fix(skills): make the new preview rules executable, and drop three false claims Review found the skill half stated things that are not true and asked for things a run cannot do. False, and a false sentence in a skill is in the next run's context: the example's hosts did not "become unreachable the day #1081 shut Railway's address" — that ticket is open, and the raw host redirects rather than going dark. The reason the hosts are gone is timeless, so it is stated that way. `finalize-pr` promised that a repo's seed check "will red this PR", but SahajCloud's step reds only where a preview was discovered; with none, CI warns. `why.md` claimed in the present tense a fixture that an unmerged PR commits, and named the ticket rather than the PR. Not executable: `review-pr` was told to call the helper but never where its input lives — `previewUrl` is not in `loop-config.json`, which is the only config that skill opens — nor that the path needs the `CLAUDE_PLUGIN_ROOT` convention, which is why 52 sessions once lost a call each. It also never got the Access headers, so on a gated repo every preview link answers with the login screen and reads as empty: the critic would have filed its own missing credential as a finding. And the new absolute collided with the carve-out two lines above it, leaving a mid-build 404 ambiguous. `finalize-pr` asked for a JSON subobject hand-spliced into a single-quoted shell string while the file was right there, and named no check on the token before sending. Both are `jq` and one clause. Hard rules still carried the unconditional form of the rule this PR makes conditional, which is the section a run under pressure re-reads, and step 7b restated the bullet instead of pointing at it. Two rules added rather than corrected. The token must never be printed — `fix-ci` already says so for the analogous case, and the values reach the shell even though the script never holds them. And data a preview already held must never be quoted into a public body: somebody may have filled it by hand from a real source. `rule-delta` reports that second one as a removal because it absorbed the shorter "never seed real people's contact details", which it contains. The docs now carry the Access application steps, because a service token is account-scoped and the promise that it "opens nothing on the live site" is kept by a policy nobody was told to create — with a verification `curl` against the live hostname expecting 403. The `CF_ACCESS_*` row moves to a repo secret: `--visibility all` would hand one repo's previews to every workflow in five. And both docs now say the feature is inert until a repo declares `previewUrl.auth`, naming its keys, which nothing told the person who must write that block. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjX5KDEbK7EeiEzbPvZ * fix(review-pr): key the unreachable preview on a signIn, not empty headers `headers: []` has two causes and the text read only one. `authPlan` empties it whenever `signIn` is null, so every repo with no `previewUrl.auth` — all four product repos today — matched the sentence, and so did a repo carrying `seed` alone. The branch's own test at `workflow/lib/preview-auth.test.mjs:141` is that case: `seedsPreviews: true`, `signIn: null`, `headers: []`. Read as written, the rule recorded such a preview unreachable and raised nothing, cancelling the `should-fix` the next sentence demands. The condition is now a `signIn` present with either `access` half unset, which is the only shape that means this environment cannot pass a gate, and empty `headers` with no `signIn` is named as no gate rather than a missing token. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW1KpxUngcdTDx7hQ1 * fix(finalize-pr): pin the unreachable preview to a signIn and name the field Same misreading as review-pr:98, and unscoped here. `authPlan` returns `headers: []` whenever `signIn` is null, so all four repos carrying no `previewUrl.auth` matched this sentence on every preview. Read as written, step 7 stopped checking data and wrote "unreachable" instead — the exact failure the step exists to prevent. The sentence now requires a `signIn`, and names the condition as `access.clientId.set` / `.clientSecret.set` rather than leaving the run to infer it from an empty list. Empty `headers` with no `signIn` is stated to mean no gate, so the data check proceeds as before. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW1KpxUngcdTDx7hQ1 * fix(preview): send the Access pair only to the plan's own host The security review found a credential leak this PR introduced, and it is the kind a prose rule cannot hold. `review-pr` was told to "send each link with the plan's `access.headers`", where each link is a `## Preview` link read out of the body under review. That body is not ours. `dispatcher/decide.mjs` fires `review-pr` with `onDemand` on a PR no member authored as soon as a `respondTo` login types the review verb, and the skill is told to judge a ticketless PR against its own body. So anyone able to open a PR could name their own host in a Preview section and collect the Cloudflare Access service token from their logs — a token that opens every PR preview of the gated repo. The branch had already hardened the script against leaving the host: `routeOn` joins the sign-in route and compares the composed origin. The prose then left by a different door, because the module validated the one URL it built while the skill attached the same headers to URLs it never saw. `onHost` closes it where a rule can be evaluated, and `--on-host <link>` answers `ON_HOST` or `OFF_HOST` for one link. Both skills now send the pair to an `ON_HOST` link only, and an `OFF_HOST` link in a body is a `should-fix` of its own: a body pointing where the repo publishes no preview is one a reviewer cannot check. `review-pr` also gains the `Never print the token` rule its `finalize-pr` counterpart already carried, since it publishes a public What-was-checked section. `railway.mjs` allowlists an outside poster's host for the same reason. Four mutations of the check were watched failing the suite: the `https:` guard dropped, `endsWith` for origin equality, hostname for origin, and always allowing. A fifth, dropping the null-host guard, is behaviour-preserving — the try/catch already answers false. `budget.test.mjs` asserts every verdict word a skill names is one a script can print, so each script now exports its own list and the test reads their union. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjW1KpxUngcdTDx7hQ1 --------- Co-authored-by: Claude <[email protected]> Co-authored-by: sydevs-bot <[email protected]>
Summary
/registrationson it: who signed up, with their answers, under Accepted / Pending / Withdrawn.GET /api/events/:id/registrations/csvserves those rows as a file. Both go through the view's own gate.registrationsjoin beside it was never readable by a manager, and is now admin-only.registrationAnswersstops showinguserAgent,locale,pathandsubscribeto managers as questions the visitor answered — live in the notification email and the daily digest, not only here.Change outline
Flow — three doors, one gate
readableEventis the authority, and each entry point calls it before it reads a row. Nothing upstream can decide this:Roothas already checkedcanAccessAdminfor the document route, and the question here is narrower than that.Contract — who may read an event's registrants
events read: project-wide (sahaj-atlas) update: region subtree OR manager == user + /registrations view active manager == user, OR admin # narrower than both + the tab's count pill the same gate + the CSV endpoint the same gate, behind requireActiveManager - registrations join visible to every viewer, renders empty for a manager + registrations join admin only (the field; its subquery still runs)A region manager holds
updateon every event in their subtree and is still refused here, which is why the gate cannot read the collection's own access config. Aninactivemanager the event still names is refused too:isManagerteststype === 'manager', and the admin shell admits them.Behaviour — the three filters, and what counts as an answer
Keyed by status, so a status added to the collection is a build error here, and none can appear under two filters.
buildRegistrationAnswerslabels an unrecognised key by the key itself, so every reserved key reaching it became a question the visitor supposedly answered.Files
The view composes
@payloadcms/ui's own primitives rather than wrapping them: the filters are Payload's document-tab markup (doc-tab, onepill-version-counteach), so they read as the header's Edit / Versions row, and the pager isPaginationdirectly. Two earlier helpers —FilterTabsandPageControls— are gone with it: each wrapped one primitive behind a slot only the dashboard used, and Payload's own composed equivalents are bound to a collection list view.Preview
Data: not seeded.
previewUrl.seedis unset for this repo and this session has noPREVIEW_ADMIN_EMAIL, so I could not sign in to the preview to create anything.pnpm seed atlasis deliberately not the answer here: its dump is 2004 real registrants' names and addresses, which must not go into a preview.To see rows, as the signed-in admin: create an event, then create a registration against it. The admin API accepts one directly — paste into the preview's own browser console on any admin page:
Create a registration on an event
The
locale,userAgentandsubscribepairs are there on purpose: before this PR they rendered in the Answers column, and in the manager's email. Add a second row withstatus: 'pending'and a third withstatus: 'spam'to see all three filters and their counts.Test results
.claude/skills/pr-prep/check.sh— lint, format:check, typecheck, typecheck:tests, 236 unit files / 3054 testsatlas-manager.int— 17 passedsecurityReview.triggerPatternthroughEvents/endpoints/registrationsCsv.ts, so the branch-level sweep was run rather than skippeddb:migrations:create --skip-emptywrote nothing — no schema changeEvery new assertion was watched failing first: the
subscribeleak, the archived-event read, the status partition, the event scoping, the inactive manager, the pill's gate, the CSV's 403, and the gate itself.Manual verification
/admin/collections/events/<id>/registrations: its registrants, Accepted first, Pending and Withdrawn behind their own filters, each tab carrying its count. The tab itself shows the accepted count beside its label.DocumentTabConditionis handed no document, so it cannot hide per event.userAgent,localeorsubscriberow.failed, which is what a manager needs in order to read that row at all.Notes for reviewer
managerSubmissionScopewould not have reached every event's manager — it narrows a role grant, andatlas-manageris the only role grantinguser-submissions, whileEvents.manageraccepts any manager.trash: trueread are in the exact code paths the ticket told me to reuse, and would have shipped in the new table too.registrationsjoin's subquery still runs for every manager and its result is discarded —admin.conditionhides a field, it does not stop a read. The ticket chose to keep the join for the admin's drawer, so this is an accepted cost, now stated at the field.helpers/searchParams.tsis notreq.searchParamsrestated.Rootrebuilds the request URL byqs.stringify-ing Next'ssearchParams, which spells a repeated keypage[0]=2&page[1]=9— soreq.searchParams.get('page')isnullwherefirstParamis'2'. The module's own comment carries it.requireActiveClient, because it serves the admin panel alone. Its docblock says so, asdocs/rules/endpoints.mdrequires of an endpoint that skips the client guard.escape_formulason the export is load-bearing: every cell is text a visitor typed, and a spreadsheet runs one starting with=,+,-or@as a formula. The integration spec pins it with=SUM(1,1).Intl.DateTimeFormatcache (bounded bylimit: 50— a cache against an unmeasured harm is machinery this repo would rather not carry); running the gate and the rows under onePromise.all(a refused caller would then have read restricted rows);userManagesDocumentfor the gate (it answers the wider ancestor-inclusive question, which would silently widen the day events gain a parent chain); a sharedregistrationRowFrom(the digest keepsstartingAtraw to group on, so one row shape would serve neither).tests/PERF.md's file/test counts moved with the new spec; its timing figures are untouched, since the measurements this container gives are not the ones that file records.Detail
Why the tab has no
condition. The ticket proposed one hiding it from non-managersusers, butadmin.userismanagers, so every admin-panel visitor already satisfies it and the condition would be vacuous.DocumentTabConditionis handed no document either, so a per-event condition is not expressible — which is why the view refuses rather than the tab hiding. The count pill is the part that can decide per event, and it renders nothing for a refused visitor.Why the gate re-reads the event instead of using the
docprop. Payload already loads the document for this route and passes it to the view, but as adraft: trueread. A region manager holdsupdateon every event in their subtree, so gating on that value would let a draft-only reassignment ofmanagerhand someone the registrants of an event they do not run, with nothing published.Why
answersFrommoved. It lived insrc/jobs/DeliverSubmissions/deliverRegistration.tsand was already imported from a second job folder, whichsrc/AGENTS.mdprohibits; this view would have been a third consumer, outsidesrc/jobs/entirely. BesidereadSubmissionValueit also sits next to the key declarations the exclusion is now derived from, which is what made thesubscribecase fixable without a fourth list.The timezone
null.startingAt_tzandschedule.firstDate_tzare both generated non-nullable and both left null by Postgres on a draft, where validation is skipped — soa || byieldsnull, andformatDate's default parameter covers onlyundefined. The three call sites spell|| 'UTC', which is what the other nine sites in the repo already do,eventDetails.tsitself included.senderEmailisvirtual: 'user.email'since #630, so it resolves through theusersjoin rather than off a column — which is whydepth: 0withsenderEmailselected is the right shape, and the same one both notification jobs use. The name is still read offsubmissionData, never from that row.Closes #1069
🤖 Generated with Claude Code
https://claude.ai/code/session_01Mg9rjX4qSoyst3EVF2Wkrr