Skip to content

Connect AI usage to developers, delivery and billing - #38

Merged
obrocki merged 1 commit into
mainfrom
obrocki-ai-attribution-recipe-tab
Oct 22, 2026
Merged

obrocki merged 1 commit into
mainfrom
obrocki-ai-attribution-recipe-tab

Conversation

@obrocki

@obrocki obrocki commented Oct 22, 2026

Copy link
Copy Markdown
Owner

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 typecheck passes — passed.
  • npm run package succeeds — passed.
  • Loaded in an Extension Development Host (F5) and checked the behaviour by hand
  • npm 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 F5 manual check was not run. Delivery and billing checks use injected synthetic responses; no real billing account was queried. src/chatWatcher.ts is unchanged.

Screenshots

All previews use synthetic repositories, accounts and API responses; no local work data is included.

Executive Overview and source-to-Recipe map

Recipe lifecycle and billing · Developer attribution · Setup and permissions

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
@obrocki
obrocki merged commit 661e9db into main Oct 22, 2026
4 checks passed
@obrocki
obrocki deleted the obrocki-ai-attribution-recipe-tab branch October 22, 2026 12:10
@obrocki
obrocki requested a balanced review from Copilot October 22, 2026 12:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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) {
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.

2 participants