@wildo-ai/saas-specifications 1.1.14 → 1.1.16
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/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts +2 -2
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js +13 -8
- package/dist/esm/_core/build-plan/build-plan-task-graph.schemas.js.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js +13 -7
- package/dist/esm/_core/build-plan/build-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts +32 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.d.ts.map +1 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js +47 -0
- package/dist/esm/_core/integration-plan/integration-execution-surface-refs.schemas.js.map +1 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts +7 -0
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js +4 -1
- package/dist/esm/_core/integration-plan/integration-plan-generation.schemas.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts +114 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan-validation.js +176 -0
- package/dist/esm/_core/integration-plan/integration-plan-validation.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js +17 -1
- package/dist/esm/_core/integration-plan/integration-plan.family-aspects.js.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts +43 -5
- package/dist/esm/_core/integration-plan/integration-plan.schemas.d.ts.map +1 -1
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js +75 -7
- package/dist/esm/_core/integration-plan/integration-plan.schemas.js.map +1 -1
- package/dist/esm/_core/provider-specification.schemas.d.ts +16 -1
- package/dist/esm/_core/provider-specification.schemas.d.ts.map +1 -1
- package/dist/esm/_core/provider-specification.schemas.js +21 -0
- package/dist/esm/_core/provider-specification.schemas.js.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts +5 -4
- package/dist/esm/application-creation/playbooks.application-creation.schemas.d.ts.map +1 -1
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js +5 -4
- package/dist/esm/application-creation/playbooks.application-creation.schemas.js.map +1 -1
- package/dist/esm/application-creation.exports.d.ts +1 -0
- package/dist/esm/application-creation.exports.d.ts.map +1 -1
- package/dist/esm/application-creation.exports.js +1 -0
- package/dist/esm/application-creation.exports.js.map +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.d.ts +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.js +1 -1
- package/dist/esm/assurance/assurance-authority-basis.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js +18 -8
- package/dist/esm/assurance/assurance-evidence-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js +9 -2
- package/dist/esm/assurance/assurance-objective-catalog.definitions.js.map +1 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.d.ts.map +1 -1
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js +8 -4
- package/dist/esm/assurance/assurance-verification-requirement-bodies.definitions.js.map +1 -1
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts +2 -2
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js +29 -6
- package/dist/esm/engine/compliance/resources/signature-requests.resource.specification.js.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.d.ts.map +1 -1
- package/dist/esm/engine/engine-resource-specifications.registry.js +4 -0
- package/dist/esm/engine/engine-resource-specifications.registry.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.js +4 -1
- package/dist/esm/engine/flows-actors/resources/actor-system-executions.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.js +3 -0
- package/dist/esm/engine/flows-actors/resources/actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js +3 -3
- package/dist/esm/engine/flows-actors/resources/flow-actor-tasks.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js +1 -1
- package/dist/esm/engine/flows-actors/resources/organization-chat-settings.resource.specification.js.map +1 -1
- package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.js +98 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-task-updates.resource.specification.js.map +1 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.d.ts +3 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.d.ts.map +1 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.js +132 -0
- package/dist/esm/engine/flows-actors/resources/remote-agent-tasks.resource.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.d.ts +5 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.d.ts.map +1 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.js +79 -0
- package/dist/esm/engine/frontend-components/app/app-layout-agent-activity-settings.frontend-component.specification.js.map +1 -0
- package/dist/esm/engine/frontend-components/index.d.ts +1 -0
- package/dist/esm/engine/frontend-components/index.d.ts.map +1 -1
- package/dist/esm/engine/frontend-components/index.js +3 -0
- package/dist/esm/engine/frontend-components/index.js.map +1 -1
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js +2 -2
- package/dist/esm/engine/infrastructure/resources/external-data-pipeline-states.resource.specification.js.map +1 -1
- package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.d.ts +8 -0
- package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.d.ts.map +1 -0
- package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.js +65 -0
- package/dist/esm/engine/notifications/system-emails/delegated-work.system-emails.specification.js.map +1 -0
- package/dist/esm/engine/notifications/system-emails/index.d.ts +1 -0
- package/dist/esm/engine/notifications/system-emails/index.d.ts.map +1 -1
- package/dist/esm/engine/notifications/system-emails/index.js +3 -1
- package/dist/esm/engine/notifications/system-emails/index.js.map +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js +1 -1
- package/dist/esm/engine/organizations/resources/organization-units.resource.specification.js.map +1 -1
- package/dist/esm/engine/providers/_engine-provider-shared.d.ts +5 -0
- package/dist/esm/engine/providers/_engine-provider-shared.d.ts.map +1 -1
- package/dist/esm/engine/providers/_engine-provider-shared.js +5 -0
- package/dist/esm/engine/providers/_engine-provider-shared.js.map +1 -1
- package/dist/esm/engine/providers/dropbox.provider.specification.d.ts +14 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.d.ts.map +1 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.js +76 -0
- package/dist/esm/engine/providers/dropbox.provider.specification.js.map +1 -0
- package/dist/esm/engine/providers/index.d.ts +3 -1
- package/dist/esm/engine/providers/index.d.ts.map +1 -1
- package/dist/esm/engine/providers/index.js +5 -2
- package/dist/esm/engine/providers/index.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js +2 -0
- package/dist/esm/engine/users/resources/user-preferences-api-reference.examples.js.map +1 -1
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts +1 -0
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.d.ts.map +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js +1 -1
- package/dist/esm/engine/users/resources/user-self-preferences.resource.specification.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-plan.family-aspects.js","sourceRoot":"","sources":["../../../../src/_core/build-plan/build-plan.family-aspects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+CAA+C,EAAE,MAAM,sDAAsD,CAAC;AAEvH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,MAAM,CAAC,MAAM,yBAAyB,GAA6B;IACjE,SAAS,EAAE,+CAA+C,CAAC,qBAAqB;IAChF,OAAO,EAAE;QACP;YACE,GAAG,EAAE,iBAAiB;YACtB,YAAY,EAAE,OAAO;YACrB,IAAI,EAAE,gBAAgB,CAAC,UAAU;YACjC,UAAU,EAAE,mBAAmB;YAC/B,WAAW,E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;wBACZ,sBAAsB;wBACtB,mBAAmB;qBACpB;iBACF;aACF;YACD,gBAAgB,EAAE;gBAChB,SAAS,EAAE,iFAAiF;gBAC5F;;;;;;mBAMG;gBACH,QAAQ,EAAE,usCAAusC;gBACjtC;;;;;;;;;;;mBAWG;gBACH,0BAA0B,EAAE,gGAAgG;gBAC5H;;;;;mBAKG;gBACH,kBAAkB,EAAE,kHAAkH;gBACtI,kBAAkB,EAAE,kHAAkH;gBACtI,oBAAoB,EAAE,4EAA4E;aACnG;SACF;KACF;CACF,CAAC","sourcesContent":["import { ApplicationSpecificationFamilySemanticSchemaRef } from \"../application-specification-family-identity.schemas\";\nimport type { FamilyAspectsDeclaration } from '../family-aspects.schemas';\nimport { FamilyAspectKind } from '../family-aspects.schemas';\nimport { BuildPlanTaskSchema } from './build-plan-task-graph.schemas';\n\nexport const BUILD_PLAN_FAMILY_ASPECTS: FamilyAspectsDeclaration = {\n schemaRef: ApplicationSpecificationFamilySemanticSchemaRef.BUILD_PLAN_TASK_GRAPH,\n aspects: [\n {\n key: 'build-plan.task',\n snapshotPath: 'tasks',\n kind: FamilyAspectKind.COLLECTION,\n itemSchema: BuildPlanTaskSchema,\n businessKey: 'taskRef',\n headlineField: 'objective',\n edges: [\n // The graph's only ordering authority — a SELF-edge (issue #124's lesson lives in the schema JSDoc).\n { field: 'prerequisiteTaskRefs', targetAspects: ['build-plan.task'] },\n /*\n * The `servesRefs` targets (the edge below), and they grew one producer measurement at a\n * time: five by 2026-09-11 — the two vision targets added (#629) because the producer had\n * already been writing them for as long as the field existed — then a drafted feature\n * (#1433), a pricing plan (#1835) and the brand (#2221).\n *\n * `servesRefs` is TRACEABILITY — what this task is accountable to — and the generation\n * contract asks the model for a plain string list, so nothing ever constrained it. Wonder\n * CRM's plan named 8 keys outside the three declared targets: 2 `success-criterion-` and 6\n * `constraint-`, both real vision aspects with their own workbench resources. Neither is a\n * typo, and neither is unreasonable: a roadmap phase already carries\n * `deliversSuccessCriterionRefs` as a first-class edge, so \"work is accountable to a success\n * criterion\" is a relation this vocabulary already makes elsewhere.\n *\n * The alternative — refuse them and regenerate the plan — was rejected: it treats a\n * narrower-than-reality declaration as the truth and throws away traceability a human wrote\n * down. Widening costs nothing to a plan that names none of them (every split field is\n * `hideWhenEmpty`), and it makes the 8 keys resolve instead of sitting on the page as\n * \"unresolved\".\n */\n /*\n * THE LINK BACK TO THE DECISION (#1427). A build task's target names the domain-plan module\n * or relationship it builds, and those refs were carried in the data and invisible to the\n * registry: the drift pin only ever read TOP-LEVEL field names, and `target` is an object.\n * Measured on Wonder CRM, `relationshipRef` resolved 8 of 8. A list since #3209 (`relationshipRefs`: one task\n * per module relationships file), read through the same edge, which follows an array of keys.\n *\n * It is what makes RELATED useful on a build plan: from a task, the decision that motivated\n * it; from a decision, every task accountable to it.\n */\n { field: 'target', throughField: 'moduleRef', targetAspects: ['domain-plan.module'] },\n { field: 'target', throughField: 'relationshipRefs', targetAspects: ['domain-plan.relationship'] },\n /*\n * The most-travelled link in the build lane, and an edge since #1482: 24 of 24 tasks on\n * Wonder CRM name a resource here. It was a stated non-edge for one reason — the domain plan\n * listed resources as strings with no identity — and that reason is gone.\n */\n { field: 'target', throughField: 'resourceRef', targetAspects: ['domain-plan.resource'] },\n // The same link on the PRODUCT side: what the task will have built when it lands.\n { field: 'produces', throughField: 'resourceRef', targetAspects: ['domain-plan.resource'] },\n /*\n * The experience plan's entries, on the product side (#1660). A view, milestone or guidance\n * task builds an entry the experience plan decided, and names it by the plan's own ref. As\n * edges, a ref the plan does not carry is a DANGLING finding — refused at generation, so the\n * model corrects it — instead of a silent mismatch. The one that made this necessary: the\n * dispatch tells an execution view from a custom view by looking the product's `viewRef` up in\n * the plan, and a free-text ref would quietly load the custom-view skill. Silent when the\n * application has no experience plan (the report asks only when the target family is present);\n * measured on the journey-built application, all four view products already resolve.\n */\n { field: 'produces', throughField: 'viewRef', targetAspects: ['experience-plan.view'] },\n { field: 'produces', throughField: 'milestoneRef', targetAspects: ['experience-plan.milestone'] },\n { field: 'produces', throughField: 'guidanceRef', targetAspects: ['experience-plan.guidance'] },\n {\n field: 'servesRefs',\n targetAspects: [\n 'requirements.functional',\n 'requirements.non-functional',\n 'roadmap.phase',\n 'vision.success-criterion',\n 'vision.constraint',\n /*\n * The researched regimes (#3362), since the posture stopped landing them as vision constraints. A\n * task that lands a posture obligation (#309) names the regime it serves; without this target the\n * ref would be a dangling finding at generation and the obligation would lose its trace.\n */\n 'compliance-posture.constraint',\n /*\n * SIXTH, added 2026-09-22 (#1433 row 4) on the same evidence and the same argument as the\n * two above. Wonder CRM's plan names `feature-due-today-view` here, and that IS one of\n * its eight authored feature drafts — so the declaration was narrower than reality, and\n * refusing the key would treat the narrow declaration as the truth and throw away\n * traceability a human wrote down. \"This work serves that drafted feature\" is a relation\n * this vocabulary already makes everywhere else.\n */\n 'feature-drafts.draft',\n /*\n * SEVENTH, added 2026-09-27 (#1835): a billing-catalogue task writes the products a pricing\n * plan decided, and names the plan it realises here (`pricing-plan-team`) — so a task citing a\n * plan the business model does not carry is a dangling finding at generation, not a product\n * nobody can trace back to its decision.\n */\n 'business-model.plan',\n /*\n * The BRAND, added 2026-10-01 (#2221), on the same argument as the four above. The `logo`\n * generation step consumes the brand brief, and the method tells the producer so, so a\n * model naturally cites `brand.logo-direction` and `brand.name`. Refusing those keys made\n * a correct 91-task plan fail generation over one task (app-creation-test-004, run\n * `6abe4b92…`), and with a whole-artifact retry the plan came back as one task.\n * `brand.visual-tone` is the input the design-system config target derives its palette\n * and typography from. `brand.audience` and `brand.asset` are left out: no build task\n * is accountable to an audience description, and an asset is something a step PRODUCES,\n * not something it serves.\n */\n 'brand.name',\n 'brand.logo-direction',\n 'brand.visual-tone',\n ],\n },\n ],\n nonEdgeRefFields: {\n skillRefs: 'installed app-knowledge skill folders — the skills catalog, not a family aspect',\n /*\n * NARROWED by #1482 and again by #1660 rather than removed: `produces.resourceRef` is an edge\n * (the resource IS a decided element), and so are `viewRef`, `milestoneRef` and `guidanceRef`\n * (the experience plan decides those entries). Everything else a product names — a field, an\n * operation, a chart, a component, a document — belongs to the built application and has no\n * aspect to point at.\n */\n produces: 'the rest of a product — fields, operations, charts, components, documents, inbound handlers and billing-catalogue product keys of the BUILT application, not decided elements (its `resourceRef`, `viewRef`, `milestoneRef` and `guidanceRef` are edges; a billing product traces to its pricing plan through `servesRefs`). An agent\\'s `serviceMethodStepRefs` and `serviceMethodAskedDecisionRefs` and a gate\\'s `serviceMethodDecisionRef` name the firm\\'s method elements a product realizes (#2305), as `<service>/<element>`: those are nested inside a service rather than addressable aspects, so `findServiceMethodDerivationGaps` resolves them. A metered usage recording\\'s `serviceMethodServiceRef` names the service it bills per case by its bare `serviceRef`, and a PDF template\\'s `serviceMethodDeliverableRef` the deliverable it generates (#2305 S6): the service is an addressable aspect, but it is resolved by the same function rather than by an edge, so every method ref has one resolver and a ref naming nothing is reported once, as that function\\'s dangling `UNKNOWN_METHOD_ELEMENT` (#2305 review). A conferred role\\'s `relationshipRef` names a relationship kind of the application\\'s configuration, not a decided element',\n /*\n * The two halves of `target` that reach nothing addressable, stated rather than left silent\n * (#1427). `moduleRef` and `relationshipRefs` beside them ARE edges — see above.\n *\n * `resourceRef` is the one to explain, because it LOOKS like it should resolve and the\n * measurement says it does: every `resourceRef` a build plan carries appears in a domain-plan\n * module's `mainResources` / `supportingResources`. But those are plain string arrays inside\n * a module item, not an aspect — the registry declares `domain-plan.module` and\n * `domain-plan.relationship` and nothing between them — so there is no target to point at.\n * Giving the domain plan a RESOURCE aspect would make this an edge and is the right fix; it\n * is a schema decision about a landed family, not something an edge declaration can do.\n */\n 'target.generationStepRef': 'a COMPANION generation step id (labels, seeds, emails) — a runtime step, not a decided element',\n /*\n * The non-resource targets (#1490). A worker, a minion and a provider are surfaces of the BUILT\n * application — composed by a scenario, bound in the SaaS config — and no family declares\n * them as elements. The capability composition decides whether the application HAS them, by\n * scenario, not which ones; so there is nothing addressable for these refs to point at.\n */\n 'target.workerRef': 'a worker package directory under `workers/` — a composed surface of the built application, not a decided element',\n 'target.minionRef': 'a minion package directory under `minions/` — a composed surface of the built application, not a decided element',\n 'target.providerRef': \"an engine provider ref — the engine's own catalogue, not a decided element\",\n },\n },\n ],\n};\n"]}
|
|
1
|
+
{"version":3,"file":"build-plan.family-aspects.js","sourceRoot":"","sources":["../../../../src/_core/build-plan/build-plan.family-aspects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+CAA+C,EAAE,MAAM,sDAAsD,CAAC;AAEvH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,MAAM,CAAC,MAAM,yBAAyB,GAA6B;IACjE,SAAS,EAAE,+CAA+C,CAAC,qBAAqB;IAChF,OAAO,EAAE;QACP;YACE,GAAG,EAAE,iBAAiB;YACtB,YAAY,EAAE,OAAO;YACrB,IAAI,EAAE,gBAAgB,CAAC,UAAU;YACjC,UAAU,EAAE,mBAAmB;YAC/B,WAAW,EAAE,SAAS;YACtB,aAAa,EAAE,WAAW;YAC1B,KAAK,EAAE;gBACL,qGAAqG;gBACrG,EAAE,KAAK,EAAE,sBAAsB,EAAE,aAAa,EAAE,CAAC,iBAAiB,CAAC,EAAE;gBACrE;;;;;;;;;;;;;;;;;;;mBAmBG;gBACH;;;;;;;;;mBASG;gBACH,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,oBAAoB,CAAC,EAAE;gBACrF,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,CAAC,0BAA0B,CAAC,EAAE;gBAClG;;;;mBAIG;gBACH,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC,sBAAsB,CAAC,EAAE;gBACzF,kFAAkF;gBAClF,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,E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;;;;;;;mBAWG;gBACH,0BAA0B,EAAE,gGAAgG;gBAC5H;;;mBAGG;gBACH,oBAAoB,EAAE,4EAA4E;aACnG;SACF;KACF;CACF,CAAC","sourcesContent":["import { ApplicationSpecificationFamilySemanticSchemaRef } from \"../application-specification-family-identity.schemas\";\nimport type { FamilyAspectsDeclaration } from '../family-aspects.schemas';\nimport { FamilyAspectKind } from '../family-aspects.schemas';\nimport { BuildPlanTaskSchema } from './build-plan-task-graph.schemas';\n\nexport const BUILD_PLAN_FAMILY_ASPECTS: FamilyAspectsDeclaration = {\n schemaRef: ApplicationSpecificationFamilySemanticSchemaRef.BUILD_PLAN_TASK_GRAPH,\n aspects: [\n {\n key: 'build-plan.task',\n snapshotPath: 'tasks',\n kind: FamilyAspectKind.COLLECTION,\n itemSchema: BuildPlanTaskSchema,\n businessKey: 'taskRef',\n headlineField: 'objective',\n edges: [\n // The graph's only ordering authority — a SELF-edge (issue #124's lesson lives in the schema JSDoc).\n { field: 'prerequisiteTaskRefs', targetAspects: ['build-plan.task'] },\n /*\n * The `servesRefs` targets (the edge below), and they grew one producer measurement at a\n * time: five by 2026-09-11 — the two vision targets added (#629) because the producer had\n * already been writing them for as long as the field existed — then a drafted feature\n * (#1433), a pricing plan (#1835) and the brand (#2221).\n *\n * `servesRefs` is TRACEABILITY — what this task is accountable to — and the generation\n * contract asks the model for a plain string list, so nothing ever constrained it. Wonder\n * CRM's plan named 8 keys outside the three declared targets: 2 `success-criterion-` and 6\n * `constraint-`, both real vision aspects with their own workbench resources. Neither is a\n * typo, and neither is unreasonable: a roadmap phase already carries\n * `deliversSuccessCriterionRefs` as a first-class edge, so \"work is accountable to a success\n * criterion\" is a relation this vocabulary already makes elsewhere.\n *\n * The alternative — refuse them and regenerate the plan — was rejected: it treats a\n * narrower-than-reality declaration as the truth and throws away traceability a human wrote\n * down. Widening costs nothing to a plan that names none of them (every split field is\n * `hideWhenEmpty`), and it makes the 8 keys resolve instead of sitting on the page as\n * \"unresolved\".\n */\n /*\n * THE LINK BACK TO THE DECISION (#1427). A build task's target names the domain-plan module\n * or relationship it builds, and those refs were carried in the data and invisible to the\n * registry: the drift pin only ever read TOP-LEVEL field names, and `target` is an object.\n * Measured on Wonder CRM, `relationshipRef` resolved 8 of 8. A list since #3209 (`relationshipRefs`: one task\n * per module relationships file), read through the same edge, which follows an array of keys.\n *\n * It is what makes RELATED useful on a build plan: from a task, the decision that motivated\n * it; from a decision, every task accountable to it.\n */\n { field: 'target', throughField: 'moduleRef', targetAspects: ['domain-plan.module'] },\n { field: 'target', throughField: 'relationshipRefs', targetAspects: ['domain-plan.relationship'] },\n /*\n * The most-travelled link in the build lane, and an edge since #1482: 24 of 24 tasks on\n * Wonder CRM name a resource here. It was a stated non-edge for one reason — the domain plan\n * listed resources as strings with no identity — and that reason is gone.\n */\n { field: 'target', throughField: 'resourceRef', targetAspects: ['domain-plan.resource'] },\n // The same link on the PRODUCT side: what the task will have built when it lands.\n { field: 'produces', throughField: 'resourceRef', targetAspects: ['domain-plan.resource'] },\n /*\n * The worker and minion a task builds, named by the integration plan's own ref (#1495). The package directory is\n * DERIVED from that ref, by the rule the foundation step composes it with, so a ref the plan does not carry must\n * be refused at generation: on client creation run 44031607175 the build plan named `worker-spreadsheet-import`\n * correctly and the host looked for it under the wrong directory, and a dangling ref would fail the same silent way.\n */\n { field: 'target', throughField: 'workerRef', targetAspects: ['integration-plan.worker'] },\n { field: 'produces', throughField: 'workerRef', targetAspects: ['integration-plan.worker'] },\n { field: 'target', throughField: 'minionRef', targetAspects: ['integration-plan.minion'] },\n { field: 'produces', throughField: 'minionRef', targetAspects: ['integration-plan.minion'] },\n /*\n * The experience plan's entries, on the product side (#1660). A view, milestone or guidance\n * task builds an entry the experience plan decided, and names it by the plan's own ref. As\n * edges, a ref the plan does not carry is a DANGLING finding — refused at generation, so the\n * model corrects it — instead of a silent mismatch. The one that made this necessary: the\n * dispatch tells an execution view from a custom view by looking the product's `viewRef` up in\n * the plan, and a free-text ref would quietly load the custom-view skill. Silent when the\n * application has no experience plan (the report asks only when the target family is present);\n * measured on the journey-built application, all four view products already resolve.\n */\n { field: 'produces', throughField: 'viewRef', targetAspects: ['experience-plan.view'] },\n { field: 'produces', throughField: 'milestoneRef', targetAspects: ['experience-plan.milestone'] },\n { field: 'produces', throughField: 'guidanceRef', targetAspects: ['experience-plan.guidance'] },\n {\n field: 'servesRefs',\n targetAspects: [\n 'requirements.functional',\n 'requirements.non-functional',\n 'roadmap.phase',\n 'vision.success-criterion',\n 'vision.constraint',\n /*\n * The researched regimes (#3362), since the posture stopped landing them as vision constraints. A\n * task that lands a posture obligation (#309) names the regime it serves; without this target the\n * ref would be a dangling finding at generation and the obligation would lose its trace.\n */\n 'compliance-posture.constraint',\n /*\n * SIXTH, added 2026-09-22 (#1433 row 4) on the same evidence and the same argument as the\n * two above. Wonder CRM's plan names `feature-due-today-view` here, and that IS one of\n * its eight authored feature drafts — so the declaration was narrower than reality, and\n * refusing the key would treat the narrow declaration as the truth and throw away\n * traceability a human wrote down. \"This work serves that drafted feature\" is a relation\n * this vocabulary already makes everywhere else.\n */\n 'feature-drafts.draft',\n /*\n * SEVENTH, added 2026-09-27 (#1835): a billing-catalogue task writes the products a pricing\n * plan decided, and names the plan it realises here (`pricing-plan-team`) — so a task citing a\n * plan the business model does not carry is a dangling finding at generation, not a product\n * nobody can trace back to its decision.\n */\n 'business-model.plan',\n /*\n * The BRAND, added 2026-10-01 (#2221), on the same argument as the four above. The `logo`\n * generation step consumes the brand brief, and the method tells the producer so, so a\n * model naturally cites `brand.logo-direction` and `brand.name`. Refusing those keys made\n * a correct 91-task plan fail generation over one task (app-creation-test-004, run\n * `6abe4b92…`), and with a whole-artifact retry the plan came back as one task.\n * `brand.visual-tone` is the input the design-system config target derives its palette\n * and typography from. `brand.audience` and `brand.asset` are left out: no build task\n * is accountable to an audience description, and an asset is something a step PRODUCES,\n * not something it serves.\n */\n 'brand.name',\n 'brand.logo-direction',\n 'brand.visual-tone',\n ],\n },\n ],\n nonEdgeRefFields: {\n skillRefs: 'installed app-knowledge skill folders — the skills catalog, not a family aspect',\n /*\n * NARROWED by #1482 and again by #1660 rather than removed: `produces.resourceRef` is an edge\n * (the resource IS a decided element), and so are `viewRef`, `milestoneRef` and `guidanceRef`\n * (the experience plan decides those entries). Everything else a product names — a field, an\n * operation, a chart, a component, a document — belongs to the built application and has no\n * aspect to point at.\n */\n produces: 'the rest of a product — fields, operations, charts, components, documents, inbound handlers and billing-catalogue product keys of the BUILT application, not decided elements (its `resourceRef`, `viewRef`, `milestoneRef`, `guidanceRef`, `workerRef` and `minionRef` are edges; a billing product traces to its pricing plan through `servesRefs`). An agent\\'s `serviceMethodStepRefs` and `serviceMethodAskedDecisionRefs` and a gate\\'s `serviceMethodDecisionRef` name the firm\\'s method elements a product realizes (#2305), as `<service>/<element>`: those are nested inside a service rather than addressable aspects, so `findServiceMethodDerivationGaps` resolves them. A metered usage recording\\'s `serviceMethodServiceRef` names the service it bills per case by its bare `serviceRef`, and a PDF template\\'s `serviceMethodDeliverableRef` the deliverable it generates (#2305 S6): the service is an addressable aspect, but it is resolved by the same function rather than by an edge, so every method ref has one resolver and a ref naming nothing is reported once, as that function\\'s dangling `UNKNOWN_METHOD_ELEMENT` (#2305 review). A conferred role\\'s `relationshipRef` names a relationship kind of the application\\'s configuration, not a decided element',\n /*\n * The two halves of `target` that reach nothing addressable, stated rather than left silent\n * (#1427). `moduleRef` and `relationshipRefs` beside them ARE edges — see above.\n *\n * `resourceRef` is the one to explain, because it LOOKS like it should resolve and the\n * measurement says it does: every `resourceRef` a build plan carries appears in a domain-plan\n * module's `mainResources` / `supportingResources`. But those are plain string arrays inside\n * a module item, not an aspect — the registry declares `domain-plan.module` and\n * `domain-plan.relationship` and nothing between them — so there is no target to point at.\n * Giving the domain plan a RESOURCE aspect would make this an edge and is the right fix; it\n * is a schema decision about a landed family, not something an edge declaration can do.\n */\n 'target.generationStepRef': 'a COMPANION generation step id (labels, seeds, emails) — a runtime step, not a decided element',\n /*\n * The non-resource target that reaches nothing addressable (#1490). A worker and a minion are edges since the\n * integration plan named them (see `workerRef` / `minionRef` above).\n */\n 'target.providerRef': \"an engine provider ref — the engine's own catalogue, not a decided element\",\n },\n },\n ],\n};\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The names of a planned WORKER and MINION, and the ONE rule that turns each into the directory its package lives in.
|
|
4
|
+
*
|
|
5
|
+
* A worker or minion is named once, by the integration plan (`worker-<slug>`, `minion-<slug>`), and the build plan names
|
|
6
|
+
* the same one by the same ref. Its package is composed under `workers/<slug>` / `minions/<slug>`: the stamped prefix
|
|
7
|
+
* says which collection a ref belongs to, and the directory is already inside that collection, so the prefix is not part
|
|
8
|
+
* of the directory.
|
|
9
|
+
*
|
|
10
|
+
* Two parties need the directory: the foundation step that COMPOSES the package, and the coding policy that scopes a
|
|
11
|
+
* build task to it, typechecks it and reads its entry to decide the task landed. They used to derive it separately, and
|
|
12
|
+
* disagreed: the foundation stripped the prefix, the policy kept it. On client creation run 44031607175 the worker's
|
|
13
|
+
* task committed its three routes in `workers/spreadsheet-import/src/index.ts` and was probed at
|
|
14
|
+
* `workers/worker-spreadsheet-import/src/index.ts`, a file that never existed, so it never landed and the 20 tasks after
|
|
15
|
+
* it never ran. The two minion tasks landed only because their agents wrote the prefixed ref into the application's
|
|
16
|
+
* config as comments and an invented ref map, for the probe to find. Both parties now call the functions below.
|
|
17
|
+
*
|
|
18
|
+
* A leaf module, so the build-plan schemas can type their refs with it: the integration plan's schemas import from the
|
|
19
|
+
* build plan's, and the reverse import would be a cycle.
|
|
20
|
+
*/
|
|
21
|
+
/** Stable prefixes the trusted runtime stamps; a provider supplies only the slug. */
|
|
22
|
+
export declare const INTEGRATION_WORKER_REF_PREFIX = "worker-";
|
|
23
|
+
export declare const INTEGRATION_MINION_REF_PREFIX = "minion-";
|
|
24
|
+
/** A planned worker's ref: `worker-<slug>`, as the integration plan stamps it. */
|
|
25
|
+
export declare const IntegrationWorkerRefSchema: z.ZodString;
|
|
26
|
+
/** A planned minion's ref: `minion-<slug>`, as the integration plan stamps it. */
|
|
27
|
+
export declare const IntegrationMinionRefSchema: z.ZodString;
|
|
28
|
+
/** The directory, under `workers/`, a planned worker's package is composed into: its ref without the stamped prefix. */
|
|
29
|
+
export declare function integrationWorkerDirectoryName(workerRef: string): string;
|
|
30
|
+
/** The directory, under `minions/`, a planned minion's package is composed into: its ref without the stamped prefix. */
|
|
31
|
+
export declare function integrationMinionDirectoryName(minionRef: string): string;
|
|
32
|
+
//# sourceMappingURL=integration-execution-surface-refs.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-execution-surface-refs.schemas.d.ts","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-execution-surface-refs.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;GAkBG;AAEH,qFAAqF;AACrF,eAAO,MAAM,6BAA6B,YAAY,CAAC;AACvD,eAAO,MAAM,6BAA6B,YAAY,CAAC;AAIvD,kFAAkF;AAClF,eAAO,MAAM,0BAA0B,aAA2F,CAAC;AACnI,kFAAkF;AAClF,eAAO,MAAM,0BAA0B,aAA2F,CAAC;AAEnI,wHAAwH;AACxH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,wHAAwH;AACxH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAExE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The names of a planned WORKER and MINION, and the ONE rule that turns each into the directory its package lives in.
|
|
4
|
+
*
|
|
5
|
+
* A worker or minion is named once, by the integration plan (`worker-<slug>`, `minion-<slug>`), and the build plan names
|
|
6
|
+
* the same one by the same ref. Its package is composed under `workers/<slug>` / `minions/<slug>`: the stamped prefix
|
|
7
|
+
* says which collection a ref belongs to, and the directory is already inside that collection, so the prefix is not part
|
|
8
|
+
* of the directory.
|
|
9
|
+
*
|
|
10
|
+
* Two parties need the directory: the foundation step that COMPOSES the package, and the coding policy that scopes a
|
|
11
|
+
* build task to it, typechecks it and reads its entry to decide the task landed. They used to derive it separately, and
|
|
12
|
+
* disagreed: the foundation stripped the prefix, the policy kept it. On client creation run 44031607175 the worker's
|
|
13
|
+
* task committed its three routes in `workers/spreadsheet-import/src/index.ts` and was probed at
|
|
14
|
+
* `workers/worker-spreadsheet-import/src/index.ts`, a file that never existed, so it never landed and the 20 tasks after
|
|
15
|
+
* it never ran. The two minion tasks landed only because their agents wrote the prefixed ref into the application's
|
|
16
|
+
* config as comments and an invented ref map, for the probe to find. Both parties now call the functions below.
|
|
17
|
+
*
|
|
18
|
+
* A leaf module, so the build-plan schemas can type their refs with it: the integration plan's schemas import from the
|
|
19
|
+
* build plan's, and the reverse import would be a cycle.
|
|
20
|
+
*/
|
|
21
|
+
/** Stable prefixes the trusted runtime stamps; a provider supplies only the slug. */
|
|
22
|
+
export const INTEGRATION_WORKER_REF_PREFIX = 'worker-';
|
|
23
|
+
export const INTEGRATION_MINION_REF_PREFIX = 'minion-';
|
|
24
|
+
const SLUG_PATTERN_SOURCE = '[a-z0-9]+(?:-[a-z0-9]+)*';
|
|
25
|
+
/** A planned worker's ref: `worker-<slug>`, as the integration plan stamps it. */
|
|
26
|
+
export const IntegrationWorkerRefSchema = z.string().regex(new RegExp(`^${INTEGRATION_WORKER_REF_PREFIX}${SLUG_PATTERN_SOURCE}$`));
|
|
27
|
+
/** A planned minion's ref: `minion-<slug>`, as the integration plan stamps it. */
|
|
28
|
+
export const IntegrationMinionRefSchema = z.string().regex(new RegExp(`^${INTEGRATION_MINION_REF_PREFIX}${SLUG_PATTERN_SOURCE}$`));
|
|
29
|
+
/** The directory, under `workers/`, a planned worker's package is composed into: its ref without the stamped prefix. */
|
|
30
|
+
export function integrationWorkerDirectoryName(workerRef) {
|
|
31
|
+
return withoutStampedPrefix(workerRef, INTEGRATION_WORKER_REF_PREFIX, 'worker');
|
|
32
|
+
}
|
|
33
|
+
/** The directory, under `minions/`, a planned minion's package is composed into: its ref without the stamped prefix. */
|
|
34
|
+
export function integrationMinionDirectoryName(minionRef) {
|
|
35
|
+
return withoutStampedPrefix(minionRef, INTEGRATION_MINION_REF_PREFIX, 'minion');
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Refuses a ref that does not carry its prefix rather than passing it through: a ref that is already a directory name
|
|
39
|
+
* would otherwise be accepted here and lose its first word whenever that word is the prefix.
|
|
40
|
+
*/
|
|
41
|
+
function withoutStampedPrefix(ref, prefix, subject) {
|
|
42
|
+
if (!ref.startsWith(prefix) || ref.length === prefix.length) {
|
|
43
|
+
throw new Error(`A planned ${subject} is named "${prefix}<slug>" by the integration plan; got "${ref}".`);
|
|
44
|
+
}
|
|
45
|
+
return ref.slice(prefix.length);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=integration-execution-surface-refs.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration-execution-surface-refs.schemas.js","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-execution-surface-refs.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;GAkBG;AAEH,qFAAqF;AACrF,MAAM,CAAC,MAAM,6BAA6B,GAAG,SAAS,CAAC;AACvD,MAAM,CAAC,MAAM,6BAA6B,GAAG,SAAS,CAAC;AAEvD,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAEvD,kFAAkF;AAClF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,6BAA6B,GAAG,mBAAmB,GAAG,CAAC,CAAC,CAAC;AACnI,kFAAkF;AAClF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,6BAA6B,GAAG,mBAAmB,GAAG,CAAC,CAAC,CAAC;AAEnI,wHAAwH;AACxH,MAAM,UAAU,8BAA8B,CAAC,SAAiB;IAC9D,OAAO,oBAAoB,CAAC,SAAS,EAAE,6BAA6B,EAAE,QAAQ,CAAC,CAAC;AAClF,CAAC;AAED,wHAAwH;AACxH,MAAM,UAAU,8BAA8B,CAAC,SAAiB;IAC9D,OAAO,oBAAoB,CAAC,SAAS,EAAE,6BAA6B,EAAE,QAAQ,CAAC,CAAC;AAClF,CAAC;AAED;;;GAGG;AACH,SAAS,oBAAoB,CAAC,GAAW,EAAE,MAAc,EAAE,OAAe;IACxE,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC;QAC5D,MAAM,IAAI,KAAK,CAAC,aAAa,OAAO,cAAc,MAAM,yCAAyC,GAAG,IAAI,CAAC,CAAC;IAC5G,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC","sourcesContent":["import { z } from 'zod';\n\n/**\n * The names of a planned WORKER and MINION, and the ONE rule that turns each into the directory its package lives in.\n *\n * A worker or minion is named once, by the integration plan (`worker-<slug>`, `minion-<slug>`), and the build plan names\n * the same one by the same ref. Its package is composed under `workers/<slug>` / `minions/<slug>`: the stamped prefix\n * says which collection a ref belongs to, and the directory is already inside that collection, so the prefix is not part\n * of the directory.\n *\n * Two parties need the directory: the foundation step that COMPOSES the package, and the coding policy that scopes a\n * build task to it, typechecks it and reads its entry to decide the task landed. They used to derive it separately, and\n * disagreed: the foundation stripped the prefix, the policy kept it. On client creation run 44031607175 the worker's\n * task committed its three routes in `workers/spreadsheet-import/src/index.ts` and was probed at\n * `workers/worker-spreadsheet-import/src/index.ts`, a file that never existed, so it never landed and the 20 tasks after\n * it never ran. The two minion tasks landed only because their agents wrote the prefixed ref into the application's\n * config as comments and an invented ref map, for the probe to find. Both parties now call the functions below.\n *\n * A leaf module, so the build-plan schemas can type their refs with it: the integration plan's schemas import from the\n * build plan's, and the reverse import would be a cycle.\n */\n\n/** Stable prefixes the trusted runtime stamps; a provider supplies only the slug. */\nexport const INTEGRATION_WORKER_REF_PREFIX = 'worker-';\nexport const INTEGRATION_MINION_REF_PREFIX = 'minion-';\n\nconst SLUG_PATTERN_SOURCE = '[a-z0-9]+(?:-[a-z0-9]+)*';\n\n/** A planned worker's ref: `worker-<slug>`, as the integration plan stamps it. */\nexport const IntegrationWorkerRefSchema = z.string().regex(new RegExp(`^${INTEGRATION_WORKER_REF_PREFIX}${SLUG_PATTERN_SOURCE}$`));\n/** A planned minion's ref: `minion-<slug>`, as the integration plan stamps it. */\nexport const IntegrationMinionRefSchema = z.string().regex(new RegExp(`^${INTEGRATION_MINION_REF_PREFIX}${SLUG_PATTERN_SOURCE}$`));\n\n/** The directory, under `workers/`, a planned worker's package is composed into: its ref without the stamped prefix. */\nexport function integrationWorkerDirectoryName(workerRef: string): string {\n return withoutStampedPrefix(workerRef, INTEGRATION_WORKER_REF_PREFIX, 'worker');\n}\n\n/** The directory, under `minions/`, a planned minion's package is composed into: its ref without the stamped prefix. */\nexport function integrationMinionDirectoryName(minionRef: string): string {\n return withoutStampedPrefix(minionRef, INTEGRATION_MINION_REF_PREFIX, 'minion');\n}\n\n/**\n * Refuses a ref that does not carry its prefix rather than passing it through: a ref that is already a directory name\n * would otherwise be accepted here and lose its first word whenever that word is the prefix.\n */\nfunction withoutStampedPrefix(ref: string, prefix: string, subject: string): string {\n if (!ref.startsWith(prefix) || ref.length === prefix.length) {\n throw new Error(`A planned ${subject} is named \"${prefix}<slug>\" by the integration plan; got \"${ref}\".`);\n }\n return ref.slice(prefix.length);\n}\n"]}
|
|
@@ -54,6 +54,13 @@ export declare const IntegrationPlanGenerationSchema: z.ZodObject<{
|
|
|
54
54
|
purpose: z.ZodString;
|
|
55
55
|
servesRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
56
56
|
}, z.core.$strict>>>;
|
|
57
|
+
unprovidedNeeds: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
58
|
+
providerRef: z.ZodString;
|
|
59
|
+
need: z.ZodString;
|
|
60
|
+
whyNoExistingProvider: z.ZodString;
|
|
61
|
+
wiredByRef: z.ZodOptional<z.ZodString>;
|
|
62
|
+
servesRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
63
|
+
}, z.core.$strict>>>;
|
|
57
64
|
}, z.core.$strict>;
|
|
58
65
|
export type IntegrationPlanGeneration = z.infer<typeof IntegrationPlanGenerationSchema>;
|
|
59
66
|
/** Normalize strict provider output into the persisted family (stamping refs and version). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-plan-generation.schemas.d.ts","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan-generation.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"integration-plan-generation.schemas.d.ts","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan-generation.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAQL,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AAKpC;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC;;;;;;kBAAqF,CAAC;AACpI,eAAO,MAAM,iCAAiC;;;;;;;kBAAqF,CAAC;AAEpI,sEAAsE;AACtE,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAsB1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,8FAA8F;AAC9F,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CAW9E"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { applyFamilyRefPrefix } from '../utils/family-ref-stamping.js';
|
|
3
|
-
import { INTEGRATION_MINION_REF_PREFIX, INTEGRATION_WORKER_REF_PREFIX
|
|
3
|
+
import { INTEGRATION_MINION_REF_PREFIX, INTEGRATION_WORKER_REF_PREFIX } from './integration-execution-surface-refs.schemas.js';
|
|
4
|
+
import { IntegrationInboundChannelPlanSchema, IntegrationMinionPlanSchema, IntegrationPlanSchema, IntegrationPlanVersion, IntegrationProviderBindingPlanSchema, IntegrationUnprovidedNeedSchema, IntegrationWorkerPlanSchema, } from './integration-plan.schemas.js';
|
|
4
5
|
const SlugSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
|
|
5
6
|
const NonEmptyStringSchema = z.string().trim().min(1);
|
|
6
7
|
/**
|
|
@@ -19,6 +20,7 @@ export const IntegrationPlanGenerationSchema = z.strictObject({
|
|
|
19
20
|
minions: z.array(IntegrationMinionGenerationSchema).default([]),
|
|
20
21
|
providerBindings: z.array(IntegrationProviderBindingPlanSchema).default([]),
|
|
21
22
|
inboundChannels: z.array(IntegrationInboundChannelPlanSchema).default([]),
|
|
23
|
+
unprovidedNeeds: z.array(IntegrationUnprovidedNeedSchema).default([]),
|
|
22
24
|
}).superRefine((generated, context) => {
|
|
23
25
|
// Keyed on the STAMPED form in both collections: `imports` and `worker-imports` are two slugs that
|
|
24
26
|
// normalize to one ref, and two surfaces sharing a ref make their build tasks ambiguous.
|
|
@@ -47,6 +49,7 @@ export function parseIntegrationPlanGeneration(input) {
|
|
|
47
49
|
minions: generated.minions.map(({ slug, ...minion }) => ({ minionRef: applyFamilyRefPrefix(slug, INTEGRATION_MINION_REF_PREFIX), ...minion })),
|
|
48
50
|
providerBindings: generated.providerBindings,
|
|
49
51
|
inboundChannels: generated.inboundChannels,
|
|
52
|
+
unprovidedNeeds: generated.unprovidedNeeds,
|
|
50
53
|
});
|
|
51
54
|
}
|
|
52
55
|
//# sourceMappingURL=integration-plan-generation.schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-plan-generation.schemas.js","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan-generation.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,
|
|
1
|
+
{"version":3,"file":"integration-plan-generation.schemas.js","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan-generation.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC5H,OAAO,EACL,mCAAmC,EACnC,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,oCAAoC,EACpC,+BAA+B,EAC/B,2BAA2B,GAE5B,MAAM,4BAA4B,CAAC;AAEpC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;AAClE,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,2BAA2B,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;AACpI,MAAM,CA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AE,oBAAoB,CAAC,IAAI,EAAE,6BAA6B,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;QAC9I,gBAAgB,EAAE,SAAS,CAAC,gBAAgB;QAC5C,eAAe,EAAE,SAAS,CAAC,eAAe;QAC1C,eAAe,EAAE,SAAS,CAAC,eAAe;KAC3C,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { z } from 'zod';\n\nimport { applyFamilyRefPrefix } from '../utils/family-ref-stamping';\nimport { INTEGRATION_MINION_REF_PREFIX, INTEGRATION_WORKER_REF_PREFIX } from './integration-execution-surface-refs.schemas';\nimport {\n IntegrationInboundChannelPlanSchema,\n IntegrationMinionPlanSchema,\n IntegrationPlanSchema,\n IntegrationPlanVersion,\n IntegrationProviderBindingPlanSchema,\n IntegrationUnprovidedNeedSchema,\n IntegrationWorkerPlanSchema,\n type IntegrationPlan,\n} from './integration-plan.schemas';\n\nconst SlugSchema = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);\nconst NonEmptyStringSchema = z.string().trim().min(1);\n\n/**\n * Strict provider-facing shapes. The provider supplies stable semantic slugs; the trusted runtime\n * stamps the canonical ref prefixes and the payload version.\n *\n * No path, port, package name or schedule expression is representable: the plan decides WHAT runs\n * and what it may touch, and the composition scenario plus the coding agent own the rest.\n */\nexport const IntegrationWorkerGenerationSchema = IntegrationWorkerPlanSchema.omit({ workerRef: true }).extend({ slug: SlugSchema });\nexport const IntegrationMinionGenerationSchema = IntegrationMinionPlanSchema.omit({ minionRef: true }).extend({ slug: SlugSchema });\n\n/** One complete provider response for the integration-plan family. */\nexport const IntegrationPlanGenerationSchema = z.strictObject({\n rationale: NonEmptyStringSchema,\n workers: z.array(IntegrationWorkerGenerationSchema).default([]),\n minions: z.array(IntegrationMinionGenerationSchema).default([]),\n providerBindings: z.array(IntegrationProviderBindingPlanSchema).default([]),\n inboundChannels: z.array(IntegrationInboundChannelPlanSchema).default([]),\n unprovidedNeeds: z.array(IntegrationUnprovidedNeedSchema).default([]),\n}).superRefine((generated, context) => {\n // Keyed on the STAMPED form in both collections: `imports` and `worker-imports` are two slugs that\n // normalize to one ref, and two surfaces sharing a ref make their build tasks ambiguous.\n const workerRefs = new Set<string>();\n generated.workers.forEach((worker, index) => {\n const workerRef = applyFamilyRefPrefix(worker.slug, INTEGRATION_WORKER_REF_PREFIX);\n if (workerRefs.has(workerRef)) context.addIssue({ code: 'custom', message: `duplicate worker slug ${worker.slug} (normalizes to ${workerRef})`, path: ['workers', index, 'slug'] });\n workerRefs.add(workerRef);\n });\n const minionRefs = new Set<string>();\n generated.minions.forEach((minion, index) => {\n const minionRef = applyFamilyRefPrefix(minion.slug, INTEGRATION_MINION_REF_PREFIX);\n if (minionRefs.has(minionRef)) context.addIssue({ code: 'custom', message: `duplicate minion slug ${minion.slug} (normalizes to ${minionRef})`, path: ['minions', index, 'slug'] });\n minionRefs.add(minionRef);\n });\n});\nexport type IntegrationPlanGeneration = z.infer<typeof IntegrationPlanGenerationSchema>;\n\n/** Normalize strict provider output into the persisted family (stamping refs and version). */\nexport function parseIntegrationPlanGeneration(input: unknown): IntegrationPlan {\n const generated = IntegrationPlanGenerationSchema.parse(input);\n return IntegrationPlanSchema.parse({\n version: IntegrationPlanVersion.V1,\n rationale: generated.rationale,\n workers: generated.workers.map(({ slug, ...worker }) => ({ workerRef: applyFamilyRefPrefix(slug, INTEGRATION_WORKER_REF_PREFIX), ...worker })),\n minions: generated.minions.map(({ slug, ...minion }) => ({ minionRef: applyFamilyRefPrefix(slug, INTEGRATION_MINION_REF_PREFIX), ...minion })),\n providerBindings: generated.providerBindings,\n inboundChannels: generated.inboundChannels,\n unprovidedNeeds: generated.unprovidedNeeds,\n });\n}\n"]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ProviderBindingScope } from '../build-plan/build-plan-task-graph.schemas';
|
|
2
|
+
import { ProviderSpecificationFacet } from '../provider-specification.schemas';
|
|
1
3
|
import type { IntegrationPlan } from './integration-plan.schemas';
|
|
2
4
|
/** Deterministic finding over an integration plan; authoring coherence beyond structural validity. */
|
|
3
5
|
export declare enum IntegrationPlanFindingCode {
|
|
@@ -6,7 +8,14 @@ export declare enum IntegrationPlanFindingCode {
|
|
|
6
8
|
/** A worker or minion accountable to nothing: no requirement, feature draft or roadmap phase asked for it. */
|
|
7
9
|
EXECUTION_SURFACE_SERVES_NOTHING = "EXECUTION_SURFACE_SERVES_NOTHING",
|
|
8
10
|
/** A worker whose only job shares its own name — the starter route, planned rather than designed. */
|
|
9
|
-
WORKER_JOB_RESTATES_ITS_WORKER = "WORKER_JOB_RESTATES_ITS_WORKER"
|
|
11
|
+
WORKER_JOB_RESTATES_ITS_WORKER = "WORKER_JOB_RESTATES_ITS_WORKER",
|
|
12
|
+
/**
|
|
13
|
+
* A need recorded as unprovided (#3992) that no provider binding wires and no planned worker or minion wires for itself
|
|
14
|
+
* (`wiredByRef`, #3995 item 6): a provider would be authored for nothing.
|
|
15
|
+
*/
|
|
16
|
+
UNPROVIDED_NEED_NEVER_BOUND = "UNPROVIDED_NEED_NEVER_BOUND",
|
|
17
|
+
/** A need recorded as unprovided that serves no requirement: a provider would be authored for nothing anyone asked for. */
|
|
18
|
+
UNPROVIDED_NEED_SERVES_NOTHING = "UNPROVIDED_NEED_SERVES_NOTHING"
|
|
10
19
|
}
|
|
11
20
|
export interface IntegrationPlanFinding {
|
|
12
21
|
readonly code: IntegrationPlanFindingCode;
|
|
@@ -24,4 +33,108 @@ export interface IntegrationPlanFinding {
|
|
|
24
33
|
*/
|
|
25
34
|
export declare const INTEGRATION_PLAN_HARD_FLOOR_CODES: readonly IntegrationPlanFindingCode[];
|
|
26
35
|
export declare function validateIntegrationPlan(plan: IntegrationPlan): readonly IntegrationPlanFinding[];
|
|
36
|
+
/** Why a provider reference in an integration plan names no provider it may (#3995). */
|
|
37
|
+
export declare enum IntegrationPlanProviderRefFindingCode {
|
|
38
|
+
/** A binding names a provider that is no engine provider, no registry module, nothing installed, and no recorded need. */
|
|
39
|
+
BINDING_NAMES_NO_KNOWN_PROVIDER = "BINDING_NAMES_NO_KNOWN_PROVIDER",
|
|
40
|
+
/** An unprovided need names a provider that EXISTS: authoring it would fork a provider the framework already has. */
|
|
41
|
+
UNPROVIDED_NEED_NAMES_EXISTING_PROVIDER = "UNPROVIDED_NEED_NAMES_EXISTING_PROVIDER",
|
|
42
|
+
/**
|
|
43
|
+
* A binding puts a provider on a scope whose facet it does not ship (a `BACKEND` binding to the browser-only Dropbox
|
|
44
|
+
* Chooser): a task with nothing to load there, refused like an unknown provider. Checked only for a provider whose
|
|
45
|
+
* facets are known (`IntegrationPlanKnownProviders.facetsByProvider`).
|
|
46
|
+
*/
|
|
47
|
+
BINDING_SCOPE_NOT_SHIPPED_BY_PROVIDER = "BINDING_SCOPE_NOT_SHIPPED_BY_PROVIDER"
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The facet a provider must ship for a binding on each scope to load (#3995): total over {@link ProviderBindingScope}, so a
|
|
51
|
+
* scope added tomorrow names its facet or does not compile. The backend and the companion both load backend modules.
|
|
52
|
+
*/
|
|
53
|
+
export declare const PROVIDER_BINDING_SCOPE_FACET: Readonly<Record<ProviderBindingScope, ProviderSpecificationFacet>>;
|
|
54
|
+
export interface IntegrationPlanProviderRefFinding {
|
|
55
|
+
readonly code: IntegrationPlanProviderRefFindingCode;
|
|
56
|
+
readonly providerRef: string;
|
|
57
|
+
/**
|
|
58
|
+
* The element's path in the plan (`providerBindings.0.providerRef`). A correction that changes a binding's provider
|
|
59
|
+
* changes that element's identity, and the retry's drop guard (#3363) lets a correction remove or re-identify an
|
|
60
|
+
* element only when a finding names it by its position: without the path the model could never fix what it is told.
|
|
61
|
+
*/
|
|
62
|
+
readonly path: string;
|
|
63
|
+
readonly message: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The providers an integration plan is checked against (#3995), as two sets because the two checks ask different things.
|
|
67
|
+
* `existing` is what the FRAMEWORK already has (the engine's providers and the registry's modules): a recorded need naming
|
|
68
|
+
* one would fork it. `bindable` adds what THIS application has (installed or authored packages, refs its scopes declare):
|
|
69
|
+
* a binding may name any of them. An authored provider is bindable but not existing, so a plan rerun after authoring it
|
|
70
|
+
* keeps the need that records why.
|
|
71
|
+
*/
|
|
72
|
+
export interface IntegrationPlanKnownProviders {
|
|
73
|
+
readonly existing: ReadonlySet<string>;
|
|
74
|
+
readonly bindable: ReadonlySet<string>;
|
|
75
|
+
/**
|
|
76
|
+
* The facets each provider ships a module for, ONLY for a provider whose every source is known: an engine provider
|
|
77
|
+
* specification that no registry module, application package or non-engine contribution shares the ref with. A provider
|
|
78
|
+
* absent here has unknown facets (an installed, authored or registry one), and its binding's scope is not checked:
|
|
79
|
+
* unknown is not wrong. Absent as a whole, no scope is checked.
|
|
80
|
+
*/
|
|
81
|
+
readonly facetsByProvider?: ReadonlyMap<string, ReadonlySet<string>>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The binding scopes whose providers the known set describes COMPLETELY (#3995 review R1): every scope, since #3995 item 5.
|
|
85
|
+
*
|
|
86
|
+
* The set's framework half comes from the registered provider specifications, so a scope may be checked only when every
|
|
87
|
+
* engine provider that scope can bind has one. For the backend side that was always true (every MAIN backend module is
|
|
88
|
+
* described). For the frontend side it was not: the Dropbox picker had no specification, and discovery finds an engine
|
|
89
|
+
* browser module only when an application's frontend scope already declares a provider, so FRONTEND_APP and WEBSITE were
|
|
90
|
+
* left unchecked rather than refuse a real engine provider and steer the model into recording it as unprovided (a fork).
|
|
91
|
+
* Dropbox now has its specification, and the CLI's provider-specification reconciliation (#328, facet-aware since #3995)
|
|
92
|
+
* fails when any engine browser module lacks one, so the frontend scopes are as completely described as the backend.
|
|
93
|
+
* Enumerated when widened: `frontend-app` dropbox, google-drive, google-places, microsoft-onedrive; `frontend-website`
|
|
94
|
+
* recaptcha; `frontend-techdoc` none. The application's own browser providers are in `bindable` through discovery and the
|
|
95
|
+
* refs its frontend scopes declare; a host that cannot read any discovery owner, frontend included, reports no set (the
|
|
96
|
+
* companion's `readKnownProviderRefsFor`).
|
|
97
|
+
*
|
|
98
|
+
* Kept as a named set rather than deleted, so a scope added to {@link ProviderBindingScope} without a complete source is a
|
|
99
|
+
* decision written here, not a check that silently starts refusing.
|
|
100
|
+
*/
|
|
101
|
+
export declare const PROVIDER_BINDING_SCOPES_CHECKED_FOR_EXISTENCE: ReadonlySet<ProviderBindingScope>;
|
|
102
|
+
/**
|
|
103
|
+
* The provider references of an integration plan, against the providers that exist (#3995). Kept out of
|
|
104
|
+
* {@link validateIntegrationPlan} on purpose: that one reads the plan alone, and this needs the application around it, so
|
|
105
|
+
* a host calls it only when it could read the whole set (an unreadable source means no set, and no check, since unknown is
|
|
106
|
+
* not wrong).
|
|
107
|
+
*
|
|
108
|
+
* Every finding makes the plan UNTRUE, not thin (`application-creation-directive.md`): a binding to a provider nothing
|
|
109
|
+
* provides, or on a scope whose facet its provider does not ship, is a task with nothing to wire, and a recorded need for
|
|
110
|
+
* a provider that exists is a decision to fork it, which is what Paul's rule (#3992) forbids. So a host rejects the
|
|
111
|
+
* candidate into the model's retry with these findings.
|
|
112
|
+
* Bindings are checked only on {@link PROVIDER_BINDING_SCOPES_CHECKED_FOR_EXISTENCE}. `augments` is not checked: it names
|
|
113
|
+
* the provider an augmentation extends, which configuration sync already resolves.
|
|
114
|
+
*/
|
|
115
|
+
export declare function validateIntegrationPlanProviderRefs(plan: IntegrationPlan, known: IntegrationPlanKnownProviders): readonly IntegrationPlanProviderRefFinding[];
|
|
116
|
+
/** What {@link repairIntegrationPlanProviderRefs} removed from a plan, each with the finding that removed it. */
|
|
117
|
+
export interface IntegrationPlanProviderRefRepair {
|
|
118
|
+
readonly plan: IntegrationPlan;
|
|
119
|
+
/** The findings whose elements were removed, paths as they stood BEFORE the removal. Empty when nothing was. */
|
|
120
|
+
readonly removed: readonly IntegrationPlanProviderRefFinding[];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The plan with every provider reference {@link validateIntegrationPlanProviderRefs} refuses REMOVED, for the generation's
|
|
124
|
+
* LAST attempt (#3995 review follow-up): the same mechanical repair `skipDroppableRefs` makes for an optional dangling ref
|
|
125
|
+
* (#2556, #3074), so one wrong ref costs that element rather than the whole plan, and with it the run.
|
|
126
|
+
*
|
|
127
|
+
* - An `unprovidedNeeds` entry naming an EXISTING provider is dropped. Its binding stays: it now wires the provider that
|
|
128
|
+
* exists, which is exactly what Paul's rule (#3992) asks for. Nothing is authored, nothing is forked.
|
|
129
|
+
* - A binding to a provider that is neither bindable nor a remaining recorded need is dropped, and so is a binding on a
|
|
130
|
+
* scope whose facet its provider does not ship: a task with nothing to wire is not one the build can do. The
|
|
131
|
+
* requirement it served is then served by no binding, which the host reports as an advisory (in the generation's trace
|
|
132
|
+
* and attempt record, and the companion's log); the landing record does not carry it. A binding refused for two reasons
|
|
133
|
+
* is removed once, and recorded once, with its first finding.
|
|
134
|
+
*
|
|
135
|
+
* Needs first, then bindings, against the needs that remain. A dropped need names a provider in `existing`, which the
|
|
136
|
+
* host keeps inside `bindable`, so dropping it never orphans a binding. Pure; the caller decides whether to use it, and
|
|
137
|
+
* uses it only when the model has no attempt left to correct the refs itself.
|
|
138
|
+
*/
|
|
139
|
+
export declare function repairIntegrationPlanProviderRefs(plan: IntegrationPlan, known: IntegrationPlanKnownProviders): IntegrationPlanProviderRefRepair;
|
|
27
140
|
//# sourceMappingURL=integration-plan-validation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-plan-validation.d.ts","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,sGAAsG;AACtG,oBAAY,0BAA0B;IACpC,+FAA+F;IAC/F,kCAAkC,uCAAuC;IACzE,8GAA8G;IAC9G,gCAAgC,qCAAqC;IACrE,qGAAqG;IACrG,8BAA8B,mCAAmC;CAClE;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iCAAiC,EAAE,SAAS,0BAA0B,EAAO,CAAC;AAE3F,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,eAAe,GAAG,SAAS,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"integration-plan-validation.d.ts","sourceRoot":"","sources":["../../../../src/_core/integration-plan/integration-plan-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AACnF,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE,sGAAsG;AACtG,oBAAY,0BAA0B;IACpC,+FAA+F;IAC/F,kCAAkC,uCAAuC;IACzE,8GAA8G;IAC9G,gCAAgC,qCAAqC;IACrE,qGAAqG;IACrG,8BAA8B,mCAAmC;IACjE;;;OAGG;IACH,2BAA2B,gCAAgC;IAC3D,2HAA2H;IAC3H,8BAA8B,mCAAmC;CAClE;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iCAAiC,EAAE,SAAS,0BAA0B,EAAO,CAAC;AAE3F,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,eAAe,GAAG,SAAS,sBAAsB,EAAE,CA6DhG;AAED,wFAAwF;AACxF,oBAAY,qCAAqC;IAC/C,0HAA0H;IAC1H,+BA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0B/I"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ProviderBindingScope } from '../build-plan/build-plan-task-graph.schemas.js';
|
|
2
|
+
import { ProviderSpecificationFacet } from '../provider-specification.schemas.js';
|
|
1
3
|
/** Deterministic finding over an integration plan; authoring coherence beyond structural validity. */
|
|
2
4
|
export var IntegrationPlanFindingCode;
|
|
3
5
|
(function (IntegrationPlanFindingCode) {
|
|
@@ -7,6 +9,13 @@ export var IntegrationPlanFindingCode;
|
|
|
7
9
|
IntegrationPlanFindingCode["EXECUTION_SURFACE_SERVES_NOTHING"] = "EXECUTION_SURFACE_SERVES_NOTHING";
|
|
8
10
|
/** A worker whose only job shares its own name — the starter route, planned rather than designed. */
|
|
9
11
|
IntegrationPlanFindingCode["WORKER_JOB_RESTATES_ITS_WORKER"] = "WORKER_JOB_RESTATES_ITS_WORKER";
|
|
12
|
+
/**
|
|
13
|
+
* A need recorded as unprovided (#3992) that no provider binding wires and no planned worker or minion wires for itself
|
|
14
|
+
* (`wiredByRef`, #3995 item 6): a provider would be authored for nothing.
|
|
15
|
+
*/
|
|
16
|
+
IntegrationPlanFindingCode["UNPROVIDED_NEED_NEVER_BOUND"] = "UNPROVIDED_NEED_NEVER_BOUND";
|
|
17
|
+
/** A need recorded as unprovided that serves no requirement: a provider would be authored for nothing anyone asked for. */
|
|
18
|
+
IntegrationPlanFindingCode["UNPROVIDED_NEED_SERVES_NOTHING"] = "UNPROVIDED_NEED_SERVES_NOTHING";
|
|
10
19
|
})(IntegrationPlanFindingCode || (IntegrationPlanFindingCode = {}));
|
|
11
20
|
/**
|
|
12
21
|
* The finding codes that must block a landing — NONE, and that is a decision rather than an omission.
|
|
@@ -58,6 +67,173 @@ export function validateIntegrationPlan(plan) {
|
|
|
58
67
|
});
|
|
59
68
|
}
|
|
60
69
|
}
|
|
70
|
+
const boundRefs = new Set(plan.providerBindings.map((binding) => binding.providerRef));
|
|
71
|
+
// The schema refuses a `wiredByRef` naming no planned surface, so a present one wires the need.
|
|
72
|
+
const plannedSurfaceRefs = new Set([...plan.workers.map((worker) => worker.workerRef), ...plan.minions.map((minion) => minion.minionRef)]);
|
|
73
|
+
for (const need of plan.unprovidedNeeds) {
|
|
74
|
+
const wiredBySurface = need.wiredByRef !== undefined && plannedSurfaceRefs.has(need.wiredByRef);
|
|
75
|
+
if (!boundRefs.has(need.providerRef) && !wiredBySurface) {
|
|
76
|
+
findings.push({
|
|
77
|
+
code: IntegrationPlanFindingCode.UNPROVIDED_NEED_NEVER_BOUND,
|
|
78
|
+
surfaceRef: need.providerRef,
|
|
79
|
+
message: `${need.providerRef} is recorded as a need no existing provider fills, but nothing wires it: bind it on the scope that needs it, name the worker or minion that alone uses it in wiredByRef, or drop the entry.`,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (need.servesRefs.length === 0) {
|
|
83
|
+
findings.push({
|
|
84
|
+
code: IntegrationPlanFindingCode.UNPROVIDED_NEED_SERVES_NOTHING,
|
|
85
|
+
surfaceRef: need.providerRef,
|
|
86
|
+
message: `${need.providerRef} is recorded as a need no existing provider fills, but it serves no requirement: a new provider is authored only for something the product was asked to do.`,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
61
90
|
return findings;
|
|
62
91
|
}
|
|
92
|
+
/** Why a provider reference in an integration plan names no provider it may (#3995). */
|
|
93
|
+
export var IntegrationPlanProviderRefFindingCode;
|
|
94
|
+
(function (IntegrationPlanProviderRefFindingCode) {
|
|
95
|
+
/** A binding names a provider that is no engine provider, no registry module, nothing installed, and no recorded need. */
|
|
96
|
+
IntegrationPlanProviderRefFindingCode["BINDING_NAMES_NO_KNOWN_PROVIDER"] = "BINDING_NAMES_NO_KNOWN_PROVIDER";
|
|
97
|
+
/** An unprovided need names a provider that EXISTS: authoring it would fork a provider the framework already has. */
|
|
98
|
+
IntegrationPlanProviderRefFindingCode["UNPROVIDED_NEED_NAMES_EXISTING_PROVIDER"] = "UNPROVIDED_NEED_NAMES_EXISTING_PROVIDER";
|
|
99
|
+
/**
|
|
100
|
+
* A binding puts a provider on a scope whose facet it does not ship (a `BACKEND` binding to the browser-only Dropbox
|
|
101
|
+
* Chooser): a task with nothing to load there, refused like an unknown provider. Checked only for a provider whose
|
|
102
|
+
* facets are known (`IntegrationPlanKnownProviders.facetsByProvider`).
|
|
103
|
+
*/
|
|
104
|
+
IntegrationPlanProviderRefFindingCode["BINDING_SCOPE_NOT_SHIPPED_BY_PROVIDER"] = "BINDING_SCOPE_NOT_SHIPPED_BY_PROVIDER";
|
|
105
|
+
})(IntegrationPlanProviderRefFindingCode || (IntegrationPlanProviderRefFindingCode = {}));
|
|
106
|
+
/**
|
|
107
|
+
* The facet a provider must ship for a binding on each scope to load (#3995): total over {@link ProviderBindingScope}, so a
|
|
108
|
+
* scope added tomorrow names its facet or does not compile. The backend and the companion both load backend modules.
|
|
109
|
+
*/
|
|
110
|
+
export const PROVIDER_BINDING_SCOPE_FACET = {
|
|
111
|
+
[ProviderBindingScope.BACKEND]: ProviderSpecificationFacet.BACKEND,
|
|
112
|
+
[ProviderBindingScope.COMPANION]: ProviderSpecificationFacet.BACKEND,
|
|
113
|
+
[ProviderBindingScope.FRONTEND_APP]: ProviderSpecificationFacet.FRONTEND_APP,
|
|
114
|
+
[ProviderBindingScope.WEBSITE]: ProviderSpecificationFacet.FRONTEND_WEBSITE,
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* The binding scopes whose providers the known set describes COMPLETELY (#3995 review R1): every scope, since #3995 item 5.
|
|
118
|
+
*
|
|
119
|
+
* The set's framework half comes from the registered provider specifications, so a scope may be checked only when every
|
|
120
|
+
* engine provider that scope can bind has one. For the backend side that was always true (every MAIN backend module is
|
|
121
|
+
* described). For the frontend side it was not: the Dropbox picker had no specification, and discovery finds an engine
|
|
122
|
+
* browser module only when an application's frontend scope already declares a provider, so FRONTEND_APP and WEBSITE were
|
|
123
|
+
* left unchecked rather than refuse a real engine provider and steer the model into recording it as unprovided (a fork).
|
|
124
|
+
* Dropbox now has its specification, and the CLI's provider-specification reconciliation (#328, facet-aware since #3995)
|
|
125
|
+
* fails when any engine browser module lacks one, so the frontend scopes are as completely described as the backend.
|
|
126
|
+
* Enumerated when widened: `frontend-app` dropbox, google-drive, google-places, microsoft-onedrive; `frontend-website`
|
|
127
|
+
* recaptcha; `frontend-techdoc` none. The application's own browser providers are in `bindable` through discovery and the
|
|
128
|
+
* refs its frontend scopes declare; a host that cannot read any discovery owner, frontend included, reports no set (the
|
|
129
|
+
* companion's `readKnownProviderRefsFor`).
|
|
130
|
+
*
|
|
131
|
+
* Kept as a named set rather than deleted, so a scope added to {@link ProviderBindingScope} without a complete source is a
|
|
132
|
+
* decision written here, not a check that silently starts refusing.
|
|
133
|
+
*/
|
|
134
|
+
export const PROVIDER_BINDING_SCOPES_CHECKED_FOR_EXISTENCE = new Set([
|
|
135
|
+
ProviderBindingScope.BACKEND,
|
|
136
|
+
ProviderBindingScope.COMPANION,
|
|
137
|
+
ProviderBindingScope.FRONTEND_APP,
|
|
138
|
+
ProviderBindingScope.WEBSITE,
|
|
139
|
+
]);
|
|
140
|
+
/**
|
|
141
|
+
* The provider references of an integration plan, against the providers that exist (#3995). Kept out of
|
|
142
|
+
* {@link validateIntegrationPlan} on purpose: that one reads the plan alone, and this needs the application around it, so
|
|
143
|
+
* a host calls it only when it could read the whole set (an unreadable source means no set, and no check, since unknown is
|
|
144
|
+
* not wrong).
|
|
145
|
+
*
|
|
146
|
+
* Every finding makes the plan UNTRUE, not thin (`application-creation-directive.md`): a binding to a provider nothing
|
|
147
|
+
* provides, or on a scope whose facet its provider does not ship, is a task with nothing to wire, and a recorded need for
|
|
148
|
+
* a provider that exists is a decision to fork it, which is what Paul's rule (#3992) forbids. So a host rejects the
|
|
149
|
+
* candidate into the model's retry with these findings.
|
|
150
|
+
* Bindings are checked only on {@link PROVIDER_BINDING_SCOPES_CHECKED_FOR_EXISTENCE}. `augments` is not checked: it names
|
|
151
|
+
* the provider an augmentation extends, which configuration sync already resolves.
|
|
152
|
+
*/
|
|
153
|
+
export function validateIntegrationPlanProviderRefs(plan, known) {
|
|
154
|
+
const findings = [];
|
|
155
|
+
const recordedNeeds = new Set(plan.unprovidedNeeds.map((need) => need.providerRef));
|
|
156
|
+
plan.unprovidedNeeds.forEach((need, index) => {
|
|
157
|
+
if (known.existing.has(need.providerRef)) {
|
|
158
|
+
findings.push({
|
|
159
|
+
code: IntegrationPlanProviderRefFindingCode.UNPROVIDED_NEED_NAMES_EXISTING_PROVIDER,
|
|
160
|
+
providerRef: need.providerRef,
|
|
161
|
+
path: `unprovidedNeeds.${index}.providerRef`,
|
|
162
|
+
message: `${need.providerRef} is recorded as a need no existing provider fills, but ${need.providerRef} EXISTS (an engine provider or a registry module): bind it instead, and drop the entry.`,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
plan.providerBindings.forEach((binding, index) => {
|
|
167
|
+
if (!PROVIDER_BINDING_SCOPES_CHECKED_FOR_EXISTENCE.has(binding.scope))
|
|
168
|
+
return;
|
|
169
|
+
if (known.bindable.has(binding.providerRef) || recordedNeeds.has(binding.providerRef))
|
|
170
|
+
return;
|
|
171
|
+
findings.push({
|
|
172
|
+
code: IntegrationPlanProviderRefFindingCode.BINDING_NAMES_NO_KNOWN_PROVIDER,
|
|
173
|
+
providerRef: binding.providerRef,
|
|
174
|
+
path: `providerBindings.${index}.providerRef`,
|
|
175
|
+
message: `${binding.providerRef} is bound, but it is no engine provider, no registry module and nothing this application has. Bind one the brief lists, or, if none fills the need, record ${binding.providerRef} in unprovidedNeeds with why.`,
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
plan.providerBindings.forEach((binding, index) => {
|
|
179
|
+
if (!PROVIDER_BINDING_SCOPES_CHECKED_FOR_EXISTENCE.has(binding.scope))
|
|
180
|
+
return;
|
|
181
|
+
const facets = known.facetsByProvider?.get(binding.providerRef);
|
|
182
|
+
const needed = PROVIDER_BINDING_SCOPE_FACET[binding.scope];
|
|
183
|
+
if (facets === undefined || facets.has(needed))
|
|
184
|
+
return;
|
|
185
|
+
findings.push({
|
|
186
|
+
code: IntegrationPlanProviderRefFindingCode.BINDING_SCOPE_NOT_SHIPPED_BY_PROVIDER,
|
|
187
|
+
providerRef: binding.providerRef,
|
|
188
|
+
path: `providerBindings.${index}.scope`,
|
|
189
|
+
message: `${binding.providerRef} is bound on ${binding.scope}, which loads a \`${needed}\` module, but ${binding.providerRef} ships only [${[...facets].sort().join(', ')}]. Bind it on a scope its facets serve, or bind a provider that ships \`${needed}\`.`,
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
return findings;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* The plan with every provider reference {@link validateIntegrationPlanProviderRefs} refuses REMOVED, for the generation's
|
|
196
|
+
* LAST attempt (#3995 review follow-up): the same mechanical repair `skipDroppableRefs` makes for an optional dangling ref
|
|
197
|
+
* (#2556, #3074), so one wrong ref costs that element rather than the whole plan, and with it the run.
|
|
198
|
+
*
|
|
199
|
+
* - An `unprovidedNeeds` entry naming an EXISTING provider is dropped. Its binding stays: it now wires the provider that
|
|
200
|
+
* exists, which is exactly what Paul's rule (#3992) asks for. Nothing is authored, nothing is forked.
|
|
201
|
+
* - A binding to a provider that is neither bindable nor a remaining recorded need is dropped, and so is a binding on a
|
|
202
|
+
* scope whose facet its provider does not ship: a task with nothing to wire is not one the build can do. The
|
|
203
|
+
* requirement it served is then served by no binding, which the host reports as an advisory (in the generation's trace
|
|
204
|
+
* and attempt record, and the companion's log); the landing record does not carry it. A binding refused for two reasons
|
|
205
|
+
* is removed once, and recorded once, with its first finding.
|
|
206
|
+
*
|
|
207
|
+
* Needs first, then bindings, against the needs that remain. A dropped need names a provider in `existing`, which the
|
|
208
|
+
* host keeps inside `bindable`, so dropping it never orphans a binding. Pure; the caller decides whether to use it, and
|
|
209
|
+
* uses it only when the model has no attempt left to correct the refs itself.
|
|
210
|
+
*/
|
|
211
|
+
export function repairIntegrationPlanProviderRefs(plan, known) {
|
|
212
|
+
// The needs first: each refused one names a provider that exists, and its binding (if any) wires that provider instead.
|
|
213
|
+
const refusedNeeds = validateIntegrationPlanProviderRefs(plan, known)
|
|
214
|
+
.filter((finding) => finding.code === IntegrationPlanProviderRefFindingCode.UNPROVIDED_NEED_NAMES_EXISTING_PROVIDER);
|
|
215
|
+
const refusedNeedPaths = new Set(refusedNeeds.map((finding) => finding.path));
|
|
216
|
+
const withKeptNeeds = {
|
|
217
|
+
...plan,
|
|
218
|
+
unprovidedNeeds: plan.unprovidedNeeds.filter((_need, index) => !refusedNeedPaths.has(`unprovidedNeeds.${index}.providerRef`)),
|
|
219
|
+
};
|
|
220
|
+
// Then the bindings, judged against the needs that remain; the binding list is unchanged, so their paths still hold.
|
|
221
|
+
const refusedBindings = validateIntegrationPlanProviderRefs(withKeptNeeds, known)
|
|
222
|
+
.filter((finding) => finding.code === IntegrationPlanProviderRefFindingCode.BINDING_NAMES_NO_KNOWN_PROVIDER
|
|
223
|
+
|| finding.code === IntegrationPlanProviderRefFindingCode.BINDING_SCOPE_NOT_SHIPPED_BY_PROVIDER);
|
|
224
|
+
// A binding is named by `providerBindings.<index>.<field>`, whichever field its finding is about; one removal per binding.
|
|
225
|
+
const bindingIndexOf = (finding) => Number(finding.path.split('.')[1]);
|
|
226
|
+
const refusedBindingIndexes = new Set(refusedBindings.map(bindingIndexOf));
|
|
227
|
+
const firstFindingPerBinding = refusedBindings.filter((finding, position) => refusedBindings.findIndex((other) => bindingIndexOf(other) === bindingIndexOf(finding)) === position);
|
|
228
|
+
const removed = [...refusedNeeds, ...firstFindingPerBinding];
|
|
229
|
+
if (removed.length === 0)
|
|
230
|
+
return { plan, removed };
|
|
231
|
+
return {
|
|
232
|
+
plan: {
|
|
233
|
+
...withKeptNeeds,
|
|
234
|
+
providerBindings: plan.providerBindings.filter((_binding, index) => !refusedBindingIndexes.has(index)),
|
|
235
|
+
},
|
|
236
|
+
removed,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
63
239
|
//# sourceMappingURL=integration-plan-validation.js.map
|