Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8757134
perf(native): overlap distinct image archive preparation
roodboi Nov 22, 2026
4f5b08f
merge: integrate next into native image batching
roodboi Nov 22, 2026
cc4d231
fix(native): budget image waits and recover only owned staging
roodboi Nov 22, 2026
1992cbd
fix(native): recover interrupted manifest proof publication (HACK-2555)
roodboi Nov 22, 2026
4b05b76
fix(native): admit image disk use and retain batch failures
roodboi Nov 22, 2026
79634ca
fix(native): preserve stray image staging entries
roodboi Nov 22, 2026
0598a0c
fix: bound startup publication lease waits
roodboi Nov 22, 2026
dbe3281
Merge remote-tracking branch 'origin/next' into codex-hd/native-image…
roodboi Nov 22, 2026
011e97e
fix(models): require the final counterexample state
roodboi Nov 22, 2026
a556090
Merge commit '993744630d' into native-per-service-publication
roodboi Nov 22, 2026
82bf4dd
test: model gated native publication admission
roodboi Nov 22, 2026
9f60135
fix: gate native publisher exec on admission
roodboi Nov 22, 2026
c3020c0
fix: scope native bridge admission to the ready service
roodboi Nov 22, 2026
afd52e0
test: require complete early-bind counterexample
roodboi Nov 22, 2026
e915390
Merge branch 'native-per-service-publication' into native-per-service…
roodboi Nov 22, 2026
64ab8bf
fix: start native publication from service readiness
roodboi Nov 22, 2026
0939bde
fix: retire native publication when authorization fails
roodboi Nov 22, 2026
f51c071
Merge branch 'native-per-service-publication' into native-per-service…
roodboi Nov 22, 2026
ed10188
docs: include checked publication state chart
roodboi Nov 22, 2026
5fa3b2e
Merge branch 'native-per-service-publication' into native-per-service…
roodboi Nov 22, 2026
8791c83
fix: defer early native ports until healthchecks settle
roodboi Nov 22, 2026
36be86b
feat(runtime): report when every service of a native start has started
roodboi Nov 22, 2026
71ad4c6
Merge commit '3f2f00e1b8' into native-per-service-publication
roodboi Nov 22, 2026
43677d4
fix(runtime): keep the started phase behind --report-started and make…
roodboi Nov 22, 2026
4791d04
Merge branch 'native-per-service-publication' into native-per-service…
roodboi Nov 22, 2026
6021cfb
fix(runtime): recover a restored started run across a boot; inert loo…
roodboi Nov 22, 2026
091a40e
fix: observe and retire native ports during startup
roodboi Nov 22, 2026
79c8202
Merge commit '011e97e810' into native-per-service-publication
roodboi Nov 22, 2026
b8ecbe5
fix: preserve publication timing and model contracts
roodboi Nov 22, 2026
0df96b8
Merge branch 'native-per-service-publication' into native-per-service…
roodboi Nov 22, 2026
4a6b37d
Merge commit 'b8ecbe5b0c' into claude-lead/up-started-b-cli
roodboi Nov 22, 2026
1f17dc3
Merge remote-tracking branch 'origin/native-per-service-publication-w…
roodboi Nov 22, 2026
a8fa7ea
feat(native): hack up returns when every container has started; --wai…
roodboi Nov 22, 2026
4471df9
refactor(native): keep the new optional flags out of two functions' c…
roodboi Nov 22, 2026
51f6e40
fix(native): address the PR B review of started returns
roodboi Nov 23, 2026
c2a6132
fix(native): keep the started chain off the provider lease
roodboi Nov 23, 2026
7137f31
fix(native): address the second PR B review of started returns
roodboi Nov 23, 2026
442fd3e
fix(native): publish a slow service's port after a started return
roodboi Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 24 additions & 8 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -1052,10 +1052,22 @@ records what each model does and does not prove.

### Foreground startup owner

