Skip to content

Commit 69ec78a

Browse files
authored
fix(native): keep Compose-only projects on the Compose backend with closed refusals (#365)
## Summary User decision (2026-10-19): in v5, unchanged real Compose projects such as Omega stay on the supported Compose backend. Native support for these features is post-v5 work (HACK-1270). This PR makes native `hack up` and `hack restart` refuse each blocking Compose feature exactly, before any mutation. It also documents the features and adds a `hack doctor` check that reports them. The explicit `HACK_NATIVE_ADAPTATION` path stays supported. A network that a valid adaptation lists in `isolatedNetworks` is not treated as an external network: the check classifies the Compose file after that adaptation, as native start does. ### Root cause Native image-project `up` (`handleNativeUp` → `startNativeProject`) had no early classification of Compose-only features: - **External networks** and **non-arm64 `platform`** were not checked on the TypeScript side. They failed only after `runtime check-project-share`, run-storage preparation, lifecycle `before` hooks and `runtime up` (the runtime-core review rejects `external_network`, and registry admission selects arm64 only). - **Builds** and **labels** were refused, but only as the general `NATIVE_CONFIGURATION_REFUSAL`. That came after the source preflight and storage preparation, and it did not say the project belongs on the Compose backend. ### Rework after verification (adaptation regression) The first version of this PR (9ce0f3b) read only the original `.hack/docker-compose.yml`. It ignored the documented `HACK_NATIVE_ADAPTATION` `isolatedNetworks` selection, which native start applies to the normalized copy (`replaceNetworks` sets `x-hack-isolated`). So `"isolatedNetworks": ["hack-dev"]` with an external `hack-dev` network was refused with the Compose-backend line before the adaptation was read. That blocked `up`, `restart` and `restart --recover`, and native doctor warned about it. On `next` the same project passes native review and reaches `runtime check-project-share` and `runtime up`. Fix (76003b5): - `findComposeBackendFeatures(compose, {isolatedNetworks})` does not count a network named in the set as external. Other features are unaffected. - `readComposeBackendFeatures(composeFile, {adaptationFile})` reads the selection only when the unadapted file has an external network. A project without one keeps its existing refusal order. - `readAdaptedIsolatedNetworks` reads the file with native start's own `readNativeSelection` (absolute path, bounded, unchanged regular file). If the file cannot be read, the selection is not version 1, or `isolatedNetworks` is not a bounded list of unique strings, it refuses with the same one-line `E_CONFIG_INVALID` message native start gives, before any runtime request. Native start still validates the whole selection against the normalized Compose file, including that each listed name is an external network. - `handleNativeUp` (covers `up`, `restart` and `restart --recover`) passes `process.env.HACK_NATIVE_ADAPTATION`, the same value it gives `startNativeProject`. Native doctor passes the same value. Compose doctor does not, because the adaptation is native-only. - Docs: the "External network" row, the refusal-contract paragraph and the doctor paragraph in `docs/guides/native-candidate.md` now describe the adaptation. The adaptation section links back to the Compose-backend section, and `docs/reference/native-config-import.md` qualifies its summary. The two sections no longer contradict each other, and `isolatedNetworks` is not retired. ### Fix (unchanged from the first version) - `src/lib/native-compose-backend-features.ts` classifies the project's Compose file into a closed, ordered set: `external_network`, `reserved_label`, `unsupported_build`, `foreign_platform`. - **External network**: top-level `external: true` or `external: {name}`, unless it is `x-hack-isolated: true` or isolated by the adaptation. - **Reserved ownership labels**: keys starting with `com.docker.compose.`, `io.hack-local.` or `io.hack.native-config.`, on service, network and volume labels. Routing (`caddy*`), cache (`hack.dependencies.*`), one-shot and other ordinary labels keep their native behavior. - **Build**: reuses the import preview's `mapLegacyComposeBuild`. The result matches what `hack config import --dry-run` reports as `invalid_or_unsupported_build` or `image_build_exclusive`. - **Platform**: anything other than `linux/arm64` or `linux/arm64/v8`. - `handleNativeUp` calls `refuseNativeComposeBackendFeatures` after option refusal and project selection, before branch, config, env-fingerprint, lifecycle, shared-source, storage and runtime work. `--detach` still gets its one-line `E_USAGE` first (#359). `down` is not affected. Authored and adopted native-config projects go through `tryNativeComposeCommand` first and never reach this check. - Each refusal is a `HackCliError` with the stable code `E_NATIVE_PROJECT_UNSUPPORTED` and one value-free line that names every feature found and the `HACK_RUNTIME_BACKEND=compose` selection. `detail` is `{backend: "compose", features: [...]}`. - Unreadable, oversized (over 256 KiB), symlinked or unparseable Compose files produce no features. Native input review still refuses them as before. - `hack doctor` has a `compose backend features` check, in both native and Compose doctor. On native, a feature found is a `warn`. On Compose it is informational (`ok`). With `--json`, the check carries `composeBackend.features` (closed names only). The CLI surface (options and help) is unchanged, so `docs/reference/cli.md` was not regenerated. ## Tests - `tests/native-compose-backend-features.test.ts` (unit, 13 tests). The original cases are kept. New in the rework: - An adaptation-isolated network is not external. A parity check runs the real `adaptNativeProject` on the same selection and classifies its normalized output the same way. A network that is not listed is still external, and isolation never hides another feature. - A file classified with a valid isolating selection has no features, while a selection that lists another network or has no `isolatedNetworks` leaves the external network. - Five invalid selections refuse with `E_CONFIG_INVALID` and the exact message. For each one, the real `adaptNativeProject` throws the same message. Without an external network the selection is not read. Missing and relative paths refuse. - `tests/native-compose-backend-features-cli.test.ts` (real CLI through `privateCliEnv`, stub runtime, 15 tests). The original cases are kept. New in the rework: - The verifier's repro: external `hack-dev` + `{"version":1,"isolatedNetworks":["hack-dev"]}` + `HACK_NATIVE_SHARED_SOURCE=1`. `hack up` passes the check and reaches `runtime check- project-share` and then `runtime up`, as on `next`. - `hack restart` with the same selection reaches restart preflight's own `Native restart has no existing run` line. - A selection that isolates a different network still gets the Compose-backend line, with 0 runtime calls and an unchanged tree. - An invalid selection (version 2) gets one `E_CONFIG_INVALID` line, with 0 runtime calls and an unchanged tree. - Native `doctor --json` with the selection reports `ok` and `features: []`. - Mutation proof for the rework. Each mutation was applied, both files run, and the change reverted with `git checkout`: | Mutation | Failing tests | | --- | --- | | `handleNativeUp` does not pass the adaptation | 3 (up, restart, invalid selection) | | Classifier ignores the isolated set | 5 | | Selection read even without an external network | 1 | | `isolatedNetworks` shape not validated | 1 | | `version` not validated | 2 | | Native doctor does not pass the adaptation | 1 | The first version's mutation results (removing the call, each rule, doctor wiring) still apply to the unchanged cases. ## Evidence - Bun 1.4.2 (`mise x bun@1.4.2`), macOS arm64 host. Load average was between 30 and 95 during these runs. - `bun run --cwd packages/cli typecheck`: 0 errors. `bun run --cwd packages/cli check`: 0 errors and 34 existing warnings. `biome check` on the changed files is clean. - Focused and required: the two PR test files, `tests/cli-spawn-env-isolation.test.ts`, `tests/cli-reference-docs.test.ts`, `tests/integration-ownership.test.ts` and `tests/native- refusal-cli.test.ts`: 63 pass, 0 fail. - `tests/doctor-*.test.ts`, `tests/native-project-adaptation.test.ts` and `tests/native-config- import*.test.ts`: 539 pass, 3 fail. The 3 failures are the capture process-group tests in `tests/native-config-import-build.test.ts` (about 505 ms each). The verifier found the same failures with `origin/next` source, so they come from this host, not this PR. - After `bun run build` and `bun run build:config-compiler`, all six `scripts/check- native-*-plan-cli.ts` exit 0. No native refusal code or message changed. The `E_CONFIG_INVALID` adaptation message is native start's existing one. - gitleaks 8.30.1: no leaks. The scan ran as `gitleaks dir` on a `git log -p origin/next..HEAD` export, because the worktree sandbox blocks `gitleaks git`. - Full `bun run test`: exit 1 after 1 h 27 min on the loaded host. 114 files had failures in the parallel run. A serial rerun of each with `--timeout 60000` left 20 files failing. 19 are authored/adopted native-compose suites, which never reach `handleNativeUp`'s check, and their failures are fixture timeouts and unsettled children. The 20th, `native-env-metadata`, passed 32/32 on a later rerun with this PR's code. As a baseline, `src/commands/project.ts` and `src/commands/doctor.ts` were swapped to the merge base `ec223cdb`. `native-compose-down- command` (1/13), `native-compose-storage-fence-cost` (0/4), `native-compose-retained-storage- command` (0/5) and `native-authored-process-incarnation` (9/1) failed the same way, so these failures are inherited under this load. - The adaptation CLI case also accepts a timed-out or unreadable stub reply (94e12a9). Under load, both appeared in the parallel run, and each is reachable only after the check passed. The original `control: ordinary labels…` case is sensitive to the same load in the parallel run and passes serially. - Hosted CI on 76003b5: every job passed except docker-e2e shards 3 and 4, which hit the same inherited failures as on 9ce0f3b: - Shard 3: the `pattern-p01-dependency-bootstrap` `docker inspect … No such object` race. - Shard 4: `native-config-build` and `native-config-down-hooks` (also failing on the `next` base run 39663080763). The run on 94e12a9 was in progress when this was written. Shards 1–3 and all other completed jobs passed. ## Remaining gaps - The Compose-doctor variant is covered by a unit test of its result, not a CLI run, because the private CLI harness does not stub its Docker-era checks. - Only the explicit `platform` field is classified. An image with no `platform` that publishes only amd64 is still refused later, at native image admission, with the existing image refusal. - Only `.hack/docker-compose.yml` is classified. Compose override files and env-overlay interpolation are not evaluated. An interpolated `platform` such as `${PLATFORM}` is treated as non-native. - The check validates only the `version` and `isolatedNetworks` parts of the adaptation. Native start still validates the rest of the selection, and that each listed name is an external network, in its existing order. A listed network declared in the legacy `external: {name}` form passes this check. Native start's adaptation then decides it as before, because `replaceNetworks` accepts only `external: true` in the normalized file. - Native support for these features stays in HACK-1270. Real Omega acceptance on the M3 has not been run here. Refs HACK-1291 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 7bebe9c commit 69ec78a

8 files changed

Lines changed: 1441 additions & 2 deletions

‎docs/guides/native-candidate.md‎

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,62 @@ finalization checks still apply. Fresh and already branch-scoped graphs keep
170170
their normal branch namespace. This compatibility path does not authorize
171171
adopting an unrelated branch or project.
172172

173+
## Compose projects that stay on the Compose backend
174+
175+
In v5, an unchanged Compose project (`.hack/hack.config.json` with
176+
`.hack/docker-compose.yml`) that uses any of the following features runs on the
177+
Compose backend. Native support for them is planned after v5.
178+
179+
| Compose feature | Kept on the Compose backend when |
180+
| --- | --- |
181+
| External network | A top-level network sets `external: true` or `external: {name: ...}`. A reviewed `x-hack-isolated: true` replacement is not external: it creates an owned internal bridge. A network that the `HACK_NATIVE_ADAPTATION` selection (see [Frontend integration status](#frontend-integration-status)) lists in `isolatedNetworks` gets the same replacement, so it is not external either. |
182+
| Reserved ownership label | A service, network or volume label key starts with `com.docker.compose.`, `io.hack-local.` or `io.hack.native-config.`. Compose, the native runtime and native-config Compose use these labels to prove which resources they own. |
183+
| Build outside the basic form | A service `build` is not the basic form that [`hack config import --dry-run`](../reference/native-config-import.md#pure-basic-build-preview) accepts (a relative context and optional relative `dockerfile` and `target`), or the service also sets `image`. Build arguments, secrets, SSH, cache options, platforms and other build options are outside the basic form. |
184+
| Non-native platform | A service sets a `platform` other than `linux/arm64` or `linux/arm64/v8`, for example `linux/amd64`. The native VM runs Linux arm64 only. |
185+
186+
Native `hack up` and `hack restart` check for these features after selecting the
187+
project and before branch, environment, lifecycle, storage or runtime work. They
188+
refuse with `E_NATIVE_PROJECT_UNSUPPORTED` and one line that names each feature
189+
found, without network names, label keys, paths or platform values. Nothing is
190+
started, stopped or written. Every service is checked, including services outside
191+
the selected profiles.
192+
193+
The check applies the explicit `HACK_NATIVE_ADAPTATION` selection first, as native
194+
start does. An unchanged Compose file whose external network is listed in
195+
`isolatedNetworks` therefore stays on native, and native start replaces that
196+
network with an owned isolated one. The selection is read only when the Compose
197+
file has an external network. If it cannot be read, is not version 1, or its
198+
`isolatedNetworks` is not a list of unique names, the command refuses with the
199+
same one-line `E_CONFIG_INVALID` message native start gives, before any runtime
200+
request.
201+
202+
To run such a project, select the Compose backend:
203+
204+
```sh
205+
HACK_RUNTIME_BACKEND=compose hack up
206+
```
207+
208+
The bundle's `hack-v5` entrypoint and the `hack-next` launcher accept the same
209+
selection; see [Test both backends](https://github.com/hack-dance/hack/blob/next/docs/guides/candidate-install.md#test-both-backends).
210+
211+
Other labels keep their native behavior. Routing (`caddy*`) and dependency cache
212+
(`hack.dependencies.*`) labels are reviewed as before, and other ordinary labels
213+
are refused with the general native configuration refusal. A basic build is also
214+
refused by native image-project `up`, with the general refusal: it needs the
215+
authored native format.
216+
217+
`hack doctor` reports the same features for the current project in its
218+
`compose backend features` check. With `--json`, the check's `composeBackend.features`
219+
lists the closed names `external_network`, `reserved_label`, `unsupported_build`
220+
and `foreign_platform`. On the native backend a found feature is a warning; on
221+
the Compose backend it is informational. Native doctor applies the same
222+
`HACK_NATIVE_ADAPTATION` selection before it reports.
223+
224+
Native `up` and `restart` also stay in the foreground in every project:
225+
`--detach` refuses with one `E_USAGE` line. Run `hack up` in its own terminal and
226+
keep it open, use `hack ps` and `hack logs` from another terminal, and press
227+
Ctrl-C to stop it. For detached startup, use the Compose backend.
228+
173229
## Manual candidate upgrade and rollback
174230

175231
Manual candidate bundles are selected by their full path. The separate
@@ -675,7 +731,9 @@ Without that grant, `up` and `restart` refuse with `E_PERMISSION` before any sto
675731
runtime request; set it and run the command again.
676732

677733
This initial foreground path does not support detached/JSON startup, selected
678-
services or external networks. `--detach`, `--json`, `--target` and service names
734+
services, or the Compose features listed in
735+
[Compose projects that stay on the Compose backend](#compose-projects-that-stay-on-the-compose-backend),
736+
such as external networks. `--detach`, `--json`, `--target` and service names
679737
each refuse with a one-line `E_USAGE` message that names the option and the supported
680738
form: run `hack up` in the foreground in its own terminal and use `hack ps` and
681739
`hack logs` from another. Routed services and host dependencies require the
@@ -1216,7 +1274,9 @@ adaptations are accepted:
12161274
```
12171275

12181276
Networks must already be declared external; selection explicitly replaces their
1219-
connectivity with the owned isolated network. Probes apply only when no existing
1277+
connectivity with the owned isolated network. Native `up`, `restart` and doctor
1278+
then treat those networks as owned, not as external Compose networks (see
1279+
[Compose projects that stay on the Compose backend](#compose-projects-that-stay-on-the-compose-backend)). Probes apply only when no existing
12201280
healthcheck is present. Additional hostnames append to existing Caddy labels.
12211281
Additional host aliases append explicit `host-gateway` declarations and still need
12221282
separate pinned dependency selections; they do not enable general host access or

‎docs/reference/native-config-import.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ projects, read managed environment values or keys, or inspect/change engine
1515
resources. Any refusal discards the private candidate; no partial conversion is
1616
reported as successful.
1717

18+
An unchanged project that uses an external network (one that the
19+
`HACK_NATIVE_ADAPTATION` selection does not list in `isolatedNetworks`), a reserved
20+
ownership label, a build outside the basic form below, or a non-arm64 platform
21+
stays on the Compose backend in v5. Native `up` refuses those features before any work, and
22+
`hack doctor` reports them; see
23+
[Compose projects that stay on the Compose backend](../guides/native-candidate.md#compose-projects-that-stay-on-the-compose-backend).
24+
That check uses the same basic build mapping as this preview.
25+
1826
## Supported subset
1927

2028
| Legacy input | Native mapping |

‎src/commands/doctor.ts‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ import {
7373
checkBrowserLocalNetwork,
7474
parseBrowserNetworkOptions,
7575
} from "../lib/doctor-browser-network.ts";
76+
import {
77+
COMPOSE_BACKEND_CHECK,
78+
type ComposeBackendReport,
79+
composeBackendCheckResult,
80+
} from "../lib/doctor-compose-backend.ts";
7681
import {
7782
describeEnvKeyInspection,
7883
type EnvKeyInspection,
@@ -125,6 +130,7 @@ import {
125130
repairNativeCaTrust,
126131
} from "../lib/native-ca-doctor.ts";
127132
import { selectLegacyComposeAdoptedRoot } from "../lib/native-compose-adoption-command.ts";
133+
import { readComposeBackendFeatures } from "../lib/native-compose-backend-features.ts";
128134
import {
129135
describeHackLocalRoute,
130136
HACK_LOCAL_ROLLBACK_COMMAND,
@@ -207,6 +213,8 @@ interface CheckResult {
207213
readonly hackLocalRoute?: HackLocalRouteReport;
208214
/** Closed, value-free env key findings; project-relative subjects only. */
209215
readonly envKey?: EnvKeyInspection;
216+
/** Closed Compose-backend feature names only; never authored values. */
217+
readonly composeBackend?: ComposeBackendReport;
210218
}
211219

212220
const HACK_LOCAL_ROUTE_CHECK = "native hack.local route";
@@ -863,6 +871,11 @@ const handleDoctor: CommandHandlerFor<typeof doctorSpec> = async ({
863871
checkComposeNetworkHygiene({ startDir })
864872
)
865873
);
874+
results.push(
875+
await runCheck(s, COMPOSE_BACKEND_CHECK, () =>
876+
checkComposeBackendFeatures({ startDir, backend: "compose" })
877+
)
878+
);
866879
results.push(
867880
await runCheck(s, "DEV_HOST", () => checkDevHost({ startDir }))
868881
);
@@ -1189,6 +1202,15 @@ async function handleNativeDoctor(opts: {
11891202
{ timeoutMs: 5000 }
11901203
)
11911204
);
1205+
results.push(
1206+
await runCheck(progress, COMPOSE_BACKEND_CHECK, () =>
1207+
checkComposeBackendFeatures({
1208+
startDir: opts.startDir,
1209+
backend: "native",
1210+
adaptationFile: process.env.HACK_NATIVE_ADAPTATION,
1211+
})
1212+
)
1213+
);
11921214
}
11931215
progress.stop(`Native doctor checks complete (${results.length} checks)`);
11941216
const hasError = results.some((result) => result.status === "error");
@@ -1353,6 +1375,8 @@ export type DoctorJsonCheck = {
13531375
readonly hackLocalRoute?: HackLocalRouteReport;
13541376
/** Present only on the env key check: closed codes, no key bytes or absolute paths. */
13551377
readonly envKey?: EnvKeyInspection;
1378+
/** Present only on the Compose-backend feature check: closed feature names. */
1379+
readonly composeBackend?: ComposeBackendReport;
13561380
};
13571381

13581382
export type DoctorJsonData = {
@@ -1388,6 +1412,9 @@ export function buildDoctorJsonData(opts: {
13881412
? { hackLocalRoute: result.hackLocalRoute }
13891413
: {}),
13901414
...(result.envKey ? { envKey: result.envKey } : {}),
1415+
...(result.composeBackend
1416+
? { composeBackend: result.composeBackend }
1417+
: {}),
13911418
})),
13921419
summary: buildDoctorSummaryLines({ results: opts.results }),
13931420
counts,
@@ -2984,6 +3011,33 @@ export function envKeyCheckResult(inspection: EnvKeyInspection): CheckResult {
29843011
* Read-only key-strength and exposure audit (HACK-1127). `--fix` never acts on
29853012
* it; each finding suggests the exact command instead.
29863013
*/
3014+
/**
3015+
* Reports which Compose features keep the current project on the Compose
3016+
* backend (HACK-1291). Reads only the project's Compose file and, on the native
3017+
* backend, the `HACK_NATIVE_ADAPTATION` selection native up applies. An
3018+
* invalid selection is the same value-free error native up gives.
3019+
*/
3020+
async function checkComposeBackendFeatures(opts: {
3021+
readonly startDir: string;
3022+
readonly backend: "native" | "compose";
3023+
readonly adaptationFile?: string;
3024+
}): Promise<CheckResult> {
3025+
const ctx = await findProjectContext(opts.startDir);
3026+
if (!ctx) {
3027+
return {
3028+
name: COMPOSE_BACKEND_CHECK,
3029+
status: "warn",
3030+
message: `Skipped (no ${HACK_PROJECT_DIR_PRIMARY}/ found)`,
3031+
};
3032+
}
3033+
return composeBackendCheckResult({
3034+
backend: opts.backend,
3035+
features: await readComposeBackendFeatures(ctx.composeFile, {
3036+
adaptationFile: opts.adaptationFile,
3037+
}),
3038+
});
3039+
}
3040+
29873041
async function checkProjectEnvKey({
29883042
startDir,
29893043
}: {

‎src/commands/project.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ import {
220220
resolveShouldTryLoki,
221221
resolveUseLoki,
222222
} from "../lib/logs.ts";
223+
import { refuseNativeComposeBackendFeatures } from "../lib/native-compose-backend-features.ts";
223224
import { tryNativeComposeCommand } from "../lib/native-compose-command.ts";
224225
import { tryNativeComposeOpen } from "../lib/native-compose-open.ts";
225226
import {
@@ -4970,6 +4971,15 @@ async function handleNativeUp({
49704971
projectOpt: args.options.project,
49714972
touchRegistration: false,
49724973
});
4974+
// Before branch, config, env, lifecycle, storage or runtime work. `down`
4975+
// stays available for any graph a project already has.
4976+
// The explicit adaptation applies first: a network it isolates is not
4977+
// external here, exactly as native start normalizes it.
4978+
await refuseNativeComposeBackendFeatures({
4979+
composeFile: project.composeFile,
4980+
adaptationFile: process.env.HACK_NATIVE_ADAPTATION,
4981+
restart,
4982+
});
49734983
const branch = await resolveEffectiveBranchForCommand({
49744984
project,
49754985
branchOption: args.options.branch,

‎src/lib/doctor-compose-backend.ts‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import {
2+
COMPOSE_BACKEND_SELECTION,
3+
type ComposeBackendFeature,
4+
describeComposeBackendFeatures,
5+
} from "./native-compose-backend-features.ts";
6+
7+
/** Doctor check id for the Compose-backend feature report. */
8+
export const COMPOSE_BACKEND_CHECK = "compose backend features";
9+
10+
/** Value-free JSON payload: closed feature names only. */
11+
export type ComposeBackendReport = {
12+
readonly features: readonly ComposeBackendFeature[];
13+
};
14+
15+
/**
16+
* Doctor result for the current project's Compose-backend features
17+
* (HACK-1291). Read-only and value-free: it names closed features, never a
18+
* network, label, path or platform value.
19+
*
20+
* On the native backend a blocking feature is a warning, because native `up`
21+
* refuses the project; on the Compose backend it is informational, because
22+
* the project already runs where those features are supported.
23+
*/
24+
export function composeBackendCheckResult(opts: {
25+
readonly backend: "native" | "compose";
26+
readonly features: readonly ComposeBackendFeature[];
27+
}): {
28+
readonly name: string;
29+
readonly status: "ok" | "warn";
30+
readonly message: string;
31+
readonly composeBackend: ComposeBackendReport;
32+
} {
33+
const composeBackend = { features: [...opts.features] };
34+
if (opts.features.length === 0) {
35+
return {
36+
name: COMPOSE_BACKEND_CHECK,
37+
status: "ok",
38+
message:
39+
"No Compose-only features found; native up still reviews the rest of the configuration when it starts.",
40+
composeBackend,
41+
};
42+
}
43+
const uses = `This project uses ${describeComposeBackendFeatures(opts.features)}`;
44+
if (opts.backend === "native") {
45+
return {
46+
name: COMPOSE_BACKEND_CHECK,
47+
status: "warn",
48+
message: `${uses}, so native up refuses it and the project runs on the Compose backend. ${COMPOSE_BACKEND_SELECTION} to run it there.`,
49+
composeBackend,
50+
};
51+
}
52+
return {
53+
name: COMPOSE_BACKEND_CHECK,
54+
status: "ok",
55+
message: `${uses}, so it stays on the Compose backend; native up refuses these features.`,
56+
composeBackend,
57+
};
58+
}

0 commit comments

Comments
 (0)