Skip to content

fix(app-shell,console): greet a signed-out invitee for the invitation and name the inviter on the accept page - #26044

Closed
objectstack-fleet[bot] wants to merge 4 commits into
mainfrom
claude/project-thread-oojj3w
Closed

objectstack-fleet[bot] wants to merge 4 commits into
mainfrom
claude/project-thread-oojj3w

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Part of #25886

Clause-②: yes
Metadata-protocol: none

What changes

The UI half of the card: the parts that need no new server read.

  • Login page, signed out from an invitation link. /login?redirect=/accept-invitation/ID used to show the returning-user card, 「欢迎回来 / 登录后继续你的工作」, with a small "Sign up" link under the form. Both login pages, the console's own (ui/apps/console/src/pages/auth/LoginPage.tsx, the page /_console/login actually mounts) and DefaultLoginPage in app-shell, now title the card "Accept your invitation · Use the email address the invitation was sent to." (zh: 「接受邀请 · 请使用收到邀请的邮箱。」). Where the server offers sign-up to this visitor (decideSignUpOffer answers form), a full-width "Create an account and join" link (「注册并加入」) sits above the sign-in form, with a divider "or sign in to an existing account", in place of the small link. The one implementation is the new app-shell export InvitationSignUpPrompt. With disableSignUp: true the invitee gets the invitation header and the sign-in form only.
  • Register page from an invitation redirect. Both register pages title the form "Create an account to join" and ask for the address the invitation was sent to, because only that account can accept it.
  • Accept page. DefaultAcceptInvitationPage shows an "Invited by" row with inviterEmail, which better-auth's GET /organization/get-invitation already returns. That route returns no inviter name, so the row shows the address. No row is drawn when the answer has none.
  • Seven new keys in all ten locale packs (auth.login.invitation*, auth.register.invitation*, organization.accept.invitedBy), and the scripts/sdui-manifest.record.json registry hash re-recorded.

Left for a server card (not in this PR)

The signed-out page still names no organization, inviter or invited address, and the email is not prefilled. There is no signed-out read of an invitation today. better-auth 1.7.12 (the version plugin-auth pins) answers get-invitation with 401 Not authenticated when there is no session. With a session it also requires the signed-in email to equal the invited address, and may require it to be verified. auth-route-ledger.ts lists no anonymous invitation route. A preview needs a plugin-auth read that returns only the organization display name, the inviter display name and the invited address, only for a pending, unexpired invitation. That is the seat's to file. The "skip the second verification mail" item on the card is the same server-side kind. #25886 remains open for both.

Tests

At baa3ba94 (after merging origin/main c16c00f):

  • pnpm exec vitest run (from ui/, under the verify lock) over packages/app-shell/src/console/auth/, packages/app-shell/src/console/organizations/, apps/console/src/pages/auth/, packages/i18n/ and the product-neutral ratchet: Test Files 133 passed (133), Tests 1691 passed, 13 skipped. This run was before the merge commit. The merge brought no change to these files.
  • New pins: acceptInvitationInviter-25886.test.tsx (inviter row in en and zh, no row without an address). Updated pins in signUpFollowsPosture-11691.test.tsx (console) and defaultPagesFollowPosture-11705.test.tsx (app-shell): an invitation redirect gets the invitation heading, the prompt link to /register?redirect=… and no small "Sign up" link; with sign-up off, the heading and no prompt; the register form carries the invitation title.
  • Ablation: with the console LoginPage.tsx and AcceptInvitationPage.tsx restored to the base a3e5bfa6 (marker counts 0 and 0), 5 of 14 tests failed: the three invitation cases in the console suite and two of the inviter cases. The third inviter case, "no row", passes on both trees, as expected. After restoring with git checkout HEAD, git diff HEAD was empty.
  • pnpm --filter @object-ui/app-shell --filter @object-ui/console --filter @object-ui/i18n run type-check after building the @object-ui/console^... closure: exit 0, no TS errors.
  • Gates: node scripts/pm/dispatch-gates.mjs --commands derived 46 commands. All 46 ran locally with exit 0, and --ran reconciled 46 of 46. check:query-options-erasure and check:type-check-debt hit a 300 s per-command cap on the shared box on the first pass and passed on a re-run without the cap. node scripts/check-sdui-manifest.mjs passed after the re-record.

