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.

23.5 KB
Raw Blame

App-Builder Offline Structural Eval Harness — Guide

Companion to evals/model-apps/genpage/EVAL_GUIDE.md.
Source of truth: plugins/model-apps/docs/app-builder-design.md §13.

What we evaluate

Offline per-stage facts, not live Dataverse state or execution of the skill's prompts. Each fixture contains an App Spec (app-spec.json); some also contain baseline specs, hand-authored deployed FormXML, downloaded PAC page files, or before/after .tsx bytes. The runner computes deterministic facts using the current plugin helpers and grades them against independent expectations in evals.json.

Stage → oracle table

Stage Oracle Plugin primitive
author validateAppSpec(plan profile) passes · no lint errors · artifact names are table/type-scoped · ASCII page-quote warnings stay visible without changing approved names. Other advisories remain non-fatal. app-spec.js, spec-lint.js
author (optional capabilities) Off unless the prompt asks for them, on every fixture: app.theme, a configuration item (environmentVariables, connectionReferences, customApis, duplicateDetectionRules, solution.version) and a declared form, dashboard, business rule or process flow (reconcile: "declared") are present only when expect says the prompt asked. What it asked for must be there, graded by kind and table only (expect.declared: names, stage labels, tile order and scope are not compared, and nothing in this check grades an artifact's shape), so removing the only declared artifact of an asked kind on a table, dropping its reconcile, a wrong table or an extra kind fails; with several declared artifacts of one kind on a table, only the count the prompt states is checked. A prompt that declines rules and flows (expect.noBusinessLogic) gets no plain rule or flow either. See "Optional capabilities". app-spec.js, assertions.js
plan Every planned item targets a known engine phase sdk-build.js planFor + PHASES
data Normalized data-model facts match the expect.tables/relationships block schema-facts.js schemaFacts
ui View/chart names match expect.views/charts · a filter the prompt names (expect.viewFilters, { entity, view, attr, op, value }, written from the prompt) is among the view's compiled conditions, so a spelling the build ignores (filter, column, operator) fails · explicit tab/section names, topology, percentage widths, display flags, field state and spans match authored input · enriched default views keep parent lookups (#2) and drop createdon (#7) · each sub-grid is a full-width 1-column section titled by the child display name (#5) sdk-build.js viewDef / chartDef / compileFormIntent / defaultViewColumns / subgridLabel · artifact-intent.js subgridSectionIntent
app Every sitemap subarea resolves to a concrete target · no dangling navigatesTo keys sdk-build.js appDef
security Each declared persona maps to exactly one role · the role injects appmodule read for app-access personas (and only those) · every persona privilege on an app-owned table (the app's own publisher prefix) resolves to a provisioned entity (JTBD coverage) · the role grants exactly its jobs' declared privileges — no extra entity, access token, or inflated scope beyond the declared union + the documented appmodule injection (least privilege) sdk-build.js personaRoleSpecFor
verify Required verification succeeds, reports no missing artifacts, and actually runs each applicable check kind. Fixture 7 supplies independent deployed XML and served Main form order instead of compiler-rendered XML. verify-spec.js verifySpec
process Declarative logic binds real columns — every business-rule clause/action and every BPF step resolves to a column the spec creates (or a lookup its relationships create) sdk-build.js businessRuleDef + bpfDef
generate-pages Declared navigation edges resolve in canonical synthesized call sites; this does not inspect a page's actual source. See compatibility skips below. pageref-resolver.js resolvePageRefs
teardown The reverse-of-build delete plan is dependency-safe (solution last · web resources after tables · every table, business rule and process flow has a step) sdk-teardown.js planTeardown
round-trip The compared hydration subset preserves solution identity, table names, page keys/names/models, authored direct-entry behavior and ordered sitemap target references. Fixture 8 also reads PAC page/config files, unescapes names and diagnoses an omitted invalid model. hydrate-spec.js hydrateSpec · download-model-app.js parseDownloadedPages / assignPageKeys · genpage-sdk.js unescapePacName
changed-only Real source-byte hashes and an eligible serialized snapshot produce exactly the expected fast, full or noop verdict, changed phases, page identities and full-build reasons. content-hash.js, apply-snapshot.js, classify-changes.js

These are bounded helper-level oracles, not proof that download followed by rebuild is lossless. Most readers are synthetic; views, charts, forms and commands are not structurally reconstructed by the hydrator, and entity column fidelity is checked separately by the metadata projection. Fixture 7 checks a declared before/after layout and its independently authored deployed evidence; it does not run SDK reconciliation. Fixture 9 exercises the real decision core and pure snapshot lifecycle, not the build CLI's flag handoff, workspace lease, live identity discovery or partial-apply side effects.

The process oracle exists because both surfaces share a failure mode nothing downstream detects: the platform accepts a definition whose column bindings are wrong or missing, and the artifact then does nothing. A business rule with a mis-shaped condition tree deploys, activates and never fires; a BPF step with no bound field is refused only at push time, on a live environment. Counting artifacts would stay green through both, so the assertions grade the bindings the pure def builders emit.

Optional capabilities

/app-builder offers branding, configuration items, declared rules and flows, and declared form and dashboard layouts as questions (references/authoring-flow.md, Levels (a0) and (b)), and writes none of them by default. What these evals grade is the spec, in both directions, on every fixture:

  • A capability nobody asked for fails. With no expectation, a spec that carries app.theme, a configuration item or a declared form, dashboard, rule or flow fails, so adding one to an ordinary fixture is caught.
  • A capability the prompt asked for must be there (appTheme, configuration, declared in expect). The check is presence and absence by capability kind and table, nothing finer: the theme is present iff asked; each configuration field is non-empty iff asked; for each declared kind (form, dashboard, business rule, process flow) the set of tables carrying a reconcile: "declared" artifact equals the asked set, with at least minCount artifacts where the prompt states a count. Removing the only declared artifact of an asked kind on a table, dropping its reconcile: "declared", putting it on another table, or adding an artifact of a kind or table nobody asked for fails; when a table carries several declared artifacts of one kind, only the count the prompt states is checked. Names, stage labels, tile order and scope are never compared by this check; the shape assertions below grade what the prompt says about them.
  • What grades a declared artifact's shape, and what does not. On every fixture the common assertions check that each business rule binds only columns the spec creates and compiles at least one condition and one action, that each process-flow step binds a field on the flow's table and each stage is scoped to that table, and that each declared dashboard, rule and flow has a teardown step. Beyond that, fixtures 21-24 each have their own shape assertions. Fixture 21 grades the authored tab, form-column and section topology, and column and row spans. Fixtures 22-24 grade what the plugin compiles for the artifact (facts.declaredShapes) against expect.declaredDashboards, expect.declaredRules and expect.declaredFlows, each written from the prompt:
    • 22, dashboard: exactly the asked tiles, each bound to the view, chart or iframe address it names (the tile kind and the table are part of that identity) and at least as wide or as tall as the prompt says. Tile names and order are not compared.
    • 23, rules: each asked rule is Active (a Draft rule never runs, so it is not the operating rule the prompt asks for), fires on exactly the asked conditions (column, operator and, for a choice, the option label), has the asked logic and scope where the prompt states them, and carries exactly the asked actions (kind, column, lock, required, visible, a non-empty message). Rule names, the order of rules, conditions and actions, and any scope the prompt leaves unsaid are not compared.
    • 24, flow: exactly the asked stages in order, each matched by a pattern for the word the prompt uses. Stage wording beyond that word, step names and the flow name are not compared.
  • A prompt that declines rules and flows (expect.noBusinessLogic: true) fails on any rule or flow, declared or not.

Whether the agent makes the offer is not graded. That is a property of a conversation, and no offline harness records one; a hand-written record of an offer would only certify itself. Grading the offer needs a harness that captures a transcript of a real /app-builder run. That is a follow-up.

Fixtures

Each fixture lives in fixtures/<id>-<slug>/ and contains app-spec.json. Naming is numeric-prefix; fixture-loader.js matches ^(\d+)(?:-(.+))?$. Optional evidence.json selects fixture evidence, baseline-app-spec.json supplies the prior spec, and entity-edit-app-spec.json supplies fixture 9's schema-only edit. FormXML file references are confined to the fixture directory, including when the fixtures root is a junction or symlink.

# Slug What it tests
1 1-support-desk Full data/ui/app/verify oracle (no pages) · two personas (Support Agent, Support Lead) exercise the security oracle — one role each, app-module read injected, JTBD coverage + least-privilege
2 2-orders-multipage Page intents + navigation + design contract; page-key round-trip
3 3-assets-dashboard Global choice + column binding, on-click command, and a classic dashboard pinned to the nav — exercises teardown (dashboard/command/web-resource/global-choice steps) + the dashboard round-trip
4 4-hardening The hardening fixes: a lookup-heavy child (8 scalars + a 1:N parent lookup) proves the default view keeps the lookup and drops createdon; an N:N proves the alphabetically-sorted schema name new_tag_new_ticket; a no-label sub-grid proves the own-section + pluralName title; relational sample data proves validateAppSpec accepts a resolvable $parent match and declared Choice labels
5 5-process-logic The two declarative-logic surfaces: a 3-stage business process flow whose steps bind both the table's own columns and a relationship lookup (new_customerid, which is absent from columns[]), plus two business rules — one multi-action, one multi-condition including a value-less presence operator. Grades stage order, step bindings, clause/action survival, and one teardown step each
6 6-form-layout Fresh explicit forms: 65/35 form-column widths, grid columns, spans, collapsed tab, read-only reviewer and a polymorphic Customer lookup. Authored shape/state facts are independent of compiler output.
7 7-form-reconcile Before/desired specs plus independent FormXML: inserted/reordered tabs, reordered sections, hidden tab/section/field, suppressed labels, read-only fields, 50/50 default widths, spans, Quick View binding and stored/served Main form order.
8 8-page-roundtrip PAC-stored escaped own name differs from navigation title; actual downloaded files preserve a valid model, keep an absent model absent, and omit an invalid one with loss diagnostics.
9 9-changed-only Baseline and edited .tsx bytes: only overview is a page-content fast change; adding a column is full with a data-model reason; identical spec and bytes are noop. Real hash, snapshot and classifier helpers run offline.
10 10-name-scope The same form/view/chart names on two tables do not collide. A straight double quote warns without a rename; apostrophe and typographic-quote controls do not. Same-table duplicates and missing/spurious warnings are negative unit probes, not red corpus fixtures.
11 11-portable-options-labels Option values a maker depends on: a global choice with values 1, 2, 10, sparse and mixed inline options, sample data by label and a view filtered by number. The spec asks for 2.21.0.
12 12-date-behavior Date and Time behaviours: DateOnly with and without a date format, TimeZoneIndependent, explicit UserLocal and an omitted behaviour.
13 13-secured-profile-principals Secured Money and Memo columns with explicit field security profiles: one assigned to a named team, one with no assignment, plus sample data.
14 14-app-exact-main-forms "Only the Summary form": app.mainForms lists it with mainFormsOnUpdate: "exact"; an "add the Summary form" ask must not get exact (negative unit probe). Verify must read an exact list strictly. The spec asks for 2.21.0.
15 15-app-pin-offnav-chart A new app with a chart of a table outside its navigation sets app.pinDeclaredArtifacts: true.
16 16-declared-search-join A new app declares every view and chart (reconcile: "declared", none named like a stock view, no chart title), gives each new table search columns (quickFind: the primary name plus the identifiers the prompt names), and joins a related table only on the view that shows its column. No form or command carries reconcile or a command key.
17 17-declared-web-resource Fixture 5 with one HTML web resource marked reconcile: "declared" (the maker asked a rebuild to keep its content in step); the spec sets minimumPluginVersion 2.21.0, which validation asks for, and no other kind but views, charts and web resources carries reconcile (the declared form layouts, dashboards, business rules and process flows are covered by fixtures 21–24).
18 18-configuration-items An app that names per-environment settings, a connector, an action and a duplicate check declares environmentVariables[] (the API key as type: "secret"), connectionReferences[], customApis[], duplicateDetectionRules[] and solution.version, with no current value, secret value or connection id in the spec. The fixture's deployment-settings.json carries those, and a unit test proves it binds every declared reference and secret. The spec asks for 2.21.0.
19 19-modern-branding An explicit branding ask declares app.theme (Preview): a base colour, header colours and a logo that is a declared SVG web resource, never a URL. The spec asks for 2.21.0. An ordinary app ask must not get a theme; --verify reports API state, and the header is checked in a browser.
20 20-stable-identities A new-app ask writes createIdentity: "stable-v1" with minimumPluginVersion 2.21.0 and declares its view and chart, the only creates that get stable ids. A download prompt must not gain the field (negative unit probe). The /app-builder skill's createIdentity guidance must tell the maker that an unsent local edit stops the build (create-completion-required) and that running again does not merge it.
21 21-declared-form-layout A "lay out this form myself and keep it" ask declares the Main form with reconcile: "declared": a full-width name (colspan), a two-row address (rowspan), field flags set both true and false, two sub-grids to different child tables, and an onload handler from a declared web resource. The runner checks the compiled topology and spans; the declared-form unit tests check that content the spec omits is kept and that a rebuild finds the same form and sends no form write.
22 22-declared-dashboard A "keep this dashboard's tiles the way the spec says" ask declares a global Standard dashboard with reconcile: "declared", a key on it and on each tile (a two-column list, a chart, a tall iframe), and the app shell places it. The runner checks the plan, the sitemap target and its teardown, and that it holds exactly the asked tiles (a wide list of the open view, the status chart, a tall iframe of the named address); the declared-dashboard unit tests check that a keyed tile edit writes only that tile, an added tile goes after the last row, a tile made in Maker is kept, and a rebuild sends no write.
23 23-declared-business-rule A "keep these business rules the way the spec says" ask declares two business rules with reconcile: "declared", a key on each rule, condition and action: one on the table (a required resolution and a locked field when closed), one on every form (scope: "AllForms", an error message from a two-condition test). The runner checks that each compiles and binds only the spec's columns, that each is Active and fires on the asked condition with the asked scope and actions, and its teardown; the declared-rule unit tests check the Draft-first create, the conditional activation, that a rebuild sends no write, the typed adoption, verify and the managed download.
24 24-declared-bpf A "keep this process flow the way the spec says" ask declares one linear business process flow with reconcile: "declared", a key on each stage and step (three stages, required and optional steps), a description, an order and an Active status. The runner checks that it compiles on its own table and binds only the spec's columns, that its stages are the three the prompt names in order, and its teardown; the declared-flow unit tests check that every stage and step id is fixed before the Draft-first create, the conditional activation, that a rebuild sends no write, that an edit, omission or reorder is refused with no write, the typed adoption, verify and the managed download.
25 25-no-optional-extras A new-app ask that says no to branding, outside services, per-environment settings, business rules, process flows and fixed layouts gets none of them: no app.theme, no configuration item, no declared form, dashboard, rule or flow, and no plain business rule or process flow either (expect.noBusinessLogic).

Fixture 2 note: appShell.subAreas[].page references use the page's key (e.g. "overview"), not its display name ("Overview"). The v2 validator requires keys, and the linter accepts valid key references; key === name is neither required nor used by this fixture.

evals.json

  • skill_name — identifies this suite.
  • eval_instructions — description used by eval runners.
  • common_stage_assertions — run for every fixture; registered in lib/assertions.js.
  • evals[].expect — independent per-eval counts/names plus form-edit, rejected-model, changed-only, name-scope, option-value, view-filter, date-behaviour, field-security, app-membership and stable-identity contracts.
  • evals[].expectations — additional per-eval assertion texts (can be empty).
  • evals[].tier — smoke (fast subset) or full.

Running

From the repo root (evals/ lives there, sibling to plugins/):

# All fixtures, TAP v13 output; exit 0 = all pass, 1 = fail, 2 = harness error
node evals/model-apps/app-builder/run-app-builder.js

# Specific fixture
node evals/model-apps/app-builder/run-app-builder.js --eval 1

# Smoke tier only
node evals/model-apps/app-builder/run-app-builder.js --tier smoke

# Unit + e2e tests (node:test, NOT part of the plugin run-tests.js)
node --test evals/model-apps/app-builder/tests/*.test.js

TAP output

TAP version 13
1..2
# Subtest: 1-support-desk
    ok 1 - author: validateAppSpec(plan profile) passes with no errors
    ok 2 - author: spec-lint reports no errors
    ...
ok 1 - 1-support-desk
# Subtest: 2-orders-multipage
    ...
ok 2 - 2-orders-multipage
# tests 20
# pass  20
# fail  0
# skip  0
# fixtures 2 (pass 2, fail 0)

Adding an eval

  1. Create fixtures/<N>-<slug>/app-spec.json.
  2. Add an entry to evals.json with matching id, an expect block, and any extra expectations.
  3. If you need a new assertion, add it to lib/assertions.js (text must match exactly).

Keep positive fixtures green. Demonstrate each new or strengthened check with a passing control and a failing mutation in tests/facts.test.js. Do not derive an expected value from the compiler output being graded. The unit suite also checks fixture/manifest IDs and registered assertion texts, and evals/model-apps/tests/eval-coverage-contract.test.js fails when an assertion returns SKIP on every fixture it runs on (so it verifies nothing) or when this guide's fixture table misses a fixture.

Adding an assertion

Register the check in lib/assertions.js:

ASSERTIONS.set('my-stage: my assertion text', ({ facts, spec, eval: ev }) => {
  if (someConditionNotMet) return { status: 'fail', reason: 'explains why' };
  if (notApplicable) return { status: 'skip', reason: 'explains why skipped' };
  return { status: 'pass' };
});

Then add the text to evals.json common_stage_assertions (applies to all) or evals[].expectations (per-eval).

Failures, skips and advisories

An unexpected verifier exception is a FAIL, never a skip. A successful ok flag without the required check kinds is also a failure. Topology reads are required for explicit layouts; a throwing or missing topology reader cannot certify them.

The optional servedMainForms capability is named explicitly: when absent, its own assertion skips; when present, its checks must run and failures remain failures. Checks with no applicable artifact also emit a named skip. The legacy PAGEREF compatibility path can skip a resolver that an older plugin does not supply; the current verifier itself requires that module, so it is not optional on current plugin versions.

Lint warnings are printed as TAP comments without blanket-failing legitimate advisories. Assertions check page-quote warning coverage, and fixture 10 rejects wrong name-scope warnings. Invalid downloaded models are also printed as omission diagnostics. Failing assertions or stage-fact computation return exit 1; malformed fixtures and argument errors return exit 2.

Live evals

The live smoke (plugins/model-apps/scripts/smoke-eval.js) grades actual Dataverse provisioning. These offline evals complement it; they do not certify live deployment, SDK serialization or runtime UI behavior.

Nor do they grade the skill's judgment: each fixture is a hand-authored App Spec, so the suite tests the deterministic engine (spec → plan → facts), not whether /app-builder authors a good spec from a user's intent. Whether a prompt reaches /app-builder at all is graded by the agent-in-the-loop routing eval in evals/model-apps/routing/.

Cross-links

  • Plugin AGENTS.md → Eval Suite
  • plugins/model-apps/docs/app-builder-design.md §13 — structural eval oracles
  • evals/model-apps/genpage/EVAL_GUIDE.md — the parallel eval suite for /genpage