A plugin marketplace for GitHub Copilot and other AI agents that provides Power Platform development plugins, including reusable skills, agents, and commands for building and deploying solutions.
JavaScript claude-code-pluginclaude-code-skillscode-appsgithub-copilot-pluginpower-appspower-pagespower-platform
Remove Power Pages Web API wildcard fields (#509)
Priyanshu Agrawalf9fe8714cc34
diff --git a/plugins/power-pages/.claude-plugin/plugin.json b/plugins/power-pages/.claude-plugin/plugin.jsonindex 6e91e7418..657bd9fb9 100644--- a/plugins/power-pages/.claude-plugin/plugin.json+++ b/plugins/power-pages/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "power-pages",- "version": "2.6.5",+ "version": "2.6.6","description": "Create and deploy Power Pages sites using modern development approaches. Supports code sites (SPAs) with React, Angular, Vue, or Astro. Includes ALM orchestration (plan-alm) with a solution-splitting decision tree, per-solution pipelines, Azure Blob asset advisory, manifest schema v2 for multi-solution deployments, and force-link remediation for cross-host pipeline migrations.","author": {"name": "Microsoft",diff --git a/plugins/power-pages/.plugin/plugin.json b/plugins/power-pages/.plugin/plugin.jsonindex 6e91e7418..657bd9fb9 100644--- a/plugins/power-pages/.plugin/plugin.json+++ b/plugins/power-pages/.plugin/plugin.json@@ -1,6 +1,6 @@{"name": "power-pages",- "version": "2.6.5",+ "version": "2.6.6","description": "Create and deploy Power Pages sites using modern development approaches. Supports code sites (SPAs) with React, Angular, Vue, or Astro. Includes ALM orchestration (plan-alm) with a solution-splitting decision tree, per-solution pipelines, Azure Blob asset advisory, manifest schema v2 for multi-solution deployments, and force-link remediation for cross-host pipeline migrations.","author": {"name": "Microsoft",diff --git a/plugins/power-pages/AGENTS.md b/plugins/power-pages/AGENTS.mdindex 677850f33..43aa61232 100644--- a/plugins/power-pages/AGENTS.md+++ b/plugins/power-pages/AGENTS.md@@ -136,7 +136,7 @@ Auto-triggered by the main conversation when relevant:- `data-model-architect`: Read-only agent that analyzes site requirements, discovers existing Dataverse tables via OData API, and proposes a data model (new/modified/reused tables + Mermaid ER diagram). Uses `pac env who` + Azure CLI auth to query Dataverse. Renders the ER diagram visually in the browser via Playwright (writes a temp HTML file with Mermaid.js CDN, navigates to it, takes a screenshot) before entering plan mode. Does NOT create, modify, or delete any tables — purely advisory. The main conversation uses its output to create tables.- `webapi-integration`: Implementation agent that creates production-ready Web API integration code for a single Dataverse table in a Power Pages code site. Detects the frontend framework (React/Vue/Angular/Astro), creates a shared `powerPagesApi.ts` client (token management, retry logic, OData URL builder) if one doesn't exist, then generates TypeScript entity types, a domain mapper, and a CRUD service layer for the target table. Also creates framework-specific hooks (React), composables (Vue), or injectable services (Angular). Follows Power Pages Web API best practices: `/_api/` endpoints, dual token headers, `@odata.bind` for lookups, explicit `$select` (never `*`), formatted value annotations, exponential backoff retry, and 8-minute token TTL. Handles one table per invocation — invoke separately for multiple tables.- `table-permissions-architect`: Read-only agent that analyzes site code, discovers existing web roles and table permissions, and proposes a table-permissions plan (web roles → table permissions with CRUD flags and scopes) rendered as a Mermaid flowchart. Checks for `.powerpages-site` folder to verify site deployment. Presents the plan via plan mode; after approval, creates web role and table-permission YAML files using deterministic scripts. Supports an **AI-only read posture** (invoked transitively by `/add-ai-webapi` via `/integrate-webapi`) that proposes `read: true` only, with Parent scope + `appendTo` for `$expand` targets. Invoked by `/integrate-webapi` and `/audit-permissions`.-- `webapi-settings-architect`: Read-only agent that queries Dataverse for exact column LogicalNames (case-sensitive) and proposes `Webapi/<table>/enabled` and `Webapi/<table>/fields` site settings. Never uses `*` for field settings except for aggregate OData queries — always lists specific columns. Presents the plan via plan mode; after approval, creates site-setting YAML files using `create-site-setting.js`. Supports the **AI-only read posture** (minimal fields list: no primary key, only `_<col>_value` lookup read forms). Invoked by `/integrate-webapi`.+- `webapi-settings-architect`: Read-only agent that queries Dataverse for exact field and relationship metadata and proposes `Webapi/<table>/enabled` and `Webapi/<table>/fields` site settings. Uses LogicalNames for ordinary columns, `_<LogicalName>_value` for lookup reads, and the exact Navigation Property used by `@odata.bind` for lookup writes. Presents the plan via plan mode; after approval, creates site-setting YAML files using `create-site-setting.js`. Invoked by `/integrate-webapi`.- `ai-webapi-integration`: Implementation agent that creates production-ready generative-AI summarization service code for a Power Pages SPA site — Search Summary (`/_api/search/v1.0/summary`) and Data Summarization (`/_api/summarization/data/v1.0/...`). Uses raw `fetch` (never the OData wrapper), attaches the `__RequestVerificationToken` CSRF header, groups all functions in a single `aiSummaryService.*` file, emits a framework-idiomatic wrapper (React hook / Vue composable / Angular service / Astro util), and wires real UI call sites with loading/error/content/empty branches, citation rendering, and a safe-markdown renderer. Invoked **sequentially per target** by `/add-ai-webapi` (every target shares the one service file, so parallel runs would conflict).- `ai-webapi-settings-architect`: Read-only agent that proposes the three Layer-3 summarization settings — `Summarization/Data/Enable`, per-prompt `Summarization/prompt/<identifier>`, and `Summarization/Data/ContentSizeLimit` (mandatory `200000` for list summaries). Cross-checks that Layer 1/2 prerequisites (`Webapi/<table>/*`, table permissions) exist for every summarised table and `$expand` target. Presents the plan via plan mode; after approval, creates site-setting YAMLs (script path, or hand-written block-literal YAML for long/complex prompts). Invoked by `/add-ai-webapi` Phase 6.diff --git a/plugins/power-pages/README.md b/plugins/power-pages/README.mdindex 1a1682f5a..1ecfa2a0d 100644--- a/plugins/power-pages/README.md+++ b/plugins/power-pages/README.md@@ -133,7 +133,7 @@ The skill first scans your codebase to find components using mock data, placehol- TypeScript entity types and domain mappers per table- CRUD service layer per table using `/_api/` endpoints with dual token headers and `@odata.bind` for lookups- Framework-specific patterns: React hooks, Vue composables, Angular injectable services-- Table permission YAML files and site setting YAML files (with explicit validated column lists by default; use `*` only for aggregate OData scenarios that otherwise 403)+- Table permission YAML files and site setting YAML files with explicit validated column lists**What gets updated:**diff --git a/plugins/power-pages/agents/ai-webapi-settings-architect.md b/plugins/power-pages/agents/ai-webapi-settings-architect.mdindex 19812b152..337fc8782 100644--- a/plugins/power-pages/agents/ai-webapi-settings-architect.md+++ b/plugins/power-pages/agents/ai-webapi-settings-architect.md@@ -69,8 +69,8 @@ for AI-only targets, those architects were prompted to adopt an AI-only read pos- **Fields list**: exactly the columns named in `$select` and `$expand` from the code. Noprimary key column (the record id is in the URL path, not selected as a column — this is whyMS's shipped case preset ships `Webapi/incident/fields = description,title` with no- `incidentid`). No lookup write form (`cr4fc_categoryid`) unless the same table also has- non-AI mutation code elsewhere on the site.+ `incidentid`). No relationship Navigation Property unless non-AI mutation code uses it before+ `@odata.bind` elsewhere on the site.When you inspect the prerequisites in Step 4, cross-check that this posture is in place. If youfind broader CRUD flags or a primary-key column in a fields list for an AI-only target, flag it@@ -321,9 +321,9 @@ broader than a read-only posture requires:- `Webapi/<table>/fields` values that include a primary key column (`<prefix>_<table>id`) — theAI endpoint doesn't need it since the record id is in the URL path. Harmless but broader thanthe shipped MS preset.-- `Webapi/<table>/fields` values that include lookup write forms (`cr4fc_categoryid`) without a- corresponding read form (`_cr4fc_categoryid_value`) for a table that only gets read from — the- write form isn't used by the AI endpoint.+- `Webapi/<table>/fields` values that include a relationship Navigation Property without a+ corresponding non-AI `[email protected]` write. AI-only reads need+ `_<LogicalName>_value`, not the write property.Output these as plan-level notes so the user can tighten the posture later.diff --git a/plugins/power-pages/agents/webapi-settings-architect.md b/plugins/power-pages/agents/webapi-settings-architect.mdindex 468084782..d992aecbd 100644--- a/plugins/power-pages/agents/webapi-settings-architect.md+++ b/plugins/power-pages/agents/webapi-settings-architect.md@@ -30,10 +30,14 @@ You are a Web API site settings architect for Power Pages code sites. Your job iThe Power Pages Web API `Webapi/<table>/fields` site setting performs **case-sensitive** matching against Dataverse column LogicalNames. If the fields list contains a column name with incorrect casing (e.g., `Cr4fc_Name` instead of `cr4fc_name`), the Web API returns a **403 Forbidden** error for any request involving that column. This is the most common cause of unexplained 403 errors after configuring Web API access.+Read `${PLUGIN_ROOT}/references/webapi-field-allowlist.md` before analyzing+columns. Lookup reads use `_<LogicalName>_value`; lookup writes add the exact+case-sensitive Navigation Property used before `@odata.bind`.+Dataverse stores two forms of every column name:-- **LogicalName**: Always all-lowercase (e.g., `cr4fc_productname`) — **this is what the Web API fields setting requires**-- **SchemaName**: PascalCase with publisher prefix (e.g., `Cr4fc_ProductName`) — used in some tools but **NOT valid** in the fields setting+- **LogicalName**: The case-sensitive name returned by Dataverse metadata (e.g., `cr4fc_productname`) — **this is what the Web API fields setting requires**+- **SchemaName**: PascalCase with publisher prefix (e.g., `Cr4fc_ProductName`) — do not add it automatically; add a schema-cased Navigation Property only when code uses it before `@odata.bind`This agent always queries Dataverse to get the exact LogicalName and uses it as the authoritative source. Column names from code, type definitions, or documentation are **never trusted directly** — they are cross-referenced against Dataverse and corrected if they differ.@@ -42,7 +46,7 @@ This agent always queries Dataverse to get the exact LogicalName and uses it as1. **Verify Site Deployment** — Check that `.powerpages-site` folder exists2. **Discover Existing Site Settings** — Read existing Web API site settings3. **Analyze Data Requirements** — Determine which tables need Web API access and which columns are used in code-4. **Query Dataverse for Exact Column LogicalNames** — Get authoritative column names from the OData metadata API+4. **Query Dataverse for Exact Field Metadata** — Get authoritative column names and relationship Navigation Properties5. **Cross-Validate Column Names** — Compare code references against Dataverse LogicalNames (case-sensitive)6. **Propose Site Settings Plan** — Enter plan mode for user approval7. **Create Files** — After user approval, create site setting YAML files using scripts@@ -95,7 +99,7 @@ name: Webapi/cra5b_product/enabledvalue: true```-**Fields setting (lists specific columns by default; use `*` only for aggregate OData scenarios):**+**Fields setting (explicit column list):**```yamldescription: Allowed fields for cra5b_product Web API access@@ -104,7 +108,9 @@ name: Webapi/cra5b_product/fieldsvalue: cra5b_productid,cra5b_name,cra5b_description,cra5b_price,cra5b_imageurl```-Note which tables already have Web API enabled and which fields are currently exposed.+Note which tables already have Web API enabled and which fields are currently exposed. If an+existing fields setting uses a wildcard, plan to replace it with every validated column required+by the site's reads, writes, filters, ordering, aggregates, and file/image operations.---@@ -183,17 +189,17 @@ For each table, compile the complete set of column names found in code. These wi**Common columns to check for:**- Primary key column (e.g., `cr4fc_productid`) — always needed for CRUD-- **Lookup columns** (e.g., `cr4fc_categoryid`) — these have TWO forms that both need to be in the fields list:- - `cr4fc_categoryid` — the Dataverse LogicalName (used for write operations / setting the lookup)- - `_cr4fc_categoryid_value` — the OData computed attribute (used for read operations in `$select`, `$filter`)- - **Both forms MUST be included** — see Step 5.3 for details+- **Lookup columns** (e.g., `cr4fc_categoryid`) — include identifiers by operation:+ - `_cr4fc_categoryid_value` for `$select`, `$filter`, and response bodies+ - the exact Navigation Property before `@odata.bind` for POST/PATCH relationship writes+ - **Do not add the attribute SchemaName unless it is the actual `@odata.bind` property** — see Step 5.3- File/image columns (e.g., `cr4fc_photo`) — needed if the code downloads or uploads files- `createdon` / `modifiedon` — if displayed in the UI- Columns used in `$filter` or `$orderby` — must be in the fields list to be queryable----## Step 4: Query Dataverse for Exact Column LogicalNames+## Step 4: Query Dataverse for Exact Field MetadataThis is the critical step that prevents 403 errors. Query the Dataverse OData API to get the **exact** LogicalName for every column.@@ -223,7 +229,7 @@ node "${PLUGIN_ROOT}/scripts/dataverse-request.js" <envUrl> GET "EntityDefinitioThe script outputs JSON: `{ "status": <code>, "data": { "value": [...] } }`. Each entry in `value` contains `LogicalName`, `SchemaName`, `DisplayName`, `AttributeType`, and `IsPrimaryId`.-**Important:** The query returns both `LogicalName` (all-lowercase, authoritative) and `SchemaName` (PascalCase). Always use `LogicalName` for the site settings fields list.+**Important:** The query returns both `LogicalName` and `SchemaName`. Always copy the case-sensitive `LogicalName` value exactly as Dataverse returns it for the site settings fields list.Store the results as a lookup map for each table:@@ -233,6 +239,18 @@ Store the results as a lookup map for each table:**Identify lookup columns:** Columns with `AttributeType = 'Lookup'` or `AttributeType = 'Customer'` or `AttributeType = 'Owner'` are lookup columns. These require special handling — see Step 5.3.+For tables with POST/PATCH payloads containing `@odata.bind`, query relationship+metadata so the allowlist uses the exact Navigation Property:++```text+node "${PLUGIN_ROOT}/scripts/dataverse-request.js" <envUrl> GET "EntityDefinitions(LogicalName='<table_logical_name>')/ManyToOneRelationships?\$select=ReferencingAttribute,ReferencingEntityNavigationPropertyName,SchemaName"+```++Map each lookup `ReferencingAttribute` to+`ReferencingEntityNavigationPropertyName`. The request property before+`@odata.bind` and the fields-setting entry must match that case-sensitive+Navigation Property exactly.+### Error HandlingIf any API calls fail:@@ -254,51 +272,60 @@ This step catches the casing mismatches that cause 403 errors. For each table, c### 5.1 Build Validation Map-For each table, create a case-insensitive lookup from Dataverse results:+For each table, create an exact lookup from Dataverse results:```-lowercase("LogicalName") → exact LogicalName+"LogicalName" → column metadata```-Since Dataverse LogicalNames are already all-lowercase, this map effectively allows matching code references regardless of their casing.+Create a second, case-insensitive lookup only to diagnose casing mistakes. Values written to the+fields list must always come from the exact `LogicalName` returned by Dataverse.### 5.2 Validate Each ColumnFor each column referenced in code (from Step 3.3):-1. **Normalize** the code column name to lowercase-2. **Check for OData lookup format**: If the name matches `_<name>_value`, strip the prefix `_` and suffix `_value` to get the base logical name, then look up that base name in the Dataverse map-3. **Look up** in the Dataverse map-4. Classify the result:+1. **Preserve** the column name's casing from code+2. **Check for OData lookup format**: If the name matches `_<name>_value`, strip the prefix `_` and suffix `_value` to get the base logical name+3. **Look up** the name in the exact Dataverse map+4. If the exact lookup fails, check the diagnostic case-insensitive map to identify a casing mismatch+5. Classify the result:| Scenario | Action ||----------|--------|| Exact match (code = Dataverse) | Include in fields list as-is |-| Case mismatch (code ≠ Dataverse but lowercase matches) | **Use the Dataverse LogicalName** and log a warning |-| OData lookup format (`_<name>_value`) matched to a Lookup column | Include **both** the LogicalName AND the `_<name>_value` format (see 5.3) |+| Case mismatch (code differs but the diagnostic case-insensitive lookup matches) | **Use the Dataverse LogicalName** and log a warning |+| OData lookup format (`_<name>_value`) matched to a Lookup column | Include the exact `_<LogicalName>_value` property (see 5.3) |+| `[email protected]` in POST/PATCH | Include the exact case-sensitive Navigation Property before `@odata.bind` || Not found in Dataverse | **Exclude** from fields list and flag as a potential error || In Dataverse but not in code | Note as available but not currently used |### 5.3 Lookup Column Handling (CRITICAL)-Lookup columns have **two attribute names** in OData, and the Power Pages Web API fields setting does a **literal match**. Both forms must be included:+Lookup reads use an OData property derived from the Dataverse LogicalName:| Form | Example | Used For ||------|---------|----------|-| LogicalName | `cr87b_productcategoryid` | Write operations (setting the lookup value via POST/PATCH) |-| OData computed attribute | `_cr87b_productcategoryid_value` | Read operations (`$select`, `$filter`, response body GUID) |+| Dataverse LogicalName | `cr87b_productcategoryid` | Metadata input used to derive the OData property |+| Web API lookup property | `_cr87b_productcategoryid_value` | Fields allowlist and read operations (`$select`, `$filter`, response body GUID) |-**Rule:** For every lookup column (AttributeType = `Lookup`, `Customer`, or `Owner`) that is referenced in the code — whether the code uses `cr87b_productcategoryid` or `_cr87b_productcategoryid_value` — **always include BOTH forms** in the fields list.+**Rule:** For every referenced `Lookup`, `Customer`, or `Owner` column, include+`_<LogicalName>_value` when the lookup is read. When POST/PATCH sets the+relationship, also include the exact Navigation Property used before+`@odata.bind`. Do not add the unwrapped LogicalName or attribute SchemaName+unless an operation uses that exact identifier.Example: If the code references `_cr87b_productcategoryid_value` in a `$select`:-- Include `cr87b_productcategoryid` (the LogicalName)- Include `_cr87b_productcategoryid_value` (the OData read format)+If the POST payload also contains+`[email protected]`, include `Cr87b_ProductCategory`.+The fields value becomes:```-_cr87b_productcategoryid_value,cr87b_description,cr87b_name,cr87b_price,cr87b_productcategoryid,cr87b_productid+Cr87b_ProductCategory,_cr87b_productcategoryid_value,cr87b_description,cr87b_name,cr87b_price,cr87b_productid```Note: The `_..._value` entries sort alphabetically with the underscore prefix placing them before regular column names.@@ -314,18 +341,18 @@ Column Validation for cra5b_product:|------------------------------------|----------------------------|--------|----------------|------------------------------------------------|| cra5b_productid | cra5b_productid | PK | ✓ Exact | Include || cra5b_name | cra5b_name | String | ✓ Exact | Include |-| _cra5b_productcategoryid_value | cra5b_productcategoryid | Lookup | ✓ Lookup | Include BOTH: cra5b_productcategoryid AND _cra5b_productcategoryid_value |+| _cra5b_productcategoryid_value + [email protected] | cra5b_productcategoryid | Lookup | ✓ Lookup | Include `_cra5b_productcategoryid_value` and `Cra5b_ProductCategory` || Cra5b_Description | cra5b_description | String | ✗ CASE MISMATCH | Use `cra5b_description` (Dataverse) || cra5b_bogusfield | — | — | ✗ NOT FOUND | Exclude — column does not exist |```**If any case mismatches are found**, add a prominent warning:-> **WARNING: Case mismatches detected.** The following columns in code use incorrect casing. The `Webapi/<table>/fields` site setting requires exact Dataverse LogicalNames (all lowercase). Using incorrect casing causes 403 Forbidden errors. The proposed site settings use the corrected Dataverse LogicalNames.+> **WARNING: Case mismatches detected.** The following columns in code use incorrect casing. The `Webapi/<table>/fields` site setting requires the exact case-sensitive Dataverse LogicalName. Using incorrect casing causes 403 Forbidden errors. The proposed site settings use the values returned by Dataverse metadata.**If any lookup columns are found**, add a note:-> **Lookup columns detected.** The following lookup columns require both the LogicalName and `_<name>_value` OData format in the fields list. Both forms have been included automatically.+> **Lookup columns detected.** Read operations use `_<LogicalName>_value`. Relationship writes also include the exact Navigation Property used before `@odata.bind`.---@@ -349,14 +376,14 @@ node "${PLUGIN_ROOT}/scripts/create-site-setting.js" --projectRoot "<PROJECT_ROOnode "${PLUGIN_ROOT}/scripts/create-site-setting.js" --projectRoot "<PROJECT_ROOT>" --name "Webapi/<table_logical_name>/fields" --value "<comma-separated-validated-column-logicalnames>" --description "Allowed fields for <table_logical_name> Web API access"```-**CRITICAL: For normal CRUD/read scenarios, the `--value` for fields settings MUST use exact Dataverse LogicalNames (all lowercase), comma-separated, with NO spaces after commas. NEVER use SchemaName (PascalCase) or any other casing variant. Every column name must have been validated against Dataverse in Step 5. If the table has File or Image columns accessed via the Web API, OR the site uses aggregate OData queries (`$apply`, `aggregate`, grouped totals), use `*` instead — the `/$value` download endpoint internally does `SELECT *`, so an explicit column list causes 403.**+**CRITICAL: The `--value` for every fields setting MUST follow `${PLUGIN_ROOT}/references/webapi-field-allowlist.md`: LogicalNames for ordinary columns, `_<LogicalName>_value` for lookup reads, and exact Navigation Properties used before `@odata.bind` for lookup writes. Use a comma-separated list with NO spaces. Wildcard field access is unsupported beginning September 14, 2026.**-**CRITICAL: Lookup columns MUST include BOTH the LogicalName AND the `_<name>_value` OData format.** See Step 5.3.+**CRITICAL: Lookup columns MUST include every identifier their operations use.** See Step 5.3.Example (with lookup column `cra5b_productcategoryid`):```bash---value "_cra5b_productcategoryid_value,cra5b_description,cra5b_name,cra5b_price,cra5b_productcategoryid,cra5b_productid"+--value "Cra5b_ProductCategory,_cra5b_productcategoryid_value,cra5b_description,cra5b_name,cra5b_price,cra5b_productid"```**3. Optionally**, if `Webapi/error/innererror` does not already exist, suggest it for debugging:@@ -371,7 +398,7 @@ Start with an explanation of the reasoning behind the proposed settings:- **Why these tables need Web API access** — For each table, explain what site functionality requires API access (e.g., "The `cr87b_product` table needs Web API access because the product listing page fetches products via `/_api/cr87b_products` and the admin panel creates/updates products through the service layer.")- **Column inclusion rationale** — Explain why specific columns are included and any that were deliberately excluded (e.g., "The `cr87b_internalnotes` column exists in Dataverse but is excluded from the fields list because no frontend code references it, following the principle of least privilege.")-- **Lookup column decisions** — For lookup columns, explain which relationships they support (e.g., "Both `cr87b_productcategoryid` and `_cr87b_productcategoryid_value` are included because the product service reads the category GUID via `$select` and writes it via `@odata.bind` during product creation.")+- **Lookup column decisions** — Confirm `_<LogicalName>_value` for reads and the exact Navigation Property for each `@odata.bind` write.Then include:@@ -383,8 +410,8 @@ Then include:| `Webapi/cra5b_product/fields` | `_cra5b_categoryid_value,cra5b_categoryid,cra5b_name,...` | string |2. **Column validation summary** — How many columns were validated, any mismatches found, any columns excluded-3. **Lookup columns** — List which columns are lookups and confirm both forms are included-4. **Security notes** — Confirm that wildcard `*` is only used for tables with File/Image columns or aggregate OData scenarios; all other tables use explicit column lists+3. **Lookup columns** — List which columns are lookups and confirm each `_<LogicalName>_value` property is included+4. **Security notes** — Confirm that every fields setting uses the smallest explicit column list required by the site5. **Script invocations** — The exact `create-site-setting.js` commands for each setting (from section 6.1)6. **Any discovery steps skipped** due to auth errors7. **Dataverse validation status** — Whether column names were validated against Dataverse or only inferred from code/manifest@@ -421,9 +448,8 @@ After creating all files, return a summary to the calling context:## Critical Constraints- **No manual YAML writes**: Do NOT use `Write` or `Edit` to create YAML files in `.powerpages-site/`. Always use the `create-site-setting.js` script via `Bash`. The script handles all formatting (unquoted booleans, UUIDs, alphabetical fields) automatically.-- **CASE-SENSITIVE COLUMN NAMES**: The `Webapi/<table>/fields` site setting is case-sensitive. Always use the exact Dataverse LogicalName (all lowercase). Never use SchemaName (PascalCase), DisplayName, or any other variant. Column names from code must be cross-validated against Dataverse before inclusion.-- **LOOKUP COLUMNS NEED BOTH FORMS**: For every lookup column, include both the LogicalName (`cr87b_categoryid`) AND the OData computed attribute (`_cr87b_categoryid_value`) in the fields list. Missing either form causes 403 errors — the LogicalName is needed for writes, the `_..._value` form is needed for reads.-- **Use `*` for tables with File/Image columns or aggregate OData scenarios**: If a table has **File** or **Image** columns that will be accessed via the Web API, the `Webapi/<table>/fields` setting **must use `*`** (wildcard). The `/$value` download endpoint internally performs `SELECT *`; an explicit column list causes `403 "Attribute * not enabled for Web Api"`. Also use `*` when the site relies on aggregate OData queries (`$apply`, `aggregate`, grouped totals). For all other tables, default to specific validated column logical names.+- **OPERATION-SPECIFIC IDENTIFIERS**: Follow `${PLUGIN_ROOT}/references/webapi-field-allowlist.md`. Ordinary columns use LogicalName. Lookup reads use `_<LogicalName>_value`. Lookup writes add the exact case-sensitive Navigation Property used before `@odata.bind`.+- **EXPLICIT FIELDS ONLY**: Wildcard field access is unsupported beginning September 14, 2026. Include each required File/Image column by LogicalName. For aggregate OData, include every column referenced by grouping, aggregation, filtering, or ordering.- **Dataverse is the authority**: Column names from code, type definitions, or manifests are NOT authoritative. Only the `LogicalName` returned by the Dataverse `EntityDefinitions/Attributes` API is authoritative. If Dataverse is unavailable, warn prominently that column names are unvalidated.- **No questions**: Do NOT use `AskUserQuestion`. Autonomously analyze the site and environment, then present your findings via plan mode.- **Security**: Never log or display the full auth token. Use it only in API request headers.@@ -432,10 +458,10 @@ After creating all files, return a summary to the calling context:When the invoking skill's prompt signals **AI-only read mode** (e.g. `/add-ai-webapi` delegating through `/integrate-webapi`), the fields-list rules tighten for every table in scope:-- **Fields list = exactly the primary's `$select` / `$expand` columns.** No more, no less. Extra columns expand the allowlist without any caller using them.+- **Fields list = exactly the columns required by every site call against the table.** Start with the primary's `$select` / `$expand` columns. If the same table is used by an aggregate query elsewhere, add every grouping key, aggregate input, filter column, and ordered column that query references. Extra columns expand the allowlist without any caller using them.- **Omit the primary key column.** The Power Pages summarization endpoint carries the record id in the URL path, not in `$select`. Microsoft's shipped case preset ships `Webapi/incident/fields = description,title` with no `incidentid` — match that pattern.-- **Lookup columns use the `_<col>_value` OData read form only.** Do NOT include the LogicalName write form (`<col>`) unless the same table has non-AI mutation code elsewhere in the site. In pure AI-only targets there are no writes, so the write form adds attackable surface without any reader.-- **Case-sensitivity and Dataverse-as-authority rules still apply** — all the above LogicalNames must still be the exact lowercase forms returned by the Dataverse metadata API.-- **File/Image and aggregate exceptions still apply** — if the summarised table also has File/Image columns or aggregate OData elsewhere, `*` still wins.+- **Lookup columns use the `_<col>_value` OData read form only.** Include a relationship Navigation Property only when non-AI mutation code uses it before `@odata.bind`. Pure AI-only targets have no such writes.+- **Case-sensitivity and Dataverse-as-authority rules still apply** — all the above LogicalNames must exactly match the case returned by the Dataverse metadata API.+- **File/Image and aggregate columns remain explicit** — add only the File/Image columns and aggregate-query columns that the site actually uses.The forcing function is the invoking skill's prompt. This section documents the contract so reviewers can verify it without reading downstream skill files.diff --git a/plugins/power-pages/references/webapi-field-allowlist.md b/plugins/power-pages/references/webapi-field-allowlist.mdnew file mode 100644index 000000000..67e2d5dff--- /dev/null+++ b/plugins/power-pages/references/webapi-field-allowlist.md@@ -0,0 +1,28 @@+# Web API field allowlist++Use this contract whenever an instruction creates, audits, or migrates a+`Webapi/<table>/fields` value.++Add the exact identifier used by each operation:++| Operation | Fields-setting identifier |+|-----------|---------------------------|+| Ordinary read, filter, order, aggregate, or scalar write | Dataverse attribute `LogicalName` |+| Lookup read or filter | `_<LogicalName>_value` |+| Lookup relationship set by POST/PATCH | The exact case-sensitive Navigation Property before `@odata.bind` |++For example, a lookup with `LogicalName = cr87b_categoryid` that is read as+`_cr87b_categoryid_value` and written as+`[email protected]` contributes both identifiers:++```text+Cr87b_Category,_cr87b_categoryid_value+```++The Navigation Property can use schema-style casing, but it must come from the+request payload or Dataverse relationship metadata+(`ReferencingEntityNavigationPropertyName`). Do not substitute the attribute+`SchemaName` unless it is the actual property used before `@odata.bind`.++Build the final value as a sorted, comma-separated set with no wildcard. The+allowlist is complete only when every operation has its exact identifier.diff --git a/plugins/power-pages/references/webapi-service-patterns.md b/plugins/power-pages/references/webapi-service-patterns.mdindex fa7e1c47f..99b0e5882 100644--- a/plugins/power-pages/references/webapi-service-patterns.md+++ b/plugins/power-pages/references/webapi-service-patterns.md@@ -19,8 +19,8 @@ export interface ProductEntity {cr4fc_price?: number;cr4fc_status?: number;cr4fc_imageurl?: string;- // Lookup raw values use _<navigation>_value pattern- _cr4fc_category_value?: string;+ // Lookup raw values use _<LogicalName>_value.+ _cr4fc_categoryid_value?: string;// Expanded navigation propertiescr4fc_Category?: { cr4fc_categoryid: string; cr4fc_name?: string };createdon?: string;@@ -32,8 +32,8 @@ export interface ProductEntity {**Naming rules:**- Interface: PascalCase table name + `Entity` suffix-- Properties: exact Dataverse logical names (all lowercase with publisher prefix)-- Lookup raw values: `_<navigation_property>_value`+- Properties: exact, case-sensitive Dataverse LogicalNames with the publisher prefix+- Lookup raw values: `_<LogicalName>_value`- Expanded lookups: PascalCase navigation property with nested object type- Always include `[key: string]: unknown` for formatted value annotation access@@ -113,8 +113,8 @@ export const mapProductEntity = (entity: ProductEntity): Product => ({price: entity.cr4fc_price ?? 0,status: STATUS_LABELS[entity.cr4fc_status ?? 0] ?? 'active',imageUrl: entity.cr4fc_imageurl ?? '',- category: getFormattedValue(entity, '_cr4fc_category_value') ?? 'Uncategorized',- categoryId: entity._cr4fc_category_value,+ category: getFormattedValue(entity, '_cr4fc_categoryid_value') ?? 'Uncategorized',+ categoryId: entity._cr4fc_categoryid_value,createdAt: entity.createdon ?? new Date().toISOString(),updatedAt: entity.modifiedon ?? entity.createdon ?? new Date().toISOString(),});@@ -128,7 +128,7 @@ Lookups in Dataverse expose **two distinct properties**. Understanding the diffe**On retrieval (GET):**- **GUID property** — Automatically named `_{logicalname}_value`. Contains the raw lookup ID. Use for filtering, logic, and foreign-key references. Include in `$select`.-- **Navigation property** — Named after the relationship (e.g., `cr4fc_Category`). Use with `$expand` to fetch related record details. **Case-sensitive** — must match the schema name exactly (typically PascalCase).+- **Navigation property** — Named by relationship metadata (e.g., `cr4fc_Category`). Use with `$expand` to fetch related record details. It is case-sensitive and can use schema-style casing; read `ReferencingEntityNavigationPropertyName` instead of deriving it from an attribute name.```typescript// $select includes the GUID property for the raw ID@@ -142,6 +142,7 @@ Lookups in Dataverse expose **two distinct properties**. Understanding the diffe**On create/update (POST/PATCH):**- You **cannot** set a lookup by sending a GUID to the `_value` property. You **must** use `@odata.bind` on the **Navigation Property**.- Syntax: `"[email protected]": "/entity_set_name(GUID)"`+- Add that exact case-sensitive Navigation Property to `Webapi/<table>/fields`.```typescript// CORRECT — uses Navigation Property name (case-sensitive)@@ -151,7 +152,7 @@ body['[email protected]'] = `/cr4fc_categories(${categoryId})`;body['_cr4fc_categoryid_value'] = categoryId; // ❌ Does NOT work```-**Common error:** If you get an "Undeclared Property" error on POST/PATCH, you are likely using the logical name (all lowercase) instead of the **Navigation Property name** (case-sensitive, matches the schema name).+**Common error:** If you get an "Undeclared Property" error on POST/PATCH, verify that the payload and `Webapi/<table>/fields` both use the exact relationship Navigation Property. It may use schema-style casing and is not necessarily the lookup attribute LogicalName or SchemaName.**To clear a lookup**, set the `@odata.bind` annotation to `null`:@@ -187,7 +188,7 @@ const PRODUCT_SELECT = ['cr4fc_price','cr4fc_status','cr4fc_imageurl',- '_cr4fc_category_value', // Lookup GUID — use for filtering/logic+ '_cr4fc_categoryid_value', // Lookup GUID — use for filtering/logic'createdon','modifiedon',].join(',');@@ -506,7 +507,7 @@ Only create these methods if the target table actually has File or Image columns| Using `Accept: application/json` for download | Empty or error response | Use `Accept: */*` for blob downloads || Using file MIME type as upload `Content-Type` (e.g. `image/png`) | `400 "Stream was not readable"` — OData routes to JSON deserializer instead of binary handler | Always use `Content-Type: application/octet-stream` for uploads || Missing `Content-Type: application/octet-stream` on download | `404` — OData pipeline can't route to binary file handler | Add `Content-Type: application/octet-stream` to download headers |-| Explicit column list in `Webapi/<table>/fields` with file columns | `403 "Attribute * not enabled for Web Api"` on `/$value` download — the endpoint internally does `SELECT *` | Set field allowlist to `*` when the table has File or Image columns |+| File/Image column omitted from `Webapi/<table>/fields` | `403 Forbidden` on `/$value` download | Add the File/Image column's exact Dataverse LogicalName to the explicit fields list |---@@ -640,7 +641,7 @@ export interface OrderEntity {cr4fc_orderid: string;cr4fc_ordernumber?: string;cr4fc_totalamount?: number;- _cr4fc_category_value?: string;+ _cr4fc_categoryid_value?: string;// Single-valued navigation property (lookup — returns object or null)cr4fc_Category?: CategoryEntity | null;// Collection-valued navigation property (one-to-many — returns array)@@ -692,8 +693,8 @@ export const mapOrderEntity = (entity: OrderEntity): Order => ({id: entity.cr4fc_orderid,orderNumber: entity.cr4fc_ordernumber ?? '',totalAmount: entity.cr4fc_totalamount ?? 0,- categoryId: entity._cr4fc_category_value,- categoryName: entity.cr4fc_Category?.cr4fc_name ?? getFormattedValue(entity, '_cr4fc_category_value') ?? 'Uncategorized',+ categoryId: entity._cr4fc_categoryid_value,+ categoryName: entity.cr4fc_Category?.cr4fc_name ?? getFormattedValue(entity, '_cr4fc_categoryid_value') ?? 'Uncategorized',orderLines: (entity.cr4fc_order_lines ?? []).map(mapOrderLineEntity),createdAt: entity.createdon ?? new Date().toISOString(),updatedAt: entity.modifiedon ?? entity.createdon ?? new Date().toISOString(),@@ -768,7 +769,7 @@ Use this approach when:### Site Settings for Related Entity Columns-When expanding related entities, the `Webapi/<table>/fields` site setting on the **parent** table must include the lookup column's logical name (e.g., `cr4fc_categoryid`). The **related** table must also have its own `Webapi/<related_table>/enabled` and `Webapi/<related_table>/fields` settings configured with the columns being selected in the `$expand`.+When expanding related entities, the `Webapi/<table>/fields` site setting on the **parent** table must include the lookup's OData property (for example, `_cr4fc_categoryid_value`). If POST/PATCH also sets that relationship, include the exact Navigation Property used before `@odata.bind`. The **related** table must also have its own `Webapi/<related_table>/enabled` and `Webapi/<related_table>/fields` settings configured with the columns selected in `$expand`.### Table Permissions for Related Entitiesdiff --git a/plugins/power-pages/scripts/create-site-setting.js b/plugins/power-pages/scripts/create-site-setting.jsindex 8e26089bb..25dd52341 100644--- a/plugins/power-pages/scripts/create-site-setting.js+++ b/plugins/power-pages/scripts/create-site-setting.js@@ -27,7 +27,8 @@ function getArg(name) {}const projectRoot = getArg('projectRoot');-const settingName = getArg('name');+const settingNameArg = getArg('name');+const settingName = settingNameArg === null ? null : settingNameArg.trim();const settingValue = getArg('value');const description = getArg('description');const valueType = getArg('type') || 'string';@@ -68,6 +69,16 @@ if (!usesEnvironmentVariable && valueType === 'boolean' && settingValue !== 'truprocess.exit(1);}+const isWebApiFieldsSetting = /^Webapi\/[^/]+\/fields$/i.test(settingName);+const hasWildcardField = !usesEnvironmentVariable+ && settingValue.split(',').some(column => column.trim() === '*');+if (isWebApiFieldsSetting && hasWildcardField) {+ // Power Pages stops supporting wildcard Web API field access on September 14, 2026.+ // Reject it here so generated site settings remain deployable after that cutoff.+ console.error('Error: Webapi/<table>/fields requires an explicit comma-separated column list. Use LogicalNames for ordinary columns, _<LogicalName>_value for lookup reads, and the exact Navigation Property before @odata.bind for lookup writes; wildcard field access is unsupported beginning September 14, 2026.');+ process.exit(1);+}+const siteSettingsDir = path.join(projectRoot, '.powerpages-site', 'site-settings');if (!fs.existsSync(siteSettingsDir)) {console.error(`Error: Site settings directory not found at ${siteSettingsDir}`);diff --git a/plugins/power-pages/scripts/lib/site-settings-validator.js b/plugins/power-pages/scripts/lib/site-settings-validator.jsindex 1e976867c..9e2124c16 100644--- a/plugins/power-pages/scripts/lib/site-settings-validator.js+++ b/plugins/power-pages/scripts/lib/site-settings-validator.js@@ -3,6 +3,7 @@ const { SITE_SETTING_FILE_SUFFIX, loadYamlRecordsWithErrors, listYamlFiles } = rconst { addFinding, findUnexpectedKeys, findMissingKeys, summarize } = require('./powerpages-validation-utils');const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;+const WEB_API_FIELDS_SETTING_REGEX = /^Webapi\/[^/]+\/fields$/i;const SITE_SETTING_ALLOWED_KEYS = new Set(['description',@@ -76,6 +77,19 @@ function validateSiteSettings(projectRoot) {const hasSource = Object.prototype.hasOwnProperty.call(setting, 'source');const hasValue = Object.prototype.hasOwnProperty.call(setting, 'value');+ const isWebApiFieldsSetting = WEB_API_FIELDS_SETTING_REGEX.test(String(setting.name || '').trim());+ const hasWildcardField = hasValue+ && String(setting.value).split(',').some(column => column.trim() === '*');+ if (isWebApiFieldsSetting && hasWildcardField) {+ // Power Pages stops supporting wildcard Web API field access on September 14, 2026.+ // Relationship writes use the exact Navigation Property before @odata.bind.+ addFinding(findings, 'error', `Web API fields setting "${setting.name}" uses unsupported wildcard field access. Use LogicalNames for ordinary columns, _<LogicalName>_value for lookup reads, and exact Navigation Properties for lookup writes.`, {+ filePath: setting.filePath,+ fileName,+ settingName: setting.name,+ });+ }+if (hasEnvironmentVariableSchema) {if (String(setting.envvar_schema || '').trim() === '') {addFinding(findings, 'error', 'Site setting has an empty "envvar_schema" value.', {diff --git a/plugins/power-pages/scripts/tests/create-site-setting.test.js b/plugins/power-pages/scripts/tests/create-site-setting.test.jsindex 304af883f..c40541883 100644--- a/plugins/power-pages/scripts/tests/create-site-setting.test.js+++ b/plugins/power-pages/scripts/tests/create-site-setting.test.js@@ -17,7 +17,7 @@ test('create-site-setting creates a value-backed site setting', (t) => {const projectRoot = createTempProject(t);const result = runCreateSiteSetting(['--projectRoot', projectRoot,- '--name', 'Webapi/test/enabled',+ '--name', ' Webapi/test/enabled ','--value', 'true','--description', 'Enable test setting','--type', 'boolean',@@ -67,6 +67,59 @@ test('create-site-setting rejects mixing environment-variable and value inputs',assert.match(result.stderr, /cannot be combined with --value or --description/);});+test('create-site-setting rejects wildcard Web API fields', (t) => {+ const projectRoot = createTempProject(t);+ const result = runCreateSiteSetting([+ '--projectRoot', projectRoot,+ '--name', 'Webapi/test/fields',+ '--value', 'test_name,*',+ '--description', 'Allowed test fields',+ ]);++ assert.equal(result.status, 1);+ assert.match(result.stderr, /requires an explicit comma-separated column list/);+ assert.match(result.stderr, /_<LogicalName>_value for lookup reads/);+ assert.match(result.stderr, /Navigation Property before @odata.bind for lookup writes/);+});++test('create-site-setting rejects wildcard Web API fields when the setting name has whitespace', (t) => {+ const projectRoot = createTempProject(t);+ const result = runCreateSiteSetting([+ '--projectRoot', projectRoot,+ '--name', ' Webapi/test/fields ',+ '--value', '*',+ '--description', 'Allowed test fields',+ ]);++ assert.equal(result.status, 1);+ assert.match(result.stderr, /requires an explicit comma-separated column list/);+});++test('create-site-setting detects duplicate names after trimming whitespace', (t) => {+ const projectRoot = createTempProject(t);+ const first = runCreateSiteSetting([+ '--projectRoot', projectRoot,+ '--name', 'Webapi/test/fields',+ '--value', 'test_name',+ '--description', 'Allowed test fields',+ ]);+ assert.equal(first.status, 0, first.stderr);++ const duplicate = runCreateSiteSetting([+ '--projectRoot', projectRoot,+ '--name', ' Webapi/test/fields ',+ '--value', 'test_name',+ '--description', 'Duplicate test fields',+ ]);+ assert.equal(duplicate.status, 1);+ assert.match(duplicate.stderr, /already exists/);+});++test('create-site-setting allows wildcard values for unrelated settings', (t) => {+ const yaml = getWrittenYaml(t, 'HTTP/Access-Control-Allow-Origin', '*');+ assert.match(yaml, /^value: "\*"$/m);+});+// --- YAML quoting edge cases ---//// The YAML writer must quote values that would change meaning when read backdiff --git a/plugins/power-pages/scripts/tests/integrate-webapi-ai-only-mode.test.js b/plugins/power-pages/scripts/tests/integrate-webapi-ai-only-mode.test.jsindex 36a39707f..915f6cafb 100644--- a/plugins/power-pages/scripts/tests/integrate-webapi-ai-only-mode.test.js+++ b/plugins/power-pages/scripts/tests/integrate-webapi-ai-only-mode.test.js@@ -98,7 +98,7 @@ test('Phase 6 webapi-settings-architect prompt branches for AI-only mode', () =>assert.match(wsSection, /AI-only read integration/);assert.match(wsSection, /Do \*\*not\*\* include the primary key column/);assert.match(wsSection, /`_<col>_value` OData read form/);- assert.match(wsSection, /Do NOT add the write form/);+ assert.match(wsSection, /Navigation Property only when non-AI code uses it before `@odata.bind`/);});test('Phase 6.4.2 Path A defaults table permissions to read-only in AI mode', () => {@@ -119,7 +119,7 @@ test('Phase 6.4.3 Path A tightens fields rules in AI mode', () => {assert.match(section, /AI-only read mode/);assert.match(section, /Do NOT include the primary key/);assert.match(section, /only the `_<col>_value` read form/);- assert.match(section, /Omit the LogicalName write form/);+ assert.match(section, /Omit relationship Navigation Properties/);});test('backward compatibility: default CRUD prompts are still present unchanged', () => {diff --git a/plugins/power-pages/scripts/tests/site-settings-validator.test.js b/plugins/power-pages/scripts/tests/site-settings-validator.test.jsindex 8820f2762..54298345b 100644--- a/plugins/power-pages/scripts/tests/site-settings-validator.test.js+++ b/plugins/power-pages/scripts/tests/site-settings-validator.test.js@@ -84,3 +84,42 @@ test('validateSiteSettings rejects environment-variable-backed settings with valconst result = validateSiteSettings(projectRoot);assert.ok(findingMessages(result.findings).some(message => message.includes('must not define "value"')));});++test('validateSiteSettings rejects wildcard Web API fields', (t) => {+ const projectRoot = createTempProject(t);+ writeProjectFile(+ projectRoot,+ '.powerpages-site/site-settings/Webapi-product-fields.sitesetting.yml',+ [+ 'id: e9981fe5-6724-4111-8341-6045bd001091',+ 'name: Webapi/product/fields',+ 'value: "productid,*"',+ '',+ ].join('\n')+ );++ const result = validateSiteSettings(projectRoot);+ assert.ok(findingMessages(result.findings).some(message =>+ message.includes('_<LogicalName>_value for lookup reads')+ && message.includes('Navigation Properties for lookup writes')+ ));+});++test('validateSiteSettings rejects wildcard Web API fields when the setting name has whitespace', (t) => {+ const projectRoot = createTempProject(t);+ writeProjectFile(+ projectRoot,+ '.powerpages-site/site-settings/Webapi-product-fields-whitespace.sitesetting.yml',+ [+ 'id: e9981fe5-6724-4111-8341-6045bd001091',+ 'name: " Webapi/product/fields "',+ 'value: "*"',+ '',+ ].join('\n')+ );++ const result = validateSiteSettings(projectRoot);+ assert.ok(findingMessages(result.findings).some(message =>+ message.includes('uses unsupported wildcard field access')+ ));+});diff --git a/plugins/power-pages/skills/add-ai-webapi/SKILL.md b/plugins/power-pages/skills/add-ai-webapi/SKILL.mdindex 3f6834991..64110e1f5 100644--- a/plugins/power-pages/skills/add-ai-webapi/SKILL.md+++ b/plugins/power-pages/skills/add-ai-webapi/SKILL.md@@ -286,8 +286,8 @@ What the Explore agent reports back (summary — see the reference for the exact- **Layer 1/2 status** per Data Summarization target plus every `$expand` target —`ready` / `missing` / `n/a (search)`.- **Fields-list breadth advisory** — for Layer 1/2 `ready` rows whose existing- `Webapi/<table>/fields` is broader than the AI surface needs (primary key included, lookup- write forms, unused columns), flagged `fields-broader-than-ai-mode` so Phase 3 can surface+ `Webapi/<table>/fields` is broader than the AI surface needs (primary key included, relationship+ Navigation Properties unused by `@odata.bind`, unused columns), flagged `fields-broader-than-ai-mode` so Phase 3 can surfaceit.- **Layer 3 status** per Data Summarization target — `Summarization/Data/Enable` and thespecific `Summarization/prompt/<id>` the code will send.diff --git a/plugins/power-pages/skills/add-ai-webapi/references/ai-api-reference.md b/plugins/power-pages/skills/add-ai-webapi/references/ai-api-reference.mdindex 01ac3a644..0657f37c6 100644--- a/plugins/power-pages/skills/add-ai-webapi/references/ai-api-reference.md+++ b/plugins/power-pages/skills/add-ai-webapi/references/ai-api-reference.md@@ -36,7 +36,7 @@ of those rules do **not** apply here:| Require `If-Match: *` | That header is for PATCH; not applicable. || Table permissions should grant `create: true` / `write: true` for POST callers | AI callers need **`read: true` only**. || `Webapi/<table>/fields` should include the primary key for CRUD | Primary key isn't needed — the record id is in the URL path, not a selected column. MS's shipped case preset ships `Webapi/incident/fields = description,title` with no `incidentid`. |-| Lookup columns need both the LogicalName and `_<col>_value` forms | Only the `_<col>_value` read form is needed. The LogicalName write form is only required if the same table has non-AI mutation code elsewhere. |+| Lookup reads need the relationship write property too | AI-only reads need `_<LogicalName>_value`. Add the exact Navigation Property only when non-AI code uses it before `@odata.bind`. |**Runtime auth path.** When a request hits `/_api/summarization/data/v1.0/<table>(<id>)?...`, thePower Pages runtime walks this sequence before the generative layer sees any content:diff --git a/plugins/power-pages/skills/add-ai-webapi/references/explore-prompt.md b/plugins/power-pages/skills/add-ai-webapi/references/explore-prompt.mdindex e8522afe2..c80dfbf7c 100644--- a/plugins/power-pages/skills/add-ai-webapi/references/explore-prompt.md+++ b/plugins/power-pages/skills/add-ai-webapi/references/explore-prompt.md@@ -131,8 +131,8 @@ table in scope.>> **Fields-list breadth (advisory).** For every Data Summarization target whose Layer 1/2 status> is `ready`, also report whether the existing `Webapi/<table>/fields` includes any of:-> (a) the primary key column (`<prefix>_<table>id`); (b) lookup write forms (e.g.-> `cr4fc_categoryid` without the matching `_cr4fc_categoryid_value` read form); (c) columns the+> (a) the primary key column (`<prefix>_<table>id`); (b) relationship Navigation Properties with+> no matching non-AI `[email protected]` write; (c) columns the> AI surface won't read. Mark these targets `fields-broader-than-ai-mode` so Phase 3 can surface> the gap to the user — they can choose to narrow now or accept the broader posture.>diff --git a/plugins/power-pages/skills/audit-permissions/SKILL.md b/plugins/power-pages/skills/audit-permissions/SKILL.mdindex caa40ca44..853a89b19 100644--- a/plugins/power-pages/skills/audit-permissions/SKILL.md+++ b/plugins/power-pages/skills/audit-permissions/SKILL.md@@ -106,6 +106,15 @@ Parse the JSON output and carry the findings into the audit. Treat:These findings should be included in the final audit report even if the later code/Dataverse analysis also finds additional issues.+If the validator reports wildcard field access in a `Webapi/<table>/fields` setting, add this+critical finding to the report:++- **Severity:** `critical`+- **Title:** `Unsupported wildcard Web API fields for <table>`+- **Reasoning:** The fields setting uses wildcard access, which is unsupported beginning September 14, 2026+- **Fix:** Replace the wildcard using `${PLUGIN_ROOT}/references/webapi-field-allowlist.md`: LogicalNames for ordinary columns, `_<LogicalName>_value` for lookup reads, and exact Navigation Properties used by `@odata.bind`+- **Details:** Include the site-setting file path and setting name from the validator finding+After Step 3.1 determines the environment URL, if this audit is running locally with Dataverse access available, rerun the shared validator with live relationship verification enabled and merge any additional findings:```bashdiff --git a/plugins/power-pages/skills/integrate-backend/references/decision-framework.md b/plugins/power-pages/skills/integrate-backend/references/decision-framework.mdindex 69c8aa887..d26a1f5d9 100644--- a/plugins/power-pages/skills/integrate-backend/references/decision-framework.md+++ b/plugins/power-pages/skills/integrate-backend/references/decision-framework.md@@ -66,7 +66,7 @@ Use this framework to recommend the right backend integration approach for a Pow**Field-list drift caveat (when both items exist for the same table):** if `/integrate-webapi`has already configured `Webapi/<table>/fields` for full CRUD (including primary key and-lookup write forms), the follow-up `/add-ai-webapi` run detects Layer 1/2 as `ready` and+relationship Navigation Properties used by `@odata.bind`), the follow-up `/add-ai-webapi` run detects Layer 1/2 as `ready` andskips its delegation — leaving the broader CRUD allowlist in place. The AI surface stillworks, but the fields list is broader than AI-only mode would produce. The`ai-webapi-settings-architect` agent flags this as an advisory in its plan; the user candiff --git a/plugins/power-pages/skills/integrate-webapi/SKILL.md b/plugins/power-pages/skills/integrate-webapi/SKILL.mdindex d7bad72f3..f64c15ae7 100644--- a/plugins/power-pages/skills/integrate-webapi/SKILL.md+++ b/plugins/power-pages/skills/integrate-webapi/SKILL.md@@ -104,7 +104,7 @@ Inspect `$ARGUMENTS`. If the text begins with the sentinel `[AI-READ-ONLY]`, the- Skip the Phase 3 interactive table confirmation and use the provided `tables` list verbatim (user has already confirmed in the caller).- The Phase 4.1 `webapi-integration` prompt restricts operations to **read-only** (list + get by id).- The Phase 6 Path B agent prompts apply the hardened AI-only posture documented in each agent's "AI-only read mode" section.-- The Phase 6 Path A script invocations use `--read` only for table permissions and omit primary keys / lookup write forms from `Webapi/<table>/fields`.+- The Phase 6 Path A script invocations use `--read` only for table permissions and omit primary keys / relationship Navigation Properties from `Webapi/<table>/fields`.- No `AskUserQuestion` prompts are issued for Phase 3 or Phase 6.2 — the caller owns those decisions.- **Defer all git commits to the caller.** Skip Phase 4.4 (`git add -A && git commit`) and Phase 6.5 (permissions/settings commit) entirely. The caller is batching changes into one or two commits at orchestrator-defined milestones; an unprompted commit here turns one logical change into three. Print the file lists you would have committed so the caller can reproduce them.- **Suppress the end-of-skill deploy prompt.** Skip Phase 6.1 (deploy-now ask when `.powerpages-site` is missing — the caller has already gated on this), Phase 7.3 (final deploy ask), and Phase 7.4 (post-deploy notes). The caller owns the single end-of-orchestration deploy decision; nesting deploy prompts inside the delegation gives the user 2–3 redundant asks per run. Return the integration summary (Phase 7.2) without trailing deploy/notes.@@ -399,7 +399,7 @@ If the user chooses to upload an existing diagram:2. Parse the diagram into structured format:- **Web roles**: Match with existing roles from `.powerpages-site/web-roles/` by name to get their UUIDs- **Table permissions**: Permission name, table logical name, web role UUID(s), scope, CRUD flags (read/create/write/delete/append/appendto), parent permission and relationship name (if Parent scope)- - **Site settings**: `Webapi/<table>/enabled` and `Webapi/<table>/fields` — **CRITICAL: fields normally list specific column logical names; only use `*` when the site relies on aggregate OData queries (`$apply`/aggregate) that otherwise fail with 403**+ - **Site settings**: `Webapi/<table>/enabled` and `Webapi/<table>/fields` — **CRITICAL: fields must list every required column LogicalName explicitly, including columns used by aggregate OData queries**3. **Validate column names against Dataverse** — Even when using a user-provided diagram, query Dataverse for each table's column LogicalNames and verify that every column in the `Webapi/<table>/fields` values uses the exact Dataverse LogicalName (case-sensitive). Correct any mismatches before creating files.@@ -459,9 +459,9 @@ Use the `Task` tool to invoke the `webapi-settings-architect` agent at `${PLUGIN> "**AI-only read integration.** These tables will be summarised by `/_api/summarization/data/v1.0/`. The fields list rules are stricter than the default CRUD posture:>-> - `Webapi/<table>/fields` must contain **exactly** the columns named in the primary's `$select` / `$expand` — no more, no less.+> - `Webapi/<table>/fields` must contain **exactly** the columns required by every site call against the table. Start with the primary's `$select` / `$expand`; if the table is also used by an aggregate query, add its grouping keys, aggregate inputs, filter columns, and ordered columns.> - Do **not** include the primary key column. The summarization endpoint carries the record id in the URL path; Microsoft's shipped case preset ships `Webapi/incident/fields = description,title` with no `incidentid`.-> - For lookup columns, include **only** the `_<col>_value` OData read form. Do NOT add the write form `<col>` unless the same table has non-AI mutation code elsewhere.+> - For lookup columns, include **only** the `_<col>_value` OData read form. Add a relationship Navigation Property only when non-AI code uses it before `@odata.bind`.> - Still query Dataverse for exact LogicalNames (case-sensitive) — case mismatches produce 403."The agent will:@@ -535,18 +535,18 @@ node "${PLUGIN_ROOT}/scripts/create-site-setting.js" --projectRoot "<PROJECT_ROOnode "${PLUGIN_ROOT}/scripts/create-site-setting.js" --projectRoot "<PROJECT_ROOT>" --name "Webapi/error/innererror" --value "true" --description "Enable detailed error messages for debugging" --type "boolean"```-**Important**: The `--value` for fields settings MUST use exact Dataverse LogicalNames (case-sensitive, all lowercase) for normal CRUD/read scenarios. Using incorrect casing causes 403 Forbidden errors.+**Important**: The `--value` for every fields setting MUST follow `${PLUGIN_ROOT}/references/webapi-field-allowlist.md`. Use exact LogicalNames for ordinary columns, `_<LogicalName>_value` for lookup reads, and the exact Navigation Property used before `@odata.bind` for lookup writes. Wildcard field access is unsupported beginning September 14, 2026.-**Aggregate exception**: If the site uses aggregate OData queries (`$apply`, `aggregate`, grouped totals, etc.), set `Webapi/<table>/fields` to `*`. Power Pages rejects some aggregate queries with 403 unless wildcard field access is enabled.+**Aggregate queries**: Include every grouping key, aggregate input, filter column, and ordered column referenced by `$apply` in the explicit fields list.-**Lookup columns**: For every lookup column, include **both** the LogicalName (`cr87b_categoryid`) AND the OData computed attribute (`_cr87b_categoryid_value`) in the fields value. The Power Pages Web API does a literal match — the LogicalName is needed for write operations, the `_..._value` form is needed for read operations (`$select`, `$filter`). Missing either form causes 403 errors.+**Lookup columns**: Include `_<LogicalName>_value` for reads. If POST/PATCH sets the relationship with `[email protected]`, also include that exact case-sensitive Navigation Property in the fields value.**AI-only read mode (Phase 1.6 flag set)**: the fields-value rules tighten:-- Include only the columns named in the primary's `$select` / `$expand`. Extra columns expand the allowlist without any caller reading them.+- Include the exact columns required by every site call against the table. Start with the primary's `$select` / `$expand`; if the table is also used by an aggregate query, add its grouping keys, aggregate inputs, filter columns, and ordered columns.- Do NOT include the primary key. The summarization endpoint carries the record id in the URL path; Microsoft's shipped case preset ships `Webapi/incident/fields = description,title` with no `incidentid`.-- For lookup columns, include only the `_<col>_value` read form. Omit the LogicalName write form — no write operations run against these tables in AI mode.-- The aggregate `*` exception still applies if the summarised table also has aggregate OData code elsewhere in the site.+- For lookup columns, include only the `_<col>_value` read form. Omit relationship Navigation Properties because AI mode has no `@odata.bind` writes.+- Keep File/Image and aggregate-query columns explicit, adding only the columns the site actually uses.### 6.5 Git Commit@@ -623,7 +623,7 @@ that covers AI-specific concerns (governance hierarchy, runtime version, Bing deOtherwise, after deployment (or if skipped), remind the user:- **Test the API**: Open the deployed site and verify Web API calls work in the browser's Network tab-- **Check permissions**: If any API call returns 403, verify table permissions and site settings are correct. The most common cause of 403 errors is column names in `Webapi/<table>/fields` not matching the exact Dataverse LogicalName (case-sensitive — must be all lowercase). If the failing request uses aggregate OData (`$apply`, `aggregate`, grouped totals), also verify `Webapi/<table>/fields` is set to `*`.+- **Check permissions**: If any API call returns 403, verify table permissions and site settings are correct. The most common cause is a column in the request missing from `Webapi/<table>/fields` or not matching the exact case-sensitive Dataverse LogicalName returned by metadata. For aggregate OData (`$apply`, aggregate, grouped totals), verify that every grouping key, aggregate input, filter column, and ordered column is listed explicitly.- **Disable innererror in production**: If `Webapi/error/innererror` was enabled for debugging, disable it before going live- **Web roles**: Users must be assigned the appropriate web roles to access protected APIsdiff --git a/plugins/power-pages/skills/migrate-webapi-selectall/references/column-analysis.md b/plugins/power-pages/skills/migrate-webapi-selectall/references/column-analysis.mdindex 6ecb43876..886b797c4 100644--- a/plugins/power-pages/skills/migrate-webapi-selectall/references/column-analysis.md+++ b/plugins/power-pages/skills/migrate-webapi-selectall/references/column-analysis.md@@ -50,9 +50,8 @@ For each table-returning GET:- include root `$select` columns;- include columns used by `$filter` and `$orderby`;-- include lookup read properties such as `_<lookup-column-name-1>_value` when- consumed;-- include the source lookup attribute for single-valued `$expand` navigation;+- include lookup properties as `_<LogicalName>_value` when the lookup is read,+ filtered, or expanded;- assign nested `$select`, filter, and order columns to the expanded table;- include FetchXML attributes, conditions, ordering, grouping, and aggregateinputs on their owning entity or link-entity;@@ -78,7 +77,9 @@ annotations, and filter literals are not Dataverse columns.For POST, PATCH, and PUT:- include every payload property mapped to a Dataverse attribute;-- resolve `[email protected]` to the underlying lookup attribute;+- include the exact case-sensitive Navigation Property before `@odata.bind`;+- resolve that property through relationship metadata rather than guessing from+ the attribute SchemaName;- trace variables passed to `JSON.stringify`, HTTP clients, and customwrappers;- inspect conditional properties and every object spread source;@@ -109,7 +110,10 @@ conventions, or likely primary keys.## Configuration proposalFor each logical table and configuration scope, compute the sorted union of-proven columns across all reads and writes. Every proposed column needs:+proven field identifiers across all reads and writes. Use exact Dataverse+LogicalNames for ordinary columns, `_<LogicalName>_value` for lookup reads, and+the exact Navigation Property before `@odata.bind` for relationship writes.+Every proposed identifier needs:- a relative source path and line, or a user-confirmed contract;- the operation requiring it;diff --git a/plugins/power-pages/skills/test-site/SKILL.md b/plugins/power-pages/skills/test-site/SKILL.mdindex 8b5d31503..c63ee4fbc 100644--- a/plugins/power-pages/skills/test-site/SKILL.md+++ b/plugins/power-pages/skills/test-site/SKILL.md@@ -394,7 +394,7 @@ Record the findings and any recommended frontend fixes for the Phase 6 report.For each failed API request, provide specific remediation:- **401 Unauthorized**: "This endpoint requires authentication. If you skipped login in Phase 3, try re-running with authentication. Otherwise, check that the auth token is being passed correctly."-- **403 Forbidden on `/_api/` calls**: "Check the following:\n 1. **Table permissions** — Ensure a table permission exists for this table with the correct scope and privileges (Read, Write, etc.) assigned to the appropriate web role.\n 2. **Site settings** — Verify `Webapi/<tablename>/enabled` is set to `true` and `Webapi/<tablename>/fields` lists the required columns (exact Dataverse LogicalNames, all lowercase, comma-separated). If the failing request uses aggregate OData (`$apply`, `aggregate`, grouped totals), set `Webapi/<tablename>/fields` to `*`.\n 3. **Web role assignment** — Confirm the authenticated user has the correct web role assigned."+- **403 Forbidden on `/_api/` calls**: "Check the following:\n 1. **Table permissions** — Ensure a table permission exists for this table with the correct scope and privileges (Read, Write, etc.) assigned to the appropriate web role.\n 2. **Site settings** — Verify `Webapi/<tablename>/enabled` is set to `true`. The fields value uses LogicalNames for ordinary columns, `_<LogicalName>_value` for lookup reads, and exact Navigation Properties for relationships written through `@odata.bind`. For aggregate OData, include every grouping key, aggregate input, filter column, and ordered column.\n 3. **Web role assignment** — Confirm the authenticated user has the correct web role assigned."- **404 Not Found**: "Verify the entity set name (should be the plural form of the table logical name). Check that the table exists in Dataverse and is published."- **500 Internal Server Error**: "Enable the `Webapi/error/innererror` site setting (set to `true`) to get detailed error messages. Redeploy and retest to see the inner error details."