Skip to content

refactor(stack): consolidate local lifecycle ownership - #6085

Merged
jgoux merged 67 commits into
developfrom
agent/stack-runtime-implementation
Aug 6, 2026
Merged

refactor(stack): consolidate local lifecycle ownership#6085
jgoux merged 67 commits into
developfrom
agent/stack-runtime-implementation

Conversation

@jgoux

@jgoux jgoux commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

What changed

  • replaces the duplicate lifecycle coordinator tag and pass-through facade with one scoped local stack implementation that provides both the public stack and narrow activation interfaces
  • centralizes readiness policy enforcement across startup, activation, lifecycle operations, explicit waits, Promise calls, and daemon transport
  • adds typed readiness deadline failures with terminal scoped cleanup and daemon shutdown
  • validates readiness overrides over POST transport and documents the shared foreground/detached behavior
  • removes dead cleanup-query surface and uses structural Effect equality for projected state deduplication

Why

Lifecycle state previously had redundant interface layers and readiness deadlines were enforced only by the Promise adapter. Keeping policy and cleanup inside the single runtime owner makes every adapter observe the same semantics and prevents a timed-out runtime from relaunching resources after cleanup.

Depends on #6081 and #6080 (and transitively #6078).

@jgoux
jgoux marked this pull request as ready for review August 5, 2026 13:59
@jgoux
jgoux requested a review from a team as a code owner August 5, 2026 13:59

@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: 3e5662291a

ℹ️ 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/services/health-budgets.ts
jgoux added 6 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
…-model

# Conflicts:
#	packages/stack/src/versions.ts
Comment thread packages/process-compose/src/RestartDecision.ts
Comment thread packages/process-compose/src/ServiceTransition.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: fa591c0c79

ℹ️ 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/process-compose/src/ServiceTransition.ts
Comment thread packages/process-compose/src/HealthProbe.ts
Comment thread packages/process-compose/src/ServiceTransition.ts
Comment thread packages/stack/src/ServiceActivation.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: 77782dfe2f

ℹ️ 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/services/health-budgets.ts
Comment thread packages/process-compose/src/Orchestrator.ts
Comment thread packages/stack/tests/createStack-docker.e2e.test.ts
jgoux added 4 commits August 5, 2026 20:57
…/process-compose-supervisor-cleanup

# Conflicts:
#	packages/process-compose/src/ServiceTransition.ts
…ack-runtime-implementation

# Conflicts:
#	packages/stack/tests/createStack-docker.e2e.test.ts
…-cleanup' into agent/stack-runtime-implementation

# Conflicts:
#	packages/stack/src/StackBuilder.ts
#	packages/stack/src/StackBuilder.unit.test.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: e403043044

ℹ️ 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/createStack.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: 24a9dca0e2

ℹ️ 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
@jgoux

jgoux commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 24a9dca0e2

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

jgoux added 3 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
@jgoux
jgoux changed the base branch from agent/stack-domain-model 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@2434029bd44a69449f94c09de8a350261afe1470

Preview package for commit 2434029.

…e-implementation

# Conflicts:
#	packages/stack/README.md
#	packages/stack/docs/architecture.md
#	packages/stack/src/Stack.ts
#	packages/stack/src/StackBuilder.ts
#	packages/stack/src/StackConfig.ts
#	packages/stack/src/StackConfig.unit.test.ts
#	packages/stack/src/StackLifecycleCoordinator.ts
#	packages/stack/src/createStack.ts
#	packages/stack/src/createStack.unit.test.ts
#	packages/stack/src/daemon.ts
@jgoux
jgoux added this pull request to the merge queue Aug 6, 2026
Merged via the queue into develop with commit 223fa14 Aug 6, 2026
14 checks passed
@jgoux
jgoux deleted the agent/stack-runtime-implementation branch August 6, 2026 15:02
pull Bot pushed a commit to chizee/cli that referenced this pull request Aug 7, 2026
## 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 supabase#6085 and supabase#6084 (and transitively supabase#6081, supabase#6080, and supabase#6078).
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