From ab1eb0cb4781512c08aa5fe50ae4cbf2a6031aaf Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 12 Nov 2026 15:51:02 +0100 Subject: [PATCH] Review 1 of S1: the served-text row finds the list tool by its full name; list's text is the contract's word for word MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds: design 39 parts D3 (ยง15), bullets 2 and 4. --- modules/mesh-files/cmd/mesh-files/main.go | 4 ++-- modules/mesh-files/cmd/mesh-files/reads_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mesh-files/cmd/mesh-files/main.go b/modules/mesh-files/cmd/mesh-files/main.go index 79d07b694..68c6eb232 100644 --- a/modules/mesh-files/cmd/mesh-files/main.go +++ b/modules/mesh-files/cmd/mesh-files/main.go @@ -288,8 +288,8 @@ func rawReadTools(r Reader) []stdio.Tool { object(map[string]any{"path": str("an absolute path")}, "path"), func(a map[string]any) (any, error) { return r.Readlink(arg(a, "path")) }), verb("list", "Every entry of one directory with its type, owner, group, mode, size and, for a link, its "+ - "target. At most 2000 entries; a longer directory is cut and says so. A place a secret is kept is "+ - "listed too, at any depth, and marked secret-place: its entries, never their content; what reaches a "+ + "target. At most 2000 entries; a longer directory is cut and says so. A place a secret is kept, at any depth "+ + "beneath it, is listed too and marked secret-place: its entries, never their content; what reaches a "+ "process's memory or files (/proc//environ, mem, fd, map_files, root, cwd) is refused by name. Read "+readsAs+".", object(map[string]any{"path": str("an absolute path to a directory")}, "path"), func(a map[string]any) (any, error) { return r.List(arg(a, "path")) }), diff --git a/modules/mesh-files/cmd/mesh-files/reads_test.go b/modules/mesh-files/cmd/mesh-files/reads_test.go index 399098097..bb94ef3d4 100644 --- a/modules/mesh-files/cmd/mesh-files/reads_test.go +++ b/modules/mesh-files/cmd/mesh-files/reads_test.go @@ -105,7 +105,7 @@ func TestSecretPlacesAreRefusedByNameBeforeAnyRead(t *testing.T) { } // the served text of list says it lists a secret place, and no longer that it refuses one for _, tl := range readTools(r) { - if tl.Name == "list" && (strings.Contains(tl.Description, "known credential file, is refused") || + if strings.HasSuffix(tl.Name, ".list") && (strings.Contains(tl.Description, "known credential file, is refused") || !strings.HasSuffix(tl.Description, "where its rights do not reach.")) { t.Errorf("the list text: %s", tl.Description) }