ci: map volume creation and replication peer actions

This commit is contained in:
pingqiu committed 2026-11-25 18:20:45 -08:00
1 parent a1b0a6ff39
commit 585aafaafb
3 files changed
+54 -3

No files matched your search

+20 -3
View File
@@ -10,7 +10,8 @@ expanded. Missing, empty or malformed mappings refuse the check.
The reviewed map uses the neutral public module names: `SnapshotRemoval`,
`RestoreTarget`, `HolderInterface`, `EngineAdapter`, `StopAndRestart`,
`MoveAdmission`, `Promotion`, `ProbeRound` and `FencingRound`.
`MoveAdmission`, `Promotion`, `ProbeRound`, `FencingRound`, `VolumeCreate`
and `ReplicationPeer`.
Actions name top-level definitions used by the corresponding model's `Next`.
The mapping is the source of accepted citations; private model names and
storage locations do not belong in the public map or PR description.
@@ -26,5 +27,21 @@ Model: EngineAdapter.Begin; MoveAdmission.Revoke; NONE (pure function of Restore
Unmapped paths keep the existing spec-trace policy. The pure-function
declaration is a review claim; CI checks its module, not its truth.
This branch is a trial. Populate the canonical mapping and run the complete
shell self-test on Linux before enabling it by merging the workflow.
## Adding a model or file
1. Have the model owner confirm its neutral public module name and the
top-level action definitions used by `Next`. Use those names in public
code, mapping rows and PR descriptions.
2. Add an exact-path TSV row for each implementation and enforcement file
that the action covers. Split actions get separate rows. Include receiving
guards as well as senders; a reviewer checks that each file really enforces
the cited action. Environment actions without a Go site and mutant test
obligations are not implementation mappings.
3. Add controls for accepted and refused citations when extending the
checker. For mapping additions, check the real map against representative
affected paths. Run `python3 -B .github/scripts/model-trace-check-test.py`
and `bash .github/scripts/spec-trace-check-test.sh` on Linux.
4. Submit the map and its evidence for review with the model change or before
its callers land. The PR description cites the applicable public actions.
The new rows govern later PRs once they are on the target branch; changing
a PR's own map never changes the check that evaluates that PR.
+22
View File
@@ -16,6 +16,7 @@ core/authority/workspace_delete_reservation.go MoveAdmission.DelCheck
core/authority/workspace_delete_reservation.go MoveAdmission.Reserve
core/authority/workspace_lease_view.go HolderInterface.Grant
core/authority/workspace_lease_view.go HolderInterface.Regrant
core/engine/apply.go ReplicationPeer.Reconcile
core/frontend/chunkstore/layout/claim.go EngineAdapter.Takeover
core/frontend/chunkstore/layout/claim.go MoveAdmission.ClaimB
core/frontend/chunkstore/layout/claim.go SnapshotRemoval.Claim
@@ -26,8 +27,10 @@ core/frontend/chunkstore/layout/clean.go SnapshotRemoval.BeginClean
core/frontend/chunkstore/layout/clean.go SnapshotRemoval.EndClean
core/frontend/chunkstore/layout/commit.go EngineAdapter.Apply
core/frontend/chunkstore/layout/commit.go SnapshotRemoval.Commit
core/frontend/chunkstore/layout/commit.go VolumeCreate.Commit
core/frontend/chunkstore/layout/create.go RestoreTarget.CreateHead
core/frontend/chunkstore/layout/create.go RestoreTarget.CreateVol
core/frontend/chunkstore/layout/create.go VolumeCreate.Claim
core/frontend/chunkstore/layout/delete.go MoveAdmission.DelMark
core/frontend/chunkstore/layout/delete.go MoveAdmission.DelRead
core/frontend/chunkstore/layout/delete.go RestoreTarget.OpRelease
@@ -46,6 +49,9 @@ core/frontend/chunkstore/layout/snapshots.go RestoreTarget.AddDep
core/frontend/chunkstore/layout/snapshots.go SnapshotRemoval.DeleteSnap
core/frontend/chunkstore/layout/start.go HolderInterface.Start
core/frontend/chunkstore/layout/start.go StopAndRestart.CrashRestart
core/frontend/chunkstore/layout/start.go VolumeCreate.Claim
core/frontend/chunkstore/layout_create.go VolumeCreate.IssueHead
core/frontend/chunkstore/layout_create.go VolumeCreate.IssueVol
core/frontend/chunkstore/layout_remote.go EngineAdapter.Begin
core/frontend/chunkstore/layout_remote.go EngineAdapter.ReadHead
core/frontend/chunkstore/layout_remote.go EngineAdapter.SendCommit
@@ -55,6 +61,7 @@ core/frontend/chunkstore/layout_remote.go StopAndRestart.SendCommit
core/frontend/chunkstore/layout_remote.go StopAndRestart.SettleAbort
core/frontend/chunkstore/layout_store.go SnapshotRemoval.ApplyDelete
core/frontend/chunkstore/layout_store.go SnapshotRemoval.ApplyMark
core/frontend/chunkstore/swfs.go VolumeCreate.Land
core/frontend/durable/provider_chunk.go EngineAdapter.SettleResume
core/frontend/durable/provider_chunk.go EngineAdapter.StartStop
core/frontend/durable/provider_chunk.go HolderInterface.StopBegin
@@ -64,10 +71,12 @@ core/frontend/durable/provider_layout.go EngineAdapter.SettleDown
core/frontend/durable/provider_layout.go StopAndRestart.SettleDown
core/frontend/durable/storage_adapter.go EngineAdapter.GuestWrite
core/frontend/durable/storage_adapter.go HolderInterface.Write
core/host/master/layout_ready.go VolumeCreate.Place
core/host/master/probe_round.go FencingRound.Deliver
core/host/master/probe_round.go FencingRound.Open
core/host/master/product_loop.go FencingRound.Decide
core/host/master/product_loop.go Promotion.Decide
core/host/master/store_attestation.go ReplicationPeer.Attest
core/host/master/workspace_service.go MoveAdmission.ReadForMove
core/host/master/workspace_service.go StopAndRestart.ReadClean
core/host/volume/primary_evidence.go FencingRound.Adopt
@@ -79,13 +88,21 @@ core/host/volume/workspace_lease.go MoveAdmission.StopOnExpiry
core/host/volume/workspace_lease.go MoveAdmission.Write
core/host/volume/workspace_lease.go SnapshotRemoval.Expire
core/host/volume/workspace_lease.go StopAndRestart.Write
core/lifecycle/store.go VolumeCreate.MarkReady
core/lifecycle/store.go VolumeCreate.Record
core/replication/peer.go Promotion.Ship1
core/replication/peer.go Promotion.Ship2
core/replication/peer.go ReplicationPeer.Barrier
core/replication/peer.go ReplicationPeer.Fail
core/replication/peer.go ReplicationPeer.Heal
core/replication/peer.go ReplicationPeer.Ship
core/replication/volume.go FencingRound.Ack
core/replication/volume.go Promotion.Ack1
core/replication/volume.go Promotion.Rejoin
core/replication/volume.go Promotion.Write1
core/replication/volume.go Promotion.Write2
core/replication/volume.go ReplicationPeer.Ack
core/replication/volume.go ReplicationPeer.Write
core/storage/chunk_head_belt.go HolderInterface.Fence
core/storage/chunk_layer.go EngineAdapter.EngineReRead
core/storage/chunk_layer.go EngineAdapter.NoOpCut
@@ -94,4 +111,9 @@ core/storage/chunk_layer.go HolderInterface.StopCommit
core/storage/chunk_layer.go MoveAdmission.Detach
core/storage/chunk_layer.go MoveAdmission.Publish
core/storage/chunk_layer.go SnapshotRemoval.Write
core/transport/catchup_sender.go ReplicationPeer.CatchUp
core/transport/rebuild_sender.go ReplicationPeer.Rebuild
core/transport/replica.go FencingRound.Recv
core/transport/replica.go ReplicationPeer.CatchUp
core/transport/replica.go ReplicationPeer.Rebuild
core/transport/replica.go ReplicationPeer.Ship
1 # Exact repository-relative path<TAB>Module.Action; repeat a path for alternatives.
16 core/authority/workspace_delete_reservation.go
17 core/authority/workspace_lease_view.go
18 core/authority/workspace_lease_view.go
19 core/engine/apply.go
20 core/frontend/chunkstore/layout/claim.go
21 core/frontend/chunkstore/layout/claim.go
22 core/frontend/chunkstore/layout/claim.go
27 core/frontend/chunkstore/layout/clean.go
28 core/frontend/chunkstore/layout/commit.go
29 core/frontend/chunkstore/layout/commit.go
30 core/frontend/chunkstore/layout/commit.go
31 core/frontend/chunkstore/layout/create.go
32 core/frontend/chunkstore/layout/create.go
33 core/frontend/chunkstore/layout/create.go
34 core/frontend/chunkstore/layout/delete.go
35 core/frontend/chunkstore/layout/delete.go
36 core/frontend/chunkstore/layout/delete.go
49 core/frontend/chunkstore/layout/snapshots.go
50 core/frontend/chunkstore/layout/start.go
51 core/frontend/chunkstore/layout/start.go
52 core/frontend/chunkstore/layout/start.go
53 core/frontend/chunkstore/layout_create.go
54 core/frontend/chunkstore/layout_create.go
55 core/frontend/chunkstore/layout_remote.go
56 core/frontend/chunkstore/layout_remote.go
57 core/frontend/chunkstore/layout_remote.go
61 core/frontend/chunkstore/layout_remote.go
62 core/frontend/chunkstore/layout_store.go
63 core/frontend/chunkstore/layout_store.go
64 core/frontend/chunkstore/swfs.go
65 core/frontend/durable/provider_chunk.go
66 core/frontend/durable/provider_chunk.go
67 core/frontend/durable/provider_chunk.go
71 core/frontend/durable/provider_layout.go
72 core/frontend/durable/storage_adapter.go
73 core/frontend/durable/storage_adapter.go
74 core/host/master/layout_ready.go
75 core/host/master/probe_round.go
76 core/host/master/probe_round.go
77 core/host/master/product_loop.go
78 core/host/master/product_loop.go
79 core/host/master/store_attestation.go
80 core/host/master/workspace_service.go
81 core/host/master/workspace_service.go
82 core/host/volume/primary_evidence.go
88 core/host/volume/workspace_lease.go
89 core/host/volume/workspace_lease.go
90 core/host/volume/workspace_lease.go
91 core/lifecycle/store.go
92 core/lifecycle/store.go
93 core/replication/peer.go
94 core/replication/peer.go
95 core/replication/peer.go
96 core/replication/peer.go
97 core/replication/peer.go
98 core/replication/peer.go
99 core/replication/volume.go
100 core/replication/volume.go
101 core/replication/volume.go
102 core/replication/volume.go
103 core/replication/volume.go
104 core/replication/volume.go
105 core/replication/volume.go
106 core/storage/chunk_head_belt.go
107 core/storage/chunk_layer.go
108 core/storage/chunk_layer.go
111 core/storage/chunk_layer.go
112 core/storage/chunk_layer.go
113 core/storage/chunk_layer.go
114 core/transport/catchup_sender.go
115 core/transport/rebuild_sender.go
116 core/transport/replica.go
117 core/transport/replica.go
118 core/transport/replica.go
119 core/transport/replica.go
+12
View File
@@ -35,6 +35,18 @@ class ModelTraceTests(unittest.TestCase):
def test_unmapped_files_keep_existing_policy(self):
self.assertEqual(checker.check("existing prose", ["docs/a.md", "core/a.go.bak"], self.mapping), [])
def test_repository_map_covers_claimed_head_create(self):
mapping = checker.read_mapping(SCRIPT.parent.parent / "model-code-trace.tsv")
paths = ["core/frontend/chunkstore/layout/create.go"]
self.assertEqual(checker.check("VolumeCreate.Claim", paths, mapping), [])
self.assertEqual(len(checker.check("VolumeCreate.Unknown", paths, mapping)), 1)
def test_repository_map_covers_the_replica_receiver(self):
mapping = checker.read_mapping(SCRIPT.parent.parent / "model-code-trace.tsv")
paths = ["core/transport/replica.go"]
self.assertEqual(checker.check("ReplicationPeer.Ship", paths, mapping), [])
self.assertEqual(len(checker.check("VolumeCreate.Claim", paths, mapping)), 1)
def test_cli_checks_nul_paths_and_model_citations(self):
with tempfile.TemporaryDirectory() as tmp:
mapping = Path(tmp) / "map.tsv"