Repository navigation
Connect AI usage to developers, delivery and billing - #38
Merged
Merged
Conversation
Add source-aware developer attribution and explicit billing comparison to Recipe. Simplify the canvas with plain-English labels, setup guidance, inline research and an executive Overview map. Keep committed previews synthetic-only. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 50509983-6ac1-467a-82f2-4aec8730c238
2 of 3 tasks
There was a problem hiding this comment.
🟡 Changes recommended
Billing has unresolved display-state and fractional-credit reconciliation errors that can hide reports or suppress valid estimates.
3 open issues
What changed in this PR
Extends the existing Recipe flow to connect captured AI usage with developers, delivery records and explicit GitHub billing comparisons, while keeping estimates separate from measured usage.
Changes:
- Adds developer attribution, historical ownership checks and explicit cross-provider identity links.
- Adds scoped billing reads, per-source comparisons and estimated work costs.
- Simplifies canvas navigation and language, expands setup guidance, and adds regression and screenshot checks.
| File | Description |
|---|---|
tools/README.md |
Documents expanded canvas checks. |
tools/make-canvas-shots.js |
Adds synthetic developer, billing and setup checks. |
test/tokenMeter.test.js |
Updates harness terminology in a test name. |
test/recipeCanvas.test.js |
Tests attribution, billing routes and SDK actions. |
test/recipeBilling.test.js |
Adds billing validation and reconciliation tests. |
test/recipeActors.test.js |
Adds identity, ownership and balance tests. |
test/otelWatcher.test.js |
Updates harness terminology in a test name. |
test/attributionCanvas.test.js |
Checks schema 2 and shared source labels. |
src/tokenMeter.ts |
Updates harness names in comments only. |
src/restore.ts |
Clarifies harness naming in a comment. |
src/otelWatcher.ts |
Updates harness comments and diagnostic text. |
src/otelSummary.ts |
Updates harness naming in a comment. |
src/extension.ts |
Updates connection guidance and diagnostics. |
src/agentHost.ts |
Clarifies the harness description in comments. |
SECURITY.md |
Documents identity and billing data boundaries. |
README.md |
Standardizes harness terminology. |
media/dashboard.js |
Updates displayed telemetry source names. |
docs/research/attribution-model.json |
Introduces schema 2 and billing relationships. |
docs/research/ai-telemetry-attribution.md |
Adds implementation context and descriptive link labels. |
CONTRIBUTING.md |
Defines attribution, billing and naming conventions. |
CHANGELOG.md |
Records the attribution and canvas enhancements. |
.github/extensions/ai-attribution/ui/style.css |
Styles Overview, developer and billing components. |
.github/extensions/ai-attribution/ui/index.html |
Revises the canvas subtitle. |
.github/extensions/ai-attribution/ui/format.mjs |
Centralizes source and attribution labels. |
.github/extensions/ai-attribution/ui/app.js |
Adds Overview and billing state handling; simplifies views. |
.github/extensions/ai-attribution/README.md |
Documents setup, permissions and new actions. |
.github/extensions/ai-attribution/lib/verify.mjs |
Reads authors and historical assignments. |
.github/extensions/ai-attribution/lib/server.mjs |
Exposes identity-link and billing routes. |
.github/extensions/ai-attribution/lib/recipe.mjs |
Retains developer balances and billing usage context. |
.github/extensions/ai-attribution/lib/model.mjs |
Exposes descriptive link methods. |
.github/extensions/ai-attribution/lib/coverage.mjs |
Supplies account/model context and shared labels. |
.github/extensions/ai-attribution/lib/billing.mjs |
Implements scoped billing reads and estimated allocations. |
.github/extensions/ai-attribution/lib/actors.mjs |
Implements identity resolution and developer summaries. |
.github/extensions/ai-attribution/extension.mjs |
Wires panel state, filters and new SDK actions. |
Review effort: Balanced
Comment on lines
+100
to
+106
| try { | ||
| instance.billing = await fetchBilling(scope); | ||
| instance.server.broadcast('recipe', {}); | ||
| return recipeFor(instance); | ||
| } finally { | ||
| instance.readingBilling = false; | ||
| } |
| .sort((a, b) => (b.total.credits ?? -1) - (a.total.credits ?? -1)) } : {}), | ||
| }; | ||
| }; | ||
| const sourceIds = [...new Set(entries.map((entry) => entry.source))]; |
Comment on lines
+118
to
+121
| if (local > gross) modelDifference = true; | ||
| // Never distribute more than the bill. No allocation for model mismatches, | ||
| // unknown consumers or unlinked work; those amounts remain unallocated. | ||
| if (gross > 0 && local <= gross) { |
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 does this change?
Connects captured AI usage to developers, work and delivery, with explicit GitHub billing comparison and clearly separated estimates. Adds an executive Overview, setup and permission guidance, plain-English labels, inline research, and model schema 2 with descriptive link methods.
Why?
Follow-up to #37, based on its merged result. Makes the work-item → branch → AI work → commits → pull request → review → merge/close flow understandable end to end, while keeping billing separate from delivery.
Recorded consumers, work owners and estimated attribution remain distinct. Sources are not summed, missing data stays unknown, and estimated work costs are not presented as GitHub invoices for individual pull requests. Delivery checks and billing reads remain explicit actions.
How was it verified?
npm run typecheckpasses — passed.npm run packagesucceeds — passed.F5) and checked the behaviour by handnpm test— passed: 301 tests, zero failures.npm run check:docs— passed: 10 Markdown files.npm run media:canvas— passed: all canvas views, developer/source filters, billing comparison, themes, keyboard navigation, disclosures and narrow layouts; fixture-only store discovery enforced.npm run media:shots -- dashboard.png dashboard-light.png dashboard-high-contrast.png dashboard-high-contrast-light.png dashboard-sdk.png dashboard-context.png dashboard-account.png dashboard-empty.png dashboard-waiting.png dashboard-credits.png— passed: all 10 dashboard previews.The canvas was loaded in the Copilot app. The VS Code
F5manual check was not run. Delivery and billing checks use injected synthetic responses; no real billing account was queried.src/chatWatcher.tsis unchanged.Screenshots
All previews use synthetic repositories, accounts and API responses; no local work data is included.
Recipe lifecycle and billing · Developer attribution · Setup and permissions