pbir-authoring-adapter
The Power BI report-AUTHORING adapter (F034 completion). Use when someone asks to apply a generated theme to a committed PBIR report, or (later increments) to set visual formatting or a page background by writing the report's PBIR JSON directly -- the settings a human sets by hand in the Power BI UI. This is a COMPANION execution/authoring adapter (the F029-dbt / F030-Dagster pattern), NOT part of the static DEFINE/CHECK core. It writes committed PBIR JSON within a tight allow-list, deterministically and validated; it uses NO pbi-cli, NO live Power BI, NO external dependency, and NO network. It grants no readiness pass and emits no score.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-11
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- pbir-authoring-adapter
- description
- The Power BI report-AUTHORING adapter (F034 completion). Use when someone asks to apply a generated theme to a committed PBIR report, or (later increments) to set visual formatting or a page background by writing the report's PBIR JSON directly -- the settings a human sets by hand in the Power BI UI. This is a COMPANION execution/authoring adapter (the F029-dbt / F030-Dagster pattern), NOT part of the static DEFINE/CHECK core. It writes committed PBIR JSON within a tight allow-list, deterministically and validated; it uses NO pbi-cli, NO live Power BI, NO external dependency, and NO network. It grants no readiness pass and emits no score.
03 SKILL.md 正文
pbir-authoring-adapter
The adapter that completes F034: it writes the committed PBIR report the kit previously left for a human to build in Power BI Desktop. Authorized by ADR 0015 (owner-ratified 2026-07-05), which lifts spec-001 FR-008/FR-009 for this bounded adapter only -- the static core stays forbidden from writing PBIR.
What it is (and is NOT)
- It is a companion authoring adapter: reads a generated theme (Slice 1
retail theme-gen) + committed PBIR, WRITES committed PBIR JSON within an allow-list, and validates every write. - It is NOT the brain: it defines no metric, mapping, or semantic logic; it writes formatting/wiring, never business meaning.
- It is NOT publish-capable: it stops at the committed on-disk PBIR. Publishing to a live workspace is the parked F016 adapter (separate, gated).
- It does NOT build a dashboard from nothing: it restyles/positions visuals a human authored. "Great professional dashboards" is a design-intelligence layer that would ride on top -- this adapter is the mechanism, not that layer.
The boundary (carry into every increment)
- Allow-list only. Write ONLY the declared formatting/wiring properties (see
templates/pbir-adapter-contract.md). Increment A's allow-list: the report'sthemeCollection.baseTheme+ itsresourcePackagesitem + the BaseTheme resource file. Nothing else -- novisual.json, nopage.jsongeometry, no semantic-model file. - No external dependency. No pbi-cli, no Power BI MCP, no live connection, no
network. stdlib
json+pathlibonly. The tool is complete in itself. - Deterministic + validated + reversible. Byte-identical re-run; reviewable git
diff; stage -> validate (valid JSON +
$schemapreserved + round-trip stable + R1 model-ref + R2 authoring-lint) -> commit-or-roll-back; all-or-nothing. - Evidence, not approval. A successful write is evidence formatting was applied;
it moves NO readiness stage and emits NO score (hard rule #9). The
dashboard_ready/ design-review sign-off stays a named human's decision. - The core polices; the adapter writes.
seshat checkR2 is the read-only core lint over the written report; the writer (src/seshat/pbir_theme_apply.py) is the adapter. The core never writes PBIR (ADR 0015 decision 1).
Increment A -- apply a generated theme (SHIPPED)
retail pbir-apply-theme --repo <root> --table <table> --theme <theme.json> --report <*.Report/> writes the theme
as a BaseTheme resource and repoints report.json's themeCollection at it. Works
on an empty report page (no visuals needed). This is the safe smallest slice.
Increment B -- per-visual formatting (SHIPPED)
retail pbir-format-visual --repo <root> --table <table> --visual <visual.json> --formatting <json> sets
allow-listed formatting under a visual's objects (chart-content: legend, labels,
dataPoint, axes) and visualContainerObjects (chrome: border, title, subTitle,
background, dropShadow) subtrees. The FR-003 guarantee: the visual's data
binding (query + visualType) is asserted byte-identical before+after; the write
is refused if it would change. It formats a visual a human already authored -- it
never binds data or creates a visual. (Latent until a human builds a visual in
Desktop; there is no live target to format yet.)
Increment C -- page background (SHIPPED)
retail pbir-set-page-background --repo <root> --table <table> --asset <img> --report <*.Report/> --page <name> [--scaling Fit|Fill|Normal] sets a page's canvas background to a committed surface-2
image asset: it copies the asset into StaticResources/RegisteredResources/,
registers it in report.json (the RegisteredResources package), and references it
from page.json objects.background via a ResourcePackageItem URL + name +
scaling. Allow-list-only: touches ONLY objects.background + the RegisteredResources
package -- every other page object (e.g. outspacePane) and report key is preserved.
Surface-2 purity: references a static image, bakes no data into it. The wire format
(ResourcePackageItem, PackageType: 1) was taken verbatim from a real
Desktop-authored sample -- it was NOT guessed (increment C was held until that sample
existed).
Increment D -- visual geometry / layout (SHIPPED)
retail pbir-set-geometry --repo <root> --table <table> --visual <visual.json> --position <json> writes ONLY a
visual's layout rectangle -- x, y, width, height, z (stack/tab order) -- for
a visual that already exists and is already on the approved binding-map. It repositions
existing truth; it NEVER changes visualType, creates/deletes a visual, or adds/removes
a page (creation is authoring truth, out of scope here). Off-canvas positions are
rejected; overlap is allowed (a design judgment). Authorized separately by ADR 0016
(the formatting-only ADR 0015 deliberately refuses geometry). No --force: position
keys always pre-exist, so a differs-then-refuse gate would block every real move;
overwrite safety is the reviewable git diff + human ratification.
Hard stops
- STOP before writing anything outside the current increment's allow-list.
- STOP unless the exact table's readiness record is committed and clean, with
semantic_model_ready: passand a complete named-humandashboard_readyapproval. The command gate checks this before reading a mutation payload. - STOP if ADR 0015 is not the recorded authorization (never self-grant the lift).
- STOP at the on-disk PBIR -- never open a live Power BI / workspace (that is F016).
See also
- Authorization:
docs/decisions/0015-pbir-authoring-adapter-lifts-fr008-fr009.md(A/B/C),docs/decisions/0016-pbir-adapter-geometry-increment-d.md(D geometry), anddocs/decisions/0017-pbir-creation-primitive.md(the spec-123 blueprint->PBIR compiler, which CREATES pages/visuals -- a separate capability beyond this adapter). - Spec / plan / tasks:
specs/106-pbir-authoring-adapter/{spec,plan,tasks}.md. - The contract:
templates/pbir-adapter-contract.md. - The enumerated shape + allow-list:
docs/integrations/pbir-adapter.md. - The writer + verb:
src/seshat/pbir_theme_apply.py(retail pbir-apply-theme). - The core lint:
src/seshat/rules/pbir.py(R2). - The theme source consumed:
src/seshat/theme_gen.py(retail theme-gen, Slice 1). - The parked publish adapter (separate): F016.
04 同仓库更多 Skills
fake-skill
A fixture skill with declaring frontmatter, used as positive shipped evidence.
fake-skill
A fixture skill with declaring frontmatter, used as positive shipped evidence.
bare-skill-no-frontmatter
暂无简介
fake-skill
A fixture skill with declaring frontmatter, used as positive shipped evidence.
retail-kpi-knowledge
Retail KPI / metric-contract reasoning layer for BI agents in the Seshat BI project. Use when an agent must reason about the BUSINESS MEANING of a retail KPI before any implementation — defining a KPI in business terms, classifying additivity (fully/semi/non-additive), identifying grain, listing required source fields, resolving ambiguity (gross vs net, VAT, returns, cost method, same-store), choosing an MVP KPI pack, reviewing a metric contract for completeness, or preparing a clean handoff to an implementation layer. Also use it to classify KPI sufficiency or prepare an owner policy decision packet. This is a meaning/definition + review layer, not an executor: it does not write DAX/SQL/Python, grant readiness, approve policy, or design dashboards. See INDEX.md for live/planned routes; registry.yaml is the authoritative machine-readable inventory.
bi-sql-knowledge
SQL reasoning, validation, reconciliation, transformation, diagnostics, and anti-pattern knowledge layer for Seshat BI agents. Use when a task involves reasoning about source SQL: source profiling, table grain, keys & uniqueness, joins & fan-out amplification, aggregation correctness, COUNT/NULL semantics, deduplication, validation queries, reconciliation queries, silver/gold transformation logic, window/date-time analytics, SQL anti-patterns, or basic SQL performance reasoning, or interpretation of a supplied sanitized PostgreSQL JSON execution plan. The SQL counterpart to bi-dax-knowledge. It is a thinking & validation layer, not a database executor, runtime validator, dbt/Dagster project, or automatic tuning service.