[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77JDPB5CTDSCTPN33QQ8W8Q":3,"skill-same:01M77JDPB5CTDSCTPN33QQ8W8Q":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M77JDPB5CTDSCTPN33QQ8W8Q","retail-semantic-check",null,"Compute the Semantic Model Ready (Stage 5) readiness verdict for a committed Power BI PBIP model in the Seshat BI repo. Use after Gold Ready is `pass`, when someone asks whether the semantic model is ready, to check that every measure binds to an approved metric contract, or before any dashboard\u002FPBIP work. READ-ONLY and invoke-and-interpret only: it runs the existing `seshat check` gate, reads the committed TMDL and the filled metric-contract store (F009), and emits ONE status (not_started | blocked | warning | pass) with evidence + blockers, then STOPS. It NEVER edits TMDL, NEVER defines\u002Fapproves a metric contract (that is F009), and NEVER calls the Power BI execution adapter (official Power BI MCP \u002F connection; `pbi-cli` no longer preferred) -- that is F016.","Kemetra\u002FSeshat-BI","Kemetra","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F206601658?v=4","01M77J5APND9QAJK8XMBH5B1A8","01M77J5AR4TM1GN2G4GS5KH02J",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FKemetra\u002FSeshat-BI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fretail-semantic-check\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: retail-semantic-check\ndescription: >-\n  Compute the Semantic Model Ready (Stage 5) readiness verdict for a committed\n  Power BI PBIP model in the Seshat BI repo. Use after Gold Ready is\n  `pass`, when someone asks whether the semantic model is ready, to check that every\n  measure binds to an approved metric contract, or before any dashboard\u002FPBIP work.\n  READ-ONLY and invoke-and-interpret only: it runs the existing `seshat check` gate,\n  reads the committed TMDL and the filled metric-contract store (F009), and emits ONE\n  status (not_started | blocked | warning | pass) with evidence + blockers, then\n  STOPS. It NEVER edits TMDL, NEVER defines\u002Fapproves a metric contract (that is F009),\n  and NEVER calls the Power BI execution adapter (official Power BI MCP \u002F connection;\n  `pbi-cli` no longer preferred) -- that is F016.\n---\n\n# retail-semantic-check\n\n`seshat check` proves the model is mechanically clean (PascalCase measures, display\nfolders, DIVIDE, single-direction relationships, a marked date table, gold-only\npartitions, parameterized connection, no real host). This skill answers the larger\nquestion that clean text alone cannot: **is the semantic model GOVERNED** -- does\nevery measure trace to an APPROVED metric contract, with the gold star already\nlive-validated underneath it? It computes the Stage-5 verdict and STOPS -- the live\nsibling of `retail-govern` \u002F `retail-validate`, one layer up: it governs the SEMANTIC\nMODEL, not the SQL. It implements the procedure that\n`docs\u002Freadiness\u002Fsemantic-model-ready.md` specifies; it redefines nothing.\n\n## Scope boundary (read first)\n\nInvoke-and-interpret only, and READ-ONLY.\n\n- **CHECKS the model.** Reads the committed PBIP TMDL, reads the filled\n  metric-contract store, runs `seshat check`, evaluates the contract-binding\n  criterion, and emits one readiness verdict. All side-effect-free reads over\n  committed text -- the same category as `retail-govern` reading TMDL.\n- **NEVER DEFINES contracts (F009).** The metric-contract store (name, grain, formula\n  intent, owner, approval) is defined and owned by feature F009 (the `metric-contract`\n  template + the `metric-contract-store` guide). This skill is the CONSUMER: it reads\n  contracts to test the binding; it never creates, edits, or approves one.\n- **NEVER AUTHORS or EXECUTES the model (F016, deferred + gated).** It writes no TMDL, adds\u002Fedits\n  no measure \u002F relationship \u002F date marker, opens no DB connection, and calls no\n  the Power BI execution adapter (official Power BI MCP \u002F connection; `pbi-cli` no\n  longer preferred) (constitution Principle II; roadmap hard rule #6 -- F016\n  is last and gated on THIS stage being `pass`). It reads an EXISTING model and\n  reports; a human edits Power BI Desktop and re-saves the PBIP to remediate.\n\n## Prerequisites\n\n- The prior stage **Gold Ready is `pass`** -- read it from the canonical\n  `mappings\u002F\u003Ctable>\u002Freadiness-status.yaml` (ADR 0004; shaped to\n  `templates\u002Freadiness-status.yaml`). This stage sits AFTER the live-validation hard\n  gate (no gold to Power BI before validation, roadmap rule #4). If Gold Ready is not\n  `pass`, the verdict is `not_started` and the skill STOPS.\n- The committed PBIP model exists under `powerbi\u002F\u003CModel>.SemanticModel\u002Fdefinition\u002F`.\n- The metric-contract store (F009) -- the FILLED, per-table contracts -- may or may\n  not exist. Its absence is not an error; it is the reason the verdict is `blocked`\n  (see the central property below).\n\n## The store is FILLED contracts, not the template (read this before binding)\n\nF009 ships the TEMPLATE (`templates\u002Fmetric-contract.yaml`) and the authoring guide\n(`docs\u002Fmetrics\u002Fmetric-contract-store.md`). The TEMPLATE is the shape, NOT the store.\nA binding target is a FILLED, owner-APPROVED contract at the canonical store location:\n\n```\nmappings\u002F\u003Ctable>\u002Fmetrics\u002F\u003CMetricName>.yaml   # filled per-table contracts (the store)\nmetrics\u002Fpacks\u002F\u003Cpack_name>.yaml               # reusable KPI packs (group filled contracts)\n```\n\nNEVER treat the existence of `templates\u002Fmetric-contract.yaml` (or `kpi-pack.yaml`) as\n\"the store is present\". The template existing is the F009 deliverable; it binds to\nnothing. If no filled contract exists for a measure, that measure is unbound -> a\n`blocking_reason`.\n\n## The central property: a green `seshat check` is NECESSARY, not SUFFICIENT\n\nA clean mechanical gate (`seshat check` exit 0) does NOT make this stage `pass`.\n`pass` ALSO requires the contract-binding criterion satisfied AND the metric owner's\napproval recorded as evidence. Emitting `pass` on a green checker alone would be a\nsilent governance hole -- a perfectly-formed model whose measures bind to nothing.\nWhen the gate is green but no filled, approved contract backs the measures, the\nverdict is `blocked`, not `pass`, and the green run is cited as MECHANICAL-pass-only.\n\n## Run it -- the fixed 5-step evaluation order (do not reorder)\n\n### 1. Ordering gate\nRead `mappings\u002F\u003Ctable>\u002Freadiness-status.yaml`. If that file is **absent or\nunreadable**, or `gold_ready.status` is anything other than `pass`, emit\n`not_started`, record the blocking reason \"prior stage Gold Ready is not proven\n`pass`\" (an absent readiness file means gold has not been live-validated -- e.g. the\ndeferred DB boundary), and STOP. Never check a model whose source gold is unproven\n(Principle VIII). Reaching the binding criterion (step 4) requires clearing this gate\nfirst; `not_started` here takes precedence over a `blocked` the later steps would\nproduce.\n\n### 2. Mechanical gate\nRun the same command CI runs:\n\n```\nseshat check\n```\n\nAny `D1`-`D8` (TMDL\u002FDAX), `C1` (connection params), `R1` (relative reference), or\n`G6` (no real host) finding is a distinct `blocking_reason` (cite the id + locator;\nhand the fix to the `retail-govern` interpret table). Record the exit code as\nevidence: **exit 0 is MECHANICAL-pass-only**, never a stage pass by itself.\n\n### 3. Structural facts (interpret, do not re-implement)\nThe structural readiness the stage doc requires is already surfaced by step 2 --\ninterpret it, never re-code it:\n\n| Fact | Surfaced by | Pass means |\n|------|-------------|------------|\n| Relationships present + single-direction | `D6` | star relationships exist; no bidirectional (or a justified, annotated exception) |\n| A marked date table | `D7` | the `DATE_TABLE_MARKER` annotation OR table-level `dataCategory: Time` + a key column is present |\n| Measures PascalCase, in display folders | `D1`, `D2` | every measure is PascalCase and carries a `displayFolder` |\n| Gold-only partitions | `D8` | every partition reads `gold` only |\n\nA finding here is a step-2 `blocking_reason`; a clean pass here is recorded as part of\nMECHANICAL-pass-only, still not a stage pass.\n\n### 4. Contract-binding (the criterion this stage adds)\nRead the FILLED metric-contract store (see \"The store is FILLED contracts\" above).\nFor EACH PascalCase measure in the model:\n\n- **Matched + approved** -> a measure that maps to a filled contract whose\n  `readiness.status` is `pass` with owner-approval evidence (owner + date). Record the\n  contract name + owner + date as `evidence[]`.\n- **Unmatched** (no filled contract for the measure) -> a distinct `blocking_reason`\n  naming the measure. NEVER auto-create the contract.\n- **Matched but not approved** (a filled contract exists but its status is not `pass`\n  \u002F no owner approval recorded) -> `blocked` (\"owner approval missing for \u003Ccontract>\").\n  Approval is a human action the skill cannot self-grant (Principle V).\n- **Store absent** (no `mappings\u002F\u003Ctable>\u002Fmetrics\u002F` filled contracts at all) ->\n  `blocked` (\"no filled, owner-approved metric contracts exist for this model's\n  measures; the F009 template ships the shape but no per-table contract is authored\").\n- **Ambiguous mapping** (a measure name that does not map cleanly to a contract key)\n  -> HARD-STOP and raise it for a human; never guess a match.\n\n### 4b. Contract\u003C->DAX drift (L3 -- the measure's LOGIC matches its contract)\n\nBinding (step 4) proves a measure maps to an approved contract; it does NOT prove the\nDAX LOGIC matches the contract's approved definition. A measure can bind to its\ncontract and still compute the WRONG number (the 50.37-vs-33.55 class: a denominator\nover all transactions when the contract rules known-status only). `seshat check` (D-rules)\nsees only form; nothing else sees a wrong denominator. L3 closes that gap.\n\nFor each measure whose contract carries an optional machine-readable `definition`\nblock, invoke the drift checker (a lazy module -- it reads YAML, so it is NOT part of\nthe `seshat check` core; mirrors `validate_targets`):\n\n```python\nfrom retail.metric_drift import load_definition, check_measure_drift\ndefn = load_definition(\"mappings\u002F\u003Ctable>\u002Fmetrics\u002F\u003CMeasure>.yaml\")  # None if no block\nverdict = check_measure_drift(\u003Cthe measure's DAX body from the TMDL>, defn)\n# verdict.status in {pass, drift, escalate, skip}\n```\n\nMap the per-measure status to this stage:\n\n- **pass** -> the DAX denominator filter-set matches the contract; record as `evidence[]`.\n- **drift** -> a recognized mismatch (wrong\u002Fmissing\u002Fextra denominator filter, wrong\n  column) -> `blocked` with the measure named (\"DAX denominator drifts from the\n  approved contract definition\"). The fix is a human Desktop edit (re-save the PBIP) or\n  a contract correction -- never self-applied here.\n- **escalate** -> the DAX uses a predicate spelling the checker does not recognize, is\n  not a DIVIDE ratio, or is unparseable -> HARD-STOP and raise it for a human; NEVER\n  guess pass or drift (the contract -- not the DAX shape -- is the sole arbiter; an\n  unrecognized form is a human judgment call, Principle V).\n- **skip** -> the contract has no `definition` block yet -> no L3 finding (binding from\n  step 4 still governs). Backward-compatible; contracts adopt the block incrementally.\n\nThe contract is the SOLE arbiter of the correct denominator direction. NEVER infer the\nintended denominator from the DAX or the prose (an inference can be inverted -- it has\nbeen). Only the structured `definition` decides; absent it, L3 stays silent (skip).\n\n### 5. Verdict\nCombine into EXACTLY ONE status, shaped to `templates\u002Freadiness-status.yaml`, with\n`evidence[]` (committed files + the `seshat check` run) and `blocking_reasons[]`:\n\n| Verdict | When |\n|---------|------|\n| `not_started` | step 1 failed (Gold Ready not `pass`) |\n| `blocked` | any step-2\u002F3 finding, OR any unmatched\u002Funapproved measure, OR store absent, OR an L3 `drift` (step 4b: DAX denominator contradicts the contract definition) |\n| `warning` | `seshat check` clean + binding satisfied, but a non-fatal recorded item (e.g. an accepted display-folder deviation), OR an L3 `escalate` left for human classification; never auto-promotes |\n| `pass` | steps 2-4(+4b) ALL clear AND every measure binds to an approved contract AND owner approval is recorded as `evidence[]` (any measure with a `definition` block is L3 `pass` or `skip`; none `drift`\u002F`escalate`) |\n\nA `pass` MUST carry evidence; never fabricate a confidence number (roadmap rule #9 --\nthe four explicit statuses + evidence + blockers are the only vocabulary). Then STOP.\n\n## Read-only \u002F author-nothing contract\n\nThis skill writes no TMDL, edits no measure \u002F relationship \u002F date marker, opens no DB\nconnection, invokes no Power BI execution adapter (official Power BI MCP \u002F connection;\n`pbi-cli` no longer preferred), and modifies no file under\n`powerbi\u002F`. For every FIXABLE finding it REPORTS the human remediation step rather\nthan applying it:\n\n| Fixable finding | Human remediation (the skill reports; never self-edits) |\n|-----------------|---------------------------------------------------------|\n| `D1` measure not PascalCase | rename the measure in Power BI Desktop, re-save the PBIP |\n| `D2` measure missing `displayFolder` | set its display folder in Desktop, re-save the PBIP |\n| `D4` `\u002F` instead of `DIVIDE()` | rewrite the measure in Desktop, re-save the PBIP |\n| `C1`\u002F`R1`\u002F`G6` connection \u002F ref \u002F host | repoint to parameters \u002F a relative ref in Desktop, re-save |\n| An unbound measure | author + owner-approve the metric contract under F009 (`mappings\u002F\u003Ctable>\u002Fmetrics\u002F`), not here |\n\nProgrammatic remediation (editing TMDL, marking a date table, adding a measure) is the\ndeferred, execution-only F016 Power BI adapter (official Power BI MCP \u002F connection;\n`pbi-cli` no longer preferred), gated on this stage being `pass` (Principle II;\nhard rule #6).\n\n## Fail-loud judgment-stop table (HARD-STOP, never a silent default)\n\nEach of these STOPS and is raised for a human -- the skill never picks a default:\n\n| Situation | Why it stops |\n|-----------|--------------|\n| Filled metric-contract store absent | nothing to bind to; `blocked`, never a guessed pass |\n| A measure name not cleanly mappable to a contract key | guessing a match would mis-govern; raise the ambiguous mapping |\n| `warning`-vs-`blocked` ambiguity | the analyst classifies the non-fatal item; do not auto-pick |\n| Owner identity unclear for an approval | approval is a NAMED human action; the skill cannot self-grant it |\n\nGrain semantics, PII publish-safety, business-rollup mappings, and product-identity\nare NOT decided by this skill -- they belong to the metric owner \u002F F009 (Principle V).\n\n## What to do after interpreting\n\nReport the one verdict, its `evidence[]`, and each `blocking_reason` with the measure\nor finding id it names and the one place to fix it (Desktop edit + re-save PBIP for\nmechanical findings; author + owner-approve a contract under F009 for unbound\nmeasures). Then STOP -- re-running the check after a human remediates is the user's\nnext call, not a loop this skill performs.\n\n## See also\n\n- The stage authority (required artifacts, checks, statuses, approver):\n  `docs\u002Freadiness\u002Fsemantic-model-ready.md`.\n- The spine: `docs\u002Freadiness\u002Freadiness-model.md`, `docs\u002Freadiness\u002Freadiness-pipeline.md`.\n- The contracts it consumes (owned by F009): `templates\u002Fmetric-contract.yaml`,\n  `templates\u002Fkpi-pack.yaml`, `docs\u002Fmetrics\u002Fmetric-contract-store.md`.\n- The mechanical gate it calls: `seshat check` (`D1`-`D8` `src\u002Fseshat\u002Frules\u002Fdax.py`,\n  `C1`\u002F`R1` `src\u002Fseshat\u002Frules\u002Fpbir.py`, `G6` `src\u002Fseshat\u002Frules\u002Fg6.py`); the\n  `retail-govern` skill for the id -> fix mapping.\n- The live sibling one layer down: the `retail-validate` skill.\n- The model under check: `powerbi\u002FRetailgold.SemanticModel\u002Fdefinition\u002F`.\n- The next stage (gated on this one passing): `docs\u002Freadiness\u002Fdashboard-ready.md`,\n  the `dashboard-design` skill (F011).\n- Roadmap hard rules #4 (gold validated first), #5 (no dashboard before contracts),\n  #6 (no pbi-cli before this stage passes), #9 (no fake confidence):\n  `docs\u002Froadmap\u002Froadmap.md`.\n\n## Orchestration\n\nWhen a table is driven end-to-end, the `retail-orchestrate` conductor parks at the\nPhase-7 model seam and invokes this verb to compute the Semantic Model Ready verdict\nBEFORE any Power BI authoring. A `pass` is the gate that lets the next phase\n(dashboard design, then official report authoring after its gate; live semantic\nexecution remains parked F016) proceed; anything else STOPS\nthe conductor with the blocking reasons. This skill stays single-purpose: it computes\none verdict and STOPS. The self-heal loop (run gate -> classify -> auto-fix mechanical\n\u002F HARD-STOP judgment calls -> re-run) lives ONLY in `retail-orchestrate`, never here;\nand contract approval is a human action no loop self-grants.\n","# retail-semantic-check\n\n`seshat check` proves the model is mechanically clean (PascalCase measures, display\nfolders, DIVIDE, single-direction relationships, a marked date table, gold-only\npartitions, parameterized connection, no real host). This skill answers the larger\nquestion that clean text alone cannot: **is the semantic model GOVERNED** -- does\nevery measure trace to an APPROVED metric contract, with the gold star already\nlive-validated underneath it? It computes the Stage-5 verdict and STOPS -- the live\nsibling of `retail-govern` \u002F `retail-validate`, one layer up: it governs the SEMANTIC\nMODEL, not the SQL. It implements the procedure that\n`docs\u002Freadiness\u002Fsemantic-model-ready.md` specifies; it redefines nothing.\n\n## Scope boundary (read first)\n\nInvoke-and-interpret only, and READ-ONLY.\n\n- **CHECKS the model.** Reads the committed PBIP TMDL, reads the filled\n  metric-contract store, runs `seshat check`, evaluates the contract-binding\n  criterion, and emits one readiness verdict. All side-effect-free reads over\n  committed text -- the same category as `retail-govern` reading TMDL.\n- **NEVER DEFINES contracts (F009).** The metric-contract store (name, grain, formula\n  intent, owner, approval) is defined and owned by feature F009 (the `metric-contract`\n  template + the `metric-contract-store` guide). This skill is the CONSUMER: it reads\n  contracts to test the binding; it never creates, edits, or approves one.\n- **NEVER AUTHORS or EXECUTES the model (F016, deferred + gated).** It writes no TMDL, adds\u002Fedits\n  no measure \u002F relationship \u002F date marker, opens no DB connection, and calls no\n  the Power BI execution adapter (official Power BI MCP \u002F connection; `pbi-cli` no\n  longer preferred) (constitution Principle II; roadmap hard rule #6 -- F016\n  is last and gated on THIS stage being `pass`). It reads an EXISTING model and\n  reports; a human edits Power BI Desktop and re-saves the PBIP to remediate.\n\n## Prerequisites\n\n- The prior stage **Gold Ready is `pass`** -- read it from the canonical\n  `mappings\u002F\u003Ctable>\u002Freadiness-status.yaml` (ADR 0004; shaped to\n  `templates\u002Freadiness-status.yaml`). This stage sits AFTER the live-validation hard\n  gate (no gold to Power BI before validation, roadmap rule #4). If Gold Ready is not\n  `pass`, the verdict is `not_started` and the skill STOPS.\n- The committed PBIP model exists under `powerbi\u002F\u003CModel>.SemanticModel\u002Fdefinition\u002F`.\n- The metric-contract store (F009) -- the FILLED, per-table contracts -- may or may\n  not exist. Its absence is not an error; it is the reason the verdict is `blocked`\n  (see the central property below).\n\n## The store is FILLED contracts, not the template (read this before binding)\n\nF009 ships the TEMPLATE (`templates\u002Fmetric-contract.yaml`) and the authoring guide\n(`docs\u002Fmetrics\u002Fmetric-contract-store.md`). The TEMPLATE is the shape, NOT the store.\nA binding target is a FILLED, owner-APPROVED contract at the canonical store location:\n\n```\nmappings\u002F\u003Ctable>\u002Fmetrics\u002F\u003CMetricName>.yaml   # filled per-table contracts (the store)\nmetrics\u002Fpacks\u002F\u003Cpack_name>.yaml               # reusable KPI packs (group filled contracts)\n```\n\nNEVER treat the existence of `templates\u002Fmetric-contract.yaml` (or `kpi-pack.yaml`) as\n\"the store is present\". The template existing is the F009 deliverable; it binds to\nnothing. If no filled contract exists for a measure, that measure is unbound -> a\n`blocking_reason`.\n\n## The central property: a green `seshat check` is NECESSARY, not SUFFICIENT\n\nA clean mechanical gate (`seshat check` exit 0) does NOT make this stage `pass`.\n`pass` ALSO requires the contract-binding criterion satisfied AND the metric owner's\napproval recorded as evidence. Emitting `pass` on a green checker alone would be a\nsilent governance hole -- a perfectly-formed model whose measures bind to nothing.\nWhen the gate is green but no filled, approved contract backs the measures, the\nverdict is `blocked`, not `pass`, and the green run is cited as MECHANICAL-pass-only.\n\n## Run it -- the fixed 5-step evaluation order (do not reorder)\n\n### 1. Ordering gate\nRead `mappings\u002F\u003Ctable>\u002Freadiness-status.yaml`. If that file is **absent or\nunreadable**, or `gold_ready.status` is anything other than `pass`, emit\n`not_started`, record the blocking reason \"prior stage Gold Ready is not proven\n`pass`\" (an absent readiness file means gold has not been live-validated -- e.g. the\ndeferred DB boundary), and STOP. Never check a model whose source gold is unproven\n(Principle VIII). Reaching the binding criterion (step 4) requires clearing this gate\nfirst; `not_started` here takes precedence over a `blocked` the later steps would\nproduce.\n\n### 2. Mechanical gate\nRun the same command CI runs:\n\n```\nseshat check\n```\n\nAny `D1`-`D8` (TMDL\u002FDAX), `C1` (connection params), `R1` (relative reference), or\n`G6` (no real host) finding is a distinct `blocking_reason` (cite the id + locator;\nhand the fix to the `retail-govern` interpret table). Record the exit code as\nevidence: **exit 0 is MECHANICAL-pass-only**, never a stage pass by itself.\n\n### 3. Structural facts (interpret, do not re-implement)\nThe structural readiness the stage doc requires is already surfaced by step 2 --\ninterpret it, never re-code it:\n\n| Fact | Surfaced by | Pass means |\n|------|-------------|------------|\n| Relationships present + single-direction | `D6` | star relationships exist; no bidirectional (or a justified, annotated exception) |\n| A marked date table | `D7` | the `DATE_TABLE_MARKER` annotation OR table-level `dataCategory: Time` + a key column is present |\n| Measures PascalCase, in display folders | `D1`, `D2` | every measure is PascalCase and carries a `displayFolder` |\n| Gold-only partitions | `D8` | every partition reads `gold` only |\n\nA finding here is a step-2 `blocking_reason`; a clean pass here is recorded as part of\nMECHANICAL-pass-only, still not a stage pass.\n\n### 4. Contract-binding (the criterion this stage adds)\nRead the FILLED metric-contract store (see \"The store is FILLED contracts\" above).\nFor EACH PascalCase measure in the model:\n\n- **Matched + approved** -> a measure that maps to a filled contract whose\n  `readiness.status` is `pass` with owner-approval evidence (owner + date). Record the\n  contract name + owner + date as `evidence[]`.\n- **Unmatched** (no filled contract for the measure) -> a distinct `blocking_reason`\n  naming the measure. NEVER auto-create the contract.\n- **Matched but not approved** (a filled contract exists but its status is not `pass`\n  \u002F no owner approval recorded) -> `blocked` (\"owner approval missing for \u003Ccontract>\").\n  Approval is a human action the skill cannot self-grant (Principle V).\n- **Store absent** (no `mappings\u002F\u003Ctable>\u002Fmetrics\u002F` filled contracts at all) ->\n  `blocked` (\"no filled, owner-approved metric contracts exist for this model's\n  measures; the F009 template ships the shape but no per-table contract is authored\").\n- **Ambiguous mapping** (a measure name that does not map cleanly to a contract key)\n  -> HARD-STOP and raise it for a human; never guess a match.\n\n### 4b. Contract\u003C->DAX drift (L3 -- the measure's LOGIC matches its contract)\n\nBinding (step 4) proves a measure maps to an approved contract; it does NOT prove the\nDAX LOGIC matches the contract's approved definition. A measure can bind to its\ncontract and still compute the WRONG number (the 50.37-vs-33.55 class: a denominator\nover all transactions when the contract rules known-status only). `seshat check` (D-rules)\nsees only form; nothing else sees a wrong denominator. L3 closes that gap.\n\nFor each measure whose contract carries an optional machine-readable `definition`\nblock, invoke the drift checker (a lazy module -- it reads YAML, so it is NOT part of\nthe `seshat check` core; mirrors `validate_targets`):\n\n```python\nfrom retail.metric_drift import load_definition, check_measure_drift\ndefn = load_definition(\"mappings\u002F\u003Ctable>\u002Fmetrics\u002F\u003CMeasure>.yaml\")  # None if no block\nverdict = check_measure_drift(\u003Cthe measure's DAX body from the TMDL>, defn)\n# verdict.status in {pass, drift, escalate, skip}\n```\n\nMap the per-measure status to this stage:\n\n- **pass** -> the DAX denominator filter-set matches the contract; record as `evidence[]`.\n- **drift** -> a recognized mismatch (wrong\u002Fmissing\u002Fextra denominator filter, wrong\n  column) -> `blocked` with the measure named (\"DAX denominator drifts from the\n  approved contract definition\"). The fix is a human Desktop edit (re-save the PBIP) or\n  a contract correction -- never self-applied here.\n- **escalate** -> the DAX uses a predicate spelling the checker does not recognize, is\n  not a DIVIDE ratio, or is unparseable -> HARD-STOP and raise it for a human; NEVER\n  guess pass or drift (the contract -- not the DAX shape -- is the sole arbiter; an\n  unrecognized form is a human judgment call, Principle V).\n- **skip** -> the contract has no `definition` block yet -> no L3 finding (binding from\n  step 4 still governs). Backward-compatible; contracts adopt the block incrementally.\n\nThe contract is the SOLE arbiter of the correct denominator direction. NEVER infer the\nintended denominator from the DAX or the prose (an inference can be inverted -- it has\nbeen). Only the structured `definition` decides; absent it, L3 stays silent (skip).\n\n### 5. Verdict\nCombine into EXACTLY ONE status, shaped to `templates\u002Freadiness-status.yaml`, with\n`evidence[]` (committed files + the `seshat check` run) and `blocking_reasons[]`:\n\n| Verdict | When |\n|---------|------|\n| `not_started` | step 1 failed (Gold Ready not `pass`) |\n| `blocked` | any step-2\u002F3 finding, OR any unmatched\u002Funapproved measure, OR store absent, OR an L3 `drift` (step 4b: DAX denominator contradicts the contract definition) |\n| `warning` | `seshat check` clean + binding satisfied, but a non-fatal recorded item (e.g. an accepted display-folder deviation), OR an L3 `escalate` left for human classification; never auto-promotes |\n| `pass` | steps 2-4(+4b) ALL clear AND every measure binds to an approved contract AND owner approval is recorded as `evidence[]` (any measure with a `definition` block is L3 `pass` or `skip`; none `drift`\u002F`escalate`) |\n\nA `pass` MUST carry evidence; never fabricate a confidence number (roadmap rule #9 --\nthe four explicit statuses + evidence + blockers are the only vocabulary). Then STOP.\n\n## Read-only \u002F author-nothing contract\n\nThis skill writes no TMDL, edits no measure \u002F relationship \u002F date marker, opens no DB\nconnection, invokes no Power BI execution adapter (official Power BI MCP \u002F connection;\n`pbi-cli` no longer preferred), and modifies no file under\n`powerbi\u002F`. For every FIXABLE finding it REPORTS the human remediation step rather\nthan applying it:\n\n| Fixable finding | Human remediation (the skill reports; never self-edits) |\n|-----------------|---------------------------------------------------------|\n| `D1` measure not PascalCase | rename the measure in Power BI Desktop, re-save the PBIP |\n| `D2` measure missing `displayFolder` | set its display folder in Desktop, re-save the PBIP |\n| `D4` `\u002F` instead of `DIVIDE()` | rewrite the measure in Desktop, re-save the PBIP |\n| `C1`\u002F`R1`\u002F`G6` connection \u002F ref \u002F host | repoint to parameters \u002F a relative ref in Desktop, re-save |\n| An unbound measure | author + owner-approve the metric contract under F009 (`mappings\u002F\u003Ctable>\u002Fmetrics\u002F`), not here |\n\nProgrammatic remediation (editing TMDL, marking a date table, adding a measure) is the\ndeferred, execution-only F016 Power BI adapter (official Power BI MCP \u002F connection;\n`pbi-cli` no longer preferred), gated on this stage being `pass` (Principle II;\nhard rule #6).\n\n## Fail-loud judgment-stop table (HARD-STOP, never a silent default)\n\nEach of these STOPS and is raised for a human -- the skill never picks a default:\n\n| Situation | Why it stops |\n|-----------|--------------|\n| Filled metric-contract store absent | nothing to bind to; `blocked`, never a guessed pass |\n| A measure name not cleanly mappable to a contract key | guessing a match would mis-govern; raise the ambiguous mapping |\n| `warning`-vs-`blocked` ambiguity | the analyst classifies the non-fatal item; do not auto-pick |\n| Owner identity unclear for an approval | approval is a NAMED human action; the skill cannot self-grant it |\n\nGrain semantics, PII publish-safety, business-rollup mappings, and product-identity\nare NOT decided by this skill -- they belong to the metric owner \u002F F009 (Principle V).\n\n## What to do after interpreting\n\nReport the one verdict, its `evidence[]`, and each `blocking_reason` with the measure\nor finding id it names and the one place to fix it (Desktop edit + re-save PBIP for\nmechanical findings; author + owner-approve a contract under F009 for unbound\nmeasures). Then STOP -- re-running the check after a human remediates is the user's\nnext call, not a loop this skill performs.\n\n## See also\n\n- The stage authority (required artifacts, checks, statuses, approver):\n  `docs\u002Freadiness\u002Fsemantic-model-ready.md`.\n- The spine: `docs\u002Freadiness\u002Freadiness-model.md`, `docs\u002Freadiness\u002Freadiness-pipeline.md`.\n- The contracts it consumes (owned by F009): `templates\u002Fmetric-contract.yaml`,\n  `templates\u002Fkpi-pack.yaml`, `docs\u002Fmetrics\u002Fmetric-contract-store.md`.\n- The mechanical gate it calls: `seshat check` (`D1`-`D8` `src\u002Fseshat\u002Frules\u002Fdax.py`,\n  `C1`\u002F`R1` `src\u002Fseshat\u002Frules\u002Fpbir.py`, `G6` `src\u002Fseshat\u002Frules\u002Fg6.py`); the\n  `retail-govern` skill for the id -> fix mapping.\n- The live sibling one layer down: the `retail-validate` skill.\n- The model under check: `powerbi\u002FRetailgold.SemanticModel\u002Fdefinition\u002F`.\n- The next stage (gated on this one passing): `docs\u002Freadiness\u002Fdashboard-ready.md`,\n  the `dashboard-design` skill (F011).\n- Roadmap hard rules #4 (gold validated first), #5 (no dashboard before contracts),\n  #6 (no pbi-cli before this stage passes), #9 (no fake confidence):\n  `docs\u002Froadmap\u002Froadmap.md`.\n\n## Orchestration\n\nWhen a table is driven end-to-end, the `retail-orchestrate` conductor parks at the\nPhase-7 model seam and invokes this verb to compute the Semantic Model Ready verdict\nBEFORE any Power BI authoring. A `pass` is the gate that lets the next phase\n(dashboard design, then official report authoring after its gate; live semantic\nexecution remains parked F016) proceed; anything else STOPS\nthe conductor with the blocking reasons. This skill stays single-purpose: it computes\none verdict and STOPS. The self-heal loop (run gate -> classify -> auto-fix mechanical\n\u002F HARD-STOP judgment calls -> re-run) lives ONLY in `retail-orchestrate`, never here;\nand contract approval is a human action no loop self-grants.\n",{"name":5,"description":7},"main","6266e304556a72b75d951b9433fd833481c61233",".claude\u002Fskills\u002Fretail-semantic-check",0,"https:\u002F\u002Fgithub.com\u002FKemetra\u002FSeshat-BI","https:\u002F\u002Fpypi.org\u002Fproject\u002Fseshat-bi\u002F","https:\u002F\u002Fgithub.com\u002FKemetra","2026-11-11 21:44:25",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add Kemetra\u002FSeshat-BI --skill retail-semantic-check",{"tool":37,"command":38},"bunx","bunx skills add Kemetra\u002FSeshat-BI --skill retail-semantic-check",{"tool":40,"command":41},"pnpm","pnpm dlx skills add Kemetra\u002FSeshat-BI --skill retail-semantic-check","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FKemetra\u002FSeshat-BI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fretail-semantic-check\u002FSKILL.md",true,[],[46,53,58,64,69,76],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M77JWCTJ88JWPDD25WZ2NEY8","fake-skill","A fixture skill with declaring frontmatter, used as positive shipped evidence.","https:\u002F\u002Fgithub.com\u002FKemetra\u002FSeshat-BI\u002Fblob\u002Fmain\u002Ftests\u002Funit\u002Ffixtures\u002Fcapability_inventory\u002Funlisted\u002F.claude\u002Fskills\u002Ffake-skill\u002FSKILL.md",[],[],{"skillNo":54,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M77JWA0BTG4JB2HR52Q99216","https:\u002F\u002Fgithub.com\u002FKemetra\u002FSeshat-BI\u002Fblob\u002Fmain\u002Ftests\u002Funit\u002Ffixtures\u002Fcapability_inventory\u002Forphan\u002F.claude\u002Fskills\u002Ffake-skill\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":18},"01M77JW6VE59XEFHWBTNDYAS2Q","bare-skill-no-frontmatter","https:\u002F\u002Fgithub.com\u002FKemetra\u002FSeshat-BI\u002Fblob\u002Fmain\u002Ftests\u002Funit\u002Ffixtures\u002Fcapability_inventory\u002Forphan\u002F.claude\u002Fskills\u002Fbare-skill-no-frontmatter\u002FSKILL.md",[],[],{"skillNo":65,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":18},"01M77JW4TD1FNFSBNP5C0WXAA5","https:\u002F\u002Fgithub.com\u002FKemetra\u002FSeshat-BI\u002Fblob\u002Fmain\u002Ftests\u002Funit\u002Ffixtures\u002Fcapability_inventory\u002Fgood\u002F.claude\u002Fskills\u002Ffake-skill\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M77JVWCVE3WZ82ZNFCSFVDCP","retail-kpi-knowledge","Retail KPI \u002F 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\u002Fsemi\u002Fnon-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\u002Fdefinition + review layer, not an executor: it does not write DAX\u002FSQL\u002FPython, grant readiness, approve policy, or design dashboards. See INDEX.md for live\u002Fplanned routes; registry.yaml is the authoritative machine-readable inventory.","https:\u002F\u002Fgithub.com\u002FKemetra\u002FSeshat-BI\u002Fblob\u002Fmain\u002Fskills\u002Fretail-kpi-knowledge\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M77JVNDM1NGYGSCPTBW9ZCF5","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\u002FNULL semantics, deduplication, validation queries, reconciliation queries, silver\u002Fgold transformation logic, window\u002Fdate-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\u002FDagster project, or automatic tuning service.","https:\u002F\u002Fgithub.com\u002FKemetra\u002FSeshat-BI\u002Fblob\u002Fmain\u002Fskills\u002Fbi-sql-knowledge\u002FSKILL.md",[],[]]