From 06576b406ccc2d8d7db053d7f4fbcfd00d6c14a3 Mon Sep 17 00:00:00 2001 From: claude Date: Thu, 13 Aug 2026 03:07:52 +0400 Subject: [PATCH] Pass the ambient boolean as one flag argument Go flag parsing stops at the separate boolean value before ambient-token. Use -ambient-enabled=value and pin the deployed argv contract discovered during live V-691 verification. Owner explicitly requested direct commits to master. --- docker-compose.yml | 2 +- internal/config/deployconfig_test.go | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0d499db..60a8f1f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -107,7 +107,7 @@ services: # `ps` inside this container, unlike the zenmoney and IMAP secrets which are # read from files. command: ["mavweb", "-addr", ":9201", "-voice", "mavend:9100", "-core", "/run/maven/mavend.sock", - "-ambient-enabled", "${MAVEN_AMBIENT_ENABLED:-false}", + "-ambient-enabled=${MAVEN_AMBIENT_ENABLED:-false}", "-ambient-token", "${MAVEN_AMBIENT_TOKEN:-}", "-nexus", "http://nexus:9740", "-praxis", "http://praxis:8989", "-hexis", "http://hexis:9741"] depends_on: [mavend] diff --git a/internal/config/deployconfig_test.go b/internal/config/deployconfig_test.go index 090bf55..44416f7 100644 --- a/internal/config/deployconfig_test.go +++ b/internal/config/deployconfig_test.go @@ -108,3 +108,23 @@ func TestCanonicalDeployEnvExampleNamesEverySecret(t *testing.T) { } } } + +// Go's flag package treats a bare boolean flag as true and does not consume a +// following "true"/"false" argument. That following value becomes the first +// positional argument and stops parsing, so every flag after it silently keeps +// its default. Keep the Compose boolean in -name=value form (V-691 live QA). +func TestComposeAmbientBooleanDoesNotStopFlagParsing(t *testing.T) { + path := filepath.Join("..", "..", "docker-compose.yml") + b, err := os.ReadFile(path) + if err != nil { + t.Fatalf("read %s: %v", path, err) + } + compose := string(b) + const joined = `"-ambient-enabled=${MAVEN_AMBIENT_ENABLED:-false}"` + if !strings.Contains(compose, joined) { + t.Fatalf("mavweb ambient boolean must be one argv element %s", joined) + } + if strings.Contains(compose, `"-ambient-enabled",`) { + t.Fatal("bare -ambient-enabled leaves its value positional and prevents -ambient-token from being parsed") + } +}