Skip to content

feat(atlas): audit the embed hosts the captcha challenge refuses - #1106

Merged
Ardnived merged 11 commits into
mainfrom
fix/challenge-parent-audit
Nov 11, 2026
Merged

Ardnived merged 11 commits into
mainfrom
fix/challenge-parent-audit

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds a read-only audit of stored Atlas mounts that GET /api/atlas/challenge refuses.
  • Production needs no domain fixes: of 48 stored mounts, the one refused is a lane.test test row.
  • Joined: the challenge's allowlist moves into challengeParentAllowlist, so the audit shares it.

Change outline

Flow — the gate and its audit share one allowlist

The endpoint's allowlist query moves into its own module. The audit then calls the same function and the same matcher, so it cannot judge against inputs the gate no longer uses.

 GET /api/atlas/challenge                            src/endpoints/atlas/challenge/index.ts
-  allowedParentHosts([SAHAJATLAS_URL, WEMEDITATE_WEB_URL], activeClientDomains(req))
+  challengeParentAllowlist(req.payload)             src/endpoints/atlas/challenge/allowlist.ts
+    find clients where enabled, select { site.domain }      # moved verbatim from index.ts
+    allowedParentHosts([SAHAJATLAS_URL, WEMEDITATE_WEB_URL], domains)
   isParentAllowed(parent, patterns) → 200 | 403
+
+audit-challenge-parents.ts main()                   scripts/audit-challenge-parents.ts
+  getPayload(disableDBConnect, disableOnInit)
+    assert push, prodMigrations, connect present    # a rename must fail, not write past it
+    db.push = false; db.prodMigrations = undefined; connect
+  find clients, every row, select { name, enabled, site.domain, embedMetadata }
+  storedMounts(clients)                             scripts/challenge-mounts.ts
+    every embedMetadata key, inline and iframe     # the widget sends its own origin either way
+  challengeParentAllowlist(payload)                 # the gate's own call
+  refusedMounts(mounts, patterns, services)         scripts/challenge-mounts.ts
+    enabled service  → isParentAllowed(origin, patterns)
+    disabled service → isParentAllowed(origin, patterns + its own siteHosts)   # as if re-enabled
+    no date window                                 # a domainless service's rows are frozen
+    ownedBy: the disabled service whose domain holds the host   # enabling it is the row's fix
+  print rows ([disabled] flagged, owner named) and a count; exit once stdout flushes

Preview

Nothing to open on the preview: the change is an operator script, a behaviour-preserving extract inside the challenge endpoint, and docs.

Test results

  • Lean gate: ✓ check.sh — lint, format, typecheck, typecheck:tests, unit (255 files, 3457 tests)
  • Targeted specs: challenge-mounts.spec.ts 8 passed; atlas-challenge.int.spec.ts 9 passed
  • Build: N/A

Manual verification

  1. railway run --service SahajCloud -- env DATABASE_URL=<Postgres DATABASE_PUBLIC_URL> pnpm tsx scripts/audit-challenge-parents.ts prints one row, http://lane.test/ on "Sahaj Atlas (Local Test Key)", and exits.

Notes for reviewer

  • Title differs from the ticket's: production needed no domain fixes, so the PR ships the audit and its runbook step.
  • Closes fix(atlas): give every live embed host a service domain, which the captcha now requires #1077 by the owner's choice. Its WordPress registration criterion moves to the re-sync runbook (seeds/atlas/AGENTS.md): no WordPress site reports the new widget yet.
  • The lane.test row stays in production by choice; the runbook names it as expected.
  • Iframe mounts are judged, unlike the ticket's "inline alone": the widget sends its own document's origin as parent in a frame too.
  • Blind spot: a service stores reports from its own domain only, so the audit cannot see a partner page on another host. The registration check covers it.
  • src/endpoints/atlas/challenge/index.ts changed: the read moved verbatim and stays inside the endpoint's try (503 on failure).
  • A mount on a host a disabled service owns is still reported, because the live gate still refuses it. The row names that service, so the fix read off it is to enable the owner rather than to give the reporting service a domain.
  • Dismissed review findings:
    • Exit non-zero on refusals: the known lane.test row would fail every run, and a person reads the check.
    • serverEnv in a script: booting payload.config already validates the same environment.
    • The spec rebuilds the allowlist: the audit calls challengeParentAllowlist itself, and the int spec covers that function through the endpoint.
    • Two clients queries: the second is the gate's own, which is the point.
    • sanitizeEmbedMetadata on read, a shared script loader, readonly on isHostAllowed: other readers cast too, it's outside this diff, and the gain isn't measurable.
    • Lending every disabled service's domain globally: it would drop exactly the mounts the live gate refuses today, which is what the audit exists to find.
