Repository navigation
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Ready for lead: #1119 (draft) at Size: about 170 source lines (Rust about 130, TypeScript about 40), plus tests, docs, the model and the chart. Checks run here:
Decisions to flag:
Two failures I did not touch, under your rule: in Not covered: a real VM on a Mac. To check it there:
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.
Where the limit of 8 comes from.
A root that was deleted or moved.
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?
Conclusion.
For the owner:
|
… 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>
|
Ready for lead: #1119 (draft) at Your three points:
Independent review: one reviewer (a Claude subagent, read-only), the same thread for three rounds, ending clean. What its findings changed:
Checks:
The two unrelated 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.
Where the limit of 8 comes from.
A root that was deleted or moved.
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?
Conclusion.
For the owner:
|
…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>
|
Ready for lead: #1119 at
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 |
# Conflicts: # tests/fixtures/native-detached-owner.ts
|
Ready for lead: #1119 at
|
HACK-2535 option 1: a second project can start while the pool runs, if nothing uses the pool.
Before:
hack upin a project root that the running pool does not share refused. The user had to stop every project (downin each), stop the pool by hand (runtime down), and runupagain.Now: when the running pool is idle,
updoes this before any startup hook: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;Idle (
pool_users::require_idle) means all of these:runtime downalready 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_poolchecks idleness under the provider lease, and again right beforeguest_stop.project_share_pool_in_use; it is never stopped.project_share_extension_required, as on any running pool.Refusals:
runtime downis no longer needed.project_share_limitbefore anything stops.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 downkeeps its old order.Names in the refusal:
runtime statusnow reportslive_runs. The CLI maps those run ids through the run mappings of registered projects and their worktrees: Compose.internal/native-runsand 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 (whichhack exec-sessions --reconcileclears 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 addsstopped_idle_pool.Model (
native-pool-stop):RestartCheck,RestartStopandRestartRefused, behind the switchesIdleRestartandSecondCheck.idle-restartpasses in 302 states. It checksNoDeadEnd,RecoversandNoRestartOverLiveRun: a run that became live before the stop is never stopped by it.idle-restart-one-checkdrops the second check and fails, as it should: a start between the checks is stopped.IdleRestart = FALSE).Tests:
pool_users: what counts as idle.share_update: when the pool must be stopped first.boot_sequence_tests: the order indown(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.
SVG · source
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.