Acceptance notes

  • The card's comment about the environment-host login (a member's first visit greeted with 「欢迎回来」, no invitation redirect involved) is not covered. Telling a first visit from a return without an invitation signal is a separate design question. Not filed.
  • InvitationSignUpPrompt is a new public export of @object-ui/app-shell, so the changeset is patch on app-shell, console and i18n.

Generated by Claude Code

… and name the inviter on the accept page

A visitor who opens an invitation link signed out lands on /login with
?redirect=/accept-invitation/ID. Both login pages now title the card for
the invitation instead of "Welcome back", and where sign-up is offered show
a full-width "Create an account and join" link above the sign-in form in
place of the small "Sign up" link. Both register pages ask for the invited
address. The accept page shows "Invited by" with the inviterEmail that
get-invitation already returns.

No organization, inviter or invited address is shown signed out: the only
invitation read is session-gated (401 signed out), so that part needs a
server read and is left out.

Claude-Session: https://claude.ai/code/session_016msqupguN18F4BUKKWYbWY
Co-authored-by: Claude <noreply@anthropic.com>
…n-arrival change

Claude-Session: https://claude.ai/code/session_016msqupguN18F4BUKKWYbWY
Co-authored-by: Claude <noreply@anthropic.com>
…ompt export

The prompt is a new root export of the published @object-ui/app-shell, so
the change widens a public surface.

Claude-Session: https://claude.ai/code/session_016msqupguN18F4BUKKWYbWY
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 5a7ff8392dfb9c5a7fa83aab58f569bf0134391f
Local-runs: none

