Skip to content

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.

fix(canvas-apps): strengthen functional app contracts (#468)

Maliheasadi94d73f9bcdc5
diff --git a/plugins/canvas-apps/agents/canvas-app-planner.md b/plugins/canvas-apps/agents/canvas-app-planner.md
index 4282e3d1a..8d09e7ead 100644
--- a/plugins/canvas-apps/agents/canvas-app-planner.md
+++ b/plugins/canvas-apps/agents/canvas-app-planner.md
@@ -50,6 +50,11 @@ exactly, record an explicit approximation and reason; never silently rename butt
"drag-style", call buttons "handles", or put copy in the app that promises an interaction
the controls do not provide.
+Plan in functional-first order: shared state and stable identity, complete executable
+workflows, observable evidence, responsive/accessibility behavior, then visual polish.
+When a control or screen budget is tight, remove decorative complexity before omitting,
+combining, or weakening a requested action.
+
Use `ModernTabList` only when it switches visible panels within one screen. For navigation
between separate screen files, plan a repeated ModernButton row with direct `OnSelect:
=Navigate(...)` actions and an explicit current-screen appearance.
@@ -62,6 +67,7 @@ Read:
- `${PLUGIN_ROOT}/references/ControlGuide.md` — control selection, per-control properties, enums
- `${PLUGIN_ROOT}/references/LayoutGuide.md` — responsive layout, scrolling, color contrast
- `${PLUGIN_ROOT}/references/PowerFxGuide.md` — state, events, named formulas, mock data
+- `${PLUGIN_ROOT}/references/BehaviorGuide.md` — action contracts, lifecycle behavior, mutation evidence
- `${PLUGIN_ROOT}/references/DesignGuide.md` — aesthetic direction and design process
- `${PLUGIN_ROOT}/references/PlanTemplates.md` — the exact shape of every artifact you write
@@ -128,20 +134,75 @@ Before writing plans:
visible labels and every filter must agree; do not display a due date while silently
filtering the calendar and report by a different date.
8. For each semantic display control, record its visible value property in the brief
- (`Badge.Content`, card slots, avatar identity). Accessible labels and color bindings do
- not substitute for visible content.
+ (`Badge.Content`, card slots, avatar identity). For every primary-record row or detail,
+ name the canonical human-readable identity field and the text control/property that
+ renders its full value. Avatar initials, icons, IDs, accessible labels, and color
+ bindings do not substitute for visible identity text.
9. Before selecting `ModernDataGrid`, confirm its current definition can declare every
requested visible column in YAML. If it exposes no Fields/Columns contract and there is
no existing configured grid to preserve, plan a sortable Gallery table with explicit
headers instead.
+10. Classify the approved requirements with the capability inventory in
+ `${PLUGIN_ROOT}/references/BehaviorGuide.md`. Use it to find missing behaviors, not to invent
+ unrequested features.
+11. Build one Action Contract row for each requested or approved action. Do not infer
+ universal CRUD for supporting entities, but treat role-scoped management of primary
+ records as requiring reachable list/detail, correction/update, and remove/cancel
+ flows. A named role that must "manage all" primary records therefore requires separate
+ list/select, edit/save, and remove/cancel contracts; a read-only queue is insufficient.
+ Split create, edit, delete, search, filter, approve, reject, period, and export
+ behaviors into separate rows when requested or implied by that role-scoped lifecycle.
+ When review has approved and rejected outcomes, require both Approve and Reject/Decline
+ contracts on the same eligible record surface. A lone decision is an incomplete plan;
+ phone density may change their arrangement but may not remove either contract.
+12. For every Action Contract, name its eligible precondition, source of truth, immutable
+ record identity, exact event, source transition, postcondition, observer formula, and
+ visible evidence. Verify the observer reads the same source and field the event writes.
+ A control label and an `OnSelect` formula are not a complete contract.
+13. For every mutation, name the target source, exact data operation, refresh or collection
+ update, and a mandatory in-viewport mutation receipt bound to the returned record, changed
+ stable ID, or deletion snapshot. Record the mutation's **write set** and **proof set** in
+ its Action Contract. The write set lists every field or status the handler changes. The
+ proof set lists the identity plus the values the receipt renders. For create and edit,
+ proof every user-entered or user-selected field in the write set; never omit a field merely
+ because the destination list does not display it. Specify the receipt control, visibility
+ state, and one labeled binding per proof-set field. The changed list, detail, dashboard,
+ or metric must also read the updated source, but navigation, a notification, or a record
+ somewhere in a longer list cannot replace the receipt.
+14. Verify every Action Contract has a reachable entry point and owner screen. Include
+ supporting setup actions when they are necessary to exercise an explicitly requested
+ lifecycle, comparison, relationship, or ranking with local/mock data.
+15. For create and edit contracts, specify every required input, requiredness, finite-choice
+ source, concrete option values, default/placeholder, stable record ID, and post-save
+ destination. For short static choices, prefer visible radio or button choices, then a
+ dropdown that commits by click or tap; do not plan a searchable combobox unless the set
+ requires search or allows free-form entry. Give required short choices valid defaults
+ when the business rule permits them. The edit contract must name the visible per-record
+ Edit entry point, selected-record state, prepopulation formulas, stable-ID update, cancel
+ behavior, mutation write set, and receipt proof set shown after save. Reject the contract
+ if any submitted visible field appears in the write set but not the proof set.
+16. Write a `## Functional Test Matrix` with at least one deterministic Given/When/Then
+ success scenario per Action Contract and one scenario for each required boundary or
+ negative path. Use concrete seeded IDs and values for local/mock data. Each `Then`
+ names the source postcondition and the exact observer/evidence surface that proves it.
+ In EDIT mode, add regression scenarios for existing behaviors whose source, fields,
+ controls, or observer formulas are touched.
+17. For every selector or filter, couple the concrete option source, readable option
+ formula, pointer-committed selected value, consumer predicate, active-selection
+ indicator, and clear behavior. Apply the short-choice rule to filters as well as form
+ inputs. Seed at least two matching records and one non-matching record for every
+ filter scenario.
Property support is per-control. Never transfer radius, shadow, padding, or other styling
properties by analogy. Text styling in particular is spelled differently across families:
the modern React controls use `Color` and `Size`, `Badge` uses `FontColor` and `FontSize`,
and `ModernCard` uses `TitleColor`/`TitleSize` with a single `BorderRadius`.
-Never plan a `Control:` value with an `@version` suffix. Use the bare name returned by
-`list_controls`.
+Use `list_controls` only to discover the name passed to `describe_control`. For every
+planned control type, copy the `Control:` value and all other required creation keywords
+from the `describe_control` response verbatim into the control definition and screen
+brief. Never strip an `@version` suffix or infer `ComponentName`,
+`ComponentLibraryUniqueName`, `Variant`, or `Layout` from the list result.
## 4. Size the Screens
@@ -173,6 +234,8 @@ For every screen brief, state explicitly:
`Self.Width`. Do not initialize layout variables such as `varIsMobile` or `varColumns`
in `OnVisible`; they can be unset in Studio and become stale after resize.
- That the root container scrolls (`LayoutOverflowY: =LayoutOverflow.Scroll`).
+- That the sole responsive root uses exact `Width: =Parent.Width`,
+ `Height: =Parent.Height`, `LayoutMinWidth: =0`, and `LayoutMinHeight: =0`.
- That the screen-level `Children:` list contains only that root, with every visible
section nested under the root's `Children:` list.
- The foreground color for text on every colored surface, so nothing renders
@@ -194,8 +257,17 @@ For every screen brief, state explicitly:
gaps, padding and the resulting section size. Presence of a breakpoint is not enough.
- Group each visible label with its corresponding input in one field container before
the row stacks.
+- For galleries with record actions, define the phone row as an action-first composition:
+ render the canonical identity's full text, status, and required lifecycle actions by
+ stacking them or placing the actions in an immediately visible overflow/detail entry.
+ Avatar initials do not satisfy identity. When Approve and Reject/Decline are required,
+ keep both on the same eligible row or in the same immediately reachable detail. Do not
+ preserve a desktop column layout that moves Edit, approve, reject, or remove beyond the
+ canvas width, and do not drop an action to make the row fit.
- For bounded local galleries of about ten rows or fewer, size the gallery to all rows
- and rely on the root scroll; do not plan a hidden nested scroll region.
+ and rely on the root scroll; do not plan a hidden nested scroll region. Dynamic gallery
+ height is valid, but derive it from `CountRows(<the same source/filter used by Items>)`,
+ never from rendered-item state such as `Self.AllItemsCount`.
## 6. Assign the Control Name Space
@@ -266,6 +338,8 @@ Follow `${PLUGIN_ROOT}/references/PlanTemplates.md`.
Write only orchestration information:
- Mode and requirements
+- Requirement coverage and complete Action Contracts
+- Functional Test Matrix
- Working directory
- Compact discovery summary
- Dispatch table
@@ -311,6 +385,9 @@ Each brief contains only what that builder needs:
each enum property the screen actually sets
- Every inline literal value the screen writes directly: screen-local `Items`, `Default`
values, and static option lists
+- Every Action Contract and Functional Test Matrix scenario owned or exercised by the
+ screen, including preconditions, source/ID, transition, observer, evidence, and boundary
+ behavior
Two things a builder cannot recover on its own, and both cost a full round trip:
@@ -360,6 +437,7 @@ Plan index: `[working directory]/canvas-app-plan.md`
Shared plan: `[working directory]/canvas-app-shared.md`
App file: [`[working directory]/App.pa.yaml` for CREATE, "unchanged" for EDIT]
App compile: [Clean / diagnostics remaining, with detail]
+Functional scenarios: [N total; all assigned to screen briefs / defects]
```
## Constraints
@@ -372,7 +450,8 @@ App compile: [Clean / diagnostics remaining, with detail]
- Do not embed all discovery output in the index or shared plan.
- Every screen brief must be self-sufficient when read with the shared plan.
- Never assign two screens the same control name prefix.
-- Never plan a `Control:` value carrying an `@version` suffix.
+- Never derive or normalize control creation keywords from `list_controls`; copy them
+ from `describe_control`.
- When re-invoked to repair a defective brief, change only what the reported defect
requires. Do not restructure the dispatch table, rewrite unaffected briefs, or redesign
the app.
diff --git a/plugins/canvas-apps/agents/canvas-screen-builder.md b/plugins/canvas-apps/agents/canvas-screen-builder.md
index 8ab282910..93a5111eb 100644
--- a/plugins/canvas-apps/agents/canvas-screen-builder.md
+++ b/plugins/canvas-apps/agents/canvas-screen-builder.md
@@ -36,6 +36,7 @@ Read:
1. The shared plan
2. The assigned screen brief
3. For `Modify`, the exact target `.pa.yaml`
+4. `${PLUGIN_ROOT}/references/BehaviorGuide.md` when the brief contains Required Actions
Do not read `[working directory]/canvas-app-plan.md`, other screen briefs, or other screen YAML files.
Do not call discovery tools. The assigned documents contain all required context.
@@ -96,9 +97,9 @@ Do not fix unrelated pre-existing issues.
even when they do not carry the prefix; renaming them breaks every formula that
references them.
- Use exact properties from the screen brief's control definitions.
-- Write the bare control name: `Control: ModernText`, never `Control: [email protected]`.
- A version suffix on one control makes every property of every other version report as
- `Unknown property` across the whole app.
+- Copy each control's complete creation-keyword block from the screen brief exactly. The
+ planner sourced `Control:`, `ComponentName`, `ComponentLibraryUniqueName`, `Variant`,
+ and `Layout` from `describe_control`; do not strip, normalize, or reconstruct them.
- Copy enum type names verbatim from the `Enum name:` line of the control definition in
your brief. They are not derivable from the control name — `Badge.Appearance` is
`'BadgeCanvas.Appearance'`, `ModernButton.Appearance` is `ButtonAppearance`, and
@@ -108,6 +109,50 @@ Do not fix unrelated pre-existing issues.
only on the gallery's direct child. Use them on the row shell and nowhere else; deeper
controls use `FillPortions`, `Parent.Width` or `Parent.Height`.
- Use exact RGBA values and shared state names from the shared plan.
+- Implement every row in `Required Actions` with the named reachable control and event.
+ Do not leave create, edit, delete, search, filter, review, approve, reject, period, or
+ export behavior as static UI.
+- Treat every Required Action as one closed transition loop: reachable eligible entry,
+ event, operation against the named source and stable ID, declared postcondition, observer
+ reading that same source, and visible evidence. Do not write one field and render another.
+- Implement every row in `Functional Test Scenarios`. Use its Given state to verify
+ visibility and enablement, mentally execute the exact When interaction, then trace the
+ resulting source values through the named observer and evidence. Implement boundary and
+ negative behavior rather than replacing it with explanatory copy.
+- For short finite-choice fields, use the radio, visible choice buttons, or directly
+ selectable dropdown named by the brief, populate all concrete options, configure visible
+ item text, and give required fields a valid default when the business rule permits one.
+ Do not substitute an autocomplete combobox or any control that requires typed filtering
+ or keyboard-only commitment.
+- A manageable primary-record row needs a visible Edit action. Its handler stores the
+ stable record ID and prepopulates every editable input; Save updates that ID, preserves
+ unchanged fields, exits edit mode, and reveals the changed values. Cancel clears edit
+ state without mutating the source.
+- Every primary-record row or its immediately reachable detail renders the canonical
+ human-readable identity as full visible text. An avatar, initials, icon, record ID,
+ accessible label, or tooltip may supplement the identity but cannot replace that text.
+- When the brief contains paired Approve and Reject/Decline actions, implement both for
+ every eligible pending record on the same row or in the same immediately reachable
+ detail. Do not omit one action to reduce control count or fit a phone row; stack the
+ controls or use the planned detail entry.
+- For each mutation, capture the returned record, changed stable ID, or deletion snapshot
+ before resetting inputs or navigating. Update or refresh the bound source, then show the
+ brief's in-viewport mutation receipt. Implement one readable labeled binding for every
+ field in the Required Action's proof set. For create and edit, compare the handler's
+ write set with the proof set and do not finish while any user-entered or user-selected
+ field is missing from the receipt. Keep it visible until dismissal or the next mutation.
+ Navigation, `Notify()`, or a selected, highlighted, filtered, or sorted list row may
+ supplement this receipt but cannot replace it.
+- At phone width, stack a manageable record row or provide an immediately visible
+ overflow/detail entry so full identity text, status, and required Edit/review/remove
+ actions remain reachable. Do not implement required actions only in right-side desktop
+ columns.
+- For bounded dynamic galleries, derive height from
+ `CountRows(<the same source/filter used by Items>)`. Never use `Self.AllItemsCount` or
+ another rendered-item count to determine the gallery's own height.
+- The sole responsive root uses exact `Width: =Parent.Width`,
+ `Height: =Parent.Height`, `LayoutMinWidth: =0`, and `LayoutMinHeight: =0`; put
+ breakpoint sizing on descendants.
- Prefix every property value with `=`. A value without it fails the whole file at parse
time and suppresses every other diagnostic in the screen.
- Quote any value containing a colon followed by a space — `Text: '="Votes: " & n'`, not
@@ -121,6 +166,22 @@ Do not fix unrelated pre-existing issues.
it with one `create` or one whole-file `edit`. Dozens of incremental edits against a
file you keep re-reading is the dominant cost in this workflow and does not improve the
result.
+- Before the first `create` or whole-file `edit`, inspect the composed YAML text itself:
+ - Every control creation keyword exactly matches the screen brief. Do not alter a
+ `Control:` value or omit a required `ComponentName`, `ComponentLibraryUniqueName`,
+ `Variant`, or `Layout`.
+ - Every enum qualifier exactly matches the brief's `Enum name:`. In particular, Badge
+ formulas use `='BadgeCanvas.Appearance'.Filled` and
+ `='BadgeCanvas.ThemeColor'.Warning`, never `BadgeAppearance.Filled` or
+ `BadgeColor.Warning`.
+ - Every property used appears in that control's definition and every property value
+ starts with `=`.
+ These are pre-save checks, not only self-QA checks: invalid whole-screen YAML may make
+ the document server reject the write before the file exists to inspect.
+- If a whole-file write returns `failedToSave` or `ServerException`, do not submit the
+ identical content again. Re-run the pre-save checks against the composed text, correct
+ every creation-keyword mismatch, enum qualifier, unsupported property, missing formula
+ prefix, and duplicate key in one pass, then retry the corrected whole file once.
- Keep the screen proportionate: roughly 40 controls is the practical ceiling for one
screen. If the brief demands substantially more, implement the specification faithfully
but say so in your result so the orchestrator can decide whether to split it.
@@ -144,6 +205,10 @@ Do not fix unrelated pre-existing issues.
5. Record an outcome for every check by number — `PASS`, `FIXED(n)` or `N/A` — as
`${PLUGIN_ROOT}/references/QAChecks.md` § "Reporting" describes. You report the line; do not
summarize it as a total.
+6. For each Required Action, record a compact transition trace:
+ `Action: precondition -> control.event -> source[ID] write/read -> postcondition ->
+ observer -> evidence`. Mark `PASS` only when every link is present in the generated
+ formulas. Mark `BLOCKED: [missing link]` otherwise and repair it before returning.
Do not call `compile_canvas`; the orchestrator owns compilation. It compiles as soon as
the first builder returns, so return promptly rather than polishing indefinitely.
@@ -155,20 +220,26 @@ Screen: [logical name]
Action: [Create / Modify]
File: [absolute target file]
QA: 1 [outcome] · 2 [outcome] · …
-- [fix summary, or "clean"]
+Fixes: [fix summary, or "clean"]
+Functional:
+- [Action]: PASS — [precondition] -> [control.event] -> [source and stable ID operation] -> [postcondition] -> [observer and visible evidence]
Status: Done
```
The `QA:` line must list every check in `${PLUGIN_ROOT}/references/QAChecks.md`. A return without it is
incomplete, and the orchestrator will send the screen back.
+The `Functional:` section must contain exactly one trace per Required Action. A trace that
+omits the source/ID, postcondition, or observer/evidence is incomplete even when Check 33,
+34, or 35 says `PASS`.
+
## Constraints
- Modify exactly one screen file.
- Do not edit `[working directory]/App.pa.yaml` or `[working directory]/_EditorState.pa.yaml`; the top-level orchestrator owns app-level and cross-file ordering changes.
- Never substitute a filename, YAML key, or control name prefix.
- Never use a property absent from that control's definition.
-- Never write a version suffix on a `Control:` value.
+- Never normalize a `Control:` value supplied by the brief.
- Never invent an enum type name, and never write an enum member that starts with a digit
unquoted — `DecimalPrecision.'1'`, not `DecimalPrecision.1`.
- Never leave a `ModernCard` slot unset. For text-only cards set `Image: =Blank()` and,
diff --git a/plugins/canvas-apps/references/BehaviorGuide.md b/plugins/canvas-apps/references/BehaviorGuide.md
new file mode 100644
index 000000000..a7627fb54
--- /dev/null
+++ b/plugins/canvas-apps/references/BehaviorGuide.md
@@ -0,0 +1,193 @@
+# Canvas App Behavior Acceptance Guide
+
+Use this guide to turn advanced prompt requirements into implementation contracts that can be verified from the generated YAML. A control, collection, or screen existing is not proof that the behavior works.
+
+## Functional capability inventory
+
+Canvas apps are extensible through controls, Power Fx, data sources, connectors, components, and device capabilities, so no static list can enumerate every possible app. Classify every requested requirement into the applicable capability families below and create an Action Contract for every behavior in scope:
+
+1. **App shell and navigation** — start screen, menus, tabs, deep links, back behavior, responsive composition, accessibility, loading, empty, error, and permission states.
+2. **Data lifecycle** — create, read, select, view details, edit, save, cancel, delete, restore, validate, deduplicate, and preserve stable identity.
+3. **Data exploration** — search, filter, sort, group, paginate, select, clear, drill down, and show active criteria and zero-result states.
+4. **Workflow and review** — status transitions, approve, reject, assign, escalate, submit, reopen, confirm, enforce eligibility, and expose role-specific actions.
+5. **Relationships and hierarchy** — parent/child, team membership, ownership, dependencies, trees, org charts, and reassignment.
+6. **Time and scheduling** — dates, calendars, periods, recurrence, deadlines, timers, reminders, and time-zone-aware display.
+7. **Analytics and visualization** — counts, aggregates, KPIs, charts, dashboards, boards, maps, rankings, comparisons, and snapshots.
+8. **Files, media, and device input** — attachments, images, camera, barcode, audio, signatures, location, sensors, and import/export.
+9. **Integration and automation** — data-source CRUD, connectors, APIs, flows, notifications, report preparation, refresh, and error handling.
+10. **Security, persistence, and resilience** — role visibility, data-source permissions, session versus durable storage, offline behavior, concurrency, retry, and truthful failure states.
+
+Implement only capabilities supported by discovered controls, data sources, APIs, and the approved scope. If exact behavior is unavailable, use an explicitly approved approximation or mark it blocked. Never substitute static UI for a behavior from this inventory.
+
+## Functional-first priority
+
+Allocate implementation effort in this order:
+
+1. Shared data model, stable IDs, source-of-truth fields, and valid seed data.
+2. Every requested action's complete state transition and boundary behavior.
+3. Observable postconditions and cross-screen source consistency.
+4. Reachability, responsive layout, accessibility, and truthful empty/error states.
+5. Visual polish, decorative media, and optional secondary content.
+
+When control or screen budgets are tight, remove decoration and consolidate presentation before reducing behavior. An attractive control that does not perform its named action is a defect, not partial credit.
+
+## General acceptance contract
+
+For every requested behavior, the plan must identify:
+
+1. The initial state and visible entry point.
+2. The exact source of truth and stable record identity.
+3. The exact control event and state or data operation.
+4. The postcondition in that source and the observer formula that reads it.
+5. The success path and its visible evidence.
+6. Any required blocked or boundary path and its visible evidence.
+
+Keep a single source of truth for each concept. Do not update one collection while a visible gallery, metric, or selector reads another.
+
+Every mutation needs an in-viewport result surface bound to the exact affected record or a snapshot captured by the handler. Show the record identity, action, and fields needed to verify the requested outcome. A list, detail screen, or metric must also read the changed source, but list position is secondary evidence: a success notification, navigation alone, or a changed row somewhere in a long list does not satisfy the contract. Do not depend on programmatically scrolling a Gallery to an arbitrary record; Canvas galleries do not provide a reliable general reveal contract.
+
+## Closed-loop state transitions
+
+Every action must form one traceable loop:
+
+`reachable entry point -> enabled event -> source operation -> postcondition -> observer -> visible evidence`
+
+- Name the precondition and eligibility predicate. The control's `Visible` and `DisplayMode` formulas must permit that state.
+- Mutate the same source and field that the observer reads. A status button that patches `ReviewState` while the badge renders `Status` is broken even when both formulas compile.
+- Identify records by an immutable stable ID. Capture `ThisItem.ID` or the selected ID before mutation and look up the target from the source; do not infer identity from a display name.
+- Use the mutation result or a fresh lookup by ID for the receipt. Do not read a potentially stale gallery `ThisItem` after `Patch` and assume it contains the new value.
+- Make success contingent on the operation. Reset inputs, exit edit mode, navigate, and reveal success evidence only on the success path.
+- Bind every downstream list, filter, metric, export, and decision surface to the same updated source or refresh the external source before observing it.
+- Define a deterministic Given/When/Then scenario for the success path and each required negative or boundary path. If the generated formulas cannot satisfy that scenario by inspection, the action is incomplete.
+
+## Mutation receipt contract
+
+- Reserve a compact result card, banner, or detail region in the action screen's initial viewport. Hide it until a mutation succeeds.
+- In the mutation handler or form success event, capture the returned record, stable ID, or a deletion snapshot before resetting inputs or navigating. Bind the result surface to that captured state.
+- Define a **write set** for each mutation: every field and status value the handler creates or changes. Define a **proof set** in the Action Contract: the identity plus the write-set values that must be visible after success. For create and edit, the proof set must include every user-entered or user-selected field written by the handler; do not reduce it to fields already convenient to display in a list. For approve, reject, or another transition, include the identity and resulting status. For delete, include the removed identity and action from the captured snapshot.
+- Render every proof-set field as labeled, readable content bound to the captured state. A field is not proven by the input before submission, by an agent's remembered value, by hidden state, or by an unlabeled/truncated list cell.
+- Keep the result visible until the user dismisses it or begins another mutation. A transient `Notify()` may supplement this surface but cannot replace it.
+- Also refresh or update the shared source so lists, filters, metrics, and later screens reflect the mutation. The receipt proves the immediate outcome; it does not replace source-of-truth consistency.
+- Treat write-set/proof-set parity as a generation invariant. If the handler writes a user-supplied field that the receipt does not render, the mutation is incomplete even when persistence and navigation work.
+
+## Create and edit form lifecycle
+
+- Give every required finite-choice field a directly selectable control. For a short static set, prefer visible radio or button choices, then a dropdown that commits a value by click or tap. Do not use a searchable combobox unless the choice set is large enough to require search or the requirement allows free-form entry.
+- Populate finite-choice sources with concrete, visible values, including examples named by the request. Configure the display field correctly and give a required short-choice field a valid initial value when the business rule permits one. Use a blank required placeholder only when an explicit choice is meaningful, and keep every option selectable without typing text or relying on keyboard-only commitment.
+- Do not make an optional field block submission. For required fields, keep the submit action reachable and visibly explain what remains invalid.
+- Create records with a stable unique ID and write every displayed field to the shared source. Capture the created record or its ID before resetting the form and show the required mutation receipt with labeled bindings for every submitted visible field. The bound list must also update; sorting, selecting, highlighting, or filtering the new ID can reinforce the receipt but cannot replace it.
+- Put a visible Edit action on each manageable row or its immediately reachable detail. Selecting Edit must store the record identity, enter an obvious edit mode, and prepopulate every editable input from that record.
+- Save edits by stable ID, preserve fields the user did not change, exit edit mode, and show the required mutation receipt with the updated values. The bound list or detail must also reflect them. Cancel must leave the source unchanged and clear edit state.
+- When create and edit share a form, make mode, selected record, defaults, submit label, save formula, cancel behavior, and reset behavior explicit. Never infer edit mode from a mutable display value such as a name.
+
+## Navigation and action reachability
+
+- Put every primary destination in a repeated navigation region that is visible in the initial viewport, or behind an immediately visible menu control.
+- Keep record-level management actions on the management row/detail surface or behind a visible overflow control. Do not rely on clicking non-interactive text or cards.
+- Render each primary record's canonical human-readable identity, such as the full colleague, customer, or item name, as visible text on its row or immediately reachable detail. Avatar initials, icons, IDs, accessible labels, and agent-inferred names may supplement this text but cannot replace it.
+- On phone layouts, keep the record identity, status, and required lifecycle actions in the visible row or its immediately reachable detail. Stack the row or use a visible overflow control; never leave Edit, approve, reject, or remove in desktop columns clipped beyond the canvas width.
+- A required action below the fold needs an obvious, working scroll affordance and must not be trapped inside nested fixed-height containers.
+- Repeat the same destination set and ordering across screens so an evaluator or user does not need to rediscover navigation after each action.
+
+## Role-scoped record management and review
+
+A request for a named role to manage all records of the app's primary entity is an operational lifecycle requirement, not a request for a read-only list. It does not imply CRUD for supporting entities.
+
+- Provide a reachable management list and a visible way to select a record.
+- Provide a visible Edit action that loads the selected record by stable ID, prepopulates editable fields, saves changes to the shared source, and displays the updated values in the management list.
+- Provide remove/cancel with a visible confirmation or cancel path. After confirmation, the record must disappear or visibly enter the requested canceled state.
+- When review distinguishes final approved records, provide both approve and reject/decline decisions unless the request explicitly defines a one-way workflow.
+- Keep decision controls together on each eligible pending record, or expose one immediately visible Review entry that opens a detail surface containing both decisions. Render the resulting status from the same field they mutate. An Approve-only queue is not a complete review workflow when rejected records are a meaningful outcome, and screen density is not permission to drop one decision.
+
+## Program periods and recurrence
+
+- Represent quarterly, monthly, annual, cycle, season, or period requirements with a shared field or deterministic derivation, not only a heading.
+- Give new records the active period and show it in the relevant form, list, detail, or review surface.
+- When users need to distinguish periods, provide a visible selector or filter and bind it directly to the rendered source.
+- Use one period meaning everywhere. Do not label a date as a quarter in one screen while filtering a different field elsewhere.
+
+## Export and report output
+
+- Give every explicit export, download, print, or report request a visible action.
+- Define the eligible-record predicate and output columns exactly. For example, an approved list export must exclude pending and rejected records using the same status field shown in review.
+- Use an output mechanism supported by discovered controls, connectors, and data sources, and provide visible evidence that output was prepared or delivered.
+- If exact file export is unavailable, label and implement an explicit approximation such as a copyable report view. Do not present a notification that claims a file was exported when no output exists.
+
+## Operational setup for requested behavior
+
+A prompt can request moving, comparing, ranking, scheduling, or measuring records without explicitly saying "add a create form." When the generated app uses local/mock data and the requested behavior needs mutable records to be exercised, provide the minimum visible setup actions needed to create those records.
+
+- Add only the supporting create actions needed to exercise requested behavior; this is not permission to generate universal CRUD.
+- For relationship-based features, provide inputs for the entity name, group/team, and parent/manager relationship needed to create at least two levels.
+- New records must enter the same shared source used by the visualization, metrics, selectors, mutations, and snapshots.
+- Keep meaningful seed data so the app is useful on first load, but do not make seeded rows the only records the user can operate on.
+- After creation, show the new record in the core visualization without navigation, reload, or app restart.
+
+## Search and filtering
+
+- Bind the visible input or selector directly into the target list's `Items` formula.
+- Include every requested searchable field and combine simultaneous filters explicitly.
+- Provide a reachable clear/reset action when more than one filter can be active.
+- Show the active filter state and a zero-result state; a blank gallery is ambiguous.
+- For six or fewer static filter choices, prefer visible choice buttons or radio controls. Use a dropdown only when the current control definition exposes a pointer-committed selection contract, and keep its `Items` shape, display formula, selected-value formula, and target predicate type-compatible.
+- Verify filtering with at least two matching records and one non-matching record. Selecting one criterion must leave all matching records visible and hide the non-matching record; clearing it must restore the full eligible set.
+
+## Reordering, moving, and drag interactions
+
+- Define the source item, destination position or group, ordering field, and visible list that proves the result.
+- Update every affected row when order values must remain unique and contiguous.
+- Bind the rendered list to the ordering field with an explicit sort.
+- Preserve the changed order when navigating away and back by storing it in the shared mutable source, not screen-local initialization.
+- Use real drag and drop only when a discovered control exposes that event contract. If it does not, plan explicit Move up, Move down, Move to, or Apply reassignment controls and mark the interaction as an approximation. Never label click controls as drag handles.
+
+## Limits and validation constraints
+
+- Derive the limit from the same source and predicate used by the visible list or count.
+- Enforce the rule twice: disable or explain the unavailable action before submission, and guard the mutation event so stale UI state cannot bypass it.
+- Define both boundary paths: the last allowed operation succeeds, and the next operation is rejected without changing data.
+- Display the current count, limit, and rejection reason close to the action.
+
+## Metrics and dashboards
+
+- Derive metrics from the current shared source or a named formula, not a copied value initialized during navigation.
+- State the exact field semantics, filters, grouping, and denominator.
+- Every mutation that should affect a metric must change the source the metric reads.
+- For relationship data, calculate layer depth, direct-report counts, and group totals from the same current parent/group fields rendered by the hierarchy.
+- Show both aggregate values and the requested breakdown. A heading or empty metric card is not a metric.
+- Provide meaningful zero and empty states; never divide by zero or display a stale seeded total after records change.
+
+## Versions and comparison
+
+- A save-version action creates an immutable snapshot with a unique identifier, timestamp, and the fields needed for comparison.
+- Store version metadata separately from snapshot rows. Copy every compared entity into snapshot rows keyed by `VersionId`; do not store a reference to the live collection or derive both comparison panels from current state.
+- Saving a later version must not mutate the earlier snapshot.
+- Version selectors bind to the snapshot source and prevent comparing one version to itself.
+- The comparison view identifies both selected versions and renders two populated, labeled panels at the same time. When the requirement says side by side, do not replace this with a single panel, tabs, or vertically stacked states; choose a wide dashboard composition or an intentional horizontal comparison region.
+- Derive field-level differences by matching stable entity IDs across the two selected snapshot sets. Highlight added, removed, moved, and changed records from that derivation.
+- Do not show "no changes" unless the selected snapshots are distinct and the derived difference set is actually empty.
+- Persistence claims must match the actual source. An in-memory collection persists only during the current app session; do not describe it as durable storage.
+
+## Core visualizations
+
+- A named org chart, timeline, comparison, dashboard, board, chart, or map must render bound content. A filled rectangle, empty container, disabled input, or heading over blank space is a placeholder, not a visualization.
+- Provide meaningful first-render data or a visible, truthful empty state with a reachable setup action.
+- Relationship visualizations must expose the relationship, not only a flat list. Show parent/group labels, layer or depth, and a visible reporting/connection treatment.
+- Keep required controls outside decorative overlays and ensure empty-state surfaces do not cover populated content.
+
+## Category management
+
+- Category creation updates the same shared category source used by forms, filters, and management lists.
+- Prevent or visibly handle blank and duplicate category names.
+- A newly added category must become visible in every requested selector without requiring app restart or reseeding.
+- Deletion or rename behavior must define what happens to records that reference the affected category.
+
+## Leaderboards and ranked lists
+
+- Define the score formula, eligible population, sort direction, tie behavior, and displayed rank.
+- Sort from the current source rather than storing a separate stale leaderboard.
+- Use a deterministic secondary sort for ties.
+- Recalculate visibly after any action that changes the ranking inputs.
+
+## Completion rule
+
+If any required success path, boundary path, source-of-truth binding, or visible evidence cannot be implemented with discovered controls and data sources, mark the action blocked or an explicit approximation. Do not ship placeholder UI or claim completion.
diff --git a/plugins/canvas-apps/references/ControlGuide.md b/plugins/canvas-apps/references/ControlGuide.md
index 06e476b6e..048f031cb 100644
--- a/plugins/canvas-apps/references/ControlGuide.md
+++ b/plugins/canvas-apps/references/ControlGuide.md
@@ -121,7 +121,20 @@ child-column contract, do not create a new grid for a local collection. It can c
and still render "There are no fields in this data table." Use an explicit header row
plus a Gallery row shell and implement sorting through the Gallery `Items` formula.
-## Selection controls — `ItemDisplayText` is a per-item formula
+## Selection controls and filters — `ItemDisplayText` is a per-item formula
+
+Choose the interaction before styling the control. These rules apply equally to form
+fields, filters, sort choices, periods, statuses, and category selectors:
+
+- For a short static required set, prefer `ModernRadio` or visible choice buttons when the options fit, then a `ModernDropdown` that selects an option by click or tap.
+- Use `ModernCombobox` only for a large set that benefits from search or when free-form entry is explicitly required. Do not use it for a short required set merely because modern controls are preferred.
+- Give a required short-choice field a valid initial selection when the business rule permits one. If an explicit choice is required, show a visible placeholder and validation, but keep selection independent of typed filtering or keyboard-only commitment.
+- A populated `Items` formula is not enough. The planned control must expose readable options and commit the selected record or value through its normal pointer interaction.
+- Record the exact selected-value property returned by `describe_control` and bind it into
+ the consumer formula. Never guess `Selected.Value`, invent a child listbox, or assume
+ that opening a popup commits a value.
+- For a filter, show the active choice and provide a reachable clear/reset action. Verify
+ the consumer against at least two matching records and one non-matching record.
`ItemDisplayText` and `ItemKey` on `ModernDropdown`, `ModernCombobox` and similar controls
are evaluated once per row with `ThisItem` in scope. They take an expression, not a column
@@ -176,17 +189,18 @@ the most common single-property mistake:
`Gallery` has `Fill` but no text properties at all — style the labels inside it, not the
container.
-### Trap 3 — writing a template version on `Control:`
+### Trap 3 — deriving creation keywords from `list_controls`
-Never write `Control: [email protected]`. Use the bare name that `list_controls` returned.
+`list_controls` returns the name used to query `describe_control`; it is not the authored
+YAML contract. The `Control creation keywords` block in `describe_control` is
+authoritative. Copy its `Control:` value and any required `ComponentName`,
+`ComponentLibraryUniqueName`, `Variant`, and `Layout` keywords verbatim.
## Control template versions
-Every control type resolves to exactly one template version per app. You do not choose it
-and you do not need to: write the bare control name everywhere and the app stays
-consistent.
-
-Writing an explicit `@version` on even one control breaks that:
+Do not add, remove, or replace an `@version` suffix yourself. If compilation reports a
+template-version conflict, re-run `describe_control` and make every instance use the
+exact `Control:` value currently returned for that type:
```text
Another instance of control type 'ModernText' has already been referenced using a
@@ -204,12 +218,9 @@ not the one you wrote:
Unknown property 'Color' for control type 'Text'.
```
-Those properties are valid on `ModernText`. Nothing is wrong with them. The only defect is
-the version suffix, and removing every suffix clears the entire cascade in one compile.
-
-- ✅ `Control: ModernText`
-- ❌ `Control: [email protected]`
-- ❌ mixing `Control: Badge` in one file with `Control: [email protected]` in another
+Those properties may be valid on `ModernText`; resolve the creation-keyword mismatch
+before changing them. Do not assume the bare or versioned form is correct without
+checking `describe_control`.
## Enum type names
@@ -397,8 +408,9 @@ replace `Badge.Content`; omitting Content can render placeholder text such as `A
- **`Unknown property`:** run `describe_control` and use only the properties it returns
for that exact control type.
- **Many `Unknown property` errors naming a control type you never wrote** (e.g. `'Text'`
- when your YAML says `ModernText`): a template version conflict. Strip every `@version`
- suffix from every `Control:` value and re-compile.
+ when your YAML says `ModernText`): a template version conflict. Re-run
+ `describe_control`, copy its complete creation-keyword block to every instance of that
+ type, and re-compile.
- **A property works on one control but not a similar one:** property support is per
control type, and the modern React, FluentV9 and Classic families disagree. Check the
per-control table above rather than reasoning by analogy.
diff --git a/plugins/canvas-apps/references/CreateWorkflow.md b/plugins/canvas-apps/references/CreateWorkflow.md
index f8f4b1f0a..e40055006 100644
--- a/plugins/canvas-apps/references/CreateWorkflow.md
+++ b/plugins/canvas-apps/references/CreateWorkflow.md
@@ -16,6 +16,9 @@ Read:
Determine:
+- Requested capability families from `${PLUGIN_ROOT}/references/BehaviorGuide.md`
+- Every user action, precondition, source-of-truth transition, and visible postcondition
+- Stable IDs, mutable fields, status values, relationships, and persistence semantics
- Screen count, purpose, and navigation
- Controls and layout strategy for each screen
- Data sources, connectors, collections, or mock data
@@ -42,12 +45,19 @@ Use this format:
| Create | [Additional] | [Name].pa.yaml | [purpose] | [controls] |
### Data Strategy
-[Data sources, connectors, collections, or mock data]
+[Data sources, connectors, collections, or mock data; stable IDs; mutable fields; status values; and session versus durable persistence]
+
+### Functional Scope
+| Capability | User path | Source transition | Visible success |
+|------------|-----------|-------------------|-----------------|
+| [Requested behavior] | [Reachable entry point and action] | [Source, stable ID, and exact postcondition] | [Bound receipt plus downstream observer] |
### Aesthetic Direction
[Direction and exact RGBA palette]
```
+List every requested behavior in Functional Scope before decorative or optional screens. Do not present the plan as ready when a named action has only a control and no source transition or visible success state.
+
Wait for user approval. Revise and re-present if requested.
## 4. Invoke the Planner
diff --git a/plugins/canvas-apps/references/DesignGuide.md b/plugins/canvas-apps/references/DesignGuide.md
index 970d3649a..4828bf39a 100644
--- a/plugins/canvas-apps/references/DesignGuide.md
+++ b/plugins/canvas-apps/references/DesignGuide.md
@@ -57,8 +57,8 @@ the real user experience.
### Typography & Text Hierarchy
-- **Control Selection**: When there are multiple controls for the same purpose, and one of them is a "Classic" control, favor the modern controls:
- - Favor `ModernText` over `Label`, `ModernCombobox` over `Classic/ComboBox`, `ModernRadio` over `Classic/Radio`, `Button` or `ModernButton` over `Classic/Button`, `ModernTabList` for in-screen tabs, `ModernButton` rows for cross-screen navigation, `ModernTextInput` over `Classic/TextInput`, and so on.
+- **Control Selection**: When there are multiple controls for the same purpose, favor the modern control whose interaction matches the data:
+ - Favor `ModernText` over `Label`, `ModernRadio` or a directly selectable modern dropdown for short static choices, `ModernCombobox` over `Classic/ComboBox` only for large searchable sets, `ModernRadio` over `Classic/Radio`, `Button` or `ModernButton` over `Classic/Button`, `ModernTabList` for in-screen tabs, `ModernButton` rows for cross-screen navigation, `ModernTextInput` over `Classic/TextInput`, and so on. Never choose a searchable control merely because it is modern when a required short choice should take one click or tap.
- **Font Weight**: Use `ModernText` for headlines with `FontWeight: =FontWeight.Bold` and a large font size. Use `ModernText` with `FontWeight: =FontWeight.Normal` for body content.
- **Size Contrast**: Create dramatic hierarchy with size differences. Headers at 24-32, subheaders at 18-20, body at 14-16.
- **Alignment as Statement**: Mix `Align.Left`, `Align.Center`, `Align.Right` intentionally. Centered text for impact, left-aligned for readability.
@@ -173,4 +173,4 @@ Interpret creatively and make unexpected choices:
7. **Validate** — Use compile_canvas early, not just at the end
8. **Refine** — Polish spacing, color, sizing, and depth until the design feels intentional
-Remember: Canvas Apps can be visually striking and memorable despite platform constraints. Don't hold back. Show what can truly be created when thinking outside the box and committing fully to a distinctive vision.
\ No newline at end of file
+Remember: Canvas Apps can be visually striking and memorable despite platform constraints. Don't hold back. Show what can truly be created when thinking outside the box and committing fully to a distinctive vision.
diff --git a/plugins/canvas-apps/references/EditWorkflow.md b/plugins/canvas-apps/references/EditWorkflow.md
index 2b125a666..a740144de 100644
--- a/plugins/canvas-apps/references/EditWorkflow.md
+++ b/plugins/canvas-apps/references/EditWorkflow.md
@@ -37,6 +37,8 @@ Read:
Determine:
+- Requested capability families from `${PLUGIN_ROOT}/references/BehaviorGuide.md`
+- Every changed action's precondition, source-of-truth transition, and visible postcondition
- Screens to modify and exact changes
- Screens to create
- Existing palette, layout strategy, variables, and data bindings to preserve
@@ -61,6 +63,11 @@ Present:
### App Changes
[Exact App.pa.yaml changes, or "None"]
+### Functional Changes
+| Capability | Existing behavior | Required transition | Visible success |
+|------------|-------------------|---------------------|-----------------|
+| [Changed behavior] | [Current reachable path or gap] | [Source, stable ID, and exact postcondition] | [Bound receipt plus downstream observer] |
+
### Approach
[How the edit preserves and extends the current app]
```
diff --git a/plugins/canvas-apps/references/LayoutGuide.md b/plugins/canvas-apps/references/LayoutGuide.md
index 1c0968a2a..1ad175a3c 100644
--- a/plugins/canvas-apps/references/LayoutGuide.md
+++ b/plugins/canvas-apps/references/LayoutGuide.md
@@ -74,7 +74,7 @@ For flexible, responsive designs:
```
1. **Dynamic gallery height:**
- `Height: =Self.AllItemsCount * Self.TemplateHeight + ((Self.AllItemsCount + 1) * Self.TemplatePadding)`
+ `Height: =With({rowCount: CountRows(<same source/filter used by Items>)}, rowCount * Self.TemplateHeight + ((rowCount + 1) * Self.TemplatePadding))`
2. **Container scrolling:** `LayoutOverflowY: =LayoutOverflow.Scroll`
3. **AutoLayout child properties:** `AlignInContainer`, `FillPortions`,
`LayoutMinWidth/Height`, `LayoutMaxWidth/Height`
@@ -207,12 +207,17 @@ directly.
Small bounded lists should not create a second hidden scroll region. For a local roster
of roughly ten or fewer rows inside a scrollable root, include every row and its template
-padding in the gallery height, then let the root scroll:
+padding in the gallery height, then let the root scroll. Count the gallery's source
+expression, not `Self.AllItemsCount`: rendered-item counts depend on the gallery having a
+non-zero height and can create a zero-height cycle.
```yaml
-Height: =Self.AllItemsCount * Self.TemplateHeight + ((Self.AllItemsCount + 1) * Self.TemplatePadding)
+Height: =With({rowCount: CountRows(<same source/filter used by Items>)}, rowCount * Self.TemplateHeight + ((rowCount + 1) * Self.TemplatePadding))
```
+Use that same source count for empty-state visibility. Do not derive either property from
+`Self.AllItems`, `Self.AllItemsCount`, or another rendered gallery property.
+
## Give labelled controls room for their longest value
A `Badge`, status pill, or KPI value sized for `"New"` clips `"Implemented"`. When such a
diff --git a/plugins/canvas-apps/references/PlanTemplates.md b/plugins/canvas-apps/references/PlanTemplates.md
index 00972f2a4..ae368892d 100644
--- a/plugins/canvas-apps/references/PlanTemplates.md
+++ b/plugins/canvas-apps/references/PlanTemplates.md
@@ -30,6 +30,34 @@ CREATE
|-------------|--------------------|----------|
| [Concrete noun or interaction from the request] | [Visible control and exact behavior] | Exact / Approximation: [reason] |
+## Action Contracts
+| Requested action | Preconditions | Entry point | Owner screen | Control and event | Source and stable ID | Transition and postcondition | Mutation write set | Receipt proof set | Observer and evidence |
+|------------------|---------------|-------------|--------------|-------------------|----------------------|------------------------------|--------------------|-------------------|-----------------------|
+| [Concrete requested action] | [Eligible state and enabled/visible rule] | [Visible control the user starts from] | [Screen] | [PrefixedControl.OnSelect / OnChange] | [Named source and immutable identity, or N/A] | [Exact operation and resulting source state] | [Every changed field/status, or N/A] | [Identity plus every value rendered after success, or N/A] | [Formula/control reading the post-state plus in-viewport evidence] |
+
+[Include only actions stated by the request or approved plan and apply the relevant
+acceptance paths from `${PLUGIN_ROOT}/references/BehaviorGuide.md`. Do not infer universal CRUD for
+supporting entities. Role-scoped management of all primary records requires separate
+list/select, edit/save, and remove/cancel rows. Keep other requested actions separate,
+including paired approve and reject decisions. Add supporting setup only when required to
+exercise requested behavior over local/mock data. For create/edit, include inputs, finite
+choices, defaults, stable identity, prepopulation, cancel behavior, and a deterministic
+post-save mutation receipt bound to the changed ID. For every mutation, enumerate the write
+set and proof set. A create/edit proof set must contain every user-entered or user-selected
+field in the write set. Name the receipt control, visibility state, and labeled binding for
+each proof-set field. Do not use navigation, a notification, or a row somewhere in a longer
+list as the Observable result.]
+
+## Functional Test Matrix
+| Scenario | Given | When | Then | Evidence surface | Boundary or negative case |
+|----------|-------|------|------|------------------|---------------------------|
+| [Action-path identifier] | [Deterministic seed and eligible state] | [Exact visible control interaction] | [Exact source postcondition] | [Observer formula/control and receipt fields] | [Blocked, empty, invalid, clear, or failure behavior, or N/A] |
+
+[Include at least one success scenario for every Action Contract and one row for every
+required boundary or negative path. Use concrete seeded IDs and values when the app uses
+local/mock data. Every Then clause must be provable from the named source through the
+Evidence surface; do not use appearance, navigation, or notification as proof.]
+
## Working Directory
[absolute working directory]
@@ -64,6 +92,24 @@ EDIT
|-------------|--------------------|----------|
| [Concrete noun or interaction from the request] | [Visible control and exact behavior] | Exact / Approximation: [reason] |
+## Action Contracts
+| Requested action | Preconditions | Entry point | Owner screen | Control and event | Source and stable ID | Transition and postcondition | Mutation write set | Receipt proof set | Observer and evidence |
+|------------------|---------------|-------------|--------------|-------------------|----------------------|------------------------------|--------------------|-------------------|-----------------------|
+| [Concrete requested action] | [Eligible state and enabled/visible rule] | [Visible control the user starts from] | [Screen] | [PrefixedControl.OnSelect / OnChange] | [Named source and immutable identity, or N/A] | [Exact operation and resulting source state] | [Every changed field/status, or N/A] | [Identity plus every value rendered after success, or N/A] | [Formula/control reading the post-state plus in-viewport evidence] |
+
+[Include only actions stated by the request or approved plan. Preserve unaffected existing
+actions, and do not expand the edit into universal CRUD. Preserve the semantic contracts
+for role-scoped primary-record management, paired review decisions, requested periods or
+cycles, and requested export/report output.]
+
+## Functional Test Matrix
+| Scenario | Given | When | Then | Evidence surface | Boundary or negative case |
+|----------|-------|------|------|------------------|---------------------------|
+| [Changed or regression path] | [Current or seeded state] | [Exact visible interaction] | [Exact preserved or changed postcondition] | [Observer/control reading the source] | [Required failure/boundary behavior, or N/A] |
+
+[Cover every changed Action Contract and every existing action whose source, fields,
+controls, or observer are touched by this edit. This is the regression contract.]
+
## Working Directory
[absolute working directory]
@@ -102,6 +148,13 @@ seed data — or "None"]
- Text secondary: RGBA([...])
- Typography: [scale and weights]
+## Visual Contract
+- Type roles: [exact title, section-heading, body, caption sizes and weights]
+- Spacing scale: [approved gap and padding values]
+- Surfaces: [page, panel, card, border, and shadow treatment]
+- Actions: [exact primary, secondary, destructive, and disabled treatment]
+- Density: [desktop, tablet, and phone composition rules]
+
## Layout Strategy
[Shared layout rules and target-device rationale. Record the breakpoint formulas and the
rule that responsive properties derive from current width rather than `OnVisible`
@@ -143,7 +196,23 @@ for cross-screen navigation; reserve ModernTabList for panels within one screen.
- Purpose: [description]
- Layout: [root and child structure. For each fixed-height section and horizontal row
with four or more substantive children, include a desktop/narrow/phone budget with
- child grouping, minimum widths/heights, gaps, padding and resulting section size.]
+ child grouping, minimum widths/heights, gaps, padding and resulting section size.
+ Prove all visible children remain inside their parent and do not overlap at each target
+ width. The sole responsive root must use exact `Width: =Parent.Width`,
+ `Height: =Parent.Height`, `LayoutMinWidth: =0`, and `LayoutMinHeight: =0`; breakpoint
+ sizing belongs only on descendants. For record rows, name the canonical human-readable
+ identity field and text binding that renders its full value, then define how that text,
+ status, and required lifecycle actions remain visible or immediately reachable on phone.
+ Avatar initials do not satisfy identity. When review requires both Approve and
+ Reject/Decline, keep both decisions on the same eligible row or same immediately reachable
+ detail; do not drop one to fit the layout.]
+- Text fit: [single-line or wrapping behavior and longest-value width/height budget for
+ each text-bearing control]
+- Visual hierarchy: [title, section, body, caption, primary action, and focal content
+ roles copied from the shared Visual Contract]
+- Core visualization: [bound source, meaningful first-render records, relationship or
+ comparison encoding, populated controls, and truthful empty state; omit only when this
+ screen owns no core visualization]
- Grid contract: [for each GridLayout, exact columns, rows, column minimum, row minimum,
height and child-position formulas; omit when there is no GridLayout]
- Controls: [prefixed control names and purpose]
@@ -158,6 +227,28 @@ for cross-screen navigation; reserve ModernTabList for panels within one screen.
- Navigation: [targets and triggers]
- State: [OnVisible initialization]
+## Required Actions
+| Action | Preconditions | Entry point and event | Source and stable ID | Transition and postcondition | Mutation write set | Receipt proof set | Observer and evidence |
+|--------|---------------|-----------------------|----------------------|------------------------------|--------------------|-------------------|-----------------------|
+| [Action copied from the plan index] | [Eligible state] | [Visible entry and PrefixedControl.OnSelect / OnChange] | [Named source and immutable identity, or N/A] | [Exact formula operation and resulting state] | [Every changed field/status, or N/A] | [Identity plus every labeled bound value, or N/A] | [Formula/control reading the source plus visible result] |
+
+[Copy every Action Contract owned by this screen. Include the exact input, binding, event,
+source operation, and immediate visible evidence needed to implement each row. For
+create/edit, include finite-choice values and defaults, stable identity, prepopulation,
+save-by-ID, reset, cancel behavior, and the in-viewport mutation receipt's control,
+visibility state, and labeled binding for every proof-set field. Preserve write-set/proof-set
+parity from the Action Contract. Expand every success, boundary, rejection, persistence,
+and recalculation path assigned by the plan. Keep paired review decisions as separate rows
+but require both controls on the same eligible record surface.]
+
+## Functional Test Scenarios
+| Scenario | Given | When | Then | Evidence surface | Boundary or negative case |
+|----------|-------|------|------|------------------|---------------------------|
+| [Scenario copied from the plan index] | [Concrete state] | [Exact local interaction] | [Source postcondition] | [Local or downstream observer and receipt] | [Required boundary behavior, or N/A] |
+
+[Copy every Functional Test Matrix row exercised by this screen. The builder must be able
+to trace each row through concrete formulas without reading another brief.]
+
## Relevant Data Source Schemas
[Only the fields this screen reads or writes; omit if none]
@@ -196,6 +287,14 @@ then fails to compile.]
## Changes
1. [Exact required change]
+## Layout and Visual Impact
+- Responsive bounds: [desktop, tablet, and phone width/height budgets for changed regions]
+- Text fit: [longest-value budget for changed text-bearing controls]
+- Visual contract: [shared type, spacing, surface, and action roles that changed controls
+ must preserve]
+- Record presentation: [canonical identity field and full visible text binding; placement
+ of paired review decisions on each eligible record, or N/A]
+
## Controls to Add
[Name, type, placement, properties; or "None"]
@@ -205,6 +304,27 @@ then fails to compile.]
## Properties to Update
[Control -> property -> exact value; or "None"]
+## Required Actions
+| Action | Preconditions | Entry point and event | Source and stable ID | Transition and postcondition | Mutation write set | Receipt proof set | Observer and evidence |
+|--------|---------------|-----------------------|----------------------|------------------------------|--------------------|-------------------|-----------------------|
+| [Action copied from the plan index] | [Eligible state] | [Visible entry and Control.OnSelect / OnChange] | [Named source and immutable identity, or N/A] | [Exact formula operation and resulting state] | [Every changed field/status, or N/A] | [Identity plus every labeled bound value, or N/A] | [Formula/control reading the source plus visible result] |
+
+[Copy every affected Action Contract and preserve unaffected behavior. Include the target
+source and deterministic visible result bound to the changed stable ID for mutations. Copy
+the exact mutation write set and receipt proof set from the Action Contract. For create/edit
+changes, define finite-choice values and defaults, stable identity, visible Edit entry,
+prepopulation, save-by-ID, reset, cancel behavior, and the exact reveal receipt. Name its
+control, visibility state, and one labeled binding per proof-set field. Keep changed
+success, boundary, rejection, persistence, and recalculation paths separate.]
+
+## Functional Test Scenarios
+| Scenario | Given | When | Then | Evidence surface | Boundary or negative case |
+|----------|-------|------|------|------------------|---------------------------|
+| [Changed or regression scenario copied from the plan index] | [Concrete state] | [Exact local interaction] | [Source postcondition] | [Observer/control reading the source] | [Required boundary behavior, or N/A] |
+
+[Copy every affected scenario, including preservation checks for behavior sharing a
+changed source, field, control, or observer.]
+
## Relevant Data Source Schemas
[Only the fields this edit reads or writes; omit if none]
diff --git a/plugins/canvas-apps/references/PowerFxGuide.md b/plugins/canvas-apps/references/PowerFxGuide.md
index 770a34ffe..d1acfdcd5 100644
--- a/plugins/canvas-apps/references/PowerFxGuide.md
+++ b/plugins/canvas-apps/references/PowerFxGuide.md
@@ -101,7 +101,7 @@ OnSelect: |-
Set(currentPlayer, If(currentPlayer = "X", "O", "X"))
```
-### Confirm data changes and derive validation from current values
+### Close every data mutation loop
An action that changes data must say so, and must leave the form in a clean state. Two
defects show up constantly in generated apps: a quantity silently changes with no
@@ -110,13 +110,28 @@ about was successfully saved.
```yaml
OnSelect: |-
- =Patch(colInventory, ThisItem, {Quantity: ThisItem.Quantity - varAdjustBy});
- Notify("Issued " & varAdjustBy & " units", NotificationType.Success);
- Set(varAdjustBy, 0)
+ =With(
+ {
+ targetId: ThisItem.ID,
+ nextQuantity: ThisItem.Quantity - varAdjustBy
+ },
+ Set(
+ varLastInventoryMutation,
+ Patch(
+ colInventory,
+ LookUp(colInventory, ID = targetId),
+ {Quantity: nextQuantity}
+ )
+ );
+ Set(varInventoryReceiptVisible, true);
+ Set(varAdjustBy, 0)
+ )
```
-- Use `Notify(...)` or a transient in-screen message after every create, update, or delete.
-- Reset inputs after a successful action.
+- Capture the returned record, changed stable ID, or deletion snapshot before resetting inputs or navigating. Bind an in-screen receipt to that captured value.
+- Use `Notify(...)` only as supplemental feedback. It does not prove persistence or the resulting values.
+- Reset inputs only after the successful source operation and captured receipt state.
+- Read the target record from the source by immutable ID. Do not patch by display name and do not inspect a stale `ThisItem` after mutation.
- Derive validation text and submit availability directly from the current input values:
```yaml
@@ -132,6 +147,106 @@ OnSelect: |-
maintain separate validity flags or clear them from every input's `OnChange`; correcting
the input must make the formula false declaratively.
+### Canonical local-collection mutation patterns
+
+Create and capture the record before resetting inputs:
+
+```yaml
+OnSelect: |-
+ =If(
+ !IsBlank(Trim(txtName.Value)),
+ Set(
+ varLastRecord,
+ Patch(
+ colRecords,
+ Defaults(colRecords),
+ {
+ ID: GUID(),
+ Name: Trim(txtName.Value),
+ Category: varSelectedCategory,
+ Status: "Pending"
+ }
+ )
+ );
+ Set(varLastAction, "Created");
+ Set(varReceiptVisible, true);
+ Reset(txtName)
+ )
+```
+
+Edit the selected stable ID and preserve fields not present in the change record:
+
+```yaml
+OnSelect: |-
+ =Set(
+ varLastRecord,
+ Patch(
+ colRecords,
+ LookUp(colRecords, ID = varEditRecordId),
+ {
+ Name: Trim(txtName.Value),
+ Category: varSelectedCategory
+ }
+ )
+ );
+ Set(varLastAction, "Updated");
+ Set(varReceiptVisible, true);
+ Set(varEditMode, false)
+```
+
+Apply an eligible status transition and capture the resulting record:
+
+```yaml
+OnSelect: |-
+ =With(
+ {targetId: ThisItem.ID},
+ If(
+ LookUp(colRecords, ID = targetId).Status = "Pending",
+ Set(
+ varLastRecord,
+ Patch(
+ colRecords,
+ LookUp(colRecords, ID = targetId),
+ {Status: "Approved"}
+ )
+ );
+ Set(varLastAction, "Approved");
+ Set(varReceiptVisible, true)
+ )
+ )
+```
+
+Capture a deletion snapshot before removing the source row:
+
+```yaml
+OnSelect: |-
+ =With(
+ {targetId: ThisItem.ID},
+ Set(varDeletedRecord, LookUp(colRecords, ID = targetId));
+ RemoveIf(colRecords, ID = targetId);
+ Set(varLastAction, "Deleted");
+ Set(varDeleteReceiptVisible, true)
+ )
+```
+
+The receipt renders the captured identity, action, and proof-set values. The list, badge, filter, metric, or leaderboard separately reads `colRecords`, so the immediate proof and downstream state agree.
+
+### Selector and filter bindings
+
+Treat a selector as four coupled formulas: option source, visible option text, committed selected value, and consumer predicate. Use the exact selected-value property returned by `describe_control`; do not guess it.
+
+For six or fewer static choices, prefer visible choice buttons or radio controls. They avoid an inaccessible or uncommitted dropdown state and make the active filter visible. A category filter can set `varCategoryFilter` directly, while the gallery reads:
+
+```yaml
+Items: |-
+ =Filter(
+ colRecords,
+ varCategoryFilter = "All" || Category = varCategoryFilter
+ )
+```
+
+The clear action restores `"All"`. Seed or create at least two matching records and one non-matching record so the planned Given/When/Then scenario can prove inclusion, exclusion, and reset.
+
### Toggle once, report the same next value
Do not mutate a record and then inspect that same `ThisItem` to infer what happened.
diff --git a/plugins/canvas-apps/references/QAChecks.md b/plugins/canvas-apps/references/QAChecks.md
index af5586151..baa9509d0 100644
--- a/plugins/canvas-apps/references/QAChecks.md
+++ b/plugins/canvas-apps/references/QAChecks.md
@@ -16,7 +16,7 @@ are not part of the identifier.
**Run first — these invalidate the whole file or the whole compile:**
-- Check 1 — `QACHK-CONTROL-VERSION-SUFFIX` — `@version` suffix on a `Control:` value
+- Check 1 — `QACHK-CONTROL-CREATION-KEYWORDS` — creation keywords differ from `describe_control`
- Check 2 — `QACHK-MISSING-FORMULA-PREFIX` — property value without the `=` prefix
- Check 3 — `QACHK-DUPLICATE-PROPERTY-KEY` — same property key twice in one
`Properties:` block
@@ -59,6 +59,16 @@ are not part of the identifier.
- Check 31 — `QACHK-SEMANTIC-VALUE-BINDING` — semantic display control missing its visible
value binding
- Check 32 — `QACHK-ACTION-LABEL-FIT` — multiword action label does not fit its control
+- Check 33 — `QACHK-ACTION-CONTRACT` — required action or navigation is missing,
+ unreachable, or not wired
+- Check 34 — `QACHK-MUTATION-OUTCOME` — data changes without a visible post-action result
+- Check 35 — `QACHK-BEHAVIOR-ACCEPTANCE` — advanced behavior omits a required acceptance path
+- Check 36 — `QACHK-HORIZONTAL-BUDGET` — row content exceeds its available width
+- Check 37 — `QACHK-MANUAL-BOUNDS` — visible ManualLayout controls overlap or leave the parent
+- Check 38 — `QACHK-TEXT-CONTENT-FIT` — text control cannot fit its longest visible value
+- Check 39 — `QACHK-VISUAL-CONTRACT` — screen styling diverges from the shared visual system
+- Check 40 — `QACHK-EXCESS-WHITESPACE` — layout sizing creates unintended empty regions
+- Check 41 — `QACHK-CORE-VISUALIZATION` — core visualization is blank, static, or incomplete
Agents that write `.pa.yaml` files MUST run these checks against their own
output before returning, and fix every issue inline. Report the outcome of
@@ -88,7 +98,8 @@ QA: 1 PASS · 2 PASS · 3 PASS · 4 FIXED(7) · 5 PASS · 6 FIXED(2) · 7 FIXED(
8 PASS · 9 PASS · 10 PASS · 11 PASS · 12 PASS · 13 PASS · 14 PASS · 15 PASS ·
16 PASS · 17 PASS · 18 FIXED(4) · 19 PASS · 20 PASS · 21 PASS · 22 FIXED(3) ·
23 FIXED(4) · 24 PASS · 25 N/A · 26 N/A · 27 PASS · 28 N/A · 29 PASS ·
- 30 N/A · 31 PASS · 32 PASS
+ 30 N/A · 31 PASS · 32 PASS · 33 PASS · 34 PASS · 35 PASS · 36 PASS ·
+ 37 N/A · 38 PASS · 39 PASS · 40 PASS · 41 PASS
```
- `PASS` — you inspected every control the check applies to and found nothing.
@@ -107,17 +118,29 @@ QA: 1 PASS · 2 PASS · 3 PASS · 4 FIXED(7) · 5 PASS · 6 FIXED(2) · 7 FIXED(
surface.
- `QACHK-ROOT-CONTAINMENT` is `N/A` only when the brief explicitly requires fixed
ManualLayout with deliberate screen-level overlays.
+- `QACHK-BEHAVIOR-ACCEPTANCE` is `N/A` when the screen owns no advanced behavior named
+ by Check 35.
+- `QACHK-HORIZONTAL-BUDGET` is `N/A` when the changed scope has no horizontal AutoLayout
+ container.
+- `QACHK-MANUAL-BOUNDS` is `N/A` when the changed scope has no ManualLayout container.
+- `QACHK-TEXT-CONTENT-FIT` is `N/A` only when the changed scope has no visible text.
+- `QACHK-VISUAL-CONTRACT` applies to every created screen and every visually changed
+ region.
+- `QACHK-EXCESS-WHITESPACE` is `N/A` for a Modify action that changes no layout sizing,
+ spacing, or visibility.
+- `QACHK-CORE-VISUALIZATION` is `N/A` only when the screen brief names no hierarchy,
+ chart, comparison, board, timeline, map, or other core visualization.
`PASS` is valid when every applicable control was inspected and no defect was found.
Never infer that a check was skipped solely from the number of controls on the screen.
---
-## Check 1 — `QACHK-CONTROL-VERSION-SUFFIX` (`Control:` value contains `@version`)
+## Check 1 — `QACHK-CONTROL-CREATION-KEYWORDS` (creation keywords differ from `describe_control`)
-**Problem:** Every control type resolves to exactly one template version per app. A single
-`Control: [email protected]` anywhere in the app pins every `ModernText` instance to one
-version and reports every property belonging to the other version as unknown:
+**Problem:** `list_controls` provides discovery names, not authoritative authored YAML.
+Guessing or normalizing `Control:`, `ComponentName`, `ComponentLibraryUniqueName`,
+`Variant`, or `Layout` can select the wrong template or omit a required keyword:
```text
Another instance of control type 'ModernText' has already been referenced using a
@@ -126,17 +149,19 @@ Unknown property 'Color' for control type 'Text'.
Unknown property 'FontWeight' for control type 'Text'.
```
-Those properties are valid. Nothing is wrong with them. One stray suffix can produce
-hundreds of phantom diagnostics, and they name an internal control type (`'Text'`) that
-appears nowhere in the YAML — so they are extremely hard to diagnose after the fact. This
-check is cheap; run it first.
+The properties may be valid; fix the creation contract before changing them.
-**Detect:** For every `Control:` property, flag any value that contains an `@` character
-(e.g. `Control: [email protected]`).
+**Detect:** For every control type, compare its creation keywords with the `Control
+creation keywords` block returned by `describe_control`. Flag changed `Control:` values
+and missing, added, or altered companion keywords.
-**Fix:** Strip the `@…` suffix, keeping only the bare control name (`Control: Text`).
+**Fix:** Copy the complete creation-keyword block from `describe_control` verbatim to
+every instance of that type. Do not independently add or strip an `@version` suffix.
-**Exception:** None. Always use the bare name that `list_controls` returned.
+**Exception:** None. `describe_control` is authoritative.
+
+Run this check against composed whole-screen text before its first save as well as against
+the persisted file. A rejected first write leaves no target file for normal self-QA.
---
@@ -968,23 +993,29 @@ action is not duplicate UI.
---
-## Check 27 — `QACHK-ROOT-CONTAINMENT` (responsive screen content outside its root container)
+## Check 27 — `QACHK-ROOT-CONTAINMENT` (responsive root malformed or content outside it)
-**Problem:** A responsive screen can compile with a correctly configured root AutoLayout
-container while the actual header, sections and galleries are mis-indented as sibling
-entries in the screen's top-level `Children:` list. The root is then empty. Those siblings
-use screen-level positioning instead of AutoLayout, overlap one another, intercept pointer
-events and leave large blank areas. Every property on the individual controls can be
-valid, so no compile diagnostic reports the failure.
+**Problem:** A responsive screen can compile with a root AutoLayout that was accidentally
+given a button, panel, or breakpoint width, producing a narrow strip of clipped content.
+It can also compile while the actual header, sections and galleries are mis-indented as
+sibling entries in the screen's top-level `Children:` list. Those siblings use
+screen-level positioning instead of AutoLayout, overlap one another, intercept pointer
+events and leave large blank areas. No compile diagnostic reports either failure.
**Detect:** When the screen brief names a responsive root container, inspect the
-`Children:` list directly under the screen key. It must contain exactly that root
-container. Then confirm every visible section named in the brief is nested under the
-root's `Children:` list. A root followed by another screen-level `- [Prefix]Header`,
-`- [Prefix]Panel`, gallery or stage is a failure, not a second layout region.
+`Children:` list directly under the screen key:
+
+1. It must contain exactly that root container.
+2. The root must set exact `Width: =Parent.Width`, `Height: =Parent.Height`,
+ `LayoutMinWidth: =0`, and `LayoutMinHeight: =0`. Flag fixed values, breakpoint
+ branches, or any other formulas for those four properties.
+3. Every visible section named in the brief must be nested under the root's `Children:`
+ list. A root followed by another screen-level `- [Prefix]Header`, `- [Prefix]Panel`,
+ gallery or stage is a failure, not a second layout region.
-**Fix:** Move every screen-level sibling under the root container's `Children:` key,
-preserving their order and existing properties:
+**Fix:** Restore the root's exact full-screen sizing and move every screen-level sibling
+under the root container's `Children:` key, preserving their order and existing
+properties:
```yaml
Screens:
@@ -996,6 +1027,8 @@ Screens:
Properties:
Width: =Parent.Width
Height: =Parent.Height
+ LayoutMinWidth: =0
+ LayoutMinHeight: =0
LayoutDirection: =LayoutDirection.Vertical
Children:
- AppHeader:
@@ -1101,22 +1134,27 @@ four of six people and have no cue that more exist.
**Detect:** For every Gallery inside a root scroll container:
1. If its Items source is a bounded local collection with roughly ten or fewer rows,
- compare `Height` with
- `AllItemsCount * TemplateHeight + ((AllItemsCount + 1) * TemplatePadding)`.
+ compare `Height` with the count of the same source/filter used by `Items`, multiplied
+ by `TemplateHeight` with template padding included.
2. Flag it when the fixed height is smaller than the full list, regardless of
`ShowScrollbar`.
3. Flag a list that can open at a non-zero internal scroll position without an explicit
reset-to-top behavior.
+4. Flag `Height` or empty-state `Visible` formulas that read `Self.AllItems`,
+ `Self.AllItemsCount`, or the gallery's rendered `AllItemsCount`. Those values depend
+ on materialized rows; when height begins at zero, the formula can keep the gallery at
+ zero height even though its `Items` source contains records.
**Fix:** Let small bounded lists grow and rely on the root scroll:
```yaml
-Height: =Self.AllItemsCount * Self.TemplateHeight + ((Self.AllItemsCount + 1) * Self.TemplatePadding)
+Height: =With({rowCount: CountRows(<same source/filter used by Items>)}, rowCount * Self.TemplateHeight + ((rowCount + 1) * Self.TemplatePadding))
ShowScrollbar: =false
```
-For genuinely large or unbounded data, keep the internal scroll region but provide a
-visible affordance and reset it to the first row on screen entry.
+Drive the empty-state control from that same source/filter count. For genuinely large or
+unbounded data, keep the internal scroll region but provide a visible affordance and reset
+it to the first row on screen entry.
**Exception:** Large/unbounded datasets where virtualization and internal scrolling are
intentional and visibly discoverable.
@@ -1184,3 +1222,283 @@ For four-item phone navigation, allocate equal widths that fit the parent withou
wrapping; shorten labels or use icons when the full labels cannot fit.
**Exception:** A deliberately compact icon-only action whose visible text is omitted.
+
+---
+
+## Check 33 — `QACHK-ACTION-CONTRACT` (required action is missing, unreachable, or not wired)
+
+**Problem:** A screen can display the expected entity while omitting or failing to wire a
+required action.
+
+**Detect:** For every row in the screen brief's `## Required Actions` table:
+
+1. Find the named entry point and action control.
+2. Confirm it is visible, non-zero-sized, enabled, outside read-only ancestors, and
+ reachable from the normal screen state. Trace any visibility variable to a reachable
+ control that sets it.
+3. Confirm actions below the fold have a working scroll path and record actions use an
+ interactive control.
+4. Inspect the named event for the required navigation, mutation, state transition, or
+ search/filter binding.
+5. For search and filter, confirm the input participates in the target list's `Items`
+ formula over the fields named by the brief.
+6. For role-scoped primary-record management, require a visible Edit entry point; review
+ or status controls are not an edit path.
+7. For every primary-record row or immediately reachable detail, find a visible text
+ binding to the canonical human-readable identity field. Avatar initials, icons, IDs,
+ accessible labels, tooltips, and agent-inferred values do not pass.
+8. When the Required Actions include both Approve and Reject/Decline, confirm every
+ eligible pending record exposes both decisions on the same row or in the same
+ immediately reachable detail. A lone Approve or Reject control fails even when the
+ other action exists elsewhere on the screen.
+9. Evaluate the phone branch. Required record actions must remain visible in the row or
+ behind an immediately visible overflow/detail entry, not in clipped desktop columns.
+10. Trace the contract as one loop: precondition/eligibility -> entry point -> event ->
+ named source and stable ID -> postcondition -> observer -> visible evidence. Confirm
+ `Visible` and `DisplayMode` permit the Given state and every name in the trace exists.
+
+**Fix:** Surface the full canonical identity text and every planned entry control, and
+implement each required event behavior. Stack paired decisions or move both into the same
+immediately reachable detail rather than dropping one.
+
+**Exception:** None for a Required Actions row. If the brief cannot be implemented with
+the discovered controls or data source, return `Status: Blocked` rather than shipping a
+placeholder.
+
+---
+
+## Check 34 — `QACHK-MUTATION-OUTCOME` (data changes without a visible post-action result)
+
+**Problem:** A create, edit, delete, or state-transition formula can run successfully while
+the app continues to show stale or incomplete data. A success notification alone does not
+prove that the requested outcome occurred.
+
+**Detect:** For every Required Actions row whose handler uses `Patch`, `SubmitForm`,
+`Collect`, `Remove`, `RemoveIf`, `UpdateIf`, or a connector mutation:
+
+1. Confirm the handler captures or preserves the returned record, changed stable ID
+ (`Patch` result, `Form.LastSubmit`, selected ID, or equivalent), or deletion snapshot
+ before resetting inputs or navigating.
+2. Confirm the new or edited record appears, the deleted record disappears, or the
+ transitioned record appears in the requested status, filter, or dashboard.
+3. Find an in-viewport mutation receipt whose visibility is set by the successful handler
+ and whose displayed identity, action, and verification fields bind to the captured state.
+ It must remain visible until dismissal or the next mutation.
+4. Compare the Required Action's mutation write set with its receipt proof set and the
+ handler formula. Every field or status changed by the formula must appear in the declared
+ write set. For create/edit, every user-entered or user-selected write-set field must also
+ appear in the proof set.
+5. Inspect the receipt controls and confirm each proof-set field has a readable label and a
+ visible binding to the captured state. Input values before submission, hidden variables,
+ agent memory, unlabeled or truncated text, and fields available only in a scrolled list
+ do not count. `Notify()` and navigation do not pass.
+6. For edit, require stable-ID selection and update, complete prepopulation, preservation
+ of unchanged fields, and non-mutating Cancel behavior.
+7. For a shared create/edit form, require intentional state reset after create and save.
+8. Confirm the observer formula reads the same source, stable ID, and changed fields used
+ by the handler. A receipt copied from input controls, a parallel collection, a stale
+ `ThisItem`, or a badge bound to a different status field fails.
+9. Mentally substitute the Functional Test Scenario's concrete Given values into the
+ handler. Confirm its Then postcondition and every proof-set value follow from the
+ formula without assuming runtime state not established by the app.
+
+**Fix:** Preserve the affected record state, update or refresh the visible binding, and add
+the required in-viewport mutation receipt with write-set/proof-set parity and one labeled
+binding per proof-set field. `Notify()` alone is not an observable outcome.
+
+**Exception:** None for a mutation named in `## Required Actions`.
+
+---
+
+## Check 35 — `QACHK-BEHAVIOR-ACCEPTANCE` (advanced behavior omits an acceptance path)
+
+**Problem:** Advanced behavior can look complete while omitting a boundary, persistence,
+recalculation, or rejection path required by its Action Contract.
+
+**Detect:** Apply this check to every Required Actions row for search/filtering, moving or
+reordering, limits, metrics, versions, category management, ranking, role-scoped record
+management, review decisions, program periods, or export/report output:
+
+1. Apply the relevant acceptance criteria from `${PLUGIN_ROOT}/references/BehaviorGuide.md`.
+2. Match every path named by the brief to a reachable event or binding that reads and
+ writes the named source of truth.
+3. Confirm visible evidence reads that source rather than seeded or copied state.
+4. For short finite choices, require concrete visible options in radio buttons, visible
+ choice buttons, or a dropdown that commits by click or tap. Reject a searchable
+ combobox, typed filtering, or keyboard-only commitment unless search or free-form input
+ is required. Give required short choices valid defaults when the business rule permits.
+5. Mentally execute create → bound list → Edit → prepopulate → change two fields including
+ one finite choice → stable-ID save → verify both values. Flag any broken link.
+6. Execute every row in the brief's `## Functional Test Scenarios` symbolically. For each
+ Given/When/Then path, identify the exact eligibility formula, event formula, source
+ operation, observer formula, and evidence control. Any missing or contradictory link
+ fails even if the controls exist.
+7. For a filter scenario, confirm pointer selection commits a value consumed by the target
+ `Items` formula, keeps all matching seeded records, excludes the non-matching record,
+ visibly identifies the active choice, and clear/reset restores the eligible source.
+
+**Fix:** Implement the missing path from the brief and bind its evidence to the shared
+source of truth. Do not replace a missing behavior with explanatory text.
+
+**Exception:** None for a path named in `## Required Actions`. Return `Status: Blocked`
+when the discovered controls or source cannot implement it.
+
+---
+
+## Check 36 — `QACHK-HORIZONTAL-BUDGET` (row content exceeds its available width)
+
+**Problem:** A row can have a breakpoint and still overflow. Child minimum widths, gaps,
+and padding may total more than the parent, clipping right-side controls or forcing them
+off-canvas.
+
+**Detect:** For every horizontal AutoLayout container at each desktop, tablet, and phone
+branch:
+
+1. Add the minimum or fixed widths of all visible children.
+2. Add `LayoutGap` for every gap and left/right padding.
+3. Compare the total with the parent width available in that branch.
+4. If flexible children use `FillPortions`, confirm their `LayoutMinWidth` values still
+ fit before remaining width is distributed.
+5. If the total does not fit, require a wrap or vertical-stack branch and repeat the
+ calculation for each resulting row.
+6. For a record row, confirm its phone branch keeps identity, status, and required
+ lifecycle actions visible or uses an immediately visible overflow/detail entry.
+
+**Fix:** Stack or wrap the row, reduce justified minimum widths, group related fields, or
+move secondary actions to another reachable region. Keep required lifecycle actions in the
+visible phone composition. Do not shrink interactive controls below 44px or hide required
+actions.
+
+**Exception:** A deliberately horizontally scrolling region with an obvious visible
+scroll affordance and a brief that explicitly requires it.
+
+---
+
+## Check 37 — `QACHK-MANUAL-BOUNDS` (visible ManualLayout controls overlap or leave the parent)
+
+**Problem:** Absolute `X`, `Y`, `Width`, and `Height` formulas can place controls on top of
+one another or outside the parent at narrower widths. The compiler accepts both.
+
+**Detect:** For every pair of simultaneously visible children in a ManualLayout container,
+evaluate their rectangular bounds at each supported width branch. Flag:
+
+- rectangles with intersecting interiors unless the brief explicitly defines the pair as
+ an overlay;
+- `X < 0`, `Y < 0`, `X + Width > Parent.Width`, or
+ `Y + Height > Parent.Height`;
+- an overlay that covers a required interactive control or intercepts its input.
+
+**Fix:** Move the composition into AutoLayout, add breakpoint-specific bounds, or resize
+and reposition the controls so their rectangles fit without intersection.
+
+**Exception:** Intentional overlays such as badges, modal scrims, or decorative layers
+that are named in the screen brief and do not block required controls.
+
+---
+
+## Check 38 — `QACHK-TEXT-CONTENT-FIT` (text control cannot fit its longest visible value)
+
+**Problem:** Correct text can be clipped, truncated, or reduced to one unreadable line
+because its width or height was sized for a shorter seed value.
+
+**Detect:** For every visible text-bearing control:
+
+1. Identify the longest literal, status, field value, or composed caption specified by
+ the brief.
+2. For single-line text, require enough width and `Wrap: =false`.
+3. For wrapping text, require `AutoHeight: =true` or a height budget covering all lines,
+ vertical padding, and line spacing.
+4. A fixed-height text control must be at least `Size * 1.5` plus vertical padding for
+ each planned line.
+5. Confirm the containing row, card, gallery template, or section is tall enough for the
+ resulting control; `AutoHeight` does not grow a fixed parent.
+
+**Fix:** Allocate responsive width, enable wrapping with sufficient height, shorten
+nonessential copy, or enlarge the containing section/template. Do not solve clipping by
+reducing body text below 14px.
+
+**Exception:** Deliberate ellipsis in a secondary preview when the full value is reachable
+in a detail view named by the brief.
+
+---
+
+## Check 39 — `QACHK-VISUAL-CONTRACT` (screen styling diverges from the shared visual system)
+
+**Problem:** Independently built screens drift into different type scales, accent colors,
+spacing, surfaces, and action styles. A screen can also lack hierarchy when every label
+has equal weight and every action looks primary.
+
+**Detect:** Compare the screen with `canvas-app-shared.md`:
+
+1. Map the page title, section headings, body, captions, and KPI values to the exact shared
+ type roles.
+2. Confirm gaps and padding use the shared spacing scale.
+3. Confirm page, panel, card, border, and shadow treatments match the shared surfaces.
+4. Confirm primary, secondary, destructive, and disabled actions use their shared styles.
+5. Require one clear page title and focal region. Do not allow all headings, cards, and
+ actions to have equal visual weight.
+
+**Fix:** Replace screen-local styling values with the shared contract and restore the
+intended hierarchy. Do not introduce another palette or spacing increment.
+
+**Exception:** A deliberate exceptional state, such as an error or destructive
+confirmation, whose distinct treatment is defined in the shared contract.
+
+---
+
+## Check 40 — `QACHK-EXCESS-WHITESPACE` (layout sizing creates unintended empty regions)
+
+**Problem:** `FillPortions: =1`, oversized fixed heights, `SpaceBetween`, or empty spacer
+controls can create large blank bands that push useful content below the fold and make the
+screen look unfinished.
+
+**Detect:** At each supported width:
+
+1. Flag empty spacer controls or gaps larger than the shared spacing scale permits.
+2. Flag content-sized sections with `FillPortions: =1` when they do not intentionally
+ absorb remaining viewport space.
+3. Flag vertical `LayoutJustifyContent.SpaceBetween` when it separates ordinary content
+ into distant islands.
+4. Compare each fixed section height with child heights, gaps, and padding. Unassigned
+ space greater than one approved spacing increment needs an explicit purpose.
+5. Confirm blank space does not push a required action or primary result below the initial
+ viewport unnecessarily.
+
+**Fix:** Size the section to content, set `FillPortions: =0`, use an approved gap, or
+assign remaining space to the primary gallery/content region rather than empty controls.
+
+**Exception:** Deliberate negative space defined by the shared Visual Contract around a
+hero, empty state, or focused form.
+
+---
+
+## Check 41 — `QACHK-CORE-VISUALIZATION` (core visualization is blank, static, or incomplete)
+
+**Problem:** A screen can contain a correctly titled "Org chart", "Version Compare",
+"Timeline", or "Dashboard" region that renders only a blank rectangle, disabled-looking
+inputs, or decorative cards. This passes compilation and keyword checks while the core
+experience is missing or broken.
+
+**Detect:** For every core visualization named by the screen brief:
+
+1. Identify the populated-state controls and confirm they bind to the specified shared
+ source. A background container or title is not populated-state content.
+2. Confirm meaningful seed or guaranteed source data makes the visualization non-empty on
+ first render. Otherwise require a truthful empty state and reachable setup action.
+3. For relationship visualizations, confirm visible records expose their group/parent,
+ layer/depth, and reporting or connection relationship rather than rendering a flat list.
+4. For comparisons, confirm two distinct selected sources render simultaneously with
+ visible labels. If the requirement says side by side, reject tabs, a single reused
+ panel, and vertical stacking.
+5. Confirm differences are derived by stable record identity across the selected sources
+ and that added, removed, moved, or changed states have a visible treatment.
+6. Confirm empty-state, overlay, and input controls cannot cover populated content or
+ intercept its interactions.
+
+**Fix:** Bind real populated-state controls to the shared source, add meaningful first-load
+data or a truthful setup path, and implement the relationship/comparison encoding required
+by the brief. Remove placeholder surfaces and overlays that obscure the result.
+
+**Exception:** None when the screen brief names a core visualization. If the discovered
+controls cannot implement the requested interaction exactly, render the strongest truthful
+approximation and report it as blocked or approximate; never ship a blank region.
diff --git a/plugins/canvas-apps/references/ValidationWorkflow.md b/plugins/canvas-apps/references/ValidationWorkflow.md
index 235c5dfb4..73346f121 100644
--- a/plugins/canvas-apps/references/ValidationWorkflow.md
+++ b/plugins/canvas-apps/references/ValidationWorkflow.md
@@ -8,7 +8,8 @@ The orchestrator owns compilation of the finished workspace and the final summar
- Section 1 — Compile: diagnostic tiers, parse-error coordinates, version conflicts,
reading diagnostics, liveness, the convergence budget, repair ownership, and verifying
before summarizing
-- Section 2 — Summary: the CREATE, EDIT, and unresolved-diagnostics report formats
+- Section 2 — Functional conformance: post-compile transition and scenario gate
+- Section 3 — Summary: the CREATE, EDIT, and unresolved report formats
## 0. Compile Gates
@@ -40,6 +41,7 @@ the navigation to satisfy an intermediate compile breaks the finished app.
Call `compile_canvas`.
+
If compilation fails, fix diagnostics in this order:
1. `YamlInvalidSyntax` parse errors
@@ -77,11 +79,12 @@ mis-indented `Children:` entry, or a duplicate property key, read the rest of th
fix every other occurrence of the same pattern in the same pass. Otherwise each one costs a
full compile cycle and burns the convergence budget on a single defect.
-### Version conflicts masquerade as unknown properties
+### Creation-keyword conflicts masquerade as unknown properties
-Tier 2 sits above `Unknown property` for a reason. When any `Control:` value carries an
-`@version` suffix, the whole app binds to one template version, and every property that
-exists only in the *other* version is then reported as
+Tier 2 sits above `Unknown property` for a reason. When instances of a control type use
+creation keywords that disagree with the current `describe_control` response, the app may
+bind to a different template version and report every property that exists only in the
+other version as
`Unknown property 'P' for control type 'T'` — where `T` is the internal control name, not
the name you wrote. The properties are fine; the version pin is not.
@@ -93,8 +96,9 @@ Symptoms of this exact failure:
YAML says `ModernText`.
- One or two version diagnostics buried in the same compile output.
-The fix is always the same: strip every `@version` suffix from every `Control:` value in
-every file, then re-compile once. Do not edit a single property until you have done that.
+The fix is always the same: re-run `describe_control`, copy its complete creation-keyword
+block to every instance of that type, then re-compile once. Do not edit a single property
+until you have done that, and do not independently add or strip an `@version` suffix.
### Reading diagnostics
@@ -176,7 +180,43 @@ Edits to non-compiled artifacts do not invalidate the result: `[working director
`[working directory]/canvas-app-shared.md` and `[working directory]/*.screen-plan.md` are planning documents, and
updating one after the final compile is fine.
-## 2. Summary
+## 2. Functional Conformance
+
+A clean compile proves syntax and formula binding, not that named actions change the
+state users observe. After the final clean compile, read the plan index and generated
+files and evaluate every `## Functional Test Matrix` row.
+
+For each scenario, record one result:
+
+- `PASS` only when the Given state establishes eligibility, the When interaction reaches
+ the named event, the event reads or writes the named source and stable ID, the Then
+ postcondition follows from the formula, and the evidence surface observes that same
+ source/post-state.
+- `FAIL` when any link is missing, contradictory, stale, bound to another source or field,
+ dependent on an unstated runtime assumption, or supported only by navigation,
+ notification, input text, or static copy.
+
+For mutations, also compare the handler, write set, proof set, receipt bindings, and
+downstream observer one-for-one. For filters, verify the concrete selector value is
+pointer-committed into the target `Items` predicate, preserves both matching seeded
+records, excludes the non-match, shows the active criterion, and clears deterministically.
+
+Calculate:
+
+`Functional readiness = PASS scenarios / total scenarios * 100`
+
+The internal ship gate is **100%**, not 80%. The external goal above 80 is a measurement
+target, not permission to omit one fifth of the approved behavior. If any scenario fails,
+repair the owning `.pa.yaml` file with a targeted edit, compile again, and rerun all
+scenarios affected by that source, field, or observer. Do not add static confirmation copy
+to make a failed transition appear complete.
+
+This is a deterministic static conformance gate because the prompt environment has no
+runtime interaction tool. Report it as functional readiness, not as proof of runtime
+execution. A fresh browser evaluation remains the authority for the external functional
+grade.
+
+## 3. Summary
For CREATE:
@@ -188,6 +228,7 @@ For CREATE:
| [Screen] | [file].pa.yaml | Created |
**Compiled clean** after [N] pass(es).
+**Functional readiness:** [passed]/[total] scenarios passed static conformance.
```
For EDIT:
@@ -200,6 +241,7 @@ For EDIT:
| [Create / Modify] | [Screen] | [file].pa.yaml | Done |
**Compiled clean** after [N] pass(es).
+**Functional readiness:** [passed]/[total] scenarios passed static conformance.
```
If diagnostics remain after the convergence budget is exhausted, report them explicitly
@@ -220,3 +262,16 @@ instead of claiming completion:
[One line on what was tried and what is likely blocking.]
```
+
+If compilation is clean but functional scenarios remain unresolved, report them instead
+of claiming completion:
+
+```markdown
+**App compiled with unresolved functional defects.**
+
+**Functional readiness:** [passed]/[total] scenarios passed static conformance.
+
+| Scenario | Failed link | Owner file |
+|----------|-------------|------------|
+| [scenario] | [eligibility / event / source-ID / postcondition / observer-evidence] | [file] |
+```
diff --git a/plugins/canvas-apps/skills/canvas-app/SKILL.md b/plugins/canvas-apps/skills/canvas-app/SKILL.md
index 3d470adf4..d085297af 100644
--- a/plugins/canvas-apps/skills/canvas-app/SKILL.md
+++ b/plugins/canvas-apps/skills/canvas-app/SKILL.md
@@ -48,7 +48,32 @@ CREATE and complex EDIT workflows return here after the planner finishes.
2. Verify its `## Requirement Coverage` table maps every concrete requested noun and
interaction to a visible affordance. Any approximation must be explicit and must not
use UI copy that claims the unavailable interaction is exact.
-3. Verify its `## Dispatch` table:
+3. Verify its `## Action Contracts` table:
+ - Every requested or approved action has its own row and reachable entry point.
+ - Create, edit, delete, search, filter, approve, reject, period, and export behaviors
+ are not collapsed into vague combined rows.
+ - When review distinguishes approved and rejected outcomes, Approve and Reject/Decline
+ have separate contracts owned by the same eligible record surface.
+ - Every mutation names an observable bound result, not only a confirmation message.
+ - Every mutation declares a write set and receipt proof set. For create/edit, reject the
+ plan when any user-entered or user-selected write-set field is absent from the proof set.
+ - Supporting setup actions exist when required to exercise an explicitly requested
+ lifecycle, relationship, comparison, or ranking.
+ - Role-scoped management of all primary records includes separate visible select/edit/save
+ and remove/cancel paths, not only review or status controls.
+ - Create/edit contracts define required inputs, directly selectable finite choices,
+ stable identity, edit prepopulation, cancel/reset behavior, and post-save evidence.
+ - Every row names a precondition, source and stable identity, exact transition and
+ postcondition, observer reading that source, and visible evidence.
+4. Verify its `## Functional Test Matrix`:
+ - Every Action Contract has at least one deterministic Given/When/Then success row.
+ - Every required invalid, blocked, empty, clear/reset, or boundary path has a row.
+ - Every `Then` names a source postcondition and an evidence surface that reads it.
+ - Local/mock scenarios use concrete seeded IDs and values. Filter scenarios include at
+ least two matching records and one non-matching record.
+ - EDIT scenarios cover existing behavior touched by changed sources, fields, controls,
+ or observer formulas.
+5. Verify its `## Dispatch` table:
- Every row has `Action`, `Screen`, `Target File`, `YAML Key`, `Name Prefix`, and
`Screen Brief`.
- CREATE rows use `Create`; EDIT rows use `Modify` or `Create`.
@@ -57,16 +82,18 @@ CREATE and complex EDIT workflows return here after the planner finishes.
- No two rows share a `Name Prefix`.
- In CREATE mode the first row targets `[working directory]/Screen1.pa.yaml` with YAML key `Screen1`.
- `## Editor State Changes` exists and contains exact final order lists or `None`.
-4. Confirm `[working directory]/canvas-app-shared.md` and every dispatch row's `Screen Brief` exists.
- Verify each brief's assignment matches its dispatch row.
-5. In EDIT mode, apply the `### Before builders` group of `## App Changes` to
+6. Confirm `[working directory]/canvas-app-shared.md` and every dispatch row's `Screen Brief` exists.
+ Verify each brief's assignment matches its dispatch row and includes every Action
+ Contract owned by that screen under `## Required Actions` and every scenario it
+ exercises under `## Functional Test Scenarios`.
+7. In EDIT mode, apply the `### Before builders` group of `## App Changes` to
`[working directory]/App.pa.yaml` now. Screens bind to those collections, formulas and variables, and
compiling them against a stale `App.pa.yaml` produces a flood of false name errors.
-6. Confirm the planner reported a clean `compile_canvas` for `[working directory]/App.pa.yaml`. If it
+8. Confirm the planner reported a clean `compile_canvas` for `[working directory]/App.pa.yaml`. If it
did not, compile now and resolve every `App`-level diagnostic before dispatching.
For EDIT mode, compile after applying the before-builder app changes and resolve
App-level diagnostics before dispatching.
-7. Invoke `canvas-screen-builder` once per dispatch row, in waves of
+9. Invoke `canvas-screen-builder` once per dispatch row, in waves of
**at most three**. Fire the wave's invocations together in one message, wait for that
wave to return, then dispatch the next.
@@ -102,6 +129,12 @@ unrecognized. Confirm it matches a remaining dispatch row and leave it in place.
After all builders finish:
+- Check each builder's `Functional:` section before accepting its `QA:` line. It must
+ contain exactly one `PASS` trace per Required Action in that screen's brief, and each
+ trace must name the precondition, control event, source/stable-ID operation,
+ postcondition, and observer/evidence. A missing link, generic claim, or `BLOCKED` result
+ sends that screen back for targeted repair and a corrected trace; do not accept
+ checklist `PASS` as a substitute.
- Check each builder's `QA:` line. It must list an outcome for every check in
`${PLUGIN_ROOT}/references/QAChecks.md`. Treat these as unrun and send the screen back for self-QA
only — not a rebuild — before you compile:
@@ -127,6 +160,33 @@ After all builders finish:
destination items, same order, no extra brand/label injected into one screen's nav,
and width formulas that fit the narrowest target. This is an app-wide check builders
cannot perform because each sees only one screen.
+- Verify each `## Action Contracts` row end to end against the generated files: the entry
+ point is reachable, the named event is wired, and the observable result is visible
+ immediately after the action. For mutations, require an in-viewport receipt bound to the
+ returned record, changed stable ID, or deletion snapshot. Compare the handler formula,
+ declared write set, declared proof set, and receipt controls one-for-one. For create/edit,
+ every user-entered or user-selected field written by the handler needs a readable labeled
+ receipt binding. Navigation, a notification, hidden state, or a row somewhere in a longer
+ list cannot replace it. Compile success does not prove runtime usability.
+- Execute every `## Functional Test Matrix` row symbolically against the final formulas.
+ Confirm the Given state makes the entry point eligible, the When event targets the
+ declared source and stable ID, the Then values follow from the operation, and the
+ evidence formula reads that post-state. Repair the owning file when any link depends on
+ an unstated assumption or a different source/field.
+- For every primary-record list, verify each row or its immediately reachable detail renders
+ the canonical human-readable identity as full visible text. Avatar initials, icons,
+ record IDs, accessible labels, or evaluator inference cannot replace the identity.
+- When Approve and Reject/Decline are paired contracts, verify every eligible pending record
+ exposes both decisions on the same row or the same immediately reachable detail at phone
+ width. Send the owning screen back when either decision is missing; never accept a
+ single-sided review queue as a density tradeoff.
+- For every create/edit lifecycle, verify short static choices use radio buttons, visible
+ choice buttons, or a dropdown that commits by click or tap without typed filtering, then
+ trace create → bound mutation receipt → visible Edit → prepopulated form → stable-ID save
+ → bound mutation receipt with updated values. At phone width, verify identity,
+ status, and required lifecycle actions remain visible or have an immediately visible
+ overflow/detail entry. Send only the owning screen back for self-QA when any link is
+ missing.
- Reject `QACHK-CARD-PLACEHOLDER` `PASS` when a ModernCard displays Title, Subtitle and
Description with `Height < 180`; send that screen back for self-QA.
- If a builder returns `Status: Blocked`, re-invoke the planner to correct that screen
@@ -157,11 +217,11 @@ After all builders finish:
writes uses the standard control-type abbreviation followed by that screen's assigned
name prefix, such as `conDiscNavBar` or `btnDetailBack`. This applies especially to UI
blocks repeated on many screens — nav bars, headers, toolbars, badges.
-4. **Never write a version suffix on `Control:`.** Write `Control: ModernText`, never
- `Control: [email protected]`. One suffixed instance pins the whole app to a single
- template version, and every property that exists only in the other version then fails
- with `Unknown property '...' for control type '...'` — on controls that are perfectly
- correct. One stray suffix can produce hundreds of them.
+4. **Copy control creation keywords from `describe_control`.** `list_controls` provides
+ the name used to query `describe_control`; it is not the authority for authored YAML.
+ Copy the returned `Control:` value and every required `ComponentName`,
+ `ComponentLibraryUniqueName`, `Variant`, and `Layout` keyword verbatim. Never strip,
+ normalize, or reconstruct those values.
5. **Never invent an enum type name.** `describe_control` prints the exact name on the
`Enum name:` line of each enum property. Copy it verbatim. Enum names do not follow
from control names: `Badge.Appearance` is `BadgeCanvas.Appearance`, `Progress.Shape`
@@ -178,5 +238,6 @@ After all builders finish:
10. Compile early and often. `App.pa.yaml` is validated before builders are dispatched,
and again as soon as the first builder returns. Never defer the first compile until
every file is written.
-11. Do not report completion until the workspace compiles clean or remaining diagnostics
- are explicitly reported.
+11. Do not report completion until the workspace compiles clean and the functional
+ conformance gate passes, or remaining compile and functional defects are explicitly
+ reported.