Detail
  • Production, 2026-11-10, read-only. 48 stored mounts. Only shrimataji.org (clients/38) reports the new widget among the partner services, and it passes. The other mounts are first-party, Workers previews and loopback test keys.
  • Domains followed. 25 of the 28 service domains end on their own host or its www twin. 3 did not answer in 15 s: meditatenow.online, www.meditaceonline.cz, www.meditaciononline.sahajayoga.com.ar. No service has site.page, so VerifyEmbeds checks none of them.
  • Final migration. clients/43 "Yoga Essonne" already carries legacyId: -32, so CLIENT_SPLITS reconciles it. The import writes site.domain on create only, so an Install-tab fix survives a re-sync.
  • *.pages.dev. normalizeCanonicalDomain('*.pages.dev') returns null, so siteDomainValidate refuses it.
  • Read-only boot. I ran it against an empty database under NODE_ENV=development and under production: no table was created either way. push, prodMigrations and connect are own properties of the adapter on a real boot, which is what the script now asserts before writing them — a read-back would pass on a renamed key, since all three are plain data properties. The first production run, before this fix, booted with NODE_ENV=production from a checkout with no migration production lacked. payload_migrations shows nothing applied.
  • Mutations. Seven deliberate breaks were each caught by the spec: own-domain-only matching, a 30-day window, the iframe filter, disabled services judged without their domain, disabled services skipped, an owner never attributed, and an owner attributed without matching the host.

Closes #1077

🤖 Generated with Claude Code

Ardnived and others added 6 commits November 10, 2026 15:32
`scripts/audit-challenge-parents.ts` reads every service's stored
`embedMetadata` and prints each inline mount whose origin
`GET /api/atlas/challenge` would refuse. It judges with the endpoint's own
`allowedParentHosts` and `isParentAllowed`, against the one global
allowlist, with no date window, and flags disabled services.

Against production on 2026-11-10, 1 of 47 stored inline mounts is
refused: `http://lane.test/`, a test run's mount on the local test key.

Part of #1077.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Extract the challenge's allowlist into `challengeParentAllowlist`
  (src/endpoints/atlas/challenge/allowlist.ts). The endpoint and the
  audit now share every input to the gate, not just its matcher, so a
  change to who counts as active reaches both.
- The audit loads `.env` before reading anything, and skips `onInit`, so
  a local run works and a boot cancels no stale jobs.
- Judge a disabled service as if re-enabled, so its rows name embeds
  that would still break.
- One `inlineMounts` rule feeds both the rows and the totals; rows carry
  the client instead of copying its fields.
- Trim the spec to the audit's own behaviour, and the scripts/AGENTS.md row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Per /code-review:
- Connect with the schema push and `prodMigrations` switched off, so a
  run against production writes nothing whatever NODE_ENV says. Checked
  against an empty database in both modes: no table created.
- Judge every stored mount. The widget sends its own document's origin
  as the challenge's parent in a frame too, so an iframe mount off
  sahajatlas.com is refused on the same grounds.
- Exit once stdout has flushed, rather than cutting a piped report or
  hanging on the boot's open handles.
- Count hosts as the gate does (`normalizeHost`), list mounts once, and
  drop a comment that claimed `serverEnv` parses on import.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…gacy id

The runbook step names the one known refused row, says how to run the
audit, and carries #1077's WordPress registration check to the cutover.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@railway-app

railway-app Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-1106 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Nov 10, 2026 at 11:29 pm UTC
1 service not affected by this PR
  • mailpit

@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1106 November 10, 2026 23:00 Destroyed
@Ardnived
Ardnived marked this pull request as ready for review November 10, 2026 23:03
@Ardnived

Copy link
Copy Markdown
Contributor Author

@sydevs-bot review

@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 10, 2026
@sydevs-bot

