carlos / platform Public

docs+copy: --if-version means same bytes; Luna 1b CLI lines

docs/site/cli.md no longer promises nobody wrote in between: the write
lands only if the stored bytes are exactly the ones read, and a change
followed by a change back is not detected (round 2 P2).

Luna 1b, verbatim: the default-bundle unavailable note, the empty
--if-version refusal, and the effective 404's older-console clause.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev ff0079ab5a064a50e5abd0dd5d28c13460e9f2e1 parent 27611ef
4 files changed, +10 −7
  • apimode.go +1 −1
  • apimode_test.go +1 −1
  • appconfig_cli.go +2 −2
  • docs/site/cli.md +6 −3
diff --git a/apimode.go b/apimode.go
index 1375e5846..2eef5f814 100644
--- a/apimode.go
+++ b/apimode.go
@@ -3176,7 +3176,7 @@ func (s *apiSession) configEffective(ctx context.Context, a apiAcct, app, host s
return apiConfigEffective{}, err
}
if status == http.StatusNotFound && !hasJSONError(body) {
- return apiConfigEffective{}, fmt.Errorf("%w. or %s is not one of this app's routes (check --host), or this console predates carlos env effective and needs updating", notFoundErr(), host)
+ return apiConfigEffective{}, fmt.Errorf("%w. or %s is not one of this app's routes (check --host), or this console needs updating before carlos env effective can be used", notFoundErr(), host)
}
if status != http.StatusOK {
return apiConfigEffective{}, apiErrorFromBody(status, body)
diff --git a/apimode_test.go b/apimode_test.go
index c1671aefe..5e624b8e3 100644
--- a/apimode_test.go
+++ b/apimode_test.go
@@ -4375,7 +4375,7 @@ func TestConfigEffectiveNotFoundNamesHostAndOlderConsole(t *testing.T) {
if err == nil || !errors.Is(err, errMembershipNotFound) {
t.Fatalf("err = %v, want the membership 404", err)
}
- for _, want := range []string{"shop.example.com", "--host", "predates carlos env effective"} {
+ for _, want := range []string{"shop.example.com", "--host", "needs updating before carlos env effective"} {
if !strings.Contains(err.Error(), want) {
t.Errorf("err = %q, want it to mention %q", err, want)
}
diff --git a/appconfig_cli.go b/appconfig_cli.go
index d08625650..7240fdb44 100644
--- a/appconfig_cli.go
+++ b/appconfig_cli.go
@@ -412,8 +412,8 @@ const (
receiptCopyVersion = "version %s, was %s"
receiptCopyUnchanged = "nothing changed. the bundle is still at version %s"
receiptCopyOtherMoved = "the default bundle changed while this was written. it is now at version %s, was %s"
- receiptCopyOtherGone = "the default bundle could not be read either side of this write, so whether it changed meanwhile is not known"
- ifVersionCopyEmpty = "--if-version is empty, so nothing was written. pass the version to write against, or leave the flag out"
+ receiptCopyOtherGone = "the default bundle could not be read before or after this write, so it is not known whether it changed"
+ ifVersionCopyEmpty = "--if-version is empty, so nothing was written. pass the version to write against, or omit the flag"
effectiveCopyDirect = "carlos env effective works through a console only. unset CARLOS_DEPLOYMENT_BUCKET and CARLOS_DEPLOYMENT_DIR and run carlos auth login"
)
diff --git a/docs/site/cli.md b/docs/site/cli.md
index fee028e60..ca71e09db 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -1063,9 +1063,12 @@ a console, not in direct-bucket mode.
`carlos env set`, `carlos env unset`, `carlos secrets set` and `carlos
secrets unset` take `--if-version <v>`. The write happens only if the bundle
-is still at version `v`, so you can read a bundle, decide what to change, and
-be sure nobody wrote in between. `--if-version none` means the write happens
-only if the bundle does not exist yet.
+is still at version `v`, that is, only if its stored bytes are exactly the
+ones you read. So you can read a bundle, decide what to change, and write
+only if it still holds what you saw. A write that changed it and a later
+write that changed it back are not detected, because the bytes are the same
+again. `--if-version none` means the write happens only if the bundle does
+not exist yet.
```sh
carlos env set --app shop --if-version cv1:3f0c… FEATURE_X=on