You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/vrs/03-host-local/spec.md
+28-28Lines changed: 28 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,22 +7,22 @@ policy, or a second Doctor health model.
7
7
8
8
## Subject selection and ownership
9
9
10
-
The CLI selects a catalog and an explicit or locally detected host. A
11
-
[`HostLock`](../../../src/host_lock.rs#L1-L67) tracks resident ownership of
12
-
that `(catalog, host)` subject independently from another host's slice of the
13
-
same synced catalog.
10
+
The CLI selects a catalog and an explicit or locally detected host.
11
+
[`HostOwnership`](../../../src/host_lock.rs) canonicalizes that subject and
12
+
retains its host-scoped kernel `flock` for the resident writer's lifetime,
13
+
independently from another host's slice of the same synced catalog.
14
14
15
15
## Current mechanism and evidence
16
16
17
17
| Requirement | Current mechanism | Evidence |
18
18
| --- | --- | --- |
19
-
| HOST-R01 | Reconciliation filters every declaration through its resolved host; remote declarations are reported but not acted on. |[`reconcile`](../../../src/reconcile.rs#L106-L191); [host-placement tests](../../../tests/reconcile.rs#L135-L153)|
20
-
| HOST-R02 | One pass discovers declarations, obtains an authoritative local session view, computes desired versus actual, and then adopts or executes the plan. A failed session listing skips the whole pass. |[reconcile pass](../../../src/run.rs#L737-L813); [reconcile-plan model](../../../src/reconcile.rs#L66-L81)|
21
-
| HOST-R03 |The long-running CLI checks for a live owner of the same catalog and host, records its own PID, and reclaims stale ownership. |[catalog supervisor entry](../../../src/main.rs#L1738-L1838); [`HostLock` tests](../../../src/host_lock.rs#L83-L143)|
22
-
| HOST-R04 | PTY and exec tasks survive normal or forced control-plane termination and binary replacement; the successor preserves PID and creation identity while adopting them. |[replacement acceptance](../../../tests/nomad_survival.rs#L592-L701)|
23
-
| HOST-R05 | Normal supervisor exit leaves tasks running. Teardown and retirement are separate paths that target only the selected host's declared task IDs. |[`down` and teardown](../../../src/run.rs#L987-L1056); [explicit-lifecycle acceptance](../../../tests/nomad_survival.rs#L703-L780)|
24
-
| HOST-R06 | The deterministic loop surfaces bounded crash-loop failure to the declared supervisor; the root-agent responsibility itself is owned by root R04. |[crash-loop surfacing](../../../src/run.rs#L1090-L1189); [R04](../requirements.md#L43-L46)|
25
-
| HOST-R07 | Agent/task liveness and the resident supervisor lock are separate observations. A replacement adopts matching work visible in its selected current state. Sidecar-only work does not make an otherwise unrunnable agent live. No global catalog-liveness classifier is implemented. |[replacement adoption](https://github.com/compoundingtech/st2/blob/661c88b6e50cddbdf85e8ffaca9245c46491a1e0/tests/nomad_survival.rs#L608-L717); [separate supervisor report](https://github.com/compoundingtech/st2/blob/661c88b6e50cddbdf85e8ffaca9245c46491a1e0/src/main.rs#L985-L1008); [DING-only boundary](https://github.com/compoundingtech/st2/blob/661c88b6e50cddbdf85e8ffaca9245c46491a1e0/tests/reconcile.rs#L533-L561)|
19
+
| HOST-R01 | Reconciliation filters every declaration through its resolved host; remote declarations are reported but not acted on. |[`reconcile_selected`](../../../src/reconcile.rs); [`other_host_specs_are_skipped`](../../../tests/reconcile.rs)|
20
+
| HOST-R02 | One admitted pass discovers declarations, obtains an authoritative local runtime view, computes desired versus actual, and then adopts or executes the plan. A failed session listing skips the whole pass. |[`reconcile_pass_admitted`](../../../src/run.rs); [`up_once_marks_a_list_failure_as_a_skipped_pass`](../../../tests/run.rs)|
21
+
| HOST-R03 |`HostOwnership` canonicalizes one catalog/host subject and retains its persistent-inode kernel `flock`; a simultaneous second claim refuses. PID text is diagnostic only. |[`HostOwnership` and `HostLock`](../../../src/host_lock.rs); [ownership tests](../../../src/host_lock.rs)|
22
+
| HOST-R04 | PTY and exec tasks survive normal or forced control-plane termination and binary replacement; the successor preserves PID and creation identity while adopting them. |[replacement acceptance](../../../tests/nomad_survival.rs)|
23
+
| HOST-R05 | Normal supervisor exit leaves tasks running. Teardown and retirement are separate paths that target only the selected host's declared task IDs. |[`down` and teardown](../../../src/run.rs); [explicit-lifecycle acceptance](../../../tests/nomad_survival.rs)|
24
+
| HOST-R06 | The deterministic loop surfaces bounded crash-loop failure to the declared supervisor; the root-agent responsibility itself is owned by root R04. |[`surface_crash_loop`](../../../src/run.rs); [crash-loop acceptance](../../../tests/run.rs); [R04](../requirements.md#L43-L46)|
25
+
| HOST-R07 | Agent/task liveness and resident supervisor ownership are separate observations. A replacement adopts matching work visible in its selected current state. Sidecar-only work does not make an otherwise unrunnable agent live. No global catalog-liveness classifier is implemented. |[replacement adoption](../../../tests/nomad_survival.rs); [supervisor reporting](../../../src/main.rs); [DING-only boundary](../../../tests/reconcile.rs)|
26
26
| HOST-R08 | Stable catalog-root and PTY-root path lifetime is an accepted constraint. The guided coordinated relocation operation is not implemented. |[migration contract](https://github.com/compoundingtech/st2/issues/85)|
27
27
28
28
## Catalog liveness and path lifetime
@@ -52,29 +52,29 @@ paths and never scan arbitrary old roots.
52
52
53
53
## Partition boundary
54
54
55
-
The root [R18–R19](../requirements.md) contract requires a complete,
56
-
validated, locally applied catalog to remain authoritative through transport
57
-
loss. The current reconciler instead discovers the live catalog filesystem on
58
-
each pass ([source](../../../src/run.rs#L737-L758)), while validation is a
59
-
separate read-only command
60
-
([source](../../../src/validate.rs#L1-L24)). st2 does not yet stage a candidate
61
-
catalog, assign or compare catalog versions, atomically activate a validated
62
-
snapshot, or retain an activation receipt. That durable last-known-good
63
-
activation path is unimplemented.
55
+
The root [R18/R26](../requirements.md) contract requires a complete, validated,
56
+
locally applied catalog to remain authoritative through transport loss.
57
+
[`st2 catalog snapshot` and `catalog apply`](../../../src/catalog_transaction.rs)
58
+
implement the local activation boundary. Snapshot emits the exact declaration
59
+
root digest. Apply captures and validates a complete candidate, takes the
60
+
exclusive catalog lock, rechecks the expected predecessor digest, durably stages
61
+
the bytes, publishes an incomplete marker, and atomically applies the
62
+
projection. A crash resumes from that marker and content-addressed stage without
63
+
reopening the original candidate. While the marker exists, declaration readers
64
+
and lifecycle actions fail closed. The executable acceptance is in
0 commit comments