Repository navigation
Description
The problem
The codebase carries the name Betty throughout — 35 files under emulator/betty*.go, 93 occurrences in Go source, the Betty CFN resource types heading repeated ~40 times in docs/services.md, and 8 lines of README.md. It refers to another, unrelated project. Nothing in substrate's own model needs the name: the code behind it is CloudFormation template deployment, cost/quota validation of a recorded run, and a time-travel debug session — all of which describe themselves.
The cost is real if unglamorous. A reader grepping for CloudFormation deployment does not find betty_cfn.go; a new contributor has no way to learn what "Betty" designates; and docs/services.md advertises a Betty CFN resource types section per service, so the name is on the public documentation of every one of 65 plugins.
What is externally facing, and what is not
Measured rather than assumed. Only two exported identifiers contain the name:
emulator.BettyClient(emulator/betty.go:80)emulator.NewBettyClient(emulator/betty.go:91)
Intent, DeployResult, DeployedResource, ValidationReport, DebugSession, StackDeployer and every method on them are already neutrally named. So the deprecation surface is two symbols, and everything else — file names, unexported identifiers, comments, docs headings — can be renamed outright with no consumer impact.
Plan
Now, no deprecation needed (internal only):
- Rename the 35
emulator/betty*.gofiles to what they contain:betty.go→client.go,betty_cfn.go→cfn_deployer.go,betty_report.go→validation_report.go,betty_debug.go→debug_session.go,betty_cfn_*→cfn_*. Thebetty_cfn_vNN_plugins.gofiles are named for the release that added them rather than their contents; renaming them tocfn_resources_<service-group>.gois a judgement call to settle in review, and could be deferred to keep this diff reviewable. - Drop the name from comments and from the
Betty CFN resource typesheading indocs/services.md(generated — the change belongs incmd/gen-service-reference/main.go, andmake docs-reference-checkgates it). Proposed replacement: CloudFormation resource types. - Update
README.md,docs/fidelity.md,examples/README.md, and renameexamples/betty_workflow/→examples/validation_workflow/. - Rename the
area: bettyGitHub label — it is part of the same naming and is on this issue.gh label edit "area: betty" --name "area: cloudformation"preserves it on every issue already carrying it, where deleting and recreating would not. - Leave
.github/ISSUE_TEMPLATE/feature_request.yml:44alone:"v0.6.0 — Betty integration"is a historical release label, and rewriting history in a dropdown makes past issues unmatchable.
Deprecation schedule for the two exported symbols:
| Release | Action |
|---|---|
| next minor | Add Client / NewClient as the real implementation. BettyClient becomes a type alias (type BettyClient = Client) and NewBettyClient a one-line wrapper, both marked // Deprecated: use Client / NewClient. BettyClient will be removed in v1.0.0. A type alias rather than a distinct type, so a consumer holding a *BettyClient and a *Client interchangeably keeps compiling. |
| every release until removal | The aliases stay, tested, so go vet/staticcheck flags a consumer's use without breaking their build. |
| v1.0.0 | Remove both, noted in the CHANGELOG under Removed. |
Two exported symbols behind aliases is a cheap deprecation, and v1.0.0 is the only place a Go module can remove exported API without breaking the import path — so tying removal to it rather than to a date is what the module system asks for.
Acceptance criteria
-
grep -ril bettyover*.go,docs/,examples/andREADME.mdreturns only the deprecation aliases and their doc comments (CHANGELOG.mdand the issue-template release label are exempt — both are historical records). -
emulator.Client/emulator.NewClientexist and are what the docs and examples use. -
BettyClientandNewBettyClientstill compile, still work, are marked// Deprecated:naming the replacement and the removal release, and are covered by a test asserting the alias resolves to the same type. -
docs/services.mdsays CloudFormation resource types, generated bycmd/gen-service-reference—make docs-reference-checkclean. - Full verification suite clean:
gofmt -l .,go build ./...,go vet ./...,golangci-lint run ./...→ 0 issues,make test,make docs-reference-check docs-versions,npm --prefix docs run build,test/e2e. - The
area: bettylabel is renamed in place, so existing issues keep it. - The rename is pure: no behaviour change in the same PR, so the diff is reviewable as a rename and a bisect over it cannot land on a mixed commit.
Notes
Best done as its own PR with no other change riding along, and worth doing before v1.0.0 regardless of this issue, since that is when the aliases can be removed. #371 (managing flat-package growth) touches the same files and should be sequenced after this, not merged with it — a rename and a repackaging in one diff is unreviewable.
Activity