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.
Eval Guide — Model Apps /genpage
Comprehensive guide to the /genpage evaluation suite. What evals exist, how they're structured, how to run them, how to interpret results, and how to extend them. Companion to the plugin's docs/architecture.md (system overview).
Table of contents
- Related files
- What we evaluate
- The three-layer grading model
- Eval data —
evals.jsonstructure - Eval tiers (smoke / full / stress)
- Fixture types (synthetic vs real captures)
- Running the suite
- Cadence — when to run
- Quick start — manual capture and offline replay
- Reading runner output (TAP)
- Manual grep patterns (Layer 2 fallback)
- Pass / fail summary
- Diagnosing failures (which agent owns what)
- Capturing real fixtures from
/genpage - Adding a new eval
- Adding a new assertion
- Expected refusals and corpus gating
Related files
- Skill definition:
plugins/model-apps/skills/genpage/SKILL.md - Specialist agents:
plugins/model-apps/agents/genpage-planner.mdplugins/model-apps/agents/genpage-entity-builder.mdplugins/model-apps/agents/genpage-page-builder.mdplugins/model-apps/agents/genpage-edit-planner.md
- References:
plugins/model-apps/references/rules.mdplugins/model-apps/references/plan-schema.mdplugins/model-apps/references/troubleshooting.md
- Sample pages:
plugins/model-apps/samples/1-account-grid.tsxthrough11-kanban-with-dnd.tsx
What we evaluate
/genpage is a multi-phase skill: orchestrator → planner → optional entity-builder → page-builder(s) → deploy → optional verify. Each phase has rules (auth must precede entity creation, plans must follow a schema, generated code must follow rules.md, etc.). These runners replay stored artifacts against selected contracts; they do not launch agents, answer questions, run logged commands, or deploy anything. A green replay is not end-to-end evidence of current agent or platform behavior.
Three kinds of failure we want to catch:
| Failure class | Example | Where it shows up |
|---|---|---|
| Workflow drift | Planner skipped the AskUserQuestion for new-vs-edit | Layer 1 (workflow-log + plan grading) |
| Code-gen drift | Generated .tsx uses <FluentProvider> wrapper or 100vh |
Layer 2 (.tsx static analysis) |
| UX drift | Layout cramped, lookups show raw GUIDs instead of names | Layer 3 (manual UX rubric) |
Layers 1 and 2 are automated. Layer 3 is human judgment by design — visual quality is genuinely hard to grade with regex.
The three-layer grading model
Layer 1 — Workflow assertions
Input: workflow-log.md, genpage-plan.md, optionally genpage-edit-plan.md, genpage-entity-creation-log.md (legacy entity-creation-log.md remains supported) and a captured RuntimeTypes.ts. Current synthetic fixtures also supply fixture.json, ordered tool-results.json and the declared JSON/text/source snapshots.
What it checks:
- Prereq commands are recorded (
node --version,pac helpwith version > 2.10.0) pac auth listran and the active env was reportedAskUserQuestionwas used (or new-page intent was inferable from a## Pagessection in the plan)- Plan was presented via
EnterPlanModeand approved - Plan conforms to
references/plan-schema.md(required headings, safe targets and matching Pages-table/per-page File values) ## EnvironmentcontainsSolution:andPublisher Prefix:lines- Solution-selection question runs when (and only when) metadata work is needed
- Auth results belong to their commands; the latest successful applicable gate precedes mutations, final failures halt, and timeout retry/advice is bounded
- Failed connection discovery is not an empty success and cannot authorize setup
- A recorded command is read as text, not as a shell (
lib/evidence-utils.js, "How the graders read a recorded command"). The verb ofapps.js,genpage.jsandsolution-settings.jsis read the way the script reads it —apps.js --env <url> createis acreate, asapps.js create --env <url>is; a switch just before the verb is taken to stand alone, an inference made on purpose (the script's own parser would take the verb as the switch's value) — and EVERY run of a script in a call counts, in its text and in an event'sargv:apps.js list …; apps.js create …is a mutation, so it needs the latest successful auth gate, has a result event of its own, and breaks a refusal. The verbs that write areapps.js create,genpage.js add-to-app | remove-from-app | deleteandsolution-settings.js import(templateonly prints a settings file), beside the upload and the scripts that only write;pac solution import, whichsolution-settings.js importfalls back to, is one too. Limits, by design: a command line handed to a wrapper as one string (bash -c '…',cmd /c "…",pwsh -Command "…",eval) is one quoted word and is not read, a variable, an escape or a line continuation is not followed, and the text of a here-document is read as if it were commands; prose is not told from a command (a log line that names a write after a read is graded as the write);;,&&and|are not told apart, so a write in the same call as its gate is not judged against that gate and the environment compared with the gate is the call's last--env; a phase pattern also still matches its older raw-text form, so a run inside a wrapper's string can still credit a phase; and a listing that is not valid JSON lists nothing as an event's result, while on a log'sResult:line it goes on to the PAC table reader, as before - Current upload commands use
genpage-upload.jswith file transport; the preservation fixture compares exact approved/forwarded text and before/after name, model and binding sets.--app-idis optional for a create — the first page of a new app has none, and no--add-to-sitemap— while a create that names an app includes--add-to-sitemap, and an update names its app and omits it (the update that completes a create that did not finish is the exception).forwardedrecords what the script hands the page backend: a flag an update leaves out forwards nothing, so the page keeps its own name, model and data sources, and a name with a straight", a%or a$(…)is stored exactly - A divergence refusal (
no-base,deployed-changed,deployed-unreadable) stops an update before the page backend writes (ok: false, no write, no forwarded args).--overwrite-deployedneeds theChoice:line that upload command consumes to be exactlyChoice: Overwrite the deployed changes. Eachgenpage-upload.jsline consumes the pending choice, so one approval does not cover a later upload - Custom API discovery/bindings/runtime/update stages agree; optional packaging names every deployed page and preserves failures/read-back evidence When successful downloads are recorded, before-page evidence needs one identifiable producing output directory. Environment/app checks use that producer, not unrelated same-ID downloads elsewhere; unmatched or ambiguous producers refuse preservation rather than guessing a historical source.
- Prefix discipline holds across plan, entity-creation log, and resolved names
- An auth blocker the eval names (
az_not_logged_in,whoami_403) is read from check-auth.js's own result: its advice —az login, oraz login --username <pacUser>when az and pac are different identities — reaches the user verbatim, and nothing provisions, generates or uploads after it - A gate that passes with az and pac signed in as different identities (
ok: true,identitiesMatch: false) is a warning, not a blocker: the orchestrator shows its one-linemessageverbatim, with theaz login --username <pacUser>fix, and goes on to the entity-builder, whose dispatch is read from the recorded calls; a builder re-probe that sees the same mismatch logs a one-line warning in its transaction log (agents/genpage-entity-builder.mdStep 2) - An edit keeps what its plan's Preservation Constraints promise: every identifier a constraint quotes in a code span and the downloaded page (
before/) uses is still used by the edited page (comments do not count). Constraints written only in prose are left to a person - Sample data handed to
provision-entities.jsis realistic: no lorem ipsum, no placeholder word (test,sample,TBD,N/A…) or numbered table name (Project 1), and no table whose rows repeat one name - Per-eval discovery, provisioning, schema and deployment expectations compare structured evidence read by
lib/expectation-evidence.js—list-tables/list-languages/the type generator/upload flags and their recorded results, the plan's entity blocks, the entity-creation transactions, and the choice enums in the capturedRuntimeTypes.ts— on either upload transport. The plugin's own scripts are read as data:scripts/list-tables.js(a table exists whentablesholds its exact logical name;missingnames the terms with none; a failed read confirms nothing),scripts/apps.js list(apps),scripts/genpage.js list(pages, each with itspageIdandname) andscripts/list-languages.js(languages; it is the only source, so a failed read detects nothing and apac model list-languagesafter it is not credited). The type generator isscripts/genpage.js typesand the edit flow's downloadscripts/genpage.js download; a capture made before the scripts records thepac model list-tables,pac model list,pac model list-languages,pac model genpage list | download | generate-typesforms, and those are read too. The new-app expectations (eval 8) require the plugin's order: the first page uploaded with no app and no--add-to-sitemap, thenapps.js create --solution --page-id --publish(which pins the first page's tables itself, so nothing has to follow it), and every upload after it naming the app it returned —pac model createdoes not satisfy them. These recognizers read a script's verb the way the mutation checks do, so a verb after its flags (genpage.js --env <url> types …) counts, and a "types … SKIPPED (mock data)" expectation fails for a run that generated types that way. A listing recorded as the JSON the scripts print — one line, as a parsed result, as text, or as a log'sResult: {…}line — is read as data (id/pageId/appIdandname); JSON that does not parse lists nothing, and only output that is not JSON (a PAC table, a log's bullets) goes to the older table reader - A newly authored plan's records (evals 26 and 27;
references/plan-schema.md"Assumptions, data semantics and lookup metadata"): the written plan in required mode, the approved preview the run saved (fixture.jsonsemantics.approvedPlan) holding the same assumptions, decisions and lookup records field by field, and the run's owngenpage-plan-provenance.js verify --require-assumptionswhosesemanticsHashis the hash of exactly those records. Eval 26 adds the question it answered (semantics.interactions, in order: the planner'sneeds_inputwith several candidates and no default, the maker'sAskUserQuestionanswer handed back to the planner by question id, the plan approval), the user-confirmed assumption both documents keep for it, theget-lookup-metadata.jsread made before approval whose successful answer is the savedlookup-metadata.json(semantics.lookupMetadata) and agrees with every observed lookup record, the lookup typed inRuntimeTypes.tswith exactly its recorded targets, and the Phase 5a gate — a passing--require-observed-lookups --lookup-metadataverification of these records before the page is written. A declared artifact or event that is missing fails rather than skips. These checks prove that a recorded run agrees with itself, not that a person answered or that the answer is what the request meant; older plans without the records are not graded by them
Runner: evals/model-apps/genpage/run-layer-1.js
Library: lib/assertions-layer-1.js (one check function per assertion text)
Layer 2 — Code-quality assertions
Input: every top-level .tsx file in the fixture (excluding RuntimeTypes.ts), plus declared before/after source and lifecycle evidence where applicable.
What it checks (against common_code_assertions in evals.json):
- Single file with
export default GeneratedComponent pageInputis destructured from props (even on mock pages)- Either
./RuntimeTypesimport (Dataverse) or realistic inline mock data makeStylespresence (the existing heuristic does not prove tokens or prohibit every inline style)- No
100vh/100vw/createTheme/mergeThemes/useTheme/<FluentProvider> - No
window.location/react-router/ rawpagetype=URLs Xrm.Navigation.navigateTo(orxrm?.Navigation?.navigateTovia a typed(window as any).Xrmalias) for in-app nav- Unsized Fluent icons only (e.g.,
AddRegular, notAdd24Regular) - Every icon name in
@fluentui/react-iconsimports appears inreferences/verified-icons.txt - A
try/catchmarker for Dataverse awaits (not proof that every await is enclosed) - Whether every failure reaches the page's reporter is not graded yet: no check proves that each DataAPI failure of a page goes through
reportPageErrorinto a renderedPageErrorBarinsidePageErrorBoundary(references/rules.mdCritical Rule 22) - No
TODO/FIXME/...placeholders - Lookup fields use
@OData.Community.Display.V1.FormattedValueannotations <DataGrid>usage importscreateTableColumn+ configurescolumnSizingOptionsorresizableColumns- Every effective navigation target is checked with the production resolver; current before/after snapshots must differ by exact substitutions only, and only affected pages reupload
- The production
pageStructureProblemsgate rejects truncated modules, including unfinished statements after valid exports - A scroll context, with the plugin's own rule (
scripts/lib/page-scroll.js, the onecheck-griffel-styles.jsruns at the /genpage gate): the page's top element is bounded by the host's fixed-height container and scrolls, or holds a bounded scrolling body, with no padded content-box box overhanging the host. The pages captured before the rule (lib/scroll-context.js) report a skip that names the verdict the rule gives them, so the report still shows which captures clip (AB#6793599) - The Custom API lifecycle grades actual saved TSX, method/parameter/bound-record parity, sanitized result handling and preservation versus explicit clear. For a clear of a page that binds
WhoAmIorRetrieveVersion, the grader reads the maker'sClear choice:line recorded right before each upload the clear covers; it does not check that the choice was made before the edit plan was approved, which the skill requires (edit-flow.md, Edit Phase 3).
Whether a page applies a style the maker asked for (a plan whose Styling: line starts with Maker-requested:) is not graded yet.
Plus per-eval expectations for Phase 5, 5a, 5b and 5c. Edit Phase 5 entries remain Layer-1 expectations. The column-name expectations (eval 1's Phase 5b, in both layers, and eval 7's) are graded by lib/column-contract.js against the RuntimeTypes.ts a fixture kept: every column a page names in its dataApi calls — a select list, an orderBy or filter expression, the keys of a createRow/updateRow payload, an options object or select list written as a name it declares, and each <column>@OData.Community.Display.V1.FormattedValue key it reads — must be one the schema declares on that table (or a system column every user-owned table has and the type generator does not write, such as createdon). A fixture that kept no RuntimeTypes.ts reports column-name verification requires RuntimeTypes.ts fixture. Lookup-identity use in page code is not graded yet: no check proves that a page reads, filters, retrieves, opens or writes a lookup only through its normalized table-and-id pair (references/rules.md Critical Rule 23) — eval 26 grades the question, the lookup metadata and the plan records behind its page, not the page's lookup code. Other unregistered expectations are reported as skips, not claimed as coverage. The API request scorer supports literal request objects in named helpers and scalar annotations; it is not a TypeScript compiler or a runtime execution oracle.
Structural page checks: several per-eval expectations are graded from how a page is BUILT rather than whether a word appears in it — eval 4's review step showing every entered field before the submit, and a label on every form field (its own aria-label/aria-labelledby, or a Fluent <Field label> around it); eval 5's components and utilities kept top level (a nested PascalCase component, or a nested function that reads nothing from the one around it, fails; a handler that closes over state does not); eval 12's search box beside a filter toolbar; eval 13's shown text through the translate (or t) helper; and eval 15's choice values named after the RuntimeTypes.ts member they are. lib/tsx-structure.js reads elements, attributes, JSX text and function scopes from the plugin's lexer view, where strings, comments and JSX text are blanked at their offsets, and lib/page-checks.js holds the checks; each states what it does not judge, which stays with the Layer 3 rubric. JSX text and a JSX attribute's string are read as the page renders them: lib/jsx-references.js decodes their character references with the page compiler the plugin vendors, so to eval 13's checks <Text>Hi</Text> is the hardcoded text "Hi" and <Text>€{total}</Text> a hardcoded currency symbol, exactly as when written plainly, while a JavaScript string ({'€'}) shows its references as written. A component's type arguments are read when they are names only, so <DataGridRow<Row> title="€" /> is graded like any tag; a tag whose type arguments are anything else (a function, string, template, object or other type) cannot be read for certain, and every check that reads elements or JSX text fails its page with the tag's line and column rather than pass what it could not see. Eval 4's step navigation ("step state management … and Next/Back navigation") is deliberately not graded: whether Next and Back move the step is the value the step's setter receives — an updater can compute the next step and return the old one — which a scan of the page's text cannot prove; it needs data-flow analysis, and the coverage baseline records it as unscored with that reason.
Bounded Custom API declaration tracking (Layers 1 and 2): Potential-write checks distinguish a definite plain arrow parameter declaration, including a default, from an unrelated outer variable with the same name. Arrow values and callers remain opaque; this does not prove lookup input values or relax receiver/RHS checks. Ambiguous binding patterns retain conservative outer-write possibilities, and actual writes to the selected input still refuse lookup provenance.
Runner: evals/model-apps/genpage/run-layer-2.js
Library: lib/assertions-layer-2.js
Layer 3 — UX rubric (manual)
Input: the deployed page rendered in the browser.
What it checks (against a 5-category, 2-point-each rubric):
| Category | 2 points | 1 point | 0 points |
|---|---|---|---|
| Workflow | All phases ran correctly | Minor deviation | Phase skipped |
| Code | Clean, all rules followed | 1-2 minor violations | JS errors or major rule violations |
| Visual | Polished, good spacing, Fluent tokens | Decent but cramped or inconsistent | Broken layout |
| Data | All fields correct, lookups resolved | Some missing or showing raw IDs | Blank or wrong data |
| Design | Right visual for the data, accessible | Reasonable but suboptimal | Wrong visual type |
Pass criteria: average score ≥ 8.5/10 across pages; no page below 7.
Not automated — visual regression testing is a separate, expensive problem and out of scope for v2.2.
Eval data
All eval definitions live in evals.json alongside this file. The file contains:
common_workflow_assertions: 18 registered workflow checks, each passed or explicitly skipped when inapplicable.common_code_assertions: 22 registered code checks.evals: 27 prompt definitions, each withid,tier,prompt,data, and per-evalexpectations.
The data field specifies scenario assumptions for a manual capture or constructed fixture. The offline harness does not provide responses to AskUserQuestion or verify every recorded answer. The corpus contains 35 fixture directories / 39 top-level TSX files, representing 27 prompt IDs. IDs none have no fixture — every registered prompt is executed.
Enumerating registered and unmatched checks
The assertion modules export four iterable Maps: Layer 1's WORKFLOW_ASSERTIONS and
PHASE_EXPECTATIONS, and Layer 2's ASSERTIONS and PHASE5_EXPECTATIONS. Iterate their
entries to inventory every registered text and callback. Use the matching common Map
for common_workflow_assertions / common_code_assertions.
For per-eval expectations, both runner modules export getExpectationCheck(text),
returning the actual routed callback or undefined. They also export their predicates:
Layer 1 isPhaseExpectation(text) and Layer 2 isPhase5Expectation(text). The scoring
loops use these same functions. A cross-runner contract test can list unmatched entries
without reimplementing the routing expressions (paths below are relative to this directory):
const data = require('./evals.json');
const workflow = require('./run-layer-1.js');
const code = require('./run-layer-2.js');
const unmatched = data.evals.flatMap(({ id, expectations }) =>
expectations
.filter((text) => !workflow.getExpectationCheck(text) && !code.getExpectationCheck(text))
.map((text) => ({ id, text }))
);
A matched callback can still intentionally return SKIP; matching is not proof of an implemented oracle. The Phase-5b routing test also injects a failing result at the real registry entry and requires runner exit 1, proving the callback executes.
The coverage contract
evals/model-apps/tests/eval-coverage-contract.test.js (run by CI with the other eval unit
tests) grades through each runner's exported gradeFixture, so it sees exactly what the runners
report, and fails when:
- a prompt has no fixture and no recorded reason, or a fixture has no prompt;
- an expectation is routed by neither runner (it would be dropped without even a SKIP), or a common assertion has no check;
- an expectation has no check and is not recorded as
deferred(an offline check could grade it) ormanual(a person judges the generated page), with the reason no check grades it yet; - a registered check returns SKIP on every fixture it runs on and is not recorded with its reason;
- the counts and missing prompt IDs this guide and
fixtures/README.mdstate disagree with the registries, or the loader's entity-log name differs from the one the skill writes.
Today's gaps are recorded in evals/model-apps/tests/eval-coverage-baseline.json. Every list in
it is a ratchet: when you capture a missing prompt, add a check or make a placeholder grade, the
contract fails until you remove the entry, so the baseline only shrinks.
Eval tiers
Each eval in evals.json has a tier field for selective execution.
| Tier | Count | When to run | Eval IDs |
|---|---|---|---|
smoke |
5 | Every PR that touches the skill, agents, rules, or evals | 1, 2, 3, 16, 17 |
full |
19 | Nightly or pre-release; covers core workflows | 4, 5, 6, 7, 8, 9, 11, 13, 15, 18–27 |
stress |
3 | With full suite; edge cases (auth blockers, plan revisions, filename collisions) | 10, 12, 14 |
Recommended cadence:
- Smoke tier on every PR (~30 seconds)
- Full + smoke nightly (~2 minutes)
- All three tiers before bumping the plugin version (
v2.x.0release)
Run a single tier:
node run-layer-1.js --tier smoke
node run-layer-2.js --tier smoke
Fixture types
A fixture is a folder under fixtures/<eval-id>-<slug>/ containing the artifacts a /genpage run would produce. The runner doesn't drive /genpage itself — it grades pre-captured outputs.
Synthetic fixtures
Hand-built artifacts for specific contracts, not captured agent runs. The current additions declare provenance: "synthetic", contractVersion: 2 and the public skill/reference sections they exercise. They serve as deterministic positive/rejection/recovery controls. Historical synthetics retain their compatibility contract rather than being advertised as current compliant output.
Pros: deterministic, fast to build, no Dataverse dependency, fully under our control. Cons: can't catch agent drift (the synthetic fixture is what we want the agent to produce, not what it does).
Real captures
Output from real /genpage sessions, captured via scripts/capture-fixture.js. These validate the runner against actual agent behavior.
Pros: catch agent drift, validate that the spec produces the expected output, surface edge cases the synthetic fixtures missed. Cons: require a working Dataverse env + interactive session, slower to produce, can become stale when rules tighten.
Both together
The suite ships both kinds:
| Eval | Synthetic fixture | Real capture |
|---|---|---|
| 1 | 1-account-card-gallery, 1-account-cards-verified-columns (current, keeps its RuntimeTypes.ts) |
— |
| 2 | 2-mock-dashboard |
2-mock-dashboard-real (historical compatibility replay) |
| 4 | 4-case-wizard |
— |
| 5 | — | 5-kanban-task-board (historical compatibility replay) |
| 7 | 7-job-candidates-new-entities, 7-job-candidates-verified-columns (current, keeps its RuntimeTypes.ts) |
— |
| 11 | 11-recruitment-multi-page (historical) |
11-recruitment-pages-real (historical, green) |
| 13 | 13-contact-localization |
— |
| 15 | — | 15-support-tickets-real (historical, green) |
| 17 | 17-weather-mock-data (historical) |
— |
| 18 | 18-sharepoint-connectors (historical) |
— |
| 19 | 19-add-weather-connector (historical edit) |
— |
| 10 | 10-auth-timeout-halt, 10-az-signed-out-halt, 10-whoami-403-halt (current refusals), 10-identity-mismatch-proceeds (current, proceeds past an identity warning) |
— |
| 20 | 20-upload-preservation (current create/edit/refusal) |
— |
| 21 | 21-discovery-failure (current refusal) |
— |
| 22 | 22-navigation-contract (current before/after) |
— |
| 23 | 23-worker-completeness (current rejection/recovery) |
— |
| 24 | 24-custom-api-lifecycle (current create/preserve/clear) |
— |
| 25 | 25-solution-package (current packaging/refusal) |
— |
| 3 | 3-contacts-edit-search-sort (current edit), 3-edit-no-pages-stop (current refusal: the app has no pages) |
— |
| 6 | 6-traffic-analytics-mock (current mock data) |
— |
| 8 | 8-account-metrics-new-app (current new app) |
— |
| 9 | 9-project-tracker-new-entities (current new tables + sample data) |
— |
| 12 | 12-account-plan-revision (current plan revision) |
— |
| 14 | 14-account-list-edit-collision (current filename collision) |
— |
| 16 | 16-account-list (current minimal existing-table page) |
— |
| 26 | 26-customer-lookup (current: an answered account-scope question and the lookup metadata read behind the plan's records; its page normalizes a Customer lookup, which is not graded) |
— |
| 27 | 27-page-error-helper (current: a newly authored plan with its assumptions; its page follows the page error teaching on a cached read, an awaited read and a Custom API Action, which is not graded) |
— |
The mix gives:
- A green baseline to catch runner regressions (synthetics)
- Drift detection against real agent output (real captures)
- Compatibility evidence, not proof that the current skill produces current-compliant captures
Versioned evidence and discrimination
fixtures/contracts.json explicitly labels the 13 existing directories as historical contract 1, without rewriting captured content. Raw PAC transport, legacy navigation spelling and missing transport/read-back artifacts are not certified as current compliant. Contract 2 uses a per-directory fixture.json and tool-results.json: one ordered record per command with its own result, plus artifacts listing the exact files to load. Artifact paths must stay inside the fixture and be plain files.
These contract-2 fixtures exercise the current contracts below:
| Fixture | Evidence/check | Negative control in scorer tests |
|---|---|---|
10-auth-timeout-halt |
One timeout retry, original advice, no provisioning/upload | Failed auth followed by unrelated ok:true; malformed result or wrong environment |
20-upload-preservation |
Wrapper/name/prompt/message files; separate own-name/config snapshots | Inline/rewritten approved text; dropped name/model/bindings; hidden shim/read warnings |
21-discovery-failure |
Unreadable discovery returns needs_input, no setup |
Failed discovery followed by connection/reference creation or upload |
22-navigation-contract |
Actual before/after TSX and deployed ID map | Unknown/optional-call non-GUID target, runtime override, a PAGEREF_ token anywhere but a navigation pageId — a comment included (the build refuses it), a page the checker cannot read for certain (it refuses every token at or after the first guess and every call that reaches it, a resolved id literal there included), collateral edit or extra reupload |
23-worker-completeness |
Failed production gate, fresh regeneration, then upload | Valid export plus unfinished statement, stale/missing write or upload before acceptance |
24-custom-api-lifecycle |
Discovery, bare actions, runtime and config stages | Invented kind/name/parameter, wrong method/bound record, unsafe response or lost bindings |
25-solution-package |
Explicit page IDs, dynamic types, app-first writes and read-back | Omitted page/wrong solution/type/order; invalid ID writes; partial failure reported as success |
26-customer-lookup |
An attended run that asks which opportunities "this account" means (no default) and records the answer as a user-confirmed assumption before approval; lookup records built from the saved get-lookup-metadata.js read and gated with --require-observed-lookups; lookup-rows.json holds synthetic customer values with the state the published normalizer gives each (the page's lookup code is not graded) |
A pre-settled default, a missing or unrecorded answer, an approval before the answer; a metadata read that is not the saved file or comes after approval, incomplete targets, a lookup left planned, a one-target type, a gate after generation |
27-page-error-helper |
A newly authored plan whose records equal the approved preview's, verified with --require-assumptions; its page follows the page error teaching (not graded) |
A plan verified without --require-assumptions or a preview whose assumption differs |
Expected refusals are green only when the recorded refusal contract is satisfied. The refusal fixtures of evals 10 and 21, and 3-edit-no-pages-stop, legitimately contain no generated TSX; Layer 2 grades their failed gate and absence of generation/mutations rather than manufacturing a page. A refusal declares its stage in fixture.json (refusal.stage): auth and discovery stop at a failed check-auth.js or list-connections.js result, and edit-pages at an app whose genpage.js list succeeded with no page to offer — the user is told so and nothing is downloaded, planned or uploaded after the first such listing (a later read does not reset it), and the edit phases that would follow the page choice skip for that run. Fixture 23's rejected snapshot is nested evidence; the top-level page is the accepted regeneration. Expected-failure mutations live in unit tests, never unexplained red corpus directories.
Running the suite
One-shot — all fixtures, both layers
node evals/model-apps/genpage/run-layer-1.js
node evals/model-apps/genpage/run-layer-2.js
Exit codes:
0— every fixture passed1— at least one fixture has a failing assertion2— runner error (missing fixtures dir, bad args, malformedevals.json)
Filter by tier
node run-layer-1.js --tier smoke # 8 stored fixtures, 5 prompt definitions
node run-layer-1.js --tier full # 21 stored fixtures, 19 prompt definitions
node run-layer-1.js --tier stress # 6 stored fixtures, 3 prompt definitions
A tier runs only existing fixtures, not every prompt definition. An empty selection reports
no fixtures matched the filter and exits 2. The stress tier now replays the three synthetic auth
refusals (a timeout, a signed-out Azure CLI and a WhoAmI 403), a run that passes the auth gate with an
identity warning and goes on, the plan-revision trace and the filename-collision trace.
Filter by eval id (debugging)
node run-layer-1.js --eval 11 # only fixtures under eval id 11
node run-layer-2.js --eval 15
Returns matching fixtures regardless of name slug. So --eval 2 runs both 2-mock-dashboard/ and 2-mock-dashboard-real/.
Custom fixture directory
For a side-by-side comparison or trial run:
node run-layer-1.js --fixtures /path/to/alternate/fixtures
Selected by name: a host's retry under --turn-id
genpage-upload.js --turn-id is for a host or script that retries one complete edit after losing its
answer, not for the skill's ordinary flow, so its evidence is outside the default runs and their counts:
node evals/model-apps/genpage/run-stable-turn-retry.js # fixtures/stable-turn-retry
node evals/model-apps/genpage/run-stable-turn-retry.js --fixtures <folder> # another evidence folder
It grades one folder (lib/turn-retry-contract.js): the turn id is kept before the first send and never
added after a lost answer; the retry is the same command with the same bytes from another process,
under the same turn; the turn leaves one page and one history turn; a reuse of the turn for another
request (another binding list) is refused GENPAGE_TURN_ID_REUSED with nothing written and the
page's connection kept; and an ordinary edit passes no --turn-id — in the folder and in every upload
the default corpus records. --eval and --tier are refused (exit 2). The evidence is constructed,
not captured, and nothing is sent to a service.
CI-style summary
The runner emits TAP v13 — pipe through any TAP consumer for nice reporting:
node run-layer-1.js | tap-spec
node run-layer-1.js | tap-summary
For raw counts:
node run-layer-1.js 2>&1 | tail -6
Example summary (counts come from the selected stored corpus):
# tests 530
# pass 267
# fail 0
# skip 263
# fixtures 20 (pass 20, fail 0)
Cadence
When to run which tier:
- Smoke tier: on every PR that touches the skill, agents, or rules reference.
- Full + smoke: nightly, or before merging a significant change.
- Stress tier: with the full suite, or when changing the orchestrator probe logic, filename validation, or plan-mode handling.
- All tiers: before bumping the plugin version (any 2.x.0 release).
These runners grade artifacts a run already produced; none of them can see whether a prompt reached /genpage in the first place. That is graded by the agent-in-the-loop routing eval (evals/model-apps/routing/, see its EVAL_GUIDE.md), which runs on a PR labelled run-agent-evals, weekly, and on demand — label any PR that edits the skill's description:.
Quick start
Example using eval id 1 (account gallery) — manual fixture capture if you don't have one yet:
- Open Claude Code with the
model-appsplugin loaded. - Send:
/genpage Build a page showing Account records as a gallery of cards. Include name, website, email, phone number. Make the gallery scrollable and each card clickable to open the Account record.
- As the planner asks questions, answer per the eval's
data.question_answersfield. - When the planner enters plan mode, approve it (or reject per the stress eval's
plan_revision_scenario). - Save the generated
workflow-log.md,genpage-plan.md, and the produced.tsxfiles into a newfixtures/1-<slug>/folder. Usescripts/capture-fixture.jsfor this — it skips Phase 0.5 scaffolding automatically. - Layer 1 check:
node run-layer-1.js --eval 1grades the workflow-log + plan. - Layer 2 check:
node run-layer-2.js --eval 1grades the.tsx. - Layer 3 check: Open the deployed page in the browser and score it against the UX rubric (manual).
Reading runner output
The runners emit TAP v13. Each fixture is a subtest; each assertion is one ok / not ok line. The following is illustrative failure output, not the current corpus result.
TAP version 13
1..2
# Subtest: 1-account-card-gallery
ok 1 - Generated .tsx is a single file with `export default GeneratedComponent`
ok 2 - Generated .tsx destructures props including `pageInput`
ok 3 - Generated .tsx imports types from `./RuntimeTypes` ...
...
1..21
ok 1 - 1-account-card-gallery
# Subtest: 11-recruitment-pages-real
...
not ok 18 - For Dataverse list/detail pages, the inline IIFE + window cache pattern is used
---
reason: "candidate-list.tsx: missing window cache or uses useCallback for fetch"
...
not ok 2 - 11-recruitment-pages-real
...
# tests 42
# pass 39
# fail 1
# skip 2
# fixtures 2 (pass 1, fail 1)
Read this output as:
- Top of each subtest:
# Subtest: <fixture-folder-name>— which fixture is being graded. - Per-assertion line:
ok N - <assertion text>(pass) ornot ok N - <assertion text>(fail) orok N - <text> # SKIP <reason>(not applicable). - YAML block under
not ok: thereasonfield names the offending file and what specifically violated the assertion. - Aggregate:
ok N - <fixture-name>(at least one assertion graded, and none failed),ok N - <fixture-name> # SKIP no expectation graded(unscored: every assertion skipped, or there was none — nothing was graded, so it is not a pass) ornot ok N - <fixture-name>(at least one fail). - Final summary:
# tests <N>/# pass <N>/# fail <N>/# skip <N>/# fixtures <N> (pass X, fail Y), then# unscored fixtures <U>only when U > 0. An unscored fixture is in neither X nor Y, so X + Y + U = N. The app-builder runner shares this reporter and prints the same lines.
Skipped vs failed:
# SKIP <reason>— the assertion doesn't apply (e.g., "no Dataverse files in this fixture" for a mock-data assertion), or a registered check cannot grade the stored evidence yet (e.g., "column-name verification requires RuntimeTypes.ts fixture"). Does not fail the fixture — but a fixture whose every assertion skips is unscored, not passed.not ok— actual failure. Fixture fails. Exit code becomes 1. An unscored fixture does not change the exit code.
Three common skip reasons in our suite:
no Dataverse files / no <feature> detected— the fixture doesn't exercise this code pathnot graded yet/requires RuntimeTypes.ts fixture— a check that cannot grade the stored evidence: a correct check would fail a historical fixture's real drift, or the capture did not keep what the check reads.evals/model-apps/tests/eval-coverage-baseline.jsonrecords the reason for eachno check registered for this expectation— the assertion text inevals.jsondoesn't have a corresponding check in the runner library. Either add the check or accept the skip as documentation-only.
Custom API support has no feature flag, so no rule grades a custom-api gate: a probe of that removed flag, recorded by an older run, is neither required nor refused, and a run that never probes it is not failed for it.
Manual grep patterns
For ad-hoc verification or assertions the Layer 2 runner currently skips, grep the source directly. Useful when you don't have a fixture yet or want to spot-check a single file before capturing.
| Assertion | Grep pattern |
|---|---|
| Single file + default export | ^export default GeneratedComponent |
Destructures pageInput |
const.*\{.*pageInput.*\}.*=.*props |
Uses makeStyles |
makeStyles |
No 100vh/100vw |
grep -E '100v[hw]' should return nothing |
| No forbidden theme functions | grep -E '(createTheme|mergeThemes|useTheme)' should return nothing |
No <FluentProvider> wrapper |
grep '<FluentProvider' should return nothing (except in Dark Mode Toggle pattern) |
| No raw URL navigation | grep -E '(window\.location|href=.*pagetype=)' should return nothing |
Xrm.Navigation.navigateTo |
If navigation is used, must appear (literal or via xrm?.Navigation?.navigateTo alias) |
| Unsized icons | grep -E '\w+(16|20|24|28|32)(Regular|Filled)\b' should return nothing |
| try-catch on dataApi | Each await dataApi\. must be inside a try block |
| No placeholders | node plugins/model-apps/scripts/genpage-worker-output.js --file <page>.tsx — its elision check is the Layer 2 rule. A bare grep -E '(TODO|FIXME|\.\.\.)' over-matches spreads, 'TODO' status values and "Loading…" |
| FormattedValue for lookups | Any _xxx_value in a select must be paired with a FormattedValue access |
createTableColumn import |
If <DataGrid> is used, must import createTableColumn |
Pass / fail summary
An eval run passes when:
- Layer 1: no executed workflow assertion fails
- Layer 2: no executed code/lifecycle assertion fails (or the declared source-free refusal is verified)
- Layer 3: average UX score ≥ 8.5, no page below 7
An offline replay fails if any executed assertion fails. Skips are visible but do not fail the run: they can be inapplicable, manual/AST-dependent or unregistered. Green therefore does not imply complete prompt coverage, a TypeScript build, React execution, live upload/download, or a browser/UX result.
Diagnosing failures
When the runner reports a not ok, file the issue against the agent that owns the concern:
| Failure type | Likely owner |
|---|---|
| Missed agent invocation, wrong phase order | Orchestrator (SKILL.md) |
| Plan document missing sections or wrong structure | genpage-planner.md or plan-schema.md |
| Entity created in wrong order or missing columns | genpage-entity-builder.md |
Generated code violates a common_code_assertion |
genpage-page-builder.md or rules.md |
| Edit modified the wrong thing or broke existing behavior | genpage-edit-planner.md or orchestrator edit flow |
Use the failure's reason field (in the TAP YAML block) to find the offending file and pattern; cross-reference with the agent file to identify which rule the agent diverged from.
Capturing real fixtures
Use scripts/capture-fixture.js. The helper copies the right files (excluding local-dev scaffolding) and immediately runs both layers against the result.
Steps
Run
/genpagemanually with the plugin loaded. Use the eval's prompt and role-play itsdata.question_answers; offline runners do not emit or supply those answers.After completion, run the capture script:
node plugins/model-apps/scripts/capture-fixture.js \ --working-dir <path-to-/genpage-working-dir> \ --eval <id> \ --slug <kebab-slug>Inspect the JSON summary the script prints. Each layer reports its counts, the runner's
exitCodeand afailureslist. Iflayer1.failuresandlayer2.failuresare both empty, the fixture is good to commit. A runner that exits with an error but reports no failing assertion, or reports no assertions at all, is listed as a failure too: nothing was verified, even though the process itself exits 0. If there are failures, decide:- Real agent drift → file an issue or tighten the spec (don't doctor the fixture)
- Runner false positive → relax the assertion regex to accept the functionally-equivalent alternative pattern
- Historical contract → label/version the evidence and capture a new directory under a fresh slug, rather than rewriting an old transcript
What the script copies (allowlist)
*.tsx(each page produced)*.md(workflow-log, genpage-plan, genpage-entity-creation-log, genpage-edit-plan)RuntimeTypes.ts
What it skips (denylist)
package.jsonandgenpage.d.ts— Phase 0.5 local-dev scaffolding, not agent outputnode_modules/,dist/,build/,.cache/,.tmp/,.next/*.log,.DS_Store,Thumbs.db
Flags
| Flag | Purpose |
|---|---|
--force |
Overwrite an existing fixture with the same slug |
--skip-verify |
Capture without running the layers (rare; use when you just want to inspect the artifacts) |
Prefer a fresh slug for historical captures; do not use --force to make old evidence resemble today's workflow. The capture helper's allowlist does not collect the new JSON/text transport and lifecycle evidence. Constructed contract-2 fixtures explicitly package those snapshots and associated results themselves.
Adding a new eval
When the skill grows a new capability (new sample pattern, new agent flow, etc.), add an eval to cover it.
Append a new entry to the
evalsarray inevals.json:{ "id": <next-available>, "tier": "smoke" | "full" | "stress", "prompt": "<exact /genpage prompt>", "data": { "question_answers": { "new_or_edit": "...", "data_source": "...", ... }, "app_selection": "...", "sample_data_response": "..." // if applicable }, "expectations": [ "Phase 1 (Planner): <eval-specific check>", "Phase 5 (Page Builder): <code-quality check>", ... ] }Pick a tier:
smokeif it covers a major shape and is fast (no entity creation)fullif it covers a core scenario but has setup cost (entity creation, new app)stressif it's an edge case (auth blocker, plan revision, collision)
Write
expectationsas exact-text assertions starting withPhase(the runner matches by exact string against checks inassertions-layer-1.js/assertions-layer-2.js).Build at least one fixture under
fixtures/<eval-id>-<slug>/. Synthetic is fine to start; capture a real one when you can.Run both runners:
node run-layer-1.js --eval <id> node run-layer-2.js --eval <id>Register any unregistered assertion texts. If you see
# SKIP no check registered for this expectation, decide:- If the text is checkable → add the function to
assertions-layer-{1,2}.js - If it's subjective → leave skipped and rely on Layer 3 (manual)
- If the text is checkable → add the function to
Adding a new assertion
When a new rule is added to rules.md or a new phase requirement lands in SKILL.md:
Add the assertion text to
common_code_assertions(Layer 2) orcommon_workflow_assertions(Layer 1) inevals.json. Use natural language; this is the human-readable rule statement.Register a check function in
lib/assertions-layer-1.jsorlib/assertions-layer-2.js:ASSERTIONS.set( 'Your exact assertion text from evals.json', ({ files, eval: ev, fixture }) => { // Inspect files / workflow-log / plan // Return { status: 'pass' | 'fail' | 'skip', reason: '...' } const offender = files.find((f) => /forbidden-pattern/.test(stripComments(f.content))); return offender ? { status: 'fail', reason: `${offender.name}: contains forbidden-pattern` } : { status: 'pass', reason: '' }; } );Use the right relaxations. The runner accepts functionally-equivalent alternatives — e.g.,
xrm?.Navigation?.navigateToandxrm.Navigation.navigateToboth pass the Xrm.Navigation check because they call the same API. When you find a real agent output that uses a valid alternative pattern, relax the regex; don't tighten the spec to forbid the alternative.Add unit tests in
tests/assertions-layer-{1,2}.test.jscovering pass / fail / skip cases.Add a versioned synthetic fixture for a new contract, or rely on existing evidence when it genuinely covers it. Do not alter captured directories. Include a positive control and a negative mutation proving the scorer rejects the precise regression.
Run the full test + runner sweep:
node --test plugins/model-apps/scripts/tests/*.test.js evals/model-apps/genpage/tests/*.test.js node evals/model-apps/genpage/run-layer-1.js node evals/model-apps/genpage/run-layer-2.js
Expected refusals and corpus gating
Currently red: none. Every fixture — synthetic and real capture alike — is green under both
runners, and CI runs both runners on every PR that touches evals/model-apps/**
(.github/workflows/model-apps-script-tests.yml, job test-model-apps-evals, on ubuntu, windows and
macos with Node 20 and 22).
Aggregate state for CI gating: every stored fixture must pass. Expected rejection is an explicit outcome with associated failed-gate/no-mutation evidence, not an excuse for a red fixture. Put bad inputs and ignored-failure mutations in scorer unit tests. Historical captures use their labelled compatibility contract; newer requirements need new evidence rather than rewritten history or a broader skip. CI green covers these replays and units, not unrepresented prompts or live behavior.