sydevs-bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 23:12Z address-review · attempt 1 · session · done
  • 23:12Z address-review · attempt 1 · session
  • 23:04Z review-pr · attempt 1 · session · done
  • 23:04Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 10, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

The diff matches #1077's size: the one script and spec it asked for, plus two pieces it forces. Both earn their place. challengeParentAllowlist cannot join challengeRequest.ts, which stays Payload-free so tests/unit/atlas-challenge.spec.ts can cover it. The pure half follows two documented precedents in scripts/AGENTS.md. The endpoint extract is behaviour-preserving: same query, same mapping, same try.

Two acceptance criteria are unmet and the body says so — one refused mount remains, and the WordPress registration moves to the runbook. Both are the owner's call, disclosed.

The one claim I would not ship unasserted is the read-only boot. It is the whole safety story for a production run.

Findings

  • should-fix — audit-challenge-parents.ts:37: the read-only guarantee rests on two untyped writes, with no gate.
  • consider — challenge-parents.ts:59: a disabled service's domain is lent per row, so one row names the wrong fix.
  • consider — challenge-parents.ts:2: the pure half's name says nothing its sibling's does not.

What was checked

  • Read whole: both scripts, allowlist.ts, challenge/index.ts, challengeRequest.ts, site.ts, embedMetadata.ts, report.ts, env/server.ts, the spec.
  • Consumer side followed. Judging iframe mounts is right, against the ticket's "inline alone": SahajAtlasWeb's use-turnstile.ts:133 and lib/mount.ts both read window.location, so the mount key's origin is the parent the gate sees. report.ts:148 refuses any other host.
  • serverEnv in a script is harmless: the proxy validates lazily.
  • Contract files untouched, and no guide enumerates the challenge endpoint's modules, so the new file leaves no stale doc.
  • Not re-run: the empty-database boot. Taken from the body's measurement. No preview opened — "nothing to open" holds.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread scripts/audit-challenge-parents.ts Resolved
Comment thread scripts/challenge-mounts.ts Resolved
Comment thread scripts/challenge-mounts.ts Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 10, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 10, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 10, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 10, 2026
Both flags were written through a cast that made them optional, so a
Payload rename would have compiled and left the script applying
`prodMigrations` against production. The keys are now asserted present
before they are written.

Reading a key back after setting it was the other option, and it proves
nothing: a plain data property returns whatever was just assigned, on a
renamed key as much as on the right one.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZUpPe91FYd9wpXMPZ
A disabled service's domain is lent back for its own mounts only, so
another service's mount on that host is still reported — correctly, since
the live gate refuses it — but the row read "give this service a domain"
when enabling the owner is the fix.

Lending every disabled domain globally was the alternative. It would drop
exactly those mounts from the report, which is the breakage the audit
exists to find, so the row carries the owner instead.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZUpPe91FYd9wpXMPZ
Its exports speak mounts, and the old name was the script's own minus
`audit-`, so neither file said which half was pure. `signin-token.ts`
beside `signin-link.ts` and `railway-preview-status.ts` beside
`get-railway-preview-url.ts` are the precedents, and both name the spec
after the pure half too.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZUpPe91FYd9wpXMPZ
@sydevs-bot

Copy link
Copy Markdown
Contributor

Addressed all three review threads. Pushed to claude/relay-1106-cabc5dd for Actions to land.

  • The read-only boot had no gate — adopted, c05b0b6. The three adapter keys are asserted present before they are written. A read-back cannot catch a rename: all three are plain data properties.
  • A disabled domain is lent per row — kept per row, 6f751ef. Lending globally would drop the mounts the live gate refuses. Such a row now names the disabled owner to enable.
  • The pure half's name — adopted, 80e07f1. scripts/challenge-mounts.ts, with its spec.

Lean gate green, 255 files and 3457 tests. Security review skipped: no changed path matches the trigger.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 10, 2026
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1106 November 10, 2026 23:26 Destroyed
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 10, 2026
@sydevs-bot
sydevs-bot enabled auto-merge November 10, 2026 23:43
@Ardnived
Ardnived disabled auto-merge November 11, 2026 15:25
@Ardnived
Ardnived merged commit e543e6a into main Nov 11, 2026
9 checks passed
@Ardnived
Ardnived deleted the fix/challenge-parent-audit branch November 11, 2026 15:26
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 11, 2026
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
#1108 renamed Clients.name to label; #1106 landed after it with two new
scripts still reading name. The two touch different files, so GitHub merged
#1106 without a conflict and main has not typechecked since: tsc --noEmit on
e543e6a reports the same three errors this branch inherited on merging it.

