Skip to content

fix(sharing): bootstrap fresh recipient invitations#1355

Merged
kunickiaj merged 1 commit into
mainfrom
07-23-fix_sharing_bootstrap_fresh_recipient_invitations
Jul 24, 2026
Merged

fix(sharing): bootstrap fresh recipient invitations#1355
kunickiaj merged 1 commit into
mainfrom
07-23-fix_sharing_bootstrap_fresh_recipient_invitations

Conversation

@kunickiaj

@kunickiaj kunickiaj commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Description

Fixes codemem-wosg by making Team-member and add-device invitations carry a canonical, coordinator-owned reviewed-intent snapshot. Fresh recipients can now review and accept invitations without preexisting local Team, Identity, membership, or Project-recipient facts.

The snapshot remains digest- and target-bound, invitation URLs remain digest-only, reviewed onboarding is validated before coordinator consumption, add-device Identity adoption is restricted to pristine bootstrap profiles, and local DB/config failures compensate safely. SQLite and D1 coordinator stores share the same fail-closed contract.

Type of Change

  • 🚀 Feature (new functionality)
  • 🐛 Bug fix (fixes an issue)
  • 📚 Documentation (docs-only change)
  • 🔧 Maintenance (refactor, chore, CI, etc.)
  • 🧪 Testing (test-only changes)

Testing

  • Relevant checks pass locally (pnpm run tsc, pnpm run lint, pnpm run test)
  • Added/updated tests for changes
  • Manually verified changes work as expected

Validation performed:

  • pnpm run check — 3,310 passed, 3 todo
  • pnpm --filter @codemem/cloudflare-coordinator-worker test:worker — Node and Worker runtime suites passed
  • Real owner viewer → coordinator → separate fresh recipient integration for Team and add-device journeys
  • Independent blocker/high security and correctness review found no remaining serious issues

Checklist

  • Code follows project style (pnpm run lint passes for touched files)
  • Self-review completed
  • Documentation updated (if needed)
  • No new warnings introduced

@kunickiaj
kunickiaj marked this pull request as ready for review July 23, 2026 21:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 423c23fbe7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/viewer-server/src/routes/sync.ts
Comment thread packages/core/src/coordinator-actions.ts
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_clarify_recipient_access_dialogs branch from 7cedce9 to f1c8ef0 Compare July 24, 2026 06:35
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_bootstrap_fresh_recipient_invitations branch from 423c23f to 30d140f Compare July 24, 2026 06:35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30d140f27b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/recipient-policy-onboarding.ts
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_clarify_recipient_access_dialogs branch from f1c8ef0 to dcbe107 Compare July 24, 2026 06:54
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_bootstrap_fresh_recipient_invitations branch 2 times, most recently from 90d1dab to f1633f6 Compare July 24, 2026 07:02
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_clarify_recipient_access_dialogs branch from dcbe107 to a1dac5c Compare July 24, 2026 07:02

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1633f66de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/recipient-reviewed-intent.ts Outdated
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_bootstrap_fresh_recipient_invitations branch from f1633f6 to 1505cf9 Compare July 24, 2026 07:16
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_clarify_recipient_access_dialogs branch from a1dac5c to e47597e Compare July 24, 2026 07:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1505cf9d12

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/coordinator-actions.ts Outdated
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_clarify_recipient_access_dialogs branch from e47597e to b8d0b92 Compare July 24, 2026 07:33
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_bootstrap_fresh_recipient_invitations branch from 1505cf9 to 4125a92 Compare July 24, 2026 07:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4125a9273b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/coordinator-actions.ts Outdated
Comment thread packages/viewer-server/src/routes/sync.ts Outdated
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_clarify_recipient_access_dialogs branch from b8d0b92 to 9487e50 Compare July 24, 2026 07:54
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_bootstrap_fresh_recipient_invitations branch from 4125a92 to c4f8345 Compare July 24, 2026 07:54

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4f8345a8e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/recipient-reviewed-intent.ts
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_bootstrap_fresh_recipient_invitations branch from c4f8345 to 22e8751 Compare July 24, 2026 08:34
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_clarify_recipient_access_dialogs branch from 9487e50 to 9784e3b Compare July 24, 2026 08:34

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 22e8751417

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/recipient-policy-onboarding.ts Outdated
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_clarify_recipient_access_dialogs branch from 9784e3b to be8ae10 Compare July 24, 2026 09:03
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_bootstrap_fresh_recipient_invitations branch from 22e8751 to c1246e3 Compare July 24, 2026 09:03

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c1246e3c12

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/viewer-server/src/routes/sync.ts
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_clarify_recipient_access_dialogs branch from be8ae10 to 0e5c912 Compare July 24, 2026 14:44
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_bootstrap_fresh_recipient_invitations branch 2 times, most recently from 0a92811 to 74b2fec Compare July 24, 2026 15:12
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_clarify_recipient_access_dialogs branch from 0e5c912 to a0a9a64 Compare July 24, 2026 15:42
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_bootstrap_fresh_recipient_invitations branch from 74b2fec to c74490e Compare July 24, 2026 15:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c74490e275

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/coordinator-actions.ts
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_clarify_recipient_access_dialogs branch 2 times, most recently from 489eb35 to 1d1c55c Compare July 24, 2026 21:56
@kunickiaj
kunickiaj changed the base branch from 07-23-fix_sharing_clarify_recipient_access_dialogs to graphite-base/1355 July 24, 2026 22:16
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_bootstrap_fresh_recipient_invitations branch from c74490e to 374d1eb Compare July 24, 2026 22:42
@kunickiaj
kunickiaj force-pushed the graphite-base/1355 branch from a0a9a64 to d14a530 Compare July 24, 2026 22:42
@kunickiaj
kunickiaj changed the base branch from graphite-base/1355 to main July 24, 2026 22:42
@kunickiaj
kunickiaj force-pushed the 07-23-fix_sharing_bootstrap_fresh_recipient_invitations branch from 374d1eb to e325e6c Compare July 24, 2026 22:47

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e325e6c706

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1457 to +1459
configuredRecipientActorId &&
configuredRecipientActorId !== addDeviceTargetIdentityId &&
configuredRecipientActorId !== `local:${deviceId}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Respect the environment actor override before adoption

When CODEMEM_ACTOR_ID is set to an established Identity but actor_id is absent from the JSON config, this check treats the profile as bootstrap-safe because it only examines config.actor_id. The add-device invite can therefore be consumed and persisted under its target Identity, but MemoryStore gives CODEMEM_ACTOR_ID precedence on the next start, switching the process back to the old Identity and potentially demoting the newly adopted actor when local actor state is materialized. Resolve the effective actor ID using the same environment precedence as MemoryStore, and reject adoption when that value conflicts with the invite target.

Useful? React with 👍 / 👎.

@kunickiaj
kunickiaj merged commit f9ee4f5 into main Jul 24, 2026
13 checks passed
@kunickiaj
kunickiaj deleted the 07-23-fix_sharing_bootstrap_fresh_recipient_invitations branch July 24, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant