Skip to content

refactor: decompose prune.go by protocol - #97

Merged
ShocOne merged 1 commit into
mainfrom
refactor/decompose-prune
Aug 14, 2026
Merged

refactor: decompose prune.go by protocol#97
ShocOne merged 1 commit into
mainfrom
refactor/decompose-prune

Conversation

@ShocOne

@ShocOne ShocOne commented Aug 14, 2026

Copy link
Copy Markdown
Member

internal/sdkbind/prune.go sat at 799 lines against an 800-line ceiling, so
the next change to it failed scripts/repo_hygiene_gate.sh. handoff.md:251
names it as blocking work: the largest attribute-level refusal family left —
234 carries no Get… to read — lives in this package.

The split

Three files, by protocol rather than by size:

File Lines Contents
prune.go 352 Prune, pruner, resolveType, remove, the four per-kind entities (resource, datasource, listResource, action), settleUpdateBody, copyFieldBindings, unbuildableReason
prune_calls.go 328 Resolving a drafted call against the SDK that has to make it: resolveCall, resolveFieldHop, repairBodySetter, settleCall, writeModelFor, settleParamTypes, repairIndexer, recordTypePackage
prune_list.go 139 Settling how a list call reaches its elements: resolveListElement, sliceGetters, sliceFields, pickByName

The two new files carry a header saying what the group is for — a collection
comes back as a slice, as an envelope with a getter, or as an envelope with a
field, and which of those it is decides what the generated iteration reads.

Measured effect

None, and that is the acceptance test.

unsupported.json is byte-identical on all three pilots — verified with
diff, not by comparing totals:

github         unsupported.json byte-identical
jamfpro        unsupported.json byte-identical
thousandeyes   unsupported.json byte-identical

tfpfgen provider verify reports no drift on all three (3358 / 2935 / 1420
files), and postcheck passes.

No function was renamed, no signature changed, and no comment was rewritten —
the declarations moved and nothing else, so the diff is reviewable as a move.

Gates

  • gofmt -l internal cmd — empty
  • scripts/repo_hygiene_gate.sh — pass (this is what it was failing)
  • golangci-lint run — 0 issues
  • go build ./... && go vet ./... — pass
  • go test ./... — pass, internal/sdkbind 85.0%, 91.4% total

🤖 Generated with Claude Code

At 799 lines it sat one under the ceiling, so the next change to it
failed the gate. It splits three ways: resolving a call against the SDK
that has to make it, settling how a list call reaches its elements, and
what remains — the entry point and the four per-kind entities.

No behaviour change. unsupported.json is byte-identical on all three
pilots and every generated tree reproduces without drift.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ShocOne
ShocOne merged commit f864bc6 into main Aug 14, 2026
2 checks passed
@ShocOne
ShocOne deleted the refactor/decompose-prune branch August 14, 2026 16:34
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