carlos / platform Public

release: tolerate MinIO listing marker-only prefixes in the version test

AWS S3 hides a prefix whose only object is a delete marker from a
delimiter LIST; MinIO returns it. The prune discovers trees by version
dirs, so the test now requires only the live box from plain ListDirs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 3d93ce53885feaae88543e7ed1bb05a99badbb14 parent 64e9b4d
1 file changed, +5 −2
  • internal/release/s3_minio_test.go +5 −2

CI failed — run details

Intent

Human

<task-notification> <task-id>a15a2482578e9726d</task-id> <tool-use-id>toolu_01XXXqFgYfM4r6q2qSF4MSau</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/dbc12c58-9d65-48e0-ba5b-f12ec7bb5a4d/tasks/a15a2482578e9726d.output</output-file> <status>completed</status> <summary>Agent "Opus census verdict" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>All my verdicts still hold at 47d6934d: every unit and envelope is approved. I updated /home/paulca/.cache/stats-prune/census-verdict.md to name the new tip and changed only the main.tf and variables.tf lines. Nothing was posted. From 1e482544 to 47d6934d, the only changes inside the census scope are to comments and text: - **main.tf:** only the comment above `host_analytics_prune` changed. It now says IAM's `*` also matches "/", which was the note in my first verdict. The policy itself is unchanged. - **variables.tf:** only the description of `enable_analytics_version_prune` changed. - **Census records:** the card has a new seal and the overlay and chain lines were re-pinned. The card still lists the same units and envelopes. - **Outside the census:** the rest is console code (`internal/console/analyticsprune.go` and a new test), which is not part of the root binary. Nothing changed in `internal/analytics`, `internal/release` or `infra/modules/region-host/tests`. Final text: Census verdict, stats-prune-400 @ 47d6934d, reviewer Opus 5.5 infra/modules/region-host/main.tf (external): APPROVE — the new host_analytics_prune policy is count 0 unless enable_analytics_version_prune is set, and group mode refuses that input; when on, it adds only s3:ListBucketVersions (s3:prefix apps/\*) and s3:DeleteObjectVersion on apps/\*/\*/analytics/\*/days/\* to the host role, which already has Put/DeleteObject on the whole deployment bucket and no deployment-bucket version read; no read is added, no existing grant, Deny, release-key Deny or group refusal is weakened, and BoxRecordsAreNeverDeleted still denies DeleteObjectVersion on the evidence prefixes; at 47d6934d the comment and variable description now correctly say IAM \* also matches "/" so the pattern can reach deeper apps/ keys, with the policy itself unchanged; only the box role holder can use it and it adds no root read. infra/modules/region-host/variables.tf (external): APPROVE — adds one operator Terraform bool, enable_analytics_version_prune, default false; no box runtime read and no existing validation touched. At 47d6934d only the description text changed. infra/modules/region-host/tests/group.tftest.hcl (external): APPROVE — adds one mock plan run that expects group mode to refuse enable_analytics_version_prune; test-only, no runtime reads. infra/modules/region-host/tests/analytics_prune.tftest.hcl (external, new; legacy, accepted-legacy, frozen): APPROVE — mock-provider plan assertions only: off by default, the exact two-statement policy when on, nothing on the data bucket, and host_buckets unchanged; no AWS effect and nothing on a box reads it. envelope infra/modules/region-host: APPROVE — the only changes are the counted prune policy, its variable and the added group-mode refusal clause, all covered by the units above; the group precondition is strengthened, not loosened. envelope infra/modules/region-host/tests: APPROVE — one new mock test file and one new expect_failures run; both are test-only Terraform with no runtime reads. envelope internal/analytics: APPROVE — the only non-test change is the new prune.go (Prune, RetentionCutoff, pruneChild, pruneEligible); its one caller is the console (internal/console/analyticsprune.go, out of the root binary), it has no init or package state, and it deletes only exact YYYY-MM-DD.json leaves under a validated BoxPrefix, so root gains no open, run, query or follow. envelope internal/release: APPROVE — new optional S3Store/DirStore capabilities (BatchDeleter/DeleteKeys, VersionPager, VersionDeleter, VersionDirLister, CountedDirLister) are reached only from analytics.Prune; nothing in the root binary type-asserts or calls them, and S3Store.ListDirs now wraps ListDirsWithCount with the same paginator, delimiter and output, only adding a request count.</result> <usage><subagent_tokens>86775</subagent_tokens><tool_uses>2</tool_uses><duration_ms>21316</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>a85041e090a364eeb</task-id> <tool-use-id>toolu_01MzSNnCXqMA1RUppvS3ifS9</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/dbc12c58-9d65-48e0-ba5b-f12ec7bb5a4d/tasks/a85041e090a364eeb.output</output-file> <status>completed</status> <summary>Agent "Opus storage-gate review" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**Fix check: READY.** Both findings are resolved, the fix adds no new storage or permission defect, and no P1 or P2 is open. `go test ./internal/console -run '^TestAnalyticsPrune' -count=1` passes. - **P1-1 (daily cap below the version inflow): RESOLVED.** - The caps are now 2,000,000 deletions and 20,000,000 listed entries, so the ten-minute deadline is the real limit. 2,000,000 deletions is 2,000 S3 DeleteObjects calls. - A pass that doesn't finish now logs a line starting `warning: backlog remains:` and returns an error. This covers a pass left with a saved box, a cancelled run and a timed-out run. The economics job's existing failure path then marks the job failed. - The saved position is still written after a timeout. - `TestAnalyticsPruneDefaultCapsClearBusyFleet` clears 48 boxes × 288 versions (13,824, above the old 10,000 cap) in one pass. - `TestAnalyticsPruneBacklogFailsJobAndResumes` stops a pass on the delete cap, the listing cap and the deadline in turn. Each time it checks the failed job, the warning line, the saved position and that nothing runs again within 23 hours. It then checks that the next day's pass resumes at the saved box, finishes, clears the saved position and leaves the job OK. - `internal/analytics/prune.go`, where the delete check lives, is unchanged. - **P3-1 (IAM wording): RESOLVED.** The comment at `main.tf:449-461` and the variable description now say that IAM's `*` matches `/` and that the code check is the exact boundary. The policy itself is unchanged. The commit (51e7dcd3) only changes the caps, a test hook for the caps, the unfinished-pass warning and error, and comment and description text. The delete paths, the eligibility check, the IAM grant and the once-a-day SQL are untouched. The branch tip has since moved to 47d6934d, which only adds census re-pin data files. P3-2 (confirm the flagship console's role actually has the grant) and P3-3 (one bad listing page ends the whole pass) remain as follow-ups. I appended a "Fix check" section to `/home/paulca/.cache/stats-prune/review-storage-findings.md`.</result> <usage><subagent_tokens>121192</subagent_tokens><tool_uses>4</tool_uses><duration_ms>34450</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bigeq6vi3</task-id> <tool-use-id>toolu_01LA7yzYgua17pifSmo3y9bp</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/dbc12c58-9d65-48e0-ba5b-f12ec7bb5a4d/tasks/bigeq6vi3.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on merged tip" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>blyxv1jpd</task-id> <tool-use-id>toolu_01AMadTGFfMSYZ9SRGoAPauW</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/dbc12c58-9d65-48e0-ba5b-f12ec7bb5a4d/tasks/blyxv1jpd.output</output-file> <status>completed</status> <summary>Background command "Wait for CI rerun on merged tip" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>bi4ht82zi</task-id> <tool-use-id>toolu_014Jq5Ym7drU6fksB9FCwJGx</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/dbc12c58-9d65-48e0-ba5b-f12ec7bb5a4d/tasks/bi4ht82zi.output</output-file> <status>completed</status> <summary>Background command "Wait for CI on new tip" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 57.6 g CO₂e (7,216,579 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on stats-prune-400, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/internal/release/s3_minio_test.go b/internal/release/s3_minio_test.go
index d228ffedd..8ffd1dbc2 100644
--- a/internal/release/s3_minio_test.go
+++ b/internal/release/s3_minio_test.go
@@ -111,9 +111,12 @@ func TestS3StoreMinioVersions(t *testing.T) {
if err != nil || n < 1 || strings.Join(dirs, ",") != run+"apps/a/x/analytics/box1/,"+run+"apps/a/x/analytics/box2/" {
t.Fatalf("version dirs = %v (%d requests), err %v", dirs, n, err)
}
+ // Plain ListDirs on a marker-only tree differs by backend: AWS S3 hides
+ // box2, MinIO still returns it. The prune does not rely on either answer
+ // (it discovers trees by version dirs), so only the live box is required.
live0, err := s.ListDirs(ctx, run+"apps/a/x/analytics")
- if err != nil || len(live0) != 1 {
- t.Fatalf("plain ListDirs = %v, err %v: expected only the live box", live0, err)
+ if err != nil || len(live0) < 1 || live0[0] != run+"apps/a/x/analytics/box1/" {
+ t.Fatalf("plain ListDirs = %v, err %v: expected the live box first", live0, err)
}
// Page by 2 so a page boundary falls inside one key's versions.