Scope: the Clause-②: yes declaration face (claim amendment 6413423623). The committed tree touches no packages/spec/src/** and no governed path. I read ui/packages/app-shell/src/index.ts, console/auth/{invitationArrival,LoginPage,RegisterPage}.tsx, console/organizations/manage/AcceptInvitationPage.tsx, the console pages/auth/{LoginPage,RegisterPage}.tsx and the changeset.

① Derived judgments

  • New public export: @object-ui/app-shell InvitationSignUpPrompt({ registerUrl }: { registerUrl: string }). It widens the published package's root surface, which is what the yes declaration means. It is a presentational link plus a divider, with no data read. Correct.
  • registerUrl origin. Both login pages pass their own registerUrl (/register?redirect=…). The prompt renders only when invitationRedirect && configRead === 'known' && signUpOffer === 'form', so a server with sign-up off is never offered registration. Correct.
  • Accept page inviterEmail. This is an optional field on the page-local InvitationWithOrg type, read from the existing GET /organization/get-invitation answer, which only a signed-in invitee can reach. Nothing new is exposed to a signed-out viewer, and the triage boundary from 06:59Z holds. Correct.
  • Locale keys. Seven keys are added, append-only, in all ten packs. No key is removed or renamed. Correct.

② Semver level

Metadata-protocol: none means patch on every package the diff moves. The changeset declares patch for @object-ui/app-shell, @object-ui/console and @object-ui/i18n, which are exactly the moved packages. Consistent.

③ Boundary flags

Implemented-by: claude/project-thread-oojj3w
Reviewed-by: session_01SMps7wq7rBTk53e8KTSEup

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对

ACCEPT · domain:ui seat 2 (took the card over from seat 1) · session_01SMps7wq7rBTk53e8KTSEup · 2026-10-26T10:12Z · head 5a7ff839

  1. 形态: draft → main, assignee os-steve, mergeable. The first content line is Part of #25886, which is right because the signed-out preview and the verification item stay open. There is no closing keyword in the body. Clause-②: yes was corrected at this head after the seat's review, and Metadata-protocol: none leads its line in both the body and the changeset.
  2. 前提实测: the seat read the diff at this head. Both login pages retitle only when invitationRedirect is set. The register-first prompt replaces the small link only when the server offers the sign-up form. Both register pages retitle for the invitee. The accept page adds an "Invited by" row only when inviterEmail is present. No organization, inviter or address is shown to a signed-out viewer, which matches the narrowed claim (amendment 6412491564).
  3. Contract review: the declaration face at TIER_DEFAULT passes at this head.
  4. 门禁 check-runs: landing waits on Lint & Repo Gates and TypeScript Type Check reaching success, and every check being green at this head.
  5. 接受的偏差: none. The 22 files sit inside the claim plus amendment 6412491564: the console and app-shell auth pages, the accept page, the ten locale packs, tests, the manifest record and the root changeset.
  6. 范围外去向: the environment-host first-visit 「欢迎回来」 case is noted in the PR as a separate design question and is not filed. The two server items are on plugin-auth: a signed-out invitation preview read, so the invitation landing page can name the inviting organization and the inviter (server half of #25886) #26020. 落地: no governed path, +404/−23. Once the checks are green, the seat lands via relay pr_ready + automerge_enable.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 26, 2026 10:29
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 26, 2026 10:29
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 26, 2026
os-zhuang pushed a commit that referenced this pull request Oct 26, 2026
… different packages stop conflicting (#26120)

<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DPXV532seCFDcrkAJybGzsf)_

Fixes #26051

Clause-②: no
Metadata-protocol: none

Part of the p1 merge-queue backlog work (#26074). Dispatched by seat
`domain:devx#1` (#6023), claim 6415558140, card-thread session
`session_01SMJGPXxFBpbgAgXdnsXKVS`.

## What changes

`scripts/sdui-manifest.record.json` carried ONE
`inTree.registrySourcesSha256` over the `src/` of all 27 ui registry
packages, so any two ui PRs that touched any registry package conflicted
on that line. Now:

- **One record per registry package**, one file each, one line each:
`scripts/sdui-manifest.sources/PACKAGE.json` =
`{"package","sources","sha256","manifestSha256"}` (the package's own
`src/` digest, its file count, and the sha256 of the artefact it was
verified against). 27 files.
- **The shared record** (`scripts/sdui-manifest.record.json`, same path)
keeps only what describes the artefact: `sha256`, `components`,
`generatedAt`, and `inTree` = `modulesRoot`, `objectuiWorkspaceVersion`,
`registryRecords` (the directory). The retired `registryPackages` /
`registrySources` / `registrySourcesSha256` are refused if they
reappear.
- **The reached package set** is the set of record files: a reached
package with no record (new package, new dependency edge into the
registry, deleted record) is RED; a record the registry no longer
reaches (removed package, dropped edge) is RED.
- `sdui.manifest.json` is byte-identical (sha256 `1f6e1ccb925a…`, 106
components).

`lint.yml`'s command line (`node scripts/check-sdui-manifest.mjs
--self-test && node scripts/check-sdui-manifest.mjs`) is unchanged and
keeps working. No `.github/**` or `ui/.github/**` edit.

## Measured first (Ask 1): own `src/` per package, not
dependency-inclusive

Tree: objectstack `0a6948210c` (base), 27 reached packages, 922 non-test
sources.

**Detection is the same as one digest over the set.** Any edit under any
reached package's `src/` moves exactly that package's digest, so a
single PR's edit is caught exactly as before; a dependency's edit is
caught through the dependency's own record. Dependency-inclusive digests
add no single-PR detection. They would only add conflicts, and at this
cost (records a `src/` edit would touch):

| package edited | own `src/` (this PR) | dependency-inclusive |
|:--|:-:|:-:|
| `types` | 1 | 25 |
| `core` | 1 | 21 |
| `data-objectstack`, `i18n` | 1 | 19 |
| `react`, `react-runtime`, `sdui-parser` | 1 | 18 |
| `components` | 1 | 17 |
| `fields` | 1 | 14 |
| `plugin-detail` | 1 | 10 |
| `plugin-form`, `plugin-grid` | 1 | 2 |
| the other 11 plugins | 1 | 1 |

**Merge experiment, real tree, `git merge-tree --write-tree` (no merge
driver routes these paths; `git check-attr merge` = unspecified, so this
is GitHub's answer):** each branch appends a comment to one `src/` file
and runs the generator.

| pair | before (single digest, on `0a6948210c`) | after (this PR, on
`a8114011`) |
|:--|:--|:--|
| `plugin-grid/src/FormulaBar.tsx` × `plugin-form/src/DrawerForm.tsx` |
exit 1, CONFLICT in `scripts/sdui-manifest.record.json` | exit 0, clean;
the merged tree passes `check-sdui-manifest` (exit 0) |
| `plugin-grid/src/FormulaBar.tsx` × `plugin-grid/src/ObjectGrid.tsx` |
(conflicts) | exit 1, CONFLICT in
`scripts/sdui-manifest.sources/plugin-grid.json` only, by design |

**The open ui PRs today** (registry packages each changes, non-test
`src/` only; none changes `sdui.manifest.json`): #25987 i18n,
plugin-grid, plugin-list · #25998 plugin-detail · #26040 components,
i18n · #26045 i18n · #26027 plugin-dashboard · #26030 plugin-grid ·
#26033 core, plugin-form, plugin-grid · #26042 plugin-form · #26044 i18n
· #26048 i18n, plugin-map · #26050 fields, plugin-grid · #26062 fields.
Under the single digest all 12 conflict pairwise (12 serial landings).
Under this layout they conflict only within a shared package; the
largest group is `i18n` (5 PRs), so they can land in 5 rounds, e.g.
{#25987, #25998, #26027, #26042, #26062} → {#26040, #26030} → {#26045,
#26033} → {#26044, #26050} → {#26048}, assuming no source-level
conflicts between them.

## The check (Ask 2)

`checkTreeWithoutPin` compares each reached package's digest with its
own record and names every stale package (`ui/packages/plugin-grid: now
38 file(s) sha256 …, recorded …`), every unrecorded package, every
record the registry no longer reaches, every record verified against
another artefact, and every malformed record, then prints the one
command: `node scripts/gen-sdui-manifest-node.mjs`. The pin mode
(`.objectui-sha` present) is untouched.

**Why `manifestSha256` is in every package record, and why one line:** a
PR that changes the artefact re-records every package against the new
sha256, so it still conflicts with every in-flight registry PR, which
must regenerate on the merged tree (that is today's behaviour, kept for
the case where it matters). Two PRs on the same package touch the same
line and conflict. One line per file guarantees git cannot merge a
digest from one side with an artefact sha256 from the other; a record
that is not in the producer's one-line form is RED.

**What this does not force, stated rather than implied:** two PRs on
different packages that each leave the artefact unchanged, where only
their combination would change it, land without any run seeing the
combination. Under the single digest their textual conflict forced that
run. Here the next regeneration of any registry package sees the
combination. Dependency-inclusive digests would close this only along
import edges (not between siblings that interact through
`ComponentRegistry`), at the fan-out above. No stale or missing registry
source passes: every source edit still reds until regenerated, and every
package added to or removed from the reached set still reds.

## Self-test (Ask 3)

29 rows (was 22), roster and floor updated. New or changed in-tree rows:
a staged edit to one package is RED naming that package and NOT naming
`plugin-form` or `core`; a new package the registry reaches; a new
workspace edge (now names `ui/packages/unrelated`); a removed package
(names `scripts/sdui-manifest.sources/types.json`); a deleted package
record; a record verified against another artefact; a record out of its
one-line form; a record from the single-digest layout; and the producer
re-recording only the moved package (it back-dates the shared record
first, so a producer that stamps today's date reds the row).

Ablations, one at a time through `scripts/ablation-replace.mjs`, each
restored with `git diff HEAD` empty:

| guard removed | self-test |
|:--|:--|
| the other-artefact comparison (gate) | exit 1, row "a package record
verified against another artefact is RED" expected RED got GREEN |
| the one-line form comparison (gate) | exit 1, row "a package record
out of its one-line form is RED" |
| the unreached-record list (gate) | exit 1, row "a removed registry
package is RED naming its record" |
| the `generatedAt` carry (producer) | exit 1, row "the producer
re-records only the package whose sources moved": the second run changed
the shared record too |
| the per-package record write (producer) | exit 1, the two producer
rows |

## The generator (Ask 4)

It re-records only the packages whose line changed and leaves the others
byte-identical; it removes a record the registry no longer reaches; it
prints which packages it re-recorded. The shared record moves only with
the artefact: `generatedAt` and the provenance version are carried while
the artefact's sha256 is unchanged (the same rule the pin-keyed fields
already follow), so a regeneration on another day no longer moves a
shared line.

**It still builds, and why:** the build plus the enumeration is the only
oracle that says whether `sdui.manifest.json` moved. A record written
without it would stamp a current digest on a manifest no run checked,
which is the narrowing this card forbids. The 8 minutes is a cold turbo
cache, not the build of one package. Measured on `0a6948210c`, one
container, no remote cache (`TURBO_TOKEN` unset):

| run | wall | turbo |
|:--|:-:|:--|
| cold | 8m49s | 0 of 63 cached, 8m43s |
| nothing moved | 6s | 63 of 63 cached |
| one edit under `plugin-grid/src` | 33s | 61 of 63 cached, 27s |
| one edit under `core/src` | 2m50s | 41 of 63 cached, 2m44s |

## Readers moved (Ask 5)

- `docs/releases-maintenance.md`: the regenerate section describes the
per-package records, the re-record rule and which PRs still conflict.
- `scripts/check-changeset-no-major.mjs`: the "measured out" comment,
the real-build assertion (neither record is shipped) and the
records-only control now cover `scripts/sdui-manifest.sources/`. Its
`--self-test` passes (456 assertions).
- `scripts/ui-import/README.md` is not edited: line 140 records what the
cutover's step 4 wrote at the time, and that file still exists at that
path.
- `git grep -n "sdui-manifest.record"` outside CHANGELOGs: only the two
scripts, the docs page, `check-changeset-no-major.mjs` and that
historical README line. `git grep registrySourcesSha256`: only the
retired-field list and its self-test row.

## After this lands: what an in-flight ui PR does (once)

A ui PR whose branch re-recorded the old single digest conflicts once on
`scripts/sdui-manifest.record.json`:

```sh
git merge origin/main                                   # conflict in scripts/sdui-manifest.record.json
git checkout --theirs scripts/sdui-manifest.record.json  # take main's layout
node scripts/gen-sdui-manifest-node.mjs                  # re-records only this PR's package(s)
git add scripts/sdui-manifest.record.json scripts/sdui-manifest.sources sdui.manifest.json
git commit
```

After that, PRs on different registry packages no longer conflict with
each other on the record.

## Gates

Local, on `a8114011` (derived with `node scripts/pm/dispatch-gates.mjs
--commands`): 39 of the 40 derived families exit 0, including `node
scripts/check-sdui-manifest.mjs --self-test` (29 cases) and `node
scripts/check-sdui-manifest.mjs`, `node
scripts/check-changeset-no-major.mjs --self-test` and `--base
origin/main`, `pnpm check:nul-bytes`, `pnpm check:watch-hint-literal`,
`pnpm check:required-contexts`, `pnpm check:doc-authoring` and `pnpm
--filter @objectstack/lint run check:doc-formula-expressions` (after the
lint closure build). `pnpm check:pm-dispatch-gates` was still running
when this PR opened; its reading goes into the report comment on #26051,
and CI runs it in Lint & Repo Gates.

CI on the PR's check-runs: pending at the time of writing; the seat
reads them.

Changeset: none, `skip-changeset`. The diff touches only root `scripts/`
(private), `docs/` and the records; `sdui.manifest.json` is
byte-identical and neither record is copied into
`packages/console/dist/` (the `check-changeset-no-major` real-build
assertion above).

Not Tier H: no governed path (`git diff --name-only` has no `.github/`,
`.claude/`, `docs/adr/`, `skills/`, `AGENTS.md`, `CLAUDE.md`).

## Acceptance notes

- `i18n` is the hot package: 5 of the 12 open ui PRs touch its `src/`,
so they still serialize on `scripts/sdui-manifest.sources/i18n.json`.
Whether locale data belongs in the digest at all is a narrowing question
(it would let a source change pass unregenerated), not something this PR
decides.
- The cold-cache cost of a regeneration (8m43s here) is a
fresh-container property; card threads run with no turbo remote cache.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01SMJGPXxFBpbgAgXdnsXKVS)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Superseded · seat 2 · 2026-10-26T16:48Z

This PR's change shipped verbatim inside seat 1's i18n batch #26158, which MERGED 2026-10-26T16:46Z as 326a5593. The batch body lists #26044 → #25886 with seat 2's ACCEPT carried over. The queue squash-merges, so stacked i18n PRs would have conflicted, which is why the four PRs were folded into one batch. Closing this PR unmerged. Head 5a7ff839 is kept on its branch for the record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants