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.

Sync Canvas prompts from client templates (#614)

Maliheasadif6cc8c56dc72
diff --git a/plugins/canvas-apps/agents/canvas-app-planner.md b/plugins/canvas-apps/agents/canvas-app-planner.md
index daedb9d3c..d8af4036f 100644
--- a/plugins/canvas-apps/agents/canvas-app-planner.md
+++ b/plugins/canvas-apps/agents/canvas-app-planner.md
@@ -26,6 +26,8 @@ Your invocation includes:
- Shared plan: `[working directory]/canvas-app-shared.md`
- Plugin root: the immutable `${PLUGIN_ROOT}` path supplied by the orchestrator
- User requirements and approved plan
+- Orchestrator-authored `[working directory]/canvas-app-requirements.md`; read it before planning and
+ never modify, replace, or regenerate it
- Discovery packet produced by the orchestrator in the MCP-owning top-level context
- CREATE context: target users and device
- EDIT context: current app state and synced files
@@ -151,16 +153,24 @@ Before writing plans:
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
+10. Before reducing the approved request into screens, copy every independently testable
+ original clause from `canvas-app-requirements.md` into
+ `## Original Request Capability Inventory`. Preserve its stable key, clause,
+ capability family, required outcome/scope, Action Contract key(s), and Functional Test
+ Matrix scenario key(s) exactly, then add the exact final-YAML observer binding(s).
+ Keep field, relationship, lifecycle, alert, aggregation scope, and specialized
+ contract mappings explicit. Reject dropped or unknown mappings. Do not infer universal
+ CRUD that the request does not require.
+11. 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. Write `## Required Record Fields` when the app has a repeated record card, row, or
+12. Write `## Required Record Fields` when the app has a repeated record card, row, or
immediately reachable detail. Add one stable field key for the canonical identity and
every field the requirements say users must see, including named title, person, time
range, description, status, and similar values. Name the owner screen, record surface,
source field, and presentation requirement. Do not accept a time-only or identity-only
surface when additional fields are requested.
-12. Build one Action Contract row for each requested or approved action. Do not infer
+13. 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
@@ -173,7 +183,7 @@ Before writing plans:
Receive/Issue, Increase/Decrease, Credit/Debit, Allocate/Release, Check-in/Check-out,
Enable/Disable, and other opposing transitions as separate contracts even when they use
one shared form.
-13. For every Action Contract, name its eligible precondition, source of truth, immutable
+14. 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. For opposing
@@ -185,7 +195,7 @@ Before writing plans:
Apply the exact selector, empty-state, numeric-input, reset, and guard contracts from
`${PLUGIN_ROOT}/references/BehaviorGuide.md` and copy the resulting compile-ready formulas and
properties into the owning screen brief.
-14. For every mutation, name the target source, exact data operation, refresh or collection
+15. 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
@@ -204,10 +214,10 @@ Before writing plans:
or lifecycle-significant Preserved field. Changed rows must match the write and proof
sets one-for-one; Preserved rows name canonical pre-state, exact omission/carry-forward,
and post-state evidence.
-15. Verify every Action Contract has a reachable entry point and owner screen. Include
+16. 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.
-16. For create and edit contracts, specify every required input, requiredness, finite-choice
+17. 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
@@ -221,7 +231,7 @@ Before writing plans:
later action directly to the returned create ID and specify clearing of continuation
ID/mode after successful downstream completion and cancellation. Omit the section for
create-only flows; do not invent continuation for ordinary navigation.
-17. Write a `## Functional Test Matrix` with at least one deterministic Given/When/Then
+18. 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.
@@ -237,7 +247,7 @@ Before writing plans:
When a continuation contract exists, add one scenario for returned-ID-bound downstream
completion and one for cancellation. Both clear continuation ID/mode; cancellation
leaves the canonical source unchanged.
-18. When Action Contracts contain an opposing directional pair, write the
+19. When Action Contracts contain an opposing directional pair, write the
`## Directional Mutation Evidence` table from `PlanTemplates.md`. Declare exact
compile-ready planned bindings for selected ID, resettable operation state, invalid
amount and submit gates, both directional formulas, the canonical observer, and all
@@ -248,7 +258,7 @@ Before writing plans:
state. Copy these planned formulas into the owning screen brief; final acceptance
compares the implemented YAML to this contract. Require a literal guard for each
direction; an `else`, default `Switch` arm, or unguarded fallback does not prove it.
-19. For every selector or filter, couple the concrete option source, readable option
+20. 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
@@ -288,6 +298,10 @@ observed defect in finished apps, and no compile diagnostic reports it.
For every screen brief, state explicitly:
+- A `## Viewport Containment Contracts` row for every responsive or unknown-device
+ screen. The declared AutoLayout root is the only top-level child and uses exact
+ `Width: =Parent.Width` and `Height: =Parent.Height`; nest alerts, receipts,
+ confirmations, forms, and navigation beneath it.
- Which horizontal rows wrap (`LayoutWrap: =true`) and which stack below a width
breakpoint. Logical canvas sources such as `App.Width`, a root container's `Width`, and
root-level `Parent.Width` can remain at design width when an embedded or scale-to-fit
@@ -327,6 +341,9 @@ For every screen brief, state explicitly:
not fit. Protect required inputs, primary actions, and complete mutation receipts.
Apply the exact arithmetic, `FillPortions`, nested-width, overflow, and fixed-height
rules from `${PLUGIN_ROOT}/references/LayoutGuide.md` and `${PLUGIN_ROOT}/references/QAChecks.md`.
+- For every fixed-height text-bearing action, badge, label, receipt, or navigation item,
+ budget the longest reachable value. Include wrapped line count plus vertical padding;
+ parent `LayoutWrap` does not make a 44px child tall enough for two lines.
- Group each visible label with its corresponding input in one field container before
the row stacks.
- Give every required classic or modern TextInput, NumberInput, Radio, DropDown, or
@@ -347,6 +364,10 @@ For every screen brief, state explicitly:
that shape despite populated collections. A required selected ID must also have either
a non-gallery event that assigns it or a row-selection event inside this render-safe
Gallery contract.
+- When any list, schedule, queue, timeline, report, or alert orders time-of-day values,
+ write `## Temporal Ordering Contracts`. Prefer a typed time field. If text storage is
+ necessary, parse accepted input and persist a zero-padded `HH:mm` sort key, define
+ invalid/blank behavior, and sort that key rather than the display string.
## 6. Assign the Control Name Space
diff --git a/plugins/canvas-apps/agents/canvas-screen-builder.md b/plugins/canvas-apps/agents/canvas-screen-builder.md
index 882b0c3f4..090a02054 100644
--- a/plugins/canvas-apps/agents/canvas-screen-builder.md
+++ b/plugins/canvas-apps/agents/canvas-screen-builder.md
@@ -167,10 +167,23 @@ Do not fix unrelated pre-existing issues.
complete mutation receipts. Apply the exact sizing, `FillPortions`, nested-width,
overflow, and fixed-height rules from `${PLUGIN_ROOT}/references/LayoutGuide.md` and
`${PLUGIN_ROOT}/references/QAChecks.md`.
+- Implement the screen's viewport-containment row exactly. The responsive AutoLayout root
+ is the sole top-level child; navigation, forms, alerts, receipts, confirmations, and
+ other conditional surfaces remain nested beneath it. Put state-driven `Visible` on the
+ whole conditional surface, not only on its children.
+- For each fixed-height text-bearing control, test the longest reachable value. A
+ multiword 112x44 button or badge is not safe merely because the parent wraps; either
+ allocate wrapped-line height or disable wrapping and provide sufficient width.
- 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.
+- Implement every Temporal Ordering Contract. Sort typed time directly, or parse and
+ validate input into the declared zero-padded 24-hour sort key. For canonical text evidence,
+ use the bounded direct form from `PowerFxGuide.md`: guard the same input for blank, then put
+ the direct declared-source `Patch` with `Text(TimeValue(same input), "HH:mm")` inside
+ `IfError`. Staged normalization can be legitimate, but the static validator reports it as
+ unverified. Keep display formatting separate and preserve the declared invalid/blank state.
- 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.
diff --git a/plugins/canvas-apps/references/BehaviorGuide.md b/plugins/canvas-apps/references/BehaviorGuide.md
index 2c65f5746..426268cb0 100644
--- a/plugins/canvas-apps/references/BehaviorGuide.md
+++ b/plugins/canvas-apps/references/BehaviorGuide.md
@@ -19,6 +19,14 @@ Canvas apps are extensible through controls, Power Fx, data sources, connectors,
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.
+Before summarizing or reorganizing the request, preserve each independently testable
+original clause in the plan's `## Original Request Capability Inventory`. Give it a stable
+key, capability family, required outcome and scope, mapped Action Contract(s), named
+observer(s), and Functional Test Matrix scenario(s). Inventory first, then design. A later
+planner summary must not erase create/edit lifecycles, relationships, alert rules,
+aggregation scope, or other requested behavior. Do not invent universal CRUD: map only
+what the original request or approved plan requires.
+
## Functional-first priority
Allocate implementation effort in this order:
diff --git a/plugins/canvas-apps/references/CreateWorkflow.md b/plugins/canvas-apps/references/CreateWorkflow.md
index f0a83a059..dfe4e2649 100644
--- a/plugins/canvas-apps/references/CreateWorkflow.md
+++ b/plugins/canvas-apps/references/CreateWorkflow.md
@@ -16,6 +16,8 @@ Read:
Determine:
+- An original-request capability inventory, captured clause-by-clause before screen or
+ feature consolidation, with stable mappings to actions, observers, and scenarios
- 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
@@ -25,6 +27,9 @@ Determine:
- Aesthetic direction with exact RGBA values
- Target device and users
+For any requested time ordering, choose typed Date/Time storage or a validated canonical
+24-hour sort key before presenting the plan. Never sort 12-hour display strings directly.
+
Use AutoLayout for phone, tablet, multi-device, or unknown targets. ManualLayout is
acceptable for desktop-only, fixed dashboards.
@@ -66,6 +71,12 @@ Otherwise, wait for user approval. Revise and re-present if requested.
## 4. Invoke the Planner
+Before delegation, write `[working directory]/canvas-app-requirements.md` from the approved plan and
+original request using the `Original Requirements Contract` template in
+`${PLUGIN_ROOT}/references/PlanTemplates.md`. This is an orchestrator-owned input: preserve the original
+request clauses before planner reduction, assign stable action/scenario and
+specialized-contract keys, and record the target device. The planner must not edit it.
+
Before delegation, use the top-level skill's MCP connection to call `list_controls`,
`list_apis`, and `list_data_sources`; call `describe_control` for every control type in
@@ -86,6 +97,7 @@ Shared plan: `[working directory]/canvas-app-shared.md`
Plugin root: `${PLUGIN_ROOT}`
Requirements: [user requirements]
Approved plan: [full approved plan]
+Original requirements contract: `[working directory]/canvas-app-requirements.md`
Target users and device: [stated or inferred]
Discovery packet: [complete results gathered above]
```
diff --git a/plugins/canvas-apps/references/EditWorkflow.md b/plugins/canvas-apps/references/EditWorkflow.md
index dd9512bdc..dda327b03 100644
--- a/plugins/canvas-apps/references/EditWorkflow.md
+++ b/plugins/canvas-apps/references/EditWorkflow.md
@@ -46,6 +46,8 @@ Read:
Determine:
+- An original-request capability inventory for every changed requirement, captured before
+ reducing it to screens or implementation tasks
- 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
@@ -54,6 +56,9 @@ Determine:
- New controls, data sources, connectors, or shared state
- Required changes to `[working directory]/App.pa.yaml`
+For changed time ordering, preserve typed Date/Time semantics or introduce a validated
+canonical 24-hour sort key; do not retain direct sorting of mixed display strings.
+
Present:
```markdown
@@ -85,6 +90,12 @@ Wait for user approval. Revise and re-present if requested.
## 4. Invoke the Planner
+Before delegation, write `[working directory]/canvas-app-requirements.md` from the approved edit plan and
+original request using the `Original Requirements Contract` template in
+`${PLUGIN_ROOT}/references/PlanTemplates.md`. Include every requested edit clause and every existing
+behavior made regression-sensitive by the edit. This artifact is orchestrator-owned and
+the planner must not edit it.
+
Before delegation, use the top-level skill's MCP connection for discovery introduced by
the edit. List resources only when the edit introduces resources not already present.
@@ -107,6 +118,7 @@ Shared plan: `[working directory]/canvas-app-shared.md`
Plugin root: `${PLUGIN_ROOT}`
Edit requirements: [user requirements]
Approved plan: [full approved plan]
+Original requirements contract: `[working directory]/canvas-app-requirements.md`
Current app state: [palette, variables, layout, screens, controls]
Synced files: [absolute working-directory paths]
Discovery packet: [complete results gathered above]
diff --git a/plugins/canvas-apps/references/LayoutGuide.md b/plugins/canvas-apps/references/LayoutGuide.md
index a46a522e2..1df1fc8a2 100644
--- a/plugins/canvas-apps/references/LayoutGuide.md
+++ b/plugins/canvas-apps/references/LayoutGuide.md
@@ -224,6 +224,13 @@ parent grow. Avoid parent `Height` formulas that read descendant `.Height` value
those descendants also size from the parent; use collection counts and constants
directly.
+For text-bearing buttons, badges, status pills, and labels, budget the longest reachable
+literal or formatted value, not the shortest seed. A 44px-high control is only a
+single-line target. If a multiword value can wrap, include every wrapped line plus vertical
+padding in both the control height and its parent/row budget. Otherwise set `Wrap: =false`
+and provide enough width for the longest value. `LayoutWrap` on the parent moves controls;
+it does not increase a child's fixed height.
+
Give list-driven galleries a conservative viewport-bounded height and let the Gallery
scroll when its source has more rows. Always set explicit positive `TemplateSize`, numeric
`TemplatePadding`, `Items`, and concrete row controls. Do not derive the Gallery's own
@@ -303,6 +310,12 @@ top-level `Children:` list contains the root and nothing else; a header or panel
as the root's sibling is outside AutoLayout and can overlap or cover the rest of the
screen while still compiling cleanly.
+Record this as a `## Viewport Containment Contracts` row. Do not mark
+`QACHK-ROOT-CONTAINMENT` N/A for a responsive or unknown-device screen. A conditional
+receipt, alert, confirmation, or editor remains inside the root and uses a state-driven
+`Visible` predicate; hiding only its children leaves the fixed parent in the layout and
+can preserve blank space or clipping.
+
A **direct** child of a scroll container must use `FillPortions: =0`, or it is pinned to
the viewport height and the content is clipped rather than scrolled. Give stacked sections
explicit heights, or let them size to content.
diff --git a/plugins/canvas-apps/references/PlanTemplates.md b/plugins/canvas-apps/references/PlanTemplates.md
index a09bc838b..a3dd2f461 100644
--- a/plugins/canvas-apps/references/PlanTemplates.md
+++ b/plugins/canvas-apps/references/PlanTemplates.md
@@ -6,6 +6,11 @@ The planner writes three artifact types:
2. `[working directory]/canvas-app-shared.md` — cross-screen conventions
3. `[working directory]/[target-base].screen-plan.md` — one implementation brief per screen
+Before the planner runs, the top-level orchestrator writes one immutable planning input:
+
+4. `[working directory]/canvas-app-requirements.md` — original request and stable capability mappings
+ captured before planner reduction
+
## Contents
- Plan Index — CREATE
@@ -14,6 +19,31 @@ The planner writes three artifact types:
- Screen Brief — CREATE
- Screen Brief — MODIFY
+## Original Requirements Contract
+
+```markdown
+# Canvas App Original Request Contract
+
+Contract version: 1
+Target device: [Phone / Tablet / Responsive / Unknown / Fixed desktop]
+
+## Original Request
+
+[Original user request and approved clarifications, without planner summarization]
+
+## Capability Inventory
+
+| Requirement key | Original request clause | Capability family | Required outcome / scope | Required action(s) | Scenario(s) | Specialized contract mappings |
+| --------------- | ----------------------- | ----------------- | ------------------------ | ------------------ | ----------- | ----------------------------- |
+| [stable key] | [One independently testable original clause] | [BehaviorGuide family] | [Fields, relationships, lifecycle, alert rule, aggregation scope, or visible outcome] | [Stable Action Contract keys] | [Stable Functional Test Matrix keys] | [e.g. `Temporal ordering=meeting-start`, or N/A] |
+```
+
+The orchestrator writes this file before planner delegation. The planner may consume it
+but must not modify it. Every mapping uses stable exact keys rather than prose matching.
+Use `Fixed desktop` only for an explicitly fixed desktop-only request; `Unknown` is
+responsive and requires viewport containment. Do not use placeholders or create rows for
+unrequested universal CRUD.
+
## Plan Index — CREATE
```markdown
@@ -27,6 +57,17 @@ CREATE
[Original requirements]
+## Original Request Capability Inventory
+
+| Requirement key | Original request clause | Capability family | Required outcome / scope | Required action(s) | Observer(s) | Scenario(s) |
+| --------------- | ----------------------- | ----------------- | ------------------------ | ------------------ | ----------- | ----------- |
+| [stable key] | [One independently testable clause preserved before planner reduction] | [BehaviorGuide family] | [Fields, relationship, state transition, aggregation scope, or visible outcome] | [Exact Action Contract keys] | [Named visible/canonical observers] | [Exact Functional Test Matrix keys] |
+
+[Write this table before consolidating screens or capabilities. Every row maps to the
+same stable key in Requirement Coverage, at least one existing Action Contract, a named
+observer, and at least one existing scenario. Use comma-separated exact keys. Do not add
+unrequested universal CRUD and do not drop a clause because the proposed plan omitted it.]
+
## Requirement Coverage
| Requirement | Planned affordance | Fidelity |
@@ -234,6 +275,25 @@ canvas/root width may remain at design width in a scale-to-fit host, so the wide
field and action composition must fit a static bound, wrap, deliberately scroll, or stack
without relying on narrow-branch activation.]
+## Viewport Containment Contracts
+
+| Screen | Root control | Layout variant | Width binding | Height binding | Overflow policy |
+| ------ | ------------ | -------------- | ------------- | -------------- | --------------- |
+| [Screen] | [sole top-level root] | AutoLayout | `[root].Width: =Parent.Width` | `[root].Height: =Parent.Height` | [vertical scroll or proven bounded content] |
+
+[Include every responsive or unknown-device screen. The root is the only top-level child;
+all visible, conditional, and overlay-like app content is nested below it. Fixed
+desktop-only ManualLayout screens are exempt only when that choice is explicit.]
+
+## Temporal Ordering Contracts
+
+[Include when a requested list, schedule, queue, timeline, report, or alert orders or
+compares time-of-day values.]
+
+| Ordering key | Source | Sort field | Storage semantics | Input validation / normalization | Canonical sort binding | Accepted formats | Invalid / blank behavior |
+| ------------ | ------ | ---------- | ----------------- | -------------------------------- | ---------------------- | ---------------- | ------------------------ |
+| [stable key] | [collection/data source] | [typed field or canonical sort-key field] | Typed time / Canonical 24-hour text | [exact input rule and planned binding] | [exact source and sort key] | [allowed input forms] | [visible reject/blank handling] |
+
## Working Directory
[absolute working directory]
@@ -269,6 +329,16 @@ EDIT
[Original edit requirements]
+## Original Request Capability Inventory
+
+| Requirement key | Original request clause | Capability family | Required outcome / scope | Required action(s) | Observer(s) | Scenario(s) |
+| --------------- | ----------------------- | ----------------- | ------------------------ | ------------------ | ----------- | ----------- |
+| [stable key] | [One changed or regression-sensitive clause preserved before planner reduction] | [BehaviorGuide family] | [Fields, relationship, state transition, aggregation scope, or visible outcome] | [Exact Action Contract keys] | [Named visible/canonical observers] | [Exact Functional Test Matrix keys] |
+
+[Include every requested edit clause and every existing behavior whose source, fields,
+controls, observer, or layout is touched. Map exact keys; do not silently narrow the edit
+to the planner's proposed screens.]
+
## Requirement Coverage
| Requirement | Planned affordance | Fidelity |
@@ -365,6 +435,20 @@ returned-ID-bound downstream completion and non-mutating cancellation/clear scen
| ------------------ | ---------------------------- | ----------------------------------- | -------------------------- | ------------------ |
| [changed container] | [local/root source and narrowest supported rendered width, or all cross-branch pairs] | [total available local width versus padding + children + gaps, or N/A] | [available Height versus children + gaps + padding, or N/A] | [amount, Save/Apply, complete receipt, or N/A] |
+## Viewport Containment Contracts
+
+| Screen | Root control | Layout variant | Width binding | Height binding | Overflow policy |
+| ------ | ------------ | -------------- | ------------- | -------------- | --------------- |
+| [changed responsive screen] | [sole top-level root] | AutoLayout | `[root].Width: =Parent.Width` | `[root].Height: =Parent.Height` | [vertical scroll or proven bounded content] |
+
+## Temporal Ordering Contracts
+
+[Include when the edit adds, changes, or can invalidate time-of-day ordering.]
+
+| Ordering key | Source | Sort field | Storage semantics | Input validation / normalization | Canonical sort binding | Accepted formats | Invalid / blank behavior |
+| ------------ | ------ | ---------- | ----------------- | -------------------------------- | ---------------------- | ---------------- | ------------------------ |
+| [stable key] | [collection/data source] | [typed field or canonical sort-key field] | Typed time / Canonical 24-hour text | [exact input rule and planned binding] | [exact source and sort key] | [allowed input forms] | [visible reject/blank handling] |
+
## Working Directory
[absolute working directory]
diff --git a/plugins/canvas-apps/references/PowerFxGuide.md b/plugins/canvas-apps/references/PowerFxGuide.md
index d1acfdcd5..ebee23e13 100644
--- a/plugins/canvas-apps/references/PowerFxGuide.md
+++ b/plugins/canvas-apps/references/PowerFxGuide.md
@@ -79,6 +79,42 @@ Text: =Text(varDate, "dddd, mmmm d, yyyy")
Text: =Text(Now(), "hh:mm:ss")
```
+### Sort by time semantics, not display text
+
+Do not sort user-facing time strings directly. Lexicographic ordering puts values such as
+`"2:00 PM"` before `"9:00 AM"` and allows padded, non-padded, 12-hour, 24-hour, and blank
+values to mix silently.
+
+Prefer a typed Date/Time column and sort that field directly. When a local/mock source must
+store text, validate the same input that is written and persist a separate zero-padded
+24-hour sort key. The static acceptance validator deliberately supports a bounded direct
+form: an outer blank guard and an `IfError` whose successful expression directly writes
+`Text(TimeValue(the same input), "HH:mm")` to the declared source field. Staged variables
+and other control flow may be valid at runtime, but are reported as unverified rather than
+being inferred from unrelated parsing tokens.
+
+```yaml
+OnSelect: |-
+ =If(
+ IsBlank(Trim(txtStart.Text)),
+ Notify("Time is required"),
+ IfError(
+ Patch(
+ colMeetings,
+ First(colMeetings),
+ {StartSortKey: Text(TimeValue(Trim(txtStart.Text)), "HH:mm")}
+ ),
+ Notify("Enter a valid time")
+ )
+ )
+
+Items: =SortByColumns(colMeetings, "StartSortKey", SortOrder.Ascending)
+```
+
+Keep the original display value separate when the requested presentation is 12-hour time.
+The plan must name accepted input forms and the visible invalid/blank behavior. Do not
+claim free-form time input is valid merely because one seed format sorts correctly.
+
## Event handling
### Guard clauses
diff --git a/plugins/canvas-apps/references/QAChecks.md b/plugins/canvas-apps/references/QAChecks.md
index e17ca97e8..cf3abb815 100644
--- a/plugins/canvas-apps/references/QAChecks.md
+++ b/plugins/canvas-apps/references/QAChecks.md
@@ -156,6 +156,16 @@ numeric branch calculations in `QA layout evidence`; unsupported PASS text fails
These calculations are static evidence. Browser execution remains necessary to prove the
rendered controls are visible, scrollable, and pointer-reachable.
+For `QACHK-ROOT-CONTAINMENT`, a responsive or unknown-device screen passes only when its
+declared viewport root is the sole top-level child, uses `AutoLayout`, and has exact
+`Width: =Parent.Width` and `Height: =Parent.Height`. Every alert, receipt, confirmation,
+form, and navigation region must be nested beneath it.
+
+For `QACHK-TEXT-CONTENT-FIT`, test the longest reachable label/value. A wrapped multiword
+button, badge, or label needs height for every line plus vertical padding; a fixed 44px
+height is not evidence of two-line fit. If wrapping is disabled, prove the longest value
+fits the available width.
+
---
## Check 1 — `QACHK-CONTROL-CREATION-KEYWORDS` (creation keywords differ from `describe_control`)
diff --git a/plugins/canvas-apps/references/ValidationWorkflow.md b/plugins/canvas-apps/references/ValidationWorkflow.md
index 095a765b8..0366f6a9a 100644
--- a/plugins/canvas-apps/references/ValidationWorkflow.md
+++ b/plugins/canvas-apps/references/ValidationWorkflow.md
@@ -211,6 +211,7 @@ Runtime evaluation: NOT RUN
Plugin root: [exact plugin root]
+Skill contract version: [version from `${PLUGIN_ROOT}/skills/canvas-app/SKILL.md`]
Source revision: [git revision, package version, or "unavailable"]
@@ -256,6 +257,30 @@ Contract `Observer and evidence` cell declares an exact
| ----------- | -------------------------- | ------ |
| [plan key] | [exact final-YAML `Surface.Visible: =state predicate`] | PASS |
+## Temporal Ordering Evidence
+
+[Include when the plan contains `## Temporal Ordering Contracts`.]
+
+| Ordering key | Input validation / normalization binding | Sort binding | Observer binding | Result |
+| ------------ | ---------------------------------------- | ------------ | ---------------- | ------ |
+| [plan key] | [exact final-YAML typed input or parse/normalize binding] | [exact `Sort` or `SortByColumns` binding over the declared typed/canonical field] | [exact visible observer binding] | PASS |
+
+For canonical text, static PASS is intentionally bounded to a direct
+`If(IsBlank(input), ..., IfError(Patch(declaredSource, ..., {declaredField:
+Text(TimeValue(input), "HH:mm")}), ...))` shape. The blank guard, conversion, and write must
+use the same input. Wrappers or suffixes around the normalized value and staged-variable
+dataflow are unverified; do not replace missing structural evidence with token-presence claims.
+Typed-time evidence likewise requires the assigned field value itself, rather than a nested
+argument, to return `Time`, `TimeValue`, `DateTime`, or `DateTimeValue`.
+
+## Viewport Containment Evidence
+
+[Include when the plan contains `## Viewport Containment Contracts`.]
+
+| Screen | Root control | Top-level containment | Conditional surfaces | Result |
+| ------ | ------------ | --------------------- | -------------------- | ------ |
+| [screen] | [declared sole AutoLayout root] | [all visible screen content nested under root] | [state-driven surfaces use whole-surface `Visible`, or N/A] | PASS |
+
## Data Entry Label Evidence
| Control | Visible label binding | Shared layout region |
diff --git a/plugins/canvas-apps/skills/canvas-app/SKILL.md b/plugins/canvas-apps/skills/canvas-app/SKILL.md
index a6b0e53f1..f4b81b975 100644
--- a/plugins/canvas-apps/skills/canvas-app/SKILL.md
+++ b/plugins/canvas-apps/skills/canvas-app/SKILL.md
@@ -1,6 +1,6 @@
---
name: canvas-app
-version: 3.0.9
+version: 3.1.0
description: Creates or edits a Power Apps Canvas App through the Canvas Authoring MCP coauthoring session. Handles new app generation, direct targeted edits, complex multi-screen changes, responsive layout, per-screen self-QA, and compile-error convergence. Trigger on requests to create, build, generate, modify, update, change, fix, or edit a Canvas App or .pa.yaml files.
author: Microsoft Corporation
user-invocable: true
@@ -59,16 +59,26 @@ Do not load both workflow documents.
CREATE and complex EDIT workflows return here after the planner finishes.
-1. Read `[working directory]/canvas-app-plan.md` returned by the planner.
-2. Verify its `## Requirement Coverage` table maps every concrete requested noun and
+1. Read the orchestrator-authored `[working directory]/canvas-app-requirements.md` and
+ `[working directory]/canvas-app-plan.md` returned by the planner. The requirements artifact must
+ already exist before planner delegation, use contract version 1, preserve the original
+ request, identify the target device, and assign stable requirement, action, scenario,
+ and specialized-contract mappings. Do not let the planner create, rewrite, or replace
+ this upstream artifact.
+2. Verify `## Original Request Capability Inventory` was captured from the original
+ request before planner reduction. Every stable key must appear in `## Requirement
+ Coverage` and map to existing Action Contract key(s), named observer(s), and Functional
+ Test Matrix scenario key(s). Reject dropped clauses and unknown mappings; do not add
+ universal CRUD absent from the request.
+3. 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. When the app contains record cards, rows, lists, or details, verify its
+4. When the app contains record cards, rows, lists, or details, verify its
`## Required Record Fields` table has one stable key for the canonical identity and
every field the requirements say users must see. Reject a time-only, identity-only, or
action-only surface when additional title, person, time, description, status, or other
values are requested.
-4. Verify its `## Action Contracts` table:
+5. 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.
@@ -111,7 +121,7 @@ CREATE and complex EDIT workflows return here after the planner finishes.
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.
-5. Verify its `## Functional Test Matrix`:
+6. 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 direction of an opposing pair has its own concrete scenario with explicit old
@@ -124,7 +134,7 @@ CREATE and complex EDIT workflows return here after the planner finishes.
- When a continuation contract is present, scenarios cover the returned-ID-bound
downstream completion and non-mutating cancellation paths, including
continuation-state clear.
-6. When the plan contains an opposing directional pair, require `## Directional Mutation
+7. When the plan contains an opposing directional pair, require `## Directional Mutation
Evidence` before dispatch. It must state a nullable selected-ID state with blank reset
and row assignment, the actual operation state with an entry/success `Blank()` reset
event, representable blank/non-positive amount bindings, a disabled invalid submission
@@ -132,7 +142,16 @@ CREATE and complex EDIT workflows return here after the planner finishes.
bindings for operation, old value, amount, expected value, and actual persisted value.
For a shared-operation flow, the plan must also identify each selection-only binding,
the common guarded mutation event, and their common operation state.
-7. Verify its `## Dispatch` table:
+8. Verify every responsive or unknown-device screen has a `## Viewport Containment
+ Contracts` row naming one sole top-level AutoLayout root with exact
+ `Width: =Parent.Width` and `Height: =Parent.Height`. All visible and conditional
+ surfaces must be nested below it.
+9. When requested behavior orders or compares time-of-day values, require
+ `## Temporal Ordering Contracts`. Sort typed Date/Time fields directly, or require
+ validated input normalization to a zero-padded 24-hour `HH:mm` sort key with explicit
+ invalid/blank behavior. Reject direct sorting of 12-hour, non-padded, or mixed display
+ strings.
+10. 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`.
@@ -141,13 +160,13 @@ 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`.
-8. Confirm `[working directory]/canvas-app-shared.md` and every dispatch row's `Screen Brief` exists.
+11. 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`. It also includes every
`## Required Record Fields` row owned by that screen with an exact bound control,
formula, hierarchy, visibility rule, and layout budget.
-9. Before dispatch, read every brief and reject it when:
+12. Before dispatch, read every brief and reject it when:
- a used control lacks its exact creation keywords, supported input-property names, or
the full `Enum name:` and compile-ready enum literal required by discovery;
- a Required Action is only an identifier or summary instead of its complete
@@ -155,14 +174,14 @@ CREATE and complex EDIT workflows return here after the planner finishes.
- a Functional Test Scenario is only an identifier instead of complete
Given/When/Then text, boundary conditions, and expected evidence; or
- it contains an unresolved placeholder or delegates discovery to the builder.
-10. In EDIT mode, apply the `### Before builders` group of `## App Changes` to
+13. 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.
-11. Call `compile_canvas` now and resolve every `App`-level diagnostic before dispatching.
+14. Call `compile_canvas` now and resolve every `App`-level diagnostic before dispatching.
The planner cannot validate through the top-level MCP connection. For EDIT mode,
compile after applying the before-builder app changes and resolve App-level
diagnostics before dispatching.
-12. Invoke one general-purpose agent with `Task` per dispatch row and instruct it to read
+15. Invoke one general-purpose agent with `Task` per dispatch row and instruct it to read
and follow `${PLUGIN_ROOT}/agents/canvas-screen-builder.md` using the supplied
assignment. Run these workers in waves of **at most three**. Fire each wave together,
wait for it to return, then dispatch the next.
@@ -308,6 +327,14 @@ Report the guide path and highest defined check as `Status: Provenance Blocked`.
phone layouts. Static budgets do not replace post-export runtime proof for list rows and
row actions. Apply the exact containment, sizing, breakpoint, and scrolling rules from
`${PLUGIN_ROOT}/references/QAChecks.md` and `${PLUGIN_ROOT}/references/ValidationWorkflow.md`.
+- Verify every Viewport Containment Contract against final YAML. The declared AutoLayout
+ root must be the sole top-level child with exact viewport width/height; do not accept
+ `QACHK-ROOT-CONTAINMENT` N/A on these screens.
+- Verify fixed-height text-bearing controls against their longest reachable values.
+ Include wrapped lines and padding; parent wrapping cannot prevent child-height clipping.
+- Verify every Temporal Ordering Contract against final YAML. Test representative morning
+ and afternoon values, zero-padded and non-padded 24-hour input, 12-hour input when
+ accepted, and invalid/blank input. Direct lexicographic sorting of display strings fails.
- Require persistent human-readable visible labels for accepted data-entry controls,
including controls on state-driven surfaces, and record the corresponding Data Entry
Label Evidence from `${PLUGIN_ROOT}/references/ValidationWorkflow.md`.