carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1package provision
2
3// s3ChangeIndexWriteCensusInventory is the record-write inventory for the S3
4// change index (amadan #336; docs/superpowers/specs/2026-10-21-s3-change-index-design.md),
5// layered on dbRegionForward1WriteCensusInventory (main's newest, which is
6// itself over plans2WriteCensusInventory). Reviewed by the branch author;
7// PROPOSED, the census owner rules on #280 (census-ruling-s3-change-index).
8//
9// Re-pinned, class and kinds unchanged:
10// - DirStore.Put, DirStore.PutFrom, S3Store.Put, S3Store.PutFrom: each is
11// now its old body moved unchanged into an unexported raw method (putRaw,
12// putFromRaw), then, after a successful write and only on a store opened
13// with the change index (EnableChangeIndex, NewDeploymentS3Store), a bump
14// of control/changes.json (bumpAfterMutation). Still record-transport:
15// they write whatever key the caller names, record keys included.
16// - Reconcile and ReconcileSidecars: the record walk moves unchanged into a
17// scan closure over a store argument, and the removal phase into a retire
18// closure. Over a record view snapshot, a pass that reaches a removal the
19// snapshot proves by absence (record gone, a sidecar gone or no longer
20// placeable, the app's trash marker) runs scan again over the bucket and
21// decides every removal that pass from it, by the walk's own rules
22// (final review R1, findings 2 and 4); a walk that cannot read cleanly
23// keeps every row. No record write is added; they stay key-site.
24//
25// New:
26// - snapStore.Put, snapStore.PutFrom: the record view snapshot store
27// forwards every write, record writes from WriteRecord included, to the
28// live store unchanged, and remembers the key so later reads of it go to
29// the bucket: record-transport, like prefixStore.Put.
30// - uncachedStore.Put: refuses and writes nothing (it backs walkComplete's
31// read-only walk over the cache): nonrecord, like versionStore.Put.
32// - RecordView.readApp, RecordView.readScope, RecordView.walk,
33// walkComplete, ViewSnapshot.list, ViewSnapshot.lookup: the record view's
34// reads. They name the instances/ and sidecars/ families (and the sidecar
35// manifest key) to list, fetch and answer them from the snapshot, and
36// write nothing: key-site.
37//
38// Not listed, and not a record write in this census's sense: the bump
39// itself. bumpAfterMutation and bumpChangeIndex rewrite only
40// control/changes.json (release.ChangeIndexKey), through the store's raw
41// put handed in as a function value, so the scanner sees neither, nor the
42// raw methods (putRaw, putFromRaw, deleteRaw, deleteIfMatchRaw), whose names
43// are not Put-family names. Every call of a raw put is in its own store's
44// Put, PutFrom or bump.
45func s3ChangeIndexWriteCensusInventory() []censusEntry {
46 entries := append([]censusEntry(nil), dbRegionForward1WriteCensusInventory()...)
47 repins := []censusEntry{
48 {"internal/provision/reconcile.go", "Reconcile", "key-site", "key:ParseRecordKey,key:RecordKey,lit:instances", "b93306e178252e56c67dd2ed58b87250e1b3756bddaa2589c3f7392d03300832"},
49 {"internal/provision/sidecar_reconcile.go", "ReconcileSidecars", "key-site", "key:ParseSidecarKey,key:SidecarRecordKey,lit:sidecars", "cc2aa4dbcb68f06f1190ad58a37c58e2608517e7388318b5b9e0b4bad0e8b5db"},
50 {"internal/release/store.go", "DirStore.Put", "record-transport", "def:Put", "63c5ff8af0fd64d30502735306287c489a659863ef3fc8b3f0df48f31c25134e"},
51 {"internal/release/store.go", "DirStore.PutFrom", "record-transport", "def:PutFrom", "f3f61446f41f15692d7e164b1a1637a8ff213359da3eebd60f574f585b31eb6a"},
52 {"internal/release/store.go", "S3Store.Put", "record-transport", "def:Put", "cd2fbd84994508f0f920210d6b0b4375a2d0ea1369ef0b73160fc2e0b2de66e9"},
53 {"internal/release/store.go", "S3Store.PutFrom", "record-transport", "def:PutFrom", "743c0dd30f0b1ea209a518382ab89d175d6e7fa15f0812f1f90e4fe6fd63b621"},
54 }
55 for _, r := range repins {
56 found := false
57 for i, e := range entries {
58 if e.File == r.File && e.Unit == r.Unit {
59 if e.Class != r.Class || e.Kinds != r.Kinds {
60 panic("s3-change-index re-pin changes the class or kinds of " + e.File + ":" + e.Unit)
61 }
62 entries[i], found = r, true
63 break
64 }
65 }
66 if !found {
67 panic("s3-change-index re-pin of an unlisted unit " + r.File + ":" + r.Unit)
68 }
69 }
70 return append(entries,
71 censusEntry{"internal/provision/recordview_store.go", "snapStore.Put", "record-transport", "def:Put,sel:Put", "3d2e124f1aba407198c881bb86357065bcfd93bec30d913e4a37b503ed131917"},
72 censusEntry{"internal/provision/recordview_store.go", "snapStore.PutFrom", "record-transport", "def:PutFrom,sel:PutObjectFrom", "469205cdc7b7b3882750731fadf0dfa8822393b8c1c134e4ee2e25c7df08f453"},
73 censusEntry{"internal/provision/recordview_store.go", "uncachedStore.Put", "nonrecord", "def:Put", "6b84938254d188d730158b529b89cbd040222c1509d5170bcac984bd4e50a2f6"},
74 censusEntry{"internal/provision/recordview.go", "RecordView.readApp", "key-site", "key:SidecarManifestKey", "09b0c8c11e7c42ed8a31fcc7a6f324b4f4b9a97fef463c5c032797ac6f4547d2"},
75 censusEntry{"internal/provision/recordview.go", "RecordView.readScope", "key-site", "lit:instances,lit:sidecars", "2820835bc309da9cd98a749106bde435fe6597a1b6b39472adf63908f9b55b7f"},
76 censusEntry{"internal/provision/recordview.go", "RecordView.walk", "key-site", "lit:instances,lit:sidecars", "ea585c4f5b40c1be6eb0b25d56b1041f8143e2176ca75c9636a959dc988c7184"},
77 censusEntry{"internal/provision/recordview.go", "walkComplete", "key-site", "lit:instances,lit:sidecars", "2edf70da2e873f69e5186845e19a32d0cec495e038d49bd889409a39ef431735"},
78 censusEntry{"internal/provision/recordview_store.go", "ViewSnapshot.list", "key-site", "lit:instances,lit:sidecars", "66443ba9b310eff8b59b7340fcc9ceee99e487b37029dce1ca82ea11858e23a5"},
79 censusEntry{"internal/provision/recordview_store.go", "ViewSnapshot.lookup", "key-site", "lit:instances,lit:sidecars", "25bea5560b69cdde76d3e8affd47ad915d75107cf5a7df6221efc89205191ea2"},
80 )
81}
82