Skip to content

Refresh Copilot Studio knowledge and query catalog for FOCUS 1.4#2210

Draft
flanakin wants to merge 3 commits into
flanakin/focus14-phase7-tests-changelogfrom
flanakin/focus14-copilot-studio
Draft

Refresh Copilot Studio knowledge and query catalog for FOCUS 1.4#2210
flanakin wants to merge 3 commits into
flanakin/focus14-phase7-tests-changelogfrom
flanakin/focus14-copilot-studio

Conversation

@flanakin

@flanakin flanakin commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

🛠️ Description

Work item W8b: refreshes the Copilot Studio knowledge files and remaining _v1_2/query-catalog surfaces from FOCUS 1.2/v1_2 to FOCUS 1.4/v1_4. This is the copilot-studio counterpart to #2135 (which already fixed claude-plugin and agent-skills files).

Stacked on flanakin/focus14-phase7-tests-changelog (targets that branch, not dev).

Per-file changes

  • src/templates/finops-hub-copilot-studio/knowledge/schema-reference.md — full rewrite for Costs_v1_4():
    • Title/intro/"Based on FOCUS 1.2" → FOCUS 1.4
    • Added all 10 new FOCUS 1.3/1.4 columns from Costs_final_v1_4: AllocatedMethodDetails, AllocatedMethodId, AllocatedResourceId, AllocatedResourceName, AllocatedTags, ContractApplied, ServiceProviderName, HostProviderName, CommitmentProgramEligibilityDetails, InvoiceDetailId — plus the 12 per-row ContractCommitment* columns also present in Costs_final_v1_4
    • Removed ProviderName/PublisherName rows; replaced with a "Removed in FOCUS 1.4" callout under the new Provider section (renamed from Publisher) pointing to ServiceProviderName/HostProviderName
    • Fixed the synthetic-category KQL snippet that referenced the removed PublisherName
    • Added two hubs enrichment columns caught by the cross-check that were missing even in the old FOCUS-1.2 version: x_BillingAccountName, x_Location
    • Added "no data until a FOCUS 1.4 export ships" caveats for ContractApplied, the ContractCommitment* row fields, and InvoiceDetailId
  • src/templates/finops-hub-copilot-studio/knowledge-descriptions.mdCosts_v1_2()Costs_v1_4() in the schema-reference.md description
  • src/templates/finops-hub-copilot-studio/agent-instructions.md — 4 occurrences of Costs_v1_2()Costs_v1_4() (schema-reference pointer, currency-detection query, scope-discovery query, core rule Hubs v0.1 – Power BI on CM exports #1)
  • src/templates/finops-hub-copilot-studio/knowledge/weekly-report-guide.md — 6 occurrences of Costs_v1_2()Costs_v1_4(); PublisherNameServiceProviderName in Q6 (marketplace costs) and Q7 (marketplace purchases) KQL, since PublisherName is removed in v1_4 and would break those queries
  • src/scripts/Build-QueryCatalog.ps1 — bumped the hardcoded Costs()Costs_v1_2() rewrite (docstring, header text, and regex replacement) to Costs_v1_4()
  • src/queries/catalog/costs-enriched-base.kqlProviderName == 'Microsoft'HostProviderName == 'Microsoft' in the x_CommitmentDiscountUtilizationPotential case (infrastructure-provider check per D3; behavior-identical since down-conversion defines ProviderName = HostProviderName), with an explanatory KQL comment
  • src/queries/catalog/top-other-transactions.kql — projects ServiceProviderName (vendor: Marketplace publisher or Microsoft; never null) in place of the removed ProviderName, PublisherName pair; header column list and note updated
  • src/queries/finops-hub-database-guide.md — same HostProviderName fix in the "All available columns" example query; Costs() table reference swaps the ProviderName/PublisherName rows for HostProviderName and ServiceProviderName (alphabetical positions). The Recommendations() and Transactions() table rows intentionally keep ProviderName — those datasets still carry it in v1_4 (hubs add-on column; verified in Transactions_final_v1_4/Recommendations_final_v1_4; not FOCUS CostAndUsage datasets)

Cross-check results

Programmatically diffed every column listed in the rewritten schema-reference.md against the Costs_final_v1_4 table definition in IngestionSetup_v1_4.kql (ground truth):

  • 175/175 documented columns exist in Costs_final_v1_4 — zero fabricated columns
  • 0 columns in Costs_final_v1_4 missing from the doc after the rewrite (initially found 2 pre-existing gaps unrelated to FOCUS 1.4 — x_BillingAccountName, x_Location — and 12 new ContractCommitment* row columns; all added)

Remaining _v1_2 / "FOCUS 1.2" hits (all justified)

src/templates/agent-skills/finops-toolkit/references/finops-hubs.md:54:
- The unversioned functions (`Costs()`, etc.) return the latest supported FOCUS schema (v1_4).
  Use versioned functions (`Costs_v1_0()`, `Costs_v1_2()`, `Costs_v1_4()`) to pin to a specific schema.

This is the only surviving hit across src/templates/agent-skills/ and src/templates/finops-hub-copilot-studio/. It's legitimate — documents the versioned-function pinning mechanism itself (already corrected by #2135; not a stale "1.2 is latest" claim).

agent-skills/ had no other unresolved hits — #2135 already fixed finops-hubs.md's stale claims and finops-hubs-deployment.md.

Removed-column migration in src/queries/ (initially flagged, now fixed)

The first commit flagged ProviderName/PublisherName references in src/queries/ as out of scope; scope was extended and the second commit (b2d138a4) fixes them. All three files query unversioned Costs(), which resolves to v1_4 where those columns no longer exist, so the queries would have broken on the new schema. Successor picked per usage, per plan D3:

  • "Is this Microsoft-billed data" checks (ProviderName == 'Microsoft') → HostProviderName == 'Microsoft' (infrastructure provider; always Microsoft for Cost Management data). Behavior-identical: the v1_0/v1_2 down-conversion defines ProviderName = HostProviderName.
  • "Who did we buy this from" projections (marketplace/third-party purchase analysis) → ServiceProviderName (vendor; Marketplace publisher or Microsoft; never null).

Remaining ProviderName hits in src/queries/ after the fix — all justified:

  • finops-hub-database-guide.md Recommendations() and Transactions() table rows: those datasets keep ProviderName in v1_4 (hubs add-on column, verified against Transactions_final_v1_4/Recommendations_final_v1_4; not FOCUS CostAndUsage datasets)
  • Explanatory comments/descriptions that mention the removed columns by name, plus the new HostProviderName/ServiceProviderName columns themselves (substring matches)

Verification

  • grep -rn '_v1_2' <touched dirs> — only the one justified hit above
  • Cross-check of schema-reference.md columns vs. Costs_final_v1_4 — 175/175 match, 0 missing, 0 fabricated
  • grep -rn 'ProviderName\|PublisherName' src/queries/ — only the justified hits listed above
  • Build-QueryCatalog.ps1 re-run after the query fixes — generates cleanly; catalog uses Costs_v1_4() throughout with no live removed-column references. Output (query-catalog.md) is gitignored, so nothing to commit.
  • pwsh -Command Invoke-Pester -Path ./src/powershell/Tests/Unit/*2047 passed, 0 failed, 4 skipped (pre-existing skips; nothing asserts on the copilot-studio/query files touched here); re-run green after both commits

📋 Checklist

🔬 How did you test this change?

  • 🤏 Lint tests
  • 🤞 PS -WhatIf / az validate
  • 👍 Manually deployed + verified
  • 💪 Unit tests
  • 🙌 Integration tests

📦 Deploy to test?

  • Hubs + ADX (managed)
  • Hubs + Fabric (manual) — URI:
  • Hubs (manual)
  • Hubs (no data)
  • Workbooks
  • Alerts

🙋‍♀️ Do any of the following that apply?

  • 🚨 This is a breaking change.
  • 🤏 The change is less than 20 lines of code.

🤖 Generated with Claude Code

…OCUS 1.4

Rewrite schema-reference.md for Costs_v1_4() with all 10 new FOCUS 1.3/1.4
columns (Allocated*, ContractApplied, ServiceProviderName, HostProviderName,
CommitmentProgramEligibilityDetails, InvoiceDetailId, 12 ContractCommitment*
row fields), remove the deleted ProviderName/PublisherName columns, and
cross-check every listed column against the Costs_final_v1_4 table
definition. Update agent-instructions.md, knowledge-descriptions.md, and
weekly-report-guide.md from Costs_v1_2()/FOCUS 1.2 to Costs_v1_4(),
replacing removed-column usage (PublisherName -> ServiceProviderName) in
weekly-report-guide.md's KQL queries. Bump Build-QueryCatalog.ps1's
hardcoded Costs() -> Costs_v1_2() rewrite to Costs_v1_4().

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…OCUS 1.4 successors

FOCUS 1.4 removes ProviderName and PublisherName from the Costs dataset;
these queries read unversioned Costs(), which now resolves to the v1_4
schema and would fail on the removed columns.

- costs-enriched-base.kql: ProviderName == 'Microsoft' ->
  HostProviderName == 'Microsoft' (infrastructure-provider check per the
  D3 mapping; identical behavior since down-conversion defines
  ProviderName = HostProviderName), with an explanatory comment.
- top-other-transactions.kql: project ServiceProviderName (vendor that
  makes the service available - Marketplace publisher or Microsoft) in
  place of ProviderName/PublisherName for third-party purchase analysis.
- finops-hub-database-guide.md: same HostProviderName fix in the "All
  available columns" example; Costs() table reference swaps the
  ProviderName/PublisherName rows for HostProviderName and
  ServiceProviderName. The Recommendations() and Transactions() table
  rows keep ProviderName - those datasets still carry it in v1_4 (hubs
  add-on column; not a FOCUS CostAndUsage dataset).

Build-QueryCatalog.ps1 re-run to confirm a clean v1_4 catalog; its
output (query-catalog.md) is gitignored, so there is nothing to commit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@flanakin flanakin mentioned this pull request Jul 15, 2026
30 tasks
…angelog' into flanakin/focus14-copilot-studio

# Conflicts:
#	src/queries/finops-hub-database-guide.md
@flanakin

Copy link
Copy Markdown
Collaborator Author

Synced with the updated base (origin/dev merge incl. #2166's KPI query catalog, plus the ContractCommitments Q4 spec-ID rename).

Conflict: src/queries/finops-hub-database-guide.md — combined base's decimalreal type fix (SEM0019) with this branch's HostProviderName/ServiceProviderName migration; kept ContractedCost/ContractedUnitPrice/EffectiveCost as real per base.

Migrated: src/queries/catalog/commitment-utilization-score.kql (new in #2166) — its x_CommitmentDiscountUtilizationPotential case expression used ProviderName == 'Microsoft' against Costs(), same infrastructure-provider check pattern as costs-enriched-base.kql; migrated to HostProviderName per the established rule.

Verification: Build-QueryCatalog.ps1 re-ran clean; full Pester unit suite green (2117 passed, 0 failed, 4 skipped, including HubsFocusSchemas.Tests.ps1 30-column checks); no conflict markers remain repo-wide.

🤖 Generated with Claude Code

@flanakin flanakin added this to the v15 milestone Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Review 👀 PR that is ready to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants