@wildo-ai/framework-knowledge 1.1.13 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/claude-marketplace/.claude-plugin/marketplace.json +1 -1
- package/dist/claude-marketplace/plugins/wildo/.claude-plugin/plugin.json +1 -1
- package/dist/claude-marketplace/plugins/wildo/references/composites-and-the-loop.md +12 -4
- package/dist/claude-marketplace/plugins/wildo/skills/build/SKILL.md +4 -0
- package/dist/esm/framework-knowledge.definitions.d.ts +1 -1
- package/dist/esm/framework-knowledge.definitions.d.ts.map +1 -1
- package/dist/esm/framework-knowledge.definitions.js +9 -0
- package/dist/esm/framework-knowledge.definitions.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.d.ts +1 -1
- package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.js +1 -1
- package/dist/esm/playbooks/bottom_up.assemble-verify/playbook.definition.js.map +1 -1
- package/dist/esm/playbooks/bottom_up.integration-plan/playbook.definition.d.ts +1 -1
- package/dist/esm/playbooks/bottom_up.integration-plan/playbook.definition.js +1 -1
- package/dist/esm/playbooks/bottom_up.integration-plan/playbook.definition.js.map +1 -1
- package/dist/knowledge/assurance-authority-bases/wildo-safe-baseline-v1/authority-basis.json +1 -1
- package/dist/knowledge/assurance-authority-bases/wildo-safe-baseline-v1/external-framework-mapping.json +1 -1
- package/dist/knowledge/manifest.json +7 -7
- package/dist/knowledge/playbooks/bottom_up.assemble-verify/method.md +7 -0
- package/dist/knowledge/playbooks/bottom_up.assemble-verify/playbook.json +2 -2
- package/dist/knowledge/playbooks/bottom_up.build-decompose/method.md +27 -10
- package/dist/knowledge/playbooks/bottom_up.build-decompose/playbook.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/method.md +13 -9
- package/dist/knowledge/playbooks/bottom_up.build-dispatch/playbook.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.foundation/method.md +6 -0
- package/dist/knowledge/playbooks/bottom_up.foundation/playbook.json +1 -1
- package/dist/knowledge/playbooks/bottom_up.integration-plan/method.md +20 -5
- package/dist/knowledge/playbooks/bottom_up.integration-plan/playbook.json +2 -2
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/method.md +15 -2
- package/dist/knowledge/playbooks/refinement.compliance-document-candidate/playbook.json +1 -1
- package/dist/knowledge/references/build-plan.task-graph.config.md +12 -8
- package/dist/knowledge/references/engine.client-bundle.allow-list.md +6 -0
- package/dist/knowledge/references/example.backend.addon-wiring.module.md +5 -1
- package/dist/knowledge/references/example.backend.custom-operation.declared-refusal-code.md +6 -0
- package/dist/knowledge/references/example.config.navigation.full.md +14 -0
- package/dist/knowledge/references/example.flows-actors.autonomous-agent.reviewed-write.md +6 -2
- package/dist/knowledge/references/example.flows-actors.chat-assistant.md +13 -2
- package/dist/knowledge/references/example.inbound.email-to-todo.md +33 -2
- package/dist/knowledge/references/example.module.relationships.discriminator.md +7 -1
- package/dist/knowledge/references/example.resource.status-lifecycle.quote.md +1 -1
- package/dist/knowledge/references/example.resource.ui-behavior.operation-icon.md +8 -2
- package/dist/knowledge/references/external-connectors.frontend-provider-consent-classification.md +2 -0
- package/dist/knowledge/references/integration-plan.config.md +78 -8
- package/dist/knowledge/references/platform.config.environment.deployment.md +84 -5
- package/dist/knowledge/references/saas.backend.custom-operation.hook-transaction-posture.md +12 -1
- package/dist/knowledge/references/saas.backend.domain-module.md +15 -0
- package/dist/knowledge/references/saas.backend.flows-actors.a2a-agent-card.md +43 -11
- package/dist/knowledge/references/saas.backend.flows-actors.a2a-task-surface.md +17 -11
- package/dist/knowledge/references/saas.backend.flows-actors.function-tool.md +11 -0
- package/dist/knowledge/references/saas.backend.system-access-service.md +30 -1
- package/dist/knowledge/references/saas.frontend.app-shell.shell-motion-contract.md +30 -0
- package/dist/knowledge/references/saas.frontend.electronic-signatures.embedded-signing-frame.md +46 -0
- package/dist/knowledge/references/saas.models.flows-actors.agent-definition.md +24 -33
- package/dist/knowledge/references/saas.models.flows-actors.mcp-server-declaration.md +63 -0
- package/dist/knowledge/references/saas.models.flows-actors.outbound-credential.md +61 -0
- package/dist/knowledge/references/saas.models.flows-actors.remote-agent-declaration.md +56 -0
- package/dist/knowledge/references/saas.models.frontend-provider-public-config-contract.md +6 -0
- package/dist/knowledge/references/saas.models.http-api-binding.md +51 -0
- package/dist/knowledge/references/saas.models.privacy.data-residency.md +188 -31
- package/dist/knowledge/references/saas.models.privacy.provider-capability-disclosure.md +7 -0
- package/dist/knowledge/references/saas.models.provider-capabilities.md +11 -0
- package/dist/knowledge/references/saas.models.providers.compliance-choice.md +9 -0
- package/dist/knowledge/references/saas.models.resource-config.operation-condition-parameters.md +8 -1
- package/dist/knowledge/references/saas.models.system-of-record-error-codes.md +30 -0
- package/dist/knowledge/references/saas.rag.retrieval-scores.md +4 -2
- package/dist/knowledge/references/saas.specifications.processor-register.md +10 -0
- package/dist/knowledge/registries/assurance-authority-bases.json +1 -1
- package/dist/knowledge/registries/framework-topics.json +45 -1
- package/dist/knowledge/registries/playbooks.json +2 -2
- package/dist/knowledge/registries/source-tags.json +1175 -1107
- package/dist/knowledge/skills/INDEX.md +2 -2
- package/dist/knowledge/skills/backend-addon-wiring/SKILL.md +9 -2
- package/dist/knowledge/skills/backend-addon-wiring/references/framework-backend-bootstrap-api.md +15 -0
- package/dist/knowledge/skills/backend-custom-operation/SKILL.md +3 -1
- package/dist/knowledge/skills/backend-custom-operation/references/declared-refusal-codes.md +28 -1
- package/dist/knowledge/skills/backend-custom-operation/references/framework-hook-transaction-posture-api.md +21 -1
- package/dist/knowledge/skills/compliance-document-authoring/references/document-composition-privacy-notice.md +15 -2
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-processor-register-authoring.md +16 -0
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-provider-compliance-choice-api.md +197 -31
- package/dist/knowledge/skills/compliance-document-authoring/references/framework-recipient-disclosures.md +7 -0
- package/dist/knowledge/skills/config-app-shell/references/framework-shell-layout-api.md +30 -0
- package/dist/knowledge/skills/config-navigation/SKILL.md +14 -0
- package/dist/knowledge/skills/config-saas/references/compliance-declarations.md +19 -0
- package/dist/knowledge/skills/config-saas/references/framework-auditable-event-catalog.md +1 -0
- package/dist/knowledge/skills/config-saas/references/framework-key-management-api.md +15 -1
- package/dist/knowledge/skills/config-saas/references/framework-provider-capabilities-api.md +11 -0
- package/dist/knowledge/skills/electronic-signature-deliverables/SKILL.md +12 -5
- package/dist/knowledge/skills/electronic-signature-deliverables/references/signing-inside-the-application.md +113 -0
- package/dist/knowledge/skills/email-add-template/SKILL.md +3 -2
- package/dist/knowledge/skills/email-add-template/references/email-artifact-paths.md +8 -4
- package/dist/knowledge/skills/email-definition-wiring/SKILL.md +1 -1
- package/dist/knowledge/skills/flows-actors-a2a-exposure/SKILL.md +29 -7
- package/dist/knowledge/skills/flows-actors-a2a-exposure/references/framework-flows-actors-a2a-contract.md +66 -26
- package/dist/knowledge/skills/flows-actors-autonomous-agents/SKILL.md +6 -2
- package/dist/knowledge/skills/flows-actors-chat-assistant/SKILL.md +34 -3
- package/dist/knowledge/skills/flows-actors-chat-assistant/examples/todo-assistant.example.md +13 -2
- package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-flows-actors-tool-api.md +11 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-flows-actors-view-api.md +15 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-mcp-server-declaration-api.md +139 -0
- package/dist/knowledge/skills/flows-actors-chat-assistant/references/framework-remote-a2a-agent-declaration-api.md +169 -0
- package/dist/knowledge/skills/flows-actors-llm-agent-invocation/references/framework-llm-agent-definition-api.md +24 -33
- package/dist/knowledge/skills/inbound-channels/references/receiving-email.md +33 -2
- package/dist/knowledge/skills/infra-environment-config/SKILL.md +39 -13
- package/dist/knowledge/skills/infra-environment-config/references/framework-environment-deployment-api.md +84 -5
- package/dist/knowledge/skills/layout-2d-adoption/references/framework-shell-motion-api.md +30 -0
- package/dist/knowledge/skills/local-environment-bootstrap/references/wildo-cli-bootstrap-commands.md +26 -0
- package/dist/knowledge/skills/module-registration/references/framework-domain-modules-api.md +15 -0
- package/dist/knowledge/skills/module-relationships/SKILL.md +20 -1
- package/dist/knowledge/skills/provider-backend-package/SKILL.md +13 -2
- package/dist/knowledge/skills/provider-frontend-file-picker/references/framework-frontend-provider-consent-api.md +2 -0
- package/dist/knowledge/skills/provider-frontend-file-picker/references/framework-frontend-public-config-api.md +6 -0
- package/dist/knowledge/skills/provider-frontend-module/SKILL.md +3 -0
- package/dist/knowledge/skills/provider-frontend-module/references/package-frontend-facets.md +4 -1
- package/dist/knowledge/skills/resource-add-module/SKILL.md +8 -2
- package/dist/knowledge/skills/resource-add-module/references/module-scaffold-layout.md +17 -0
- package/dist/knowledge/skills/resource-chat-commands/SKILL.md +1 -1
- package/dist/knowledge/skills/resource-config-wiring/SKILL.md +6 -2
- package/dist/knowledge/skills/resource-config-wiring/references/framework-operation-audit-api.md +4 -3
- package/dist/knowledge/skills/resource-config-wiring/references/framework-system-access-reads-api.md +30 -1
- package/dist/knowledge/skills/resource-external-data/references/framework-http-api-binding-api.md +51 -0
- package/dist/knowledge/skills/resource-external-data/references/incremental-extraction.md +14 -5
- package/dist/knowledge/skills/resource-external-data/references/read-through-writes.md +30 -0
- package/dist/knowledge/skills/resource-mcp-tool-exposure/references/mcp-client-registration-postures.md +5 -0
- package/dist/knowledge/skills/resource-rag-source-fields/references/framework-rag-retrieval-api.md +4 -2
- package/dist/knowledge/skills/resource-status-lifecycle/SKILL.md +3 -2
- package/dist/knowledge/skills/resource-status-lifecycle/references/framework-operation-condition-parameters-api.md +8 -1
- package/dist/knowledge/skills/resource-status-lifecycle/references/quote-lifecycle-worked-example.md +3 -3
- package/dist/knowledge/skills/resource-ui-behavior/SKILL.md +8 -2
- package/dist/knowledge/skills/views-chart-authoring/SKILL.md +5 -1
- package/dist/knowledge/skills/website-bundle-discipline/SKILL.md +6 -0
- package/dist/knowledge/skills/website-bundle-discipline/references/website-bundle-rules.md +6 -0
- package/dist/knowledge/topic-index.json +326 -179
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
],
|
|
113
113
|
"stepOutputs": [],
|
|
114
114
|
"method": {
|
|
115
|
-
"guidance": "# Build Decompose — Domain Plan → Ordered Coding-Agent Task Graph \n\n### Target Application Framing\n\nThis knowledge is for configuring behavior in the target application.\nWildo is the framework surface being used, not the product being built.\n\nRead and apply these patterns from the application-developer point of view:\n\n- how the application should configure the relevant app-level file\n- how the application should use framework-provided factories, enums, and helpers\n- how the application should avoid mixing frontend, backend, and infrastructure concerns\n\n\nThe output follows the existing `BuildPlanTaskGraph` contract. The host checks its\nshape and graph consistency, then uses `prerequisiteTaskRefs` to determine readiness.\nFunctional topics organize context; they do not create scheduling edges. Decompose\nthe work using the current contracts rather than designing a replacement planner.\n\n## Where you are in the journey\n\nThis is the **first build-execution playbook** — the pivot from **planning the\ndomain** (the domain-plan: modules, per-module resource inventory, relationship\nintents) to **decomposing the build** (the ordered set of buildable tasks). It runs\nin the **bottom-up phase**, after the domain plan exists (`artifact_exists\ndomain-plan`). You are not re-opening domain questions here — you are turning an\n*approved* domain plan into the *ordered work that builds it*.\n\nDownstream of this playbook, two further playbooks consume your output: the\n**dispatch-orchestration** playbook dispatches the tasks through the coding-agent\ncontract in parallel waves (up to the application's build parallelism at once), and the\n**scale** playbook describes how those waves are scheduled, interleaved with the\ncompanion generation steps, and reconciled. **You author neither of those concerns** — see the\nboundary section below.\n\n## What this playbook does\n\nYou are the **build planner**. This playbook reads the approved domain plan and the\ndefinition set and drafts the **build plan**: the answer to *\"what ordered sequence\nof coding-agent tasks turns this domain plan into a running app?\"* You produce **one\nartifact**: the **build-plan** family — an **ordered task graph**, each task bound\nonto the **7-topic functional taxonomy** and the **app-knowledge skill catalog**.\n\nThis is a **decomposition pass**. You name tasks, their target, **what each one\nproduces**, their topic, their skill(s), and their ordering intent. You do **not** dispatch any task, capture any\nchange-set, author any schema, or generate any code — that is the job of the\ndownstream dispatch / scale playbooks and the coding agents they run.\n\n## Read state first — what you read, the one artifact you write\n\nThis playbook is **idempotent** and, on a re-run, a *refinement*. Before decomposing\nanything:\n\n1. Read the current journey state and scope from what this run is given — the loaded\n specifications and the workspace sections of your brief — and do not re-derive it. Confirm the domain plan is present and\n approved, and check whether a `build-plan` already exists from an earlier run\n (refine it, do not re-author — see below).\n2. Read the approved domain plan and the definition set. **Load-bearing** (these drive\n the decomposition): the **domain-plan** (`domain-plan` — the module decomposition +\n each module's `mainResources` / `supportingResources` inventory) and the\n **relationship drafts** (inside the domain-plan value — the inter-resource relationship\n intents, each with two ends + cardinality intent + ownership direction).\n **Contextual** (they shape ordering and task briefs, not the core decomposition):\n the **roadmap** (`roadmap` — the release phasing, so MVP-critical modules are\n sequenced before later ones) and the **requirements** + **feature-drafts** (the\n prose contracts each task's brief points the coding agent at).\n\n(Both are already in your brief: the domain plan renders under \"# Accepted application truth\", and\nthe real module/resource state arrives as the declared `workspace_truth` context section of your brief. There is no command to\nrun in this mode.)\n\nYou **read** `domain-plan` (incl. its relationship drafts) + `roadmap` + `requirements` +\n`feature-drafts`, and the **business model** for its pricing plans (the billing catalogue, Step 3);\nyou **write** the `build-plan` family.\n\n3. Read the **current application workspace** section supplied with this brief (the real\n module ids and each resource's present schema fields). It is BINDING, in both directions:\n - Every task's `moduleRef` MUST be one of the listed module ids, exactly — a module id\n the workspace does not carry is an invented address the dispatcher cannot route.\n - A resource the workspace already lists exists as a **compose-born starter skeleton**\n (registered, typechecking, carrying the fields shown). Its stage tasks are\n **enrichment** tasks: their objective states what domain content to ADD or CHANGE.\n An objective that asks to \"create\" or \"scaffold\" such a resource describes work that\n is already done, and the dispatched coding run will correctly change nothing.\n\n## Every task declares WHAT IT PRODUCES\n\nEach task carries `produces`: the artifacts the finished application will contain\n*because this task ran*. It is how the host answers **\"has this task landed?\"**, and\nit is not optional thinking: without declared products the host cannot probe the\nintended result. A COMPLETED durable run lets the loop advance, but the task remains\nexplicitly marked in `unverifiableLandedTaskRefs` as ran, not proven.\n\n**`target` and `produces` answer different questions, and a task needs both.**\n`target` is the WRITE SCOPE — which module tree this run may edit. Several tasks\nlegitimately share one. `produces` is the PRODUCT IDENTITY — what this task, and no\nother, is accountable for. Wonder CRM's plan proved they cannot be the same field:\nits pipeline-view task and its follow-through-operation task carry byte-identical\ntargets, so nothing derived from `target` could ever tell them apart, and 40 of its\n42 tasks were reported finished while none had run.\n\n**The one rule that makes a product real: name something the SCAFFOLD does not\nalready contain.** Every module, every resource file and every resource\nspecification is written by composition before any task exists. So \"the resource\nconfig file\" is not a product — it was there on day one. The VERBS it gains are.\nApply that test to every product you write.\n\n| product | you name | use it for |\n|---|---|---|\n| `RESOURCE_SCHEMA_FIELDS` | `resourceRef` + the `fieldRefs` the task adds | a schema stage. The FIELDS, never the file — the file is scaffolded. A `fieldRef` is the field's own IDENTIFIER as it will stand in the schema (`slug`, `archivedAt`, `completedAt`), never a description of what the fields express |\n| `RESOURCE_REGISTRATION` | `resourceRef` + the `operationRefs` it gains | a config stage |\n| `RESOURCE_UI_BEHAVIOR` | `resourceRef` | a ui-behavior stage — the one artifact composition never writes |\n| `RESOURCE_SPECIFICATION` | `resourceRef` + the `fieldRefs` it documents | a spec stage. The fields again: the spec file is scaffolded too |\n\n**A product ref is an ARTIFACT IDENTITY, not a concept.** Every `produces` entry is read back by a\nLANDING PROBE that searches the application's own source for that ref — in its plain, camelCase,\nPascalCase and SCREAMING_SNAKE spellings — and a task lands only when the probe finds it. So a ref\nnaming something that will never appear in the tree makes the task permanently unlandable, however\ncorrectly it is built.\n\nMeasured on the first end-to-end journey run (#1273): all sixteen schema tasks declared refs like\n`private-workspace-shape`, `membership-access-shape` and `one-sentence-rationale-shape` — eighteen\nrefs, not one of them a field. The schemas were authored correctly and committed; every task stayed\nunlanded, the loop guard then refused the whole band at task one, and the board read 9 of 94 while\nthe work was being done.\n\nName what a reader will find in the file. `slug`, `description`, `archivedAt` — not the idea they\nserve together. If you cannot name the fields yet, the task is not decomposed far enough to declare a\nproduct, and `TASK_DECLARES_NO_PRODUCT` is the honest answer rather than a placeholder concept.\n| `RESOURCE_RELATIONSHIP` | `relationshipRef` + `sourceResourceRef` + `targetResourceRef` | a relationship-wiring task. Both endpoints, because the scaffold already declares each resource's own edges |\n| `RESOURCE_OPERATION` | `resourceRef` + `operationRef` | a custom operation |\n| `APPLICATION_VIEW` | `viewRef` | an app-level view. With an experience plan, the `viewRef` is the plan's own (`view-…`), verbatim |\n| `APPLICATION_DOCUMENT` | `documentRef` | a governed document the engine catalog DEFINES — see the closed list below. Never a document you name yourself |\n| `APPLICATION_MODULE` | `moduleRef` | an ensure-module task. The REGISTRY entry, not the directory |\n| `APPLICATION_FRONTEND_CONFIG` | `configSurface` + the `declarationRefs` the file gains | composing ONE app-wide config file — `NAVIGATION`, `DESIGN_SYSTEM`, `APP_SHELL`, `GLOBAL_VIEWS`, `SHELL_LAYOUT`. The DECLARATIONS (a sidebar section ref, a zone, a token, the one layout constant), never the file: `wildo init` writes every one of them |\n| `RESOURCE_COMPOSITE_VIEW` | `resourceRef` + `viewRef` | a composite view of one resource, bound in its ui-behavior's `compositeViews`. The plan's `viewRef`, verbatim |\n| `RESOURCE_CUSTOM_VIEW` | `resourceRef` + `viewRef` | a custom operation view or an execution view of one resource, bound in its ui-behavior. The plan's `viewRef`, verbatim — it is how the dispatch tells an execution view from a custom one |\n| `RESOURCE_CHART_VIEW` | `resourceRef` + `chartRef` | a chart view declared under the resource's `chartViews` |\n| `CUSTOM_COMPONENT` | `componentRef` | a custom frontend component, registered on the module's frontend index or in the engine registrations |\n| `APPLICATION_MILESTONE` | `milestoneRef` | a milestone the module declares — the experience plan's identifier, as a slug |\n| `APPLICATION_GUIDANCE` | `guidanceKind` + `guidanceRef` | an onboarding document or guidance flow the module declares — the experience plan's `kind` and ref |\n| `PDF_TEMPLATE` | `resourceRef` + `templateRef` | a PDF template BOUND to a resource's generated-file field (`generatedSummaryPdf`) |\n| `APPLICATION_WORKER` | `workerRef` + the `jobRefs` its entry file declares | a worker's behaviour. The JOBS, not the package: `add-worker-node` / `add-worker-rust` write the package |\n| `APPLICATION_MINION` | `minionRef` + the `behaviorRefs` its entry file declares | a minion's tick behaviour. Same rule: `add-minion` writes the package |\n| `PROVIDER_BINDING` | `providerRef` + `scope` (`BACKEND`, `COMPANION`, `FRONTEND_APP`, `WEBSITE`), + `augments` when the binding has it | one provider declared in one runtime owner's scope — the SaaS config block, or the service's `provider-contributions.ts`. With `augments`, the module's opt-in under `providers.augmentations.<augments>` instead |\n| `WEBSITE_PAGE` | `pageRef` | a marketing page, registered in `website-root.config.ts` by its manifest |\n| `WEBSITE_SECTION` | `pageRef` + `sectionRef` | one section of one page, declared in `<pageRef>.sections.tsx` |\n| `DOCUMENTATION_CHAPTER` | `chapterRef` | the chapter's authored body, in its own file `specifications/src/technical-documentation/chapters/<chapterRef>.ts`, which `wildo docs publish` joins to the documentation plan and publishes under `/guides/<slug>` |\n| `APPLICATION_BILLING_PRODUCT` | `productKey` | one product of the application's billing catalogue, named by its catalogue `key` (a slug, e.g. `team`) — declared in `shared-lib/src/engine/product.ts` under the `BILLING_CATALOG` target. The KEY, never the file: `wildo init` writes the file with an empty catalogue |\n| `APPLICATION_ROLE` | `roleRef` | one role the application declares, named by its key in `CUSTOM_ROLES_CONFIGURATION` (upper snake case, e.g. `FIELD_TECHNICIAN`; never a core role such as `ORG_MEMBER`) — declared in `shared-lib/src/engine/roles.ts` under the `APPLICATION_ROLES` target. The NAME, never the file: `wildo init` writes the file with an empty table |\n| `APPLICATION_DATA_SEED` | `seedKey` + `resourceRef` + `content` (`REFERENCE` or `DEMONSTRATION`) | one data seed a module declares, named by its key (`<moduleRef>:<purpose>`, e.g. `crm:demo-customers`) — the file `backend-api/src/modules/<moduleRef>/seeds/<seedKey with : as .>.seed.ts`, registered by the module. A `DEMONSTRATION` seed lands only once it declares the environments it runs in, without production |\n| `INBOUND_CHANNEL_HANDLER` | `channel` + the handler's `handlerRef` (`<moduleRef>.<purpose>`, e.g. `matters.mail-intake`) | the handler that decides what a message arriving on a channel the integration plan declared causes. Its file is `backend-api/src/modules/<moduleRef>/inbound/<handlerRef>.inbound-channel-handler.ts`, and it lands when the module's backend `index.ts` imports that file — which is how it is registered on `inboundHandlers` |\n| `APPLICATION_AGENT` | `agentRef` + `shape` (`CHAT_ASSISTANT`, `AUTONOMOUS`, `INVOKED`, `FLOW_STEP`) | one AI agent, named by the `ref` it is registered under (lower case, e.g. `tasks.overdue-triage`). An `AUTONOMOUS` agent is named by its autonomous declaration's `ref`, every other shape by the agent's own. It lands when the TASK'S module registers that ref (`flowsActors.agents`, or `autonomousAgents` for `AUTONOMOUS`) and the module's backend `index.ts`, its `addons/flows-actors/index.ts` and every file that index imports are present. The shape also decides the skill the task is built with |\n| `AGENT_APPROVAL_GATE` | `functionRef` + `route` (`owner`, `role`, `assignee`) + `eligibleRole` for `role` and `assignee` | the approval gate on one function tool an agent calls, named by the `functionRef` it is registered under — `resource.<resourceType>.<operation>` for a resource tool, with the resource type as the code spells it (`resource.adjustmentProposals.post`). Its calls wait for the person the route names. `owner` is the person whose turn it is and takes no role; `role` and `assignee` name the role the approver must hold (a role the application declares, or a core role). It lands only when the registered tool's gate has that route AND that role, so a gate routed to anyone else does not land |\n| `WORK_UNIT_RESOURCE` | `resourceRef` | the resource whose rows are the application's CASES — the unit model spend is attributed to and cost per case is read by. It lands when the resource's configuration declares `workUnit: true` |\n| `METERED_USAGE_RECORDING` | `resourceRef` + `operationRef` + `productKey` + `oncePerRecord`, and `serviceMethodServiceRef` when it bills a service of the firm's method | one operation of one resource that records usage of one METERED billing product when it succeeds (`recordsUsage` on the operation), named by the operation as the resource's configuration keys it (`record-sign-off` for `record_sign_off`) and the product's catalogue `key`. `oncePerRecord: true` counts each row once, which is what a price per case needs. It lands when the resource's configuration declares exactly that recording on that operation |\n| `RESOURCE_RETENTION_BINDING` | `resourceRef` + `retentionClass` (`RESOURCE_DATA`, `FILES`, `AUDIT_LOGS`, `OPERATIONAL_LOGS`, `BUSINESS_RECORDS`) | how long one resource's rows are kept: its configuration's `retentionBinding` in that class. It lands when the resource's configuration declares that class |\n| `RELATIONSHIP_CONFERRED_ROLE` | `relationshipRef` (the relationship kind's key, e.g. `service`) + `roleRef` | one role an organization relationship confers: in `wildo.saas.config.ts`, the kind's `confers.roles` holds it and every organization type the kind grants offers it in `availableOrgRoles`. Under the `APPLICATION_ROLES` target. It lands when the configuration, read fresh, says so |\n| `ORGANIZATION_TYPE` | `organizationTypeRef` (the entry's `ref`, e.g. `regulated-client`), + `ownsApplication: true` for the type that operates the application, + the entry's `offeredRoles`, `userTypes` and `requiresMfa` | one organization type the domain plan's organization model declares, in `organizationTypes` of `wildo.saas.config.ts`. Under the `ORGANIZATION_MODEL` target. The OWNER type is the configuration's own `ownsApplication` type whatever its key; any other type is found by its key. It lands when that type, read fresh, offers those roles, grants those user types and requires a second factor as planned |\n| `ORGANIZATION_RELATIONSHIP_KIND` | `relationshipRef` (the kind's key, e.g. `partnership`) | one kind of relationship between organizations: a key of `organizationRelationships` in `wildo.saas.config.ts`. Under the `ORGANIZATION_MODEL` target. Never a module and never a resource: the engine owns the relationship rows. It lands when the configuration, read fresh, declares the key |\n| `ORGANIZATION_UNIT_CONFINEMENT` | `resourceRef` + `mode` (`ORGANIZATION_UNIT` or `OWN_ROWS`) + `fieldName` | one resource whose rows are confined below the whole organization: to the unit a member holds a role in (`organizationUnitNarrowing`, on the unit field, usually `organizationUnitId`), or to the rows a member owns (`organizationOwnRows`, on the owner's field, usually `createdByUserId`), in `backend-api/src/bootstrap-config.ts`. Under the `ORGANIZATION_MODEL` target. One resource may carry both modes, as two products. It lands when the backend's startup configuration declares the resource in that mode on that field |\n| `SYSTEM_OF_RECORD_BINDING` | `resourceRef` + `systemOfRecordRef` (the instance's key under `systemsOfRecord`, e.g. `odoo`) + `systemOfRecordKind` (the vendor's facet the domain plan names, e.g. `odoo`) + `access` (`READ_THROUGH` or `OWNED_COPY`) + `partitioned` (`true` when the domain plan splits the records by legal entity) | one resource whose records live in another system: its configuration's `httpApiBinding` (read through) or inbound `externalDataPipeline` (copied) names the instance. Carried by the resource's CONFIG task, since the binding is its configuration. It lands when the configuration binds that instance through that lane and `wildo.saas.config.ts` declares the instance with that `vendor`, with `partition: true` exactly when `partitioned` is true; a copy of a partitioned instance also declares `partitionUnitLocalField` and `partitionKeyLocalField` on its pipeline |\n\n**A GOVERNED DOCUMENT is chosen from a closed list, never invented.** There are six,\nand a `documentRef` names one of them in exactly this form:\n\n```\ndocument:public.privacy-notice document:governance.program-handbook\ndocument:public.service-terms document:governance.scope-system-description\n document:governance.roles-responsibilities\n document:governance.document-record-control\n```\n\nA document is drafted against a BLUEPRINT — the required sections, the required\nfacts, the claim guards — and the blueprint is what the catalog holds. A ref outside\nthis list resolves to no blueprint, so the only thing a coding agent could do is\nINVENT the document's structure, which its authoring skill forbids. The task is then\nunbuildable by any run, and the dispatcher skips it by name rather than spending an\nagent turn rediscovering that.\n\nThis is not a hypothetical constraint. A plan authored against the previous wording\nof the row above — \"a notice, a governance statement\" — declared\n`gdpr-data-handling-governance` and `terminal-access-governance`: two plausible\ngovernance statements, neither of which names anything. Both sat permanently ready,\nand the one that was dispatched spent a full turn establishing that the document does\nnot exist. **If the obligation you have in mind is not on this list, it belongs in a\ndocument that IS** — GDPR data-handling scope, retention and subject rights are\n`document:public.privacy-notice`'s subject matter — or it is not a build task at all.\n\n**A cross-resource FOREIGN KEY belongs to the RELATIONSHIP task, never to the schema\ntask of the resource that holds it.** The domain plan makes the FK derivable — an\n`ownershipIntent` of SOURCE_HOLDS_REFERENCE on `contact-company` says contact carries\n`companyId` — and that is exactly why the mistake is easy: the field is derivable, so\nit is tempting to declare it on the schema task that will contain it. Step 2 below\nmakes the relationship task the SINGLE home for cross-resource wiring, and the\n`module-relationships` skill coordinates that FK across the owner's schema and config.\nDeclaring it in both places attributes one artifact to two tasks — the ambiguity\n`produces` exists to remove, reintroduced through the field that removes it. A schema\ntask's products are the resource's OWN domain fields.\n\nTwo further rules the graph enforces, so authoring against them saves a rejection:\n\n- **No two tasks may claim the same artifact.** That is what makes landing decidable.\n Two tasks may both enrich one resource's schema — it is the FIELDS that must not\n overlap, so split by field, never by prose.\n- **A `COMPANION_GENERATION_STEP` declares NO products.** Its landing is the\n generation step's own condition, computed by the companion. A product declared\n beside one is refused.\n\nProducts stay SEMANTIC. You name a resource, a field, a relationship, a view — never\na path and never a command, exactly as with `target`. The host alone turns a product\ninto a question about the working tree.\n\nThe contract itself, so the vocabulary below is read from the source rather than\nfrom this prose:\n\n## Import Origins\n\n- `@wildo-ai/saas-specifications`\n\n## Source Excerpts\n\n### Origin Package: `@wildo-ai/saas-specifications`\n\n```typescript\n *\n * Versioning for the build-plan task-graph payload format itself. `V1` —\n * initial shape (one ordered `tasks` collection with typed targets and\n * declared prerequisites). The shape grows additively across versions; the\n * `version` field is the explicit marker for consumers that branch on era.\n */\nexport enum BuildPlanTaskGraphVersion {\n V1 = 'v1',\n}\n\n/** Stable prefix every build-plan task ref carries; the trusted runtime stamps it, a provider supplies only the slug. */\nexport const BUILD_PLAN_TASK_REF_PREFIX = 'build-task-';\n\n/**\n * WHAT a build task builds — a closed vocabulary, because the host derives\n * the physical mutation scope and verification policy from the target kind\n * and the model must never author those powers through free text.\n */\nexport enum BuildPlanTaskTargetKind {\n /** A whole application module (its shared-lib registration, backend module and frontend module skeletons). */\n MODULE = 'MODULE',\n /** One build stage of one resource: schema → config → ui-behavior → spec. */\n RESOURCE_STAGE = 'RESOURCE_STAGE',\n /** The relationships between resources wired in ONE module's relationships file (#3209): one task per file, not per edge. */\n RELATIONSHIP = 'RELATIONSHIP',\n /** A companion-owned deterministic generation step (labels, email templates, logo or database migrations) interleaved by the build loop, never a coding-agent run. */\n COMPANION_GENERATION_STEP = 'COMPANION_GENERATION_STEP',\n /**\n * Authoring one SHELL SURFACE's placement configuration from the accepted\n * placement plan — the settings rail, the sidebar, the user menu or the\n * command palette.\n *\n * Its own kind rather than a reuse of the neighbours, because none of them is\n * true of it: it is not a MODULE or a RESOURCE_STAGE (it is application-wide\n * and belongs to no resource), not a RELATIONSHIP, and emphatically not a\n * COMPANION_GENERATION_STEP — that kind is documented as \"never a coding-agent\n * run\" and writing `settings-hub.config.ts` is exactly a coding-agent run.\n * Borrowing one would hand the host the wrong mutation scope and the wrong\n * verification, which is what the closed vocabulary exists to prevent.\n */\n SHELL_PLACEMENT = 'SHELL_PLACEMENT',\n /*\n * THE NON-RESOURCE SURFACES (#1490). Until 2026-09-22 the five kinds above were the whole\n * vocabulary, and every one of them is about a resource or the shell placement of one. The\n * decompose method meanwhile told the planner to emit tasks for views, navigation, the design\n * system, custom components, PDF templates, workers, minions, providers, the website and the\n * documentation — surfaces the framework's own composition scenarios and 85 of its 111 skills\n * already build. A task for any of them had no kind to declare, so it either declared none\n * (landing as RAN-not-PROVEN forever) or borrowed `MODULE` with a product the module scope could\n * not prove. The members below are those surfaces, one per write scope the host can derive.\n */\n /**\n * The FRONTEND and SPECIFICATION layers of one module — its composite, custom and chart views,\n * its custom components and their specifications.\n *\n * Narrower than `MODULE` on purpose: a view task never touches `shared-lib` or `backend-api`, so\n * handing it the four-layer scope also hands it four typechecks and the FK sweep for a change\n * that can only break the frontend and the specifications package.\n */\n MODULE_FRONTEND = 'MODULE_FRONTEND',\n /**\n * The BACKEND layer of one module beside its shared-lib declarations — PDF templates and their\n * bindings, backend addons (services, controllers, flows-actors), email definitions.\n *\n * Shared-lib is in scope because a PDF template is bound to a resource FIELD the config declares\n * (`generatedSummaryPdf`), and a backend addon usually declares its contract there first.\n */\n MODULE_BACKEND = 'MODULE_BACKEND',\n /**\n * ONE application-wide frontend configuration surface — navigation, the design system, the app\n * shell's composition, the global views, the shell layout — named by {@link FrontendConfigSurface}.\n *\n * Distinct from {@link SHELL_PLACEMENT}, which authors the placement plan's decisions into the\n * shell files: a placement puts a decided subject in a decided group, while this kind COMPOSES\n * the surface itself (which sidebar sections exist, which transitions the primary zone uses,\n * which palette the product carries). Same file for `APP_SHELL`, different question.\n */\n APPLICATION_FRONTEND_CONFIG = 'APPLICATION_FRONTEND_CONFIG',\n /** The marketing website workspace (`website/`), composed by the `add-website` scenario. Pages and sections are its products. */\n WEBSITE = 'WEBSITE',\n /**\n * The technical-documentation workspace (`technical-doc/`) and the specification package's\n * `technical-documentation/` declarations that feed it. Its generated tree is never written by a\n * task: the companion publishes into it, and the coding policy prohibits it by prefix.\n */\n TECHNICAL_DOCUMENTATION = 'TECHNICAL_DOCUMENTATION',\n /** One worker package (`workers/<workerRef>/`), Node or Rust, plus its declaration in the SaaS config. */\n WORKER = 'WORKER',\n /** One cron minion package (`minions/<minionRef>/`) plus its declaration in the SaaS config. */\n MINION = 'MINION',\n /**\n * Declaring one provider in the application — the SaaS config's provider scopes, the backend\n * package dependency, the frontend provider module and its companion contribution.\n *\n * Application-wide by construction: a provider binding names no module, and the four files it\n * may touch are the same for every provider.\n */\n PROVIDER_BINDING = 'PROVIDER_BINDING',\n /**\n * The application's BILLING CATALOGUE — the `ProductDefinition[]` in `shared-lib/src/engine/product.ts`\n * (and the product specifications that document it), which the backend syncs to the billing\n * provider and the public website reads for its pricing page (#1835).\n *\n * Its own kind because none of the others is true of it: the catalogue is application-wide (a plan\n * belongs to no module), it lives in the shared library's ENGINE module that no `MODULE_*` scope\n * reaches, and before it existed a journey-built application reached its website with an EMPTY\n * catalogue, so the website re-typed the business model's prices by hand.\n */\n BILLING_CATALOG = 'BILLING_CATALOG',\n /**\n * The application's own ROLES — `CUSTOM_ROLES_CONFIGURATION` in `shared-lib/src/engine/roles.ts`, the\n * organization types that offer them (`availableOrgRoles` in `wildo.saas.config.ts`), their\n * specifications, and the `roles` of the operations they unlock (#2490).\n *\n * Its own kind because none of the others reaches it: the role table is application-wide and lives in\n * the shared library's ENGINE module. Before it existed a requirement naming user groups (\"office and\n * field users see different things\") had no task able to declare a role, so app-creation-test-005\n * modelled roles as an access-role RESOURCE that nothing reads.\n */\n APPLICATION_ROLES = 'APPLICATION_ROLES',\n /**\n * The application's ORGANIZATION MODEL (#3035, #3036): the organization types and the relationship kinds between them,\n * declared in `wildo.saas.config.ts` (`organizationTypes`, `organizationRelationships`), and the confinements of an\n * organization's rows to its units or to their owners, declared in the backend's startup configuration\n * (`backend-api/src/bootstrap-config.ts`: `organizationUnitNarrowing`, `organizationOwnRows`).\n *\n * Its own kind because none of the others is true of it. It is application-wide and names no module, like the role\n * table, but it is not the role table: an organization type is the shape a tenant takes (its user types, the roles it\n * offers, how it is joined), and a relationship kind is what one organization may do for another. Borrowing\n * `APPLICATION_ROLES` would have given a task deciding them the role table's scope and the roles skill. Before it\n * existed, creation could lay these down only from fixed blueprints, and a confinement the requirements stated\n * produced no work at all, so a generated internal tool showed every record to every member.\n */\n ORGANIZATION_MODEL = 'ORGANIZATION_MODEL',\n}\n\n/**\n * WHICH application-wide frontend configuration surface a task composes — one file each (in\n * `frontend/src/config/`, except the shell layout, whose one line lives in the engine registrations\n * file), and the coding policy resolves the member to that file exactly as `SHELL_PLACEMENT` resolves\n * a `PlacementSurface`.\n *\n * Its own vocabulary rather than a reuse of `PlacementSurface`: a placement surface is WHERE a\n * subject sits in the shell (settings hub, sidebar, user menu, command palette), and three of\n * those live in one file. A configuration surface is WHICH FILE a composition task authors, and\n * navigation and the design system are not places anything is placed.\n */\nexport enum FrontendConfigSurface {\n /** `frontend/src/config/navigation.config.ts` — zones, transitions, overlay appearance. */\n NAVIGATION = 'NAVIGATION',\n /** `frontend/src/config/design-system.config.ts` — palette, typography, shell appearance from the brand's visual tone. */\n DESIGN_SYSTEM = 'DESIGN_SYSTEM',\n /** `frontend/src/config/app-shell.config.ts` — top bar, sidebar sections, quick switcher: the shell's COMPOSITION, not a placement into it. */\n APP_SHELL = 'APP_SHELL',\n /** `frontend/src/config/global-views.config.ts` — the application-level launcher and view registrations. */\n GLOBAL_VIEWS = 'GLOBAL_VIEWS',\n /**\n * `frontend/src/engine/component-registrations.frontend.ts` — the ONE animated 2D shell layout the application moves\n * in (`register2DLayout(MORPH_LAYOUT_2D, { speed })`), decided beside the design system because both are the\n * brand's: the design system its palette and pace, the layout how the shell moves at that pace. Its single\n * declaration names the layout constant, written out. A 3D layout is never decided here: it is the operator's\n * opt-in, through the `add-3d-layout` composition scenario.\n */\n SHELL_LAYOUT = 'SHELL_LAYOUT',\n}\n\n/**\n * The two shapes of guidance an application gives a person, and the file each is declared in.\n *\n * They are distinct because they are found differently: an onboarding DOCUMENT is embedded in a\n * screen (`EmbedOnboarding`) and is there whenever that screen is, while a guidance FLOW is started\n * by an event and shows once. Both are listed on the owning frontend module — `onboardingViews` and\n * `guidanceFlows`. Each kind has a CONVENTIONAL definitions file, which the authoring skill teaches\n * and a landing probe reads for the declared ref (alongside the module's `index.ts`, where a small\n * module may declare inline). A convention for generated applications: a hand-authored application\n * may keep its declarations elsewhere, and then simply is not probed by a build plan.\n */\nexport enum ApplicationGuidanceKind {\n /** `frontend/src/modules/<m>/app-level-views/onboarding-views.definitions.ts` — an embedded onboarding document. */\n ONBOARDING_DOCUMENT = 'ONBOARDING_DOCUMENT',\n /** `frontend/src/modules/<m>/app-level-views/guidance-flows.definitions.ts` — a triggered guidance flow. */\n GUIDANCE_FLOW = 'GUIDANCE_FLOW',\n}\n\n/**\n * The two worker runtimes the framework composes (`add-worker-node`, `add-worker-rust`). The\n * runtime decides the entry file a landing probe reads and whether a typecheck exists to run: a\n * Node worker is verified by its package typecheck, a Rust worker has no TypeScript to check and\n * the policy says so rather than inventing a command.\n *\n * Not the SaaS config's `WorkerRuntime`, which is a free-form `{ type, language }` pair an\n * application authors for deployment; this is the closed set a creation run can COMPOSE.\n */\nexport enum BuildPlanWorkerRuntime {\n NODE = 'NODE',\n RUST = 'RUST',\n}\n\n/**\n * WHERE a provider is bound — which runtime owner's scope its declaration lands in. Each member\n * is a different file, so a probe and a write grant both derive from it.\n *\n * Named after the SaaS config's own scope keys (`providers.scopes.backend`, `.companion`,\n * `.frontendServices.app`, `.frontendServices.website`), which the `add-provider` and\n * `add-file-picker-provider` scenarios write. Minion and worker scopes are deliberately absent:\n * a provider reaching a minion is declared on that minion's own `providers` block and belongs to\n * the {@link BuildPlanTaskTargetKind.MINION} task that builds it.\n */\nexport enum ProviderBindingScope {\n BACKEND = 'BACKEND',\n COMPANION = 'COMPANION',\n FRONTEND_APP = 'FRONTEND_APP',\n WEBSITE = 'WEBSITE',\n}\n\n/**\n * The inbound channels a creation run can PLAN (#1630, #3394): the members of `InboundChannelKind` an application\n * declares as channels work arrives on, and that a channel handler can be built for. One list, read by the integration\n * plan's declaration and by the build task's product, so the two cannot disagree about what is plannable.\n *\n * `EMAIL` (received by the `EMAIL_INBOUND` provider, routed by the address) and `SMS` (received by the SMS provider's\n * notification endpoint, routed by the number the text was sent TO). `WEBHOOK` is absent on purpose: it is the channel\n * every signed delivery from another system arrives on, derived for that delivery and never declared.\n *\n * ## A NAMED const object, not a TypeScript enum and not an array (#3685)\n *\n * The schemas read it as `z.enum(PlannableInboundChannelKind)`, so the schema node keeps THIS object as its\n * vocabulary, and a landed build or integration plan can name it: `deriveLandingRenderEnumBindings` resolves an\n * enum node by the IDENTITY of that object against the package's exports. `z.enum([EMAIL, SMS])` built a fresh\n * anonymous object, which nothing exports, so every plan landing refused (\"Closed vocabularies with no exported\n * name … tasks.*.produces.*.channel (email, sms)\"), so no build plan could land at all.\n *\n * Not a TypeScript enum, because a subset of a vocabulary must keep the OWNER's members: an enum would make\n * `PlannableInboundChannelKind.SMS` a nominal type of its own, no longer an `InboundChannelKind`, and every reader\n * that maps a planned channel onto the inbound vocabulary would stop compiling. Each member here IS the\n * `InboundChannelKind` member, so a landed `PlannableInboundChannelKind.SMS` is assignable where the channel is read.\n */\nexport const PlannableInboundChannelKind = {\n EMAIL: InboundChannelKind.EMAIL,\n SMS: InboundChannelKind.SMS,\n} as const;\nexport type PlannableInboundChannelKind = (typeof PlannableInboundChannelKind)[keyof typeof PlannableInboundChannelKind];\n\n/**\n * The same vocabulary as a list, for code that iterates it. Derived from {@link PlannableInboundChannelKind}, never\n * written twice.\n */\nexport const PLANNABLE_INBOUND_CHANNEL_KINDS: readonly PlannableInboundChannelKind[] = Object.values(PlannableInboundChannelKind);\n\n/** The per-resource build stages, in their fixed order. */\nexport enum BuildPlanResourceStage {\n SCHEMA = 'SCHEMA',\n CONFIG = 'CONFIG',\n UI_BEHAVIOR = 'UI_BEHAVIOR',\n SPEC = 'SPEC',\n}\n\nconst SlugSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);\n\n/**\n * The key of the domain-plan MODULE a task targets or produces (`deals`, `tasks-manager`). Same\n * slug grammar as the other keys, declared as its own schema because it names one thing — a\n * module — where the other slugs name resources, relationships, steps, workers and products.\n */\nconst ModuleRefSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);\n\n/**\n * The governed document a task produces, named as a COMPLIANCE-DOCUMENT CANDIDATE names it:\n * `document:<namespace>.<id>`, e.g. `document:public.privacy-notice`.\n *\n * **This field was `SlugSchema`, and a slug cannot name a governed document — so until 2026-09-16 no\n * build plan in any application could declare a document the engine catalog defines.** A slug forbids\n * the colon and the dot, the catalog's definitions are `document-definition:public.privacy-notice`,\n * and `selectAssuranceDocumentBlueprintForDocumentRef` joins the two namespaces by exact suffix — so\n * every authored `documentRef` resolved to NO blueprint, and a blueprint is what says which sections,\n * facts and claim guards the document owes. The two vocabularies were disjoint by construction.\n *\n * The cost is measured rather than theoretical. Wonder CRM's plan declares two such products\n * (`gdpr-data-handling-governance`, `terminal-access-governance`), neither of which names anything;\n * the first was dispatched, and its agent spent a full turn establishing — with a positive control —\n * that the document does not exist and could only be invented, which the authoring skill forbids.\n *\n * The bare slug is STILL ACCEPTED, and that is deliberate rather than tidiness left undone: tightening\n * this to the namespaced form alone would make every already-accepted plan carrying one fail to parse,\n * and a build plan that cannot be READ stops the whole lane — the gate\n * `application-creation-directive.md` forbids, for a task nobody can fix by re-running anything. A slug\n * simply resolves to no blueprint, so the dispatcher skips that task with a message naming the ref,\n * and the rest of the plan proceeds.\n */\nconst DocumentProductRefSchema = z.union([\n z.string().regex(/^document:[a-z0-9]+(?:-[a-z0-9]+)*\\.[a-z0-9]+(?:-[a-z0-9]+)*$/),\n SlugSchema,\n]);\n/**\n * A skill ref is the skill's FOLDER id in the app-knowledge catalog, which is\n * also its `SKILL.md` frontmatter `name` — one id, kebab-case. The host refuses\n * any skill name outside `[a-z0-9-]+`, so a ref that does not match this shape\n * can never resolve to an installed skill.\n */\nconst SkillRefSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);\nconst NonEmptyStringSchema = z.string().trim().min(1);\n\n/**\n * WHAT a build task PRODUCES — the artifact whose presence in the application\n * proves the task is done.\n *\n * **This is not `target`, and the difference is the whole reason it exists.**\n * `target` is a WRITE SCOPE: the host turns it into the path prefixes a run may\n * mutate, and several tasks legitimately share one. `produces` is a PRODUCT\n * IDENTITY: it says which artifact this task, and no other, is accountable for.\n *\n * Measured 2026-09-10 on Wonder CRM (issue #597): `build-task-pipeline-view`\n * and `build-task-deal-follow-through-operation` carry BYTE-IDENTICAL targets\n * (`{ kind: MODULE, moduleRef: 'deals' }`), and 7 of that plan's 42 tasks share\n * 3 targets. Landing had been answered by narrowing the target to a module\n * DIRECTORY — which `wildo compose` commits on day one, and which cannot tell\n * two tasks apart even in principle. The loop reported 40 of 42 tasks landed\n * while no coding task had ever run, so `dispatch-next` skipped every one of\n * them and the phase-advance gate read a build that was all but complete.\n *\n * Like `target`, this stays SEMANTIC: a product names a resource, a field, a\n * relationship or a view — never a path, and never a command. The host owns the\n * translation from a product to the physical question it asks of the working\n * tree, exactly as it owns the translation from a target kind to path prefixes.\n * A model that could author the path could author its own mutation scope.\n */\nexport enum BuildPlanTaskProductKind {\n /**\n * Named fields on one resource's schema.\n *\n * The shape an ENRICHMENT task needs, and the reason a product cannot always\n * be \"a file\": every resource file already exists, written by the scaffold\n * with its self-described STARTER shape, so file presence answers nothing.\n * The FIELDS are what the task adds.\n */\n RESOURCE_SCHEMA_FIELDS = 'RESOURCE_SCHEMA_FIELDS',\n /**\n * One resource's declared operations — its registry presence, named by the verbs it gains.\n *\n * The VERBS, not the config file: `<r>.resources-config.ts` is written by the scaffold, so its\n * existence is satisfied before any task runs. That is the exact shape of the defect this\n * vocabulary replaces, and a kind that reproduced it would be worse than no kind at all.\n */\n RESOURCE_REGISTRATION = 'RESOURCE_REGISTRATION',\n /** One resource's frontend ui-behavior. */\n RESOURCE_UI_BEHAVIOR = 'RESOURCE_UI_BEHAVIOR',\n /**\n * One resource's specification, named by the fields it documents.\n *\n * The FIELDS, for the same reason as {@link RESOURCE_REGISTRATION}: every resource is scaffolded\n * with a `*.resource.specification.ts` documenting only the starter shape, so file existence\n * proves nothing about the task that was meant to enrich it.\n */\n RESOURCE_SPECIFICATION = 'RESOURCE_SPECIFICATION',\n /** One relationship edge between two resources, named by the domain plan's `relationshipRef`. */\n RESOURCE_RELATIONSHIP = 'RESOURCE_RELATIONSHIP',\n /** One named custom operation on one resource. */\n RESOURCE_OPERATION = 'RESOURCE_OPERATION',\n /** One named application-level view. */\n APPLICATION_VIEW = 'APPLICATION_VIEW',\n /** One named governed application document (a compliance notice, a governance statement). */\n APPLICATION_DOCUMENT = 'APPLICATION_DOCUMENT',\n /** One application module, registered across the layer registries under one module identity. */\n APPLICATION_MODULE = 'APPLICATION_MODULE',\n /*\n * THE NON-RESOURCE PRODUCTS (#1490). Each names an artifact of a surface the five target kinds\n * above `MODULE_FRONTEND` could not express, and each is probed by the host from committed bytes —\n * a declaration in the one file that registers it, never a directory a scenario already wrote.\n */\n /**\n * Named declarations in ONE application-wide frontend configuration file — a sidebar section\n * ref the app shell gains, a zone the navigation config declares, a token the design system sets.\n *\n * The DECLARATIONS, never the file: every `frontend/src/config/*.config.ts` is written by\n * `wildo init`, so its presence is true before any task runs. Same reasoning as\n * {@link RESOURCE_SCHEMA_FIELDS}, one level up.\n */\n APPLICATION_FRONTEND_CONFIG = 'APPLICATION_FRONTEND_CONFIG',\n /**\n * One composite view of one resource — the cross-resource surface a resource's ui-behavior\n * declares under `compositeViews`. Distinct from {@link APPLICATION_VIEW}, which is\n * application-level and owned by a module rather than a resource.\n */\n RESOURCE_COMPOSITE_VIEW = 'RESOURCE_COMPOSITE_VIEW',\n /** One custom operation or execution view of one resource, bound in its ui-behavior. */\n RESOURCE_CUSTOM_VIEW = 'RESOURCE_CUSTOM_VIEW',\n /** One chart view of one resource, declared under its ui-behavior's `chartViews`. */\n RESOURCE_CHART_VIEW = 'RESOURCE_CHART_VIEW',\n /** One custom frontend component, registered by `componentRef` in the module's or the engine's registrations. */\n CUSTOM_COMPONENT = 'CUSTOM_COMPONENT',\n /**\n * One milestone a module declares — the moment the application recognises and celebrates.\n *\n * Named by its identifier, which is what the module's `milestones.ts` declares\n * (`first-project-created` is spelled `FIRST_PROJECT_CREATED` there). The module FILE is not the\n * product: a module may carry milestones before this task runs, and only the identifier says this\n * one landed.\n */\n APPLICATION_MILESTONE = 'APPLICATION_MILESTONE',\n /** One onboarding document or guidance flow a module declares, named by its ref. */\n APPLICATION_GUIDANCE = 'APPLICATION_GUIDANCE',\n /** One PDF template bound to one resource's generated-file field. */\n PDF_TEMPLATE = 'PDF_TEMPLATE',\n /**\n * One worker's JOBS — the named handlers its entry file declares.\n *\n * The jobs, not the package: `add-worker-node` writes the package, so its directory proves\n * nothing. What a coding task adds is behaviour, and behaviour is a symbol in the entry file.\n */\n APPLICATION_WORKER = 'APPLICATION_WORKER',\n /** One minion's BEHAVIOURS — the named tick handlers its entry file declares. Same reasoning as the worker. */\n APPLICATION_MINION = 'APPLICATION_MINION',\n /** One provider declared in one runtime owner's scope. */\n PROVIDER_BINDING = 'PROVIDER_BINDING',\n /**\n * One product of the application's billing catalogue — a plan, add-on or purchase the application\n * sells — named by its catalogue `key`, which the catalogue file declares (`key: 'team'`).\n *\n * The KEY, not the file: `wildo init` writes `product.ts` with an empty catalogue, so the file proves\n * nothing. Written from the accepted business model's pricing plans, with the plan's price as typed\n * money and the pricing-surface facts (recommended, price disclosure, availability) the plan implies.\n */\n APPLICATION_BILLING_PRODUCT = 'APPLICATION_BILLING_PRODUCT',\n /**\n * One data seed a module declares — rows the application creates for itself, named by the seed's\n * `seedKey` (`crm:demo-customers`).\n *\n * The seed is its own file, `backend-api/src/modules/<module>/seeds/<seedKey with ':' as '.'>.seed.ts`,\n * and it lands only once the module registers it — a seed file nothing imports never runs. Its\n * {@link BuildPlanDataSeedContent} says whether it is REFERENCE data the application needs everywhere\n * or DEMONSTRATION data that must never reach production.\n */\n APPLICATION_DATA_SEED = 'APPLICATION_DATA_SEED',\n /** One website page, registered in the website root config by its manifest. */\n WEBSITE_PAGE = 'WEBSITE_PAGE',\n /** One section of one website page, declared in that page's sections file. */\n WEBSITE_SECTION = 'WEBSITE_SECTION',\n /**\n * One authored documentation chapter — a consumer guide the specifications package declares\n * for the documentation portal to publish (#874's publication input).\n */\n DOCUMENTATION_CHAPTER = 'DOCUMENTATION_CHAPTER',\n /**\n * One inbound CHANNEL handler — the code that decides what a message arriving on a channel causes\n * (#1832). Named by the handler's `ref` (`matters.mail-intake`), which the handler file spells and whose\n * file NAME is derived from it, so the module index's import of that file is what proves the handler is\n * registered. Produced once per channel the integration plan declares (`inboundChannels`).\n */\n INBOUND_CHANNEL_HANDLER = 'INBOUND_CHANNEL_HANDLER',\n /**\n * One role the application declares, named by its role name (`FIELD_TECHNICIAN`), which is its key in\n * `CUSTOM_ROLES_CONFIGURATION`. The NAME, not the file: `wildo init` writes `roles.ts` with an empty\n * table, so the file proves nothing (#2490).\n */\n APPLICATION_ROLE = 'APPLICATION_ROLE',\n /*\n * AGENT WORK (#2966). An agent, the approval gate on one of its tools, and the resource whose rows are the cases its\n * work is costed to. None of them is a name the tree spells in one file: an agent's ref and a gate's role are written\n * through constants in other files, and a gate is a property of a tool object. So each is proven from the REGISTRY the\n * application's backend registers at startup, read through introspection, never from text.\n */\n /**\n * One AI agent the application registers, named by its `ref` — a chat agent's (`agents`) or an autonomous agent's\n * (`autonomousAgents`), as its {@link BuildPlanAgentShape} says. Its shape also decides the skill it is built with.\n */\n APPLICATION_AGENT = 'APPLICATION_AGENT',\n /**\n * The approval gate on one function tool (`humanApproval`): its calls wait for the person the ROUTE names, holding the\n * role the gate requires. Proven when the registered tool's gate has that route and that role, so a gate routed to the\n * wrong role, or a tool left ungated, does not land.\n */\n AGENT_APPROVAL_GATE = 'AGENT_APPROVAL_GATE',\n /**\n * One resource declared as the application's unit of work (`workUnit: true`): its rows are the cases model spend is\n * attributed to, and cost per case is read by them.\n */\n WORK_UNIT_RESOURCE = 'WORK_UNIT_RESOURCE',\n /**\n * One operation of one resource that records usage of one METERED billing product when it succeeds (`recordsUsage`,\n * #2305 S5). How a price per case is billed: the operation that closes a case records one unit, once per case. Proven\n * from the registry like the agent work: the declaration is a property of one operation object in the resource's\n * configuration, which no text in the tree ties to that operation.\n */\n METERED_USAGE_RECORDING = 'METERED_USAGE_RECORDING',\n /**\n * One resource's rows bound to one of the application's retention classes (`retentionBinding`, #2305 S6): how long the\n * firm's case evidence is kept. Proven from the registry: the binding is a property of the resource's configuration.\n */\n RESOURCE_RETENTION_BINDING = 'RESOURCE_RETENTION_BINDING',\n /**\n * One role CONFERRED through one organization relationship kind (#2305 S6): the relationship's `confers.roles` holds it\n * and every organization type the relationship grants offers it (`availableOrgRoles`). How the firm's people come to\n * hold, for a client, the role a decision of its method requires. Proven from the application's configuration\n * (`wildo.saas.config.ts`), read fresh at landing: the role is spelled through constants, so no text can prove it.\n * \"Conferred\" is the kind's CEILING: each client still grants the role, or not, on its own relationship. And the fresh\n * read re-evaluates the configuration and the files it imports by relative path; a value imported from a package is\n * read from that package's build.\n */\n RELATIONSHIP_CONFERRED_ROLE = 'RELATIONSHIP_CONFERRED_ROLE',\n /*\n * THE ORGANIZATION MODEL (#3035, #3036, #3039). What the domain plan's `organizationModel` decides, each proven from what\n * the application DECLARES: its configuration, read fresh, for a type and a relationship kind; the registry its backend\n * assembles at startup for a confinement and a binding. None of them is a name the tree spells in one place (a\n * resource type is written through its constant, a binding's instance through a declaration helper), so no text probe\n * could prove them.\n */\n /**\n * One organization type the application declares in `wildo.saas.config.ts` `organizationTypes`: the shape a tenant\n * takes. Lands when the configuration, read fresh, declares the type carrying what the plan decided of it (the roles\n * it offers, the user types it grants, a required second factor).\n *\n * The type that OWNS the application is identified by `ownsApplication`, never by its key. By the time the build runs\n * the platform has already created the operator's organization under the scaffold's key (`workspace`), and the\n * application line may have set its joining posture, so a plan naming its owner `group` revises THAT type: adding a\n * second owner type is refused by the configuration at startup, and replacing it would lose the organization already\n * created. Its key and its people's user type are renamed to the plan's through a declared rename (`renamedFrom`,\n * #3044), which the foundation usually makes; the product lands only under the plan's key, granting exactly the plan's\n * user types.\n */\n ORGANIZATION_TYPE = 'ORGANIZATION_TYPE',\n /**\n * One kind of relationship between organizations, by its key in `organizationRelationships` (`partnership`): which\n * types represent and which grant, and what the relationship may confer. Never a module and never a resource\n * (#2617): the engine owns the relationship rows. Lands when the configuration, read fresh, declares the key.\n */\n ORGANIZATION_RELATIONSHIP_KIND = 'ORGANIZATION_RELATIONSHIP_KIND',\n /**\n * One resource's rows confined below the whole organization (#3036), in one {@link OrganizationRowConfinementMode}: to\n * the unit a member holds a role in (`organizationUnitNarrowing`), or to the rows a member owns (`organizationOwnRows`),\n * on the field the plan names. Lands when the backend's startup configuration declares the resource in that mode on\n * that field. One resource may be confined in both modes (a department head sees the department's requests, an\n * employee only their own), so the mode is part of the product's identity.\n */\n ORGANIZATION_UNIT_CONFINEMENT = 'ORGANIZATION_UNIT_CONFINEMENT',\n /**\n * One resource whose records live in a system of record (#3039), bound to the instance the application declares under\n * `systemsOfRecord` (`odoo`), of the vendor the domain plan named. Read through (`httpApiBinding`) or copied (an\n * inbound `externalDataPipeline`), as its {@link SystemOfRecordAccess} says. Lands when the resource's configuration\n * binds that instance through that lane and the configuration declares the instance with that vendor, partitioned\n * exactly when the plan splits the records by legal entity (#3045; a copy then stamps each row's partition).\n */\n SYSTEM_OF_RECORD_BINDING = 'SYSTEM_OF_RECORD_BINDING',\n}\n\n/**\n * How an agent is started and talked to (#2966), which decides the skill it is built with\n * ({@link BUILD_PLAN_AGENT_SHAPE_SKILL_REF}) and where its ref is registered.\n */\nexport enum BuildPlanAgentShape {\n /** A person converses with it in the application. Registered under the module's `agents`. */\n CHAT_ASSISTANT = 'CHAT_ASSISTANT',\n /** It runs with nobody signed in: on a schedule, or when a message arrives. Registered under `autonomousAgents`. */\n AUTONOMOUS = 'AUTONOMOUS',\n /** The application's own code calls it once and uses its answer. Registered under `agents`. */\n INVOKED = 'INVOKED',\n /** One step of a declared flow. Registered under `agents`. */\n FLOW_STEP = 'FLOW_STEP',\n}\n\n\n/**\n * What a data seed's rows ARE, which decides where they may exist.\n *\n * - `REFERENCE` — rows the application needs to work wherever it runs: a closed list, a default\n * record, a system template. Every environment, production included.\n * - `DEMONSTRATION` — sample rows that make a freshly created application look lived-in (customers,\n * projects, a few records per list). They must never sit beside real rows, so the seed declares\n * `allowedApplicationEnvironments` without `production`, and the task lands only once it does.\n */\nexport enum BuildPlanDataSeedContent {\n REFERENCE = 'REFERENCE',\n DEMONSTRATION = 'DEMONSTRATION',\n}\n\n/**\n * A data seed's key: kebab-case segments joined by `:` (`crm:demo-customers`), the convention a\n * `DataSeedDefinition` documents. Constrained here because the seed's FILE is derived from it.\n */\n/**\n * An application role's name, as `CUSTOM_ROLES_CONFIGURATION` keys it: upper snake case (`FIELD_TECHNICIAN`).\n * A core role (`ORG_MEMBER`, `APP_ADMIN_SUPER_ADMIN`) is not something an application declares, so the\n * product refuses one: a plan naming it would claim to create a role the engine already owns.\n */\nexport const APPLICATION_ROLE_NAME_PATTERN: RegExp = /^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$/;\n/** Every role the ENGINE defines: an application role may not take one of these names, and a qualification may name one without declaring it. */\nexport const CORE_ROLE_NAMES: ReadonlySet<string> = new Set<string>([...Object.values(CORE_APP_ROLES), ...Object.values(CORE_ORG_ROLES)]);\n\n/**\n * An agent's or a function tool's ref: segments of letters and digits joined by `.`, `-` or `_`\n * (`close-assistant.chat.agent`, `todos.overdue-triage`, `resource.adjustmentProposals.post`). Case is kept, because a\n * tool ref follows the framework's `resource.<resourceType>.<operation>` convention and a multi-word resource type is\n * camelCase. Constrained because the probe compares it EXACTLY with the registered ref: no space, no slash, no empty\n * segment.\n */\nexport const AGENT_WORK_REF_PATTERN: RegExp = /^[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*$/;\n\n/**\n * A step or a decision point of the firm's method (#2305), addressed as `<serviceRef>/<elementRef>`\n * (`month-end-close/approve-posting`). A step's and a decision's ref are unique only within their service, so the\n * service qualifies them; the `service-method` family declares both halves as kebab-case slugs.\n */\nexport const SERVICE_METHOD_ELEMENT_REF_PATTERN: RegExp = /^[a-z0-9]+(?:-[a-z0-9]+)*\\/[a-z0-9]+(?:-[a-z0-9]+)*$/;\n\n/** The ref a build-plan product carries for one step or decision point of the method (#2305). */\nexport function serviceMethodElementRef(serviceRef: string, elementRef: string): string {\n return `${serviceRef}/${elementRef}`;\n}\n\nexport const DATA_SEED_KEY_PATTERN: RegExp = /^[a-z0-9]+(?:-[a-z0-9]+)*(?::[a-z0-9]+(?:-[a-z0-9]+)*)*$/;\n\n/**\n * One artifact a task is accountable for. Closed by construction: a product the\n * host cannot ask a question about is a product that can never be shown to have\n * landed, so the vocabulary only grows alongside the resolver that answers it.\n */\nexport const BuildPlanTaskProductSchema = z.discriminatedUnion('kind', [\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.RESOURCE_SCHEMA_FIELDS).systemEnum('BuildPlanTaskProductKind'),\n resourceRef: SlugSchema,\n /**\n * At least one field, because a task that enriches a schema with nothing is\n * the vacuity this whole field exists to stop: it would land the moment the\n * scaffold existed, which is the defect being fixed.\n */\n fieldRefs: z.array(NonEmptyStringSchema).min(1),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_REGISTRATION).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema, operationRefs: z.array(NonEmptyStringSchema).min(1) }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_UI_BEHAVIOR).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_SPECIFICATION).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema, fieldRefs: z.array(NonEmptyStringSchema).min(1) }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.RESOURCE_RELATIONSHIP).systemEnum('BuildPlanTaskProductKind'),\n relationshipRef: SlugSchema,\n /*\n * The two resources the edge relates, NAMED rather than parsed out of the ref.\n *\n * A ref is `<source>-<target>` by convention and that convention is not invertible:\n * `next-step-deal` splits as (`next`, `step-deal`) or (`next-step`, `deal`) and only the domain\n * plan knows which. The domain plan already carries both, so the plan passes them on instead of\n * making the host guess — a host that guesses wrong probes for a resource that does not exist\n * and reports the task permanently unlanded.\n */\n sourceResourceRef: SlugSchema,\n targetResourceRef: SlugSchema,\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_OPERATION).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema, operationRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_VIEW).systemEnum('BuildPlanTaskProductKind'), viewRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_DOCUMENT).systemEnum('BuildPlanTaskProductKind'), documentRef: DocumentProductRefSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_MODULE).systemEnum('BuildPlanTaskProductKind'), moduleRef: ModuleRefSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.APPLICATION_FRONTEND_CONFIG).systemEnum('BuildPlanTaskProductKind'),\n configSurface: z.enum(FrontendConfigSurface).systemEnum('FrontendConfigSurface'),\n /** At least one, for the same vacuity reason as a schema's `fieldRefs`: the file exists on day one. */\n declarationRefs: z.array(NonEmptyStringSchema).min(1),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_COMPOSITE_VIEW).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema, viewRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_CUSTOM_VIEW).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema, viewRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_CHART_VIEW).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema, chartRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.CUSTOM_COMPONENT).systemEnum('BuildPlanTaskProductKind'), componentRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_MILESTONE).systemEnum('BuildPlanTaskProductKind'), milestoneRef: SlugSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.APPLICATION_GUIDANCE).systemEnum('BuildPlanTaskProductKind'),\n /** Which definitions file carries it — a document and a flow live in different ones. */\n guidanceKind: z.enum(ApplicationGuidanceKind).systemEnum('ApplicationGuidanceKind'),\n guidanceRef: SlugSchema,\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.PDF_TEMPLATE).systemEnum('BuildPlanTaskProductKind'),\n resourceRef: SlugSchema,\n /** The generated-file FIELD the template is bound to (`generatedSummaryPdf`) — a symbol, so any spelling. */\n templateRef: NonEmptyStringSchema,\n /**\n * #2305 S6: the deliverable of the firm's method this document is, as `<serviceRef>/<deliverableRef>`. Its resource\n * must be the one the deliverable is produced from; the derivation check compares them.\n */\n serviceMethodDeliverableRef: z.string().regex(SERVICE_METHOD_ELEMENT_REF_PATTERN).optional(),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_WORKER).systemEnum('BuildPlanTaskProductKind'), workerRef: SlugSchema, jobRefs: z.array(NonEmptyStringSchema).min(1) }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_MINION).systemEnum('BuildPlanTaskProductKind'), minionRef: SlugSchema, behaviorRefs: z.array(NonEmptyStringSchema).min(1) }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.PROVIDER_BINDING).systemEnum('BuildPlanTaskProductKind'),\n providerRef: SlugSchema,\n scope: z.enum(ProviderBindingScope).systemEnum('ProviderBindingScope'),\n /**\n * The provider this module adds operations to, copied from the integration plan's binding (#2025). Present, it\n * changes what landing means: the application's opt-in under `providers.augmentations.<augments>` lists the module's\n * package, rather than a scope naming `providerRef` (an augmentation writes no scope entry).\n */\n augments: SlugSchema.optional(),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_BILLING_PRODUCT).systemEnum('BuildPlanTaskProductKind'), productKey: SlugSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.APPLICATION_ROLE).systemEnum('BuildPlanTaskProductKind'),\n roleRef: z.string().regex(APPLICATION_ROLE_NAME_PATTERN).refine((roleRef) => !CORE_ROLE_NAMES.has(roleRef), {\n message: 'A core role is the engine\\'s; an application role needs a name of its own.',\n }),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.APPLICATION_DATA_SEED).systemEnum('BuildPlanTaskProductKind'),\n seedKey: z.string().regex(DATA_SEED_KEY_PATTERN),\n /** The resource whose rows the seed writes — the `resourceType` it declares. */\n resourceRef: SlugSchema,\n content: z.enum(BuildPlanDataSeedContent).systemEnum('BuildPlanDataSeedContent'),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.WEBSITE_PAGE).systemEnum('BuildPlanTaskProductKind'), pageRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.WEBSITE_SECTION).systemEnum('BuildPlanTaskProductKind'), pageRef: SlugSchema, sectionRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.DOCUMENTATION_CHAPTER).systemEnum('BuildPlanTaskProductKind'), chapterRef: SlugSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.APPLICATION_AGENT).systemEnum('BuildPlanTaskProductKind'),\n /** The agent's `ref` exactly as it is registered (`close-assistant.chat.agent`, `todos.overdue-triage`). */\n agentRef: z.string().regex(AGENT_WORK_REF_PATTERN),\n shape: z.enum(BuildPlanAgentShape).systemEnum('BuildPlanAgentShape'),\n /**\n * The firm's method steps this agent carries (#2305), as `<serviceRef>/<stepRef>`: set when the application has a\n * service method, so the derivation can be checked as total (every agent step has its agent). One agent may carry\n * several steps; each must be an AGENT step of the same `shape`.\n */\n serviceMethodStepRefs: z.array(z.string().regex(SERVICE_METHOD_ELEMENT_REF_PATTERN)).min(1).optional(),\n /**\n * The decision points of the firm's method this agent ASKS as a review question (an actor-system question routed\n * to people when its run suspends), as `<serviceRef>/<decisionRef>` (#2305). A decision is realized either so or by\n * a tool's approval gate (`serviceMethodDecisionRef`), never both: a review question IS the review, and its tool\n * carries no gate. Its route is built by the agent's code when it suspends, so only the realization is checked here.\n */\n serviceMethodAskedDecisionRefs: z.array(z.string().regex(SERVICE_METHOD_ELEMENT_REF_PATTERN)).min(1).optional(),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.AGENT_APPROVAL_GATE).systemEnum('BuildPlanTaskProductKind'),\n /** The gated tool's `functionRef` exactly as it is registered (`resource.<resourceType>.<operation>` for a resource tool). */\n functionRef: z.string().regex(AGENT_WORK_REF_PATTERN),\n route: z.enum(HumanDecision_RouteKind).systemEnum('HumanDecision_RouteKind'),\n /**\n * The role every answerer must hold, as the role table keys it: required for a ROLE or ASSIGNEE route, refused for\n * an OWNER route (answered by the person whose turn it is) — the engine's own rule for a gate, so a plan cannot name a\n * gate the engine would refuse at startup.\n */\n eligibleRole: z.string().regex(APPLICATION_ROLE_NAME_PATTERN).optional(),\n /**\n * The professional qualifications the answerer must ALSO hold (#2967), as the application's\n * `professionalQualificationKinds` keys them: a ROLE or ASSIGNEE gate only, the engine's own rule. Landing compares\n * them with the gate's, so a gate built without the qualification the plan required does not land.\n */\n requiredQualificationKinds: z.array(z.string().regex(LABEL_KEY_SEGMENT_PATTERN)).min(1).optional(),\n /**\n * The decision point of the firm's method this gate realizes (#2305), as `<serviceRef>/<decisionRef>`: set when the\n * application has a service method. Its route must be the decision's, its role the decision's qualification's\n * role, and its qualifications that qualification's kind; the derivation check compares them.\n */\n serviceMethodDecisionRef: z.string().regex(SERVICE_METHOD_ELEMENT_REF_PATTERN).optional(),\n }).refine((gate) => (gate.route === HumanDecision_RouteKind.OWNER) === (gate.eligibleRole === undefined), {\n message: 'An OWNER gate names no role; a ROLE or ASSIGNEE gate names the role its answerer must hold.',\n path: ['eligibleRole'],\n }).refine((gate) => gate.route !== HumanDecision_RouteKind.OWNER || gate.requiredQualificationKinds === undefined, {\n message: 'An OWNER gate requires no qualification: its answerer is the person whose turn it is, whom nothing vets.',\n path: ['requiredQualificationKinds'],\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.WORK_UNIT_RESOURCE).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.METERED_USAGE_RECORDING).systemEnum('BuildPlanTaskProductKind'),\n resourceRef: SlugSchema,\n /** The operation that records, as the resource's configuration keys it (`record-sign-off` for `record_sign_off`). */\n operationRef: SlugSchema,\n /** The METERED product it records against: an `APPLICATION_BILLING_PRODUCT` of this plan, by its catalogue key. */\n productKey: SlugSchema,\n /** Whether it records at most once per row (`oncePerRecord`). A price per case counts each case once, however often it closes. */\n oncePerRecord: z.boolean(),\n /**\n * #2305 S5: the service of the firm's method whose price PER CASE this records, by its `serviceRef`. Its resource must\n * be that service's case and it must count once per row; the derivation check compares them.\n */\n serviceMethodServiceRef: SlugSchema.optional(),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.RESOURCE_RETENTION_BINDING).systemEnum('BuildPlanTaskProductKind'),\n resourceRef: SlugSchema,\n retentionClass: z.enum(DataRetentionClass).systemEnum('DataRetentionClass'),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.RELATIONSHIP_CONFERRED_ROLE).systemEnum('BuildPlanTaskProductKind'),\n /** The relationship kind, by its key in `organizationRelationships` (`service`). */\n relationshipRef: SlugSchema,\n /** The role conferred, by its key in the role table (`ORG_QUALIFIED_ACCOUNTANT`), a core role or the application's. */\n roleRef: z.string().regex(APPLICATION_ROLE_NAME_PATTERN),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.ORGANIZATION_TYPE).systemEnum('BuildPlanTaskProductKind'),\n /**\n * The type's ref as the domain plan's organization model names it (`regulated-client`): its key in\n * `organizationTypes`, except for the owner type, which is found by `ownsApplication` whatever its key.\n */\n organizationTypeRef: SlugSchema,\n /** The type operates the application. Then the configuration's own owner type is the one the plan describes. */\n ownsApplication: z.literal(true).optional(),\n /** The roles the type must offer (`availableOrgRoles`, or the engine's default offer). */\n offeredRoles: z.array(z.string().regex(APPLICATION_ROLE_NAME_PATTERN)).min(1).optional(),\n /** The user types the type must grant its members (`userTypes`). */\n userTypes: z.array(SlugSchema).min(1).optional(),\n /** Whether the type's members must use a second factor (`authOverrides.mfaPolicy.requireMFA`). */\n requiresMfa: z.boolean().optional(),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.ORGANIZATION_RELATIONSHIP_KIND).systemEnum('BuildPlanTaskProductKind'),\n /** The kind's key in `organizationRelationships` (`partnership`), the same key a `RELATIONSHIP_CONFERRED_ROLE` names. */\n relationshipRef: SlugSchema,\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.ORGANIZATION_UNIT_CONFINEMENT).systemEnum('BuildPlanTaskProductKind'),\n resourceRef: SlugSchema,\n mode: z.enum(OrganizationRowConfinementMode).systemEnum('OrganizationRowConfinementMode'),\n /**\n * The field the confinement reads, as the resource's schema names it: the unit field (`organizationUnitId`) for\n * `ORGANIZATION_UNIT`, the owning user's field (`createdByUserId`) for `OWN_ROWS`. Compared exactly, because a\n * confinement on another field confines by something else.\n */\n fieldName: z.string().regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.SYSTEM_OF_RECORD_BINDING).systemEnum('BuildPlanTaskProductKind'),\n resourceRef: SlugSchema,\n /** The instance's key in `systemsOfRecord` (`odoo`), the name a binding's `system` carries. */\n systemOfRecordRef: z.string().regex(SYSTEM_OF_RECORD_NAME_PATTERN),\n /**\n * The system's facet, as the domain plan names it (`odoo`, `sap-s4hana`): the `vendor` the declared instance must\n * carry, so a binding to an instance of another vendor does not land.\n */\n systemOfRecordKind: SlugSchema,\n /** The lane the domain plan decided: read through on every request, or copied by a pipeline. Required there, so here. */\n access: z.enum(SystemOfRecordAccess).systemEnum('SystemOfRecordAccess'),\n /**\n * Whether the instance's records are split by legal entity (#3045), as the domain plan's record location says\n * (`domainPlanRecordPartitionPartitionsInstance`): `true` declares `partition: true` on the instance, and a copied\n * resource then stamps each row's unit and entity key on its pipeline (`partitionUnitLocalField`,\n * `partitionKeyLocalField`); `false` declares neither. The landing probe compares it with the instance's flag. Absent\n * (a plan written before #3045): not compared.\n */\n partitioned: z.boolean().optional(),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.INBOUND_CHANNEL_HANDLER).systemEnum('BuildPlanTaskProductKind'),\n /** The channel the handler serves — one the integration plan declared ({@link PlannableInboundChannelKind}). */\n channel: z.enum(PlannableInboundChannelKind).systemEnum('InboundChannelKind'),\n /** The handler's `ref`, exactly as `inboundHandlerRef()` will accept it. */\n handlerRef: z.string().regex(INBOUND_HANDLER_REF_PATTERN),\n }),\n]);\nexport type BuildPlanTaskProduct = z.infer<typeof BuildPlanTaskProductSchema>;\n\n/**\n * Every artifact identity a product claims — one string per artifact, not one\n * per product, because a product may claim several.\n *\n * `RESOURCE_SCHEMA_FIELDS` is why this returns a list. Two tasks may both enrich\n * one resource's schema (a domain shape and a billing concern, say), and that is\n * legitimate; what must never overlap is the FIELDS. Comparing whole products\n * would refuse the legitimate pair, and comparing only the resource would let two\n * tasks claim one field and make landing ambiguous again.\n *\n * Derived from the product's own members rather than stored, and total over the\n * vocabulary, so a kind added tomorrow must state its identity here or fail to\n * compile — it cannot be silently treated as equal to its siblings.\n */\nexport function buildPlanTaskProductIdentities(product: BuildPlanTaskProduct): readonly string[] {\n switch (product.kind) {\n case BuildPlanTaskProductKind.RESOURCE_SCHEMA_FIELDS:\n return product.fieldRefs.map((fieldRef) => `${product.kind}:${product.resourceRef}:${fieldRef}`);\n case BuildPlanTaskProductKind.RESOURCE_REGISTRATION:\n return product.operationRefs.map((operationRef) => `${product.kind}:${product.resourceRef}:${operationRef}`);\n case BuildPlanTaskProductKind.RESOURCE_SPECIFICATION:\n return product.fieldRefs.map((fieldRef) => `${product.kind}:${product.resourceRef}:${fieldRef}`);\n case BuildPlanTaskProductKind.RESOURCE_UI_BEHAVIOR:\n return [`${product.kind}:${product.resourceRef}`];\n case BuildPlanTaskProductKind.RESOURCE_RELATIONSHIP:\n return [`${product.kind}:${product.relationshipRef}`];\n case BuildPlanTaskProductKind.RESOURCE_OPERATION:\n return [`${product.kind}:${product.resourceRef}:${product.operationRef}`];\n case BuildPlanTaskProductKind.APPLICATION_VIEW:\n return [`${product.kind}:${product.viewRef}`];\n case BuildPlanTaskProductKind.APPLICATION_DOCUMENT:\n /*\n * The ref AS AUTHORED, so a slug and a namespaced ref are different artifact identities even\n * where they mean the same document — the duplicate-artifact refusal cannot see two tasks\n * claiming one document if they spell it differently. Not normalisable: a slug carries no\n * namespace, so nothing can recover `public.` from `privacy-notice`. It costs nothing today\n * because a slug names no catalogued document at all, and the dispatcher skips such a task.\n */\n return [`${product.kind}:${product.documentRef}`];\n case BuildPlanTaskProductKind.APPLICATION_MODULE:\n return [`${product.kind}:${product.moduleRef}`];\n // One identity per DECLARATION, like schema fields: two tasks may compose one config file as\n // long as they declare different things in it.\n case BuildPlanTaskProductKind.APPLICATION_FRONTEND_CONFIG:\n return product.declarationRefs.map((declarationRef) => `${product.kind}:${product.configSurface}:${declarationRef}`);\n case BuildPlanTaskProductKind.RESOURCE_COMPOSITE_VIEW:\n case BuildPlanTaskProductKind.RESOURCE_CUSTOM_VIEW:\n return [`${product.kind}:${product.resourceRef}:${product.viewRef}`];\n case BuildPlanTaskProductKind.RESOURCE_CHART_VIEW:\n return [`${product.kind}:${product.resourceRef}:${product.chartRef}`];\n case BuildPlanTaskProductKind.CUSTOM_COMPONENT:\n return [`${product.kind}:${product.componentRef}`];\n case BuildPlanTaskProductKind.APPLICATION_MILESTONE:\n return [`${product.kind}:${product.milestoneRef}`];\n // The ref alone: a document and a flow sharing one ref is still one guidance identity, and the\n // runtime keys a person's saved state by it — two artifacts claiming it would collide there too.\n case BuildPlanTaskProductKind.APPLICATION_GUIDANCE:\n return [`${product.kind}:${product.guidanceRef}`];\n case BuildPlanTaskProductKind.PDF_TEMPLATE:\n return [`${product.kind}:${product.resourceRef}:${product.templateRef}`];\n case BuildPlanTaskProductKind.APPLICATION_WORKER:\n return product.jobRefs.map((jobRef) => `${product.kind}:${product.workerRef}:${jobRef}`);\n case BuildPlanTaskProductKind.APPLICATION_MINION:\n return product.behaviorRefs.map((behaviorRef) => `${product.kind}:${product.minionRef}:${behaviorRef}`);\n // The SCOPE is part of the identity: one provider bound on the backend and on the website is two artifacts.\n case BuildPlanTaskProductKind.PROVIDER_BINDING:\n return [`${product.kind}:${product.scope}:${product.providerRef}`];\n case BuildPlanTaskProductKind.APPLICATION_BILLING_PRODUCT:\n return [`${product.kind}:${product.productKey}`];\n case BuildPlanTaskProductKind.APPLICATION_ROLE:\n return [`${product.kind}:${product.roleRef}`];\n // The key alone: two seeds may write one resource, and the key is what the seed run ledger tracks.\n case BuildPlanTaskProductKind.APPLICATION_DATA_SEED:\n return [`${product.kind}:${product.seedKey}`];\n case BuildPlanTaskProductKind.WEBSITE_PAGE:\n return [`${product.kind}:${product.pageRef}`];\n case BuildPlanTaskProductKind.WEBSITE_SECTION:\n return [`${product.kind}:${product.pageRef}:${product.sectionRef}`];\n case BuildPlanTaskProductKind.DOCUMENTATION_CHAPTER:\n return [`${product.kind}:${product.chapterRef}`];\n case BuildPlanTaskProductKind.INBOUND_CHANNEL_HANDLER:\n return [`${product.kind}:${product.handlerRef}`];\n case BuildPlanTaskProductKind.APPLICATION_AGENT:\n return [`${product.kind}:${product.agentRef}`];\n // The TOOL alone: one tool has one gate, so two tasks gating it differently would make landing ambiguous.\n case BuildPlanTaskProductKind.AGENT_APPROVAL_GATE:\n return [`${product.kind}:${product.functionRef}`];\n case BuildPlanTaskProductKind.WORK_UNIT_RESOURCE:\n return [`${product.kind}:${product.resourceRef}`];\n // The operation and the product: one operation may record several products, and two tasks recording one product on\n // one operation would make landing ambiguous.\n case BuildPlanTaskProductKind.METERED_USAGE_RECORDING:\n return [`${product.kind}:${product.resourceRef}:${product.operationRef}:${product.productKey}`];\n // One resource has one binding, so two tasks binding it would make landing ambiguous.\n case BuildPlanTaskProductKind.RESOURCE_RETENTION_BINDING:\n return [`${product.kind}:${product.resourceRef}`];\n case BuildPlanTaskProductKind.RELATIONSHIP_CONFERRED_ROLE:\n return [`${product.kind}:${product.relationshipRef}:${product.roleRef}`];\n // The OWNER type is one per application whatever its key, so two products describing it would make landing ambiguous.\n case BuildPlanTaskProductKind.ORGANIZATION_TYPE:\n return [product.ownsApplication === true ? `${product.kind}:application-owner` : `${product.kind}:${product.organizationTypeRef}`];\n case BuildPlanTaskProductKind.ORGANIZATION_RELATIONSHIP_KIND:\n return [`${product.kind}:${product.relationshipRef}`];\n // The MODE is part of the identity: one resource may be confined to the unit AND to its owner's rows (#3036).\n case BuildPlanTaskProductKind.ORGANIZATION_UNIT_CONFINEMENT:\n return [`${product.kind}:${product.resourceRef}:${product.mode}`];\n // The resource alone: one resource's records live in one place, so two bindings of it would make landing ambiguous.\n case BuildPlanTaskProductKind.SYSTEM_OF_RECORD_BINDING:\n return [`${product.kind}:${product.resourceRef}`];\n default: {\n const unhandled: never = product;\n throw new Error(`Unhandled build-plan task product ${JSON.stringify(unhandled)}.`);\n }\n }\n}\n\n/**\n * The skill every billing-catalogue task is authored with (#1835): the product-catalogue contract, the\n * money encoding (minor units), and the pricing-surface facts. The dispatch derives it from an\n * `APPLICATION_BILLING_PRODUCT` product whatever the decomposer wrote, so an agent writing the catalogue\n * the backend sells from is never without it. A `METERED_USAGE_RECORDING` task carries it too (#2305 S5): the skill\n * says how an operation records usage of a metered product, and how a price per case counts each case once.\n */\nexport const BILLING_CATALOG_SKILL_REF = 'configure-billing';\n\n/**\n * The skill every application-roles task is authored with (#2490): the role table, the organization\n * types that offer a role, and the operation roles that make it matter. The dispatch derives it from an\n * `APPLICATION_ROLE` product whatever the decomposer wrote.\n */\nexport const APPLICATION_ROLES_SKILL_REF = 'application-roles-authoring';\n\n/**\n * The skill every data-seed task is authored with (#2234): levels, modes, business keys, and the\n * environment restriction that keeps demonstration rows out of production. The dispatch derives it from\n * an `APPLICATION_DATA_SEED` product whatever the decomposer wrote.\n */\nexport const DATA_SEED_SKILL_REF = 'seeding-authoring';\n\n/**\n * The skill every PDF-template task is authored with (#2495): the template contract, the file field it fills, and\n * where the generated file is stored. The dispatch derives it from a `PDF_TEMPLATE` product whatever the decomposer\n * wrote.\n */\nexport const PDF_TEMPLATE_SKILL_REF = 'pdf-template-authoring';\n\n/**\n * The skill a resource CONFIG task carries when the resource DECLARES personal data (#2495): its retention binding\n * lives in that configuration file, and storage limitation is a duty about personal data. The dispatch reads the\n * declaration from the resource's schema (the engine's personal-data markers), whatever the decomposer wrote.\n */\nexport const RESOURCE_RETENTION_SKILL_REF = 'resource-retention-binding';\n\n/**\n * The skill a task conferring a role through an organization relationship is authored with (#2305 S6): the relationship\n * kind's `confers`, the granting types that must offer the role, and the startup checks that refuse a mismatch. The\n * dispatch derives it from a `RELATIONSHIP_CONFERRED_ROLE` product whatever the decomposer wrote.\n */\nexport const ORGANIZATION_RELATIONSHIPS_SKILL_REF = 'organization-relationships';\n\n/**\n * The skill each agent shape is built with (#2966). The dispatch derives it from an `APPLICATION_AGENT` product whatever\n * the decomposer wrote. Total over {@link BuildPlanAgentShape}, so a shape added tomorrow must name its skill.\n */\nexport const BUILD_PLAN_AGENT_SHAPE_SKILL_REF: Readonly<Record<BuildPlanAgentShape, string>> = {\n [BuildPlanAgentShape.CHAT_ASSISTANT]: 'flows-actors-chat-assistant',\n [BuildPlanAgentShape.AUTONOMOUS]: 'flows-actors-autonomous-agents',\n [BuildPlanAgentShape.INVOKED]: 'flows-actors-llm-agent-invocation',\n [BuildPlanAgentShape.FLOW_STEP]: 'flows-actors-declared-flow',\n};\n\n/**\n * The skill every agent and every approval gate is ALSO built with (#2966): what the agent's use is for, whether it\n * decides anything about a person, and its gated writes. An agent built from its shape skill alone is the undeclared,\n * unguarded shape.\n */\nexport const AI_USE_DECLARATION_SKILL_REF = 'ai-use-declaration';\n\n/**\n * The skill an approval gate is built with (#2966): `flows-actors-chat-assistant` is where the `humanApproval` contract\n * is taught whole — the three routes, the eligible role, an assignee, escalation, deadlines and the review calendar —\n * whichever kind of agent calls the tool.\n */\nexport const AGENT_APPROVAL_GATE_SKILL_REF = 'flows-actors-chat-assistant';\n\n/**\n * The skill an organization-type task is built with (#3040): `organizationTypes` in the application's configuration, the\n * user types and roles a type offers, how it is joined, and the identity overrides it may carry. The dispatch derives it\n * from an `ORGANIZATION_TYPE` product whatever the decomposer wrote. A relationship kind is built with\n * {@link ORGANIZATION_RELATIONSHIPS_SKILL_REF}.\n */\nexport const ORGANIZATION_TYPE_SKILL_REF = 'config-saas-backend';\n\n/**\n * The skill a confinement task is built with (#3040): `organizationUnitNarrowing` and `organizationOwnRows` at startup,\n * and why a confined resource's reads are gated above the default member role. Derived from an\n * `ORGANIZATION_UNIT_CONFINEMENT` product whatever the decomposer wrote.\n */\nexport const ORGANIZATION_UNIT_CONFINEMENT_SKILL_REF = 'authorization-unit-narrowing';\n\n/**\n * The skills a system-of-record binding is built with (#3040): `resource-external-data` for the binding itself (the two\n * lanes, the field mapping, subject rights), and `config-saas` for the `systemsOfRecord` instance the binding names.\n * Derived from a `SYSTEM_OF_RECORD_BINDING` product whatever the decomposer wrote.\n */\nexport const SYSTEM_OF_RECORD_BINDING_SKILL_REFS: readonly string[] = ['resource-external-data', 'config-saas'];\n\n/** The skill a work-unit task is built with (#2966): the `workUnit` declaration, model prices and the case passed to agent turns. */\nexport const WORK_UNIT_SKILL_REF = 'model-cost-attribution';\n\nexport const BuildPlanTaskTargetSchema = z.discriminatedUnion('kind', [\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.MODULE), moduleRef: ModuleRefSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.RESOURCE_STAGE),\n moduleRef: ModuleRefSchema,\n resourceRef: SlugSchema,\n stage: z.enum(BuildPlanResourceStage),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.RELATIONSHIP),\n /** The module whose `<module>.relationships.ts` the edges are written into: the task's write scope. */\n moduleRef: ModuleRefSchema,\n /**\n * Every domain-plan relationship this task wires, by the domain plan's `relationshipRef` (#3209).\n *\n * A LIST, because the unit of work is the module's relationships FILE, not one edge. Each edge is a\n * `createResourcesRelationship(...)` call in that one file, plus the holder's ui-behavior and both\n * resources' specifications, so two tasks wiring two edges of one module edit the same file. Run\n * concurrently they overwrite each other, and the build wave re-runs each interfered task alone:\n * app-creation-test-007 split one module's 23 edges into 23 tasks, and the relationship phase ran one\n * task at a time for about seven hours with a parallelism of five. One task per file (see\n * {@link groupRelationshipTasksByModule}) pays the worker's start and the checks once, and lets\n * different modules' files go in parallel.\n *\n * Each ref here has its `RESOURCE_RELATIONSHIP` product on the same task, and that is checked\n * (`RELATIONSHIP_TARGET_DISAGREES_WITH_PRODUCTS`): the target says what the coverage check counts as\n * wired, and the products are what landing proves. A target naming an edge no product declares would\n * count as covered and never be probed.\n */\n relationshipRefs: z.array(SlugSchema).min(1),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.COMPANION_GENERATION_STEP),\n /** The companion generation step this task runs (e.g. i18n-labels, email-templates); resolved by the companion, never by a coding agent. */\n generationStepRef: SlugSchema,\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.SHELL_PLACEMENT),\n /**\n * Which shell surface this task authors — the placement family's OWN\n * `PlacementSurface`, deliberately not a build-plan copy of it.\n *\n * A copy was written first and was a defect, caught by probing the landing\n * renderer rather than by any test: `PlacementAddress` discriminates on\n * `surface` with `z.literal(...)` per option, so only the VALUES survive into\n * the schema, and the renderer resolves a discriminator by matching that value\n * SET against the exported enums. Two enums with identical values made the\n * match ambiguous, the renderer correctly refused to guess an owner, and the\n * address discriminator became unnameable — a landed placement plan would have\n * emitted `surface: \"SETTINGS_HUB\"` as a bare string instead of\n * `PlacementSurface.SETTINGS_HUB`. One concept, one named source.\n */\n surface: z.enum(PlacementSurface).systemEnum('PlacementSurface'),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.MODULE_FRONTEND), moduleRef: ModuleRefSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.MODULE_BACKEND), moduleRef: ModuleRefSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.APPLICATION_FRONTEND_CONFIG),\n configSurface: z.enum(FrontendConfigSurface).systemEnum('FrontendConfigSurface'),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.WEBSITE) }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.TECHNICAL_DOCUMENTATION) }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.WORKER),\n /** The worker's directory under `workers/` and its key in the SaaS config, in slug form. */\n workerRef: SlugSchema,\n runtime: z.enum(BuildPlanWorkerRuntime).systemEnum('BuildPlanWorkerRuntime'),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.MINION),\n /** The minion's directory under `minions/` and its key in the SaaS config, in slug form. */\n minionRef: SlugSchema,\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.PROVIDER_BINDING), providerRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.BILLING_CATALOG) }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.APPLICATION_ROLES) }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.ORGANIZATION_MODEL) }),\n]);\nexport type BuildPlanTaskTarget = z.infer<typeof BuildPlanTaskTargetSchema>;\n\n/**\n * One ordered build task. It names WHAT to build and WHY; it never carries\n * HOW (no paths, commands, prompts, cwd, model, profile). The host resolves\n * the physical allowed/prohibited paths and the fixed verification from the\n * target kind, and the installed skills from `skillRefs` against the app\n * knowledge catalog.\n *\n * Dependency readiness is DECLARED as prerequisite task refs and RESOLVED by\n * the host (a prerequisite is satisfied when its task has landed), never a\n * solved DAG the model must get right.\n */\nexport const BuildPlanTaskSchema = z.strictObject({\n /** `build-task-<slug>`, stamped by the trusted runtime. */\n taskRef: z.string().regex(new RegExp(`^${BUILD_PLAN_TASK_REF_PREFIX}[a-z0-9]+(?:-[a-z0-9]+)*$`)),\n /**\n * One sentence of intent: what this task delivers.\n *\n * Its OWN instance, not the file's shared leaf, which `templateRef` and the product ref lists also\n * hold. The workbench's reading decorations are keyed by INSTANCE, and it gives those refs a receding\n * identifier look, which the objective sentence took too while it shared their leaf.\n */\n objective: z.string().trim().min(1),\n target: BuildPlanTaskTargetSchema,\n /**\n * The artifacts this task is accountable for — what proves it done.\n *\n * Coding tasks should declare at least one product that composition did not already\n * write. A target is a shared mutation scope; its scaffolded file is not evidence\n * that this task's intended work exists. Products identify the output to probe.\n *\n * Empty declarations remain representable and produce the advisory\n * `TASK_DECLARES_NO_PRODUCT`. The host may advance after a COMPLETED durable run,\n * while naming the task in `unverifiableLandedTaskRefs`: it ran, but its output\n * cannot be proven from a product declaration. An unexecuted task is not landed.\n * This distinction avoids repeatedly dispatching the same unprovable task without\n * presenting execution history as evidence that the intended product is correct.\n *\n * The ONE hard exception is a `COMPANION_GENERATION_STEP`, which must declare NONE.\n * That kind already carries its own typed landed condition, owned by the\n * generation-step service — a set computed asynchronously (planner units x\n * enabled locales), and for the migration step a STATE rather than files. A\n * product declared beside it would be read by nothing, which is the inert\n * declaration this field exists to avoid. Enforced on the graph below, in both\n * directions.\n */\n produces: z.array(BuildPlanTaskProductSchema).default([]),\n /**\n * Exactly ONE functional topic this task belongs to.\n *\n * **It does NOT drive ordering** — this said \"drives cross-app ordering\" until 2026-08-30 and\n * nothing ever ordered by it. Sequencing is `prerequisiteTaskRefs`, resolved by the host, and it\n * is the only thing that decides what may run next.\n *\n * What it DOES: the dispatch host stamps it into the coding-agent's task payload beside\n * `skillRefs`, so the agent is told which phase of building the application this task belongs to.\n * That is context an LLM reads, not a value the runtime branches on — the distinction matters,\n * because a reader who believes it orders will look here for a scheduling bug that lives in the\n * prerequisite graph. See issue #124.\n */\n functionalTopic: z.enum(MetaWorkflow_FunctionalTopic).systemEnum('MetaWorkflow_FunctionalTopic'),\n /** Installed app-knowledge skill folders that carry the technical HOW; resolved via the skills router at dispatch. */\n skillRefs: z.array(SkillRefSchema).min(1),\n /** Task refs that must have landed first; resolved by the host, not solved by the model. */\n prerequisiteTaskRefs: z.array(z.string()).default([]),\n /**\n * What this task is accountable to — traceability only, NEVER scope authority.\n *\n * The vocabulary is the target aspects `BUILD_PLAN_FAMILY_ASPECTS` declares for this edge:\n * functional and non-functional requirements, roadmap phases, the vision's success criteria and\n * constraints, drafted features, pricing plans, and the brand's name, logo direction and visual\n * tone. Each target after the first three was added because a producer had already been writing\n * it (#629, #1433, #1835, #2221). A companion generation step serves what it consumes: the `logo`\n * step serves the brand's logo direction and name.\n *\n * This schema accepts any non-empty string. Generation does not: the edge is DECLARED, so a key\n * that resolves to no element of a target family (when that family has landed) is a dangling\n * reference. The model is told so on retry, and the landing refuses it. That is why widening the\n * vocabulary to what producers genuinely mean matters: a true link the vocabulary does not name\n * fails generation. The workbench renders a key outside the vocabulary as visibly unresolved.\n */\n servesRefs: z.array(NonEmptyStringSchema).default([]),\n /**\n * Who asked for this task DIRECTLY (#1608), rather than it being derived from the specifications: the\n * signed-in person who added it in conversation. STAMPED by the append, never authored: a value in\n * generated output is discarded. Absent on every task the decomposition derived.\n *\n * It is what keeps a requested task alive. Build decomposition refines the plan from the domain plan, and\n * a task nothing in the specifications justifies would read as unjustified and be dropped; a requested\n * task it leaves out is carried forward instead, keeping only the prerequisites the new plan still holds.\n */\n requestedBy: NonEmptyStringSchema.optional(),\n});\nexport type BuildPlanTask = z.infer<typeof BuildPlanTaskSchema>;\n\n/**\n * THE build-plan payload — a **single aggregate per product**: the ORDERED\n * task graph that turns the accepted domain plan into buildable units.\n *\n * **Artifact-family id: `build-plan`.** This schema is the shape of the\n * journey artifact selected by `MetaWorkflow_ArtifactSelector.family ===\n * 'build-plan'` (the `family` vocabulary stays an open string owned by the\n * selector surface; this note is the single place tying the SHAPE to the\n * NAME). Produced by the build-decompose playbook, consumed by\n * build-dispatch (and build-scale, which runs the same branch): ready tasks\n * are dispatched in parallel waves of up to the application's build\n * parallelism (`wildo workbench parallelism`, 5 by default; 1 = one at a\n * time).\n *\n * Invariants enforced here: unique task refs; every prerequisite names a task\n * in this graph; no self-prerequisite. Cycle detection and ordering\n * soundness are the deterministic validator's job (`validateBuildPlanTaskGraph`).\n */\nexport const BuildPlanTaskGraphSchema = z.object({\n version: z.enum(BuildPlanTaskGraphVersion).default(BuildPlanTaskGraphVersion.V1),\n /**\n * At least one task, at the SCHEMA — not merely as a validator warning. The first live playbook-loop\n * run (2026-08-24) proved why: build-decompose answered `tasks: []`, which was schema-valid, passed\n * `_core` validation as a mere warning, and LANDED — overwriting a completed 3-task plan with a\n * vacuous artifact. Decomposing to zero tasks is a refusal (\"nothing to decompose\"), never an\n * artifact: an empty plan carries no information a reader could act on, and the file it replaces\n * does. Same vacuity class already closed on the requirements family (`functional: min(1)`).\n */\n tasks: z.array(BuildPlanTaskSchema).min(1),\n}).superRefine((graph, context) => {\n const refs = new Set<string>();\n graph.tasks.forEach((task, index) => {\n if (refs.has(task.taskRef)) {\n context.addIssue({ code: 'custom', message: `duplicate build task ref \"${task.taskRef}\"`, path: ['tasks', index, 'taskRef'] });\n }\n refs.add(task.taskRef);\n });\n /*\n * No two tasks claim the same artifact.\n *\n * This is what makes landing DECIDABLE, not a tidiness rule. If two tasks name\n * one product, the host cannot tell which of them a present artifact proves —\n * exactly the ambiguity that shared `target`s created, arriving through the\n * field that replaced them. Enforced here rather than left to the validator\n * because a graph that cannot answer \"has this task landed?\" is not a graph\n * the loop may run at all.\n */\n graph.tasks.forEach((task, index) => {\n const isGenerationStep = task.target.kind === BuildPlanTaskTargetKind.COMPANION_GENERATION_STEP;\n if (isGenerationStep && task.produces.length > 0) {\n context.addIssue({\n code: 'custom',\n message: `build task \"${task.taskRef}\" is a companion generation step and must declare no products; its landing is the generation step's own condition`,\n path: ['tasks', index, 'produces'],\n });\n }\n });\n const productOwners = new Map<string, string>();\n graph.tasks.forEach((task, index) => {\n task.produces.forEach((product, productIndex) => {\n buildPlanTaskProductIdentities(product).forEach((identity) => {\n const owner = productOwners.get(identity);\n if (owner !== undefined) {\n context.addIssue({\n code: 'custom',\n message: `build task \"${task.taskRef}\" claims the same artifact as \"${owner}\" (${identity}); an artifact is produced by exactly one task`,\n path: ['tasks', index, 'produces', productIndex],\n });\n return;\n }\n productOwners.set(identity, task.taskRef);\n });\n });\n });\n graph.tasks.forEach((task, index) => {\n task.prerequisiteTaskRefs.forEach((prerequisite, prerequisiteIndex) => {\n if (prerequisite === task.taskRef) {\n context.addIssue({ code: 'custom', message: `build task \"${task.taskRef}\" cannot be its own prerequisite`, path: ['tasks', index, 'prerequisiteTaskRefs', prerequisiteIndex] });\n } else if (!refs.has(prerequisite)) {\n context.addIssue({ code: 'custom', message: `build task \"${task.taskRef}\" names an unknown prerequisite \"${prerequisite}\"`, path: ['tasks', index, 'prerequisiteTaskRefs', prerequisiteIndex] });\n }\n });\n });\n});\nexport type BuildPlanTaskGraph = z.infer<typeof BuildPlanTaskGraphSchema>;\n```\n\n## The two ordering axes\n\nEvery task you emit is placed on **two ordering axes**. They are **distinct** — the\nper-resource sequence deliberately *spans* topics and is not monotonic on the topic\nchain — so keep them separate and satisfy both:\n\n1. **The topic dependency edges** (across the whole app — from the taxonomy's\n `Depends On`): `configure_application_foundation` → `model_domain_graph` →\n `define_interaction_semantics` → app-level `shape_user_experience` →\n `extend_application` → `connect_runtime_and_external_capabilities` →\n `assemble_verify_and_iterate`. You author neither the foundation nor the final\n assemble/verify — you decompose the middle bands (Topics 2–6). Topic 1 IS a sibling\n playbook (`bottom_up.foundation`), and Topic 7 IS one again\n (`bottom_up.assemble-verify`, rebuilt under issue #147 after its producer was removed\n with the verification/digest demolition). You still emit no Topic 7 task, and the reason\n is structural rather than a delegation: `BuildPlanTaskTargetKind` has no verification\n member, so app-wide verification cannot be expressed as a build-plan task at all — see\n the verify/quality-gate exclusion below. The edges you must respect: an\n operation task after the resources it acts on; an **app-level** view / navigation\n task after the interaction semantics and resources it composes; an extension after\n the UX it extends; an integration after the resources it connects.\n2. **The per-resource inner stage order** (within one resource):\n **schema → config → ui-behavior → spec.** This is a *dependency* sequence (each\n stage needs the prior artifact) and it deliberately **crosses topics**: schema +\n config are `model_domain_graph`, ui-behavior is `shape_user_experience`, and the\n spec is the `model_domain_graph` documentation capstone authored last. Two\n consequences to get right:\n - A resource's **own** ui-behavior (its field displays / forms) depends only on\n that resource's schema + config — so it may be ordered **before** cross-resource\n operations. That is **not** a topic-chain violation; only *app-level* UX\n (views / navigation composing multiple resources or operations) waits on the\n interaction-semantics band.\n - The **spec** task is a documentation capstone: order it **after** the stages it\n documents (schema, config, ui-behavior), regardless of its `model_domain_graph`\n topic binding. Its topic says *what* it documents; its ordering says *after what*.\n\n**Sequencing tiebreaker — MVP first.** The two axes constrain *relative* order but leave\nfreedom in which module to build first. Break that tie with the **roadmap** — but note the\nroadmap is requirement-addressed, not module-addressed: a phase delivers\n`deliversRequirementRefs` / `deliversSuccessCriterionRefs`, not modules. So trace each\nmodule's requirements to the earliest roadmap phase that delivers them, then sequence the\nmodules whose requirements land in an earlier phase (NOW / MVP) before those whose\nrequirements land later (NEXT / LATER), so a partial build is a coherent MVP slice rather\nthan a scattered half of every module. This is a soft ordering preference, not a hard\nprerequisite — never let it override the two hard axes above.\n\n## Step 1 — Emit the module + resource tasks (the domain-graph band)\n\nWalk the domain plan module by module. For each **module**, first check whether the\n**foundation step** (a sibling playbook) already scaffolded its slice — it normally has,\nbecause foundation materialises every module in the domain plan. Emit a module task only\nwhere that is not guaranteed; then, for each **resource** in that module's inventory,\nemit the ordered per-resource stage tasks:\n\n| Task | Functional topic | Skill (the HOW) |\n|---|---|---|\n| **(only when needed)** Ensure module `<id>` slice exists + is registered across runtimes — **normally already done by the foundation step**; emit this only for a module the foundation step did NOT establish (e.g. one added to the plan after foundation ran). Idempotent, never a blind re-scaffold | `model_domain_graph` | `resource-add-module` + `module-registration` |\n| Resource `<name>` — domain schema (fields, enums, structural decorators). **Workspace-aware**: when the resource already exists as a compose-born starter (see the workspace section), the objective names the DOMAIN content to add to it; only a resource the workspace does not list gets a skeleton-creation objective | `model_domain_graph` | `resource-add-resource` (skeleton, only when the resource does not exist yet) + `resource-schema-authoring` (the persisted shape) + `application-database-migrations` (**PostgreSQL applications only** — see below) |\n| Resource `<name>` — config (registry presence, core operation verbs, access / role scope — but NOT cross-resource relationships, which are the dedicated Step 2 tasks) | `model_domain_graph` | `resource-config-wiring` (plus `resource-retention-binding` when the resource declares personal data — the dispatch adds it whatever you write) |\n| Resource `<name>` — ui-behavior (its read, form, summary and header surfaces and field chrome, each decided and stated — the resource's own UX) | `shape_user_experience` | `resource-ui-behavior` |\n| Resource `<name>` — spec (canonical business semantics — the per-resource documentation capstone) | `model_domain_graph` | `spec-resource-update` |\n\n> **Two things this table is careful about.** (a) **`ui-behavior` is `shape_user_experience`,\n> not interaction semantics** — a resource's field-display / form chrome is UX (Topic 4's\n> \"resource displays / forms\"); the resource's *operations* (custom verbs, access, scope) are a\n> SEPARATE interaction-semantics band, Step 3. (b) The **`spec` task is a documentation\n> capstone**: it documents the resource's fields (domain), operations (interaction), and frontend\n> (UX), so its single topic binding is `model_domain_graph` (the spec's canonical role is business\n> semantics), but its *ordering* is \"after the stages it documents\", not a topic-chain position —\n> see the ordering axes below. (c) **Module scaffolding + registration is the foundation\n> step's job** (a sibling playbook that materialises every domain-plan module). Do NOT emit a\n> module-scaffold or module-registration task for a module foundation already established — that\n> double-counts foundation. The build loop's domain-graph band is per-**resource**; only ensure a\n> module slice where foundation genuinely did not (e.g. a module added to the plan after\n> foundation ran).\n\n### The schema stage owes a migration on PostgreSQL\n\nThe workspace-truth section above ends with **\"Where this application STORES its data\"**, computed\nfrom the accepted schema plan and the authored store declaration. Read it, and follow what it says\nabout binding `application-database-migrations` to the schema stage.\n\nDo not try to find this out yourself. You have no shell and no file access: this method used to\ninstruct you to run `rg -n \"applicationDatabase\"`, which you could not do, and what you answered\ninstead was unanchored. If the section reports the store as UNKNOWN, say so in the plan and bind\nnothing — a wrong guess either way costs more than a stated gap.\n\n**Do not emit a separate coding task for the migration.** Generating one is deterministic work —\n`wildo db generate` writes it — so it is not a coding-agent objective at all. It is a\n`COMPANION_GENERATION_STEP`, and Step 4 below carries its slug.\n\nThe application-wide backstop is the assemble/verify playbook, whose check set includes\n`check:schema-plan-in-sync`. That gate catches a missed migration; it is not a licence to omit\nthe obligation here, because a build that fails at the capstone has already spent every task.\n\nRules for a buildable domain-graph band:\n\n- **Cover every module and every resource** in the inventory (both `mainResources`\n and `supportingResources`). A module or resource with no task is a coverage GAP (the\n build would not produce it).\n- **Not every resource needs every stage.** A `mainResource` (the entity the module is\n about) typically earns the full schema → config → ui-behavior → spec sequence. A\n `supportingResource` may not: a pure junction / lookup entity needs schema + config\n but no ui-behavior (it has no first-class UX surface). Emit the stages the resource\n genuinely needs, and say why a stage is omitted — do NOT pad every supporting\n resource with a UX task it will never use.\n- **Respect the per-resource stage order** (schema → config → ui-behavior → spec) through\n `prerequisiteTaskRefs` naming the actual predecessor task refs.\n This is checked, and it is a REFUSAL rather than a note: dispatch order is computed\n from the declared prerequisites and from nothing else, so a config task that names a\n schema task in the same plan without depending on it may be dispatched first — the\n agent would author a resources-config for a schema that has not landed. Declaring\n the edge indirectly is fine (config → module → schema); leaving it out is not.\n- **State objectives against workspace reality.** A task for a resource the workspace\n section already lists says what to ENRICH (\"author the deal-pipeline stage enum and\n amount/close-date fields the domain plan declares on `deals`\"), never \"create the\n `deals` resource\" — that file exists and a creation objective dispatches a no-op.\n `moduleRef` values come from the workspace section verbatim.\n- **Do not author fields or schemas here.** The task *names* the resource and its\n stage and points the coding agent at the skill; *what* fields the resource carries\n is resolved by the coding agent at dispatch time, from the domain plan + the skill.\n If you catch yourself writing a field list, stop — that is the coding agent's job.\n (Naming the domain CONCERN a stage must cover — \"the pipeline stages\", \"the follow-up\n reminder date\" — is objective-writing, not field authoring; listing concrete\n field-by-field types would be.)\n\n## Step 1b — Emit the shell-placement tasks (when a placement plan exists)\n\nThe **placement plan** decides WHERE every settings destination, resource operation\nand view sits in the shell, and why. It runs before you — it depends on the domain\nplan, not on your output, which is what keeps the two from forming a cycle. You do\nnot re-decide any of it; you turn it into buildable work.\n\nEmit **one task per SURFACE the plan actually places something on**, never one per\ndecision — the config files are per-surface, so a task per decision would have N\ntasks editing one file:\n\n| Task | Functional topic | Skill (the HOW) |\n|---|---|---|\n| Author the settings rail placement config from the accepted placement plan | `shape_user_experience` | `settings-placement-authoring` |\n| Author the sidebar, command palette or user menu placement config from the accepted placement plan | `shape_user_experience` | `config-app-shell` |\n\nBind by the FILE the surface is configured in. The settings rail is `settings-hub.config.ts`. The sidebar, the palette\nand the user menu (its `settingsEntries`) are `app-shell.config.ts`, and `settings-placement-authoring` itself sends\nwork on them to `config-app-shell`: binding it there hands the agent a skill that tells it to go elsewhere. Only\n`config-app-shell` teaches `runtimeAvailability.requiredRoles`, which a sidebar group or entry the plan restricts to\nsome roles needs.\n\nAny task whose HOW includes **writing JSX for a bespoke surface** — a ui-behavior\nstage, a custom or composite view, an app-level screen — binds\n`frontend-component-catalog` alongside its own skill. It is what tells the coding\nagent which components the framework exports and how to spell their props; without\nit the agent builds the surface from raw `div`s and hand-written utility classes,\nbypassing the theme, the surface policy and the accessibility behaviour every\npreset carries. Do NOT bind it to a task that writes no markup (a schema stage, a\nconfig stage, a migration).\n\nRules:\n\n- **Target kind is `SHELL_PLACEMENT`, carrying the surface.** Not\n `COMPANION_GENERATION_STEP` — that kind is \"never a coding-agent run\" and this is\n one. The host derives the mutation scope from the kind, so borrowing a neighbour's\n gives the task the wrong permissions.\n- **A surface the plan places nothing on gets no task.** An empty settings rail is\n not something to author.\n- **Order after the resources and views a surface references.** Placing a resource's\n LIST in the sidebar before that resource exists is a task that cannot verify.\n- **Carry the decision, not the config.** The task names the surface and points at\n the skill; which category a destination lands in and in what order is IN the plan,\n read by the coding agent at dispatch. Do not restate placements in the objective.\n- **Never override the placement plan in an objective.** The sidebar and command-menu tasks land when the\n shell carries exactly what the plan placed there, so an objective that keeps a placed subject off its surface\n is a task that can never land. One business concept held in two resources (read through and copied) has ONE\n sidebar entry, the experience plan's concept view (its `entryForResourceRefs`), with both lists on the command\n menu (`config-navigation`, `references/one-entry-per-concept.md`). When the coherence report shows\n `concept-list-on-sidebar`, `concept-view-not-on-sidebar` or `concept-list-not-on-command-menu`, the two plans\n disagree and the next run of the plan that is wrong resolves it: say so in your notes and decompose the\n placement plan as it stands.\n- **No placement plan? Emit nothing here and say so.** Do not invent placement — a\n guessed arrangement is exactly what the plan exists to replace, and it would be\n invisible to the reader who assumes a placement task came from a decision.\n\n## Step 2 — Emit the relationship-wiring tasks\n\nEmit one wiring task per MODULE, for the relationship-drafts that module holds:\n\n| Task | Functional topic | Skill (the HOW) |\n|---|---|---|\n| Wire the `<module>` relationships: `<A> <-> <B>` (`<cardinality>`, `<owner>` holds the ref), … | `model_domain_graph` | `module-relationships` |\n\nIts target is `RELATIONSHIP` with the module and EVERY relationship it wires in `relationshipRefs`, and it\ndeclares one `RESOURCE_RELATIONSHIP` product per relationship, with both endpoints. The target and the\nproducts name the same relationships: one named in only one of them is refused.\n\n**Why per module and not per relationship.** Every relationship of a module is written into that module's ONE\nrelationships file. Two tasks wiring two relationships of one module edit the same file; run at the same time,\nthe later write loses the earlier relationship, and the build re-runs each task alone. One application split one\nmodule's 23 relationships into 23 tasks, and its whole relationship phase ran one task at a time for seven hours.\nOne task per module pays the worker's start and its checks once, and different modules' tasks run in parallel.\nThe build also does this for you: a plan with one task per relationship is regrouped per module when it lands,\ncut into chained tasks of at most six relationships each, so a module with many relationships becomes a few\ntasks run one after the other. Group them yourself anyway, so the plan you return is the plan you meant.\n\nRules:\n\n- **This is the single home for cross-resource relationships.** A relationship is wired\n ONCE, here, by the `module-relationships` skill (which coordinates the FK across the\n owner's schema + config, the target's relationship map, the owner's read and edit pages,\n and both specs coherently). The owner's UI task runs before the FK exists, so showing the\n reference on its pages is THIS task's work; say so in the objective. Do\n NOT also wire it inside the per-resource config task in Step 1 — that config task\n establishes the resource's registry presence and core verbs, not its cross-resource\n FKs. Emitting the relationship in both places double-counts the work.\n- **Order after both endpoints' schema tasks.** A relationship-wiring task references\n two resources; both must have a schema task ordered before it (a relationship wired\n before an endpoint exists is a GAP).\n- **Never invent an endpoint.** A relationship-draft whose source or target resource no\n module declares cannot be wired, and it is not yours to repair: emit no wiring task for\n it and do not add the resource to any task. The conception owns that fault, and the\n judge's `conception-buildable` verdict sends the application back to it. A plan that\n invents the resource to wire it hides the fault the conception needs to see.\n- **Carry the intent, not the resolution.** The task states the two ends, the\n cardinality intent, and the ownership direction from the relationship-draft. Write\n the cardinality WITH its direction — \"many-to-one from `customer` to\n `country-context`, customer holds the reference\" — because the draft's label is\n read source → target and a bare \"one-to-many\" cannot be wired without knowing\n which end it was read from. The\n cardinality-to-FK-holder resolution (discriminator / conditional relationships, the\n physical FK placement) is the `module-relationships` skill's job **at dispatch\n time**, not decided here.\n\n## Step 3 — Emit the interaction, UX, extension, and integration tasks\n\nOnce the domain graph is decomposed, emit the tasks for the later topic bands, drawn\nfrom the requirements + feature-drafts. Bind each task to **one** functional topic and\nto the skill(s) that carry its HOW, resolved from the **skills catalog your brief\ncarries** — every installed skill's name and what it does, under \"Application-knowledge\nskills\". Every skill name you emit MUST appear there, spelled exactly. Do **not** guess a\nskill name and do not recall one: a name that is not in that list addresses no skill\nfolder, and the task bound to it cannot be dispatched.\n\n### Every requirement verb becomes a task\n\nDefault verbs (create, read, update, list, delete) are what Step 1 already gives every resource.\nEverything a requirement says the product DOES beyond them is work this step must emit.\n\n**Start with the domain plan's `lifecycles`.** Each declared transition is one `RESOURCE_OPERATION`\nproduct on its resource (target `RESOURCE_STAGE` CONFIG, `operationRef` = the `transitionRef`, exactly),\nskill `resource-status-lifecycle`, ordered after that resource's config task; its objective names the\nstates it moves between and who performs it. One task may carry all of a resource's transitions.\n\n**A transition that creates a record (`createsResourceRef`) creates it in its OWN operation**, in the same\ntransaction: accepting a quote IS the operation that creates the job. So the conversion is part of the\ntransition's task, never a task of its own. That task's objective names the record it creates and what it\ncarries over, it adds the skill `backend-custom-operation` (the write is a custom implementation of the\ntransition's operation), and it is ordered after BOTH resources' config tasks. Do NOT add a second task for the\nwrite, and never name an operation that is the transition plus something else (`approve-create-job`,\n`qualify-create-opportunity`): no such operation is declared, the only code that could carry that name is a\nsecond operation doing what the transition already does, and the plan is refused for it. The only operation\nnames a lifecycle gives you are its `transitionRef`s. The resource's SCHEMA task objective names the status\nenum with every declared state, the `initialState` as its default, and each transition's `stampsField`,\nall excluded from create and update: a transition is the only way to move them.\nFor a resource with `lockedStates` or `finalStates`, the objective of each transition task that moves INTO\none of them also restricts the resource's UPDATE to the states that are neither locked nor final. Never plan\nthat freeze as its own `update` operation task: the scaffold already writes `update`, so such a task reads\nas built before it runs.\n\n**A step is offered only where it can succeed, and a refusal says why.** Each transition task's objective\nnames its `from` states as the only states in which the action is offered, on EVERY variant of the\noperation (an administrator's variant included): the engine then refuses the step from any other state,\nand the screen does not offer it there. Wonder Procurement offered \"Department-head decision\" on a draft,\nand the backend answered 409. When the operation can ALSO be refused for a reason its state does not show\n(a supplier no longer in the directory, a budget already spent), the objective names that refusal and\nsays it reaches the person as a sentence worded through the labels, like every other display text,\nnever as a bare \"conflict\": the refusal carries a declared code (`backend-custom-operation`,\n`references/declared-refusal-codes.md`). The words come from the resource's specification, so its SPEC\ntask's objective names them too: each refusal code as an operation's `errorScenarios[].errorCode` with\na `when` written as what the person reads and does next, and each transition's `unavailableWhen`, the\nsentence a disabled action shows (`spec-resource-update`).\n\n**A resource with a lifecycle has a record page, and its ui-behavior task builds it.** That task's\nobjective states the page, because the engine's generated page puts the status first and who made the\nrecord last but cannot know the route, or which facts belong to which stage\n(`resource-ui-behavior`, `references/workflow-record-page.md`; its spec task documents it, `spec-resource-update`,\n`references/workflow-record-page-specification.md`):\n\n- the status as the page's leading pill, read-only, shown once: on `layout.header` when the page\n authors one (a workflow page does), otherwise `<RecordState>` first in `layout.display`, never both,\n its name kept for a screen reader (`labelPlacement=\"hidden\"`, never `hideLabel`, which removes it);\n with where the record stands in its lifecycle;\n- the next steps from that status as actions with words (its transitions, offered only from their\n `from` states), never bare icons, each with a `displayPriority` so the main verb of each state comes\n first: a desktop list row keeps ONE action in view and a phone header one, and the action with the\n lowest `displayPriority` value that can run is the one that stays;\n- the fields in sections, in business order: what the record is first, then its workflow and the moments\n its transitions stamp (`stampsField`);\n- the record keeping last: its creator and timestamps (`createdByUserId`, `createdAt`, `updatedAt`) on\n one quiet line in `<RecordKeepingFacts>`, never as tiles in a section, and the organization it belongs\n to not shown at all (`references/framework-record-page-parts-api.md`).\n\nA date the business needs in the future (needed by, due on) is refused when it is in the past by the\nOPERATIONS that write it, never by the page alone: the schema task's objective says so for create and\nedit, the transition task's for the step that relies on it (submit), each refusal with its declared code.\n\nA lifecycle resource whose build plan carries no `RESOURCE_UI_BEHAVIOR` product is reported by the\ncoherence report (`lifecycle-resource-no-record-page`), and its page is the engine's generated one, which\nknows no route.\n\nThen read every functional requirement's acceptance criteria for verbs no lifecycle carries, and\nclassify each:\n\n| The criterion says… | Emit | Skill |\n|---|---|---|\n| a record CHANGES STATE (\"an accepted quote\", \"issue the invoice\", \"mark it paid\", \"close the case\", \"a submitted request can be approved\") | one `RESOURCE_OPERATION` per transition, on the resource whose state changes, target `RESOURCE_STAGE` (CONFIG). Its objective names the states it moves between and who may call it | `resource-status-lifecycle` |\n| one record CREATES or FILLS another (\"an accepted quote creates a job\", \"invoice the job\") | when a declared transition does it: that transition's `RESOURCE_OPERATION` task, whose objective names what it creates, ordered after both resources' config tasks (no second task). Otherwise one `RESOURCE_OPERATION` on the SOURCE resource naming the new operation, target `MODULE_BACKEND` when the write is a custom implementation | `backend-custom-operation` |\n| a record must not change any more (\"an issued invoice cannot be edited\") | the objective of the `RESOURCE_OPERATION` task for the transition into that locked or final state also restricts its UPDATE to the open states (never a separate `update` task, which the scaffold already writes) | `resource-status-lifecycle` |\n| a user group may or may not do something (\"technicians cannot see invoices\") | an `APPLICATION_ROLES` task (see below), or, for core roles alone, the config tasks' objectives | `application-roles-authoring` / `resource-config-wiring` |\n| a member sees only PART of the organization's records (\"department heads see their department's requests\", \"employees see only the requests they raised\") | an `ORGANIZATION_UNIT_CONFINEMENT` product of the confinement task (see \"The organization model\" below), never a `RESOURCE_OPERATION` and never a membership feature; the domain plan records it in `organizationModel.unitConfinements` | `authorization-unit-narrowing` |\n| only a QUALIFIED person may take a decision (\"only a chartered accountant approves postings\", \"the reviewer must be licensed\") | the `APPLICATION_ROLES` task for the role, and in the same task's objective the declared `professionalQualificationKinds` and the register's Settings placement; the task that raises the decision (an agent's gate, an operation's `requiresApproval`, a flow's person step) names `requiredQualificationKinds` beside its `eligibleRole` | `professional-qualifications` |\n| the product PRODUCES a document (\"send the quote as a PDF\", \"print the invoice\") | a `PDF_TEMPLATE` task bound to a generated-file field of that resource | `pdf-template-authoring` |\n| the product SENDS a message (\"email the customer\", \"remind the office\") | the `email-templates` generation step, and a `RESOURCE_OPERATION` task whose objective declares the notification on the operation that triggers it | `email-add-template` |\n| something is shown or computed from other records (\"the next action\", \"what is overdue\") | NOT a stored field: a view task from the experience plan, or a computed value in the owning resource's config task objective | — |\n| the product uses AI (\"an assistant answers questions about…\", \"summarise\", \"classify automatically\", \"triage every morning\", \"an agent proposes, a person approves\") | one `MODULE_BACKEND` task per AGENT, in the module whose records it reads, ordered after the config tasks of every resource its tools read or write. Its objective states the agent's use (what it is for, whether it decides anything about a person, who reviews), its `contentGuardrails` wherever they can treat something, and which of its writes wait for whose approval | the shape skill: `flows-actors-chat-assistant` (a person converses with it), `flows-actors-llm-agent-invocation` (your code calls it once), `flows-actors-autonomous-agents` (it runs with nobody signed in), `flows-actors-declared-flow` (a step of a flow) — AND `ai-use-declaration` |\n\nAn agent task always names BOTH skills: the shape skill builds it, and `ai-use-declaration` is what makes it\ndeclare its use — every agent carries `aiUse`, `contentGuardrails` and gated writes, and an agent built from\nthe shape skill alone is the unguarded shape. The dispatch adds both from the task's products whatever you list.\n\nAn agent task DECLARES what it produces, so landing can prove it:\n\n- one `APPLICATION_AGENT` product, with the `agentRef` the code will register and the `shape` the requirement\n describes (a person converses with it → `CHAT_ASSISTANT`; it runs on a schedule or when a message arrives →\n `AUTONOMOUS`; your code calls it once → `INVOKED`; a step of a flow → `FLOW_STEP`);\n- one `AGENT_APPROVAL_GATE` product for EVERY tool that changes something and waits for a person, with the\n route the requirement implies: \"the person asking confirms\" → `owner`; \"a manager approves\" → `role` with the\n role that group holds; \"a chartered (licensed, certified) accountant approves\" → `role` with that role AND\n `requiredQualificationKinds` naming the declared kind; \"the account's partner signs off\" → `assignee` with the\n role that person must hold. The role is the one an `APPLICATION_ROLE` product declares, or a core role, so a\n gate whose approver group has its own role is ordered after that roles task. An `owner` gate never names a role\n or a qualification.\n\nAn assistant's view is still its own `APPLICATION_VIEW` task from the experience plan.\n\nWhen a requirement prices, budgets or reports cost PER CASE (\"what each engagement costs us in AI\", \"margin per\nmatter\", \"cost per ticket\"), or names the record the agents' work is about (\"each close\", \"each claim\"), the\nconfig task of that resource also produces `WORK_UNIT_RESOURCE`, so every model call is attributed to its case.\n\n### When the application has a service method, realize it whole\n\nA firm's method (the `service-method` family, #2305) is the application's agent work written down, so read it\nbefore the requirement verbs above and realize every element of it:\n\n- each service's CASE: the config task of the resource named by `case.caseRef` also produces\n `WORK_UNIT_RESOURCE` for it;\n- each step `performedBy: AGENT`: an `APPLICATION_AGENT` product in the step's `agentShape`, naming the step in\n `serviceMethodStepRefs` as `<serviceRef>/<stepRef>`. One agent may carry several steps of one shape;\n- each decision point, realized ONE way:\n - when a tool waits for the person's approval before it writes: an `AGENT_APPROVAL_GATE` product on that tool,\n naming the decision in `serviceMethodDecisionRef` as `<serviceRef>/<decisionRef>`, with the decision's `route`,\n its qualification's `role` as `eligibleRole` (none for `owner`), and its qualification's\n `professionalQualificationKind` as the only entry of `requiredQualificationKinds` (none when it names none);\n - when the agent ASKS the person and continues from the answer (a review question its run suspends on, such as\n choosing which document pays a bank line): the agent's `APPLICATION_AGENT` product names the decision in\n `serviceMethodAskedDecisionRefs`, and the task's objective says the question's route and role. Its tool has no\n gate: the question is the review;\n - either way, its `decisionDeadline` goes in the task's objective, which the gate's or the question's deadlines are\n built from;\n- each qualification's role: an engine role, or an `APPLICATION_ROLE` product. The `APPLICATION_ROLES` task declares\n every `professionalQualificationKind` the method names in `professionalQualificationKinds`, and is emitted for that\n even when every qualification's role is an engine role;\n- each service with `pricing: PER_CASE`: the billing catalogue task produces a METERED product for it (its\n `productKey` names the case, priced per unit), and a task on the case resource produces a `METERED_USAGE_RECORDING`\n on the operation that CLOSES the case (`case.closesWhen` says which), with that `productKey`, `oncePerRecord: true`\n and the service in `serviceMethodServiceRef`. Order it after the catalogue task and after the case's closing\n operation exists. A service priced `INCLUDED_IN_PLAN` or `BILLED_OUTSIDE` records nothing;\n- each deliverable: a `PDF_TEMPLATE` product on the resource the deliverable is produced from (`fromResourceRef`), bound\n to its generated-file field, naming the deliverable in `serviceMethodDeliverableRef` as `<serviceRef>/<deliverableRef>`;\n- the case's evidence: the config task of the case resource, and of each deliverable's resource, also produces a\n `RESOURCE_RETENTION_BINDING` in the service's `evidenceRetention.retentionClass`. A `BUSINESS_RECORDS` binding also\n declares the statutory retention policy (the `resource-retention-binding` skill says how; the dispatch adds it);\n- each qualification the firm's people hold for the client (`heldBy: FIRM`), unless its role is `ORG_REPRESENTATIVE`\n (conferred already): the `APPLICATION_ROLES` task also produces a `RELATIONSHIP_CONFERRED_ROLE` for its role on the\n relationship the firm serves its clients through (`service` in the configuration's `organizationRelationships`). The\n firm's people hold that role for a client only through the relationship: the task adds it to the kind's\n `confers.roles` and offers it on every organization type the kind grants. A role the client's own staff hold\n (`heldBy: CLIENT`) is offered on the client's organization type and conferred nowhere.\n\nThis is checked at landing: a plan that leaves a case without its work unit, an agent step without its agent or a\ndecision point unrealized (or a gate with another route, role or qualification), or a service priced per case with\nno recording of its case (or one recording elsewhere, every run, or a product the catalogue does not sell), a\ndeliverable with no document, a case's evidence unbound or bound to another class, or a firm-held role no\nrelationship confers is refused, with the list of what is missing. A case's lifecycle that lacks one of its stages is\nthe domain plan's to fix, and is reported rather than refused. A case the domain plan does not declare is the domain plan's to fix, and is reported rather than refused. Name the method's services in `servesRefs` only where a requirement also justifies the task.\n\nA task emitted from a requirement verb is justified by that requirement: name it in `servesRefs`.\nIt is never the \"justified by nothing\" speculative work the rule further down warns about. A plan\nwhose requirements describe a workflow and which carries no `define_interaction_semantics` task is\nnot a lighter plan — it is a CRUD shell, and the reviewer reports it as a gap.\n\n**Every surface below has its own target kind and its own product kind. Use them.**\nUntil 2026-09-22 only resources had a vocabulary, so a task for any of these surfaces\neither declared no product (and could never be proven landed) or borrowed `MODULE`\nwith a product its scope could not prove. A task that squeezes a website page into a\n`MODULE` target, or declares a view with no product, is the defect this vocabulary\nreplaced — the judge reports it as a gap.\n\n- **`define_interaction_semantics`** — custom operations, lifecycle behaviour, access /\n role / scope rules, rate limits — interaction beyond the default resource verbs.\n Target `RESOURCE_STAGE` (CONFIG), product `RESOURCE_OPERATION`. Skills: the Backend and\n Resources domains of the router (`backend-custom-operation`, `rate-limit-authoring`). A\n requirement that confines records to a department or to their author is NOT an operation:\n it is a row confinement, emitted under \"The organization model\" below, whose product a\n `RESOURCE_OPERATION` could never prove. **Derive these from the requirements' VERBS** — read\n \"Every requirement verb becomes a task\" below before emitting anything else in this step.\n- **`shape_user_experience`** — the cross-resource UX, and you do NOT decide it here. The\n **experience plan** (`bottom_up.experience-plan`) already did: which surfaces exist, what\n each is for, which presets it reuses, and how the shell, navigation, design system and\n global views are composed. Read it and emit:\n - one task per VIEW, target `MODULE_FRONTEND` on the view's own module, product matching\n its kind (`RESOURCE_COMPOSITE_VIEW`, `RESOURCE_CUSTOM_VIEW`, `RESOURCE_CHART_VIEW`,\n `APPLICATION_VIEW`, `CUSTOM_COMPONENT`; an execution view is a `RESOURCE_CUSTOM_VIEW`\n product, which is what its file is). A composite, custom or app-level view's product\n carries the plan's `viewRef` verbatim — a ref the plan does not carry is refused as\n dangling, and the dispatch looks the view up by it; a chart names its `chartRef` and a\n component its `componentRef`. Its skill is the one its view kind names (the dispatch\n derives it from the product and loads it first). Carry the view's `reusesComponentRefs` into the task's\n objective — the presets are the decision, and an objective that drops them hands the\n agent a blank surface;\n - one task per CONFIGURATION, target `APPLICATION_FRONTEND_CONFIG` with that surface,\n product `APPLICATION_FRONTEND_CONFIG` naming the surface's own `declarationRefs`, and\n its skill the one the surface names (`config-navigation`, `config-design-system`,\n `config-app-shell`, `layout-2d-adoption` for the shell layout; `views-app-level` for global views\n — derived at dispatch too). A shell layout task depends on the design-system task when both are\n planned: the layout moves at the theme's pace.\n A product's `declarationRefs` are NAMES THE FILE DECLARES IN CODE, never names of decisions, because\n landing looks for them in the file with its comments removed. For `NAVIGATION` that means\n zone keys only: `secondary` for a list-and-detail layout, `companion` for a persistent side panel. The\n transitions and viewport behaviour you decided (a split from list to detail, a phone that replaces the\n detail) go in the objective; a navigation product naming `navigation-transition-list-to-detail-split`\n is refused, because a navigation config has no place to declare it. `primary` is written by `wildo\n init`, so a plan keeping the one-zone default plans no navigation task at all.\n **The shell's CONTENT belongs to the placement tasks.** When a placement plan exists, the sidebar, the\n user menu and the command palette are each written by Step 1b's `SHELL_PLACEMENT` task for that surface,\n the only task whose landing can prove them (it compares the shell with what the plan placed). So the\n experience plan's `APP_SHELL` declarations that name a sidebar section or an entry go into the objective\n of the `SHELL_PLACEMENT` task for that surface, not into an `APP_SHELL` product. Emit an `APP_SHELL` task\n only for what no placement task writes (the shell's frame: which shell components are on, their chrome);\n its objective says the entries are left to the placement tasks, and the placement tasks wait on it.\n One application had its app-shell task write the whole sidebar, user menu and palette; three placement\n tasks then found their work already done, changed nothing, and ran for an hour and a half.\n When the plan decides a `home`, the `GLOBAL_VIEWS` task sets it: its objective says to make\n `homeDefinitionFactory` in `frontend/src/config/global-views.config.ts` return that home, carrying\n the home's rationale. A `VIEW` home is an application view: `{ compositeViewReference: <the view's\n ref constant> }`, and the task depends on the task that builds that view. A `RESOURCE_OPERATION`\n home is `{ resourceOperationPath: … }` naming the resource's registered type (camelCase, not the\n slug), the operation, `isOperationDefault: true`, `isBulkOperation: false` and the default variant's\n `variantKey`: the root matches all of them exactly and silently shows the welcome page on a\n mismatch. That task depends on the resource's config task. Without the home the application opens\n on the framework's welcome page whatever the plan says.\n A `VIEW` home's `blocks` are what that view shows: the task that builds the home's application view\n carries every block into its objective — for an `AWAITING_DECISION` block, the resource, the\n transitions whose waiting records it lists (their `from` states) and the people who take them (the\n block is drawn only for a viewer who may perform that operation, `useViewerMayPerformResourceOperation`;\n `views-app-level`, `references/workflow-home.md`); for\n `MY_RECORDS`, the resource and whose records they are; for `KEY_FIGURE`, the figure — and depends on\n the config tasks of the resources it reads and on the operation tasks of the transitions it awaits.\n A block that lists records embeds the resource's own LIST drawn as its rows only, so the objective\n says `collectionToolbar: CollectionToolbarPresence.HIDDEN`: without it every block repeats the list\n page's search, view switch and Create.\n An objective that drops a block hands the agent the \"Welcome\" page under another title.\n - one task per planned MILESTONE, target `MODULE_BACKEND` on the milestone's module,\n product `APPLICATION_MILESTONE` naming its `milestoneRef`, skill\n `milestones-and-celebrations` (`EXPERIENCE_MILESTONE_SKILL_REF`). It depends on the config stage of its\n `triggerResourceRef` — the operation that earns it must exist before it can be counted.\n Carry the planned moment into the objective;\n - one task per planned piece of GUIDANCE, target `MODULE_FRONTEND` on its module, product\n `APPLICATION_GUIDANCE` naming its `guidanceKind` (the plan's `kind`) and `guidanceRef`,\n skill `guidance-onboarding-authoring` (`EXPERIENCE_GUIDANCE_SKILL_REF`, the same for both\n kinds). It depends on the milestone tasks its `gatedByMilestoneRefs` name, and on the\n resources whose operations it responds to. Carry the planned purpose and gate into the\n objective — the gate is what makes it appear at the right moment. For an\n `ONBOARDING_DOCUMENT`, also carry its `hostViewRef` — the objective must say which view\n embeds it with `EmbedOnboarding` (a view of the document's own module, so inside the task's\n scope) — and depend on that view's task when the plan builds it:\n landing proves the document is declared, not that anything shows it.\n Do not choose any of these skills yourself: every map is total over its vocabulary, and the\n build dispatch DERIVES each task's skill from its product and loads it first, whatever the\n task declares. Declare the skill the product's kind names anyway (the view skill for a view,\n `config-<surface>` for a configuration), so the plan reads right; add a second only when the\n task genuinely needs one no map would give it. With no experience plan,\n emit nothing here — an improvised surface is the state this family replaced. That\n absence is not silent: the reviewer's experience-coverage invariant records it, naming\n what the application will lack, so a build that goes ahead without the plan says so.\n (A placement DECIDED by the placement plan is Step 1b's `SHELL_PLACEMENT`, not this.)\n- **`extend_application`** — the controlled extension points where the declarative model\n is not enough:\n - a custom UI component / widget → target `MODULE_FRONTEND`, product `CUSTOM_COMPONENT`;\n skills `engine-component-registration`, `frontend-component-catalog`;\n - a PDF template / renderer → target `MODULE_BACKEND`, product `PDF_TEMPLATE`; skill\n `pdf-template-authoring` (the dispatch adds it whatever you write);\n - custom backend implementation logic → target `MODULE_BACKEND`, product the\n `RESOURCE_OPERATION` it serves; skill `backend-addon-wiring`;\n - workers and minions → you do NOT decide them here. The **integration plan**\n (`bottom_up.integration-plan`) already did: which surfaces run beside the backend, on\n which runtime, and exactly which resources a minion's tick may read and write. Read it\n and emit one task per WORKER (target `WORKER` with its `runtime`, product\n `APPLICATION_WORKER` naming its `jobRefs`, skill `worker-authoring` — both `NODE` and\n `RUST`, which is what `INTEGRATION_WORKER_SKILL_REF` holds) and one per MINION (target\n `MINION`, product `APPLICATION_MINION` naming its `behaviorRefs`, skill\n `minion-authoring`). Carry the minion's\n `readsResourceRefs` / `writesResourceRefs` into the task's objective: the whitelist\n starts DENY-ALL and an empty one keeps running, so an objective that drops them hands\n the agent a minion that looks healthy and touches nothing. The PACKAGE is composed by\n the foundation, one scenario per surface, so the task authors the BEHAVIOUR. With no\n integration plan, emit nothing here.\n - inbound channels → also decided by the **integration plan** (`inboundChannels`): work that\n ARRIVES — clients emailing documents to a matter, customers writing to a support address,\n people texting an organization's number (`sms`).\n Emit one task per declared channel: target `MODULE_BACKEND` in the module whose records the\n messages concern, product `INBOUND_CHANNEL_HANDLER` with the channel and a `handlerRef`\n (`<moduleRef>.<purpose>`), skill `inbound-channels` (the dispatch adds it whatever you write,\n so the agent is never without it). The channel's `purpose` is the task's objective, and its\n `servesRefs` are the task's. Make it depend on the tasks that register the resources the\n handler writes. The foundation already switched the receiving capability on; nothing here\n configures a provider.\n- **`connect_runtime_and_external_capabilities`** — providers and external connectors,\n and the **integration plan** decided these too: one task per PROVIDER BINDING it\n declares, target `PROVIDER_BINDING`, product `PROVIDER_BINDING` with the binding's own\n `scope` (and its `augments`, copied as written: it is what that task is judged landed by), and its skill taken from that scope through\n `INTEGRATION_PROVIDER_BINDING_SKILL_REF` — do not choose it yourself, the map is total\n over the scope vocabulary. The binding's `rationale` is the task's objective. Reach for\n `provider-operation-calls` and `configure-billing` as the task's further reading when the\n binding is one an application then CALLS. Environment and infra config are the\n foundation's, not a build task's.\n- **What the domain plan left to the engine** — its `engineRealizedRequirements` name the\n requirements met by configuration rather than a module. Each still owes configuration work:\n `APPLICATION_ROLES` → the roles task below; `NOTIFICATIONS` → the triggering operation's task\n (the verb table above); `PERSONAL_DATA` and `AUDIT_TRAIL` → the declarations in the resource\n config tasks' objectives; `BILLING` → the billing catalogue task; `GUIDANCE` → the experience\n plan's guidance tasks; `GOVERNED_DOCUMENT` → no build task (the compliance lane composes it);\n `ORGANIZATION_RELATIONSHIPS` → the organization-model task below (its relationship kinds), never\n a module: the engine owns the relationship rows between organizations; `ORGANIZATION_MEMBERSHIP`\n → no task for membership itself (members, invitations, units and their roles are the foundation's\n capabilities), BUT a requirement confining records to a unit or to their owner owes the\n confinement task below, which the domain plan records in `organizationModel.unitConfinements`;\n `LOCALIZATION` → no task beyond the foundation's capabilities.\n Never emit a task that builds one of these as a resource.\n- **The application roles** — target `APPLICATION_ROLES`, when a requirement names groups of\n users with different access (\"office and field staff\", \"technicians cannot see invoices\",\n \"read-only reviewers\"). Emit ONE task (the role table is one file) producing one\n `APPLICATION_ROLE` per group that no core role covers, skill `application-roles-authoring`\n (the dispatch adds it whatever you write), and `servesRefs` naming the requirement. Reuse the\n core roles first: the broadest internal group usually holds `ORG_MEMBER`, and a requirement met by\n them alone (\"only administrators may delete\") needs no roles task, only config tasks that say which\n operations are restricted. The task declares the roles, offers them on the organization types,\n and narrows the `roles` of the operations they govern, so order it AFTER the config tasks of every\n resource it narrows, and say in its objective which operations each role may call. Never answer a\n role requirement with a resource holding roles, permissions or role assignments: nothing in the\n engine reads it.\n- **The organization model** — target `ORGANIZATION_MODEL`, and the **domain plan** decided it (your\n brief renders it under the domain plan). What the application's configuration ALREADY declares (its\n organization types with the one that owns the application, its relationship kinds, its system-of-record\n instances and their vendors) is the workspace section's \"The organization model this application's\n configuration already declares\": read every comparison below against it. Its `organizationModel` lists the organization types, the relationship kinds between them, the\n resources whose rows are confined below the organization, and where each resource's records live.\n Never a module or a resource for any of these, and above all never one for a relationship between\n organizations: the engine owns those rows, their record separation and their invitations (#2617).\n Emit, when the domain plan's organization model carries the entries:\n - ONE organization-model task (both lists live in `wildo.saas.config.ts`, so two tasks would write\n over each other) producing one `ORGANIZATION_TYPE` per entry of `organizationTypes`, carrying the\n entry's `ref`, `offeredRoles`, `userTypes` and `requiresMfa`, and one `ORGANIZATION_RELATIONSHIP_KIND`\n per entry of `relationshipKinds` the configuration does not already carry.\n **The OWNER type is identified by `ownsApplication`, never by its key.** By the time the build runs\n the platform has already created the operator's organization and its administrator under the\n scaffold's key (`workspace`), and the application line may have set its joining posture (an\n internal tool admits by invitation only). So the plan's owning type (`ownsApplication: true`),\n whatever it calls it (`group`), describes the configuration's EXISTING owner type: its product\n carries `ownsApplication: true`, and the task REVISES that type, keeping its joining posture and any\n sign-in or directory settings it carries. Its product lands only under the plan's key and granting\n exactly the plan's user types. The foundation has usually renamed it already; where the\n configuration still holds the scaffold's names (`workspace`, `member`), the task's objective says to\n RENAME them with a declared rename: the new organization type and the new user type each carry\n `renamedFrom: [{ key: '<old key>', justification: '…' }]`, every reference follows, and the backend\n then moves the organization and the accounts already created at its next start (skill\n `config-saas-backend`, reference `renaming-organization-and-user-types.md`). A key renamed without\n it strands them. Never add a second type with `ownsApplication` (the configuration refuses it at\n startup), and never replace the existing owner. Relationship kinds name the owner by the plan's key, which\n the configuration carries once renamed.\n A type's product lands when the type carries what the plan decided of it, so a type the\n configuration already declares as planned owes nothing and lands at once, and one declared\n differently lands only after the task revises it. A relationship kind proves only its KEY, so for\n a kind the configuration already carries but declares differently from the entry (other sides,\n `mutual`, conferred roles or `tenantRecords`), the task's objective names each difference and that\n kind declares no product. Its objective carries\n what each entry decided: for a type, its purpose, its user types, the roles it offers, whether it\n owns the application, whether its members must use a second factor (`requiresMfa`) and how an\n organization of it is joined; for a kind, which types represent\n and which grant, whether it is mutual, the roles it may confer and which records each relationship\n keeps apart (`tenantRecords`). Skills `config-saas-backend` and `organization-relationships` (the\n dispatch adds both whatever you write). Order it before the `APPLICATION_ROLES` task, which offers\n roles on these types and confers roles through these kinds; a role a relationship confers is that\n task's `RELATIONSHIP_CONFERRED_ROLE`, never this one's.\n - ONE confinement task producing one `ORGANIZATION_UNIT_CONFINEMENT` per entry of\n `unitConfinements`: the resource, its `mode` and its `fieldName`, verbatim. A resource confined to\n its unit AND to its owner's rows is two entries and two products. Skill\n `authorization-unit-narrowing` (added by the dispatch). Narrowing is ADDITIVE: a member whose\n organization-wide role already satisfies a read is not confined, so the task also gates the\n confined resource's reads above the default member role, and its objective says which role reads\n what. Order it after the config task of every confined resource and after the roles task.\n - each entry of `recordLocations` whose `location` is `SYSTEM_OF_RECORD` becomes a\n `SYSTEM_OF_RECORD_BINDING` product of THAT RESOURCE'S CONFIG task (not a separate task, since the\n binding is its configuration), carrying the entry's `systemOfRecordKind` and `access` verbatim, and\n an INSTANCE key derived, never invented: the key of the instance the workspace's configuration\n already declares under `systemsOfRecord` with that `vendor` (listed as \"system-of-record instance\n `<key>` of vendor `<vendor>`\" in the workspace section); when it declares none, the `systemOfRecordKind` itself (`odoo`). In that second\n case the CONFIG task's objective also declares the instance in `wildo.saas.config.ts`\n (`systemsOfRecord.<key>`, with `vendor` set to the kind, its dialect and its personal-data origin):\n the binding lands only on a declared instance of that vendor, and the task may write the\n configuration. Several resources from one system share one instance, so only the first of their\n config tasks declares it and the others depend on that task. The dispatch adds\n `resource-external-data` and `config-saas`. The resource keeps its other stages: a read-through\n resource has no table, so its schema task owes no migration.\n `partitioned` comes from the entry's `partition`, never from a guess: `true` for `BY_LEGAL_ENTITY`\n and `UNCONFIRMED`, `false` for `NOT_SPLIT` and `CANNOT_BE_SPLIT`. When it is `true`, the task that\n declares the instance gives it `partition: true`, and when the workspace section already lists the\n instance without \"partitioned\", the FIRST config task binding that system revises it (the others\n depend on that task); either objective says so: each legal entity of the system is then assigned\n to an organization unit by the operator, and a member reads only the entities of the units they\n hold a role in, so the resource's reads are gated above the default member role. A COPIED resource\n of a partitioned instance also declares `partitionUnitLocalField` and `partitionKeyLocalField` on\n its pipeline (two optional string fields of its schema, which its schema task adds); when the plan\n also confines that resource `ORGANIZATION_UNIT`, `partitionUnitLocalField` is the confinement's\n `fieldName`, since the engine narrows the copy on that field and refuses a second one. A\n read-through resource declares nothing, as the engine confines it on its own field. The split was\n read off the vendor's EFFECTIVE facet: its base facet plus any facet augmentation a declared instance\n opts into (when several instances use one vendor, the instance named like the vendor, else the\n first). `UNCONFIRMED` means that facet could not be read when the plan was written, or the engine\n refused to resolve it (an augmentation `wildo config sync` has not recorded, a vendor partitioned\n twice): the binding does not land on an instance whose effective facet declares no split (the\n backend refuses `partition: true` there at startup), and the task reports it.\n No organization model, or an empty one, emits nothing here.\n- **The billing catalogue** — target `BILLING_CATALOG`, and the **business model** decided it:\n its pricing plans are the products the application sells. Emit ONE task (the catalogue is one\n file, so two tasks would write over each other) producing one `APPLICATION_BILLING_PRODUCT` per\n plan, with a short `productKey` per plan (`free`, `team`, not the plan's `pricing-plan-…` ref),\n skill `configure-billing` (the dispatch adds it whatever you write), and `servesRefs` naming\n every plan it realises. Its objective carries what each plan decided, so the agent writes typed\n money rather than prose: the price and its billing period, whether it is per member or flat, and\n the three pricing-surface facts the plan implies — `isRecommended` for the plan the product is\n designed for (never because it sorts second), `priceDisclosure: STARTING_AT` when part of the\n price is not decided and `ON_REQUEST` when it is quoted, `availability: UPCOMING` when the plan\n is announced but the requirements do not yet build it. Order it after the module and resource\n tasks whose features the plans grant. The website's PRICING section task depends on it: the\n section reads this catalogue, so it must exist first. No business model, or one with no plans,\n emits nothing. A plan priced `per_usage` is a METERED product, priced per unit of its `usageUnit`\n (the objective names the unit); its usage is recorded by a `METERED_USAGE_RECORDING` task on the\n operation that consumes it, ordered after this one.\n- **Data seeds** — target `MODULE_BACKEND` on the seed's module, product `APPLICATION_DATA_SEED`,\n skill `seeding-authoring` (the dispatch adds it whatever you write). A built application must not\n open EMPTY: an empty list is not something a creator can judge, try or show. Emit two kinds, and\n never mix them in one seed:\n - **`REFERENCE`** — rows the application needs wherever it runs, in production too: a closed list\n the domain plan stores as rows rather than as an enum, a default record each organization\n starts with. Emit one only where the domain plan implies such rows; most applications need few\n or none.\n - **`DEMONSTRATION`** — sample rows that make a freshly created application look lived-in: a few\n plausible records (three to eight) for each main resource a person meets first, in the market's\n own language and examples, consistent with each other (an enquiry names a customer that exists).\n One seed per resource. The seed declares `allowedApplicationEnvironments` without production,\n and the task lands only once it does, so these rows can never sit beside real ones. A resource\n that belongs to an organization is seeded per organization, on organization creation.\n A seed whose rows point at rows ANOTHER seed writes (a contact's customer, a quote's customer, an\n invoice's job) links them with `referenceDataSeedRow` and lists that seed in `dependsOn` — the\n engine resolves each reference to the row's `_id`, and nothing else can, because the id is\n generated. Say so in the task's objective: name the seed it references and the field each\n reference fills, so the worker does not have to discover the mechanism. Order a seed after its\n resource's schema and config tasks, after the relationship tasks for the links its rows carry,\n and after the task of every seed whose rows it references. Name each `seedKey`\n `<moduleRef>:<purpose>` (`crm:demo-customers`): the namespace keeps one module's seeds apart from\n another's. Never a seed for a resource the engine owns (users, organizations, memberships).\n- **The website** — target `WEBSITE`, and you do NOT decide its content here. The\n **website plan** (`bottom_up.website-plan`) already decided it: which pages, what each\n is for, and the sections that carry each page's argument in reading order. Read it and\n emit, in this order:\n - one `WEBSITE_PAGE` task per page (`produces: { kind: WEBSITE_PAGE, pageRef }`), skill\n `website-page-authoring`, its objective the page's own purpose. A page task authors the\n PAGE — route (derived from the page's KIND: `/product/<slug>`, `/solutions/<slug>`, …),\n bridge, component, manifest, registration, its own entry in the site menu, and an EMPTY\n sections list — and never its sections: say so in the objective. On the first run that\n built a website the page tasks wrote every section themselves, so no section skill was\n ever applied. A `PRODUCT_OVERVIEW` page task comes after every `PRODUCT` page task: its\n menu link is the Product panel's overview, and the panel exists once its first product\n page does (the dispatch host derives that edge from the plan, so you need not write it);\n - one `WEBSITE_SECTION` task per section (`produces: { kind: WEBSITE_SECTION, pageRef,\n sectionRef }`), **with its page's task as a prerequisite** — a section is declared in\n its page's sections file, so the page must exist first — and its skill taken from the\n section's KIND through `WEBSITE_SECTION_SKILL_REF`, which gives every kind one: the kind's\n name in kebab case after `website-section-` (`HERO` → `website-section-hero`,\n `FEATURE_BENEFIT_SUMMARY` → `website-section-feature-benefit-summary`, `LATEST_POSTS` →\n `website-section-latest-posts`, and so on for all eighteen kinds, `STATS`, `INTEGRATIONS`\n and `ROADMAP` included). A\n `SOLUTION_PATHS` section comes after every `SOLUTION` page task: its cards link to those\n pages, and nothing at build checks a section's links, so built first it would publish links\n to pages that do not exist yet (the dispatch host derives that edge too). Name the skill; the\n dispatch derives the same skill from the plan and puts it first whatever you wrote, so a\n wrong one is harmless but a right one keeps the plan readable.\n A plan whose disposition is `NOT_APPLICABLE`, or no plan at all, emits NOTHING here — the\n application has no `website/` workspace for a task to write in.\n- **Technical documentation** — target `TECHNICAL_DOCUMENTATION`, and you do not choose\n the chapters here either. The **documentation plan** (`bottom_up.documentation-plan`)\n decided them: read it and emit one task per chapter, product\n `DOCUMENTATION_CHAPTER` with its `chapterRef`, skill\n `application-consumer-documentation-authoring`, and an objective carrying the chapter's\n own purpose, audiences and the specifications it documents. A `NOT_APPLICABLE` plan, or\n none, emits nothing. The portal's generated tree is never written by a task — the\n target's own policy prohibits it, because the companion publishes there.\n\n## Posture constraints are work, not commentary\n\nThe compliance posture (the `compliance-posture` family) and the vision's constraints are INPUT on\nequal footing with the requirements: an obligation the posture states — a retention/erasure rule over customer data, a\nterminal-access (cookie/telemetry) posture, an operational-vs-marketing email distinction — needs a\ntask that lands it, serving the nfr it substantiates. Do not compress a posture into an adjective\ninside another task's objective (\"GDPR-appropriate handling\"): an adjective is not schedulable,\nreviewable or landable. If the posture states an obligation and no task expresses it, the\ndecomposition is incomplete.\n\n(Label and email generation are companion-owned generation steps —\nsee Step 4 — not coding-agent extension tasks.)\n\nRules:\n\n- **Every task names a real topic + a real skill.** A task with an invented topic or a\n skill folder that does not exist is a GAP (the dispatch playbook would have nothing\n to run). Route through the declared `skill_catalog` context section of your brief; do not invent.\n- **Respect the topic dependency edges.** An operation task after the resources it acts\n on; an app-level view / navigation task after the interaction semantics **and** every\n resource it composes; an extension after the UX it extends; an integration after the\n resources it connects. (A resource's own field-display ui-behavior was already emitted\n in Step 1 and needs only that resource's schema/config — see the ordering axes.)\n- **Draw tasks from the definition set, not a blank page.** A UX or operation task\n earns its existence from a requirement or feature-draft; a task justified by nothing\n in the definition set is a CONCERN (speculative work). A task serving a requirement verb\n (the table above) always earns it, even when no feature-draft mentions the operation.\n\n## Step 4 — Interleave the companion-owned generation steps\n\nSome build steps are **companion-owned deterministic generation**, not coding-agent\nwork. Emit these as tasks too — `target.kind: COMPANION_GENERATION_STEP` with\n`generationStepRef` set to the EXACT step slug below (the companion executes only this\nclosed vocabulary; any other slug refuses at dispatch) — and **order them after the\nsurfaces whose output they consume**:\n\n- **`i18n-labels`** — label generation in the application's PRIMARY locale. Order it\n after the resources / ui-behavior / views / milestones / guidance whose labels it\n generates — a milestone's title and a flow's words are generated from their declarations.\n Translation into the other enabled locales is a separate step, `i18n-translations`, which\n the dispatch host derives after this one for an application that enables more than one\n locale. Do not author it, and never make another task wait for translation: a step that\n needs labels (documentation publication, for one) needs only the primary locale.\n- **`email-templates`** — email template + label generation and label translation.\n Order it after the notification/email surfaces it renders.\n- **`logo`** — the brand mark: an expert panel derives creative directions, marks are\n generated, a vision judge scores them, and the winner is promoted into the\n specifications brand SSOT. Author it only when the brand brief appears in your\n inputs (it is declared as a map: what the brand holds, not its content), and order\n it after that brief exists; it depends on no\n code surface, so it may run early and in parallel with resource work. Author it at\n most once — an application has one accepted mark, and the step skips itself without\n calling a model when one is already accepted. Its `servesRefs` name the brand\n elements it realises — the brief's logo direction and the brand name, by the refs the\n brand brief shows (`brand.logo-direction`, `brand.name`). Name only refs the brief holds.\n\n- **`database-migrations`** — `wildo db generate`: turns the drift the schema stages created into a\n committed migration, and advances the accepted plan with it. **PostgreSQL-backed applications\n ONLY**: an application ANY of whose environments declares\n `applicationDatabase: { engine: DatabaseEngine.POSTGRESQL }` (or declares no store, which selects\n PostgreSQL). One plan serves every environment, so a MongoDB `local` beside a PostgreSQL\n `production` still owes it. When EVERY environment is on MongoDB a collection appears on first\n write and this step must not be authored at all. It REFUSES there, and also when no readable\n environment declares PostgreSQL but one cannot be read, because generating would author a table\n set nothing uses. A PostgreSQL application with no accepted plan yet is the opposite case:\n the step renders the whole model as the INITIAL migration and writes the baseline beside it, and\n the dispatch host derives that step itself when the plan omits it.\n\n Order it **after the schema stages whose drift it migrates** — practically, after the last\n resource's schema stage in the band. Author it ONCE: one step migrates all accumulated drift, and\n re-running it over a clean plan reports \"nothing to generate\" rather than writing an empty\n migration. It needs a BUILT `backend-api`, because the plan is computed by importing the compiled\n registry; it refuses on an unbuilt tree instead of authoring a migration for a model nobody has.\n\n- **`design-system-brand` and `design-tokens`** — derived by the dispatch host around every\n DESIGN_SYSTEM config task, so do **not** author either. The brand step runs before that task and\n writes the brand's palette seeds and theme personality to `frontend/src/config/brand-design.ts`, and,\n when the application has a website, the same palette and point to `website/src/brand-theme.ts`; the\n tokens step runs after it and regenerates the stylesheet's design-token block from the config. The\n DESIGN_SYSTEM task itself derives its palette from those seeds and composes its theme from that\n personality rather than choosing colours or copying a theme (the `config-design-system` skill shows\n how), so name that skill on it.\n\nThere is no seeds GENERATION step: do **not** author one — an unknown `generationStepRef`\nrefuses at dispatch instead of parking the build. Seeding is a CODING task: an\n`APPLICATION_DATA_SEED` product under the module's backend (Step 3, \"Data seeds\").\n\nYou **place** these steps in the order; you do **not** design how they run\nconcurrently with coding-agent tasks (that interleaving-at-scale concern is the scale\nplaybook's job — see the boundary below).\n\n## Refine, don't re-author\n\n- **Your answer is the WHOLE plan, never a delta.** What you return replaces the\n plan on record, so a task you leave out is deleted. On a re-run, copy every task\n that still holds into your answer unchanged, under its existing ref, and change\n only what the domain plan or a prerequisite genuinely changed: add a task, re-order\n one, or add or correct a relationship-wiring task. Every resource and relationship\n the domain plan declares must still have its tasks when you are done — a plan that\n leaves one out is refused.\n- **Keep what still holds.** Do not re-decompose modules or resources whose tasks are\n already correct; carry them over as they are.\n- **Reuse existing task refs.** A task that already exists keeps its ref — never mint a\n second ref for the same unit of work.\n- **A task already built is never dropped, renamed or reshaped.** Your brief lists the build\n tasks that are built and committed, each with its target and what it produces. Each stays in\n your plan under the same ref (author its slug as the ref without its `build-task-` prefix),\n with that target and those products exactly, even when the domain plan moved around it:\n refine what its objective says if it must, never remove it, never give it a new name, and\n never change what it produces on your own initiative. Built work dropped from the plan is\n orphaned from it, a renamed task reads downstream as a change, and a task whose products\n changed reads unbuilt again although nothing in the code moved. Work you would add goes in a\n NEW task. When an input of the plan REQUIRES a built task's target or products to change (a\n service method that now decides its retention class, a step its agent must name), declare it\n in `reshapedBuiltTasks` with the task's slug and the reason: the task is then rebuilt. The\n reason is not the proof: a declared reshape is kept only when the task AS BUILT fails a check\n of this plan against its inputs (the domain-plan coverage, the firm's method, a reference that\n no longer resolves) and the new shape repairs it. A plan that drops or renames a built task,\n changes one it does not declare, or declares a reshape nothing requires, is refused.\n- **Never orphan an ordering reference.** A task's prerequisite reference must name a\n task that is actually in the plan. If you remove or rename a task, follow it into\n every prerequisite reference.\n\n## Validation and product review\n\n`BuildPlanTaskGraphGeneration` constrains the generated shape. The runtime normalizes\nit into `BuildPlanTaskGraph` and runs `validateBuildPlanTaskGraph`. Cycles and missing\nrequired prerequisite edges between stages present in the graph are hard failures;\na stage absent from the graph and a coding task without products produce warnings.\nSchema checks also reject unknown prerequisite refs and duplicate product ownership.\n\nThe `build-plan-coherent` checklist below complements those structural checks with\nproduct review: resource coverage, useful objectives, meaningful products and suitable\nmethods. Since 2026-09-22 it is also this playbook's compiled evaluation treatment: the\nADVISORY judge reads its invariants against the landed build plan and the domain plan\nafter every run, and its per-criterion verdicts reach the creator's review. A verdict is\na note, never a refusal. The method declares `approve_result`; neither shape validation,\nthe judge nor approval proves the application behavior that the plan intends to deliver.\n\n## Decomposition boundary\n\nKeep this playbook at decomposition depth. Explicitly **out of scope here**:\n\n- **Dispatch execution.** You do NOT dispatch any task, spawn any coding agent, build a\n context pack, or run the coding-agent contract. That is the **dispatch-orchestration**\n playbook, downstream of this decomposition.\n- **Workspace-mutation safety.** Dispatch locking and concurrency, clean-worktree preconditions,\n change-set capture (git baseline / diff), and the failure-policy revert/flag mechanics\n are the dispatch playbook's concern — NOT modelled here. A task that describes *how* it\n is captured or locked is out of this playbook's depth.\n- **Verify / quality-gate mechanics.** Running typecheck, validators, tests, or reviewer\n agents *around* a dispatched task is the dispatch playbook's verify step — you do not model it.\n The app-wide assemble / verify phase (Topic 7) you also do not emit, and the reason is\n STRUCTURAL rather than delegation: a build-plan task's `target.kind` is one of `MODULE`,\n `RESOURCE_STAGE`, `RELATIONSHIP`, `SHELL_PLACEMENT` or `COMPANION_GENERATION_STEP`, and none of them can express\n \"verify the assembled application\". There is no vocabulary for it, so a task claiming to do it\n would be a task no executor could run.\n The `bottom_up.assemble-verify` method owns application-wide verification.\n Keep its work separate from the build targets decomposed here.\n- **Multi-agent scale + interleaving.** Parallelising tasks across multiple coding\n agents, and interleaving the companion generation steps concurrently with coding-agent\n runs, is the **scale** playbook. You produce a linear-enough ordered graph with explicit\n `prerequisiteTaskRefs`; you do NOT solve the concurrency schedule.\n- **Schema / field authoring + code generation.** You name resources and stages; you do\n NOT author fields, enums, decorators, Zod schemas, or any code, and you do NOT resolve\n a cardinality intent into a concrete FK. That is the coding agent at dispatch time.\n- **Framework contract design.** Use the existing `BuildPlanTaskGraph` schema and\n validator. This method authors an application plan; it does not reshape the\n framework's `_core` contracts or implement a new scheduling engine.\n\nKeep the output at decomposition depth. The dispatch and verification methods consume\nit and perform their own work; a task graph is not evidence that those runs succeeded.\n\n## What you emit\n\nOne artifact for this journey:\n\n- The **build-plan** at `specifications/src/build-plan/index.ts` — an ordered task\n graph: the per-resource (schema / config / ui-behavior / spec) tasks, the\n relationship-wiring tasks, the interaction / UX / extension / integration tasks (views,\n frontend configuration, components, PDF templates, workers, minions, provider bindings,\n website pages and sections, documentation chapters — each over its own target and\n product kind), the organization-model tasks (types, relationship kinds, row confinements),\n any module-ensure tasks foundation did not cover, and the interleaved\n companion-generation steps — each carrying its target, **the artifacts it produces**,\n its one functional topic, its skill(s), and explicit `prerequisiteTaskRefs`.\n\nThe creator reviews the result (approval posture `approve_result`) before it is accepted\nas the journey's build plan, which the dispatch-orchestration and scale playbooks then\nturn into dispatched, verified coding-agent runs.\n\n## References\n\nThese are skill FOLDERS installed in the application, named so each piece of work has an\nauthoring contract a later coding agent can open. This step has no tools and does not open them;\nwhat reaches you is this method, your declared inputs, and the brief's own sections.\n\n- `resource-add-module` — the module-scaffolding vocabulary, for\n the conditional ensure-module task (only where the foundation step did not establish the\n module slice).\n- `resource-add-resource` — the resource vocabulary (the\n resource-skeleton task in the schema stage).\n- `resource-schema-authoring` — the schema stage (first\n per-resource task).\n- `resource-config-wiring` — the config stage (second\n per-resource task).\n- `resource-ui-behavior` — the ui-behavior stage (third\n per-resource task).\n- `spec-resource-update` — the spec stage (fourth per-resource\n task).\n- `module-relationships` — the relationship-wiring task's HOW\n (cardinality-to-FK-holder resolution, at dispatch time — named here, not performed).\n- `module-registration` — the cross-runtime module-registration\n task's HOW.\n- `config-saas-backend` — the organization-model task's organization types (`organizationTypes`).\n- `organization-relationships` — the organization-model task's relationship kinds, and the roles a\n relationship confers.\n- `authorization-unit-narrowing` — the confinement task's unit narrowing and own rows.\n- `resource-external-data` — a CONFIG task whose resource is bound to a system of record.\n- the skills CATALOG, which your brief carries as its own section — the skills router: consult it to bind each interaction /\n UX / extension / integration task to its real skill folder from the full catalog. Do\n not invent skill names; route through the index.\n\n## Reviewer checklist — `build-plan-coherent`\n\nThese thirteen invariants are the criteria of this playbook's compiled evaluation treatment (`application-creation:evaluation-treatment/build-plan-coherent`, one criterion per invariant, invariants 2 and 2b sharing one), which the advisory judge runs after every landing. They are kept here as creator-facing review guidance too, so a reviewer and the judge read the same words:\n\nJudge whether the drafted build plan is a coherent, complete, correctly-ordered decomposition of the approved domain plan into coding-agent tasks — WITHOUT straying into how those tasks execute. Assess thirteen invariants and mark each PASS / CONCERN / GAP with a one-line evidence note. (1) MODULE + RESOURCE COVERAGE — every resource in every module's inventory (mainResources + supportingResources) has build tasks; a resource with no task is a GAP (the build would not produce it). Task `moduleRef` values must be module ids the workspace section lists (an invented module id is a GAP — the dispatcher cannot route it), and a task whose objective CREATES a resource the workspace section shows already exists — instead of enriching it — is a CONCERN (it dispatches a no-op). Module slices are scaffolded by the foundation step (a sibling playbook), so a module needs a dedicated ensure-module task ONLY where foundation did not establish it — a module whose resources have tasks but which carries no redundant scaffold task is NOT a GAP (do not flag the absence of a module-scaffold task foundation already owns); a module added to the plan after foundation with neither a foundation slice nor an ensure-module task IS a GAP. Every pricing plan the business model declares must be an `APPLICATION_BILLING_PRODUCT` of a `BILLING_CATALOG` task whose `servesRefs` name it; a declared plan with no billing product is a GAP. A plan with main resources and no `DEMONSTRATION` `APPLICATION_DATA_SEED` task is a CONCERN: the application would open empty. A seed task whose rows reference another seed's rows (a contact's customer) that is not ordered after that seed's task is a GAP — the reference resolves only against rows already written. (2) TASK WELL-FORMEDNESS — every task names exactly ONE functional topic that is a real MetaWorkflow_FunctionalTopic value (configure_application_foundation / model_domain_graph / define_interaction_semantics / shape_user_experience / extend_application / connect_runtime_and_external_capabilities / assemble_verify_and_iterate) and at least one skill that is a real folder in the app-knowledge skill catalog; a task with an invented topic or a dangling skill is a GAP. (2b) PRODUCT DECLARATION — every task except a COMPANION_GENERATION_STEP declares at least one product in `produces`, and a generation step declares none; a coding task with an empty `produces` is a GAP, because it has no declared output to probe. The host can advance after a COMPLETED durable run, but carries the task in `unverifiableLandedTaskRefs`; that means ran, not proven. Repair the product declaration rather than treating this fallback as evidence of correct output. A product must name something COMPOSITION DOES NOT ALREADY WRITE — the fields a schema gains rather than its file, the verbs a config gains rather than its file, both endpoints of a relationship rather than one — so a product naming only a scaffolded artifact is a GAP wearing a declaration. Two tasks claiming the SAME artifact is a GAP as well (landing becomes undecidable); two tasks enriching one resource with DIFFERENT fields is correct and not a finding. A cross-resource FOREIGN KEY declared on a schema task's `produces` is a GAP — the relationship task is its single home (Step 2), and declaring it twice attributes one artifact to two tasks; a schema task's products are the resource's OWN domain fields. (3) PER-RESOURCE STAGE ORDER — for each resource, its tasks respect the inner order schema -> config -> ui-behavior -> spec; a config task ordered before that resource's schema task, or a spec task before its ui-behavior task, is a GAP (the build stage would run against a missing prerequisite). A supportingResource (e.g. a pure junction / lookup entity) may legitimately OMIT stages it does not need — a junction with schema + config and no ui-behavior is fine; only an out-of-ORDER stage (or a mainResource missing schema/config) is a GAP, not an intentionally-omitted stage on a supporting resource. (4) TOPIC DEPENDENCY ORDER — tasks respect the topic dependency edges (model_domain_graph before define_interaction_semantics; app-level shape_user_experience [views / navigation composing multiple resources or operations] after the interaction semantics and resources it composes; extend_application after the UX it extends; connect_runtime_and_external_capabilities after the resources it connects). Note the deliberate exception: a resource's OWN ui-behavior (its field displays / forms, a shape_user_experience task) depends only on that resource's own schema + config and MAY precede cross-resource operations — that is NOT a violation. What IS a GAP: an app-level view composing resources/operations placed before they exist, an integration task before the resources it connects, or any user-experience task before that resource's schema task. The per-resource spec task is a documentation capstone (topic model_domain_graph) and must be ordered after the schema / config / ui-behavior stages it documents; a spec task before its ui-behavior stage is a GAP. (5) RELATIONSHIP COVERAGE — every relationship-draft whose two endpoints are resources the domain plan declares is named in the `relationshipRefs` of a wiring task (bound to the module-relationships skill, one task per module, with one product per relationship) ordered AFTER both endpoint resources' schema tasks; a relationship with no wiring task, or one ordered before its endpoints exist, is a GAP; two wiring tasks of one module that neither waits on the other are a CONCERN (they edit one file). A relationship to a resource no module declares is NOT this invariant: no task can wire it, so it is invariant (8)'s. (6) COMPANION-GENERATION INTERLEAVE — the executable companion-owned generation steps (`i18n-labels`, `email-templates`, `logo`, plus `database-migrations` for a PostgreSQL-backed application) are present and placed AFTER the resources / modules whose output they consume; a labels-generation task ordered before the resources it labels, or a missing executable generation step for authored surfaces, is a CONCERN. `logo` is the exception to the ordering half — it consumes the brand brief rather than any code surface, so it is unordered with respect to resource work and only its ABSENCE (on an application with a brand brief) is a CONCERN. The migration step follows the schema stages whose drift it migrates and is not authored when every environment of the application is on MongoDB (one environment on PostgreSQL makes it owed). Do NOT flag the absence of an `i18n-translations` step — the dispatch host derives it after `i18n-labels`. Do NOT flag the absence of a seeds GENERATION step — none exists; seeding is an `APPLICATION_DATA_SEED` coding task, judged under invariant (1). (7) BOUNDARY DISCIPLINE — the plan stays at DECOMPOSITION depth: it names tasks, their topic, their skill(s), their target, and their ordering intent; it does NOT specify how a task is DISPATCHED (dispatch locking and concurrency, change-set capture, git baseline, verify/quality-gate mechanics = the dispatch-orchestration playbook) and does NOT solve multi-agent SCALE or interleaving concurrency (= the scale playbook). Any task that describes how a task EXECUTES rather than WHAT it builds, or that authors a schema / resolves a cardinality into a concrete FK / generates code, is a CONCERN (scope creep out of the decomposition phase). (8) CONCEPTION BUILDABLE — this one faults the CONCEPTION, never the plan: a GAP when the domain plan declares a module, resource or relationship no build target can express however it is decomposed, or when the computed coherence report shows a dangling reference or unrealised decision in the conception (a domain-plan resource another family names that does not exist, a composition surface no plan realises, a placement plan that still puts a concept's list on the sidebar or leaves the concept's view off it) that the build would have to invent, or override, to proceed. An element the plan merely FORGOT is invariant (1), not this one — only a conception GAP sends the application back to its conception lane, which is the most expensive way to fix an omission. Name the conception element. (9) EXPERIENCE COVERAGE — every view, configuration, milestone and piece of guidance the experience plan declares has its task (a view task carrying the plan's viewRef verbatim, an onboarding document's objective naming its hostViewRef), and a decided `home` is set by the `GLOBAL_VIEWS` task's objective (it names `homeDefinitionFactory` and the home), and a `VIEW` home's blocks are carried by the objective of the task that builds the home view, each listing block drawn as its rows (`collectionToolbar: CollectionToolbarPresence.HIDDEN`); an entry with no task, or a decided home no objective sets, is a GAP, and an objective that drops what the plan decided for its entry (reused components, the moment, the gate, a home block) is a CONCERN. With NO experience plan the plan rightly carries none of these tasks: mark PASS and begin the note with 'NO EXPERIENCE PLAN:' naming what the application will lack — never a CONCERN or GAP, because the decomposer cannot produce an upstream family by revising. (10) ROLE COVERAGE — every requirement that names groups of users with different access is served by an `APPLICATION_ROLES` task producing one `APPLICATION_ROLE` per group no core role covers, ordered after the config tasks of the resources it narrows; a group with no role, or a role requirement answered by a task or resource that stores roles or permissions as data, is a GAP; a roles task ordered before a config task it narrows, or whose objective does not say which operations each role may call, is a CONCERN. (11) INTERACTION COVERAGE — every transition the domain plan's lifecycles declare has its `RESOURCE_OPERATION` product named by its `transitionRef` (a transition that creates a resource says so in that task's objective; a separate task for the write, or an operation named after a transition with something added, is a GAP), and every functional acceptance criterion whose verb goes beyond the default resource verbs (a state change, one record creating or filling another, a record that must stop changing, a produced document, a sent message) is served by a task of the matching kind (`RESOURCE_OPERATION`, a `MODULE_BACKEND` implementation, `PDF_TEMPLATE`, the email generation step) whose `servesRefs` name the requirement; a plan whose requirements describe a workflow and which carries no interaction task, or a state change served only by a config task that leaves the status freely editable, is a GAP; a derived value (a next action, an overdue flag) planned as a stored field is a CONCERN. On the person's side of each lifecycle, a resource with a lifecycle and no `RESOURCE_UI_BEHAVIOR` task is a GAP (its page is the engine's generated one, which knows no route), and a transition objective that does not offer the step only from its `from` states on every variant, a refusal the operation can raise left unworded for the person, or a lifecycle resource's ui-behavior objective that does not state its record page (status as the leading pill shown once — on the header or as `<RecordState>`, never both — next steps as worded actions ordered by `displayPriority`, sections in business order, record keeping last in `<RecordKeepingFacts>`) is a CONCERN. (12) ORGANIZATION MODEL COVERAGE — every organization type the domain plan's `organizationModel` declares is an `ORGANIZATION_TYPE` product of an `ORGANIZATION_MODEL` task carrying its offered roles, user types and `requiresMfa`, the owning type with `ownsApplication: true` revising the configuration's existing owner type whatever its key and, where the configuration still holds other names, renaming it and its people to the plan's names with `renamedFrom` (a second owner type, or a replaced one, is a GAP), and every relationship kind the configuration does not already carry is an `ORGANIZATION_RELATIONSHIP_KIND` product; every unit confinement is an `ORGANIZATION_UNIT_CONFINEMENT` product with its mode and field; every resource whose records live in a system of record carries a `SYSTEM_OF_RECORD_BINDING` product on its config task, `partitioned` exactly as the entry's split by legal entity decides (true for `BY_LEGAL_ENTITY` or `UNCONFIRMED`). An entry with no product, or a binding whose `partitioned` is absent or says otherwise, is a GAP; a relationship between organizations built as a module or a resource is a GAP (the engine owns those rows); a confinement task ordered before the config task of a resource it confines is a CONCERN. With no organization model, mark PASS. (The deterministic gates and the creator's approval remain the floors; the judge's verdicts are advisory notes beside them.)\n",
|
|
115
|
+
"guidance": "# Build Decompose — Domain Plan → Ordered Coding-Agent Task Graph \n\n### Target Application Framing\n\nThis knowledge is for configuring behavior in the target application.\nWildo is the framework surface being used, not the product being built.\n\nRead and apply these patterns from the application-developer point of view:\n\n- how the application should configure the relevant app-level file\n- how the application should use framework-provided factories, enums, and helpers\n- how the application should avoid mixing frontend, backend, and infrastructure concerns\n\n\nThe output follows the existing `BuildPlanTaskGraph` contract. The host checks its\nshape and graph consistency, then uses `prerequisiteTaskRefs` to determine readiness.\nFunctional topics organize context; they do not create scheduling edges. Decompose\nthe work using the current contracts rather than designing a replacement planner.\n\n## Where you are in the journey\n\nThis is the **first build-execution playbook** — the pivot from **planning the\ndomain** (the domain-plan: modules, per-module resource inventory, relationship\nintents) to **decomposing the build** (the ordered set of buildable tasks). It runs\nin the **bottom-up phase**, after the domain plan exists (`artifact_exists\ndomain-plan`). You are not re-opening domain questions here — you are turning an\n*approved* domain plan into the *ordered work that builds it*.\n\nDownstream of this playbook, two further playbooks consume your output: the\n**dispatch-orchestration** playbook dispatches the tasks through the coding-agent\ncontract in parallel waves (up to the application's build parallelism at once), and the\n**scale** playbook describes how those waves are scheduled, interleaved with the\ncompanion generation steps, and reconciled. **You author neither of those concerns** — see the\nboundary section below.\n\n## What this playbook does\n\nYou are the **build planner**. This playbook reads the approved domain plan and the\ndefinition set and drafts the **build plan**: the answer to *\"what ordered sequence\nof coding-agent tasks turns this domain plan into a running app?\"* You produce **one\nartifact**: the **build-plan** family — an **ordered task graph**, each task bound\nonto the **7-topic functional taxonomy** and the **app-knowledge skill catalog**.\n\nThis is a **decomposition pass**. You name tasks, their target, **what each one\nproduces**, their topic, their skill(s), and their ordering intent. You do **not** dispatch any task, capture any\nchange-set, author any schema, or generate any code — that is the job of the\ndownstream dispatch / scale playbooks and the coding agents they run.\n\n## Read state first — what you read, the one artifact you write\n\nThis playbook is **idempotent** and, on a re-run, a *refinement*. Before decomposing\nanything:\n\n1. Read the current journey state and scope from what this run is given — the loaded\n specifications and the workspace sections of your brief — and do not re-derive it. Confirm the domain plan is present and\n approved, and check whether a `build-plan` already exists from an earlier run\n (refine it, do not re-author — see below).\n2. Read the approved domain plan and the definition set. **Load-bearing** (these drive\n the decomposition): the **domain-plan** (`domain-plan` — the module decomposition +\n each module's `mainResources` / `supportingResources` inventory) and the\n **relationship drafts** (inside the domain-plan value — the inter-resource relationship\n intents, each with two ends + cardinality intent + ownership direction).\n **Contextual** (they shape ordering and task briefs, not the core decomposition):\n the **roadmap** (`roadmap` — the release phasing, so MVP-critical modules are\n sequenced before later ones) and the **requirements** + **feature-drafts** (the\n prose contracts each task's brief points the coding agent at).\n\n(Both are already in your brief: the domain plan renders under \"# Accepted application truth\", and\nthe real module/resource state arrives as the declared `workspace_truth` context section of your brief. There is no command to\nrun in this mode.)\n\nYou **read** `domain-plan` (incl. its relationship drafts) + `roadmap` + `requirements` +\n`feature-drafts`, and the **business model** for its pricing plans (the billing catalogue, Step 3);\nyou **write** the `build-plan` family.\n\n3. Read the **current application workspace** section supplied with this brief (the real\n module ids and each resource's present schema fields). It is BINDING, in both directions:\n - Every task's `moduleRef` MUST be one of the listed module ids, exactly — a module id\n the workspace does not carry is an invented address the dispatcher cannot route.\n - A resource the workspace already lists exists as a **compose-born starter skeleton**\n (registered, typechecking, carrying the fields shown). Its stage tasks are\n **enrichment** tasks: their objective states what domain content to ADD or CHANGE.\n An objective that asks to \"create\" or \"scaffold\" such a resource describes work that\n is already done, and the dispatched coding run will correctly change nothing.\n\n## Every task declares WHAT IT PRODUCES\n\nEach task carries `produces`: the artifacts the finished application will contain\n*because this task ran*. It is how the host answers **\"has this task landed?\"**, and\nit is not optional thinking: without declared products the host cannot probe the\nintended result. A COMPLETED durable run lets the loop advance, but the task remains\nexplicitly marked in `unverifiableLandedTaskRefs` as ran, not proven.\n\n**`target` and `produces` answer different questions, and a task needs both.**\n`target` is the WRITE SCOPE — which module tree this run may edit. Several tasks\nlegitimately share one. `produces` is the PRODUCT IDENTITY — what this task, and no\nother, is accountable for. Wonder CRM's plan proved they cannot be the same field:\nits pipeline-view task and its follow-through-operation task carry byte-identical\ntargets, so nothing derived from `target` could ever tell them apart, and 40 of its\n42 tasks were reported finished while none had run.\n\n**The one rule that makes a product real: name something the SCAFFOLD does not\nalready contain.** Every module, every resource file and every resource\nspecification is written by composition before any task exists. So \"the resource\nconfig file\" is not a product — it was there on day one. The VERBS it gains are.\nApply that test to every product you write.\n\n| product | you name | use it for |\n|---|---|---|\n| `RESOURCE_SCHEMA_FIELDS` | `resourceRef` + the `fieldRefs` the task adds | a schema stage. The FIELDS, never the file — the file is scaffolded. A `fieldRef` is the field's own IDENTIFIER as it will stand in the schema (`slug`, `archivedAt`, `completedAt`), never a description of what the fields express |\n| `RESOURCE_REGISTRATION` | `resourceRef` + the `operationRefs` it gains | a config stage |\n| `RESOURCE_UI_BEHAVIOR` | `resourceRef` | a ui-behavior stage — the one artifact composition never writes |\n| `RESOURCE_SPECIFICATION` | `resourceRef` + the `fieldRefs` it documents | a spec stage. The fields again: the spec file is scaffolded too |\n\n**A product ref is an ARTIFACT IDENTITY, not a concept.** Every `produces` entry is read back by a\nLANDING PROBE that searches the application's own source for that ref — in its plain, camelCase,\nPascalCase and SCREAMING_SNAKE spellings — and a task lands only when the probe finds it. So a ref\nnaming something that will never appear in the tree makes the task permanently unlandable, however\ncorrectly it is built.\n\nMeasured on the first end-to-end journey run (#1273): all sixteen schema tasks declared refs like\n`private-workspace-shape`, `membership-access-shape` and `one-sentence-rationale-shape` — eighteen\nrefs, not one of them a field. The schemas were authored correctly and committed; every task stayed\nunlanded, the loop guard then refused the whole band at task one, and the board read 9 of 94 while\nthe work was being done.\n\nName what a reader will find in the file. `slug`, `description`, `archivedAt` — not the idea they\nserve together. If you cannot name the fields yet, the task is not decomposed far enough to declare a\nproduct, and `TASK_DECLARES_NO_PRODUCT` is the honest answer rather than a placeholder concept.\n| `RESOURCE_RELATIONSHIP` | `relationshipRef` + `sourceResourceRef` + `targetResourceRef` | a relationship-wiring task. Both endpoints, because the scaffold already declares each resource's own edges |\n| `RESOURCE_OPERATION` | `resourceRef` + `operationRef` | a custom operation |\n| `APPLICATION_VIEW` | `viewRef` | an app-level view. With an experience plan, the `viewRef` is the plan's own (`view-…`), verbatim |\n| `APPLICATION_DOCUMENT` | `documentRef` | a governed document the engine catalog DEFINES — see the closed list below. Never a document you name yourself |\n| `APPLICATION_MODULE` | `moduleRef` | an ensure-module task. The REGISTRY entry, not the directory |\n| `APPLICATION_FRONTEND_CONFIG` | `configSurface` + the `declarationRefs` the file gains | composing ONE app-wide config file — `NAVIGATION`, `DESIGN_SYSTEM`, `APP_SHELL`, `GLOBAL_VIEWS`, `SHELL_LAYOUT`. The DECLARATIONS (a sidebar section ref, a zone, a token, the one layout constant), never the file: `wildo init` writes every one of them |\n| `RESOURCE_COMPOSITE_VIEW` | `resourceRef` + `viewRef` | a composite view of one resource, bound in its ui-behavior's `compositeViews`. The plan's `viewRef`, verbatim |\n| `RESOURCE_CUSTOM_VIEW` | `resourceRef` + `viewRef` | a custom operation view or an execution view of one resource, bound in its ui-behavior. The plan's `viewRef`, verbatim — it is how the dispatch tells an execution view from a custom one |\n| `RESOURCE_CHART_VIEW` | `resourceRef` + `chartRef` | a chart view declared under the resource's `chartViews` |\n| `CUSTOM_COMPONENT` | `componentRef` | a custom frontend component, registered on the module's frontend index or in the engine registrations |\n| `APPLICATION_MILESTONE` | `milestoneRef` | a milestone the module declares — the experience plan's identifier, as a slug |\n| `APPLICATION_GUIDANCE` | `guidanceKind` + `guidanceRef` | an onboarding document or guidance flow the module declares — the experience plan's `kind` and ref |\n| `PDF_TEMPLATE` | `resourceRef` + `templateRef` | a PDF template BOUND to a resource's generated-file field (`generatedSummaryPdf`) |\n| `APPLICATION_WORKER` | `workerRef` (the integration plan's `worker-<slug>`, verbatim) + the `jobRefs` its entry file declares | a worker's behaviour. The JOBS, not the package: `add-worker-node` / `add-worker-rust` write the package |\n| `APPLICATION_MINION` | `minionRef` (the integration plan's `minion-<slug>`, verbatim) + the `behaviorRefs` its entry file declares | a minion's tick behaviour. Same rule: `add-minion` writes the package |\n| `PROVIDER_BINDING` | `providerRef` + `scope` (`BACKEND`, `COMPANION`, `FRONTEND_APP`, `WEBSITE`), + `augments` when the binding has it | one provider declared in one runtime owner's scope — the SaaS config block, or the service's `provider-contributions.ts`. With `augments`, the module's opt-in under `providers.augmentations.<augments>` instead |\n| `WEBSITE_PAGE` | `pageRef` | a marketing page, registered in `website-root.config.ts` by its manifest |\n| `WEBSITE_SECTION` | `pageRef` + `sectionRef` | one section of one page, declared in `<pageRef>.sections.tsx` |\n| `DOCUMENTATION_CHAPTER` | `chapterRef` | the chapter's authored body, in its own file `specifications/src/technical-documentation/chapters/<chapterRef>.ts`, which `wildo docs publish` joins to the documentation plan and publishes under `/guides/<slug>` |\n| `APPLICATION_BILLING_PRODUCT` | `productKey` | one product of the application's billing catalogue, named by its catalogue `key` (a slug, e.g. `team`) — declared in `shared-lib/src/engine/product.ts` under the `BILLING_CATALOG` target. The KEY, never the file: `wildo init` writes the file with an empty catalogue |\n| `APPLICATION_ROLE` | `roleRef` | one role the application declares, named by its key in `CUSTOM_ROLES_CONFIGURATION` (upper snake case, e.g. `FIELD_TECHNICIAN`; never a core role such as `ORG_MEMBER`) — declared in `shared-lib/src/engine/roles.ts` under the `APPLICATION_ROLES` target. The NAME, never the file: `wildo init` writes the file with an empty table |\n| `APPLICATION_DATA_SEED` | `seedKey` + `resourceRef` + `content` (`REFERENCE` or `DEMONSTRATION`) | one data seed a module declares, named by its key (`<moduleRef>:<purpose>`, e.g. `crm:demo-customers`) — the file `backend-api/src/modules/<moduleRef>/seeds/<seedKey with : as .>.seed.ts`, registered by the module. A `DEMONSTRATION` seed lands only once it declares the environments it runs in, without production |\n| `INBOUND_CHANNEL_HANDLER` | `channel` + the handler's `handlerRef` (`<moduleRef>.<purpose>`, e.g. `matters.mail-intake`) | the handler that decides what a message arriving on a channel the integration plan declared causes. Its file is `backend-api/src/modules/<moduleRef>/inbound/<handlerRef>.inbound-channel-handler.ts`, and it lands when the module's backend `index.ts` imports that file — which is how it is registered on `inboundHandlers` |\n| `APPLICATION_AGENT` | `agentRef` + `shape` (`CHAT_ASSISTANT`, `AUTONOMOUS`, `INVOKED`, `FLOW_STEP`) | one AI agent, named by the `ref` it is registered under (lower case, e.g. `tasks.overdue-triage`). An `AUTONOMOUS` agent is named by its autonomous declaration's `ref`, every other shape by the agent's own. It lands when the TASK'S module registers that ref (`flowsActors.agents`, or `autonomousAgents` for `AUTONOMOUS`) and the module's backend `index.ts`, its `addons/flows-actors/index.ts` and every file that index imports are present. The shape also decides the skill the task is built with |\n| `AGENT_APPROVAL_GATE` | `functionRef` + `route` (`owner`, `role`, `assignee`) + `eligibleRole` for `role` and `assignee` | the approval gate on one function tool an agent calls, named by the `functionRef` it is registered under — `resource.<resourceType>.<operation>` for a resource tool, with the resource type as the code spells it (`resource.adjustmentProposals.post`). Its calls wait for the person the route names. `owner` is the person whose turn it is and takes no role; `role` and `assignee` name the role the approver must hold (a role the application declares, or a core role). It lands only when the registered tool's gate has that route AND that role, so a gate routed to anyone else does not land |\n| `WORK_UNIT_RESOURCE` | `resourceRef` | the resource whose rows are the application's CASES — the unit model spend is attributed to and cost per case is read by. It lands when the resource's configuration declares `workUnit: true` |\n| `METERED_USAGE_RECORDING` | `resourceRef` + `operationRef` + `productKey` + `oncePerRecord`, and `serviceMethodServiceRef` when it bills a service of the firm's method | one operation of one resource that records usage of one METERED billing product when it succeeds (`recordsUsage` on the operation), named by the operation as the resource's configuration keys it (`record-sign-off` for `record_sign_off`) and the product's catalogue `key`. `oncePerRecord: true` counts each row once, which is what a price per case needs. It lands when the resource's configuration declares exactly that recording on that operation |\n| `RESOURCE_RETENTION_BINDING` | `resourceRef` + `retentionClass` (`RESOURCE_DATA`, `FILES`, `AUDIT_LOGS`, `OPERATIONAL_LOGS`, `BUSINESS_RECORDS`) | how long one resource's rows are kept: its configuration's `retentionBinding` in that class. It lands when the resource's configuration declares that class |\n| `RELATIONSHIP_CONFERRED_ROLE` | `relationshipRef` (the relationship kind's key, e.g. `service`) + `roleRef` | one role an organization relationship confers: in `wildo.saas.config.ts`, the kind's `confers.roles` holds it and every organization type the kind grants offers it in `availableOrgRoles`. Under the `APPLICATION_ROLES` target. It lands when the configuration, read fresh, says so |\n| `ORGANIZATION_TYPE` | `organizationTypeRef` (the entry's `ref`, e.g. `regulated-client`), + `ownsApplication: true` for the type that operates the application, + the entry's `offeredRoles`, `userTypes` and `requiresMfa` | one organization type the domain plan's organization model declares, in `organizationTypes` of `wildo.saas.config.ts`. Under the `ORGANIZATION_MODEL` target. The OWNER type is the configuration's own `ownsApplication` type whatever its key; any other type is found by its key. It lands when that type, read fresh, offers those roles, grants those user types and requires a second factor as planned |\n| `ORGANIZATION_RELATIONSHIP_KIND` | `relationshipRef` (the kind's key, e.g. `partnership`) | one kind of relationship between organizations: a key of `organizationRelationships` in `wildo.saas.config.ts`. Under the `ORGANIZATION_MODEL` target. Never a module and never a resource: the engine owns the relationship rows. It lands when the configuration, read fresh, declares the key |\n| `ORGANIZATION_UNIT_CONFINEMENT` | `resourceRef` + `mode` (`ORGANIZATION_UNIT` or `OWN_ROWS`) + `fieldName` | one resource whose rows are confined below the whole organization: to the unit a member holds a role in (`organizationUnitNarrowing`, on the unit field, usually `organizationUnitId`), or to the rows a member owns (`organizationOwnRows`, on the owner's field, usually `createdByUserId`), in `backend-api/src/bootstrap-config.ts`. Under the `ORGANIZATION_MODEL` target. One resource may carry both modes, as two products. It lands when the backend's startup configuration declares the resource in that mode on that field |\n| `SYSTEM_OF_RECORD_BINDING` | `resourceRef` + `systemOfRecordRef` (the instance's key under `systemsOfRecord`, e.g. `odoo`) + `systemOfRecordKind` (the vendor's facet the domain plan names, e.g. `odoo`) + `access` (`READ_THROUGH` or `OWNED_COPY`) + `partitioned` (`true` when the domain plan splits the records by legal entity) | one resource whose records live in another system: its configuration's `httpApiBinding` (read through) or inbound `externalDataPipeline` (copied) names the instance. Carried by the resource's CONFIG task, since the binding is its configuration. It lands when the configuration binds that instance through that lane and `wildo.saas.config.ts` declares the instance with that `vendor`, with `partition: true` exactly when `partitioned` is true; a copy of a partitioned instance also declares `partitionUnitLocalField` and `partitionKeyLocalField` on its pipeline |\n\n**A GOVERNED DOCUMENT is chosen from a closed list, never invented.** There are six,\nand a `documentRef` names one of them in exactly this form:\n\n```\ndocument:public.privacy-notice document:governance.program-handbook\ndocument:public.service-terms document:governance.scope-system-description\n document:governance.roles-responsibilities\n document:governance.document-record-control\n```\n\nA document is drafted against a BLUEPRINT — the required sections, the required\nfacts, the claim guards — and the blueprint is what the catalog holds. A ref outside\nthis list resolves to no blueprint, so the only thing a coding agent could do is\nINVENT the document's structure, which its authoring skill forbids. The task is then\nunbuildable by any run, and the dispatcher skips it by name rather than spending an\nagent turn rediscovering that.\n\nThis is not a hypothetical constraint. A plan authored against the previous wording\nof the row above — \"a notice, a governance statement\" — declared\n`gdpr-data-handling-governance` and `terminal-access-governance`: two plausible\ngovernance statements, neither of which names anything. Both sat permanently ready,\nand the one that was dispatched spent a full turn establishing that the document does\nnot exist. **If the obligation you have in mind is not on this list, it belongs in a\ndocument that IS** — GDPR data-handling scope, retention and subject rights are\n`document:public.privacy-notice`'s subject matter — or it is not a build task at all.\n\n**A cross-resource FOREIGN KEY belongs to the RELATIONSHIP task, never to the schema\ntask of the resource that holds it.** The domain plan makes the FK derivable — an\n`ownershipIntent` of SOURCE_HOLDS_REFERENCE on `contact-company` says contact carries\n`companyId` — and that is exactly why the mistake is easy: the field is derivable, so\nit is tempting to declare it on the schema task that will contain it. Step 2 below\nmakes the relationship task the SINGLE home for cross-resource wiring, and the\n`module-relationships` skill coordinates that FK across the owner's schema and config.\nDeclaring it in both places attributes one artifact to two tasks — the ambiguity\n`produces` exists to remove, reintroduced through the field that removes it. A schema\ntask's products are the resource's OWN domain fields.\n\nTwo further rules the graph enforces, so authoring against them saves a rejection:\n\n- **No two tasks may claim the same artifact.** That is what makes landing decidable.\n Two tasks may both enrich one resource's schema — it is the FIELDS that must not\n overlap, so split by field, never by prose.\n- **A `COMPANION_GENERATION_STEP` declares NO products.** Its landing is the\n generation step's own condition, computed by the companion. A product declared\n beside one is refused.\n\nProducts stay SEMANTIC. You name a resource, a field, a relationship, a view — never\na path and never a command, exactly as with `target`. The host alone turns a product\ninto a question about the working tree.\n\nThe contract itself, so the vocabulary below is read from the source rather than\nfrom this prose:\n\n## Import Origins\n\n- `@wildo-ai/saas-specifications`\n\n## Source Excerpts\n\n### Origin Package: `@wildo-ai/saas-specifications`\n\n```typescript\n *\n * Versioning for the build-plan task-graph payload format itself. `V1` —\n * initial shape (one ordered `tasks` collection with typed targets and\n * declared prerequisites). The shape grows additively across versions; the\n * `version` field is the explicit marker for consumers that branch on era.\n */\nexport enum BuildPlanTaskGraphVersion {\n V1 = 'v1',\n}\n\n/** Stable prefix every build-plan task ref carries; the trusted runtime stamps it, a provider supplies only the slug. */\nexport const BUILD_PLAN_TASK_REF_PREFIX = 'build-task-';\n\n/**\n * WHAT a build task builds — a closed vocabulary, because the host derives\n * the physical mutation scope and verification policy from the target kind\n * and the model must never author those powers through free text.\n */\nexport enum BuildPlanTaskTargetKind {\n /** A whole application module (its shared-lib registration, backend module and frontend module skeletons). */\n MODULE = 'MODULE',\n /** One build stage of one resource: schema → config → ui-behavior → spec. */\n RESOURCE_STAGE = 'RESOURCE_STAGE',\n /** The relationships between resources wired in ONE module's relationships file (#3209): one task per file, not per edge. */\n RELATIONSHIP = 'RELATIONSHIP',\n /** A companion-owned deterministic generation step (labels, email templates, logo or database migrations) interleaved by the build loop, never a coding-agent run. */\n COMPANION_GENERATION_STEP = 'COMPANION_GENERATION_STEP',\n /**\n * Authoring one SHELL SURFACE's placement configuration from the accepted\n * placement plan — the settings rail, the sidebar, the user menu or the\n * command palette.\n *\n * Its own kind rather than a reuse of the neighbours, because none of them is\n * true of it: it is not a MODULE or a RESOURCE_STAGE (it is application-wide\n * and belongs to no resource), not a RELATIONSHIP, and emphatically not a\n * COMPANION_GENERATION_STEP — that kind is documented as \"never a coding-agent\n * run\" and writing `settings-hub.config.ts` is exactly a coding-agent run.\n * Borrowing one would hand the host the wrong mutation scope and the wrong\n * verification, which is what the closed vocabulary exists to prevent.\n */\n SHELL_PLACEMENT = 'SHELL_PLACEMENT',\n /*\n * THE NON-RESOURCE SURFACES (#1490). Until 2026-09-22 the five kinds above were the whole\n * vocabulary, and every one of them is about a resource or the shell placement of one. The\n * decompose method meanwhile told the planner to emit tasks for views, navigation, the design\n * system, custom components, PDF templates, workers, minions, providers, the website and the\n * documentation — surfaces the framework's own composition scenarios and 85 of its 111 skills\n * already build. A task for any of them had no kind to declare, so it either declared none\n * (landing as RAN-not-PROVEN forever) or borrowed `MODULE` with a product the module scope could\n * not prove. The members below are those surfaces, one per write scope the host can derive.\n */\n /**\n * The FRONTEND and SPECIFICATION layers of one module — its composite, custom and chart views,\n * its custom components and their specifications.\n *\n * Narrower than `MODULE` on purpose: a view task never touches `shared-lib` or `backend-api`, so\n * handing it the four-layer scope also hands it four typechecks and the FK sweep for a change\n * that can only break the frontend and the specifications package.\n */\n MODULE_FRONTEND = 'MODULE_FRONTEND',\n /**\n * The BACKEND layer of one module beside its shared-lib declarations — PDF templates and their\n * bindings, backend addons (services, controllers, flows-actors), email definitions.\n *\n * Shared-lib is in scope because a PDF template is bound to a resource FIELD the config declares\n * (`generatedSummaryPdf`), and a backend addon usually declares its contract there first.\n */\n MODULE_BACKEND = 'MODULE_BACKEND',\n /**\n * ONE application-wide frontend configuration surface — navigation, the design system, the app\n * shell's composition, the global views, the shell layout — named by {@link FrontendConfigSurface}.\n *\n * Distinct from {@link SHELL_PLACEMENT}, which authors the placement plan's decisions into the\n * shell files: a placement puts a decided subject in a decided group, while this kind COMPOSES\n * the surface itself (which sidebar sections exist, which transitions the primary zone uses,\n * which palette the product carries). Same file for `APP_SHELL`, different question.\n */\n APPLICATION_FRONTEND_CONFIG = 'APPLICATION_FRONTEND_CONFIG',\n /** The marketing website workspace (`website/`), composed by the `add-website` scenario. Pages and sections are its products. */\n WEBSITE = 'WEBSITE',\n /**\n * The technical-documentation workspace (`technical-doc/`) and the specification package's\n * `technical-documentation/` declarations that feed it. Its generated tree is never written by a\n * task: the companion publishes into it, and the coding policy prohibits it by prefix.\n */\n TECHNICAL_DOCUMENTATION = 'TECHNICAL_DOCUMENTATION',\n /** One worker package (`workers/<slug>/`, named by the integration plan's `worker-<slug>`), Node or Rust, plus its declaration in the SaaS config. */\n WORKER = 'WORKER',\n /** One cron minion package (`minions/<slug>/`, named by the integration plan's `minion-<slug>`) plus its declaration in the SaaS config. */\n MINION = 'MINION',\n /**\n * Declaring one provider in the application — the SaaS config's provider scopes, the backend\n * package dependency, the frontend provider module and its companion contribution.\n *\n * Application-wide by construction: a provider binding names no module, and the four files it\n * may touch are the same for every provider.\n */\n PROVIDER_BINDING = 'PROVIDER_BINDING',\n /**\n * The application's BILLING CATALOGUE — the `ProductDefinition[]` in `shared-lib/src/engine/product.ts`\n * (and the product specifications that document it), which the backend syncs to the billing\n * provider and the public website reads for its pricing page (#1835).\n *\n * Its own kind because none of the others is true of it: the catalogue is application-wide (a plan\n * belongs to no module), it lives in the shared library's ENGINE module that no `MODULE_*` scope\n * reaches, and before it existed a journey-built application reached its website with an EMPTY\n * catalogue, so the website re-typed the business model's prices by hand.\n */\n BILLING_CATALOG = 'BILLING_CATALOG',\n /**\n * The application's own ROLES — `CUSTOM_ROLES_CONFIGURATION` in `shared-lib/src/engine/roles.ts`, the\n * organization types that offer them (`availableOrgRoles` in `wildo.saas.config.ts`), their\n * specifications, and the `roles` of the operations they unlock (#2490).\n *\n * Its own kind because none of the others reaches it: the role table is application-wide and lives in\n * the shared library's ENGINE module. Before it existed a requirement naming user groups (\"office and\n * field users see different things\") had no task able to declare a role, so app-creation-test-005\n * modelled roles as an access-role RESOURCE that nothing reads.\n */\n APPLICATION_ROLES = 'APPLICATION_ROLES',\n /**\n * The application's ORGANIZATION MODEL (#3035, #3036): the organization types and the relationship kinds between them,\n * declared in `wildo.saas.config.ts` (`organizationTypes`, `organizationRelationships`), and the confinements of an\n * organization's rows to its units or to their owners, declared in the backend's startup configuration\n * (`backend-api/src/bootstrap-config.ts`: `organizationUnitNarrowing`, `organizationOwnRows`).\n *\n * Its own kind because none of the others is true of it. It is application-wide and names no module, like the role\n * table, but it is not the role table: an organization type is the shape a tenant takes (its user types, the roles it\n * offers, how it is joined), and a relationship kind is what one organization may do for another. Borrowing\n * `APPLICATION_ROLES` would have given a task deciding them the role table's scope and the roles skill. Before it\n * existed, creation could lay these down only from fixed blueprints, and a confinement the requirements stated\n * produced no work at all, so a generated internal tool showed every record to every member.\n */\n ORGANIZATION_MODEL = 'ORGANIZATION_MODEL',\n}\n\n/**\n * WHICH application-wide frontend configuration surface a task composes — one file each (in\n * `frontend/src/config/`, except the shell layout, whose one line lives in the engine registrations\n * file), and the coding policy resolves the member to that file exactly as `SHELL_PLACEMENT` resolves\n * a `PlacementSurface`.\n *\n * Its own vocabulary rather than a reuse of `PlacementSurface`: a placement surface is WHERE a\n * subject sits in the shell (settings hub, sidebar, user menu, command palette), and three of\n * those live in one file. A configuration surface is WHICH FILE a composition task authors, and\n * navigation and the design system are not places anything is placed.\n */\nexport enum FrontendConfigSurface {\n /** `frontend/src/config/navigation.config.ts` — zones, transitions, overlay appearance. */\n NAVIGATION = 'NAVIGATION',\n /** `frontend/src/config/design-system.config.ts` — palette, typography, shell appearance from the brand's visual tone. */\n DESIGN_SYSTEM = 'DESIGN_SYSTEM',\n /** `frontend/src/config/app-shell.config.ts` — top bar, sidebar sections, quick switcher: the shell's COMPOSITION, not a placement into it. */\n APP_SHELL = 'APP_SHELL',\n /** `frontend/src/config/global-views.config.ts` — the application-level launcher and view registrations. */\n GLOBAL_VIEWS = 'GLOBAL_VIEWS',\n /**\n * `frontend/src/engine/component-registrations.frontend.ts` — the ONE animated 2D shell layout the application moves\n * in (`register2DLayout(MORPH_LAYOUT_2D, { speed })`), decided beside the design system because both are the\n * brand's: the design system its palette and pace, the layout how the shell moves at that pace. Its single\n * declaration names the layout constant, written out. A 3D layout is never decided here: it is the operator's\n * opt-in, through the `add-3d-layout` composition scenario.\n */\n SHELL_LAYOUT = 'SHELL_LAYOUT',\n}\n\n/**\n * The two shapes of guidance an application gives a person, and the file each is declared in.\n *\n * They are distinct because they are found differently: an onboarding DOCUMENT is embedded in a\n * screen (`EmbedOnboarding`) and is there whenever that screen is, while a guidance FLOW is started\n * by an event and shows once. Both are listed on the owning frontend module — `onboardingViews` and\n * `guidanceFlows`. Each kind has a CONVENTIONAL definitions file, which the authoring skill teaches\n * and a landing probe reads for the declared ref (alongside the module's `index.ts`, where a small\n * module may declare inline). A convention for generated applications: a hand-authored application\n * may keep its declarations elsewhere, and then simply is not probed by a build plan.\n */\nexport enum ApplicationGuidanceKind {\n /** `frontend/src/modules/<m>/app-level-views/onboarding-views.definitions.ts` — an embedded onboarding document. */\n ONBOARDING_DOCUMENT = 'ONBOARDING_DOCUMENT',\n /** `frontend/src/modules/<m>/app-level-views/guidance-flows.definitions.ts` — a triggered guidance flow. */\n GUIDANCE_FLOW = 'GUIDANCE_FLOW',\n}\n\n/**\n * The two worker runtimes the framework composes (`add-worker-node`, `add-worker-rust`). The\n * runtime decides the entry file a landing probe reads and whether a typecheck exists to run: a\n * Node worker is verified by its package typecheck, a Rust worker has no TypeScript to check and\n * the policy says so rather than inventing a command.\n *\n * Not the SaaS config's `WorkerRuntime`, which is a free-form `{ type, language }` pair an\n * application authors for deployment; this is the closed set a creation run can COMPOSE.\n */\nexport enum BuildPlanWorkerRuntime {\n NODE = 'NODE',\n RUST = 'RUST',\n}\n\n/**\n * WHERE a provider is bound — which runtime owner's scope its declaration lands in. Each member\n * is a different file, so a probe and a write grant both derive from it.\n *\n * Named after the SaaS config's own scope keys (`providers.scopes.backend`, `.companion`,\n * `.frontendServices.app`, `.frontendServices.website`), which the `add-provider` and\n * `add-file-picker-provider` scenarios write. Minion and worker scopes are deliberately absent:\n * a provider reaching a minion is declared on that minion's own `providers` block and belongs to\n * the {@link BuildPlanTaskTargetKind.MINION} task that builds it.\n */\nexport enum ProviderBindingScope {\n BACKEND = 'BACKEND',\n COMPANION = 'COMPANION',\n FRONTEND_APP = 'FRONTEND_APP',\n WEBSITE = 'WEBSITE',\n}\n\n/**\n * The inbound channels a creation run can PLAN (#1630, #3394): the members of `InboundChannelKind` an application\n * declares as channels work arrives on, and that a channel handler can be built for. One list, read by the integration\n * plan's declaration and by the build task's product, so the two cannot disagree about what is plannable.\n *\n * `EMAIL` (received by the `EMAIL_INBOUND` provider, routed by the address) and `SMS` (received by the SMS provider's\n * notification endpoint, routed by the number the text was sent TO). `WEBHOOK` is absent on purpose: it is the channel\n * every signed delivery from another system arrives on, derived for that delivery and never declared.\n *\n * ## A NAMED const object, not a TypeScript enum and not an array (#3685)\n *\n * The schemas read it as `z.enum(PlannableInboundChannelKind)`, so the schema node keeps THIS object as its\n * vocabulary, and a landed build or integration plan can name it: `deriveLandingRenderEnumBindings` resolves an\n * enum node by the IDENTITY of that object against the package's exports. `z.enum([EMAIL, SMS])` built a fresh\n * anonymous object, which nothing exports, so every plan landing refused (\"Closed vocabularies with no exported\n * name … tasks.*.produces.*.channel (email, sms)\"), so no build plan could land at all.\n *\n * Not a TypeScript enum, because a subset of a vocabulary must keep the OWNER's members: an enum would make\n * `PlannableInboundChannelKind.SMS` a nominal type of its own, no longer an `InboundChannelKind`, and every reader\n * that maps a planned channel onto the inbound vocabulary would stop compiling. Each member here IS the\n * `InboundChannelKind` member, so a landed `PlannableInboundChannelKind.SMS` is assignable where the channel is read.\n */\nexport const PlannableInboundChannelKind = {\n EMAIL: InboundChannelKind.EMAIL,\n SMS: InboundChannelKind.SMS,\n} as const;\nexport type PlannableInboundChannelKind = (typeof PlannableInboundChannelKind)[keyof typeof PlannableInboundChannelKind];\n\n/**\n * The same vocabulary as a list, for code that iterates it. Derived from {@link PlannableInboundChannelKind}, never\n * written twice.\n */\nexport const PLANNABLE_INBOUND_CHANNEL_KINDS: readonly PlannableInboundChannelKind[] = Object.values(PlannableInboundChannelKind);\n\n/** The per-resource build stages, in their fixed order. */\nexport enum BuildPlanResourceStage {\n SCHEMA = 'SCHEMA',\n CONFIG = 'CONFIG',\n UI_BEHAVIOR = 'UI_BEHAVIOR',\n SPEC = 'SPEC',\n}\n\nconst SlugSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);\n\n/**\n * The key of the domain-plan MODULE a task targets or produces (`deals`, `tasks-manager`). Same\n * slug grammar as the other keys, declared as its own schema because it names one thing — a\n * module — where the other slugs name resources, relationships, steps, workers and products.\n */\nconst ModuleRefSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);\n\n/**\n * The governed document a task produces, named as a COMPLIANCE-DOCUMENT CANDIDATE names it:\n * `document:<namespace>.<id>`, e.g. `document:public.privacy-notice`.\n *\n * **This field was `SlugSchema`, and a slug cannot name a governed document — so until 2026-09-16 no\n * build plan in any application could declare a document the engine catalog defines.** A slug forbids\n * the colon and the dot, the catalog's definitions are `document-definition:public.privacy-notice`,\n * and `selectAssuranceDocumentBlueprintForDocumentRef` joins the two namespaces by exact suffix — so\n * every authored `documentRef` resolved to NO blueprint, and a blueprint is what says which sections,\n * facts and claim guards the document owes. The two vocabularies were disjoint by construction.\n *\n * The cost is measured rather than theoretical. Wonder CRM's plan declares two such products\n * (`gdpr-data-handling-governance`, `terminal-access-governance`), neither of which names anything;\n * the first was dispatched, and its agent spent a full turn establishing — with a positive control —\n * that the document does not exist and could only be invented, which the authoring skill forbids.\n *\n * The bare slug is STILL ACCEPTED, and that is deliberate rather than tidiness left undone: tightening\n * this to the namespaced form alone would make every already-accepted plan carrying one fail to parse,\n * and a build plan that cannot be READ stops the whole lane — the gate\n * `application-creation-directive.md` forbids, for a task nobody can fix by re-running anything. A slug\n * simply resolves to no blueprint, so the dispatcher skips that task with a message naming the ref,\n * and the rest of the plan proceeds.\n */\nconst DocumentProductRefSchema = z.union([\n z.string().regex(/^document:[a-z0-9]+(?:-[a-z0-9]+)*\\.[a-z0-9]+(?:-[a-z0-9]+)*$/),\n SlugSchema,\n]);\n/**\n * A skill ref is the skill's FOLDER id in the app-knowledge catalog, which is\n * also its `SKILL.md` frontmatter `name` — one id, kebab-case. The host refuses\n * any skill name outside `[a-z0-9-]+`, so a ref that does not match this shape\n * can never resolve to an installed skill.\n */\nconst SkillRefSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);\nconst NonEmptyStringSchema = z.string().trim().min(1);\n\n/**\n * WHAT a build task PRODUCES — the artifact whose presence in the application\n * proves the task is done.\n *\n * **This is not `target`, and the difference is the whole reason it exists.**\n * `target` is a WRITE SCOPE: the host turns it into the path prefixes a run may\n * mutate, and several tasks legitimately share one. `produces` is a PRODUCT\n * IDENTITY: it says which artifact this task, and no other, is accountable for.\n *\n * Measured 2026-09-10 on Wonder CRM (issue #597): `build-task-pipeline-view`\n * and `build-task-deal-follow-through-operation` carry BYTE-IDENTICAL targets\n * (`{ kind: MODULE, moduleRef: 'deals' }`), and 7 of that plan's 42 tasks share\n * 3 targets. Landing had been answered by narrowing the target to a module\n * DIRECTORY — which `wildo compose` commits on day one, and which cannot tell\n * two tasks apart even in principle. The loop reported 40 of 42 tasks landed\n * while no coding task had ever run, so `dispatch-next` skipped every one of\n * them and the phase-advance gate read a build that was all but complete.\n *\n * Like `target`, this stays SEMANTIC: a product names a resource, a field, a\n * relationship or a view — never a path, and never a command. The host owns the\n * translation from a product to the physical question it asks of the working\n * tree, exactly as it owns the translation from a target kind to path prefixes.\n * A model that could author the path could author its own mutation scope.\n */\nexport enum BuildPlanTaskProductKind {\n /**\n * Named fields on one resource's schema.\n *\n * The shape an ENRICHMENT task needs, and the reason a product cannot always\n * be \"a file\": every resource file already exists, written by the scaffold\n * with its self-described STARTER shape, so file presence answers nothing.\n * The FIELDS are what the task adds.\n */\n RESOURCE_SCHEMA_FIELDS = 'RESOURCE_SCHEMA_FIELDS',\n /**\n * One resource's declared operations — its registry presence, named by the verbs it gains.\n *\n * The VERBS, not the config file: `<r>.resources-config.ts` is written by the scaffold, so its\n * existence is satisfied before any task runs. That is the exact shape of the defect this\n * vocabulary replaces, and a kind that reproduced it would be worse than no kind at all.\n */\n RESOURCE_REGISTRATION = 'RESOURCE_REGISTRATION',\n /** One resource's frontend ui-behavior. */\n RESOURCE_UI_BEHAVIOR = 'RESOURCE_UI_BEHAVIOR',\n /**\n * One resource's specification, named by the fields it documents.\n *\n * The FIELDS, for the same reason as {@link RESOURCE_REGISTRATION}: every resource is scaffolded\n * with a `*.resource.specification.ts` documenting only the starter shape, so file existence\n * proves nothing about the task that was meant to enrich it.\n */\n RESOURCE_SPECIFICATION = 'RESOURCE_SPECIFICATION',\n /** One relationship edge between two resources, named by the domain plan's `relationshipRef`. */\n RESOURCE_RELATIONSHIP = 'RESOURCE_RELATIONSHIP',\n /** One named custom operation on one resource. */\n RESOURCE_OPERATION = 'RESOURCE_OPERATION',\n /** One named application-level view. */\n APPLICATION_VIEW = 'APPLICATION_VIEW',\n /** One named governed application document (a compliance notice, a governance statement). */\n APPLICATION_DOCUMENT = 'APPLICATION_DOCUMENT',\n /** One application module, registered across the layer registries under one module identity. */\n APPLICATION_MODULE = 'APPLICATION_MODULE',\n /*\n * THE NON-RESOURCE PRODUCTS (#1490). Each names an artifact of a surface the five target kinds\n * above `MODULE_FRONTEND` could not express, and each is probed by the host from committed bytes —\n * a declaration in the one file that registers it, never a directory a scenario already wrote.\n */\n /**\n * Named declarations in ONE application-wide frontend configuration file — a sidebar section\n * ref the app shell gains, a zone the navigation config declares, a token the design system sets.\n *\n * The DECLARATIONS, never the file: every `frontend/src/config/*.config.ts` is written by\n * `wildo init`, so its presence is true before any task runs. Same reasoning as\n * {@link RESOURCE_SCHEMA_FIELDS}, one level up.\n */\n APPLICATION_FRONTEND_CONFIG = 'APPLICATION_FRONTEND_CONFIG',\n /**\n * One composite view of one resource — the cross-resource surface a resource's ui-behavior\n * declares under `compositeViews`. Distinct from {@link APPLICATION_VIEW}, which is\n * application-level and owned by a module rather than a resource.\n */\n RESOURCE_COMPOSITE_VIEW = 'RESOURCE_COMPOSITE_VIEW',\n /** One custom operation or execution view of one resource, bound in its ui-behavior. */\n RESOURCE_CUSTOM_VIEW = 'RESOURCE_CUSTOM_VIEW',\n /** One chart view of one resource, declared under its ui-behavior's `chartViews`. */\n RESOURCE_CHART_VIEW = 'RESOURCE_CHART_VIEW',\n /** One custom frontend component, registered by `componentRef` in the module's or the engine's registrations. */\n CUSTOM_COMPONENT = 'CUSTOM_COMPONENT',\n /**\n * One milestone a module declares — the moment the application recognises and celebrates.\n *\n * Named by its identifier, which is what the module's `milestones.ts` declares\n * (`first-project-created` is spelled `FIRST_PROJECT_CREATED` there). The module FILE is not the\n * product: a module may carry milestones before this task runs, and only the identifier says this\n * one landed.\n */\n APPLICATION_MILESTONE = 'APPLICATION_MILESTONE',\n /** One onboarding document or guidance flow a module declares, named by its ref. */\n APPLICATION_GUIDANCE = 'APPLICATION_GUIDANCE',\n /** One PDF template bound to one resource's generated-file field. */\n PDF_TEMPLATE = 'PDF_TEMPLATE',\n /**\n * One worker's JOBS — the named handlers its entry file declares.\n *\n * The jobs, not the package: `add-worker-node` writes the package, so its directory proves\n * nothing. What a coding task adds is behaviour, and behaviour is a symbol in the entry file.\n */\n APPLICATION_WORKER = 'APPLICATION_WORKER',\n /** One minion's BEHAVIOURS — the named tick handlers its entry file declares. Same reasoning as the worker. */\n APPLICATION_MINION = 'APPLICATION_MINION',\n /** One provider declared in one runtime owner's scope. */\n PROVIDER_BINDING = 'PROVIDER_BINDING',\n /**\n * One product of the application's billing catalogue — a plan, add-on or purchase the application\n * sells — named by its catalogue `key`, which the catalogue file declares (`key: 'team'`).\n *\n * The KEY, not the file: `wildo init` writes `product.ts` with an empty catalogue, so the file proves\n * nothing. Written from the accepted business model's pricing plans, with the plan's price as typed\n * money and the pricing-surface facts (recommended, price disclosure, availability) the plan implies.\n */\n APPLICATION_BILLING_PRODUCT = 'APPLICATION_BILLING_PRODUCT',\n /**\n * One data seed a module declares — rows the application creates for itself, named by the seed's\n * `seedKey` (`crm:demo-customers`).\n *\n * The seed is its own file, `backend-api/src/modules/<module>/seeds/<seedKey with ':' as '.'>.seed.ts`,\n * and it lands only once the module registers it — a seed file nothing imports never runs. Its\n * {@link BuildPlanDataSeedContent} says whether it is REFERENCE data the application needs everywhere\n * or DEMONSTRATION data that must never reach production.\n */\n APPLICATION_DATA_SEED = 'APPLICATION_DATA_SEED',\n /** One website page, registered in the website root config by its manifest. */\n WEBSITE_PAGE = 'WEBSITE_PAGE',\n /** One section of one website page, declared in that page's sections file. */\n WEBSITE_SECTION = 'WEBSITE_SECTION',\n /**\n * One authored documentation chapter — a consumer guide the specifications package declares\n * for the documentation portal to publish (#874's publication input).\n */\n DOCUMENTATION_CHAPTER = 'DOCUMENTATION_CHAPTER',\n /**\n * One inbound CHANNEL handler — the code that decides what a message arriving on a channel causes\n * (#1832). Named by the handler's `ref` (`matters.mail-intake`), which the handler file spells and whose\n * file NAME is derived from it, so the module index's import of that file is what proves the handler is\n * registered. Produced once per channel the integration plan declares (`inboundChannels`).\n */\n INBOUND_CHANNEL_HANDLER = 'INBOUND_CHANNEL_HANDLER',\n /**\n * One role the application declares, named by its role name (`FIELD_TECHNICIAN`), which is its key in\n * `CUSTOM_ROLES_CONFIGURATION`. The NAME, not the file: `wildo init` writes `roles.ts` with an empty\n * table, so the file proves nothing (#2490).\n */\n APPLICATION_ROLE = 'APPLICATION_ROLE',\n /*\n * AGENT WORK (#2966). An agent, the approval gate on one of its tools, and the resource whose rows are the cases its\n * work is costed to. None of them is a name the tree spells in one file: an agent's ref and a gate's role are written\n * through constants in other files, and a gate is a property of a tool object. So each is proven from the REGISTRY the\n * application's backend registers at startup, read through introspection, never from text.\n */\n /**\n * One AI agent the application registers, named by its `ref` — a chat agent's (`agents`) or an autonomous agent's\n * (`autonomousAgents`), as its {@link BuildPlanAgentShape} says. Its shape also decides the skill it is built with.\n */\n APPLICATION_AGENT = 'APPLICATION_AGENT',\n /**\n * The approval gate on one function tool (`humanApproval`): its calls wait for the person the ROUTE names, holding the\n * role the gate requires. Proven when the registered tool's gate has that route and that role, so a gate routed to the\n * wrong role, or a tool left ungated, does not land.\n */\n AGENT_APPROVAL_GATE = 'AGENT_APPROVAL_GATE',\n /**\n * One resource declared as the application's unit of work (`workUnit: true`): its rows are the cases model spend is\n * attributed to, and cost per case is read by them.\n */\n WORK_UNIT_RESOURCE = 'WORK_UNIT_RESOURCE',\n /**\n * One operation of one resource that records usage of one METERED billing product when it succeeds (`recordsUsage`,\n * #2305 S5). How a price per case is billed: the operation that closes a case records one unit, once per case. Proven\n * from the registry like the agent work: the declaration is a property of one operation object in the resource's\n * configuration, which no text in the tree ties to that operation.\n */\n METERED_USAGE_RECORDING = 'METERED_USAGE_RECORDING',\n /**\n * One resource's rows bound to one of the application's retention classes (`retentionBinding`, #2305 S6): how long the\n * firm's case evidence is kept. Proven from the registry: the binding is a property of the resource's configuration.\n */\n RESOURCE_RETENTION_BINDING = 'RESOURCE_RETENTION_BINDING',\n /**\n * One role CONFERRED through one organization relationship kind (#2305 S6): the relationship's `confers.roles` holds it\n * and every organization type the relationship grants offers it (`availableOrgRoles`). How the firm's people come to\n * hold, for a client, the role a decision of its method requires. Proven from the application's configuration\n * (`wildo.saas.config.ts`), read fresh at landing: the role is spelled through constants, so no text can prove it.\n * \"Conferred\" is the kind's CEILING: each client still grants the role, or not, on its own relationship. And the fresh\n * read re-evaluates the configuration and the files it imports by relative path; a value imported from a package is\n * read from that package's build.\n */\n RELATIONSHIP_CONFERRED_ROLE = 'RELATIONSHIP_CONFERRED_ROLE',\n /*\n * THE ORGANIZATION MODEL (#3035, #3036, #3039). What the domain plan's `organizationModel` decides, each proven from what\n * the application DECLARES: its configuration, read fresh, for a type and a relationship kind; the registry its backend\n * assembles at startup for a confinement and a binding. None of them is a name the tree spells in one place (a\n * resource type is written through its constant, a binding's instance through a declaration helper), so no text probe\n * could prove them.\n */\n /**\n * One organization type the application declares in `wildo.saas.config.ts` `organizationTypes`: the shape a tenant\n * takes. Lands when the configuration, read fresh, declares the type carrying what the plan decided of it (the roles\n * it offers, the user types it grants, a required second factor).\n *\n * The type that OWNS the application is identified by `ownsApplication`, never by its key. By the time the build runs\n * the platform has already created the operator's organization under the scaffold's key (`workspace`), and the\n * application line may have set its joining posture, so a plan naming its owner `group` revises THAT type: adding a\n * second owner type is refused by the configuration at startup, and replacing it would lose the organization already\n * created. Its key and its people's user type are renamed to the plan's through a declared rename (`renamedFrom`,\n * #3044), which the foundation usually makes; the product lands only under the plan's key, granting exactly the plan's\n * user types.\n */\n ORGANIZATION_TYPE = 'ORGANIZATION_TYPE',\n /**\n * One kind of relationship between organizations, by its key in `organizationRelationships` (`partnership`): which\n * types represent and which grant, and what the relationship may confer. Never a module and never a resource\n * (#2617): the engine owns the relationship rows. Lands when the configuration, read fresh, declares the key.\n */\n ORGANIZATION_RELATIONSHIP_KIND = 'ORGANIZATION_RELATIONSHIP_KIND',\n /**\n * One resource's rows confined below the whole organization (#3036), in one {@link OrganizationRowConfinementMode}: to\n * the unit a member holds a role in (`organizationUnitNarrowing`), or to the rows a member owns (`organizationOwnRows`),\n * on the field the plan names. Lands when the backend's startup configuration declares the resource in that mode on\n * that field. One resource may be confined in both modes (a department head sees the department's requests, an\n * employee only their own), so the mode is part of the product's identity.\n */\n ORGANIZATION_UNIT_CONFINEMENT = 'ORGANIZATION_UNIT_CONFINEMENT',\n /**\n * One resource whose records live in a system of record (#3039), bound to the instance the application declares under\n * `systemsOfRecord` (`odoo`), of the vendor the domain plan named. Read through (`httpApiBinding`) or copied (an\n * inbound `externalDataPipeline`), as its {@link SystemOfRecordAccess} says. Lands when the resource's configuration\n * binds that instance through that lane and the configuration declares the instance with that vendor, partitioned\n * exactly when the plan splits the records by legal entity (#3045; a copy then stamps each row's partition).\n */\n SYSTEM_OF_RECORD_BINDING = 'SYSTEM_OF_RECORD_BINDING',\n}\n\n/**\n * How an agent is started and talked to (#2966), which decides the skill it is built with\n * ({@link BUILD_PLAN_AGENT_SHAPE_SKILL_REF}) and where its ref is registered.\n */\nexport enum BuildPlanAgentShape {\n /** A person converses with it in the application. Registered under the module's `agents`. */\n CHAT_ASSISTANT = 'CHAT_ASSISTANT',\n /** It runs with nobody signed in: on a schedule, or when a message arrives. Registered under `autonomousAgents`. */\n AUTONOMOUS = 'AUTONOMOUS',\n /** The application's own code calls it once and uses its answer. Registered under `agents`. */\n INVOKED = 'INVOKED',\n /** One step of a declared flow. Registered under `agents`. */\n FLOW_STEP = 'FLOW_STEP',\n}\n\n\n/**\n * What a data seed's rows ARE, which decides where they may exist.\n *\n * - `REFERENCE` — rows the application needs to work wherever it runs: a closed list, a default\n * record, a system template. Every environment, production included.\n * - `DEMONSTRATION` — sample rows that make a freshly created application look lived-in (customers,\n * projects, a few records per list). They must never sit beside real rows, so the seed declares\n * `allowedApplicationEnvironments` without `production`, and the task lands only once it does.\n */\nexport enum BuildPlanDataSeedContent {\n REFERENCE = 'REFERENCE',\n DEMONSTRATION = 'DEMONSTRATION',\n}\n\n/**\n * A data seed's key: kebab-case segments joined by `:` (`crm:demo-customers`), the convention a\n * `DataSeedDefinition` documents. Constrained here because the seed's FILE is derived from it.\n */\n/**\n * An application role's name, as `CUSTOM_ROLES_CONFIGURATION` keys it: upper snake case (`FIELD_TECHNICIAN`).\n * A core role (`ORG_MEMBER`, `APP_ADMIN_SUPER_ADMIN`) is not something an application declares, so the\n * product refuses one: a plan naming it would claim to create a role the engine already owns.\n */\nexport const APPLICATION_ROLE_NAME_PATTERN: RegExp = /^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)*$/;\n/** Every role the ENGINE defines: an application role may not take one of these names, and a qualification may name one without declaring it. */\nexport const CORE_ROLE_NAMES: ReadonlySet<string> = new Set<string>([...Object.values(CORE_APP_ROLES), ...Object.values(CORE_ORG_ROLES)]);\n\n/**\n * An agent's or a function tool's ref: segments of letters and digits joined by `.`, `-` or `_`\n * (`close-assistant.chat.agent`, `todos.overdue-triage`, `resource.adjustmentProposals.post`). Case is kept, because a\n * tool ref follows the framework's `resource.<resourceType>.<operation>` convention and a multi-word resource type is\n * camelCase. Constrained because the probe compares it EXACTLY with the registered ref: no space, no slash, no empty\n * segment.\n */\nexport const AGENT_WORK_REF_PATTERN: RegExp = /^[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*$/;\n\n/**\n * A step or a decision point of the firm's method (#2305), addressed as `<serviceRef>/<elementRef>`\n * (`month-end-close/approve-posting`). A step's and a decision's ref are unique only within their service, so the\n * service qualifies them; the `service-method` family declares both halves as kebab-case slugs.\n */\nexport const SERVICE_METHOD_ELEMENT_REF_PATTERN: RegExp = /^[a-z0-9]+(?:-[a-z0-9]+)*\\/[a-z0-9]+(?:-[a-z0-9]+)*$/;\n\n/** The ref a build-plan product carries for one step or decision point of the method (#2305). */\nexport function serviceMethodElementRef(serviceRef: string, elementRef: string): string {\n return `${serviceRef}/${elementRef}`;\n}\n\nexport const DATA_SEED_KEY_PATTERN: RegExp = /^[a-z0-9]+(?:-[a-z0-9]+)*(?::[a-z0-9]+(?:-[a-z0-9]+)*)*$/;\n\n/**\n * One artifact a task is accountable for. Closed by construction: a product the\n * host cannot ask a question about is a product that can never be shown to have\n * landed, so the vocabulary only grows alongside the resolver that answers it.\n */\nexport const BuildPlanTaskProductSchema = z.discriminatedUnion('kind', [\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.RESOURCE_SCHEMA_FIELDS).systemEnum('BuildPlanTaskProductKind'),\n resourceRef: SlugSchema,\n /**\n * At least one field, because a task that enriches a schema with nothing is\n * the vacuity this whole field exists to stop: it would land the moment the\n * scaffold existed, which is the defect being fixed.\n */\n fieldRefs: z.array(NonEmptyStringSchema).min(1),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_REGISTRATION).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema, operationRefs: z.array(NonEmptyStringSchema).min(1) }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_UI_BEHAVIOR).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_SPECIFICATION).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema, fieldRefs: z.array(NonEmptyStringSchema).min(1) }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.RESOURCE_RELATIONSHIP).systemEnum('BuildPlanTaskProductKind'),\n relationshipRef: SlugSchema,\n /*\n * The two resources the edge relates, NAMED rather than parsed out of the ref.\n *\n * A ref is `<source>-<target>` by convention and that convention is not invertible:\n * `next-step-deal` splits as (`next`, `step-deal`) or (`next-step`, `deal`) and only the domain\n * plan knows which. The domain plan already carries both, so the plan passes them on instead of\n * making the host guess — a host that guesses wrong probes for a resource that does not exist\n * and reports the task permanently unlanded.\n */\n sourceResourceRef: SlugSchema,\n targetResourceRef: SlugSchema,\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_OPERATION).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema, operationRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_VIEW).systemEnum('BuildPlanTaskProductKind'), viewRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_DOCUMENT).systemEnum('BuildPlanTaskProductKind'), documentRef: DocumentProductRefSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_MODULE).systemEnum('BuildPlanTaskProductKind'), moduleRef: ModuleRefSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.APPLICATION_FRONTEND_CONFIG).systemEnum('BuildPlanTaskProductKind'),\n configSurface: z.enum(FrontendConfigSurface).systemEnum('FrontendConfigSurface'),\n /** At least one, for the same vacuity reason as a schema's `fieldRefs`: the file exists on day one. */\n declarationRefs: z.array(NonEmptyStringSchema).min(1),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_COMPOSITE_VIEW).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema, viewRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_CUSTOM_VIEW).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema, viewRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.RESOURCE_CHART_VIEW).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema, chartRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.CUSTOM_COMPONENT).systemEnum('BuildPlanTaskProductKind'), componentRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_MILESTONE).systemEnum('BuildPlanTaskProductKind'), milestoneRef: SlugSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.APPLICATION_GUIDANCE).systemEnum('BuildPlanTaskProductKind'),\n /** Which definitions file carries it — a document and a flow live in different ones. */\n guidanceKind: z.enum(ApplicationGuidanceKind).systemEnum('ApplicationGuidanceKind'),\n guidanceRef: SlugSchema,\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.PDF_TEMPLATE).systemEnum('BuildPlanTaskProductKind'),\n resourceRef: SlugSchema,\n /** The generated-file FIELD the template is bound to (`generatedSummaryPdf`) — a symbol, so any spelling. */\n templateRef: NonEmptyStringSchema,\n /**\n * #2305 S6: the deliverable of the firm's method this document is, as `<serviceRef>/<deliverableRef>`. Its resource\n * must be the one the deliverable is produced from; the derivation check compares them.\n */\n serviceMethodDeliverableRef: z.string().regex(SERVICE_METHOD_ELEMENT_REF_PATTERN).optional(),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_WORKER).systemEnum('BuildPlanTaskProductKind'), workerRef: IntegrationWorkerRefSchema, jobRefs: z.array(NonEmptyStringSchema).min(1) }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_MINION).systemEnum('BuildPlanTaskProductKind'), minionRef: IntegrationMinionRefSchema, behaviorRefs: z.array(NonEmptyStringSchema).min(1) }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.PROVIDER_BINDING).systemEnum('BuildPlanTaskProductKind'),\n providerRef: SlugSchema,\n scope: z.enum(ProviderBindingScope).systemEnum('ProviderBindingScope'),\n /**\n * The provider this module adds operations to, copied from the integration plan's binding (#2025). Present, it\n * changes what landing means: the application's opt-in under `providers.augmentations.<augments>` lists the module's\n * package, rather than a scope naming `providerRef` (an augmentation writes no scope entry).\n */\n augments: SlugSchema.optional(),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.APPLICATION_BILLING_PRODUCT).systemEnum('BuildPlanTaskProductKind'), productKey: SlugSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.APPLICATION_ROLE).systemEnum('BuildPlanTaskProductKind'),\n roleRef: z.string().regex(APPLICATION_ROLE_NAME_PATTERN).refine((roleRef) => !CORE_ROLE_NAMES.has(roleRef), {\n message: 'A core role is the engine\\'s; an application role needs a name of its own.',\n }),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.APPLICATION_DATA_SEED).systemEnum('BuildPlanTaskProductKind'),\n seedKey: z.string().regex(DATA_SEED_KEY_PATTERN),\n /** The resource whose rows the seed writes — the `resourceType` it declares. */\n resourceRef: SlugSchema,\n content: z.enum(BuildPlanDataSeedContent).systemEnum('BuildPlanDataSeedContent'),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.WEBSITE_PAGE).systemEnum('BuildPlanTaskProductKind'), pageRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.WEBSITE_SECTION).systemEnum('BuildPlanTaskProductKind'), pageRef: SlugSchema, sectionRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.DOCUMENTATION_CHAPTER).systemEnum('BuildPlanTaskProductKind'), chapterRef: SlugSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.APPLICATION_AGENT).systemEnum('BuildPlanTaskProductKind'),\n /** The agent's `ref` exactly as it is registered (`close-assistant.chat.agent`, `todos.overdue-triage`). */\n agentRef: z.string().regex(AGENT_WORK_REF_PATTERN),\n shape: z.enum(BuildPlanAgentShape).systemEnum('BuildPlanAgentShape'),\n /**\n * The firm's method steps this agent carries (#2305), as `<serviceRef>/<stepRef>`: set when the application has a\n * service method, so the derivation can be checked as total (every agent step has its agent). One agent may carry\n * several steps; each must be an AGENT step of the same `shape`.\n */\n serviceMethodStepRefs: z.array(z.string().regex(SERVICE_METHOD_ELEMENT_REF_PATTERN)).min(1).optional(),\n /**\n * The decision points of the firm's method this agent ASKS as a review question (an actor-system question routed\n * to people when its run suspends), as `<serviceRef>/<decisionRef>` (#2305). A decision is realized either so or by\n * a tool's approval gate (`serviceMethodDecisionRef`), never both: a review question IS the review, and its tool\n * carries no gate. Its route is built by the agent's code when it suspends, so only the realization is checked here.\n */\n serviceMethodAskedDecisionRefs: z.array(z.string().regex(SERVICE_METHOD_ELEMENT_REF_PATTERN)).min(1).optional(),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.AGENT_APPROVAL_GATE).systemEnum('BuildPlanTaskProductKind'),\n /** The gated tool's `functionRef` exactly as it is registered (`resource.<resourceType>.<operation>` for a resource tool). */\n functionRef: z.string().regex(AGENT_WORK_REF_PATTERN),\n route: z.enum(HumanDecision_RouteKind).systemEnum('HumanDecision_RouteKind'),\n /**\n * The role every answerer must hold, as the role table keys it: required for a ROLE or ASSIGNEE route, refused for\n * an OWNER route (answered by the person whose turn it is) — the engine's own rule for a gate, so a plan cannot name a\n * gate the engine would refuse at startup.\n */\n eligibleRole: z.string().regex(APPLICATION_ROLE_NAME_PATTERN).optional(),\n /**\n * The professional qualifications the answerer must ALSO hold (#2967), as the application's\n * `professionalQualificationKinds` keys them: a ROLE or ASSIGNEE gate only, the engine's own rule. Landing compares\n * them with the gate's, so a gate built without the qualification the plan required does not land.\n */\n requiredQualificationKinds: z.array(z.string().regex(LABEL_KEY_SEGMENT_PATTERN)).min(1).optional(),\n /**\n * The decision point of the firm's method this gate realizes (#2305), as `<serviceRef>/<decisionRef>`: set when the\n * application has a service method. Its route must be the decision's, its role the decision's qualification's\n * role, and its qualifications that qualification's kind; the derivation check compares them.\n */\n serviceMethodDecisionRef: z.string().regex(SERVICE_METHOD_ELEMENT_REF_PATTERN).optional(),\n }).refine((gate) => (gate.route === HumanDecision_RouteKind.OWNER) === (gate.eligibleRole === undefined), {\n message: 'An OWNER gate names no role; a ROLE or ASSIGNEE gate names the role its answerer must hold.',\n path: ['eligibleRole'],\n }).refine((gate) => gate.route !== HumanDecision_RouteKind.OWNER || gate.requiredQualificationKinds === undefined, {\n message: 'An OWNER gate requires no qualification: its answerer is the person whose turn it is, whom nothing vets.',\n path: ['requiredQualificationKinds'],\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskProductKind.WORK_UNIT_RESOURCE).systemEnum('BuildPlanTaskProductKind'), resourceRef: SlugSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.METERED_USAGE_RECORDING).systemEnum('BuildPlanTaskProductKind'),\n resourceRef: SlugSchema,\n /** The operation that records, as the resource's configuration keys it (`record-sign-off` for `record_sign_off`). */\n operationRef: SlugSchema,\n /** The METERED product it records against: an `APPLICATION_BILLING_PRODUCT` of this plan, by its catalogue key. */\n productKey: SlugSchema,\n /** Whether it records at most once per row (`oncePerRecord`). A price per case counts each case once, however often it closes. */\n oncePerRecord: z.boolean(),\n /**\n * #2305 S5: the service of the firm's method whose price PER CASE this records, by its `serviceRef`. Its resource must\n * be that service's case and it must count once per row; the derivation check compares them.\n */\n serviceMethodServiceRef: SlugSchema.optional(),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.RESOURCE_RETENTION_BINDING).systemEnum('BuildPlanTaskProductKind'),\n resourceRef: SlugSchema,\n retentionClass: z.enum(DataRetentionClass).systemEnum('DataRetentionClass'),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.RELATIONSHIP_CONFERRED_ROLE).systemEnum('BuildPlanTaskProductKind'),\n /** The relationship kind, by its key in `organizationRelationships` (`service`). */\n relationshipRef: SlugSchema,\n /** The role conferred, by its key in the role table (`ORG_QUALIFIED_ACCOUNTANT`), a core role or the application's. */\n roleRef: z.string().regex(APPLICATION_ROLE_NAME_PATTERN),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.ORGANIZATION_TYPE).systemEnum('BuildPlanTaskProductKind'),\n /**\n * The type's ref as the domain plan's organization model names it (`regulated-client`): its key in\n * `organizationTypes`, except for the owner type, which is found by `ownsApplication` whatever its key.\n */\n organizationTypeRef: SlugSchema,\n /** The type operates the application. Then the configuration's own owner type is the one the plan describes. */\n ownsApplication: z.literal(true).optional(),\n /** The roles the type must offer (`availableOrgRoles`, or the engine's default offer). */\n offeredRoles: z.array(z.string().regex(APPLICATION_ROLE_NAME_PATTERN)).min(1).optional(),\n /** The user types the type must grant its members (`userTypes`). */\n userTypes: z.array(SlugSchema).min(1).optional(),\n /** Whether the type's members must use a second factor (`authOverrides.mfaPolicy.requireMFA`). */\n requiresMfa: z.boolean().optional(),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.ORGANIZATION_RELATIONSHIP_KIND).systemEnum('BuildPlanTaskProductKind'),\n /** The kind's key in `organizationRelationships` (`partnership`), the same key a `RELATIONSHIP_CONFERRED_ROLE` names. */\n relationshipRef: SlugSchema,\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.ORGANIZATION_UNIT_CONFINEMENT).systemEnum('BuildPlanTaskProductKind'),\n resourceRef: SlugSchema,\n mode: z.enum(OrganizationRowConfinementMode).systemEnum('OrganizationRowConfinementMode'),\n /**\n * The field the confinement reads, as the resource's schema names it: the unit field (`organizationUnitId`) for\n * `ORGANIZATION_UNIT`, the owning user's field (`createdByUserId`) for `OWN_ROWS`. Compared exactly, because a\n * confinement on another field confines by something else.\n */\n fieldName: z.string().regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.SYSTEM_OF_RECORD_BINDING).systemEnum('BuildPlanTaskProductKind'),\n resourceRef: SlugSchema,\n /** The instance's key in `systemsOfRecord` (`odoo`), the name a binding's `system` carries. */\n systemOfRecordRef: z.string().regex(SYSTEM_OF_RECORD_NAME_PATTERN),\n /**\n * The system's facet, as the domain plan names it (`odoo`, `sap-s4hana`): the `vendor` the declared instance must\n * carry, so a binding to an instance of another vendor does not land.\n */\n systemOfRecordKind: SlugSchema,\n /** The lane the domain plan decided: read through on every request, or copied by a pipeline. Required there, so here. */\n access: z.enum(SystemOfRecordAccess).systemEnum('SystemOfRecordAccess'),\n /**\n * Whether the instance's records are split by legal entity (#3045), as the domain plan's record location says\n * (`domainPlanRecordPartitionPartitionsInstance`): `true` declares `partition: true` on the instance, and a copied\n * resource then stamps each row's unit and entity key on its pipeline (`partitionUnitLocalField`,\n * `partitionKeyLocalField`); `false` declares neither. The landing probe compares it with the instance's flag. Absent\n * (a plan written before #3045): not compared.\n */\n partitioned: z.boolean().optional(),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskProductKind.INBOUND_CHANNEL_HANDLER).systemEnum('BuildPlanTaskProductKind'),\n /** The channel the handler serves — one the integration plan declared ({@link PlannableInboundChannelKind}). */\n channel: z.enum(PlannableInboundChannelKind).systemEnum('InboundChannelKind'),\n /** The handler's `ref`, exactly as `inboundHandlerRef()` will accept it. */\n handlerRef: z.string().regex(INBOUND_HANDLER_REF_PATTERN),\n }),\n]);\nexport type BuildPlanTaskProduct = z.infer<typeof BuildPlanTaskProductSchema>;\n\n/**\n * Every artifact identity a product claims — one string per artifact, not one\n * per product, because a product may claim several.\n *\n * `RESOURCE_SCHEMA_FIELDS` is why this returns a list. Two tasks may both enrich\n * one resource's schema (a domain shape and a billing concern, say), and that is\n * legitimate; what must never overlap is the FIELDS. Comparing whole products\n * would refuse the legitimate pair, and comparing only the resource would let two\n * tasks claim one field and make landing ambiguous again.\n *\n * Derived from the product's own members rather than stored, and total over the\n * vocabulary, so a kind added tomorrow must state its identity here or fail to\n * compile — it cannot be silently treated as equal to its siblings.\n */\nexport function buildPlanTaskProductIdentities(product: BuildPlanTaskProduct): readonly string[] {\n switch (product.kind) {\n case BuildPlanTaskProductKind.RESOURCE_SCHEMA_FIELDS:\n return product.fieldRefs.map((fieldRef) => `${product.kind}:${product.resourceRef}:${fieldRef}`);\n case BuildPlanTaskProductKind.RESOURCE_REGISTRATION:\n return product.operationRefs.map((operationRef) => `${product.kind}:${product.resourceRef}:${operationRef}`);\n case BuildPlanTaskProductKind.RESOURCE_SPECIFICATION:\n return product.fieldRefs.map((fieldRef) => `${product.kind}:${product.resourceRef}:${fieldRef}`);\n case BuildPlanTaskProductKind.RESOURCE_UI_BEHAVIOR:\n return [`${product.kind}:${product.resourceRef}`];\n case BuildPlanTaskProductKind.RESOURCE_RELATIONSHIP:\n return [`${product.kind}:${product.relationshipRef}`];\n case BuildPlanTaskProductKind.RESOURCE_OPERATION:\n return [`${product.kind}:${product.resourceRef}:${product.operationRef}`];\n case BuildPlanTaskProductKind.APPLICATION_VIEW:\n return [`${product.kind}:${product.viewRef}`];\n case BuildPlanTaskProductKind.APPLICATION_DOCUMENT:\n /*\n * The ref AS AUTHORED, so a slug and a namespaced ref are different artifact identities even\n * where they mean the same document — the duplicate-artifact refusal cannot see two tasks\n * claiming one document if they spell it differently. Not normalisable: a slug carries no\n * namespace, so nothing can recover `public.` from `privacy-notice`. It costs nothing today\n * because a slug names no catalogued document at all, and the dispatcher skips such a task.\n */\n return [`${product.kind}:${product.documentRef}`];\n case BuildPlanTaskProductKind.APPLICATION_MODULE:\n return [`${product.kind}:${product.moduleRef}`];\n // One identity per DECLARATION, like schema fields: two tasks may compose one config file as\n // long as they declare different things in it.\n case BuildPlanTaskProductKind.APPLICATION_FRONTEND_CONFIG:\n return product.declarationRefs.map((declarationRef) => `${product.kind}:${product.configSurface}:${declarationRef}`);\n case BuildPlanTaskProductKind.RESOURCE_COMPOSITE_VIEW:\n case BuildPlanTaskProductKind.RESOURCE_CUSTOM_VIEW:\n return [`${product.kind}:${product.resourceRef}:${product.viewRef}`];\n case BuildPlanTaskProductKind.RESOURCE_CHART_VIEW:\n return [`${product.kind}:${product.resourceRef}:${product.chartRef}`];\n case BuildPlanTaskProductKind.CUSTOM_COMPONENT:\n return [`${product.kind}:${product.componentRef}`];\n case BuildPlanTaskProductKind.APPLICATION_MILESTONE:\n return [`${product.kind}:${product.milestoneRef}`];\n // The ref alone: a document and a flow sharing one ref is still one guidance identity, and the\n // runtime keys a person's saved state by it — two artifacts claiming it would collide there too.\n case BuildPlanTaskProductKind.APPLICATION_GUIDANCE:\n return [`${product.kind}:${product.guidanceRef}`];\n case BuildPlanTaskProductKind.PDF_TEMPLATE:\n return [`${product.kind}:${product.resourceRef}:${product.templateRef}`];\n case BuildPlanTaskProductKind.APPLICATION_WORKER:\n return product.jobRefs.map((jobRef) => `${product.kind}:${product.workerRef}:${jobRef}`);\n case BuildPlanTaskProductKind.APPLICATION_MINION:\n return product.behaviorRefs.map((behaviorRef) => `${product.kind}:${product.minionRef}:${behaviorRef}`);\n // The SCOPE is part of the identity: one provider bound on the backend and on the website is two artifacts.\n case BuildPlanTaskProductKind.PROVIDER_BINDING:\n return [`${product.kind}:${product.scope}:${product.providerRef}`];\n case BuildPlanTaskProductKind.APPLICATION_BILLING_PRODUCT:\n return [`${product.kind}:${product.productKey}`];\n case BuildPlanTaskProductKind.APPLICATION_ROLE:\n return [`${product.kind}:${product.roleRef}`];\n // The key alone: two seeds may write one resource, and the key is what the seed run ledger tracks.\n case BuildPlanTaskProductKind.APPLICATION_DATA_SEED:\n return [`${product.kind}:${product.seedKey}`];\n case BuildPlanTaskProductKind.WEBSITE_PAGE:\n return [`${product.kind}:${product.pageRef}`];\n case BuildPlanTaskProductKind.WEBSITE_SECTION:\n return [`${product.kind}:${product.pageRef}:${product.sectionRef}`];\n case BuildPlanTaskProductKind.DOCUMENTATION_CHAPTER:\n return [`${product.kind}:${product.chapterRef}`];\n case BuildPlanTaskProductKind.INBOUND_CHANNEL_HANDLER:\n return [`${product.kind}:${product.handlerRef}`];\n case BuildPlanTaskProductKind.APPLICATION_AGENT:\n return [`${product.kind}:${product.agentRef}`];\n // The TOOL alone: one tool has one gate, so two tasks gating it differently would make landing ambiguous.\n case BuildPlanTaskProductKind.AGENT_APPROVAL_GATE:\n return [`${product.kind}:${product.functionRef}`];\n case BuildPlanTaskProductKind.WORK_UNIT_RESOURCE:\n return [`${product.kind}:${product.resourceRef}`];\n // The operation and the product: one operation may record several products, and two tasks recording one product on\n // one operation would make landing ambiguous.\n case BuildPlanTaskProductKind.METERED_USAGE_RECORDING:\n return [`${product.kind}:${product.resourceRef}:${product.operationRef}:${product.productKey}`];\n // One resource has one binding, so two tasks binding it would make landing ambiguous.\n case BuildPlanTaskProductKind.RESOURCE_RETENTION_BINDING:\n return [`${product.kind}:${product.resourceRef}`];\n case BuildPlanTaskProductKind.RELATIONSHIP_CONFERRED_ROLE:\n return [`${product.kind}:${product.relationshipRef}:${product.roleRef}`];\n // The OWNER type is one per application whatever its key, so two products describing it would make landing ambiguous.\n case BuildPlanTaskProductKind.ORGANIZATION_TYPE:\n return [product.ownsApplication === true ? `${product.kind}:application-owner` : `${product.kind}:${product.organizationTypeRef}`];\n case BuildPlanTaskProductKind.ORGANIZATION_RELATIONSHIP_KIND:\n return [`${product.kind}:${product.relationshipRef}`];\n // The MODE is part of the identity: one resource may be confined to the unit AND to its owner's rows (#3036).\n case BuildPlanTaskProductKind.ORGANIZATION_UNIT_CONFINEMENT:\n return [`${product.kind}:${product.resourceRef}:${product.mode}`];\n // The resource alone: one resource's records live in one place, so two bindings of it would make landing ambiguous.\n case BuildPlanTaskProductKind.SYSTEM_OF_RECORD_BINDING:\n return [`${product.kind}:${product.resourceRef}`];\n default: {\n const unhandled: never = product;\n throw new Error(`Unhandled build-plan task product ${JSON.stringify(unhandled)}.`);\n }\n }\n}\n\n/**\n * The skill every billing-catalogue task is authored with (#1835): the product-catalogue contract, the\n * money encoding (minor units), and the pricing-surface facts. The dispatch derives it from an\n * `APPLICATION_BILLING_PRODUCT` product whatever the decomposer wrote, so an agent writing the catalogue\n * the backend sells from is never without it. A `METERED_USAGE_RECORDING` task carries it too (#2305 S5): the skill\n * says how an operation records usage of a metered product, and how a price per case counts each case once.\n */\nexport const BILLING_CATALOG_SKILL_REF = 'configure-billing';\n\n/**\n * The skill every application-roles task is authored with (#2490): the role table, the organization\n * types that offer a role, and the operation roles that make it matter. The dispatch derives it from an\n * `APPLICATION_ROLE` product whatever the decomposer wrote.\n */\nexport const APPLICATION_ROLES_SKILL_REF = 'application-roles-authoring';\n\n/**\n * The skill every data-seed task is authored with (#2234): levels, modes, business keys, and the\n * environment restriction that keeps demonstration rows out of production. The dispatch derives it from\n * an `APPLICATION_DATA_SEED` product whatever the decomposer wrote.\n */\nexport const DATA_SEED_SKILL_REF = 'seeding-authoring';\n\n/**\n * The skill every PDF-template task is authored with (#2495): the template contract, the file field it fills, and\n * where the generated file is stored. The dispatch derives it from a `PDF_TEMPLATE` product whatever the decomposer\n * wrote.\n */\nexport const PDF_TEMPLATE_SKILL_REF = 'pdf-template-authoring';\n\n/**\n * The skill a resource CONFIG task carries when the resource DECLARES personal data (#2495): its retention binding\n * lives in that configuration file, and storage limitation is a duty about personal data. The dispatch reads the\n * declaration from the resource's schema (the engine's personal-data markers), whatever the decomposer wrote.\n */\nexport const RESOURCE_RETENTION_SKILL_REF = 'resource-retention-binding';\n\n/**\n * The skill a task conferring a role through an organization relationship is authored with (#2305 S6): the relationship\n * kind's `confers`, the granting types that must offer the role, and the startup checks that refuse a mismatch. The\n * dispatch derives it from a `RELATIONSHIP_CONFERRED_ROLE` product whatever the decomposer wrote.\n */\nexport const ORGANIZATION_RELATIONSHIPS_SKILL_REF = 'organization-relationships';\n\n/**\n * The skill each agent shape is built with (#2966). The dispatch derives it from an `APPLICATION_AGENT` product whatever\n * the decomposer wrote. Total over {@link BuildPlanAgentShape}, so a shape added tomorrow must name its skill.\n */\nexport const BUILD_PLAN_AGENT_SHAPE_SKILL_REF: Readonly<Record<BuildPlanAgentShape, string>> = {\n [BuildPlanAgentShape.CHAT_ASSISTANT]: 'flows-actors-chat-assistant',\n [BuildPlanAgentShape.AUTONOMOUS]: 'flows-actors-autonomous-agents',\n [BuildPlanAgentShape.INVOKED]: 'flows-actors-llm-agent-invocation',\n [BuildPlanAgentShape.FLOW_STEP]: 'flows-actors-declared-flow',\n};\n\n/**\n * The skill every agent and every approval gate is ALSO built with (#2966): what the agent's use is for, whether it\n * decides anything about a person, and its gated writes. An agent built from its shape skill alone is the undeclared,\n * unguarded shape.\n */\nexport const AI_USE_DECLARATION_SKILL_REF = 'ai-use-declaration';\n\n/**\n * The skill an approval gate is built with (#2966): `flows-actors-chat-assistant` is where the `humanApproval` contract\n * is taught whole — the three routes, the eligible role, an assignee, escalation, deadlines and the review calendar —\n * whichever kind of agent calls the tool.\n */\nexport const AGENT_APPROVAL_GATE_SKILL_REF = 'flows-actors-chat-assistant';\n\n/**\n * The skill an organization-type task is built with (#3040): `organizationTypes` in the application's configuration, the\n * user types and roles a type offers, how it is joined, and the identity overrides it may carry. The dispatch derives it\n * from an `ORGANIZATION_TYPE` product whatever the decomposer wrote. A relationship kind is built with\n * {@link ORGANIZATION_RELATIONSHIPS_SKILL_REF}.\n */\nexport const ORGANIZATION_TYPE_SKILL_REF = 'config-saas-backend';\n\n/**\n * The skill a confinement task is built with (#3040): `organizationUnitNarrowing` and `organizationOwnRows` at startup,\n * and why a confined resource's reads are gated above the default member role. Derived from an\n * `ORGANIZATION_UNIT_CONFINEMENT` product whatever the decomposer wrote.\n */\nexport const ORGANIZATION_UNIT_CONFINEMENT_SKILL_REF = 'authorization-unit-narrowing';\n\n/**\n * The skills a system-of-record binding is built with (#3040): `resource-external-data` for the binding itself (the two\n * lanes, the field mapping, subject rights), and `config-saas` for the `systemsOfRecord` instance the binding names.\n * Derived from a `SYSTEM_OF_RECORD_BINDING` product whatever the decomposer wrote.\n */\nexport const SYSTEM_OF_RECORD_BINDING_SKILL_REFS: readonly string[] = ['resource-external-data', 'config-saas'];\n\n/** The skill a work-unit task is built with (#2966): the `workUnit` declaration, model prices and the case passed to agent turns. */\nexport const WORK_UNIT_SKILL_REF = 'model-cost-attribution';\n\nexport const BuildPlanTaskTargetSchema = z.discriminatedUnion('kind', [\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.MODULE), moduleRef: ModuleRefSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.RESOURCE_STAGE),\n moduleRef: ModuleRefSchema,\n resourceRef: SlugSchema,\n stage: z.enum(BuildPlanResourceStage),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.RELATIONSHIP),\n /** The module whose `<module>.relationships.ts` the edges are written into: the task's write scope. */\n moduleRef: ModuleRefSchema,\n /**\n * Every domain-plan relationship this task wires, by the domain plan's `relationshipRef` (#3209).\n *\n * A LIST, because the unit of work is the module's relationships FILE, not one edge. Each edge is a\n * `createResourcesRelationship(...)` call in that one file, plus the holder's ui-behavior and both\n * resources' specifications, so two tasks wiring two edges of one module edit the same file. Run\n * concurrently they overwrite each other, and the build wave re-runs each interfered task alone:\n * app-creation-test-007 split one module's 23 edges into 23 tasks, and the relationship phase ran one\n * task at a time for about seven hours with a parallelism of five. One task per file (see\n * {@link groupRelationshipTasksByModule}) pays the worker's start and the checks once, and lets\n * different modules' files go in parallel.\n *\n * Each ref here has its `RESOURCE_RELATIONSHIP` product on the same task, and that is checked\n * (`RELATIONSHIP_TARGET_DISAGREES_WITH_PRODUCTS`): the target says what the coverage check counts as\n * wired, and the products are what landing proves. A target naming an edge no product declares would\n * count as covered and never be probed.\n */\n relationshipRefs: z.array(SlugSchema).min(1),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.COMPANION_GENERATION_STEP),\n /** The companion generation step this task runs (e.g. i18n-labels, email-templates); resolved by the companion, never by a coding agent. */\n generationStepRef: SlugSchema,\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.SHELL_PLACEMENT),\n /**\n * Which shell surface this task authors — the placement family's OWN\n * `PlacementSurface`, deliberately not a build-plan copy of it.\n *\n * A copy was written first and was a defect, caught by probing the landing\n * renderer rather than by any test: `PlacementAddress` discriminates on\n * `surface` with `z.literal(...)` per option, so only the VALUES survive into\n * the schema, and the renderer resolves a discriminator by matching that value\n * SET against the exported enums. Two enums with identical values made the\n * match ambiguous, the renderer correctly refused to guess an owner, and the\n * address discriminator became unnameable — a landed placement plan would have\n * emitted `surface: \"SETTINGS_HUB\"` as a bare string instead of\n * `PlacementSurface.SETTINGS_HUB`. One concept, one named source.\n */\n surface: z.enum(PlacementSurface).systemEnum('PlacementSurface'),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.MODULE_FRONTEND), moduleRef: ModuleRefSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.MODULE_BACKEND), moduleRef: ModuleRefSchema }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.APPLICATION_FRONTEND_CONFIG),\n configSurface: z.enum(FrontendConfigSurface).systemEnum('FrontendConfigSurface'),\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.WEBSITE) }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.TECHNICAL_DOCUMENTATION) }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.WORKER),\n /**\n * The integration plan's `workerRef` (`worker-<slug>`), verbatim. The package directory is derived from it by\n * `integrationWorkerDirectoryName`, the same rule the foundation step composes the package with, so the plan never\n * has to guess where the package went.\n */\n workerRef: IntegrationWorkerRefSchema,\n runtime: z.enum(BuildPlanWorkerRuntime).systemEnum('BuildPlanWorkerRuntime'),\n }),\n z.strictObject({\n kind: z.literal(BuildPlanTaskTargetKind.MINION),\n /** The integration plan's `minionRef` (`minion-<slug>`), verbatim; the directory is `integrationMinionDirectoryName`'s. */\n minionRef: IntegrationMinionRefSchema,\n }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.PROVIDER_BINDING), providerRef: SlugSchema }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.BILLING_CATALOG) }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.APPLICATION_ROLES) }),\n z.strictObject({ kind: z.literal(BuildPlanTaskTargetKind.ORGANIZATION_MODEL) }),\n]);\nexport type BuildPlanTaskTarget = z.infer<typeof BuildPlanTaskTargetSchema>;\n\n/**\n * One ordered build task. It names WHAT to build and WHY; it never carries\n * HOW (no paths, commands, prompts, cwd, model, profile). The host resolves\n * the physical allowed/prohibited paths and the fixed verification from the\n * target kind, and the installed skills from `skillRefs` against the app\n * knowledge catalog.\n *\n * Dependency readiness is DECLARED as prerequisite task refs and RESOLVED by\n * the host (a prerequisite is satisfied when its task has landed), never a\n * solved DAG the model must get right.\n */\nexport const BuildPlanTaskSchema = z.strictObject({\n /** `build-task-<slug>`, stamped by the trusted runtime. */\n taskRef: z.string().regex(new RegExp(`^${BUILD_PLAN_TASK_REF_PREFIX}[a-z0-9]+(?:-[a-z0-9]+)*$`)),\n /**\n * One sentence of intent: what this task delivers.\n *\n * Its OWN instance, not the file's shared leaf, which `templateRef` and the product ref lists also\n * hold. The workbench's reading decorations are keyed by INSTANCE, and it gives those refs a receding\n * identifier look, which the objective sentence took too while it shared their leaf.\n */\n objective: z.string().trim().min(1),\n target: BuildPlanTaskTargetSchema,\n /**\n * The artifacts this task is accountable for — what proves it done.\n *\n * Coding tasks should declare at least one product that composition did not already\n * write. A target is a shared mutation scope; its scaffolded file is not evidence\n * that this task's intended work exists. Products identify the output to probe.\n *\n * Empty declarations remain representable and produce the advisory\n * `TASK_DECLARES_NO_PRODUCT`. The host may advance after a COMPLETED durable run,\n * while naming the task in `unverifiableLandedTaskRefs`: it ran, but its output\n * cannot be proven from a product declaration. An unexecuted task is not landed.\n * This distinction avoids repeatedly dispatching the same unprovable task without\n * presenting execution history as evidence that the intended product is correct.\n *\n * The ONE hard exception is a `COMPANION_GENERATION_STEP`, which must declare NONE.\n * That kind already carries its own typed landed condition, owned by the\n * generation-step service — a set computed asynchronously (planner units x\n * enabled locales), and for the migration step a STATE rather than files. A\n * product declared beside it would be read by nothing, which is the inert\n * declaration this field exists to avoid. Enforced on the graph below, in both\n * directions.\n */\n produces: z.array(BuildPlanTaskProductSchema).default([]),\n /**\n * Exactly ONE functional topic this task belongs to.\n *\n * **It does NOT drive ordering** — this said \"drives cross-app ordering\" until 2026-08-30 and\n * nothing ever ordered by it. Sequencing is `prerequisiteTaskRefs`, resolved by the host, and it\n * is the only thing that decides what may run next.\n *\n * What it DOES: the dispatch host stamps it into the coding-agent's task payload beside\n * `skillRefs`, so the agent is told which phase of building the application this task belongs to.\n * That is context an LLM reads, not a value the runtime branches on — the distinction matters,\n * because a reader who believes it orders will look here for a scheduling bug that lives in the\n * prerequisite graph. See issue #124.\n */\n functionalTopic: z.enum(MetaWorkflow_FunctionalTopic).systemEnum('MetaWorkflow_FunctionalTopic'),\n /** Installed app-knowledge skill folders that carry the technical HOW; resolved via the skills router at dispatch. */\n skillRefs: z.array(SkillRefSchema).min(1),\n /** Task refs that must have landed first; resolved by the host, not solved by the model. */\n prerequisiteTaskRefs: z.array(z.string()).default([]),\n /**\n * What this task is accountable to — traceability only, NEVER scope authority.\n *\n * The vocabulary is the target aspects `BUILD_PLAN_FAMILY_ASPECTS` declares for this edge:\n * functional and non-functional requirements, roadmap phases, the vision's success criteria and\n * constraints, drafted features, pricing plans, and the brand's name, logo direction and visual\n * tone. Each target after the first three was added because a producer had already been writing\n * it (#629, #1433, #1835, #2221). A companion generation step serves what it consumes: the `logo`\n * step serves the brand's logo direction and name.\n *\n * This schema accepts any non-empty string. Generation does not: the edge is DECLARED, so a key\n * that resolves to no element of a target family (when that family has landed) is a dangling\n * reference. The model is told so on retry, and the landing refuses it. That is why widening the\n * vocabulary to what producers genuinely mean matters: a true link the vocabulary does not name\n * fails generation. The workbench renders a key outside the vocabulary as visibly unresolved.\n */\n servesRefs: z.array(NonEmptyStringSchema).default([]),\n /**\n * Who asked for this task DIRECTLY (#1608), rather than it being derived from the specifications: the\n * signed-in person who added it in conversation. STAMPED by the append, never authored: a value in\n * generated output is discarded. Absent on every task the decomposition derived.\n *\n * It is what keeps a requested task alive. Build decomposition refines the plan from the domain plan, and\n * a task nothing in the specifications justifies would read as unjustified and be dropped; a requested\n * task it leaves out is carried forward instead, keeping only the prerequisites the new plan still holds.\n */\n requestedBy: NonEmptyStringSchema.optional(),\n});\nexport type BuildPlanTask = z.infer<typeof BuildPlanTaskSchema>;\n\n/**\n * THE build-plan payload — a **single aggregate per product**: the ORDERED\n * task graph that turns the accepted domain plan into buildable units.\n *\n * **Artifact-family id: `build-plan`.** This schema is the shape of the\n * journey artifact selected by `MetaWorkflow_ArtifactSelector.family ===\n * 'build-plan'` (the `family` vocabulary stays an open string owned by the\n * selector surface; this note is the single place tying the SHAPE to the\n * NAME). Produced by the build-decompose playbook, consumed by\n * build-dispatch (and build-scale, which runs the same branch): ready tasks\n * are dispatched in parallel waves of up to the application's build\n * parallelism (`wildo workbench parallelism`, 5 by default; 1 = one at a\n * time).\n *\n * Invariants enforced here: unique task refs; every prerequisite names a task\n * in this graph; no self-prerequisite. Cycle detection and ordering\n * soundness are the deterministic validator's job (`validateBuildPlanTaskGraph`).\n */\nexport const BuildPlanTaskGraphSchema = z.object({\n version: z.enum(BuildPlanTaskGraphVersion).default(BuildPlanTaskGraphVersion.V1),\n /**\n * At least one task, at the SCHEMA — not merely as a validator warning. The first live playbook-loop\n * run (2026-08-24) proved why: build-decompose answered `tasks: []`, which was schema-valid, passed\n * `_core` validation as a mere warning, and LANDED — overwriting a completed 3-task plan with a\n * vacuous artifact. Decomposing to zero tasks is a refusal (\"nothing to decompose\"), never an\n * artifact: an empty plan carries no information a reader could act on, and the file it replaces\n * does. Same vacuity class already closed on the requirements family (`functional: min(1)`).\n */\n tasks: z.array(BuildPlanTaskSchema).min(1),\n}).superRefine((graph, context) => {\n const refs = new Set<string>();\n graph.tasks.forEach((task, index) => {\n if (refs.has(task.taskRef)) {\n context.addIssue({ code: 'custom', message: `duplicate build task ref \"${task.taskRef}\"`, path: ['tasks', index, 'taskRef'] });\n }\n refs.add(task.taskRef);\n });\n /*\n * No two tasks claim the same artifact.\n *\n * This is what makes landing DECIDABLE, not a tidiness rule. If two tasks name\n * one product, the host cannot tell which of them a present artifact proves —\n * exactly the ambiguity that shared `target`s created, arriving through the\n * field that replaced them. Enforced here rather than left to the validator\n * because a graph that cannot answer \"has this task landed?\" is not a graph\n * the loop may run at all.\n */\n graph.tasks.forEach((task, index) => {\n const isGenerationStep = task.target.kind === BuildPlanTaskTargetKind.COMPANION_GENERATION_STEP;\n if (isGenerationStep && task.produces.length > 0) {\n context.addIssue({\n code: 'custom',\n message: `build task \"${task.taskRef}\" is a companion generation step and must declare no products; its landing is the generation step's own condition`,\n path: ['tasks', index, 'produces'],\n });\n }\n });\n const productOwners = new Map<string, string>();\n graph.tasks.forEach((task, index) => {\n task.produces.forEach((product, productIndex) => {\n buildPlanTaskProductIdentities(product).forEach((identity) => {\n const owner = productOwners.get(identity);\n if (owner !== undefined) {\n context.addIssue({\n code: 'custom',\n message: `build task \"${task.taskRef}\" claims the same artifact as \"${owner}\" (${identity}); an artifact is produced by exactly one task`,\n path: ['tasks', index, 'produces', productIndex],\n });\n return;\n }\n productOwners.set(identity, task.taskRef);\n });\n });\n });\n graph.tasks.forEach((task, index) => {\n task.prerequisiteTaskRefs.forEach((prerequisite, prerequisiteIndex) => {\n if (prerequisite === task.taskRef) {\n context.addIssue({ code: 'custom', message: `build task \"${task.taskRef}\" cannot be its own prerequisite`, path: ['tasks', index, 'prerequisiteTaskRefs', prerequisiteIndex] });\n } else if (!refs.has(prerequisite)) {\n context.addIssue({ code: 'custom', message: `build task \"${task.taskRef}\" names an unknown prerequisite \"${prerequisite}\"`, path: ['tasks', index, 'prerequisiteTaskRefs', prerequisiteIndex] });\n }\n });\n });\n});\nexport type BuildPlanTaskGraph = z.infer<typeof BuildPlanTaskGraphSchema>;\n```\n\n## The two ordering axes\n\nEvery task you emit is placed on **two ordering axes**. They are **distinct** — the\nper-resource sequence deliberately *spans* topics and is not monotonic on the topic\nchain — so keep them separate and satisfy both:\n\n1. **The topic dependency edges** (across the whole app — from the taxonomy's\n `Depends On`): `configure_application_foundation` → `model_domain_graph` →\n `define_interaction_semantics` → app-level `shape_user_experience` →\n `extend_application` → `connect_runtime_and_external_capabilities` →\n `assemble_verify_and_iterate`. You author neither the foundation nor the final\n assemble/verify — you decompose the middle bands (Topics 2–6). Topic 1 IS a sibling\n playbook (`bottom_up.foundation`), and Topic 7 IS one again\n (`bottom_up.assemble-verify`, rebuilt under issue #147 after its producer was removed\n with the verification/digest demolition). You still emit no Topic 7 task, and the reason\n is structural rather than a delegation: `BuildPlanTaskTargetKind` has no verification\n member, so app-wide verification cannot be expressed as a build-plan task at all — see\n the verify/quality-gate exclusion below. The edges you must respect: an\n operation task after the resources it acts on; an **app-level** view / navigation\n task after the interaction semantics and resources it composes; an extension after\n the UX it extends; an integration after the resources it connects.\n2. **The per-resource inner stage order** (within one resource):\n **schema → config → ui-behavior → spec.** This is a *dependency* sequence (each\n stage needs the prior artifact) and it deliberately **crosses topics**: schema +\n config are `model_domain_graph`, ui-behavior is `shape_user_experience`, and the\n spec is the `model_domain_graph` documentation capstone authored last. Two\n consequences to get right:\n - A resource's **own** ui-behavior (its field displays / forms) depends only on\n that resource's schema + config — so it may be ordered **before** cross-resource\n operations. That is **not** a topic-chain violation; only *app-level* UX\n (views / navigation composing multiple resources or operations) waits on the\n interaction-semantics band.\n - The **spec** task is a documentation capstone: order it **after** the stages it\n documents (schema, config, ui-behavior), regardless of its `model_domain_graph`\n topic binding. Its topic says *what* it documents; its ordering says *after what*.\n\n**Sequencing tiebreaker — MVP first.** The two axes constrain *relative* order but leave\nfreedom in which module to build first. Break that tie with the **roadmap** — but note the\nroadmap is requirement-addressed, not module-addressed: a phase delivers\n`deliversRequirementRefs` / `deliversSuccessCriterionRefs`, not modules. So trace each\nmodule's requirements to the earliest roadmap phase that delivers them, then sequence the\nmodules whose requirements land in an earlier phase (NOW / MVP) before those whose\nrequirements land later (NEXT / LATER), so a partial build is a coherent MVP slice rather\nthan a scattered half of every module. This is a soft ordering preference, not a hard\nprerequisite — never let it override the two hard axes above.\n\n## Step 1 — Emit the module + resource tasks (the domain-graph band)\n\nWalk the domain plan module by module. For each **module**, first check whether the\n**foundation step** (a sibling playbook) already scaffolded its slice — it normally has,\nbecause foundation materialises every module in the domain plan. Emit a module task only\nwhere that is not guaranteed; then, for each **resource** in that module's inventory,\nemit the ordered per-resource stage tasks:\n\n| Task | Functional topic | Skill (the HOW) |\n|---|---|---|\n| **(only when needed)** Ensure module `<id>` slice exists + is registered across runtimes — **normally already done by the foundation step**; emit this only for a module the foundation step did NOT establish (e.g. one added to the plan after foundation ran). Idempotent, never a blind re-scaffold | `model_domain_graph` | `resource-add-module` + `module-registration` |\n| Resource `<name>` — domain schema (fields, enums, structural decorators). **Workspace-aware**: when the resource already exists as a compose-born starter (see the workspace section), the objective names the DOMAIN content to add to it; only a resource the workspace does not list gets a skeleton-creation objective | `model_domain_graph` | `resource-add-resource` (skeleton, only when the resource does not exist yet) + `resource-schema-authoring` (the persisted shape) + `application-database-migrations` (**PostgreSQL applications only** — see below) |\n| Resource `<name>` — config (registry presence, core operation verbs, access / role scope — but NOT cross-resource relationships, which are the dedicated Step 2 tasks) | `model_domain_graph` | `resource-config-wiring` (plus `resource-retention-binding` when the resource declares personal data — the dispatch adds it whatever you write) |\n| Resource `<name>` — ui-behavior (its read, form, summary and header surfaces and field chrome, each decided and stated — the resource's own UX) | `shape_user_experience` | `resource-ui-behavior` |\n| Resource `<name>` — spec (canonical business semantics — the per-resource documentation capstone) | `model_domain_graph` | `spec-resource-update` |\n\n> **Two things this table is careful about.** (a) **`ui-behavior` is `shape_user_experience`,\n> not interaction semantics** — a resource's field-display / form chrome is UX (Topic 4's\n> \"resource displays / forms\"); the resource's *operations* (custom verbs, access, scope) are a\n> SEPARATE interaction-semantics band, Step 3. (b) The **`spec` task is a documentation\n> capstone**: it documents the resource's fields (domain), operations (interaction), and frontend\n> (UX), so its single topic binding is `model_domain_graph` (the spec's canonical role is business\n> semantics), but its *ordering* is \"after the stages it documents\", not a topic-chain position —\n> see the ordering axes below. (c) **Module scaffolding + registration is the foundation\n> step's job** (a sibling playbook that materialises every domain-plan module). Do NOT emit a\n> module-scaffold or module-registration task for a module foundation already established — that\n> double-counts foundation. The build loop's domain-graph band is per-**resource**; only ensure a\n> module slice where foundation genuinely did not (e.g. a module added to the plan after\n> foundation ran).\n\n### The schema stage owes a migration on PostgreSQL\n\nThe workspace-truth section above ends with **\"Where this application STORES its data\"**, computed\nfrom the accepted schema plan and the authored store declaration. Read it, and follow what it says\nabout binding `application-database-migrations` to the schema stage.\n\nDo not try to find this out yourself. You have no shell and no file access: this method used to\ninstruct you to run `rg -n \"applicationDatabase\"`, which you could not do, and what you answered\ninstead was unanchored. If the section reports the store as UNKNOWN, say so in the plan and bind\nnothing — a wrong guess either way costs more than a stated gap.\n\n**Do not emit a separate coding task for the migration.** Generating one is deterministic work —\n`wildo db generate` writes it — so it is not a coding-agent objective at all. It is a\n`COMPANION_GENERATION_STEP`, and Step 4 below carries its slug.\n\nThe application-wide backstop is the assemble/verify playbook, whose check set includes\n`check:schema-plan-in-sync`. That gate catches a missed migration; it is not a licence to omit\nthe obligation here, because a build that fails at the capstone has already spent every task.\n\nRules for a buildable domain-graph band:\n\n- **Cover every module and every resource** in the inventory (both `mainResources`\n and `supportingResources`). A module or resource with no task is a coverage GAP (the\n build would not produce it).\n- **Not every resource needs every stage.** A `mainResource` (the entity the module is\n about) typically earns the full schema → config → ui-behavior → spec sequence. A\n `supportingResource` may not: a pure junction / lookup entity needs schema + config\n but no ui-behavior (it has no first-class UX surface). Emit the stages the resource\n genuinely needs, and say why a stage is omitted — do NOT pad every supporting\n resource with a UX task it will never use.\n- **Respect the per-resource stage order** (schema → config → ui-behavior → spec) through\n `prerequisiteTaskRefs` naming the actual predecessor task refs.\n This is checked, and it is a REFUSAL rather than a note: dispatch order is computed\n from the declared prerequisites and from nothing else, so a config task that names a\n schema task in the same plan without depending on it may be dispatched first — the\n agent would author a resources-config for a schema that has not landed. Declaring\n the edge indirectly is fine (config → module → schema); leaving it out is not.\n- **State objectives against workspace reality.** A task for a resource the workspace\n section already lists says what to ENRICH (\"author the deal-pipeline stage enum and\n amount/close-date fields the domain plan declares on `deals`\"), never \"create the\n `deals` resource\" — that file exists and a creation objective dispatches a no-op.\n `moduleRef` values come from the workspace section verbatim.\n- **Do not author fields or schemas here.** The task *names* the resource and its\n stage and points the coding agent at the skill; *what* fields the resource carries\n is resolved by the coding agent at dispatch time, from the domain plan + the skill.\n If you catch yourself writing a field list, stop — that is the coding agent's job.\n (Naming the domain CONCERN a stage must cover — \"the pipeline stages\", \"the follow-up\n reminder date\" — is objective-writing, not field authoring; listing concrete\n field-by-field types would be.)\n\n## Step 1b — Emit the shell-placement tasks (when a placement plan exists)\n\nThe **placement plan** decides WHERE every settings destination, resource operation\nand view sits in the shell, and why. It runs before you — it depends on the domain\nplan, not on your output, which is what keeps the two from forming a cycle. You do\nnot re-decide any of it; you turn it into buildable work.\n\nEmit **one task per SURFACE the plan actually places something on**, never one per\ndecision — the config files are per-surface, so a task per decision would have N\ntasks editing one file:\n\n| Task | Functional topic | Skill (the HOW) |\n|---|---|---|\n| Author the settings rail placement config from the accepted placement plan | `shape_user_experience` | `settings-placement-authoring` |\n| Author the sidebar, command palette or user menu placement config from the accepted placement plan | `shape_user_experience` | `config-app-shell` |\n\nBind by the FILE the surface is configured in. The settings rail is `settings-hub.config.ts`. The sidebar, the palette\nand the user menu (its `settingsEntries`) are `app-shell.config.ts`, and `settings-placement-authoring` itself sends\nwork on them to `config-app-shell`: binding it there hands the agent a skill that tells it to go elsewhere. Only\n`config-app-shell` teaches `runtimeAvailability.requiredRoles`, which a sidebar group or entry the plan restricts to\nsome roles needs.\n\nAny task whose HOW includes **writing JSX for a bespoke surface** — a ui-behavior\nstage, a custom or composite view, an app-level screen — binds\n`frontend-component-catalog` alongside its own skill. It is what tells the coding\nagent which components the framework exports and how to spell their props; without\nit the agent builds the surface from raw `div`s and hand-written utility classes,\nbypassing the theme, the surface policy and the accessibility behaviour every\npreset carries. Do NOT bind it to a task that writes no markup (a schema stage, a\nconfig stage, a migration).\n\nRules:\n\n- **Target kind is `SHELL_PLACEMENT`, carrying the surface.** Not\n `COMPANION_GENERATION_STEP` — that kind is \"never a coding-agent run\" and this is\n one. The host derives the mutation scope from the kind, so borrowing a neighbour's\n gives the task the wrong permissions.\n- **A surface the plan places nothing on gets no task.** An empty settings rail is\n not something to author.\n- **Order after the resources and views a surface references.** Placing a resource's\n LIST in the sidebar before that resource exists is a task that cannot verify.\n- **Carry the decision, not the config.** The task names the surface and points at\n the skill; which category a destination lands in and in what order is IN the plan,\n read by the coding agent at dispatch. Do not restate placements in the objective.\n- **Never override the placement plan in an objective.** The sidebar and command-menu tasks land when the\n shell carries exactly what the plan placed there, so an objective that keeps a placed subject off its surface\n is a task that can never land. One business concept held in two resources (read through and copied) has ONE\n sidebar entry, the experience plan's concept view (its `entryForResourceRefs`), with both lists on the command\n menu (`config-navigation`, `references/one-entry-per-concept.md`). When the coherence report shows\n `concept-list-on-sidebar`, `concept-view-not-on-sidebar` or `concept-list-not-on-command-menu`, the two plans\n disagree and the next run of the plan that is wrong resolves it: say so in your notes and decompose the\n placement plan as it stands.\n- **No placement plan? Emit nothing here and say so.** Do not invent placement — a\n guessed arrangement is exactly what the plan exists to replace, and it would be\n invisible to the reader who assumes a placement task came from a decision.\n\n## Step 2 — Emit the relationship-wiring tasks\n\nEmit one wiring task per MODULE, for the relationship-drafts that module holds:\n\n| Task | Functional topic | Skill (the HOW) |\n|---|---|---|\n| Wire the `<module>` relationships: `<A> <-> <B>` (`<cardinality>`, `<owner>` holds the ref), … | `model_domain_graph` | `module-relationships` |\n\nIts target is `RELATIONSHIP` with the module and EVERY relationship it wires in `relationshipRefs`, and it\ndeclares one `RESOURCE_RELATIONSHIP` product per relationship, with both endpoints. The target and the\nproducts name the same relationships: one named in only one of them is refused.\n\n**Why per module and not per relationship.** Every relationship of a module is written into that module's ONE\nrelationships file. Two tasks wiring two relationships of one module edit the same file; run at the same time,\nthe later write loses the earlier relationship, and the build re-runs each task alone. One application split one\nmodule's 23 relationships into 23 tasks, and its whole relationship phase ran one task at a time for seven hours.\nOne task per module pays the worker's start and its checks once, and different modules' tasks run in parallel.\nThe build also does this for you: a plan with one task per relationship is regrouped per module when it lands,\ncut into chained tasks of at most six relationships each, so a module with many relationships becomes a few\ntasks run one after the other. Group them yourself anyway, so the plan you return is the plan you meant.\n\nRules:\n\n- **This is the single home for cross-resource relationships.** A relationship is wired\n ONCE, here, by the `module-relationships` skill (which coordinates the FK across the\n owner's schema + config, the target's relationship map, the owner's read and edit pages,\n and both specs coherently). The owner's UI task runs before the FK exists, so showing the\n reference on its pages is THIS task's work; say so in the objective. Do\n NOT also wire it inside the per-resource config task in Step 1 — that config task\n establishes the resource's registry presence and core verbs, not its cross-resource\n FKs. Emitting the relationship in both places double-counts the work.\n- **Order after both endpoints' schema tasks.** A relationship-wiring task references\n two resources; both must have a schema task ordered before it (a relationship wired\n before an endpoint exists is a GAP).\n- **Never invent an endpoint.** A relationship-draft whose source or target resource no\n module declares cannot be wired, and it is not yours to repair: emit no wiring task for\n it and do not add the resource to any task. The conception owns that fault, and the\n judge's `conception-buildable` verdict sends the application back to it. A plan that\n invents the resource to wire it hides the fault the conception needs to see.\n- **Carry the intent, not the resolution.** The task states the two ends, the\n cardinality intent, and the ownership direction from the relationship-draft. Write\n the cardinality WITH its direction — \"many-to-one from `customer` to\n `country-context`, customer holds the reference\" — because the draft's label is\n read source → target and a bare \"one-to-many\" cannot be wired without knowing\n which end it was read from. The\n cardinality-to-FK-holder resolution (discriminator / conditional relationships, the\n physical FK placement) is the `module-relationships` skill's job **at dispatch\n time**, not decided here.\n\n## Step 3 — Emit the interaction, UX, extension, and integration tasks\n\nOnce the domain graph is decomposed, emit the tasks for the later topic bands, drawn\nfrom the requirements + feature-drafts. Bind each task to **one** functional topic and\nto the skill(s) that carry its HOW, resolved from the **skills catalog your brief\ncarries** — every installed skill's name and what it does, under \"Application-knowledge\nskills\". Every skill name you emit MUST appear there, spelled exactly. Do **not** guess a\nskill name and do not recall one: a name that is not in that list addresses no skill\nfolder, and the task bound to it cannot be dispatched.\n\n### Every requirement verb becomes a task\n\nDefault verbs (create, read, update, list, delete) are what Step 1 already gives every resource.\nEverything a requirement says the product DOES beyond them is work this step must emit.\n\n**Start with the domain plan's `lifecycles`.** Each declared transition is one `RESOURCE_OPERATION`\nproduct on its resource (target `RESOURCE_STAGE` CONFIG, `operationRef` = the `transitionRef`, exactly),\nskill `resource-status-lifecycle`, ordered after that resource's config task; its objective names the\nstates it moves between and who performs it. One task may carry all of a resource's transitions.\n\n**A transition that creates a record (`createsResourceRef`) creates it in its OWN operation**, in the same\ntransaction: accepting a quote IS the operation that creates the job. So the conversion is part of the\ntransition's task, never a task of its own. That task's objective names the record it creates and what it\ncarries over, it adds the skill `backend-custom-operation` (the write is a custom implementation of the\ntransition's operation), and it is ordered after BOTH resources' config tasks. Do NOT add a second task for the\nwrite, and never name an operation that is the transition plus something else (`approve-create-job`,\n`qualify-create-opportunity`): no such operation is declared, the only code that could carry that name is a\nsecond operation doing what the transition already does, and the plan is refused for it. The only operation\nnames a lifecycle gives you are its `transitionRef`s. The resource's SCHEMA task objective names the status\nenum with every declared state, the `initialState` as its default, and each transition's `stampsField`,\nall excluded from create and update: a transition is the only way to move them.\nFor a resource with `lockedStates` or `finalStates`, the objective of each transition task that moves INTO\none of them also restricts the resource's UPDATE to the states that are neither locked nor final. Never plan\nthat freeze as its own `update` operation task: the scaffold already writes `update`, so such a task reads\nas built before it runs.\n\n**A step is offered only where it can succeed, and a refusal says why.** Each transition task's objective\nnames its `from` states as the only states in which the action is offered, on EVERY variant of the\noperation (an administrator's variant included): the engine then refuses the step from any other state,\nand the screen does not offer it there. Wonder Procurement offered \"Department-head decision\" on a draft,\nand the backend answered 409. When the operation can ALSO be refused for a reason its state does not show\n(a supplier no longer in the directory, a budget already spent), the objective names that refusal and\nsays it reaches the person as a sentence worded through the labels, like every other display text,\nnever as a bare \"conflict\": the refusal carries a declared code (`backend-custom-operation`,\n`references/declared-refusal-codes.md`). The words come from the resource's specification, so its SPEC\ntask's objective names them too: each refusal code as an operation's `errorScenarios[].errorCode` with\na `when` written as what the person reads and does next, and each transition's `unavailableWhen`, the\nsentence a disabled action shows (`spec-resource-update`).\n\n**A resource with a lifecycle has a record page, and its ui-behavior task builds it.** That task's\nobjective states the page, because the engine's generated page puts the status first and who made the\nrecord last but cannot know the route, or which facts belong to which stage\n(`resource-ui-behavior`, `references/workflow-record-page.md`; its spec task documents it, `spec-resource-update`,\n`references/workflow-record-page-specification.md`):\n\n- the status as the page's leading pill, read-only, shown once: on `layout.header` when the page\n authors one (a workflow page does), otherwise `<RecordState>` first in `layout.display`, never both,\n its name kept for a screen reader (`labelPlacement=\"hidden\"`, never `hideLabel`, which removes it);\n with where the record stands in its lifecycle;\n- the next steps from that status as actions with words (its transitions, offered only from their\n `from` states), never bare icons, each with a `displayPriority` so the main verb of each state comes\n first: a desktop list row keeps ONE action in view and a phone header one, and the action with the\n lowest `displayPriority` value that can run is the one that stays;\n- the fields in sections, in business order: what the record is first, then its workflow and the moments\n its transitions stamp (`stampsField`);\n- the record keeping last: its creator and timestamps (`createdByUserId`, `createdAt`, `updatedAt`) on\n one quiet line in `<RecordKeepingFacts>`, never as tiles in a section, and the organization it belongs\n to not shown at all (`references/framework-record-page-parts-api.md`).\n\nA date the business needs in the future (needed by, due on) is refused when it is in the past by the\nOPERATIONS that write it, never by the page alone: the schema task's objective says so for create and\nedit, the transition task's for the step that relies on it (submit), each refusal with its declared code.\n\nA lifecycle resource whose build plan carries no `RESOURCE_UI_BEHAVIOR` product is reported by the\ncoherence report (`lifecycle-resource-no-record-page`), and its page is the engine's generated one, which\nknows no route.\n\nThen read every functional requirement's acceptance criteria for verbs no lifecycle carries, and\nclassify each:\n\n| The criterion says… | Emit | Skill |\n|---|---|---|\n| a record CHANGES STATE (\"an accepted quote\", \"issue the invoice\", \"mark it paid\", \"close the case\", \"a submitted request can be approved\") | one `RESOURCE_OPERATION` per transition, on the resource whose state changes, target `RESOURCE_STAGE` (CONFIG). Its objective names the states it moves between and who may call it | `resource-status-lifecycle` |\n| one record CREATES or FILLS another (\"an accepted quote creates a job\", \"invoice the job\") | when a declared transition does it: that transition's `RESOURCE_OPERATION` task, whose objective names what it creates, ordered after both resources' config tasks (no second task). Otherwise one `RESOURCE_OPERATION` on the SOURCE resource naming the new operation, target `MODULE_BACKEND` when the write is a custom implementation | `backend-custom-operation` |\n| a record must not change any more (\"an issued invoice cannot be edited\") | the objective of the `RESOURCE_OPERATION` task for the transition into that locked or final state also restricts its UPDATE to the open states (never a separate `update` task, which the scaffold already writes) | `resource-status-lifecycle` |\n| a user group may or may not do something (\"technicians cannot see invoices\") | an `APPLICATION_ROLES` task (see below), or, for core roles alone, the config tasks' objectives | `application-roles-authoring` / `resource-config-wiring` |\n| a member sees only PART of the organization's records (\"department heads see their department's requests\", \"employees see only the requests they raised\") | an `ORGANIZATION_UNIT_CONFINEMENT` product of the confinement task (see \"The organization model\" below), never a `RESOURCE_OPERATION` and never a membership feature; the domain plan records it in `organizationModel.unitConfinements` | `authorization-unit-narrowing` |\n| only a QUALIFIED person may take a decision (\"only a chartered accountant approves postings\", \"the reviewer must be licensed\") | the `APPLICATION_ROLES` task for the role, and in the same task's objective the declared `professionalQualificationKinds` and the register's Settings placement; the task that raises the decision (an agent's gate, an operation's `requiresApproval`, a flow's person step) names `requiredQualificationKinds` beside its `eligibleRole` | `professional-qualifications` |\n| the product PRODUCES a document (\"send the quote as a PDF\", \"print the invoice\") | a `PDF_TEMPLATE` task bound to a generated-file field of that resource | `pdf-template-authoring` |\n| the product SENDS a message (\"email the customer\", \"remind the office\") | the `email-templates` generation step, and a `RESOURCE_OPERATION` task whose objective declares the notification on the operation that triggers it | `email-add-template` |\n| something is shown or computed from other records (\"the next action\", \"what is overdue\") | NOT a stored field: a view task from the experience plan, or a computed value in the owning resource's config task objective | — |\n| the product uses AI (\"an assistant answers questions about…\", \"summarise\", \"classify automatically\", \"triage every morning\", \"an agent proposes, a person approves\") | one `MODULE_BACKEND` task per AGENT, in the module whose records it reads, ordered after the config tasks of every resource its tools read or write. Its objective states the agent's use (what it is for, whether it decides anything about a person, who reviews), its `contentGuardrails` wherever they can treat something, and which of its writes wait for whose approval | the shape skill: `flows-actors-chat-assistant` (a person converses with it), `flows-actors-llm-agent-invocation` (your code calls it once), `flows-actors-autonomous-agents` (it runs with nobody signed in), `flows-actors-declared-flow` (a step of a flow) — AND `ai-use-declaration` |\n\nAn agent task always names BOTH skills: the shape skill builds it, and `ai-use-declaration` is what makes it\ndeclare its use — every agent carries `aiUse`, `contentGuardrails` and gated writes, and an agent built from\nthe shape skill alone is the unguarded shape. The dispatch adds both from the task's products whatever you list.\n\nAn agent task DECLARES what it produces, so landing can prove it:\n\n- one `APPLICATION_AGENT` product, with the `agentRef` the code will register and the `shape` the requirement\n describes (a person converses with it → `CHAT_ASSISTANT`; it runs on a schedule or when a message arrives →\n `AUTONOMOUS`; your code calls it once → `INVOKED`; a step of a flow → `FLOW_STEP`);\n- one `AGENT_APPROVAL_GATE` product for EVERY tool that changes something and waits for a person, with the\n route the requirement implies: \"the person asking confirms\" → `owner`; \"a manager approves\" → `role` with the\n role that group holds; \"a chartered (licensed, certified) accountant approves\" → `role` with that role AND\n `requiredQualificationKinds` naming the declared kind; \"the account's partner signs off\" → `assignee` with the\n role that person must hold. The role is the one an `APPLICATION_ROLE` product declares, or a core role, so a\n gate whose approver group has its own role is ordered after that roles task. An `owner` gate never names a role\n or a qualification.\n\nAn assistant's view is still its own `APPLICATION_VIEW` task from the experience plan.\n\nWhen a requirement prices, budgets or reports cost PER CASE (\"what each engagement costs us in AI\", \"margin per\nmatter\", \"cost per ticket\"), or names the record the agents' work is about (\"each close\", \"each claim\"), the\nconfig task of that resource also produces `WORK_UNIT_RESOURCE`, so every model call is attributed to its case.\n\n### When the application has a service method, realize it whole\n\nA firm's method (the `service-method` family, #2305) is the application's agent work written down, so read it\nbefore the requirement verbs above and realize every element of it:\n\n- each service's CASE: the config task of the resource named by `case.caseRef` also produces\n `WORK_UNIT_RESOURCE` for it;\n- each step `performedBy: AGENT`: an `APPLICATION_AGENT` product in the step's `agentShape`, naming the step in\n `serviceMethodStepRefs` as `<serviceRef>/<stepRef>`. One agent may carry several steps of one shape;\n- each decision point, realized ONE way:\n - when a tool waits for the person's approval before it writes: an `AGENT_APPROVAL_GATE` product on that tool,\n naming the decision in `serviceMethodDecisionRef` as `<serviceRef>/<decisionRef>`, with the decision's `route`,\n its qualification's `role` as `eligibleRole` (none for `owner`), and its qualification's\n `professionalQualificationKind` as the only entry of `requiredQualificationKinds` (none when it names none);\n - when the agent ASKS the person and continues from the answer (a review question its run suspends on, such as\n choosing which document pays a bank line): the agent's `APPLICATION_AGENT` product names the decision in\n `serviceMethodAskedDecisionRefs`, and the task's objective says the question's route and role. Its tool has no\n gate: the question is the review;\n - either way, its `decisionDeadline` goes in the task's objective, which the gate's or the question's deadlines are\n built from;\n- each qualification's role: an engine role, or an `APPLICATION_ROLE` product. The `APPLICATION_ROLES` task declares\n every `professionalQualificationKind` the method names in `professionalQualificationKinds`, and is emitted for that\n even when every qualification's role is an engine role;\n- each service with `pricing: PER_CASE`: the billing catalogue task produces a METERED product for it (its\n `productKey` names the case, priced per unit), and a task on the case resource produces a `METERED_USAGE_RECORDING`\n on the operation that CLOSES the case (`case.closesWhen` says which), with that `productKey`, `oncePerRecord: true`\n and the service in `serviceMethodServiceRef`. Order it after the catalogue task and after the case's closing\n operation exists. A service priced `INCLUDED_IN_PLAN` or `BILLED_OUTSIDE` records nothing;\n- each deliverable: a `PDF_TEMPLATE` product on the resource the deliverable is produced from (`fromResourceRef`), bound\n to its generated-file field, naming the deliverable in `serviceMethodDeliverableRef` as `<serviceRef>/<deliverableRef>`;\n- the case's evidence: the config task of the case resource, and of each deliverable's resource, also produces a\n `RESOURCE_RETENTION_BINDING` in the service's `evidenceRetention.retentionClass`. A `BUSINESS_RECORDS` binding also\n declares the statutory retention policy (the `resource-retention-binding` skill says how; the dispatch adds it);\n- each qualification the firm's people hold for the client (`heldBy: FIRM`), unless its role is `ORG_REPRESENTATIVE`\n (conferred already): the `APPLICATION_ROLES` task also produces a `RELATIONSHIP_CONFERRED_ROLE` for its role on the\n relationship the firm serves its clients through (`service` in the configuration's `organizationRelationships`). The\n firm's people hold that role for a client only through the relationship: the task adds it to the kind's\n `confers.roles` and offers it on every organization type the kind grants. A role the client's own staff hold\n (`heldBy: CLIENT`) is offered on the client's organization type and conferred nowhere.\n\nThis is checked at landing: a plan that leaves a case without its work unit, an agent step without its agent or a\ndecision point unrealized (or a gate with another route, role or qualification), or a service priced per case with\nno recording of its case (or one recording elsewhere, every run, or a product the catalogue does not sell), a\ndeliverable with no document, a case's evidence unbound or bound to another class, or a firm-held role no\nrelationship confers is refused, with the list of what is missing. A case's lifecycle that lacks one of its stages is\nthe domain plan's to fix, and is reported rather than refused. A case the domain plan does not declare is the domain plan's to fix, and is reported rather than refused. Name the method's services in `servesRefs` only where a requirement also justifies the task.\n\nA task emitted from a requirement verb is justified by that requirement: name it in `servesRefs`.\nIt is never the \"justified by nothing\" speculative work the rule further down warns about. A plan\nwhose requirements describe a workflow and which carries no `define_interaction_semantics` task is\nnot a lighter plan — it is a CRUD shell, and the reviewer reports it as a gap.\n\n**Every surface below has its own target kind and its own product kind. Use them.**\nUntil 2026-09-22 only resources had a vocabulary, so a task for any of these surfaces\neither declared no product (and could never be proven landed) or borrowed `MODULE`\nwith a product its scope could not prove. A task that squeezes a website page into a\n`MODULE` target, or declares a view with no product, is the defect this vocabulary\nreplaced — the judge reports it as a gap.\n\n- **`define_interaction_semantics`** — custom operations, lifecycle behaviour, access /\n role / scope rules, rate limits — interaction beyond the default resource verbs.\n Target `RESOURCE_STAGE` (CONFIG), product `RESOURCE_OPERATION`. Skills: the Backend and\n Resources domains of the router (`backend-custom-operation`, `rate-limit-authoring`). A\n requirement that confines records to a department or to their author is NOT an operation:\n it is a row confinement, emitted under \"The organization model\" below, whose product a\n `RESOURCE_OPERATION` could never prove. **Derive these from the requirements' VERBS** — read\n \"Every requirement verb becomes a task\" below before emitting anything else in this step.\n- **`shape_user_experience`** — the cross-resource UX, and you do NOT decide it here. The\n **experience plan** (`bottom_up.experience-plan`) already did: which surfaces exist, what\n each is for, which presets it reuses, and how the shell, navigation, design system and\n global views are composed. Read it and emit:\n - one task per VIEW, target `MODULE_FRONTEND` on the view's own module, product matching\n its kind (`RESOURCE_COMPOSITE_VIEW`, `RESOURCE_CUSTOM_VIEW`, `RESOURCE_CHART_VIEW`,\n `APPLICATION_VIEW`, `CUSTOM_COMPONENT`; an execution view is a `RESOURCE_CUSTOM_VIEW`\n product, which is what its file is). A composite, custom or app-level view's product\n carries the plan's `viewRef` verbatim — a ref the plan does not carry is refused as\n dangling, and the dispatch looks the view up by it; a chart names its `chartRef` and a\n component its `componentRef`. Its skill is the one its view kind names (the dispatch\n derives it from the product and loads it first). Carry the view's `reusesComponentRefs` into the task's\n objective — the presets are the decision, and an objective that drops them hands the\n agent a blank surface;\n - one task per CONFIGURATION, target `APPLICATION_FRONTEND_CONFIG` with that surface,\n product `APPLICATION_FRONTEND_CONFIG` naming the surface's own `declarationRefs`, and\n its skill the one the surface names (`config-navigation`, `config-design-system`,\n `config-app-shell`, `layout-2d-adoption` for the shell layout; `views-app-level` for global views\n — derived at dispatch too). A shell layout task depends on the design-system task when both are\n planned: the layout moves at the theme's pace.\n A product's `declarationRefs` are NAMES THE FILE DECLARES IN CODE, never names of decisions, because\n landing looks for them in the file with its comments removed. For `NAVIGATION` that means\n zone keys only: `secondary` for a list-and-detail layout, `companion` for a persistent side panel. The\n transitions and viewport behaviour you decided (a split from list to detail, a phone that replaces the\n detail) go in the objective; a navigation product naming `navigation-transition-list-to-detail-split`\n is refused, because a navigation config has no place to declare it. `primary` is written by `wildo\n init`, so a plan keeping the one-zone default plans no navigation task at all.\n **The shell's CONTENT belongs to the placement tasks.** When a placement plan exists, the sidebar, the\n user menu and the command palette are each written by Step 1b's `SHELL_PLACEMENT` task for that surface,\n the only task whose landing can prove them (it compares the shell with what the plan placed). So the\n experience plan's `APP_SHELL` declarations that name a sidebar section or an entry go into the objective\n of the `SHELL_PLACEMENT` task for that surface, not into an `APP_SHELL` product. Emit an `APP_SHELL` task\n only for what no placement task writes (the shell's frame: which shell components are on, their chrome);\n its objective says the entries are left to the placement tasks, and the placement tasks wait on it.\n One application had its app-shell task write the whole sidebar, user menu and palette; three placement\n tasks then found their work already done, changed nothing, and ran for an hour and a half.\n When the plan decides a `home`, the `GLOBAL_VIEWS` task sets it: its objective says to make\n `homeDefinitionFactory` in `frontend/src/config/global-views.config.ts` return that home, carrying\n the home's rationale. A `VIEW` home is an application view: `{ compositeViewReference: <the view's\n ref constant> }`, and the task depends on the task that builds that view. A `RESOURCE_OPERATION`\n home is `{ resourceOperationPath: … }` naming the resource's registered type (camelCase, not the\n slug), the operation, `isOperationDefault: true`, `isBulkOperation: false` and the default variant's\n `variantKey`: the root matches all of them exactly and silently shows the welcome page on a\n mismatch. That task depends on the resource's config task. Without the home the application opens\n on the framework's welcome page whatever the plan says.\n A `VIEW` home's `blocks` are what that view shows: the task that builds the home's application view\n carries every block into its objective — for an `AWAITING_DECISION` block, the resource, the\n transitions whose waiting records it lists (their `from` states) and the people who take them (the\n block is drawn only for a viewer who may perform that operation, `useViewerMayPerformResourceOperation`;\n `views-app-level`, `references/workflow-home.md`); for\n `MY_RECORDS`, the resource and whose records they are; for `KEY_FIGURE`, the figure — and depends on\n the config tasks of the resources it reads and on the operation tasks of the transitions it awaits.\n A block that lists records embeds the resource's own LIST drawn as its rows only, so the objective\n says `collectionToolbar: CollectionToolbarPresence.HIDDEN`: without it every block repeats the list\n page's search, view switch and Create.\n An objective that drops a block hands the agent the \"Welcome\" page under another title.\n - one task per planned MILESTONE, target `MODULE_BACKEND` on the milestone's module,\n product `APPLICATION_MILESTONE` naming its `milestoneRef`, skill\n `milestones-and-celebrations` (`EXPERIENCE_MILESTONE_SKILL_REF`). It depends on the config stage of its\n `triggerResourceRef` — the operation that earns it must exist before it can be counted.\n Carry the planned moment into the objective;\n - one task per planned piece of GUIDANCE, target `MODULE_FRONTEND` on its module, product\n `APPLICATION_GUIDANCE` naming its `guidanceKind` (the plan's `kind`) and `guidanceRef`,\n skill `guidance-onboarding-authoring` (`EXPERIENCE_GUIDANCE_SKILL_REF`, the same for both\n kinds). It depends on the milestone tasks its `gatedByMilestoneRefs` name, and on the\n resources whose operations it responds to. Carry the planned purpose and gate into the\n objective — the gate is what makes it appear at the right moment. For an\n `ONBOARDING_DOCUMENT`, also carry its `hostViewRef` — the objective must say which view\n embeds it with `EmbedOnboarding` (a view of the document's own module, so inside the task's\n scope) — and depend on that view's task when the plan builds it:\n landing proves the document is declared, not that anything shows it.\n Do not choose any of these skills yourself: every map is total over its vocabulary, and the\n build dispatch DERIVES each task's skill from its product and loads it first, whatever the\n task declares. Declare the skill the product's kind names anyway (the view skill for a view,\n `config-<surface>` for a configuration), so the plan reads right; add a second only when the\n task genuinely needs one no map would give it. With no experience plan,\n emit nothing here — an improvised surface is the state this family replaced. That\n absence is not silent: the reviewer's experience-coverage invariant records it, naming\n what the application will lack, so a build that goes ahead without the plan says so.\n (A placement DECIDED by the placement plan is Step 1b's `SHELL_PLACEMENT`, not this.)\n- **`extend_application`** — the controlled extension points where the declarative model\n is not enough:\n - a custom UI component / widget → target `MODULE_FRONTEND`, product `CUSTOM_COMPONENT`;\n skills `engine-component-registration`, `frontend-component-catalog`;\n - a PDF template / renderer → target `MODULE_BACKEND`, product `PDF_TEMPLATE`; skill\n `pdf-template-authoring` (the dispatch adds it whatever you write);\n - custom backend implementation logic → target `MODULE_BACKEND`, product the\n `RESOURCE_OPERATION` it serves; skill `backend-addon-wiring`;\n - workers and minions → you do NOT decide them here. The **integration plan**\n (`bottom_up.integration-plan`) already did: which surfaces run beside the backend, on\n which runtime, and exactly which resources a minion's tick may read and write. Read it\n and emit one task per WORKER (target `WORKER` with its `runtime`, product\n `APPLICATION_WORKER` naming its `jobRefs`, skill `worker-authoring` — both `NODE` and\n `RUST`, which is what `INTEGRATION_WORKER_SKILL_REF` holds) and one per MINION (target\n `MINION`, product `APPLICATION_MINION` naming its `behaviorRefs`, skill\n `minion-authoring`). Carry the minion's\n `readsResourceRefs` / `writesResourceRefs` into the task's objective: the whitelist\n starts DENY-ALL and an empty one keeps running, so an objective that drops them hands\n the agent a minion that looks healthy and touches nothing. The PACKAGE is composed by\n the foundation, one scenario per surface, so the task authors the BEHAVIOUR. With no\n integration plan, emit nothing here.\n - inbound channels → also decided by the **integration plan** (`inboundChannels`): work that\n ARRIVES — clients emailing documents to a matter, customers writing to a support address,\n people texting an organization's number (`sms`).\n Emit one task per declared channel: target `MODULE_BACKEND` in the module whose records the\n messages concern, product `INBOUND_CHANNEL_HANDLER` with the channel and a `handlerRef`\n (`<moduleRef>.<purpose>`), skill `inbound-channels` (the dispatch adds it whatever you write,\n so the agent is never without it). The channel's `purpose` is the task's objective, and its\n `servesRefs` are the task's. Make it depend on the tasks that register the resources the\n handler writes. The foundation already switched the receiving capability on; nothing here\n configures a provider.\n- **`connect_runtime_and_external_capabilities`** — providers and external connectors,\n and the **integration plan** decided these too: one task per PROVIDER BINDING it\n declares, target `PROVIDER_BINDING`, product `PROVIDER_BINDING` with the binding's own\n `scope` (and its `augments`, copied as written: it is what that task is judged landed by), and its skill taken from that scope through\n `INTEGRATION_PROVIDER_BINDING_SKILL_REF` — do not choose it yourself, the map is total\n over the scope vocabulary. The binding's `rationale` is the task's objective. Reach for\n `provider-operation-calls` and `configure-billing` as the task's further reading when the\n binding is one an application then CALLS. Environment and infra config are the\n foundation's, not a build task's.\n Such a task WIRES a provider that exists: an engine provider, or a registry module it\n installs with `wildo registry add`. The app-side module, contribution and scope entry a\n frontend binding writes are that wiring. It never writes a NEW vendor implementation (a\n provider package or module neither the engine nor the registry supplies), with ONE\n exception: a binding whose `providerRef` the integration plan records in `unprovidedNeeds`\n (#3992). That task writes the new provider; its objective carries the entry's `need` and\n `whyNoExistingProvider`, and it reaches for `provider-backend-package` (for a frontend scope, the\n skill the scope maps to, which authors the browser module). An `unprovidedNeeds` entry that\n names a worker or minion in `wiredByRef` has no binding: the WORKER or MINION task of that\n surface writes the new provider, declares it in the surface's own scope\n (`providers.scopes.workers.<key>` / `providers.scopes.minions.<key>`), carries the entry's\n `need` and `whyNoExistingProvider` in its objective, and adds `provider-backend-package` to\n its skills. Emit no task that writes a new vendor implementation for any other reason.\n- **What the domain plan left to the engine** — its `engineRealizedRequirements` name the\n requirements met by configuration rather than a module. Each still owes configuration work:\n `APPLICATION_ROLES` → the roles task below; `NOTIFICATIONS` → the triggering operation's task\n (the verb table above); `PERSONAL_DATA` and `AUDIT_TRAIL` → the declarations in the resource\n config tasks' objectives; `BILLING` → the billing catalogue task; `GUIDANCE` → the experience\n plan's guidance tasks; `GOVERNED_DOCUMENT` → no build task (the compliance lane composes it);\n `ORGANIZATION_RELATIONSHIPS` → the organization-model task below (its relationship kinds), never\n a module: the engine owns the relationship rows between organizations; `ORGANIZATION_MEMBERSHIP`\n → no task for membership itself (members, invitations, units and their roles are the foundation's\n capabilities), BUT a requirement confining records to a unit or to their owner owes the\n confinement task below, which the domain plan records in `organizationModel.unitConfinements`;\n `LOCALIZATION` → no task beyond the foundation's capabilities.\n Never emit a task that builds one of these as a resource.\n- **The application roles** — target `APPLICATION_ROLES`, when a requirement names groups of\n users with different access (\"office and field staff\", \"technicians cannot see invoices\",\n \"read-only reviewers\"). Emit ONE task (the role table is one file) producing one\n `APPLICATION_ROLE` per group that no core role covers, skill `application-roles-authoring`\n (the dispatch adds it whatever you write), and `servesRefs` naming the requirement. Reuse the\n core roles first: the broadest internal group usually holds `ORG_MEMBER`, and a requirement met by\n them alone (\"only administrators may delete\") needs no roles task, only config tasks that say which\n operations are restricted. The task declares the roles, offers them on the organization types,\n and narrows the `roles` of the operations they govern, so order it AFTER the config tasks of every\n resource it narrows, and say in its objective which operations each role may call. Never answer a\n role requirement with a resource holding roles, permissions or role assignments: nothing in the\n engine reads it.\n- **The organization model** — target `ORGANIZATION_MODEL`, and the **domain plan** decided it (your\n brief renders it under the domain plan). What the application's configuration ALREADY declares (its\n organization types with the one that owns the application, its relationship kinds, its system-of-record\n instances and their vendors) is the workspace section's \"The organization model this application's\n configuration already declares\": read every comparison below against it. Its `organizationModel` lists the organization types, the relationship kinds between them, the\n resources whose rows are confined below the organization, and where each resource's records live.\n Never a module or a resource for any of these, and above all never one for a relationship between\n organizations: the engine owns those rows, their record separation and their invitations (#2617).\n Emit, when the domain plan's organization model carries the entries:\n - ONE organization-model task (both lists live in `wildo.saas.config.ts`, so two tasks would write\n over each other) producing one `ORGANIZATION_TYPE` per entry of `organizationTypes`, carrying the\n entry's `ref`, `offeredRoles`, `userTypes` and `requiresMfa`, and one `ORGANIZATION_RELATIONSHIP_KIND`\n per entry of `relationshipKinds` the configuration does not already carry.\n **The OWNER type is identified by `ownsApplication`, never by its key.** By the time the build runs\n the platform has already created the operator's organization and its administrator under the\n scaffold's key (`workspace`), and the application line may have set its joining posture (an\n internal tool admits by invitation only). So the plan's owning type (`ownsApplication: true`),\n whatever it calls it (`group`), describes the configuration's EXISTING owner type: its product\n carries `ownsApplication: true`, and the task REVISES that type, keeping its joining posture and any\n sign-in or directory settings it carries. Its product lands only under the plan's key and granting\n exactly the plan's user types. The foundation has usually renamed it already; where the\n configuration still holds the scaffold's names (`workspace`, `member`), the task's objective says to\n RENAME them with a declared rename: the new organization type and the new user type each carry\n `renamedFrom: [{ key: '<old key>', justification: '…' }]`, every reference follows, and the backend\n then moves the organization and the accounts already created at its next start (skill\n `config-saas-backend`, reference `renaming-organization-and-user-types.md`). A key renamed without\n it strands them. Never add a second type with `ownsApplication` (the configuration refuses it at\n startup), and never replace the existing owner. Relationship kinds name the owner by the plan's key, which\n the configuration carries once renamed.\n A type's product lands when the type carries what the plan decided of it, so a type the\n configuration already declares as planned owes nothing and lands at once, and one declared\n differently lands only after the task revises it. A relationship kind proves only its KEY, so for\n a kind the configuration already carries but declares differently from the entry (other sides,\n `mutual`, conferred roles or `tenantRecords`), the task's objective names each difference and that\n kind declares no product. Its objective carries\n what each entry decided: for a type, its purpose, its user types, the roles it offers, whether it\n owns the application, whether its members must use a second factor (`requiresMfa`) and how an\n organization of it is joined; for a kind, which types represent\n and which grant, whether it is mutual, the roles it may confer and which records each relationship\n keeps apart (`tenantRecords`). Skills `config-saas-backend` and `organization-relationships` (the\n dispatch adds both whatever you write). Order it before the `APPLICATION_ROLES` task, which offers\n roles on these types and confers roles through these kinds; a role a relationship confers is that\n task's `RELATIONSHIP_CONFERRED_ROLE`, never this one's.\n - ONE confinement task producing one `ORGANIZATION_UNIT_CONFINEMENT` per entry of\n `unitConfinements`: the resource, its `mode` and its `fieldName`, verbatim. A resource confined to\n its unit AND to its owner's rows is two entries and two products. Skill\n `authorization-unit-narrowing` (added by the dispatch). Narrowing is ADDITIVE: a member whose\n organization-wide role already satisfies a read is not confined, so the task also gates the\n confined resource's reads above the default member role, and its objective says which role reads\n what. Order it after the config task of every confined resource and after the roles task.\n - each entry of `recordLocations` whose `location` is `SYSTEM_OF_RECORD` becomes a\n `SYSTEM_OF_RECORD_BINDING` product of THAT RESOURCE'S CONFIG task (not a separate task, since the\n binding is its configuration), carrying the entry's `systemOfRecordKind` and `access` verbatim, and\n an INSTANCE key derived, never invented: the key of the instance the workspace's configuration\n already declares under `systemsOfRecord` with that `vendor` (listed as \"system-of-record instance\n `<key>` of vendor `<vendor>`\" in the workspace section); when it declares none, the `systemOfRecordKind` itself (`odoo`). In that second\n case the CONFIG task's objective also declares the instance in `wildo.saas.config.ts`\n (`systemsOfRecord.<key>`, with `vendor` set to the kind, its dialect and its personal-data origin):\n the binding lands only on a declared instance of that vendor, and the task may write the\n configuration. Several resources from one system share one instance, so only the first of their\n config tasks declares it and the others depend on that task. The dispatch adds\n `resource-external-data` and `config-saas`. The resource keeps its other stages: a read-through\n resource has no table, so its schema task owes no migration.\n `partitioned` comes from the entry's `partition`, never from a guess: `true` for `BY_LEGAL_ENTITY`\n and `UNCONFIRMED`, `false` for `NOT_SPLIT` and `CANNOT_BE_SPLIT`. When it is `true`, the task that\n declares the instance gives it `partition: true`, and when the workspace section already lists the\n instance without \"partitioned\", the FIRST config task binding that system revises it (the others\n depend on that task); either objective says so: each legal entity of the system is then assigned\n to an organization unit by the operator, and a member reads only the entities of the units they\n hold a role in, so the resource's reads are gated above the default member role. A COPIED resource\n of a partitioned instance also declares `partitionUnitLocalField` and `partitionKeyLocalField` on\n its pipeline (two optional string fields of its schema, which its schema task adds); when the plan\n also confines that resource `ORGANIZATION_UNIT`, `partitionUnitLocalField` is the confinement's\n `fieldName`, since the engine narrows the copy on that field and refuses a second one. A\n read-through resource declares nothing, as the engine confines it on its own field. The split was\n read off the vendor's EFFECTIVE facet: its base facet plus any facet augmentation a declared instance\n opts into (when several instances use one vendor, the instance named like the vendor, else the\n first). `UNCONFIRMED` means that facet could not be read when the plan was written, or the engine\n refused to resolve it (an augmentation `wildo config sync` has not recorded, a vendor partitioned\n twice): the binding does not land on an instance whose effective facet declares no split (the\n backend refuses `partition: true` there at startup), and the task reports it.\n No organization model, or an empty one, emits nothing here.\n- **The billing catalogue** — target `BILLING_CATALOG`, and the **business model** decided it:\n its pricing plans are the products the application sells. Emit ONE task (the catalogue is one\n file, so two tasks would write over each other) producing one `APPLICATION_BILLING_PRODUCT` per\n plan, with a short `productKey` per plan (`free`, `team`, not the plan's `pricing-plan-…` ref),\n skill `configure-billing` (the dispatch adds it whatever you write), and `servesRefs` naming\n every plan it realises. Its objective carries what each plan decided, so the agent writes typed\n money rather than prose: the price and its billing period, whether it is per member or flat, and\n the three pricing-surface facts the plan implies — `isRecommended` for the plan the product is\n designed for (never because it sorts second), `priceDisclosure: STARTING_AT` when part of the\n price is not decided and `ON_REQUEST` when it is quoted, `availability: UPCOMING` when the plan\n is announced but the requirements do not yet build it. Order it after the module and resource\n tasks whose features the plans grant. The website's PRICING section task depends on it: the\n section reads this catalogue, so it must exist first. No business model, or one with no plans,\n emits nothing. A plan priced `per_usage` is a METERED product, priced per unit of its `usageUnit`\n (the objective names the unit); its usage is recorded by a `METERED_USAGE_RECORDING` task on the\n operation that consumes it, ordered after this one.\n- **Data seeds** — target `MODULE_BACKEND` on the seed's module, product `APPLICATION_DATA_SEED`,\n skill `seeding-authoring` (the dispatch adds it whatever you write). A built application must not\n open EMPTY: an empty list is not something a creator can judge, try or show. Emit two kinds, and\n never mix them in one seed:\n - **`REFERENCE`** — rows the application needs wherever it runs, in production too: a closed list\n the domain plan stores as rows rather than as an enum, a default record each organization\n starts with. Emit one only where the domain plan implies such rows; most applications need few\n or none.\n - **`DEMONSTRATION`** — sample rows that make a freshly created application look lived-in: a few\n plausible records (three to eight) for each main resource a person meets first, in the market's\n own language and examples, consistent with each other (an enquiry names a customer that exists).\n One seed per resource. The seed declares `allowedApplicationEnvironments` without production,\n and the task lands only once it does, so these rows can never sit beside real ones. A resource\n that belongs to an organization is seeded per organization, on organization creation.\n A seed whose rows point at rows ANOTHER seed writes (a contact's customer, a quote's customer, an\n invoice's job) links them with `referenceDataSeedRow` and lists that seed in `dependsOn` — the\n engine resolves each reference to the row's `_id`, and nothing else can, because the id is\n generated. Say so in the task's objective: name the seed it references and the field each\n reference fills, so the worker does not have to discover the mechanism. Order a seed after its\n resource's schema and config tasks, after the relationship tasks for the links its rows carry,\n and after the task of every seed whose rows it references. Name each `seedKey`\n `<moduleRef>:<purpose>` (`crm:demo-customers`): the namespace keeps one module's seeds apart from\n another's. Never a seed for a resource the engine owns (users, organizations, memberships).\n- **The website** — target `WEBSITE`, and you do NOT decide its content here. The\n **website plan** (`bottom_up.website-plan`) already decided it: which pages, what each\n is for, and the sections that carry each page's argument in reading order. Read it and\n emit, in this order:\n - one `WEBSITE_PAGE` task per page (`produces: { kind: WEBSITE_PAGE, pageRef }`), skill\n `website-page-authoring`, its objective the page's own purpose. A page task authors the\n PAGE — route (derived from the page's KIND: `/product/<slug>`, `/solutions/<slug>`, …),\n bridge, component, manifest, registration, its own entry in the site menu, and an EMPTY\n sections list — and never its sections: say so in the objective. On the first run that\n built a website the page tasks wrote every section themselves, so no section skill was\n ever applied. A `PRODUCT_OVERVIEW` page task comes after every `PRODUCT` page task: its\n menu link is the Product panel's overview, and the panel exists once its first product\n page does (the dispatch host derives that edge from the plan, so you need not write it);\n - one `WEBSITE_SECTION` task per section (`produces: { kind: WEBSITE_SECTION, pageRef,\n sectionRef }`), **with its page's task as a prerequisite** — a section is declared in\n its page's sections file, so the page must exist first — and its skill taken from the\n section's KIND through `WEBSITE_SECTION_SKILL_REF`, which gives every kind one: the kind's\n name in kebab case after `website-section-` (`HERO` → `website-section-hero`,\n `FEATURE_BENEFIT_SUMMARY` → `website-section-feature-benefit-summary`, `LATEST_POSTS` →\n `website-section-latest-posts`, and so on for all eighteen kinds, `STATS`, `INTEGRATIONS`\n and `ROADMAP` included). A\n `SOLUTION_PATHS` section comes after every `SOLUTION` page task: its cards link to those\n pages, and nothing at build checks a section's links, so built first it would publish links\n to pages that do not exist yet (the dispatch host derives that edge too). Name the skill; the\n dispatch derives the same skill from the plan and puts it first whatever you wrote, so a\n wrong one is harmless but a right one keeps the plan readable.\n A plan whose disposition is `NOT_APPLICABLE`, or no plan at all, emits NOTHING here — the\n application has no `website/` workspace for a task to write in.\n- **Technical documentation** — target `TECHNICAL_DOCUMENTATION`, and you do not choose\n the chapters here either. The **documentation plan** (`bottom_up.documentation-plan`)\n decided them: read it and emit one task per chapter, product\n `DOCUMENTATION_CHAPTER` with its `chapterRef`, skill\n `application-consumer-documentation-authoring`, and an objective carrying the chapter's\n own purpose, audiences and the specifications it documents. A `NOT_APPLICABLE` plan, or\n none, emits nothing. The portal's generated tree is never written by a task — the\n target's own policy prohibits it, because the companion publishes there.\n\n## Posture constraints are work, not commentary\n\nThe compliance posture (the `compliance-posture` family) and the vision's constraints are INPUT on\nequal footing with the requirements: an obligation the posture states — a retention/erasure rule over customer data, a\nterminal-access (cookie/telemetry) posture, an operational-vs-marketing email distinction — needs a\ntask that lands it, serving the nfr it substantiates. Do not compress a posture into an adjective\ninside another task's objective (\"GDPR-appropriate handling\"): an adjective is not schedulable,\nreviewable or landable. If the posture states an obligation and no task expresses it, the\ndecomposition is incomplete.\n\n(Label and email generation are companion-owned generation steps —\nsee Step 4 — not coding-agent extension tasks.)\n\nRules:\n\n- **Every task names a real topic + a real skill.** A task with an invented topic or a\n skill folder that does not exist is a GAP (the dispatch playbook would have nothing\n to run). Route through the declared `skill_catalog` context section of your brief; do not invent.\n- **Respect the topic dependency edges.** An operation task after the resources it acts\n on; an app-level view / navigation task after the interaction semantics **and** every\n resource it composes; an extension after the UX it extends; an integration after the\n resources it connects. (A resource's own field-display ui-behavior was already emitted\n in Step 1 and needs only that resource's schema/config — see the ordering axes.)\n- **Draw tasks from the definition set, not a blank page.** A UX or operation task\n earns its existence from a requirement or feature-draft; a task justified by nothing\n in the definition set is a CONCERN (speculative work). A task serving a requirement verb\n (the table above) always earns it, even when no feature-draft mentions the operation.\n\n## Step 4 — Interleave the companion-owned generation steps\n\nSome build steps are **companion-owned deterministic generation**, not coding-agent\nwork. Emit these as tasks too — `target.kind: COMPANION_GENERATION_STEP` with\n`generationStepRef` set to the EXACT step slug below (the companion executes only this\nclosed vocabulary; any other slug refuses at dispatch) — and **order them after the\nsurfaces whose output they consume**:\n\n- **`i18n-labels`** — label generation in the application's PRIMARY locale. Order it\n after the resources / ui-behavior / views / milestones / guidance whose labels it\n generates — a milestone's title and a flow's words are generated from their declarations.\n Translation into the other enabled locales is a separate step, `i18n-translations`, which\n the dispatch host derives after this one for an application that enables more than one\n locale. Do not author it, and never make another task wait for translation: a step that\n needs labels (documentation publication, for one) needs only the primary locale.\n- **`email-templates`** — email template + label generation and label translation.\n Order it after the notification/email surfaces it renders.\n- **`logo`** — the brand mark: an expert panel derives creative directions, marks are\n generated, a vision judge scores them, and the winner is promoted into the\n specifications brand SSOT. Author it only when the brand brief appears in your\n inputs (it is declared as a map: what the brand holds, not its content), and order\n it after that brief exists; it depends on no\n code surface, so it may run early and in parallel with resource work. Author it at\n most once — an application has one accepted mark, and the step skips itself without\n calling a model when one is already accepted. Its `servesRefs` name the brand\n elements it realises — the brief's logo direction and the brand name, by the refs the\n brand brief shows (`brand.logo-direction`, `brand.name`). Name only refs the brief holds.\n\n- **`database-migrations`** — `wildo db generate`: turns the drift the schema stages created into a\n committed migration, and advances the accepted plan with it. **PostgreSQL-backed applications\n ONLY**: an application ANY of whose environments declares\n `applicationDatabase: { engine: DatabaseEngine.POSTGRESQL }` (or declares no store, which selects\n PostgreSQL). One plan serves every environment, so a MongoDB `local` beside a PostgreSQL\n `production` still owes it. When EVERY environment is on MongoDB a collection appears on first\n write and this step must not be authored at all. It REFUSES there, and also when no readable\n environment declares PostgreSQL but one cannot be read, because generating would author a table\n set nothing uses. A PostgreSQL application with no accepted plan yet is the opposite case:\n the step renders the whole model as the INITIAL migration and writes the baseline beside it, and\n the dispatch host derives that step itself when the plan omits it.\n\n Order it **after the schema stages whose drift it migrates** — practically, after the last\n resource's schema stage in the band. Author it ONCE: one step migrates all accumulated drift, and\n re-running it over a clean plan reports \"nothing to generate\" rather than writing an empty\n migration. It needs a BUILT `backend-api`, because the plan is computed by importing the compiled\n registry; it refuses on an unbuilt tree instead of authoring a migration for a model nobody has.\n\n- **`design-system-brand` and `design-tokens`** — derived by the dispatch host around every\n DESIGN_SYSTEM config task, so do **not** author either. The brand step runs before that task and\n writes the brand's palette seeds and theme personality to `frontend/src/config/brand-design.ts`, and,\n when the application has a website, the same palette and point to `website/src/brand-theme.ts`; the\n tokens step runs after it and regenerates the stylesheet's design-token block from the config. The\n DESIGN_SYSTEM task itself derives its palette from those seeds and composes its theme from that\n personality rather than choosing colours or copying a theme (the `config-design-system` skill shows\n how), so name that skill on it.\n\nThere is no seeds GENERATION step: do **not** author one — an unknown `generationStepRef`\nrefuses at dispatch instead of parking the build. Seeding is a CODING task: an\n`APPLICATION_DATA_SEED` product under the module's backend (Step 3, \"Data seeds\").\n\nYou **place** these steps in the order; you do **not** design how they run\nconcurrently with coding-agent tasks (that interleaving-at-scale concern is the scale\nplaybook's job — see the boundary below).\n\n## Refine, don't re-author\n\n- **Your answer is the WHOLE plan, never a delta.** What you return replaces the\n plan on record, so a task you leave out is deleted. On a re-run, copy every task\n that still holds into your answer unchanged, under its existing ref, and change\n only what the domain plan or a prerequisite genuinely changed: add a task, re-order\n one, or add or correct a relationship-wiring task. Every resource and relationship\n the domain plan declares must still have its tasks when you are done — a plan that\n leaves one out is refused.\n- **Keep what still holds.** Do not re-decompose modules or resources whose tasks are\n already correct; carry them over as they are.\n- **Reuse existing task refs.** A task that already exists keeps its ref — never mint a\n second ref for the same unit of work.\n- **A task already built is never dropped, renamed or reshaped.** Your brief lists the build\n tasks that are built and committed, each with its target and what it produces. Each stays in\n your plan under the same ref (author its slug as the ref without its `build-task-` prefix),\n with that target and those products exactly, even when the domain plan moved around it:\n refine what its objective says if it must, never remove it, never give it a new name, and\n never change what it produces on your own initiative. Built work dropped from the plan is\n orphaned from it, a renamed task reads downstream as a change, and a task whose products\n changed reads unbuilt again although nothing in the code moved. Work you would add goes in a\n NEW task. When an input of the plan REQUIRES a built task's target or products to change (a\n service method that now decides its retention class, a step its agent must name), declare it\n in `reshapedBuiltTasks` with the task's slug and the reason: the task is then rebuilt. The\n reason is not the proof: a declared reshape is kept only when the task AS BUILT fails a check\n of this plan against its inputs (the domain-plan coverage, the firm's method, a reference that\n no longer resolves) and the new shape repairs it. A plan that drops or renames a built task,\n changes one it does not declare, or declares a reshape nothing requires, is refused.\n- **Never orphan an ordering reference.** A task's prerequisite reference must name a\n task that is actually in the plan. If you remove or rename a task, follow it into\n every prerequisite reference.\n\n## Validation and product review\n\n`BuildPlanTaskGraphGeneration` constrains the generated shape. The runtime normalizes\nit into `BuildPlanTaskGraph` and runs `validateBuildPlanTaskGraph`. Cycles and missing\nrequired prerequisite edges between stages present in the graph are hard failures;\na stage absent from the graph and a coding task without products produce warnings.\nSchema checks also reject unknown prerequisite refs and duplicate product ownership.\n\nThe `build-plan-coherent` checklist below complements those structural checks with\nproduct review: resource coverage, useful objectives, meaningful products and suitable\nmethods. Since 2026-09-22 it is also this playbook's compiled evaluation treatment: the\nADVISORY judge reads its invariants against the landed build plan and the domain plan\nafter every run, and its per-criterion verdicts reach the creator's review. A verdict is\na note, never a refusal. The method declares `approve_result`; neither shape validation,\nthe judge nor approval proves the application behavior that the plan intends to deliver.\n\n## Decomposition boundary\n\nKeep this playbook at decomposition depth. Explicitly **out of scope here**:\n\n- **Dispatch execution.** You do NOT dispatch any task, spawn any coding agent, build a\n context pack, or run the coding-agent contract. That is the **dispatch-orchestration**\n playbook, downstream of this decomposition.\n- **Workspace-mutation safety.** Dispatch locking and concurrency, clean-worktree preconditions,\n change-set capture (git baseline / diff), and the failure-policy revert/flag mechanics\n are the dispatch playbook's concern — NOT modelled here. A task that describes *how* it\n is captured or locked is out of this playbook's depth.\n- **Verify / quality-gate mechanics.** Running typecheck, validators, tests, or reviewer\n agents *around* a dispatched task is the dispatch playbook's verify step — you do not model it.\n The app-wide assemble / verify phase (Topic 7) you also do not emit, and the reason is\n STRUCTURAL rather than delegation: a build-plan task's `target.kind` is one of `MODULE`,\n `RESOURCE_STAGE`, `RELATIONSHIP`, `SHELL_PLACEMENT` or `COMPANION_GENERATION_STEP`, and none of them can express\n \"verify the assembled application\". There is no vocabulary for it, so a task claiming to do it\n would be a task no executor could run.\n The `bottom_up.assemble-verify` method owns application-wide verification.\n Keep its work separate from the build targets decomposed here.\n- **Multi-agent scale + interleaving.** Parallelising tasks across multiple coding\n agents, and interleaving the companion generation steps concurrently with coding-agent\n runs, is the **scale** playbook. You produce a linear-enough ordered graph with explicit\n `prerequisiteTaskRefs`; you do NOT solve the concurrency schedule.\n- **Schema / field authoring + code generation.** You name resources and stages; you do\n NOT author fields, enums, decorators, Zod schemas, or any code, and you do NOT resolve\n a cardinality intent into a concrete FK. That is the coding agent at dispatch time.\n- **Framework contract design.** Use the existing `BuildPlanTaskGraph` schema and\n validator. This method authors an application plan; it does not reshape the\n framework's `_core` contracts or implement a new scheduling engine.\n\nKeep the output at decomposition depth. The dispatch and verification methods consume\nit and perform their own work; a task graph is not evidence that those runs succeeded.\n\n## What you emit\n\nOne artifact for this journey:\n\n- The **build-plan** at `specifications/src/build-plan/index.ts` — an ordered task\n graph: the per-resource (schema / config / ui-behavior / spec) tasks, the\n relationship-wiring tasks, the interaction / UX / extension / integration tasks (views,\n frontend configuration, components, PDF templates, workers, minions, provider bindings,\n website pages and sections, documentation chapters — each over its own target and\n product kind), the organization-model tasks (types, relationship kinds, row confinements),\n any module-ensure tasks foundation did not cover, and the interleaved\n companion-generation steps — each carrying its target, **the artifacts it produces**,\n its one functional topic, its skill(s), and explicit `prerequisiteTaskRefs`.\n\nThe creator reviews the result (approval posture `approve_result`) before it is accepted\nas the journey's build plan, which the dispatch-orchestration and scale playbooks then\nturn into dispatched, verified coding-agent runs.\n\n## References\n\nThese are skill FOLDERS installed in the application, named so each piece of work has an\nauthoring contract a later coding agent can open. This step has no tools and does not open them;\nwhat reaches you is this method, your declared inputs, and the brief's own sections.\n\n- `resource-add-module` — the module-scaffolding vocabulary, for\n the conditional ensure-module task (only where the foundation step did not establish the\n module slice).\n- `resource-add-resource` — the resource vocabulary (the\n resource-skeleton task in the schema stage).\n- `resource-schema-authoring` — the schema stage (first\n per-resource task).\n- `resource-config-wiring` — the config stage (second\n per-resource task).\n- `resource-ui-behavior` — the ui-behavior stage (third\n per-resource task).\n- `spec-resource-update` — the spec stage (fourth per-resource\n task).\n- `module-relationships` — the relationship-wiring task's HOW\n (cardinality-to-FK-holder resolution, at dispatch time — named here, not performed).\n- `module-registration` — the cross-runtime module-registration\n task's HOW.\n- `config-saas-backend` — the organization-model task's organization types (`organizationTypes`).\n- `organization-relationships` — the organization-model task's relationship kinds, and the roles a\n relationship confers.\n- `authorization-unit-narrowing` — the confinement task's unit narrowing and own rows.\n- `resource-external-data` — a CONFIG task whose resource is bound to a system of record.\n- the skills CATALOG, which your brief carries as its own section — the skills router: consult it to bind each interaction /\n UX / extension / integration task to its real skill folder from the full catalog. Do\n not invent skill names; route through the index.\n\n## Reviewer checklist — `build-plan-coherent`\n\nThese thirteen invariants are the criteria of this playbook's compiled evaluation treatment (`application-creation:evaluation-treatment/build-plan-coherent`, one criterion per invariant, invariants 2 and 2b sharing one), which the advisory judge runs after every landing. They are kept here as creator-facing review guidance too, so a reviewer and the judge read the same words:\n\nJudge whether the drafted build plan is a coherent, complete, correctly-ordered decomposition of the approved domain plan into coding-agent tasks — WITHOUT straying into how those tasks execute. Assess thirteen invariants and mark each PASS / CONCERN / GAP with a one-line evidence note. (1) MODULE + RESOURCE COVERAGE — every resource in every module's inventory (mainResources + supportingResources) has build tasks; a resource with no task is a GAP (the build would not produce it). Task `moduleRef` values must be module ids the workspace section lists (an invented module id is a GAP — the dispatcher cannot route it), and a task whose objective CREATES a resource the workspace section shows already exists — instead of enriching it — is a CONCERN (it dispatches a no-op). Module slices are scaffolded by the foundation step (a sibling playbook), so a module needs a dedicated ensure-module task ONLY where foundation did not establish it — a module whose resources have tasks but which carries no redundant scaffold task is NOT a GAP (do not flag the absence of a module-scaffold task foundation already owns); a module added to the plan after foundation with neither a foundation slice nor an ensure-module task IS a GAP. Every pricing plan the business model declares must be an `APPLICATION_BILLING_PRODUCT` of a `BILLING_CATALOG` task whose `servesRefs` name it; a declared plan with no billing product is a GAP. A plan with main resources and no `DEMONSTRATION` `APPLICATION_DATA_SEED` task is a CONCERN: the application would open empty. A seed task whose rows reference another seed's rows (a contact's customer) that is not ordered after that seed's task is a GAP — the reference resolves only against rows already written. (2) TASK WELL-FORMEDNESS — every task names exactly ONE functional topic that is a real MetaWorkflow_FunctionalTopic value (configure_application_foundation / model_domain_graph / define_interaction_semantics / shape_user_experience / extend_application / connect_runtime_and_external_capabilities / assemble_verify_and_iterate) and at least one skill that is a real folder in the app-knowledge skill catalog; a task with an invented topic or a dangling skill is a GAP. (2b) PRODUCT DECLARATION — every task except a COMPANION_GENERATION_STEP declares at least one product in `produces`, and a generation step declares none; a coding task with an empty `produces` is a GAP, because it has no declared output to probe. The host can advance after a COMPLETED durable run, but carries the task in `unverifiableLandedTaskRefs`; that means ran, not proven. Repair the product declaration rather than treating this fallback as evidence of correct output. A product must name something COMPOSITION DOES NOT ALREADY WRITE — the fields a schema gains rather than its file, the verbs a config gains rather than its file, both endpoints of a relationship rather than one — so a product naming only a scaffolded artifact is a GAP wearing a declaration. Two tasks claiming the SAME artifact is a GAP as well (landing becomes undecidable); two tasks enriching one resource with DIFFERENT fields is correct and not a finding. A cross-resource FOREIGN KEY declared on a schema task's `produces` is a GAP — the relationship task is its single home (Step 2), and declaring it twice attributes one artifact to two tasks; a schema task's products are the resource's OWN domain fields. (3) PER-RESOURCE STAGE ORDER — for each resource, its tasks respect the inner order schema -> config -> ui-behavior -> spec; a config task ordered before that resource's schema task, or a spec task before its ui-behavior task, is a GAP (the build stage would run against a missing prerequisite). A supportingResource (e.g. a pure junction / lookup entity) may legitimately OMIT stages it does not need — a junction with schema + config and no ui-behavior is fine; only an out-of-ORDER stage (or a mainResource missing schema/config) is a GAP, not an intentionally-omitted stage on a supporting resource. (4) TOPIC DEPENDENCY ORDER — tasks respect the topic dependency edges (model_domain_graph before define_interaction_semantics; app-level shape_user_experience [views / navigation composing multiple resources or operations] after the interaction semantics and resources it composes; extend_application after the UX it extends; connect_runtime_and_external_capabilities after the resources it connects). Note the deliberate exception: a resource's OWN ui-behavior (its field displays / forms, a shape_user_experience task) depends only on that resource's own schema + config and MAY precede cross-resource operations — that is NOT a violation. What IS a GAP: an app-level view composing resources/operations placed before they exist, an integration task before the resources it connects, or any user-experience task before that resource's schema task. The per-resource spec task is a documentation capstone (topic model_domain_graph) and must be ordered after the schema / config / ui-behavior stages it documents; a spec task before its ui-behavior stage is a GAP. (5) RELATIONSHIP COVERAGE — every relationship-draft whose two endpoints are resources the domain plan declares is named in the `relationshipRefs` of a wiring task (bound to the module-relationships skill, one task per module, with one product per relationship) ordered AFTER both endpoint resources' schema tasks; a relationship with no wiring task, or one ordered before its endpoints exist, is a GAP; two wiring tasks of one module that neither waits on the other are a CONCERN (they edit one file). A relationship to a resource no module declares is NOT this invariant: no task can wire it, so it is invariant (8)'s. (6) COMPANION-GENERATION INTERLEAVE — the executable companion-owned generation steps (`i18n-labels`, `email-templates`, `logo`, plus `database-migrations` for a PostgreSQL-backed application) are present and placed AFTER the resources / modules whose output they consume; a labels-generation task ordered before the resources it labels, or a missing executable generation step for authored surfaces, is a CONCERN. `logo` is the exception to the ordering half — it consumes the brand brief rather than any code surface, so it is unordered with respect to resource work and only its ABSENCE (on an application with a brand brief) is a CONCERN. The migration step follows the schema stages whose drift it migrates and is not authored when every environment of the application is on MongoDB (one environment on PostgreSQL makes it owed). Do NOT flag the absence of an `i18n-translations` step — the dispatch host derives it after `i18n-labels`. Do NOT flag the absence of a seeds GENERATION step — none exists; seeding is an `APPLICATION_DATA_SEED` coding task, judged under invariant (1). (7) BOUNDARY DISCIPLINE — the plan stays at DECOMPOSITION depth: it names tasks, their topic, their skill(s), their target, and their ordering intent; it does NOT specify how a task is DISPATCHED (dispatch locking and concurrency, change-set capture, git baseline, verify/quality-gate mechanics = the dispatch-orchestration playbook) and does NOT solve multi-agent SCALE or interleaving concurrency (= the scale playbook). Any task that describes how a task EXECUTES rather than WHAT it builds, or that authors a schema / resolves a cardinality into a concrete FK / generates code, is a CONCERN (scope creep out of the decomposition phase). (8) CONCEPTION BUILDABLE — this one faults the CONCEPTION, never the plan: a GAP when the domain plan declares a module, resource or relationship no build target can express however it is decomposed, or when the computed coherence report shows a dangling reference or unrealised decision in the conception (a domain-plan resource another family names that does not exist, a composition surface no plan realises, a placement plan that still puts a concept's list on the sidebar or leaves the concept's view off it) that the build would have to invent, or override, to proceed. An element the plan merely FORGOT is invariant (1), not this one — only a conception GAP sends the application back to its conception lane, which is the most expensive way to fix an omission. Name the conception element. (9) EXPERIENCE COVERAGE — every view, configuration, milestone and piece of guidance the experience plan declares has its task (a view task carrying the plan's viewRef verbatim, an onboarding document's objective naming its hostViewRef), and a decided `home` is set by the `GLOBAL_VIEWS` task's objective (it names `homeDefinitionFactory` and the home), and a `VIEW` home's blocks are carried by the objective of the task that builds the home view, each listing block drawn as its rows (`collectionToolbar: CollectionToolbarPresence.HIDDEN`); an entry with no task, or a decided home no objective sets, is a GAP, and an objective that drops what the plan decided for its entry (reused components, the moment, the gate, a home block) is a CONCERN. With NO experience plan the plan rightly carries none of these tasks: mark PASS and begin the note with 'NO EXPERIENCE PLAN:' naming what the application will lack — never a CONCERN or GAP, because the decomposer cannot produce an upstream family by revising. (10) ROLE COVERAGE — every requirement that names groups of users with different access is served by an `APPLICATION_ROLES` task producing one `APPLICATION_ROLE` per group no core role covers, ordered after the config tasks of the resources it narrows; a group with no role, or a role requirement answered by a task or resource that stores roles or permissions as data, is a GAP; a roles task ordered before a config task it narrows, or whose objective does not say which operations each role may call, is a CONCERN. (11) INTERACTION COVERAGE — every transition the domain plan's lifecycles declare has its `RESOURCE_OPERATION` product named by its `transitionRef` (a transition that creates a resource says so in that task's objective; a separate task for the write, or an operation named after a transition with something added, is a GAP), and every functional acceptance criterion whose verb goes beyond the default resource verbs (a state change, one record creating or filling another, a record that must stop changing, a produced document, a sent message) is served by a task of the matching kind (`RESOURCE_OPERATION`, a `MODULE_BACKEND` implementation, `PDF_TEMPLATE`, the email generation step) whose `servesRefs` name the requirement; a plan whose requirements describe a workflow and which carries no interaction task, or a state change served only by a config task that leaves the status freely editable, is a GAP; a derived value (a next action, an overdue flag) planned as a stored field is a CONCERN. On the person's side of each lifecycle, a resource with a lifecycle and no `RESOURCE_UI_BEHAVIOR` task is a GAP (its page is the engine's generated one, which knows no route), and a transition objective that does not offer the step only from its `from` states on every variant, a refusal the operation can raise left unworded for the person, or a lifecycle resource's ui-behavior objective that does not state its record page (status as the leading pill shown once — on the header or as `<RecordState>`, never both — next steps as worded actions ordered by `displayPriority`, sections in business order, record keeping last in `<RecordKeepingFacts>`) is a CONCERN. (12) ORGANIZATION MODEL COVERAGE — every organization type the domain plan's `organizationModel` declares is an `ORGANIZATION_TYPE` product of an `ORGANIZATION_MODEL` task carrying its offered roles, user types and `requiresMfa`, the owning type with `ownsApplication: true` revising the configuration's existing owner type whatever its key and, where the configuration still holds other names, renaming it and its people to the plan's names with `renamedFrom` (a second owner type, or a replaced one, is a GAP), and every relationship kind the configuration does not already carry is an `ORGANIZATION_RELATIONSHIP_KIND` product; every unit confinement is an `ORGANIZATION_UNIT_CONFINEMENT` product with its mode and field; every resource whose records live in a system of record carries a `SYSTEM_OF_RECORD_BINDING` product on its config task, `partitioned` exactly as the entry's split by legal entity decides (true for `BY_LEGAL_ENTITY` or `UNCONFIRMED`). An entry with no product, or a binding whose `partitioned` is absent or says otherwise, is a GAP; a relationship between organizations built as a module or a resource is a GAP (the engine owns those rows); a confinement task ordered before the config task of a resource it confines is a CONCERN. With no organization model, mark PASS. (The deterministic gates and the creator's approval remain the floors; the judge's verdicts are advisory notes beside them.)\n",
|
|
116
116
|
"skillRefs": [
|
|
117
117
|
"resource-add-module",
|
|
118
118
|
"resource-add-resource",
|