A foreground `hack up` on the native backend serves the run until it is ready or
fails. Readiness publishes the run mapping. A failure after resources were created
must leave them owned: either cleanup is confirmed, or the frontend's final
read-only inspection authenticates the owner receipt and records it.
A native `hack up` serves the run until it is ready, fails or is stopped. The run
reaches `started` (every container started, by Compose's rule) before `ready`
(every service goal met). At `started` the owner checks the run's ownership and
saves the run mapping, with or without `--wait`. Without `--wait`, `up` then
commits the down-hook debt and returns, and the run shows as `warming` until it
is ready. With `--wait` it returns at `ready`. A `down` while the run is warming
queues a stop. The owner accepts it between passes of its start loop, which
cancels its wait, and never half-way through a service publication. A failure after resources
were created must leave them owned: either cleanup is confirmed, or the
frontend's final read-only inspection authenticates the owner receipt and
records it.

The run states between started and ready are drawn in
[the owner state chart](https://github.com/hack-dance/hack/blob/next/tests/models/tla/native-startup-owner/state.svg),
and [the model's coverage](https://github.com/hack-dance/hack/blob/next/tests/models/tla/native-startup-owner/COVERAGE.md)
maps each step to the source. The chart below is the failure path.

```mermaid
---
Expand All @@ -1066,19 +1078,22 @@ stateDiagram-v2
[*] --> idle
idle --> serving : Serve
serving --> serving : StartResources
serving --> ready : Ready [resources present]
serving --> started : Started [resources present]
started --> ready : Ready
serving --> failed : Fail
started --> failed : Fail
ready --> failed : Fail
state inspect <<choice>>
failed --> inspect : Inspect
inspect --> exited : ExitConfirmed [cleanup confirmed]
inspect --> exited : ExitUnconfirmed [receipt authenticated, owner recorded]
inspect --> exited : ExitUnconfirmed [receipt refused]
exited --> [*]
note right of ready
note right of started
INV NoUnprovenOwner: a mapping is
published only by readiness or an
authenticated receipt.
published only by the started
inspection or an authenticated
receipt.
end note
note right of exited
INV NoUnownedResources: resources that
Expand All @@ -1089,6 +1104,7 @@ stateDiagram-v2
classDef ok stroke-width:1.6px
classDef fail stroke-width:1.6px
class serving live
class started live
class ready ok
class failed fail
```
Expand Down
52 changes: 48 additions & 4 deletions docs/guides/native-candidate.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,51 @@ commands and pipelines. The command keeps the pane's terminal stdin. Failed send
remove their staged payload; if the pane never executes a successfully sent command,
the private payload remains until it is consumed or explicitly cleaned up.

### Started and ready

Native `hack up` and `hack restart` return once every container has started,
by Compose's rule: running, or exited `0` for a job another service waits on, in
dependency order; `service_healthy` and `service_completed_successfully` edges
still hold their dependents back. Health checks and route probes keep running
after that: the run is **warming** until every goal is met and every route
answers, then **ready**. `--wait` returns at ready, exactly as before, with the
same lines, exit codes and timeout text.

- **At started:** the run mapping is saved first, then `up.after`, the exit
watcher and the down-hook debt; then `up` returns. The HTTPS routes and the
removal of superseded build images wait for ready, because the runtime is
still busy with the start until then. The closing line
counts the routes still warming: `https://web.app.hack up in 4.6s · native ·
2 routes warming`. With `--json`, the result has `readiness: "warming"` (or
`"ready"`) and `services.warming`.
- **`up.after` runs at started,** as with Compose `up -d`. A hook that calls one of
the project's URLs needs `hack up --wait`.
- **While warming:**
- `hack ps` shows a service still waiting on its health check as `warming`;
`ps --json` has `readiness: "warming"`;
- `hack open` opens the route at once, as before; it may not answer until the
run is ready;
- `hack exec` and one-off `hack run` wait for the whole project to be ready
(one line on stderr), then run, so `hack up -d && hack exec api ...` keeps
working;
- `hack logs SERVICE` without `-f` prints what exists so far, in the same
format as for a ready run;
- `hack down` stops the run with data retained; the owner accepts the stop
between start passes, after any publication in progress has committed or
been withdrawn. `hack down --remove-data` waits for ready: stop first, then
remove;
- `hack restart` stops and starts again; a second `hack up` says the project is
already running and names the services still warming.
- **Scripts:** whether `--json` and `--no-interactive` imply `--wait` is one
setting, currently off. Pass `--wait` when a script needs live endpoints.
- **On the Compose backend,** `hack up -d --wait` passes `--wait` to
`docker compose up -d`, which waits for running and healthy services.
`--wait` needs `-d` (or `--json`) there, and `hack restart --wait` is native-only.

Native `hack up -d` (also `--detach`, `--json`, or both) starts the existing
frontend and Rust foreground owners in a background session, returning after
readiness and up-after hooks. The frontend keeps host lifecycle processes and
frontend and Rust foreground owners in a background session, returning once
every container has started and up-after hooks ran (see "Started and ready"
below); `--wait` returns once every service is ready instead. The frontend keeps host lifecycle processes and
down hooks alive. From any terminal, use `hack ps`, `hack logs`, `hack exec`,
`hack restart` or `hack down` through the existing authenticated controls.
When the project is already up, `hack up -d` starts nothing and succeeds: it
Expand Down Expand Up @@ -716,8 +758,10 @@ same incarnation checks and retained-uncertainty limits. No daemon adoption,
automatic replay, or separate graph supervision tick is introduced.

Foreground image-project `up` prints each startup step (input, runtime, images,
services) and one ready line, `Project is ready (SERVICES; run RUN)`, after the
graph is ready and its run mapping is published. Under it, `up` lists each routed
services) and one started line, `Project started (SERVICES; run RUN)`, once every
container has started and its run mapping is published, then `All services ready`
once every goal is met and every route answers. With `--wait` it prints one ready
line, `Project is ready (SERVICES; run RUN)`, at that point instead. Under it, `up` lists each routed
service's reviewed hostnames as HTTPS URLs (with the `HACK_NATIVE_HTTPS_PORT`
port unless it is 443) and the published loopback ports. Without the native
HTTPS frontend it says that routes are not served on this host. Ctrl-C prints the
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ hack up [services...] [options]
| `--progress` | With --json: stream ndjson progress lines before the result envelope (Compose backend) |
| `--refresh-images` | Native backend: refresh the project's mutable image tags from the registry. |
| `--offline` | Native backend: use recorded image resolutions and local archives without contacting a registry. |
| `--wait` | Native: return once every service is ready and every route answers (default: once every container has started). Compose: passed to docker compose up --wait (needs -d) |
| `--always` | Mark this project for machine-local autostart and start it |
| `--no-interactive` | Never prompt: apply documented defaults or fail with E_INTERACTIVE_REQUIRED (also via HACK_NO_INTERACTIVE=1) |
| `--help, -h` | Show help |
Expand Down Expand Up @@ -430,6 +431,7 @@ hack restart [services...] [options]
| `--target <auto|local|remote>` | Execution target routing (auto routes to remote when project execution mode requires it) |
| `--json` | Output JSON (machine-readable) |
| `--progress` | With --json: stream ndjson progress lines before the result envelope (Compose backend) |
| `--wait` | Native only: return once every service is ready and every route answers (default: once every container has started) |
| `--recover-frontend` | Recover an interrupted native frontend after proving its owner and effects are gone |
| `--expect-finalization-attempt <32-hex>` | Require this exact interrupted native frontend attempt |
| `--expect-frontend-pid <pid>` | Previously observed frontend PID (required only for legacy v1 state) |
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/timings.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ when a completed load receipt and live readback satisfy `ensure-image`.
of attempted HTTP sends in that runtime command, including registry
authentication, retries and redirects. A fresh loaded selection reports zero.
`image.tag.record` covers the local receipt read without network transfer.
A batch ensure also includes `attrs.image_index`, the zero-based position in
the batch request, so overlapping spans can be attributed to each image.

## Growing the vocabulary

Expand Down
Loading
Loading