Both scripts are operator audits printing an internal identifier, so label is
the right half of the split rather than the public title.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWo4RQkAJtqPe72vrB
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
Five conflicts, all Markdown, and four of them one fact: both sides
recounted the unit lane. The merged tree is measured rather than added
up — 261 files and 3510 tests, which `perf-figures-pinned.spec.ts` pins
to what is on disk. `tests/PERF.md` takes this run as its forty-sixth
row; `AGENTS.md`, `docs/rules/testing-reqs.md` and `tests/AGENTS.md`
quote the same pair.

The fifth is `scripts/AGENTS.md`'s table, where each side added rows:
`lib/cloudflare.ts`, `preview-domain.ts` and `preview-domain-plan.ts`
from this branch, `audit-challenge-parents.ts` and `challenge-mounts.ts`
from #1106, each kept at its own placement. One shared row differs in
substance — `get-railway-preview-url.ts`, which this branch rewrote to
wait for the head commit rather than for `/api/health` — and that is
this branch's, untouched on `main`.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZTnsrufohceG18CSK
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
…udit

`main` does not typecheck. #1106 added `audit-challenge-parents.ts` and
`challenge-mounts.ts` reading `Client.name`; #1108 split that field into
a required internal `label` and an optional public `title`. Each was
green against its own base, and #1106 merged second, so `tsc` fails on
`main` itself at three sites — not at any conflict between the two
branches. Merging `main` brought the break here, which is why it is
fixed here.

`label` is the field the split kept for operator-facing output: required,
never shown to the public, and what manager-facing mail already uses.
`title` is optional and would print nothing for most services.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZTnsrufohceG18CSK
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
#1106's audit picks `Client['name']`, which #1108 had already renamed to
`label` — it branched before that rename and merged after it, so `main`
itself does not typecheck. Nothing caught it: neither lint nor Vitest runs
`tsc`, and CI's test step does not either, so the Railway build is the
first place it fails. The audit prints the service's internal name, which
is what `label` holds.

Found by the lean gate on this merge, and fixed here because that gate is
what the merge had to pass.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZ93GJSxZ1zH4BGeHT
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
#1106's challenge audit selects and prints `Client.name`, which #1108
renamed to `label` in the same release. Both merged, so `main` itself
fails `pnpm typecheck` — nothing in either PR's own gate crossed the
other, and the type error reaches no test lane.

`label` is the internal name, which is what this operator audit wants:
every row it prints names a service for somebody to go and configure.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXtaL1Gdc9Fuxxn6Sz
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
…er-contacts

Three conflicts, all one fact: the unit lane's file and test counts, in
docs/rules/testing-reqs.md, tests/AGENTS.md and tests/PERF.md. main's #1106
and this branch each added one spec file and bumped the counts, so neither
side's number describes the merged tree. Measured instead: 256 files, 3468
tests. AGENTS.md states the file count too and merged clean at the stale
255, so it is corrected here — tests/unit/perf-figures-pinned.spec.ts pins
all four against the tree.

Everything else merged clean, and main added no migration, so the chain and
its snapshot stand as the seventh merge left them.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXy3iaPMgPWWDuicC8
sydevs-bot pushed a commit that referenced this pull request Nov 11, 2026
#1108 split the clients `name` field into `label` and `title`, and #1106
landed afterwards still reading `name`. Each was green on its own branch,
so main carries a tsc failure neither PR could see: `name` is not a key of
Client.

The audit is operator-facing, so it takes `label`, the internal name, not
`title`, which is the name registrants see.

This is main's break, not this branch's, and it reddens this PR's gate and
CI all the same.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXy3iaPMgPWWDuicC8
Ardnived added a commit that referenced this pull request Nov 11, 2026
…#1047) (#1105)

* fix(access): lock every Managers field read to the row's holder or an admin

Ports the first half of #1045 (commits 1f5c3fb..4e71879) onto main, without
its region widening or its activity-log address projection.

