Skip to content

fix: publish native ports as services become ready - #1101

Open
roodboi wants to merge 10 commits into
native-per-service-publicationfrom
native-per-service-publication-wiring
Open

roodboi wants to merge 10 commits into
native-per-service-publicationfrom
native-per-service-publication-wiring

Conversation

@roodboi

@roodboi roodboi commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #1090. In native graph foreground startup and initial restore, the scheduler keeps its lease and publishes one ready service at a time. The runtime stages the gated child, commits its identity, rechecks the target, and authorizes exec. Loopback services with an engine healthcheck still starting defer without reserving; the owner retries them before aggregate readiness. Explicit-slot runs retain batch reservation. The return condition for up is unchanged.

The project-scoped startup observation selects a read-only runtime query. ps and open expose a loopback address only after the runtime observes its exact publication. open reports that the project is still starting when a requested address is unavailable. HTTPS frontend acquisition remains at aggregate readiness; an early Unix relay observation is not public HTTPS reachability.

Startup failure and cancellation retire the run's publications before guest relay cleanup. A committed child that has not bound its control socket gets a bounded wait for exact exit or normal authenticated stop. Recovery preserves other runs. The model checks 669 states and witnesses an already-authorized child binding after owner death.

Expected larger-fixture improvement is about 12–15 seconds for six of seven listener observations, less their own publication work. The two-service baseline is about 0.38 seconds from aggregate readiness to port answer; a material gain there is not expected. Live Mac qualification is pending.

@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 23, 2026 2:04am UTC

Request Review

@roodboi
roodboi marked this pull request as ready for review November 22, 2026 19:45
@roodboi

roodboi commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: 091a40e

  • Bun frozen install, root typecheck and root check passed. Focused TypeScript tests: 517 passed, 0 failed.
  • Linux Rust 1.97.1 formatting, Clippy and runtime library suite passed: 1574 passed, 0 failed, 46 ignored. The scheduler fixture opens a real loopback listener through a fake driver before the second service is ready.
  • Apple Silicon cross-check of the runtime, binaries and tests with native-stream-relay passed. Live Mac tests are pending.
  • TLC: 669 distinct states, no errors. Both safety controls fail at their intended transitions; the reachability control observes a post-death bind only after authorization. SVG updated; the revised chart still needs browser qualification.
  • Privacy check passed. Gitleaks found no leaks.

Mac qualification: use an isolated debug candidate and a two-service fixture with two distinct loopback ports, one immediate HTTP response and one held in healthcheck starting. Keep a separate run published as a control. Before releasing the slow service, check that the first port answers, ps reports only the verified publication, open fast selects it, open slow says the project is still starting, and up has not returned. Release the healthcheck, wait for ready and run down. Repeat with Ctrl-C and with a late bind conflict on the slow port; verify earlier ports close and foreign listeners survive.

Repeat with a fresh run per debug fault point: publisher-gated, publisher-committed, publisher-authorized, publisher-bound. Wait for the exact graph fault marker, kill only that fixture's foreground owner, then run down --recover. Before authorization, EOF must prevent bind. At authorized, the child may bind after owner death and recovery must stop it. At bound, recovery uses the existing authenticated stop. Verify no fixture listener or publisher remains, its publications retire, and the separate run still answers.

HTTPS frontend acquisition remains at aggregate readiness. Early Unix relay observation is not public HTTPS reachability.

@roodboi

roodboi commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: 0df96b8

Merged the corrected #1090 head b8ecbe5 normally. Verified exact remote head with ls-remote. Root typecheck passed. Focused TypeScript tests 526 passed, 0 failed. Linux Rust timing contract 8 passed, bridge tests 37 passed, scheduler tests 14 passed. The stricter TLC reader accepted all four per-service checks, including the post-authorization owner-death witness. Privacy and Gitleaks passed.

The isolated Mac scenarios from the previous ready note still apply on this head. Live stop, Ctrl-C, fault injection, and timing measurements remain pending.

@roodboi

roodboi commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Ready for lead: b8e9789

  • Frozen install, root typecheck and lint passed. Focused startup and down tests: 258 passed, 0 failed with umask 022.
  • Pinned Rust check:local and test:local passed. The library reported 1,580 passed, 0 failed, 47 ignored, and the crate integration suites passed. The Apple Silicon all-features test target cross-checked.
  • Full test:models passed. Per-service publication explored 811 distinct states and all three controls produced their expected witnesses. Updated chart is available as SVG. The revised chart still needs a browser-rendered PNG.
  • Staged privacy check and commit gitleaks scan passed. Branch SHA verified against the remote.

The pre-confirmation refusal predates this PR. Same-boot recovery now accepts an unfinished receipt with provable process and resource identity. An uncommitted child exits on EOF. Committed children are retired by the existing run-scoped publication journal before guest cleanup. Cleanup retains data and refuses incomplete ownership evidence. The refusal links to the manual fresh-home path for an independent checkout.

Linux shell syntax and the stubbed harness passed all four owner-kill rows. Real VM recovery at gated, committed, authorized and bound is pending on the Mac. No VM ran here.

@roodboi

roodboi commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Lead read of b8e9789 (the change since 0df96b8, read in full) and a real-VM pass on this head: the release scenario and all four kill barriers recover with down --recover (about 11 s each), the other project's publication answering throughout. The recovery now also accepts a run that was preparing or restoring when every binding is Prepared or Completed; ProvisionIntent stays excluded. Accepted.

It conflicts with the tested set that merges first (live owner cleanup, startup, down and start). After that set is in, this branch merges next once and the two scenarios run again on the merged head before it joins a batch.

🤖 Generated with Claude Code

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