diff --git a/internal/link/have_test.go b/internal/link/have_test.go index ea8a0c2b..508cfad9 100644 --- a/internal/link/have_test.go +++ b/internal/link/have_test.go @@ -382,6 +382,10 @@ func testTheNodeKeyCarriesTheNodesFacts(t *testing.T) { if !slices.Contains(got.Record.ManifestReads, nodeengine.ManifestReadWordWantVersion) || slices.Contains(got.Record.Capabilities, "want-parts") { t.Errorf("the record states reads %v and capabilities %v, want the word want:version and no want-parts", got.Record.ManifestReads, got.Record.Capabilities) } + // And that it gives a directory's contents the directory's new owner (H-A-556). + if !slices.Contains(got.Record.ManifestReads, catalogue.ReadDirectoryContentsOwner) { + t.Errorf("the record states reads %v, want %s", got.Record.ManifestReads, catalogue.ReadDirectoryContentsOwner) + } // Among them, that it fills a seat's reach from the seat holder's listen (ADR 0632 §1). // And the words and forms it builds (design 42 zfs-owns-zfs §4, answer A-13). for _, read := range []string{catalogue.ReadForm + catalogue.ReferenceFormSeatReach, "word:resources.if-config", @@ -1056,9 +1060,11 @@ func slicesIndex(rs []ResourceHealth, id string) int { return -1 } -// statedReads is the contract's reads with the word that the engine reads a want by its version (design 47 H §772). +// statedReads is the contract's reads with the word that the engine reads a want by its version (design 47 H §772) and +// that it gives a directory's contents its new owner (H-A-556). func statedReads() []string { - return slices.Sorted(slices.Values(append(catalogue.ManifestReads(), nodeengine.ManifestReadWordWantVersion))) + return slices.Sorted(slices.Values(append(catalogue.ManifestReads(), nodeengine.ManifestReadWordWantVersion, + catalogue.ReadDirectoryContentsOwner))) } // TestHave runs this file's tests, each a subtest named as its function was (design 47 H2 §819, the test budget). diff --git a/internal/link/record.go b/internal/link/record.go index 1db4748c..8cc45ee6 100644 --- a/internal/link/record.go +++ b/internal/link/record.go @@ -58,6 +58,9 @@ func readsNow() []string { } out := make([]string, 0, len(set)) set[nodeengine.ManifestReadWordWantVersion] = true + // And that it gives a directory's contents the directory's new owner (internal/apply giveContents; H-A-556): a module + // declaring runs-as needs it, so its move waits for this engine on its node. + set[catalogue.ReadDirectoryContentsOwner] = true for r := range set { out = append(out, r) }