aboutsummaryrefslogtreecommitdiffstats
path: root/docs/migrations.md
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-29 13:52:20 +0000
committertv <tv@krebsco.de>2026-11-29 13:52:24 +0000
commit4791bc92062b65be6903e814fc6b13a08f2da2f2 (patch)
tree8cd657036d8c805dee2538105f3590c4c602c413 /docs/migrations.md
parenteba0bee47dc5da8cd1491c7bc33b9e22f6a929f0 (diff)
docs: design draft 4, programs and sources
A protocol for validators, renderers, converters and steps (a directory with an invocation and channels/CHANNEL/SLOT, objections as JSON lines); every slot holds a file, its type a media type, so format and type versions go; validators across slots; submissions in the same layout, with removal and the chain as order proposed; and enstate pack, with source lists in JSON or TOML by continuum's config crate. Case 2 of migrations.md now has two types and converters between them.
Diffstat (limited to 'docs/migrations.md')
-rw-r--r--docs/migrations.md45
1 files changed, 24 insertions, 21 deletions
diff --git a/docs/migrations.md b/docs/migrations.md
index 0d331a6..09c575e 100644
--- a/docs/migrations.md
+++ b/docs/migrations.md
@@ -17,7 +17,7 @@ The two rules:
S1 secrets/tinc.key ed25519-private-key
S2 secrets/retiolum.key ed25519-private-key, renamedFrom tinc.key
-| step | stored | seen by the running generation |
+| what happens | stored | seen by the running generation |
|---|---|---|
| G1 runs, key K submitted | S1: `tinc.key` = K | `tinc.key` = K |
| switch to G2 | S1: `tinc.key` = K | `retiolum.key` = K |
@@ -34,26 +34,29 @@ The two rules:
Without the first rule the rollback would find no `tinc.key` and be
refused, or worse, find a kept copy of K.
-## 2. A type with a new version, and no way down for some records
+## 2. A slot with a new type, and no way back for some records
- hosts v1 { name, addr }
- hosts v2 { name, addrs: [ … ] }
- converters up: addr -> [ addr ]
- down: addrs -> addr, only if there is exactly one
+Two types, each a shape of its own ([design.md](design.md), 5.1), and a
+converter in each direction:
- S1 fleet/hosts hosts v1
- S2 fleet/hosts hosts v2
+ T1 application/x-enstate-hosts1+json { name, addr }
+ T2 application/x-enstate-hosts2+json { name, addrs: [ … ] }
+ converters T1 -> T2: addr -> [ addr ]
+ T2 -> T1: addrs -> addr, only if there is exactly one
-| step | stored | seen |
+ S1 fleet/hosts T1
+ S2 fleet/hosts T2
+
+| what happens | stored | seen |
|---|---|---|
-| G1 runs | S1: ne = { addr: a } | v1: ne = a |
-| switch to G2 | S1: ne = { addr: a } | v2: ne = [ a ] |
-| under G2, ne gets a second address | S2: ne = { addrs: [ a, b ] } | v2: ne = [ a, b ] |
+| G1 runs | S1: ne = { addr: a } | T1: ne = a |
+| switch to G2 | S1: ne = { addr: a } | T2: ne = [ a ] |
+| under G2, ne gets a second address | S2: ne = { addrs: [ a, b ] } | T2: ne = [ a, b ] |
| roll back to G1 | refused | |
-- The rollback is refused before switching: `fleet/hosts/ne: two
- addresses, hosts v1 holds one`. The policy is refuse, and the message
- names the record.
+- The rollback is refused before switching. The converter from T2 to T1
+ objects ([design.md](design.md), 5.2): `fleet/hosts/ne: two addresses,
+ T1 holds one`. The policy is refuse, and the message names the record.
- Ways on: a submission made for S1 (the provider decides which address ne
keeps), which the plan shows as dropping `b`; or staying on G2.
- Had ne kept one address, the rollback would go through, and switching
@@ -71,10 +74,10 @@ refused, or worse, find a kept copy of K.
step split: tls.pem -> tls.cert, tls.key
step join: tls.cert, tls.key -> tls.pem
-No rename or converter says this; S2 declares custom steps, one for each
+No rename or converter says this; S2 declares steps, one for each
direction.
-| step | stored | seen |
+| what happens | stored | seen |
|---|---|---|
| G1 runs | S1: `tls.pem` = P | `tls.pem` = P |
| switch to G2 | S1: `tls.pem` = P | `tls.cert`, `tls.key` from split(P) |
@@ -94,11 +97,11 @@ direction.
## What the cases show
- Renames need nothing but the declaration, in both directions.
-- Converters and custom steps should come in pairs; where one direction is
+- Converters and steps should come in pairs; where one direction is
missing or can't hold the data, the model refuses and names the address,
it doesn't guess.
- Both rules are needed: the first for every way back, the second so that
trying an older generation costs nothing.
-- Open: a step that only works for some content (case 2's way down) makes
- whether a rollback is possible depend on the data. The deploy tool can
- ask the receptor before switching; at boot it can't.
+- Open: a converter or step that only works for some content (case 2's
+ way back) makes whether a rollback is possible depend on the data. The
+ deploy tool can ask the receptor before switching; at boot it can't.