carlos / platform Public

Plan: declare the usage read as a request job (round 3 fix)

The plan text for Astra round 3's P1, which the previous commit meant
to carry: request-driven jobs are declared beside the claim workers and
the worker guard compares against both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev e3c40ee388a048e6bbf24fd37898de80ff14f9d8 parent 240f78e
1 file changed, +21 −0
  • docs/superpowers/plans/2026-11-29-instance-usage.md +21 −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-NaYsDx
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2 v1.44.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading github.com/prometheus/client_golang v1.17.0
go: downloading golang.org/x/sync v0.24.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/config v1.32.6
go: downloading golang.org/x/crypto v0.58.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 golang.org/x/sys v0.49.0
go: downloading github.com/lmittmann/tint v1.1.3
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading golang.org/x/net v0.62.0
go: downloading github.com/pion/logging v0.2.4
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/pion/stun/v3 v3.1.5
go: downloading github.com/aws/aws-sdk-go-v2/service/ssm v1.74.0
go: downloading github.com/aws/aws-sdk-go-v2/service/sesv2 v1.66.6
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/pion/transport/v4 v4.0.2
go: downloading github.com/beorn7/perks v1.0.1
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
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 github.com/dustin/go-humanize v1.0.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/dustin/go-humanize v1.0.1
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

amadan: job cancelled โ€” a newer push superseded it
diff --git a/docs/superpowers/plans/2026-11-29-instance-usage.md b/docs/superpowers/plans/2026-11-29-instance-usage.md
index b06ff8be1..b997fc6a2 100644
--- a/docs/superpowers/plans/2026-11-29-instance-usage.md
+++ b/docs/superpowers/plans/2026-11-29-instance-usage.md
@@ -531,6 +531,13 @@ past step 2, but a month whose start is before `From` is 409 with body
`apidoorkeys.go:364` runs a door's work, so a read fault is the job's
failed run on the operator's jobs page (spec ยง8 "filed as a failed
job"); the read returns the fault as its error.
+- `TestEveryWorkerReportsItsRuns` (`jobs_test.go` ~428) requires every
+ `.jobs.Run` name to be a claim worker. Add a request-driven job list
+ beside `jobLabels` (`var requestJobs = []string{"InstanceUsageRead"}`),
+ declared with `s.jobs.declare` where the workers are, labelled in
+ `jobLabels` with the copy note's job label (section I); change the test
+ to compare the reported names with workers plus `requestJobs`, keep its
+ check that every worker reports, and count `jobLabels` against both.
- Sum per host over boxes and dates; `""` is `unattributed`; `total` is
both; instances sorted by host; more than 10,000 hosts is 409 (Task 0
copy). `read_at` is `now` RFC 3339 UTC.
@@ -557,6 +564,8 @@ it as it keeps the others.
`TestUsageMemoKeyedByAccount` (same app name in two accounts, two
answers); `TestUsagePendingAndBreakOnMemoHit` (after a 200, flip to
pending: 503; to invalidated: 409; no memo answer leaks);
+ `TestRequestJobsAreDeclared` (`InstanceUsageRead` is on the jobs
+ registry as Not run yet before any call, with its label);
`TestUsageReadFaults` (read error, bad JSON, key mismatch, body over
`usageDayReadCap`: each 503 with `Retry-After: 60`, and the
`InstanceUsageRead` job's status is `JobFailed` with that error; a
@@ -698,3 +707,15 @@ new families:
|---|---|---|
| 1 P1, the CLI's GET reads 1 MiB and truncates silently | End-to-end response-size compatibility | `getJSONLimit` with an overflow error; `carlos usage` reads up to 8 MiB; witnesses over 1 MiB and over 8 MiB (Task 7) |
| 2 P2, read faults not filed as a failed job | Operational visibility of read failures | The read runs inside `s.jobs.Run(..., "InstanceUsageRead", ...)`; the fault test asserts `JobFailed` (Task 6) |
+
+**Round 3** (Astra, on `70e5076f3`, `CODEX-FINDINGS-instance-usage-plan-R3.md`):
+NOT READY. Both round 2 findings resolved; one new P1, one cause:
+
+| Finding | Fault family | Resolution |
+|---|---|---|
+| 1 P1, `InstanceUsageRead` fails `TestEveryWorkerReportsItsRuns`, which assumes every job is a worker | Job-registration completeness | A declared `requestJobs` list with a label; the guard compares against workers plus request jobs (Task 6) |
+
+The budget's three rounds are spent. Ruling (controller, 2026-11-30): no
+fourth plan round; this fix is mechanical, the guard test it changes
+checks it, and Task 6's per-task Astra review reviews it. Paul is told
+on #1519 (stopping rule 8) and may ask for a fourth round instead.