Skip to content

docs: sync schemas and specs with source changes - #7789

Merged
lpcox merged 4 commits into
mainfrom
docs/schema-sync-2026-08-27-22a6586255e90f51
Aug 27, 2026
Merged

docs: sync schemas and specs with source changes#7789
lpcox merged 4 commits into
mainfrom
docs/schema-sync-2026-08-27-22a6586255e90f51

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Syncs schemas/token-usage.schema.json with the AI-credits pricing provenance fields added by commit c8ebd20 ("Add protected enclave entry diagnostics", #7772).

What changed

That commit added containers/api-proxy/guards/ai-credits-guard.js and extended containers/api-proxy/token-tracker-shared.js (mergeBudgetFields) to persist additional pricing-provenance fields into each token-usage.jsonl record whenever apiProxy.maxAiCredits is configured. These fields were being written but were not documented in the schema:

  • ai_credits_pricing_source
  • ai_credits_pricing_tier
  • ai_credits_accounting_policy
  • ai_credits_fallback_pricing_used
  • ai_credits_dynamic_selector
  • ai_credits_pricing_observed_at
  • ai_credits_pricing_api_version
  • ai_credits_pricing_discount_percent

All eight properties were added in alphabetical order alongside the existing ai_credits_this_response / ai_credits_total properties, each with type and description. None are required (they're optional/conditional on apiProxy.maxAiCredits), consistent with the existing ai_credits_this_response treatment.

Other files reviewed, no changes needed

  • docs/awf-config.schema.json / docs/awf-config-spec.md — the enclaves config surface touched by the same commit was already fully documented (§14 + CLI mapping table); the commit's actual src/* changes were file re-exports/facades with no new config fields.
  • schemas/audit.schema.jsonsrc/squid-config.ts and src/logs/log-parser.ts changes in that commit were structural facade/module-split refactors; the wire-format fields (_schema, timestamp, event, client, host, dest, method, status, decision, url) are unchanged.
  • schemas/README.md — no versioning/structure changes.

Generated by Schema & Spec Sync · copilot · auto · 102.3 AIC · ⌖ 7.95 AIC · ⊞ 9K ·

Commit c8ebd20 (Add protected enclave entry diagnostics) introduced new
per-record AI credits pricing provenance fields in
containers/api-proxy/guards/ai-credits-guard.js and
containers/api-proxy/token-tracker-shared.js (mergeBudgetFields), which
are persisted into token-usage.jsonl records but were missing from
schemas/token-usage.schema.json:

- ai_credits_pricing_source
- ai_credits_pricing_tier
- ai_credits_accounting_policy
- ai_credits_fallback_pricing_used
- ai_credits_dynamic_selector
- ai_credits_pricing_observed_at
- ai_credits_pricing_api_version
- ai_credits_pricing_discount_percent

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lpcox
lpcox marked this pull request as ready for review August 27, 2026 18:49
Copilot AI balanced review requested due to automatic review settings August 27, 2026 18:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Synchronizes the token-usage schema with AI-credit pricing provenance emitted by the API proxy.

Changes:

  • Documents eight optional AI-credit provenance fields.
  • Adds type and range constraints.
Show a summary per file
File Description
schemas/token-usage.schema.json Defines pricing provenance properties.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 1/1 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment thread schemas/token-usage.schema.json
Comment thread schemas/token-usage.schema.json Outdated
Comment thread schemas/token-usage.schema.json
lpcox and others added 2 commits August 27, 2026 12:04
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor Author

✅ Copilot review passed with no inline comments.

@github-actions[bot] Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor Author

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.76% 93.77% ➡️ +0.01%
Statements 92.61% 92.63% 📈 +0.02%
Functions 93.16% 93.16% ➡️ +0.00%
Branches 86.04% 86.05% ➡️ +0.01%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@lpcox
lpcox merged commit bb2b292 into main Aug 27, 2026
24 checks passed
@lpcox
lpcox deleted the docs/schema-sync-2026-08-27-22a6586255e90f51 branch August 27, 2026 19:21
Copilot AI pushed a commit that referenced this pull request Aug 27, 2026
* docs: sync token-usage schema with AI credits pricing fields

Commit c8ebd20 (Add protected enclave entry diagnostics) introduced new
per-record AI credits pricing provenance fields in
containers/api-proxy/guards/ai-credits-guard.js and
containers/api-proxy/token-tracker-shared.js (mergeBudgetFields), which
are persisted into token-usage.jsonl records but were missing from
schemas/token-usage.schema.json:

- ai_credits_pricing_source
- ai_credits_pricing_tier
- ai_credits_accounting_policy
- ai_credits_fallback_pricing_used
- ai_credits_dynamic_selector
- ai_credits_pricing_observed_at
- ai_credits_pricing_api_version
- ai_credits_pricing_discount_percent

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Landon Cox <landon.cox@microsoft.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants