carlos / platform Public

usage-attribution-390: Astra round 2 READY (no P1, no P2); census and record-write census approved; Unattributed field comment matches the rule

Follow-up list (P3, not a round): status_instances.go's comment above the
unattributed note still says the console joins readings to instance
records; fix it with the next root-package change (a byte there re-pins the
census envelope).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 8bd9e6a01b043f28d50497e597fcb99f2d1f902f parent f039c92
2 files changed, +29 −5
  • docs/superpowers/reviews/CODEX-FINDINGS-usage-attribution-390-r2.md +23 −0
  • internal/console/apistatusinstances.go +6 −5

CI passed — run details

diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-usage-attribution-390-r2.md b/docs/superpowers/reviews/CODEX-FINDINGS-usage-attribution-390-r2.md
new file mode 100644
index 000000000..2cb1b45d0
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-usage-attribution-390-r2.md
@@ -0,0 +1,23 @@
+R1 finding 1 (P1) — **resolved**: `created_at` no longer establishes ownership; untagged custom-domain readings remain unattributed.
+R1 finding 2 (P1) — **resolved**: historical attribution no longer uses current records, reports, or routes.
+R1 finding 3 (P1) — **resolved**: tenant-stamped bespoke units are unattributed on every box.
+R1 finding 4 (P2) — **resolved**: a nonempty `unreadable` set refuses census creation.
+R1 finding 5 (P2) — **resolved**: billing no longer reads sidecar records for attribution, removing the failed-read-to-zero path.
+R1 finding 6 (P2) — **resolved**: excluded records’ hosts are marked covered before route fallback.
+R1 finding 7 (P2) — **resolved**: the census includes sidecar records from live and trashed apps, with placement exclusions.
+
+No outstanding P1 or P2 findings.
+
+1. **P3 — §§2–3: Comments still describe the removed attribution algorithm.**
+ **Problem and evidence:** [apistatusinstances.go:90](/home/paulca/amadan.net/carlos/platform-usage-attrib/internal/console/apistatusinstances.go:90) describes creation-time, report, and route fallbacks; [status_instances.go:141](/home/paulca/amadan.net/carlos/platform-usage-attrib/status_instances.go:141) says ownership comes from instance records. Neither matches [usageattrib.go:151](/home/paulca/amadan.net/carlos/platform-usage-attrib/internal/console/usageattrib.go:151).
+ **Failure scenario:** A maintainer investigating attribution follows an ownership rule deliberately removed after round 1. No current runtime failure.
+ **Fix:** Update these comments to describe live tags, account namespaces, and the stamped-unit exclusion. Keep this on the follow-up list.
+ **Fault family:** Attribution documentation must match the implemented evidence requirements.
+
+Validation: targeted tests could not start because the read-only sandbox prevented Go from creating its work directory. Mutation results were not independently rerun. Formatting checks on the inspected Go files passed. `git diff --check` reported only Markdown hard-break whitespace in the committed R1 findings. No files were edited.
+
+**Root census, envelope `.` — APPROVE.** Reviewed [status_instances.go:36](/home/paulca/amadan.net/carlos/platform-usage-attrib/status_instances.go:36), the printer at line 102, copy values at line 154, and their formatting helpers. The changes decode a boolean and select printed text. They introduce no new root open, execution, query, path traversal, or weakened validation.
+
+**Record-write census, `Server.handleAPIStatusInstances` — APPROVE.** Reviewed [apistatusinstances.go:98](/home/paulca/amadan.net/carlos/platform-usage-attrib/internal/console/apistatusinstances.go:98) through its response, including attribution and app-name reads. No record write is added, moved, or reclassified; the `key-site` / `lit:instances` disposition retained at [usage_attribution_390_census_test.go:17](/home/paulca/amadan.net/carlos/platform-usage-attrib/internal/provision/usage_attribution_390_census_test.go:17) remains appropriate.
+
+**READY**
\ No newline at end of file
diff --git a/internal/console/apistatusinstances.go b/internal/console/apistatusinstances.go
index fa7ff5144..0e2b845c8 100644
--- a/internal/console/apistatusinstances.go
+++ b/internal/console/apistatusinstances.go
@@ -87,11 +87,12 @@ type apiStatusInstance struct {
// operator asking what is on the box wants the box's own overhead in the
// picture, clearly labelled rather than silently dropped.
Platform bool `json:"platform,omitempty"`
- // Unattributed marks an instance's unit whose owner cannot be
- // established: no tag from its box, no record that existed when the
- // reading was taken, no report or console-box route for a host with no
- // record. Account and App are empty; Host is the unit's. The economics
- // passes count such a reading against no account.
+ // Unattributed marks a tenant's unit whose account cannot be
+ // established (usageattrib.go): no tag from its box, and a host in no
+ // live account's namespace, or a unit stamped on a tenant's console-box
+ // route. Account and App are empty; Host is the unit's host (the unit
+ // itself for a stamped unit). The economics passes count such a reading
+ // against no account.
Unattributed bool `json:"unattributed,omitempty"`
}