carlos / platform Public

census: propose media-results-cleanup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 25276ec2a659abb0076edbb8ba7ed2c07654c140 parent 064bd19
3 files changed, +43 −0
  • docs/superpowers/notes/census-proposal-media-results-cleanup.md +27 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-media-results-cleanup.tsv +15 −0
diff --git a/docs/superpowers/notes/census-proposal-media-results-cleanup.md b/docs/superpowers/notes/census-proposal-media-results-cleanup.md
new file mode 100644
index 000000000..660406960
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-media-results-cleanup.md
@@ -0,0 +1,27 @@
+# Census approval: media-results-cleanup
+
+Ruling `census-ruling-media-results-cleanup`. The independent reviewer approves or rejects every change below, 1 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `infra/modules/deployment-buckets/main.tf` `external` | body | unchanged (1) | two lifecycle rules for media-results/ (media-results-expire: current objects after 1 day, noncurrent versions 1 day after they become noncurrent, multipart aborts after 1 day; media-results-delete-markers: expired delete markers) join the existing rules in aws_s3_bucket_lifecycle_configuration.deployment; comment only otherwise; existing rules unchanged; no read, no IAM change |
+| `infra/modules/media-engine/iam.tf` `external` | body | unchanged (1) | the console role customer-managed policy gains ListResultVersions (s3:ListBucketVersions on the deployment bucket, StringLike s3:prefix media-results/*) and DeleteResultVersions (s3:DeleteObjectVersion on <deployment bucket>/media-results/*); conversion role, execution role and every other statement unchanged; no read |
+| `infra/modules/media-engine/tests/media_engine.tftest.hcl` `external` | body | unchanged (1) | console_policy_exact expects the two new statements; mock provider only, no AWS access; no read is added |
+
+Envelopes re-pinned: `infra/modules/deployment-buckets`, `infra/modules/deployment-buckets/tests`, `infra/modules/media-engine`, `infra/modules/media-engine/tests`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Recorded dispositions, which each change must still satisfy:
+
+- `infra/modules/deployment-buckets/main.tf` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-db-region-forward-2;basis=the db-reads/ lifecycle rules (db region forward spec §5.7, J4): two rules beside geoip-noncurrent on the deployment bucket's lifecycle configuration, prepared and not applied until Paul approves docs/superpowers/notes/db-reads-lifecycle-approval.md; no read, no IAM change;rev3=census-ruling-data-lifecycle-336;basis=adds aws_s3_bucket_lifecycle_configuration "data" on the data bucket: noncurrent versions expire after var.data_noncurrent_days, expired delete markers go, multipart aborts after 7 days; no read, no IAM change
+- `infra/modules/media-engine/iam.tf` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-media-conversion;basis=new: task execution role (ECR pull and the log group only); conversion role trusted only by the console role, Allow GetObject on store objects and PutObject on derived/ and media-results/, Deny GetObject on infected objects and any PutObject setting carlos-scan tags, 1 h sessions; the console role's customer-managed policy: AssumeRole on the conversion role, RunTask on this engine's task definitions in its cluster, Describe/Stop/List tasks in the cluster, DescribeTaskDefinition, PassRole of the execution role to ecs-tasks, ListBucket on the deployment bucket.
+- `infra/modules/media-engine/tests/media_engine.tftest.hcl` `external`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-media-conversion;basis=new OpenTofu tests (24 runs: 9 plan and 15 apply, all against mock_provider aws, so no AWS access): task definitions pass the gate's shape, endpoint, role, console, reaper and DNS policies exact, no default route, drill states, output parses. The archive provider is real and writes the reaper's ZIP to a local path during the test.;rev3=census-ruling-media-spike-fixes;basis=assertions follow the module: capabilities must equal {add = [], drop = ["ALL"]}; deadline mountPoints and environment, and every volumesFrom, portMappings, systemControls must be empty (was: absent); new asserts that every list ECS fills in is written and that every DNS Firewall name is fully qualified; domain lists expected with trailing dots. Mock provider only, no AWS access; no read is added.
+
+New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff:
+
+- new `infra/modules/deployment-buckets/tests/media_results.tftest.hcl:external`: reads +file:external; written legacy, accepted-legacy, frozen
+
+Seal: `f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6` → `cdff78129017a0a50c3314be8f383d8a3348630ad6ce7d8660eac868076990d7`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-media-results-cleanup.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index d6b71e9a3..76864d901 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -274,3 +274,4 @@ plan14-root-reads-media-spike-fixes.tsv 194e88ad9cd7413c93b1181c0ac1e962107039ad
plan14-root-reads-media-spike-values.tsv 194e88ad9cd7413c93b1181c0ac1e962107039ad84525e065893a8c14cdb3138
plan14-root-reads-path-routes-across-boxes.tsv f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6
plan14-root-reads-headers-security-allowlist.tsv f959a3626e83650aaad1880eecc3feddebdbd78474937f4c619df658eb46a1d6
+plan14-root-reads-media-results-cleanup.tsv cdff78129017a0a50c3314be8f383d8a3348630ad6ce7d8660eac868076990d7
diff --git a/internal/provision/testdata/plan14-root-reads-media-results-cleanup.tsv b/internal/provision/testdata/plan14-root-reads-media-results-cleanup.tsv
new file mode 100644
index 000000000..f3766f8fa
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-media-results-cleanup.tsv
@@ -0,0 +1,15 @@
+# Census overlay media-results-cleanup, written by census-propose (#369). census-ruling-media-results-cleanup, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-media-results-cleanup.md.
+# 3 body, 0 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 1 new dispositions: 0 reads re-frozen at their disposition with the claim, 1 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+@legacy 5bb338fdf3f8cce33a231065811133980046bd399f3fb9212a8eb29a3af9950b infra/modules/deployment-buckets/main.tf external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-db-region-forward-2;basis=the db-reads/ lifecycle rules (db region forward spec §5.7, J4): two rules beside geoip-noncurrent on the deployment bucket's lifecycle configuration, prepared and not applied until Paul approves docs/superpowers/notes/db-reads-lifecycle-approval.md; no read, no IAM change;rev3=census-ruling-data-lifecycle-336;basis=adds aws_s3_bucket_lifecycle_configuration "data" on the data bucket: noncurrent versions expire after var.data_noncurrent_days, expired delete markers go, multipart aborts after 7 days; no read, no IAM change;rev3=census-ruling-media-results-cleanup;basis=two lifecycle rules for media-results/ (media-results-expire: current objects after 1 day, noncurrent versions 1 day after they become noncurrent, multipart aborts after 1 day; media-results-delete-markers: expired delete markers) join the existing rules in aws_s3_bucket_lifecycle_configuration.deployment; comment only otherwise; existing rules unchanged; no read, no IAM change file:external@0 1ba9fa127309d9d17900f7acb538c9ff77e7b7ca88675db61ff643147ef6a28d
+@legacy ec55d3c63d78859bba74f11cdd304ad9899a9e65f0398c7f9406a2deb2377173 infra/modules/media-engine/iam.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: task execution role (ECR pull and the log group only); conversion role trusted only by the console role, Allow GetObject on store objects and PutObject on derived/ and media-results/, Deny GetObject on infected objects and any PutObject setting carlos-scan tags, 1 h sessions; the console role's customer-managed policy: AssumeRole on the conversion role, RunTask on this engine's task definitions in its cluster, Describe/Stop/List tasks in the cluster, DescribeTaskDefinition, PassRole of the execution role to ecs-tasks, ListBucket on the deployment bucket.;rev3=census-ruling-media-results-cleanup;basis=the console role customer-managed policy gains ListResultVersions (s3:ListBucketVersions on the deployment bucket, StringLike s3:prefix media-results/*) and DeleteResultVersions (s3:DeleteObjectVersion on <deployment bucket>/media-results/*); conversion role, execution role and every other statement unchanged; no read file:external@0 77895122f69cc48843656678049b0e606eacc669fefff85d30c4343becbdfdee
+@legacy 257d8c612bb5984c7de5700fe4bb8a78d8978d0420b0fd219474c65fb7ccaa02 infra/modules/media-engine/tests/media_engine.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new OpenTofu tests (24 runs: 9 plan and 15 apply, all against mock_provider aws, so no AWS access): task definitions pass the gate's shape, endpoint, role, console, reaper and DNS policies exact, no default route, drill states, output parses. The archive provider is real and writes the reaper's ZIP to a local path during the test.;rev3=census-ruling-media-spike-fixes;basis=assertions follow the module: capabilities must equal {add = [], drop = ["ALL"]}; deadline mountPoints and environment, and every volumesFrom, portMappings, systemControls must be empty (was: absent); new asserts that every list ECS fills in is written and that every DNS Firewall name is fully qualified; domain lists expected with trailing dots. Mock provider only, no AWS access; no read is added.;rev3=census-ruling-media-results-cleanup;basis=console_policy_exact expects the two new statements; mock provider only, no AWS access; no read is added file:external@0 ea0c744b68641b745682be8646a39d1caea6b395d995002c75b6de6e8f746ee6
+@legacy 1ebb3fc78dc6f7cb9ec33c289f7285a42274d65f0b0159c54daf31acc993dee1 infra/modules/deployment-buckets/tests/media_results.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-results-cleanup;basis=new OpenTofu test (2 plan runs, mock_provider aws, no AWS access): asserts the two media-results/ rules and that the geoip, db-reads and data-bucket rules are unchanged; no read file:external@0 f1b8e9ae1f4f04b362f0773ddf28284e31c8b4d03f7cde5f7f62c7c586833a89
+infra/modules/deployment-buckets/main.tf external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-db-region-forward-2;basis=the db-reads/ lifecycle rules (db region forward spec §5.7, J4): two rules beside geoip-noncurrent on the deployment bucket's lifecycle configuration, prepared and not applied until Paul approves docs/superpowers/notes/db-reads-lifecycle-approval.md; no read, no IAM change;rev3=census-ruling-data-lifecycle-336;basis=adds aws_s3_bucket_lifecycle_configuration "data" on the data bucket: noncurrent versions expire after var.data_noncurrent_days, expired delete markers go, multipart aborts after 7 days; no read, no IAM change;rev3=census-ruling-media-results-cleanup;basis=two lifecycle rules for media-results/ (media-results-expire: current objects after 1 day, noncurrent versions 1 day after they become noncurrent, multipart aborts after 1 day; media-results-delete-markers: expired delete markers) join the existing rules in aws_s3_bucket_lifecycle_configuration.deployment; comment only otherwise; existing rules unchanged; no read, no IAM change file:external@0 1ba9fa127309d9d17900f7acb538c9ff77e7b7ca88675db61ff643147ef6a28d
+infra/modules/media-engine/iam.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new: task execution role (ECR pull and the log group only); conversion role trusted only by the console role, Allow GetObject on store objects and PutObject on derived/ and media-results/, Deny GetObject on infected objects and any PutObject setting carlos-scan tags, 1 h sessions; the console role's customer-managed policy: AssumeRole on the conversion role, RunTask on this engine's task definitions in its cluster, Describe/Stop/List tasks in the cluster, DescribeTaskDefinition, PassRole of the execution role to ecs-tasks, ListBucket on the deployment bucket.;rev3=census-ruling-media-results-cleanup;basis=the console role customer-managed policy gains ListResultVersions (s3:ListBucketVersions on the deployment bucket, StringLike s3:prefix media-results/*) and DeleteResultVersions (s3:DeleteObjectVersion on <deployment bucket>/media-results/*); conversion role, execution role and every other statement unchanged; no read file:external@0 77895122f69cc48843656678049b0e606eacc669fefff85d30c4343becbdfdee
+infra/modules/media-engine/tests/media_engine.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-conversion;basis=new OpenTofu tests (24 runs: 9 plan and 15 apply, all against mock_provider aws, so no AWS access): task definitions pass the gate's shape, endpoint, role, console, reaper and DNS policies exact, no default route, drill states, output parses. The archive provider is real and writes the reaper's ZIP to a local path during the test.;rev3=census-ruling-media-spike-fixes;basis=assertions follow the module: capabilities must equal {add = [], drop = ["ALL"]}; deadline mountPoints and environment, and every volumesFrom, portMappings, systemControls must be empty (was: absent); new asserts that every list ECS fills in is written and that every DNS Firewall name is fully qualified; domain lists expected with trailing dots. Mock provider only, no AWS access; no read is added.;rev3=census-ruling-media-results-cleanup;basis=console_policy_exact expects the two new statements; mock provider only, no AWS access; no read is added file:external@0 ea0c744b68641b745682be8646a39d1caea6b395d995002c75b6de6e8f746ee6
+infra/modules/deployment-buckets/tests/media_results.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-media-results-cleanup;basis=new OpenTofu test (2 plan runs, mock_provider aws, no AWS access): asserts the two media-results/ rules and that the geoip, db-reads and data-bucket rules are unchanged; no read file:external@0 f1b8e9ae1f4f04b362f0773ddf28284e31c8b4d03f7cde5f7f62c7c586833a89
+@coverage infra/modules/deployment-buckets 6cbf34efe196a9e47feae78e94bd36968f57a40e11b1719cdefbb493d417b36b
+@coverage infra/modules/deployment-buckets/tests 28adb3f47aa32b5266825a2372acb9f90200e00c1401bd02a9b579db4596022c
+@coverage infra/modules/media-engine 2343511421fc0a4c27d7db1725f32bf7cb8bc02f55e239e7c7a725ea2543950d
+@coverage infra/modules/media-engine/tests 8c5507eeb9d15191608944fc455ac0bca7888b43d299d3d1ff30789af83ad93a