feat(usage): [usage.repo_aliases] folds two names for one project - #49
Closed
as-koshiyama wants to merge 3 commits into
Closed
feat(usage): [usage.repo_aliases] folds two names for one project#49as-koshiyama wants to merge 3 commits into
as-koshiyama wants to merge 3 commits into
Conversation
The same project legitimately earns two rows: a checkout with an origin remote reports owner/name, while a copy of the same code with no remote - a scratch workspace, an agent's own working folder - reports its directory basename. On a real machine that split "HAI Neo" from "holistic-ai/hai-neo", cutting one project's ~$450 of spend into two rows that ranked separately. surface never guesses that two names are one project: folding spend together on a string resemblance is misattribution, the thing the Projects view promises never to do silently. The operator declares it instead, in config, and the declaration is applied where prices are - at read time, never to the stored keys - so an alias added today regroups the whole window retroactively and a wrong one is one edit away from undone. One hop only: an alias pointing at another alias does not chase, so a config cycle cannot loop a scan. Project totals, daily rows and the session breakdown all follow the alias; the session pane filters by the name the row above shows, so sessions recorded under either name attach to the folded row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
kleyt0n
previously approved these changes
Aug 1, 2026
kleyt0n
left a comment
Contributor
There was a problem hiding this comment.
Approved. But make sure that the changes are not generalized and will not provoke any damage to perfomance.
# Conflicts: # CHANGELOG.md # src/ui/mod.rs
This was referenced Aug 9, 2026
Merged
Contributor
Author
|
Superseded by #56, which packs this together with #52 and #51 into one branch for review. @kleyt0n — your review comment here was dismissed before it could be actioned, so it is restated verbatim in #56's body rather than lost with this PR. It is flagged there as still open, not resolved. |
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.
What
The same project legitimately earns two rows in the Projects view: a checkout with an
originremote reportsowner/name, while a copy of the same code with no remote — a scratch workspace, an agent's own working folder — reports its directory basename. On a real machine that splitHAI Neofromholistic-ai/hai-neo, cutting one project's ~$450 of spend into two rows that ranked separately.Design
surface never guesses that two names are one project — folding spend together on a string resemblance is misattribution, the thing the Projects view promises never to do silently. The operator declares it instead:
The declaration is applied where prices are — at read time, never to the stored ledger keys — so an alias added today regroups the whole window retroactively, and a wrong one is one edit away from undone. One hop only: an alias pointing at another alias does not chase, so a config cycle cannot loop a scan. Project totals, daily chart rows,
--json'sby_repo, and the session breakdown all follow the alias (the session pane filters by the name the row above shows, so sessions recorded under either name attach to the folded row).Verification
Three new tests: two names fold into one project across
by_projectandproject_rows; aliases are never persisted and never chase (the stored keys stay raw); and end-to-end at the App layer — one Projects row carrying both names' tokens with both sessions attached. Docs inconfiguration.md(new section),dashboard.md's attribution paragraph, andsurface.example.toml.cargo fmt,clippy -D warnings, all 246 tests pass.Independent of every open PR; needs the usual one-line CHANGELOG rebase after whichever lands first.
🤖 Generated with Claude Code