Skip to content

feat(native): restart an idle running pool to add a second project's folder (HACK-2535) - #1119

Draft
roodboi wants to merge 26 commits into
nextfrom
feat/native-idle-pool-share-restart
Draft

roodboi wants to merge 26 commits into
nextfrom
feat/native-idle-pool-share-restart

Conversation

@roodboi

@roodboi roodboi commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

HACK-2535 option 1: a second project can start while the pool runs, if nothing uses the pool.

Before: hack up in a project root that the running pool does not share refused. The user had to stop every project (down in each), stop the pool by hand (runtime down), and run up again.

Now: when the running pool is idle, up does this before any startup hook:

  1. stops the pool;
  2. adds the root through the journaled stopped-pool share update;
  3. prints one line: Restarting the native runtime to add this project's folder. A detached start's owner hands it to the launcher over the validated owner notice channel, which prints it on stderr;
  4. boots the pool as part of its own start.

Idle (pool_users::require_idle) means all of these:

  • no graph run whose receipt is live: running, starting, restoring, stopping, or a failed start that kept its services;
  • no pending dead-owner recovery;
  • no open interactive session;
  • no image build (runtime down already refuses one, under the same lease).

Anything unreadable counts as in use. Retained and removed runs hold no containers, so they don't count.

No race:

  • lifecycle::stop_idle_pool checks idleness under the provider lease, and again right before guest_stop.
  • Every graph start needs that lease before it creates a container. So a start that turns live between the two checks makes the stop refuse with project_share_pool_in_use; it is never stopped.
  • A start that boots the pool between the stop and the share update makes the update refuse with project_share_extension_required, as on any running pool.

Refusals:

  • A pool in use, a pool starting or stopping, or a running record whose provider is gone refuses before hooks. The message names the down-then-up steps; the hand runtime down is no longer needed.
  • A full or conflicting share set refuses with project_share_limit before anything stops.
  • The same rule applies to a pool started by hand with runtime up.

Nothing changes on a refusal: the first idle check runs under the provider lease before any effect. In idle mode the host-side releases (the managed hostname authority and the pool's publishers) come after the second check, right before the guest stops. Plain runtime down keeps its old order.

Names in the refusal: runtime status now reports live_runs. The CLI maps those run ids through the run mappings of registered projects and their worktrees: Compose .internal/native-runs and native-authored .internal/native-authored-runs. It names up to three projects, then "and N more", and says so when no registered checkout maps a live run. An image build, an open session (which hack exec-sessions --reconcile clears once finished), and a pool that is starting or stopping, or whose provider has exited, each get their own reason.

Recoveries: a completed dead-owner recovery stays in its run directory as history. It does not keep the pool in use; only an unfinished intent or its staging file does.

Runtime command: runtime project-share add --project-share <root> --unfiltered-source --stop-idle-pool --json. Its receipt adds stopped_idle_pool.

Model (native-pool-stop):

  • New actions RestartCheck, RestartStop and RestartRefused, behind the switches IdleRestart and SecondCheck.
  • idle-restart passes in 302 states. It checks NoDeadEnd, Recovers and NoRestartOverLiveRun: a run that became live before the stop is never stopped by it.
  • idle-restart-one-check drops the second check and fails, as it should: a start between the checks is stopped.
  • Every older control is unchanged (IdleRestart = FALSE).

Tests:

  • pool_users: what counts as idle.
  • share_update: when the pool must be stopped first.
  • boot_sequence_tests: the order in down (both idle checks, before the release and right before the stop).
  • native-project-source-preflight.test.ts: the idle restart and its one line, the in-use refusals, and the starting or stopping refusals.

Not covered here: a real-VM run on a Mac, for the idle restart and the time it takes.

idle restart

SVG · source

🤖 Generated with Claude Code


See it in action
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

roodboi and others added 21 commits November 22, 2026 09:42
…524)

