fix(costs): attribute Boot token spend separately from Deacon#3454
Open
mk-imagine wants to merge 1 commit intogastownhall:mainfrom
Open
fix(costs): attribute Boot token spend separately from Deacon#3454mk-imagine wants to merge 1 commit intogastownhall:mainfrom
mk-imagine wants to merge 1 commit intogastownhall:mainfrom
Conversation
Boot is modeled as a deacon dog (Role: deacon, Name: boot) in the session identity package. parseSessionName in costs.go did not account for this, so Boot's costs were silently merged into the deacon bucket — making Boot's real token spend invisible in gt costs --by-role output. Add RoleBoot and EmojiBoot constants. Special-case identity.Name==boot in the deacon branch of parseSessionName to return role "boot" instead of "deacon". Boot costs now appear as a distinct line in gt costs output.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes role-based cost attribution by separating Boot’s token spend from Deacon’s, so gt costs --by-role reports Boot as its own line item.
Changes:
- Added a first-class
RoleBootconstant and associatedEmojiBoot. - Updated
RoleEmojito mapRoleBootto the new emoji. - Updated
parseSessionNameto detectRoleDeaconsessions namedbootand attribute them toRoleBoot.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/constants/constants.go | Adds RoleBoot + EmojiBoot and maps the role to its emoji. |
| internal/cmd/costs.go | Special-cases Deacon sessions named boot to attribute costs to the new Boot role. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Boot is modeled in the session identity package as
Role: RoleDeacon, Name: bootrather than as a first-class role.
parseSessionNameincosts.gohad no specialcase for this — Boot's costs were silently merged into the
deaconbucket, makingBoot's real token spend invisible in
gt costs --by-roleoutput.The
deacontotal ingt costswas actually Deacon + Boot combined, with no wayto separate them or audit Boot's per-cycle cost.
Fix
RoleBoot = "boot"constant toconstants.goEmojiBoot = "🐾"and itsRoleEmojiswitch case toconstants.goidentity.Name == "boot"in theRoleDeaconbranch ofparseSessionNameincosts.goto returnconstants.RoleBootinsteadof
constants.RoleDeaconBoot now appears as a distinct
🐾 bootline ingt costs --by-roleoutput.Testing
Ran
gt costs --today --by-roleafter multiple Boot triage cycles with the newbinary.
🐾 bootappears as a separate line from🐺 deaconwith its owncost figure, confirming the attribution is working correctly.