carlos / platform Public

Copy: carlos usage output, route messages, mint refusals

The UX pass and Luna's copy review for the instance usage CLI and route
(plan Task 0). Luna changed one string, the cap message.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 53a8be72f49a2d19c761434eafdd2b9cd3ad97d3 parent 971f8bf
1 file changed, +108 −0
  • docs/superpowers/notes/instance-usage-copy.md +108 −0

CI cancelled — superseded by a newer push — run details

CI log
=== gate ===
go: downloading go1.26.10 (linux/arm64)
go version go1.26.10 linux/arm64
opentofu: arm64, tofu 1.13.9, aws 6.73.0, archive 2.8.1
  tofu: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/tofu_1.13.9_linux_arm64.tar.gz
  tofu: downloaded, digest verified
  aws: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-aws_6.73.0_linux_arm64.zip
  aws: downloaded, digest verified
  archive: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-archive_2.8.1_linux_arm64.zip
  archive: downloaded, digest verified
  installed in /tmp/carlos-opentofu-mcyPva
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading github.com/aws/aws-sdk-go-v2 v1.44.0
go: downloading github.com/aws/smithy-go v1.28.1
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading golang.org/x/net v0.62.0
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/config v1.32.6
go: downloading github.com/aws/aws-sdk-go-v2/service/sns v1.43.0
go: downloading github.com/prometheus/client_golang v1.17.0
go: downloading golang.org/x/sync v0.24.0
go: downloading github.com/aws/aws-sdk-go-v2/service/acm v1.45.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.324.0
go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2
go: downloading github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.37.0
go: downloading github.com/aws/aws-sdk-go-v2/service/route53 v1.64.1
go: downloading github.com/aws/aws-sdk-go-v2/service/sts v1.45.6
go: downloading golang.org/x/sys v0.49.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading golang.org/x/mod v0.41.0
go: downloading github.com/oschwald/maxminddb-golang v1.13.1
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/pion/randutil v0.1.0
go: downloading github.com/pion/transport/v4 v4.0.2
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.38
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
go: downloading golang.org/x/text v0.43.0
go: downloading github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.14
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/memory v1.11.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/google/uuid v1.6.0
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/memory v1.11.0
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec

amadan: job cancelled — a newer push superseded it
diff --git a/docs/superpowers/notes/instance-usage-copy.md b/docs/superpowers/notes/instance-usage-copy.md
new file mode 100644
index 000000000..ae54385ed
--- /dev/null
+++ b/docs/superpowers/notes/instance-usage-copy.md
@@ -0,0 +1,108 @@
+# Instance usage: approved copy
+
+Luna (gpt-6-luna) reviewed the draft on 2026-11-30 and changed one string
+(F7). These are the strings Tasks 5, 6 and 7 use verbatim, and
+`approved_usage_copy_test.go` pins. Placeholders are in angle brackets.
+Bytes are formatted by the root package's `humanBytes`. In
+`docs/site/cli.md` the two indented examples become ```sh fences (the
+docsite check runs fenced examples).
+
+UX pass (Task 0 step 1): the first line answers "how much this month?"
+(app, month, total sent, total requests); one line of caveat; then the
+table; the footer counts instances. Every line fits in 80 columns with a
+25-character hostname column; longer hosts widen the column.
+
+## A. Human output, current month
+
+```text
+patrix-sites, January 2027 so far: 14.5GB sent, 1,244,531 requests
+Counted up to 14 Jan 13:05 UTC. Traffic not yet counted is not shown.
+
+ Instance Sent Requests
+ alpha.patrix.site 14.2GB 1,204,331
+ beta.patrix.site 312.0MB 40,112
+ Not tied to an instance 1.1MB 88
+
+ 2 instances
+```
+
+## B. Human output, a past month
+
+```text
+patrix-sites, December 2026: 9.8GB sent, 802,114 requests
+Counted up to 31 Dec 23:59 UTC. Traffic not yet counted is not shown.
+```
+
+(same table and footer as A)
+
+## C. No traffic counted
+
+```text
+patrix-sites, January 2027 so far: nothing counted yet
+```
+
+## D. A month before counting started
+
+```text
+Counting by instance starts on 1 January 2027.
+```
+
+## E. CLI usage text
+
+```text
+usage: carlos usage --app <a> [flags]
+
+Bytes sent and requests served by each instance of an app in one UTC
+month, counted at the edge. Figures are what has been counted so far, so
+they can be lower than what was served but never higher.
+
+--month is YYYY-MM and defaults to this month. --json prints the answer
+as the API returns it.
+```
+
+Flag help lines:
+
+- `--month`: `month to show, YYYY-MM (default: this month)`
+- `--json`: `print the API's answer as JSON`
+
+## F. Errors the console returns
+
+1. Malformed month (400): `month: want YYYY-MM, such as 2027-01`
+2. Future month (400): `month: <YYYY-MM> has not started yet`
+3. Before counting started (409): `Counting by instance starts on <1 January 2027>. Ask for <2027-01> or later.`
+4. Hostname history not active (409): `Usage by instance is not available on this console: its hostname history is not active, so bytes cannot be tied to one instance.`
+5. History still being checked at start-up (503): `The console is still checking its hostname history. Try again in a minute.`
+6. A count object could not be read (503): `Could not read this app's usage. Try again in a minute.`
+7. Over the cap (409): `This app has more than 10,000 instances with traffic this month, so the results cannot fit in one answer. Ask for paging.`
+
+## G. Mint refusals
+
+1. No app: `A usage credential must name one app. Nothing was minted.`
+2. Feature switched off: `Usage credentials are not available on this console. Nothing was minted.`
+
+## H. Docs section
+
+```text
+### carlos usage
+
+Bytes sent and requests served by each instance of an app, for one UTC
+month, counted at the edge as it serves the app.
+
+ carlos usage --app shop
+ carlos usage --app shop --month 2027-01 --json
+
+The figures are what has been counted so far: they can be lower than what
+was served, never higher. A response that crosses midnight counts in the
+hour it finished. Bytes the edge cannot tie to one instance, such as some
+cached files served under a custom domain, are shown on their own line
+and never charged to an instance.
+
+To give a server read-only access to these figures and nothing else, mint
+a usage credential bound to the app:
+
+ carlos services create --role usage --app shop shop-usage
+
+Counting by instance starts at the beginning of the month after the
+console turns it on; earlier months are refused.
+```
+