`atlas-region-manager` holds a collection-wide `managers: read` so the
`Events.manager` and `Regions.managers` pickers can list other managers
(#821). Nothing narrowed it, so every region manager read every manager's
email, contact methods, notification preferences and imported legacy row.

- `lockManagerFieldReads` gives every field but `name` a self-or-admin `read`
  lock. `email` and `_verified` are redeclared at the top level so the lock
  has a base field to merge onto, keeping Payload's i18n labels.
- `loginPlugin`'s three machine columns carry the same lock.
- `stripLockedFieldsOnSelfRead` stands down off the caller's own row, so an
  internal `overrideAccess` read of a colleague keeps its fields.
- `UserSubmissions.previewEvent` selects only the assigned manager's name.

Refs #908

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(managers): record when a manager last signed in

Nothing recorded it: `sessions` loses its row on sign-out and prunes expired
ones, and `updatedAt` moves on every write, the digest job's included. The
manager contacts table needs it to tell an active colleague from one who
never accepted.

- `loginPlugin` appends `lastLoginAt`, read-only and `update: () => false`,
  with its own self-or-admin read lock like the other appended columns.
- `createSession`, the one place a session is minted, stamps it in the same
  write as the session row.
- The migration adds the column and fills it from `legacyData.lastLoginAt`,
  which the Atlas import kept for 448 of 516 managers. A hand edit, asked for
  on this PR, on the #1087 precedent: a projection of the same row.
- The Atlas import maps it from now on, keeping the later of the stored and
  the legacy date, so an `--update` never rewinds a real sign-in.

Refs #908

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat(atlas): show a region's and an event's managers to the managers above

With every field but `name` locked on another manager's row, a region
manager had no way to reach the people their region names. The details come
back the way an event's registrants do: through a surface that checks its own
gate and then reads past the locks, rather than a field lock widened per
reader.

- `mayReadManagerContacts` is the gate: an admin, the event's own manager, or
  an active manager whose owned subtree holds the region. That is a region's
  co-managers and the managers of every region above it, downward only.
- `managerContactsField` puts one shared table under `Regions.managers` and
  `Events.manager`: Payload's condensed `Table` with the name, a `mailto:`
  email and the last sign-in. It reads the stored row by id, never the form
  data, and for an event the published row.
- `Events.activityLog` reads behind the same gate (`eventContactsFieldAccess`,
  through a new `read` option on `logField`), since its reminder entries
  record where each one went. With no row in hand it answers for admins only.
- `previewEvent` loads its target without the log: a proposal reaches the
  managers of the region it proposes, who need not be the event's.
- Region-manager reminders already carry the event manager's email. A case
  now pins it against the new locks.

Refs #908, #1047

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(seeds): keep firstDomain's doc block on firstDomain

`laterDate` landed between the block and the function it documents, so a
reader got the legacy-domain explanation above a date comparison.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVvfniXDQu4ThbSqXV

* fix(admin): declare the contacts row type beside its loader

`import type` is erased, so the client table taking the row type from
`data.ts` pulls no server module into the browser bundle — the shape
`EventRegistrations` already has, where `RegistrationRow` is declared in its
own `data.ts`.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVvfniXDQu4ThbSqXV

* refactor(atlas): render the manager contacts table under the field description

The table is now the `Description` of `Regions.managers` and `Events.manager`
rather than a `ui` field of its own: it renders the field's own description,
then the table, as `PermissionsTable` sits under `Managers.roles`. Both fields
also declare an empty `afterInput`, because Payload otherwise renders a
`Description` once and keeps it through a save, and the table would go on
listing the managers the page loaded with.

The last sign-in is one line, `2026/11/10 - 3 weeks ago`, in three states:
normal, red past six months, and a muted "Never".

Refs #908

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(admin): spell the contacts table's sign-in day with formatShortDate

The table's own helper gave `2026/11/10`, under a reason — one unambiguous
spelling in every locale — that the module's existing `formatShortDate` already
satisfies. It also spells a UTC day, returns `''` for an unparseable value, and
is what the Registrations table beside this one shows a date with, so both
tables now read the same.

The spec spells the expected day out rather than calling the formatter, so the
day the table shows stays pinned against it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZ3Mx2LJUWEV8VFdtU

* fix(admin): take the contacts component's props from Payload's own types

`path` arrives through `renderField`'s `clientProps`, which Payload types as
`FieldPaths`, so `Pick<FieldPaths, 'path'>` says what `{ path?: string }` was
restating — and it is always set, so the `''` fallback is gone with it.

`admin.description` needed no structural cast either, only a narrower field
type: `ServerComponentProps['field']` is the whole `Field` union, whose `row`
and `tabs` members omit `description`, while both registrations are on a
relationship picker.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZ3Mx2LJUWEV8VFdtU

* fix(admin): put the contacts table in Payload's afterInput slot

`RelationshipInput` renders `AfterInput` and then the `Description` slot, so
the table reaches the same place from the slot Payload already provides for it
— and a `beforeInput`/`afterInput` key is what `renderField` tests to re-render
a field's components on every form-state request, so the save-follows behaviour
now comes from the registration itself rather than from an empty array beside a
`Description` override.

That override existed only to put the table below the description. Paying for
it were four pieces: re-rendering `FieldDescription` by hand, the `path` prop
it needs, the `RelationshipField` narrowing for `admin.description`, and the
empty-array trap with a ⚠ on each field and in the component. The table now
sits above the description instead.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYYtgW8B9ehUL2Ek4h

* docs(access): cut what the field-lock JSDoc already carries

Three ⚠ blocks restated, near-verbatim, the JSDoc on `selfOrAdminFieldAccess`
and `stripLockedFieldsOnSelfRead` — and this file loads whenever either is
edited, so every reader paid for both copies.

Each keeps its rule, its #NNN breadcrumb and the one line a reader cannot
re-derive, and hands the mechanism back to the JSDoc beside the code that
implements it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYYtgW8B9ehUL2Ek4h

* fix(admin): drop the contacts table's unreachable name fallback

`Managers.name` is `required: true`, so `name || email` never took its second
arm — and had it ever fired, the Name column would have printed an email.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYYtgW8B9ehUL2Ek4h

* chore(migrations): snapshot resync after the seventh main merge

main's 20261110_234836_clients_label_title snapshot was generated on main,
so it knows nothing of the last_login_at column this branch adds — and its
timestamp is the higher of the two. migrate:create diffed against it and
re-emitted ALTER TABLE "managers" ADD COLUMN "last_login_at", which
20261110_220603_manager_last_login already ships. Replaying one statement
aborts the boot migration (#566).

So the generated file keeps only its .json snapshot, taken on the merged
tree, which carries both sides and heals the chain. A probe run afterwards
writes no files.

CI cannot see any of this: push: !isProduction syncs the schema with Drizzle
push and never replays the chain. Only a Railway boot does.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjUvzMXoQtMoVVQaYYp

* fix(clients): read the audit's service name from label, not name

#1108 split the clients `name` field into `label` and `title`, and #1106
landed afterwards still reading `name`. Each was green on its own branch,
so main carries a tsc failure neither PR could see: `name` is not a key of
Client.

The audit is operator-facing, so it takes `label`, the internal name, not
`title`, which is the name registrants see.

This is main's break, not this branch's, and it reddens this PR's gate and
CI all the same.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXy3iaPMgPWWDuicC8

* refactor(access): trim the manager contact locks to what they need

The new comments were 44% of the PR's added source; cut to the why, keeping
every warning. The unit sweep over the Managers field locks repeated the
integration sweep, which reads the booted config and so already sees the
login plugin's columns and the base auth fields: the integration spec now
carries the non-vacuity check, and the unit spec keeps the
`selfOrAdminFieldAccess` cases. `stripLockedFieldsOnSelfRead` drops its
unselected-field skip, a shortcut that saved nothing once the hook ran on
the caller's own row alone. `MANAGER_PUBLIC_FIELDS` is no longer exported.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(admin): put the contacts table back under the field description

f0f14eb moved the table into `afterInput`, which `Relationship/Input`
renders above the description. Under the description is where the owner
asked for it, as `roles` sits on Managers, so both fields register the
component as their `Description` again, with the empty `afterInput` that
re-renders it after a save. The component's docblock now says why the slot
is `Description`, so the next review can see the placement was chosen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1106 — cabc5ddb Deployed Nov 10, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

fix(atlas): give every live embed host a service domain, which the captcha now requires

3 participants