Skip to content

feat(orchestrate): X5 — profile slicing + shared pruning into the up saga (spec 12) - #55

Merged
gustavobertoi merged 1 commit into
mainfrom
nightly/X5-slicing
Jun 29, 2026
Merged

feat(orchestrate): X5 — profile slicing + shared pruning into the up saga (spec 12)#55
gustavobertoi merged 1 commit into
mainfrom
nightly/X5-slicing

Conversation

@gustavobertoi

Copy link
Copy Markdown
Contributor

What

Wires selective-up (spec 12) into the up saga. up --profile is now the SERVICE-SLICE selector (repeatable & comma-separated, -p shorthand) — distinct from the config-driven env-overlay (profiles.default, which still drives ${profile} in generate).

How

BuildUp resolves the active set via profile.Resolve(model, --profile):

  • Projects with zero active services drop out of the up entirely.
  • Each project's compose-up is restricted to its active service names (compose up -d <svc...>), and the active slice is folded into the phase fingerprint so widening/narrowing --profile re-runs rather than skips on a stale fingerprint.
  • Shared phase + health gate see only active.Shared (the shared instances the active services transitively uses), so up --profile minimal never blocks on a service it never started (spec 12 §health, spec 10).

down stays whole-project (label-driven) per spec 12 §down — no change. Removed the now-dead sharedNamesUsedBy.

Tests

Mock-runner unit tests in internal/orchestrate:

  • --profile frontend ups only web and gates postgres (web uses it).
  • No-config default → reserved all → ups web+worker.
  • A no-match slice drops the project and gates no shared.

make ci green (fmt + vet + build + test-race).

Spec acceptance (spec 12)

  • up --profile frontend starts only the tagged services + only the shared they transitively use.
  • no-flag + no defaultProfile → all profile-less + active-profiled services.
  • --profile a,b--profile a --profile b (union; resolver-tested in internal/profile).
  • health gating waits only on active-profile shared.
  • down removes the whole project stack by label, regardless of --profile.

Note: spec-native compose --profile/COMPOSE_PROFILES activation (requires emitting per-service profiles: keys in generation — deferred at compose.go:128) is not used here; explicit service-name slicing is functionally equivalent and additionally expresses cross-repo groups that compose --profile can't per-project. memoryBudgetMB warning (spec 12 §budget) remains a follow-up.

🤖 Generated with Claude Code

…e up saga (spec 12)

`up --profile` is now the spec-12 SERVICE-SLICE selector (repeatable &
comma-separated, `-p` shorthand), distinct from the config-driven env-overlay
(`profiles.default`, which still drives `${profile}` in generate).

BuildUp resolves the active set via `profile.Resolve`:
- projects with zero active services drop out of the up entirely;
- each project's compose-up is restricted to its active service names
  (`compose up -d <svc...>`), keyed into the phase fingerprint so widening or
  narrowing the slice re-runs rather than skips on a stale fingerprint;
- the shared phase + health gate see only `active.Shared` (the shared instances
  the active services transitively `uses`), so `up --profile minimal` never
  blocks on an unstarted service.

`down` stays whole-project (label-driven) per spec 12 §down. Removed the now-dead
`sharedNamesUsedBy`. Unit-tested with the mock runner: frontend slice ups only
`web` + gates postgres; no-config default ups everything (`all`); a no-match slice
drops the project and its shared.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gustavobertoi
gustavobertoi merged commit 088dbab into main Jun 29, 2026
2 checks passed
@gustavobertoi
gustavobertoi deleted the nightly/X5-slicing branch June 29, 2026 17:58
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