`native-run-mapping-release/MappingRelease.tla`: a checkout's run mapping names
the home that owns its run, and a deleted home takes its clean-stop records
with it. `positive` releases when the recorded path no longer holds the home
(absent, not a directory, or another identity) and no process names the path:
`NoStrandedMapping` and `NeverReleaseLive` hold (21 states). `negative` is today
(the clean-stop release from the home's records only), which strands a deleted
home; `path-only` drops the process scan and releases while the home's run is
alive. The residual is a home moved and restarted from its new path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne-home

# Conflicts:
#	docs/reference/v5-model-coverage.md
Deleting a native home that ran a shared project stranded its checkout: the
mapping's clean-stop proof lived in the deleted home, so the foreign-home
refusal pointed at a command that could not work.

A recorded path that no longer holds that home (absent, not a directory, or a
directory of another identity) is now `owner: "gone"` with its own selection
digest, and the refusal names the existing release command. The release scans
this user's processes (`ps` command lines, `lsof` working directories) and
refuses, naming each PID, while any names the old home's path or works inside
it. Otherwise it keeps the mapping, its restart intent and its down-hook journal
in `<scope>.gone-home-release-<sha>.json` (owed hooks are skipped) and removes
them. An unreadable listing refuses.

Residual, said in the refusal and the docs: a home moved and started again from
its new path names only the new path; release again from the moved home.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ot a deleted home (HACK-2524)

Lead review of #1104:
- lsof exits 1 both for "some process unreadable" and for a failed run with no
  output, so an empty listing could read as "no process". Each listing must now
  show this very process (its pid in ps, its working directory in lsof), or the
  scan refuses.
- An absent home path may be a disk that is not mounted. The refusal no longer
  says the data went with the home: it says the home is not at that path any
  more, and to mount the disk and stop the run there instead. When the topmost
  missing directory sits directly under /Volumes, /mnt, /media or
  /run/media/<user>, inspection adds `missingVolume` and the text names it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…efusal (HACK-2524)

Mac review of #1104: `doctor --native-run-mapping release` on an instance with no
mapping printed a raw ENOENT and a stack (readRecoveryFile in the selection). Both
release paths (stopped home and gone home) now select through one helper that
refuses: no mapping to release for this instance, nothing changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er a listener (HACK-2550)

`native-pool-stop` adds the shared HTTPS port: the retired owner's Caddy leaves
it in TIME_WAIT until `TimeWaitEnds`, and another process may `Listen` on it
(a bounded fault) and later exit. The archive claims the port only when
`PortClaimable`: with `ReuseBind` a reuse bind passes over TIME_WAIT, and
`ListenerCheck` refuses any other listener. `https` now passes in 608 states,
including the new `NoArchiveOverListener`. The new control `reuse-no-check`
(reuse bind without the listener check) archives over a live listener.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er check (HACK-2550)

After a pool stop, the previous-boot archive waited up to about 30 s for the
retired Caddy's connections to leave TIME_WAIT: its wildcard guard bind had no
address reuse. On macOS the guards now bind with SO_REUSEADDR (never
SO_REUSEPORT), which passes over TIME_WAIT but not over a live wildcard or
loopback listener. Then `/usr/sbin/netstat -an -p tcp` (fixed path, clean
environment, 5 s bound) must list exactly this process's four guard listeners
on the port; any other listener, a missing guard, or a list that cannot be
read or parsed falls back to the strict claim and its 35 s retry. Other hosts
keep the strict claim.

Tests: the netstat parser (TIME_WAIT and other ports ignored, a specific or
dual-stack listener reported, torn output unreadable) runs everywhere; a macOS
test leaves the port in TIME_WAIT, checks the strict claim refuses, and claims
it at once, and a live loopback listener still refuses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to fix/native-https-port-time-wait

# Conflicts:
#	docs/reference/v5-model-coverage.md
… TCP listener list (HACK-2550)

macOS 27 returns an empty TCP table, with a success status, to netstat
started by a program that is not part of the system, so the listener
list always fell back to the strict claim and the 30 s TIME_WAIT wait
stayed. The reuse claim now binds, with SO_REUSEADDR and never
SO_REUSEPORT, the wildcard, the loopback and every interface address
from getifaddrs exactly (IPv6 link-local with its scope id). Another
listener on any of them refuses that bind; TIME_WAIT does not. The
addresses are listed again after binding and must match; an address the
kernel will not bind now (EADDRNOTAVAIL) is skipped. Any other failure
falls back to the strict claim.

Tests (macOS): listeners on an interface address with SO_REUSEADDR,
SO_REUSEPORT, both or neither refuse; a wildcard SO_REUSEPORT listener
refuses; an address change between the listings refuses; the first
refusal of each claim is named.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rds included (HACK-2550)

The descriptor count compares with the guards returned, which now hold one
per bindable interface address. The claim's comment states that its socket
count is bounded by the host's interface addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… into feat/native-idle-pool-share-restart

# Conflicts:
#	tests/models/tla/native-pool-stop/PoolStop.tla
…folder (HACK-2535)

A running pool's mounts never change, so `up` in a project root the pool
does not share refused until every project was stopped and the pool was
stopped by hand. When nothing uses the running pool live, `up` now stops
it, adds the root through the journaled stopped-pool share update, prints
one line ("Restarting the native runtime to add this project's folder,
about 30 s.") and boots it as part of its own start.

Idle (`pool_users::require_idle`): no graph run whose receipt is live, no
pending dead-owner recovery, no open interactive session, and no image
build. `lifecycle::stop_idle_pool` checks it under the provider lease and
again right before the guest stops; every graph start needs that lease
before it creates a container, so a start that turns live meanwhile makes
the stop refuse (`project_share_pool_in_use`) instead of being stopped. A
full or conflicting share set refuses before anything stops. A pool in
use, or one starting or stopping, refuses as before with the down-then-up
steps (no hand `runtime down` any more). The same rule applies to a pool
started by hand.

Model: native-pool-stop gains `idle-restart` (302 states, invariant
`NoRestartOverLiveRun`) and the failing control `idle-restart-one-check`
without the second check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hack-docs Ready Ready Preview Nov 22, 2026 10:00pm UTC

Request Review

@linear-code

linear-code Bot commented Nov 22, 2026

Copy link
Copy Markdown

HACK-2535

@roodboi

roodboi commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: #1119 (draft) at 353378e452, the HACK-2535 idle-pool restart. ls-remote matches. The base is next 3f2f00e1b8, with #1111 at 241e65dca5 merged in; that includes #1104. The PR body covers the behaviour, the model and the chart.

Size: about 170 source lines (Rust about 130, TypeScript about 40), plus tests, docs, the model and the chart.

Checks run here:

  • Linux clippy and aarch64-apple-darwin --all-targets clippy are clean.
  • The Rust tests in lifecycle, share_update and pool_users pass.
  • CLI typecheck passes.
  • Biome reports no errors on the changed files. Its three complexity warnings in native-project-start.ts were there before this change.
  • native-project-source-preflight.test.ts passes.
  • test:models passes: idle-restart verified, and idle-restart-one-check fails as it should.
  • Chart native-idle-pool-restart: check-labels PASS, SVG plus 2x PNG.

Decisions to flag:

  • One line, after the stop. The line prints once the stop and the share add have succeeded, before the boot. If it printed before, a refused stop would first say "Restarting".
  • What counts as in use. In use means: a live receipt, a pending dead-owner recovery, an open exec session, or an image build. Retained and removed runs don't count. Environment leases don't count either; they belong to graph runs, and a live run is already counted.
  • Not stopped from here: a pool that is starting or stopping, and a running record whose provider is gone. Both refuse as before.
  • The refusal text no longer asks for a hand runtime down. After down in the other projects, up restarts the idle pool itself.
  • One test edit in this PR's own subject: boot_sequence_tests::down_reads_the_memory_peak_before_the_stop_and_keeps_it_only_after reads the source of down, whose signature changed. It now also checks where both idle checks sit.

Two failures I did not touch, under your rule: in tests/native-project-start.test.ts, "a release from another home refuses while the owning home admits a retained startup" and "a release that wins before admission makes the retained startup refuse before runtime effects". Both fail on this host on plain next 3f2f00e1b8 too, with or without my TMPDIR. The error comes from native-project-run.ts recoveryDirectories. CI will show whether they fail there as well.

Not covered: a real VM on a Mac. To check it there:

  1. Run up in project A.
  2. Run down in A, so the pool stays running and idle.
  3. Run up in project B. Expect the one line, then B ready.
  4. With A up, run up in B. Expect a refusal before hooks.

HACK-2535 option 3: share the known projects at every boot (assessment, no code)

Idea. When the pool boots, the share set is the projects the registry knows, most recently used first, up to the limit. Then a second known project starts on the running pool without a restart. The idle restart (this PR) stays for a root that isn't in the set.

Cost per share at boot: not measured.

  • Each share is one provider filesystem device (virtio-fs), passed at boot as one mount argument and mounted by the guest under its own tag.
  • What I expect, with nothing measured:
    • a little boot time per device and guest mount;
    • a small fixed amount of memory per device (queues and a server thread in the provider process);
    • file handles: the device holds descriptors for files the guest has looked up, so their number grows with the files containers touch, not with the number of shares.
  • An idle share should be cheap, but that is not proven. To measure on both Macs: boot with 1 share and with 8, and compare:
    • time to running;
    • the provider's resident memory;
    • lsof -p <provider pid> | wc -l at idle and after one project's up.

Where the limit of 8 comes from.

  • It is our own constant (project_share.rs MAX_PROJECT_SHARES, added in feat(native): merge train batch 4 (#602, #603, #589, #599, #604, #600) #633) with the note "one provider filesystem device for the life of the machine".
  • I found no provider limit behind it in this repository.
  • Raising it to 32 needs:
    • the provider's device ceiling, from upstream libkrun and smolvm: virtio-mmio slots and interrupt lines on arm64, shared with the disks, net, vsock and console devices;
    • the provider's open-file limit, at 32 devices under load;
    • boot audit time, since every share's record and identity is checked at each boot;
    • the model bound (multi-root-share MaxShares) and its controls rechecked;
    • the guest mount script and the doc text.
  • Unknown until the provider ceiling is checked: whether 32 is possible at all.

A root that was deleted or moved.

  • Today boot refuses with project_share_stale while any share's root has moved or changed. With option 3, any deleted or moved registered project would make every boot refuse.
  • So the set must be computed while the pool is stopped, right before the boot, and include only roots that:
    • still exist with their recorded identity;
    • still have their consent (below).
  • Stale shares are removed through the journaled stopped-pool update first.
  • A stale share that a retained graph still names can't be removed (project_share_in_use), so it keeps refusing as today. It needs that project's own cleanup.

Linked worktrees. Each worktree is its own root, with an exact canonical path. So every worktree takes a share. A user with a few active worktrees fills 8 quickly, so recent-first ordering matters. Worktrees of one repository can't share one device without a parent mount, which is option 2 and its exposure.

Reachable from a container?

  • Not through admitted configuration: each graph binds only the share whose root equals its own reviewed source (project_share_for), and every bind path stays under that share.
  • But every share is mounted read-write in the guest. Anything with guest-level access can read and write every shared root, including ignored files and .env files:
    • the guest agent;
    • guest root;
    • a container escape.
  • Native is documented as not a sandbox, but option 3 widens that from "projects you started" to "every registered project, up to the limit".
  • Consent: today each share needs that project's unfiltered-source consent. Option 3 must include only projects whose machine settings already grant it, and never ask for consent on another project's behalf.

Conclusion.

  • Option 3 makes the common case free for known projects that have already consented. It exposes less than a parent folder, but still more than today: every registered project is in the guest while any one runs.
  • It is worth doing behind an explicit per-machine opt-in, after two things:
    • the per-share costs are measured on both Macs;
    • the provider's device ceiling is known.
  • It does not replace the idle restart, which still serves a project that isn't registered and a set that is full.

For the owner:

  1. Is every registered, consented project mounted in the guest acceptable while any one project runs?
  2. Should it be on by default, or a per-machine opt-in?

roodboi and others added 3 commits November 22, 2026 20:57
… name the projects that keep it in use (HACK-2535)

Review of #1119:
- In idle mode the host-side releases of a stop (the managed hostname
  authority and the pool's publishers) now follow the second idle check,
  right before the guest stops. The first check runs under the lease
  before any effect, so a refusal at either check changes nothing. Plain
  `runtime down` keeps its order.
- `runtime status` reports `live_runs`, the live graph run ids. The
  in-use refusal maps them through the run mappings of registered
  projects and their worktrees, names up to three, then "and N more", and
  says so when no registered checkout maps a live run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…native-authored runs are named (HACK-2535)

Independent review of #1119:
- A dead-owner recovery intent stays in its run directory as history once
  complete. Only an intent without `complete_sha256`, or its staging
  file, is pending; an unreadable intent still refuses.
- The in-use names read native-authored run mappings too
  (`.internal/native-authored-runs`).
- An image build (`provider_busy`) refuses with its own reason; an open
  session names `hack exec-sessions --reconcile`; a running record whose
  provider exited is no longer called "starting or stopping" only.
- Wording: the lease is held from the first idle check to the stop, so a
  start in between waits for it. The model stays deliberately more
  permissive (a start may turn live between the checks), which is what
  `idle-restart-one-check` shows the second check guards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…CK-2535)

Re-review of #1119: native-authored mappings are `{ scope, record }`; the
ready record names its run at `record.receipt.review.provenance.run`, the
start record at `record.review.provenance.run`. Only those two file kinds
are read in that store, so host-process records are no longer matched by
accident. The fixture now uses the real shapes. The model README row says
the failing control needs a start that took no lease.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roodboi

roodboi commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: #1119 (draft) at 5823c93470. ls-remote matches.

Your three points:

  1. Nothing changes on a refusal. These effects used to come between the two idle checks: the managed hostname authority stop and the release of the pool's publishers (publication::release). In idle mode both now follow the second check, right before guest_stop. The first check runs under the lease, before any effect. Before the second check there are only reads: verify_live, the guest memory-peak read, and the stop's host sample, which is settled only after the stop. So a refusal at either check has changed nothing. Plain runtime down keeps its old order. boot_sequence_tests and pressure_tests check the order in the source.
  2. The refusal names the projects.
    • runtime status reports live_runs. On an in-use refusal the CLI reads it and maps the run ids through the run mappings of registered projects and their worktrees (native-pool-run-names.ts). It reads the Compose .internal/native-runs and the native-authored .internal/native-authored-runs, the latter with its real {scope, record} shape.
    • It names at most three, then "and N more"; N also counts runs no checkout maps. With none mapped it says "N live project runs that no registered project's run mapping names".
    • An open session (with hack exec-sessions --reconcile), an image build (provider_busy), and a pool starting or stopping or whose provider has exited each get their own reason.
  3. fix(native): claim the HTTPS port over TIME_WAIT with a kernel listener check (HACK-2550) #1111: 241e65dca5 was already merged in, through merge 01102d0be; git merge-base --is-ancestor 241e65dca5 HEAD holds. No change needed.

Independent review: one reviewer (a Claude subagent, read-only), the same thread for three rounds, ending clean. What its findings changed:

  • A bug, fixed: a completed dead-owner recovery left dead-owner-cleanup.json in place as history, so the pool counted as in use forever after any recovery. Now only an intent without complete_sha256, or dead-owner-cleanup.pending, counts. The test covers null, completed, staging and torn intents.
  • A naming bug, fixed: live native-authored runs were never named, and then were briefly matched by the wrong field. They now use the real record paths, and the fixture includes a decoy file that must not match.
  • Wording, fixed:
    • Its point: the lease is held from the first check to the stop, so a start in between waits for it. The code comments and the guide now say so, and the second check is described as a second guard.
    • The model stays deliberately more permissive (a start may turn live without the lease). The README says idle-restart-one-check shows what the second check guards on its own, not a race the code has.
  • Accepted, no change:
    • If the share update fails after a successful stop, the pool stays stopped without the share; the next up takes the stopped-pool path.
    • stopped_idle_pool: true is reported when someone else stopped the pool just before.

Checks:

  • Linux clippy and aarch64-apple-darwin --all-targets clippy are clean.
  • The Rust tests in lifecycle, share_update and pool_users pass: 147 plus 8 in pool_users.
  • CLI typecheck and Biome pass on the changed files.
  • native-pool-run-names.test.ts and native-project-source-preflight.test.ts pass (9).
  • TLC: idle-restart passes in 302 states, and idle-restart-one-check violates NoRestartOverLiveRun.
  • The chart was re-rendered: check-labels PASS, SVG plus 2x PNG.

The two unrelated native-project-start.test.ts failures from my last note fail on next too, and I didn't touch them.

Not covered: the real-VM scenario you queued.


HACK-2535 option 3: share the known projects at every boot (assessment, no code)

Idea. When the pool boots, the share set is the projects the registry knows, most recently used first, up to the limit. Then a second known project starts on the running pool without a restart. The idle restart (this PR) stays for a root that isn't in the set.

Cost per share at boot: not measured.

  • Each share is one provider filesystem device (virtio-fs), passed at boot as one mount argument and mounted by the guest under its own tag.
  • What I expect, with nothing measured:
    • a little boot time per device and guest mount;
    • a small fixed amount of memory per device (queues and a server thread in the provider process);
    • file handles: the device holds descriptors for files the guest has looked up, so their number grows with the files containers touch, not with the number of shares.
  • An idle share should be cheap, but that is not proven. To measure on both Macs: boot with 1 share and with 8, and compare:
    • time to running;
    • the provider's resident memory;
    • lsof -p <provider pid> | wc -l at idle and after one project's up.

Where the limit of 8 comes from.

  • It is our own constant (project_share.rs MAX_PROJECT_SHARES, added in feat(native): merge train batch 4 (#602, #603, #589, #599, #604, #600) #633) with the note "one provider filesystem device for the life of the machine".
  • I found no provider limit behind it in this repository.
  • Raising it to 32 needs:
    • the provider's device ceiling, from upstream libkrun and smolvm: virtio-mmio slots and interrupt lines on arm64, shared with the disks, net, vsock and console devices;
    • the provider's open-file limit, at 32 devices under load;
    • boot audit time, since every share's record and identity is checked at each boot;
    • the model bound (multi-root-share MaxShares) and its controls rechecked;
    • the guest mount script and the doc text.
  • Unknown until the provider ceiling is checked: whether 32 is possible at all.

A root that was deleted or moved.

  • Today boot refuses with project_share_stale while any share's root has moved or changed. With option 3, any deleted or moved registered project would make every boot refuse.
  • So the set must be computed while the pool is stopped, right before the boot, and include only roots that:
    • still exist with their recorded identity;
    • still have their consent (below).
  • Stale shares are removed through the journaled stopped-pool update first.
  • A stale share that a retained graph still names can't be removed (project_share_in_use), so it keeps refusing as today. It needs that project's own cleanup.

Linked worktrees. Each worktree is its own root, with an exact canonical path. So every worktree takes a share. A user with a few active worktrees fills 8 quickly, so recent-first ordering matters. Worktrees of one repository can't share one device without a parent mount, which is option 2 and its exposure.

Reachable from a container?

  • Not through admitted configuration: each graph binds only the share whose root equals its own reviewed source (project_share_for), and every bind path stays under that share.
  • But every share is mounted read-write in the guest. Anything with guest-level access can read and write every shared root, including ignored files and .env files:
    • the guest agent;
    • guest root;
    • a container escape.
  • Native is documented as not a sandbox, but option 3 widens that from "projects you started" to "every registered project, up to the limit".
  • Consent: today each share needs that project's unfiltered-source consent. Option 3 must include only projects whose machine settings already grant it, and never ask for consent on another project's behalf.

Conclusion.

  • Option 3 makes the common case free for known projects that have already consented. It exposes less than a parent folder, but still more than today: every registered project is in the guest while any one runs.
  • It is worth doing behind an explicit per-machine opt-in, after two things:
    • the per-share costs are measured on both Macs;
    • the provider's device ceiling is known.
  • It does not replace the idle restart, which still serves a project that isn't registered and a set that is full.

For the owner:

  1. Is every registered, consented project mounted in the guest acceptable while any one project runs?
  2. Should it be on by default, or a per-machine opt-in?

…ut a time figure (HACK-2535)

Real-VM run of #1119: in `up -d` the source preflight runs in the
detached owner, whose standard error does not reach the person, so the
restart line was never shown. It now goes through the owner's validated
notice channel (`reportNativeImageTagOffline`, the image notice's
channel), which the launcher prints on standard error, so `--json`
stdout stays clean; a foreground start still prints it directly. The
whole second `up` took 6 s there, so the line no longer names a time.

Test: the detached-owner fixture's `pool-restart-notice` mode runs the
real preflight in the owner; the launcher shows exactly the line on
stderr and its JSON envelope on stdout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roodboi

roodboi commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: #1119 at 89329ee0c1 (ls-remote matches). Both real-VM fixes are in.

  1. The line in a detached start. The preflight's notice now goes through the owner's validated notice channel. On next that channel is called reportNativeImageTagOffline; perf(native): overlap distinct image archive preparation #1082 renames it to reportNativeImageNotice and changes its kind to image-notice. The launcher prints the line on stderr, so stdout stays clean; outside a detached start it falls back to deps.warn, the same as the image notice.
  2. No time figure. The line is now Restarting the native runtime to add this project's folder.. The figure is also gone from the guide, the two v5 pages, the chart (re-rendered, check-labels PASS, SVG plus 2x PNG) and the PR body.

Also passing: the preflight and run-name tests (9), CLI typecheck, and Biome (no errors; 4 complexity warnings in functions that already had them). No Rust change since 5823c93470. Ready for your rerun of the scenario.

# Conflicts:
#	tests/fixtures/native-detached-owner.ts
@roodboi

roodboi commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: #1119 at 9df10d370b (ls-remote matches).

  • I merged perf(native): overlap distinct image archive preparation #1082's head 011e97e810 normally. The only conflict was the fixture's import block, and I kept both sides.
  • My two call sites now use reportNativeImageNotice, the image-notice channel: native-project-source-preflight.ts writeNotice and the notice sink the preflight gets in native-project-start.ts. Neither the fixture nor the test used the old name; they go through the preflight. No old name is left in src or tests.
  • Root bun run typecheck with Bun 1.4.4 passes (exit 0).
  • native-detached-up, native-project-source-preflight and native-pool-run-names pass: 49 tests, 0 failures. That includes the pool-restart-notice fixture mode.
  • Biome reports no errors. The warnings are complexity warnings in functions this change doesn't touch, plus one in the fixture owner (22, over the limit of 20) where I added a call to my preflight mode.

This branch has not been deployed

No deployments
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