Skip to content

refactor(stack): restore service factory locality - #6086

Merged
jgoux merged 98 commits into
developfrom
agent/stack-factory-resource-locality
Aug 7, 2026
Merged

refactor(stack): restore service factory locality#6086
jgoux merged 98 commits into
developfrom
agent/stack-factory-resource-locality

Conversation

@jgoux

@jgoux jgoux commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What changed

  • makes StackBuilder the sole owner of dependency topology and passes explicit dependencies into every service factory, including the native-initialization versus Docker-readiness choice for PostgREST
  • moves Docker network and port argument construction into service factories and migrates PostgreSQL, Auth, and PostgREST onto the common Docker definition helper
  • centralizes container identity so launch, exact cleanup, orphan cleanup, and catalog-derived candidate cleanup use the same naming source
  • captures exact build-produced cleanup targets before persistence and orchestrator setup, and disposes already-started resources after any partial startup failure
  • expands semantic service-definition coverage and documents the exact-versus-candidate cleanup model

Why

Service construction and resource identity were split across the builder, individual factories, and fallback cleanup code. Keeping topology in the builder while concentrating executable details and Docker identity in factories makes service definitions easier to change safely, prevents launch and cleanup names from drifting, and ensures failed startup cannot leave an earlier service running.

Depends on #6085 and #6084 (and transitively #6081, #6080, and #6078).

@jgoux
jgoux marked this pull request as ready for review August 5, 2026 14:00
@jgoux
jgoux requested a review from a team as a code owner August 5, 2026 14:00
jgoux added 19 commits August 5, 2026 18:37
…-model

# Conflicts:
#	packages/stack/README.md
#	packages/stack/docs/architecture.md
…ementation

# Conflicts:
#	packages/process-compose/src/Orchestrator.ts
#	packages/process-compose/src/Orchestrator.unit.test.ts
#	packages/stack/src/Stack.unit.test.ts
…ctory-resource-locality

# Conflicts:
#	packages/process-compose/src/Orchestrator.ts
…-model

# Conflicts:
#	packages/stack/src/versions.ts
…/stack-runtime-implementation

# Conflicts:
#	packages/process-compose/src/Orchestrator.ts
#	packages/process-compose/src/Orchestrator.unit.test.ts
…ctory-resource-locality

# Conflicts:
#	packages/process-compose/docs/architecture.md
#	packages/process-compose/src/Orchestrator.ts
#	packages/stack/src/LocalStack.ts
…ack-factory-resource-locality

# Conflicts:
#	packages/process-compose/docs/architecture.md
jgoux added 3 commits August 6, 2026 15:07
…ack-runtime-implementation

# Conflicts:
#	packages/stack/src/StackBuilder.ts
#	packages/stack/src/StackBuilder.unit.test.ts
…ctory-resource-locality

# Conflicts:
#	packages/stack/src/StackBuilder.ts

@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: 858e882b0d

ℹ️ 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/daemon.ts Outdated
jgoux added 4 commits August 6, 2026 16:19
…-model

# Conflicts:
#	packages/stack/src/ServiceActivation.ts
#	packages/stack/src/StackBuilder.ts
#	packages/stack/src/StackLifecycleCoordinator.ts
…gent/process-compose-supervisor-cleanup

# Conflicts:
#	packages/process-compose/docs/architecture.md
#	packages/process-compose/src/Orchestrator.ts
#	packages/process-compose/src/ServiceTransition.ts
#	packages/stack/src/ServiceActivation.ts
#	packages/stack/src/StackBuilder.ts
#	packages/stack/src/StackLifecycleCoordinator.ts
…-cleanup' into agent/stack-runtime-implementation

# Conflicts:
#	packages/stack/src/ServiceActivation.ts
#	packages/stack/src/StackLifecycleCoordinator.ts
…on' into agent/stack-factory-resource-locality
@jgoux
jgoux changed the base branch from agent/stack-runtime-implementation to develop August 6, 2026 14:30
@jgoux
jgoux enabled auto-merge August 6, 2026 14:30
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Supabase CLI preview

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

Preview package for commit ed107d6.

@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: 60786d568a

ℹ️ 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/LocalStack.ts Outdated
Comment thread packages/stack/src/createStack.ts Outdated
…y-resource-locality

# Conflicts:
#	packages/stack/src/LocalStack.ts
#	packages/stack/src/Stack.unit.test.ts
#	packages/stack/src/StackBuilder.ts
#	packages/stack/src/cleanup.ts
#	packages/stack/src/createStack.ts
#	packages/stack/src/createStack.unit.test.ts
#	packages/stack/src/daemon.ts
#	packages/stack/src/layers.ts
#	packages/stack/src/services/service-utils.ts
@jgoux
jgoux requested a review from Coly010 August 6, 2026 15:15
@jgoux
jgoux added this pull request to the merge queue Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 6, 2026
@jgoux
jgoux added this pull request to the merge queue Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 6, 2026
@jgoux
jgoux added this pull request to the merge queue Aug 7, 2026
Merged via the queue into develop with commit af348a1 Aug 7, 2026
42 of 51 checks passed
@jgoux
jgoux deleted the agent/stack-factory-resource-locality branch August 7, 2026 05:59
pull Bot pushed a commit to chizee/cli that referenced this pull request Aug 7, 2026
## What changed

- Introduces a serializable resolved Functions bundle with absolute
paths, per-function policy, static files, and resolved environment
values.
- Moves project, manifest, and dotenv resolution into config and CLI
ownership while keeping stack responsible only for runtime-derived
values and ephemeral runtime configuration.
- Uses validated JSON reload bodies, preserves the active bundle across
repeated reloads, and removes resolved bundle values from daemon startup
IPC and durable state.

## Why

This makes the stack boundary independent of CLI project conventions and
gives direct callers an explicit input model. In detached mode, resolved
environment values travel only in the Unix-socket request body and are
persisted only in the owner-only ephemeral runtime file.

Depends on supabase#6086 and its prerequisite stack architecture chain.
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