Skip to content

fix(footprint): consistent snake_case keys in -o json - #781

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/footprint-json-keys
Oct 10, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/footprint-json-keys

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

spawn footprint -o json emitted snake_case at the top level and PascalCase
inside it
:

{"control_plane": [{"Service": "logs", "Kind": "log-group", ...}]}

because footprintReport had json tags and ControlPlaneResource did not. A
machine contract shouldn't require knowing which half of the struct you're
reading.

Found while using the command's own output to scope #780 — a Counter over
r['service'] raised KeyError, which is exactly the kind of thing the author
never hits because they wrote the struct.

What did not catch this

The cross-repo API surface gate (#679) is unchanged by this commit, because it
deliberately drops struct tags — "a tag change alters JSON/DynamoDB encoding,
which matters a great deal, but it is not part of the COMPILE contract this gate
guards."

That's still the right scope, but it means a JSON wire-contract change is
invisible to it. Worth knowing; not worth widening the gate, since taskproto's
wire format has its own round-trip tests and footprint's is brand new.

No consumer to break

spawn footprint landed in #771 hours ago and is unreleased. The Tier 0 JSON
test is unaffected — it asserts the top-level keys, which were already
snake_case.

`spawn footprint -o json` emitted snake_case at the top level and
PascalCase inside it:

    {"control_plane": [{"Service": "logs", "Kind": "log-group", ...}]}

because footprintReport had json tags and ControlPlaneResource did not. A
machine contract should not require knowing which half of the struct you
are reading.

Found while using the command's own output to scope #780 — a Counter over
r['service'] raised KeyError, which is the kind of thing the author never
hits because they wrote the struct.

Note what did NOT catch this: the cross-repo API surface gate (#679) is
unchanged by this commit, because it deliberately drops struct tags — "a
tag change alters JSON/DynamoDB encoding, which matters a great deal, but
it is not part of the COMPILE contract this gate guards". That is still
the right scope, but it means a JSON wire-contract change is invisible to
it. Worth knowing; not worth widening the gate, since taskproto's wire
format has its own round-trip tests and footprint's is new.

No consumer exists to break: `spawn footprint` landed in #771 hours ago
and is unreleased.

The Tier 0 JSON test is unaffected — it asserts the top-level keys, which
were already snake_case.
@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 8aab172 into main Oct 10, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the fix/footprint-json-keys branch October 10, 2026 03:00
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