Skip to content

feat(app): make the darwin podman-machine check real and provisioning-aware (RIG-3202) - #1034

Open
rigel-mintaka wants to merge 1 commit into
compass-native/rig-3548-darwin-starttimefrom
compass-native/rig-3202-darwin-machine-ready
Open

feat(app): make the darwin podman-machine check real and provisioning-aware (RIG-3202)#1034
rigel-mintaka wants to merge 1 commit into
compass-native/rig-3548-darwin-starttimefrom
compass-native/rig-3202-darwin-machine-ready

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 2 PRs:

  1. main
  2. feat(stack): read the process identity token via sysctl on darwin (RIG-3548) #1033
  3. "feat(app): make the darwin podman-machine check real and provisioning-aware (RIG-3202)" (this PR)

Embedded preflight guarded the podman-machine check with
GOOS == "darwin" && MachineReady != nil, and realPreflight never
assigned MachineReady. So on a Mac the check did not fail — it VANISHED
from the results, and a caller classifying by result read that as a pass.
A user got an all-green preflight followed by an undiagnosed failure
further down.

Wire a real darwin adapter and close the hole that let it be skipped:

  • The darwin branch keys on GOOS alone. A nil adapter is now reported as a
    failed check naming itself a wiring defect, so a wiring regression can
    no longer turn a broken host into a green preflight. Linux behaviour is
    unchanged (no machine there, check correctly absent).
  • The adapter probes machine ls then machine inspect, and CONNECTS to
    the forwarded API socket rather than stat-ing it, since a stale forward
    from a half-stopped machine satisfies a stat. Three failing states are
    distinguished in the copy — no machine, stopped, running with an
    unreachable socket — each naming the command to run.
  • Provisioning is an ensure step (init/start, then RE-PROBE), mirroring how
    up ensures the image and database rather than gating on them. Readiness
    comes from the re-probe, never from init's exit status. An unclassifiable
    CLI answer provisions nothing: init over a machine whose state cannot be
    read is destructive.
  • Unparseable output classifies as unknown, which is never ready.
    machineStatus's zero value is unknown so a failed classification cannot
    read as ready.
  • The bring-up window now budgets for a cold provision on darwin. A cold
    machine init downloads a VM image before any container image is pulled,
    so the previous 180s ceiling would have deadlined every first launch on
    a fresh Mac and blamed the timeout rather than the download.

The OS is a parameter rather than a build tag, so the exact regression this
closes is testable from a linux host.

The macOS spike has NOT run. Every podman-CLI output shape here is
designed-against-assumption per the record's own convention: the parse
accepts both the Running bool and the State string, and degrades rather
than trusting either. macOS provisioning is not claimed to work.

Refs RIG-3202, RIG-1662.

Co-authored-by: Matt Wilkinson matt@rigel.build

@linear-code

linear-code Bot commented Sep 8, 2026

Copy link
Copy Markdown

RIG-3202

RIG-1662

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-native-rig-3202-darw.compass-eng-docs.pages.dev

Deployed from compass-native/rig-3202-darwin-machine-ready at d924557.

@rigel-mintaka
rigel-mintaka force-pushed the compass-native/rig-3202-darwin-machine-ready branch from ec385c0 to d4202d5 Compare September 8, 2026 21:56
…-aware (RIG-3202)

Embedded preflight guarded the podman-machine check with
`GOOS == "darwin" && MachineReady != nil`, and realPreflight never
assigned MachineReady. So on a Mac the check did not fail — it VANISHED
from the results, and a caller classifying by result read that as a pass.
A user got an all-green preflight followed by an undiagnosed failure
further down.

Wire a real darwin adapter and close the hole that let it be skipped:

- The darwin branch keys on GOOS alone. A nil adapter is now reported as a
  failed check naming itself a wiring defect, so a wiring regression can
  no longer turn a broken host into a green preflight. Linux behaviour is
  unchanged (no machine there, check correctly absent).
- The adapter probes `machine ls` then `machine inspect`, and CONNECTS to
  the forwarded API socket rather than stat-ing it, since a stale forward
  from a half-stopped machine satisfies a stat. Three failing states are
  distinguished in the copy — no machine, stopped, running with an
  unreachable socket — each naming the command to run.
- Provisioning is an ensure step (init/start, then RE-PROBE), mirroring how
  up ensures the image and database rather than gating on them. Readiness
  comes from the re-probe, never from init's exit status. An unclassifiable
  CLI answer provisions nothing and is reported from the first probe: init
  over a machine whose state cannot be read is destructive, and re-probing
  would report the second answer over the first.
- Unparseable output classifies as unknown, which is never ready.
  machineStatus's zero value is unknown so a failed classification cannot
  read as ready.
- The bring-up window now budgets for a cold provision on darwin. A cold
  machine init downloads a VM image before any container image is pulled,
  so the previous 180s ceiling would have deadlined every first launch on
  a fresh Mac and blamed the timeout rather than the download.

The darwin CI lane now runs these tests. They sit behind
`(linux && gtk4) || darwin`, so the untagged moon lane excluded them and
the gtk4 lane's `-run E2E` filter never matched them — the wiring
assertion that catches this exact silent-skip regression ran nowhere. Each
required test is asserted by its own PASS line, since `-run` exits 0 when
it matches nothing.

The OS is a parameter rather than a build tag, so the regression this
closes is testable from a linux host.

The macOS spike has NOT run. Every podman-CLI output shape here is
designed-against-assumption per the record's own convention: the parse
accepts both the Running bool and the State string, and degrades rather
than trusting either. macOS provisioning is not claimed to work.

Refs RIG-3202, RIG-1662.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka force-pushed the compass-native/rig-3202-darwin-machine-ready branch from d4202d5 to d924557 Compare September 8, 2026 22:04
@rigel-mintaka
rigel-mintaka marked this pull request as ready for review September 8, 2026 22:04
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