carlos / platform Public

moves: the open record and its key

OpenRecord is an offline move's open intent (move, host, account, app,
incarnation, from, to, the staging coordinates, the pinned participants,
the replica layout and the stamp the open carries), at
control/offline-moves/<host>/<id>/open.json beside the seal. Task 8 writes
it create-only before the open transition; nothing writes it yet.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev d25d66fc0a2f627a402f79a9b77038c5b304e740 parent 3852ccc
1 file changed, +34 −0
  • internal/moves/offline.go +34 −0
diff --git a/internal/moves/offline.go b/internal/moves/offline.go
index 670a9d1c6..ff8ab90d9 100644
--- a/internal/moves/offline.go
+++ b/internal/moves/offline.go
@@ -400,6 +400,40 @@ func ValidateOfflineSeal(r OfflineReport, host, op string) error {
return nil
}
+// OpenRecord is the intent of an offline move's open, written create-only at
+// OpenRecordKey before the open transition (self-serve moves plan 2): which
+// move opens which host of which lifetime, from where to where, the staging
+// coordinates, the pinned participants, the replica's layout (flat or
+// nested, from the source's stopped report) and the stamp the open
+// transition carries. A retry after a crash between this record and the
+// transition adopts its OpenedAt, so the open lands at the recorded time;
+// the open committed when the record's move has opened_at equal to it, or
+// its last_move names this move done.
+type OpenRecord struct {
+ MoveID string `json:"move_id"`
+ Host string `json:"host"`
+ Account string `json:"account"`
+ App string `json:"app"`
+ Incarnation uint64 `json:"incarnation"`
+ From string `json:"from"`
+ To string `json:"to"`
+ StageBucket string `json:"stage_bucket"`
+ StageRegion string `json:"stage_region"`
+ Participants *provision.Participants `json:"participants,omitempty"`
+ Layout string `json:"layout"`
+ OpenedAt time.Time `json:"opened_at"`
+}
+
+// OpenRecordKey is where a move's open record lives:
+// control/offline-moves/<host>/<id>/open.json. "" for a host that fails
+// provision.ValidHostShape or an id that is not a plain name.
+func OpenRecordKey(host, id string) string {
+ if !provision.ValidHostShape(host) || !offlineSegment(id) {
+ return ""
+ }
+ return "control/offline-moves/" + host + "/" + id + "/open.json"
+}
+
// OfflineStager is the stage door's choice of the box that pre-copies the
// replica while a move is offline-staging: the lexically first of boxes,
// the source region's eligible boxes as the fleet's edges files list them,