Skip to content

fix(#756): stop filing published members as bookkeeping leaks - #1306

Merged
scttfrdmn merged 2 commits into
mainfrom
fix/756-published-member-collisions
Sep 30, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
fix/756-published-member-collisions

Conversation

@scttfrdmn

@scttfrdmn scttfrdmn commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

The wire-bookkeeping ratchet reported 330 declared, 13 projected, 317 still reachable after the
EFS projection landed (#1304). The denominator was wrong.

scripts/check-wire-bookkeeping.sh keys on the Go identifier, not the rendered json tag, because
the identifier is the only stable key — one AccountID renders as json:"a" and one Region as
json:"r", and a tag-name scan would miss both. The cost of that choice is a false positive class:
a field whose Go identifier is one of the five but whose member the service actually publishes.
A line in the baseline means "owed a deletion", and deleting one of these would drop a member AWS
does publish — so the entry is worse than useless, it points at the wrong fix.

Eleven such lines were in the baseline. Each was verified against the operation's own AWS reference
page rather than classified by eye:

Field Published as
ecs_types.go ECSService.CreatedAt API_Service → createdAt
acm_types.go ACMCertificate.CreatedAt API_CertificateDetail → CreatedAt, Timestamp
redshiftdata_types.go RedshiftDataStatement.CreatedAt API_DescribeStatement → CreatedAt
batch_plugin.go BatchJob.CreatedAt API_JobDetail → createdAt, Type: Long, epoch ms
firehose_types.go FirehoseDeliveryStream.CreatedAt API_DeliveryStreamDescription → CreateTimestamp, Timestamp
health_plugin.go HealthEvent.Region API_Event → region
ec2_spot_placement_control.go ec2SpotPlacementScoreSeed.Region API_SpotPlacementScore → region
organizations_types.go OrgCreateAccountStatus.AccountID API_CreateAccountStatus → AccountId
iam_types.go IAMRoleLastUsed.Region API_RoleLastUsed → Region
iam_service_linked_roles.go IAMSLRRoleUsage.Region API_RoleUsageType → Region
ecr_wire.go ecrRepositoryOut.CreatedAt API_Repository → createdAt

The last is the sharpest illustration: that struct is the wire struct #1090 added to fix ECR, so
the baseline was filing the fix as part of the defect.

Firehose's is the case the identifier key costs the most. The field is tagged
json:"CreateTimestamp", so the rendered name was right all along — only the Go identifier
collides, and the field-name scan that exists to catch json:"a" catches this too. Its AccountID
and Region stay in the baseline; that same page publishes neither.

All eleven join batchJobSummary.CreatedAt in a per-site exclusion map, keyed file/type/field so an
exclusion cannot spread to another struct by accident. The narrowness is load-bearing and was
checked: batchJobSummary.CreatedAt is excluded while BatchJob.AccountID and BatchJob.Region
remain, and all four ECRRepository lines remain.

One retraction

BatchJob.CreatedAt was not an oversight — the previous header kept it deliberately, on the
argument that BatchJob's AccountID and Region leak alongside it. That is the wrong unit of
analysis: the exclusion is per field, and a leaking sibling says nothing about this one. AWS's
API_JobDetail publishes createdAt as Type: Long, "the Unix timestamp (in milliseconds) for
when the job was created", which is exactly what the field is (int64, epoch ms, set from
p.tc.Now().UnixNano() / int64(time.Millisecond)), and DescribeJobs marshals the persisted record
straight into {"jobs": […]}. The header now says so and retracts the old reasoning. AccountID
and Region stay in the baseline, where JobDetail publishing neither is what puts them.

The honest count

check-wire-bookkeeping: ok — 319 declared, 13 projected across 4 records, 306 still reachable (#756)

No projected entry changed; no EFS or ECRRepository line moved.

Not a leak is not the same as correct — #1305

Three of the eleven publish the right name and the wrong type. ACM's, Redshift Data's and
Firehose's are time.Time, so they render RFC3339 where all three services' JSON protocol publishes
a Timestamp as epoch seconds (ECS already uses EpochSeconds, which is what right looks like). That
is a live decode failure for an SDK consumer, not a cosmetic one. It is filed as #1305 — which this
PR widens from two fields to three — and named at the point of exclusion, because "excluded from
this check" must not read as "correct".

Also recorded

The header's "the count is an upper bound" paragraph now names two structs that are matched but
cannot leak, rather than one: accountRegionRequest.AccountID (a request decode struct) and
orgPendingAccountOutcome.AccountID (a control-plane seed record, read at request time and rendered
into no body). Both stay in the baseline and are named instead of excluded, because there is no
lexical way to tell such a struct from a response struct, and excluding by a name suffix would be a
heuristic that silently drops real surface.

Verification

make lint (0 issues), make test (race, -count=1, all green), and all seven drift gates:
docs-reference-check docs-versions version-check discarded-unmarshal-check wire-bookkeeping-check operation-catalog-check operation-docs-check.

Refs #756
Refs #1305

The wire-bookkeeping check keys on the Go identifier, because that is the only
stable key — one AccountID renders as `json:"a"` and one Region as `json:"r"`,
so a tag-name scan would miss both. The cost is that a field whose identifier
is one of the five but whose *member* the service publishes is recorded as a
defect owed a deletion, and deleting it would drop something AWS does publish.

Ten such lines were in the baseline. Each was checked against the operation's
own reference page rather than classified by eye: ECS `Service.createdAt`, ACM
`CertificateDetail.CreatedAt`, Redshift Data `DescribeStatement.CreatedAt`,
Batch `JobDetail.createdAt`, Health `Event.region`, EC2
`SpotPlacementScore.region`, Organizations `CreateAccountStatus.AccountId`, IAM
`RoleLastUsed.Region` and `RoleUsageType.Region`, and `ecrRepositoryOut
.CreatedAt` — a field on the wire struct #1090 *added* to fix ECR, so the
baseline was filing the fix as part of the defect.

They join `batchJobSummary.CreatedAt` in a per-site exclusion map keyed
file/type/field, so an exclusion cannot spread to another struct by accident.
Batch's JobDetail line had been kept on purpose, on the argument that
BatchJob's AccountID and Region leak alongside it; that is the wrong unit of
analysis — the exclusion is per field, and a leaking sibling says nothing about
this one. Those two siblings stay in the baseline, where JobDetail publishing
neither is what puts them.

The honest count is 320 declared, 13 projected, 307 still reachable.

Two of the ten publish the right name and the wrong type: ACM's and Redshift
Data's CreatedAt are time.Time, so they render RFC3339 where both services'
JSON protocol publishes epoch seconds. That is a live decode failure rather
than a cosmetic one, and it is filed as #1305 and named at the exclusion,
because "not a bookkeeping leak" must not read as "correct".

Refs #756
Refs #1305
@codecov

codecov Bot commented Sep 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

FirehoseDeliveryStream.CreatedAt renders as json:"CreateTimestamp", and
API_DeliveryStreamDescription publishes CreateTimestamp, Type: Timestamp,
Required: No. It is the case the identifier key costs the most — the rendered
name was right all along, and only the Go name collides with the five.

Its AccountID and Region stay in the baseline; that same page publishes neither.

The type is still wrong (time.Time renders RFC3339 where Firehose's JSON
protocol publishes epoch seconds), so #1305 now names three fields rather than
two.

319 declared, 13 projected, 306 still reachable.

Refs #756
Refs #1305
@scttfrdmn
scttfrdmn merged commit 1a07504 into main Sep 30, 2026
15 checks passed
@scttfrdmn
scttfrdmn deleted the fix/756-published-member-collisions branch September 30, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant