Skip to content

fix(stack): detect copied ordinary-folder identities - #6232

Open
jgoux wants to merge 3 commits into
developfrom
juliengoux/cli-2203-stack-detect-copied-ordinary-folder-identity-markers
Open

fix(stack): detect copied ordinary-folder identities#6232
jgoux wants to merge 3 commits into
developfrom
juliengoux/cli-2203-stack-detect-copied-ordinary-folder-identity-markers

Conversation

@jgoux

@jgoux jgoux commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reject copied ordinary-folder identity markers before managed stack discovery or mutation can reuse another live folder's stack document
  • centralize the check in the manager across discover, ensure, read, and start flows
  • preserve legitimate ordinary-folder moves and Git identity precedence

Why

Copying an ordinary project also copies .supabase/identity.json. While both folders exist, they can otherwise present the same environment identity and resolve to the same managed stack document.

The manager now joins filesystem identity with healthy persisted stack documents and returns an actionable InvalidManagedIdentityError when another live canonical folder contains the same marker. Users are told to delete the copied marker so a new identity can be generated.

Reviewer context

This is stacked on #6218 and targets its head branch.

@jgoux
jgoux marked this pull request as ready for review August 17, 2026 16:34
@jgoux
jgoux requested a review from a team as a code owner August 17, 2026 16:34
Comment thread packages/stack/src/managed/manager.ts Outdated

@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: b801f0808a

ℹ️ 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/stack/src/managed/manager.ts Outdated
Comment thread packages/stack/src/managed/manager.ts
Base automatically changed from juliengoux/cli-2110-state-honor-explicit-config-ports-and-allocate-sticky-ports to develop August 17, 2026 20:00

@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: aa756a9fd5

ℹ️ 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/stack/src/managed/manager.ts
Comment thread packages/stack/src/managed/environment.ts
Comment thread packages/stack/src/discovery.ts
Comment thread packages/stack/src/managed/manager.ts
Comment thread packages/stack/src/supervisor.ts Outdated
@jgoux
jgoux force-pushed the juliengoux/cli-2203-stack-detect-copied-ordinary-folder-identity-markers branch from aa756a9 to 21e12f6 Compare August 17, 2026 21:39

@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: 21e12f679d

ℹ️ 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/stack/src/managed/manager.ts
Comment thread packages/stack/src/managed/manager.ts
@github-actions

Copy link
Copy Markdown
Contributor

Supabase CLI preview

npx --yes https://pkg.pr.new/supabase/cli/supabase@21e12f679d1b67eaabd72558b3a79ba813e19e6e

Preview package for commit 21e12f6.

@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: fdf64157ff

ℹ️ 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".

if (discovery.workspace.kind !== "folder") return;
const listings = yield* store.list();
const matching = listings
.filter(isHealthyDocument)

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 Reject copies when the matching stack document is corrupt

When the original workspace still has a running supervisor but its stack.json is malformed or temporarily unreadable, store.list() returns a corrupt listing and this filter discards the only persisted-path evidence. A copied folder with the same marker then passes both ensureWorkspace() validations, and the attached-supervisor path in runManaged reports success against the original workspace's live endpoint. Treat a corrupt listing for the derived stack identity as an unsafe conflict rather than silently accepting the copy.

Useful? React with 👍 / 👎.

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.

2 participants