@wildo-ai/dev-companion 1.1.1 → 1.1.2
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/.tsbuildinfo +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +12 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +11 -0
- package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +153 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +419 -41
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.d.ts +25 -10
- package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.js +65 -24
- package/dist/esm/claude-cli/services/research-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts +86 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts.map +1 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js +127 -0
- package/dist/esm/claude-cli/services/research-evidence-store.companion.js.map +1 -0
- package/dist/esm/companion-api/companion-api.schemas.d.ts +59 -2
- package/dist/esm/companion-api/companion-api.schemas.d.ts.map +1 -1
- package/dist/esm/companion-api/companion-api.schemas.js +60 -0
- package/dist/esm/companion-api/companion-api.schemas.js.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts +63 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +322 -21
- package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
- package/dist/esm/core/inject/models/container.d.ts.map +1 -1
- package/dist/esm/core/inject/models/container.js +11 -0
- package/dist/esm/core/inject/models/container.js.map +1 -1
- package/dist/esm/core/inject/models/service-types.d.ts +5 -0
- package/dist/esm/core/inject/models/service-types.d.ts.map +1 -1
- package/dist/esm/core/inject/models/service-types.js +5 -0
- package/dist/esm/core/inject/models/service-types.js.map +1 -1
- package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.d.ts.map +1 -1
- package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.js +81 -0
- package/dist/esm/core/introspection/behaviors/companion-introspection-behavior-definitions.js.map +1 -1
- package/dist/esm/core/introspection/models/companion-introspection.models.d.ts +11 -1
- package/dist/esm/core/introspection/models/companion-introspection.models.d.ts.map +1 -1
- package/dist/esm/core/introspection/models/companion-introspection.models.js +39 -0
- package/dist/esm/core/introspection/models/companion-introspection.models.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts +8 -0
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js +317 -0
- package/dist/esm/core/introspection/resources/creation-plane-dispatch.custom-impl.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts +45 -0
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js +250 -0
- package/dist/esm/core/introspection/resources/creation-plane-projection.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.d.ts +123 -0
- package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.js +298 -0
- package/dist/esm/core/introspection/resources/introspection-resource-notifier.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.d.ts +78 -1
- package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.js +155 -6
- package/dist/esm/core/introspection/resources/introspection-resource-source.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts +131 -2
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.js +259 -9
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts +243 -0
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js +417 -0
- package/dist/esm/core/introspection/services/introspection-derivation-state.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts +186 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js +368 -0
- package/dist/esm/core/introspection/services/introspection-source-state.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.d.ts +101 -0
- package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.js +278 -0
- package/dist/esm/core/introspection/services/introspection-source-watcher.companion.service.js.map +1 -0
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts +365 -0
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.d.ts.map +1 -0
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.js +167 -0
- package/dist/esm/core/introspection/subprocess/application-domain-model.behavior.js.map +1 -0
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js +332 -3
- package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts +19 -0
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.d.ts.map +1 -0
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js +164 -0
- package/dist/esm/core/introspection/subprocess/family-aspects.behavior.js.map +1 -0
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts +3 -1
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.d.ts.map +1 -1
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.js +36 -23
- package/dist/esm/core/introspection/subprocess/openapi-generation-input.behavior.js.map +1 -1
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts +51 -0
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.d.ts.map +1 -0
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js +391 -0
- package/dist/esm/core/introspection/subprocess/specification-artifacts.behavior.js.map +1 -0
- package/dist/esm/core/runtime/companion-startup-assembly.d.ts.map +1 -1
- package/dist/esm/core/runtime/companion-startup-assembly.js +5 -0
- package/dist/esm/core/runtime/companion-startup-assembly.js.map +1 -1
- package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts +103 -0
- package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts.map +1 -0
- package/dist/esm/core/runtime/dev-compile-quiet.companion.js +124 -0
- package/dist/esm/core/runtime/dev-compile-quiet.companion.js.map +1 -0
- package/dist/esm/core/runtime/services/start-companion-application.service.d.ts +39 -2
- package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
- package/dist/esm/core/runtime/services/start-companion-application.service.js +122 -11
- package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
- package/dist/esm/core/specifications/non-composite-view-specification-context.shared.d.ts +6 -0
- package/dist/esm/core/specifications/non-composite-view-specification-context.shared.d.ts.map +1 -1
- package/dist/esm/core/specifications/non-composite-view-specification-context.shared.js.map +1 -1
- package/dist/esm/core/specifications/specification-context-factory.shared.d.ts +23 -0
- package/dist/esm/core/specifications/specification-context-factory.shared.d.ts.map +1 -1
- package/dist/esm/core/specifications/specification-context-factory.shared.js +26 -4
- package/dist/esm/core/specifications/specification-context-factory.shared.js.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.d.ts +82 -3
- package/dist/esm/executions/services/companion-executions.companion.service.d.ts.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.js +126 -12
- package/dist/esm/executions/services/companion-executions.companion.service.js.map +1 -1
- package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.d.ts +12 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.d.ts.map +1 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.js +12 -0
- package/dist/esm/i18n/components/APP_LAYOUTS_MAIN_CONTAINER.en.js.map +1 -0
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.d.ts +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.js +1 -1
- package/dist/esm/i18n/components/LOW_LEVEL_FORM_FIELD.en.js.map +1 -1
- package/dist/esm/i18n/composite_views/app.creation-board.en.d.ts +13 -0
- package/dist/esm/i18n/composite_views/app.creation-board.en.d.ts.map +1 -0
- package/dist/esm/i18n/composite_views/app.creation-board.en.js +91 -0
- package/dist/esm/i18n/composite_views/app.creation-board.en.js.map +1 -0
- package/dist/esm/i18n/composite_views/app.domain-model.en.d.ts +38 -0
- package/dist/esm/i18n/composite_views/app.domain-model.en.d.ts.map +1 -0
- package/dist/esm/i18n/composite_views/app.domain-model.en.js +41 -0
- package/dist/esm/i18n/composite_views/app.domain-model.en.js.map +1 -0
- package/dist/esm/i18n/index.d.ts +3 -3
- package/dist/esm/i18n/index.js +3 -3
- package/dist/esm/i18n/index.js.map +1 -1
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.d.ts +24 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.js +20 -0
- package/dist/esm/i18n/resources/wildoApplicationActorSystemExecutions.en.js.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.d.ts +31 -0
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.js +27 -0
- package/dist/esm/i18n/resources/wildoApplicationActorTasks.en.js.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.d.ts +24 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.js +20 -0
- package/dist/esm/i18n/resources/wildoApplicationFlowSystemExecutions.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts +28 -0
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js +24 -0
- package/dist/esm/i18n/resources/workbenchBuildPlanTasks.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchDomainResources.en.d.ts +138 -0
- package/dist/esm/i18n/resources/workbenchDomainResources.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchDomainResources.en.js +100 -0
- package/dist/esm/i18n/resources/workbenchDomainResources.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchPlaybooks.en.d.ts +29 -0
- package/dist/esm/i18n/resources/workbenchPlaybooks.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchPlaybooks.en.js +25 -0
- package/dist/esm/i18n/resources/workbenchPlaybooks.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.d.ts +27 -0
- package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.js +23 -0
- package/dist/esm/i18n/resources/workbenchRunWriteRecords.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +806 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +326 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -0
- package/dist/esm/i18n/resources/workbenchTraceSessions.en.d.ts +26 -0
- package/dist/esm/i18n/resources/workbenchTraceSessions.en.d.ts.map +1 -0
- package/dist/esm/i18n/resources/workbenchTraceSessions.en.js +22 -0
- package/dist/esm/i18n/resources/workbenchTraceSessions.en.js.map +1 -0
- package/dist/esm/i18n/system_enums/market.en.d.ts +202 -0
- package/dist/esm/i18n/system_enums/market.en.d.ts.map +1 -0
- package/dist/esm/i18n/system_enums/market.en.js +209 -0
- package/dist/esm/i18n/system_enums/market.en.js.map +1 -0
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts +112 -2
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js +201 -34
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js.map +1 -1
- package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.d.ts +31 -3
- package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.js +48 -12
- package/dist/esm/meta-workflows/models/application-research-agent.actors-system.definitions.js.map +1 -1
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.d.ts +36 -0
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.d.ts.map +1 -0
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js +75 -0
- package/dist/esm/meta-workflows/models/brief-adequacy.actors-system.definitions.js.map +1 -0
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +105 -7
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +298 -24
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +46 -3
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js +95 -2
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.d.ts +9 -0
- package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.js +13 -0
- package/dist/esm/meta-workflows/services/execution-trace-read.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts +12 -0
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js +23 -0
- package/dist/esm/meta-workflows/services/playbook-run-write-register.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +120 -3
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +636 -81
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.d.ts +40 -0
- package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.js +63 -1
- package/dist/esm/meta-workflows/services/playbook-suspended-run.companion.service.js.map +1 -1
- package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts +21 -0
- package/dist/esm/technical-doc/services/technical-doc.companion.service.d.ts.map +1 -1
- package/dist/esm/technical-doc/services/technical-doc.companion.service.js +86 -2
- package/dist/esm/technical-doc/services/technical-doc.companion.service.js.map +1 -1
- package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts +12 -1
- package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.d.ts.map +1 -1
- package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js +47 -1
- package/dist/esm/technical-doc/services/technical-documentation-application-derivation.companion.service.js.map +1 -1
- package/package.json +17 -17
- package/dist/esm/.builder.pid +0 -9
- package/dist/esm/i18n/resources/workbenchApplicationModules.en.d.ts +0 -36
- package/dist/esm/i18n/resources/workbenchApplicationModules.en.d.ts.map +0 -1
- package/dist/esm/i18n/resources/workbenchApplicationModules.en.js +0 -32
- package/dist/esm/i18n/resources/workbenchApplicationModules.en.js.map +0 -1
- package/dist/esm/i18n/resources/workbenchResourceRelationships.en.d.ts +0 -29
- package/dist/esm/i18n/resources/workbenchResourceRelationships.en.d.ts.map +0 -1
- package/dist/esm/i18n/resources/workbenchResourceRelationships.en.js +0 -25
- package/dist/esm/i18n/resources/workbenchResourceRelationships.en.js.map +0 -1
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS, getFamilyPackageRelativePath, renderSpecificationFamilyReviewDocument, } from '@wildo-ai/application-creation-runtime';
|
|
4
|
+
import { getFrameworkKnowledgePlaybook, listFrameworkKnowledgePlaybooks } from '@wildo-ai/framework-knowledge';
|
|
5
|
+
import { WorkbenchSpecificationArtifactConcern, WorkbenchSpecificationArtifactState, } from '@wildo-ai/platform-core-shared';
|
|
6
|
+
import { JourneyArtifactValidationState } from '@wildo-ai/saas-specifications/application-creation';
|
|
7
|
+
import { resolveSpecificationsCompanionExports } from './companion-introspection-module-exports.utils.js';
|
|
8
|
+
/**
|
|
9
|
+
* The operator-facing projection of the application's specification families (issue #162).
|
|
10
|
+
*
|
|
11
|
+
* ## What was missing, and what was already there
|
|
12
|
+
*
|
|
13
|
+
* Nine companion behaviors already READ this content — `market-context-for-icp`,
|
|
14
|
+
* `market-render-prompt`, `brand-render-prompt`, `compliance-primary-facts`,
|
|
15
|
+
* `definition-specifications`, `specification-context-parts` and their siblings — and every one of
|
|
16
|
+
* them renders PROSE FOR A LANGUAGE MODEL. The loading and resolution paths were proven; what did
|
|
17
|
+
* not exist was a projection whose consumer is a human. So a creator could not review, compare or
|
|
18
|
+
* revise anything the journey had decided about their product without opening TypeScript files in an
|
|
19
|
+
* editor.
|
|
20
|
+
*
|
|
21
|
+
* Reusing one of those renderers to fill a UI would ship an LLM context block into a human surface.
|
|
22
|
+
* This behavior therefore renders through `renderSpecificationFamilyReviewDocument`, whose only
|
|
23
|
+
* reader is a person.
|
|
24
|
+
*
|
|
25
|
+
* ## Why it REPORTS where `definition-specifications` REFUSES
|
|
26
|
+
*
|
|
27
|
+
* That behavior runs the same validators through the same authority and THROWS on any ERROR-severity
|
|
28
|
+
* issue — correct for a durable load-time guard, and exactly wrong for a review surface: it would
|
|
29
|
+
* make an invalid artifact the one thing a reviewer cannot look at, precisely when they most need to
|
|
30
|
+
* see it. The two cannot disagree about what is VALID, because the validator is the same object; they
|
|
31
|
+
* differ only in what to do about an invalid answer.
|
|
32
|
+
*
|
|
33
|
+
* ## Pure, deterministic, and read-only by construction
|
|
34
|
+
*
|
|
35
|
+
* Reads the authored snapshots off the specifications companion exports, the two committed markdown
|
|
36
|
+
* records beside each family, and the compiled playbook catalog. No LLM, no network, no write, and no
|
|
37
|
+
* state: acceptance of a specification is a human git commit (`.claude/rules/one-source-of-truth.md`
|
|
38
|
+
* rule 2), so there is nowhere here for an acceptance state to accumulate.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* The family's name in a creator's words.
|
|
42
|
+
*
|
|
43
|
+
* Authored rather than derived from the family slug, because the two genuinely diverge in the
|
|
44
|
+
* direction that matters: `vision-brief` names a product VISION, `business-model` a pricing and
|
|
45
|
+
* revenue model, `compliance-program` an assurance PROGRAMME. Humanizing the slug would produce
|
|
46
|
+
* "Vision brief" and "Compliance program" — accurate about the id, and a worse answer to "what am I
|
|
47
|
+
* looking at" than the words the domain already uses.
|
|
48
|
+
*
|
|
49
|
+
* A family with no entry falls back to its slug rather than being dropped; see
|
|
50
|
+
* {@link classifyFamily}.
|
|
51
|
+
*/
|
|
52
|
+
const FAMILY_TITLES = {
|
|
53
|
+
'vision-brief': 'Vision',
|
|
54
|
+
'market-snapshot': 'Market',
|
|
55
|
+
requirements: 'Requirements',
|
|
56
|
+
'feature-drafts': 'Feature drafts',
|
|
57
|
+
'business-model': 'Business model',
|
|
58
|
+
roadmap: 'Roadmap',
|
|
59
|
+
'domain-plan': 'Domain plan',
|
|
60
|
+
'build-plan': 'Build plan',
|
|
61
|
+
'placement-plan': 'Placement plan',
|
|
62
|
+
'brand-brief': 'Brand',
|
|
63
|
+
'compliance-program': 'Assurance programme',
|
|
64
|
+
'compliance-document-candidate': 'Governed-document drafts',
|
|
65
|
+
'document-publication': 'Document publication',
|
|
66
|
+
'document-release-policy': 'Document release policy',
|
|
67
|
+
'document-facts': 'Document facts',
|
|
68
|
+
'document-facts-authored': 'Document facts you decide',
|
|
69
|
+
'processor-register': 'Who else processes your data',
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* What each family IS, in one sentence a creator recognizes — the summary card's subtitle.
|
|
73
|
+
*
|
|
74
|
+
* Static and present whether or not anything landed: on a NOT_LANDED card this sentence is the
|
|
75
|
+
* whole answer to "why would I care", and on a landed one it frames the pulse beside it. Authored
|
|
76
|
+
* in the creator's vocabulary, not the framework's — "the files this product must publish", never
|
|
77
|
+
* "the governed-document candidate family".
|
|
78
|
+
*/
|
|
79
|
+
const FAMILY_DESCRIPTIONS = {
|
|
80
|
+
'vision-brief': 'The founding intent — the idea, the problem it answers, and what success looks like.',
|
|
81
|
+
'market-snapshot': 'Who this product is for and how it is positioned — category, ICPs, personas, messaging.',
|
|
82
|
+
requirements: 'What the product must do, functionally and non-functionally, with acceptance criteria.',
|
|
83
|
+
'feature-drafts': 'Accepted feature intent — spec-first drafts awaiting their runtime definitions.',
|
|
84
|
+
'business-model': 'How the product earns — the revenue model and its pricing plans.',
|
|
85
|
+
roadmap: 'The build order — phases, their objectives, and what each one delivers.',
|
|
86
|
+
'domain-plan': 'The domain model as planned — modules, their purposes, and the relationships between resources.',
|
|
87
|
+
'build-plan': 'The task graph the coding lane executes — objectives, targets and prerequisites.',
|
|
88
|
+
'placement-plan': 'Where every destination sits in the application shell, and why.',
|
|
89
|
+
'brand-brief': 'How the product presents itself — name, logo direction and visual tone.',
|
|
90
|
+
'compliance-program': 'The controls this product commits to, and the authorities they answer.',
|
|
91
|
+
'compliance-document-candidate': 'Drafts of the public governed documents this product must publish.',
|
|
92
|
+
'document-publication': 'Which locales and jurisdictions each governed document publishes in.',
|
|
93
|
+
'document-release-policy': 'How each required document may be released — draft, attested, or reviewed.',
|
|
94
|
+
'document-facts': 'The accepted raw facts governed documents are built from.',
|
|
95
|
+
'document-facts-authored': 'The facts nobody can derive for you — the ones you decide or have reviewed.',
|
|
96
|
+
'processor-register': 'Every vendor that handles your users\' personal data, who they legally are, and where.',
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Which question each family answers — the axis the workbench groups its list by.
|
|
100
|
+
*
|
|
101
|
+
* Lives HERE, beside the authority it must stay exhaustive over, rather than beside the enum in
|
|
102
|
+
* `platform-core-shared`: that package cannot reach `@wildo-ai/application-creation-runtime`, so a
|
|
103
|
+
* map declared there could never be checked against the population it classifies. A companion test
|
|
104
|
+
* asserts every authority family has an entry, which is the only place both are in scope.
|
|
105
|
+
*/
|
|
106
|
+
const FAMILY_CONCERNS = {
|
|
107
|
+
'vision-brief': WorkbenchSpecificationArtifactConcern.INTENT,
|
|
108
|
+
'market-snapshot': WorkbenchSpecificationArtifactConcern.INTENT,
|
|
109
|
+
requirements: WorkbenchSpecificationArtifactConcern.SCOPE,
|
|
110
|
+
'feature-drafts': WorkbenchSpecificationArtifactConcern.SCOPE,
|
|
111
|
+
'business-model': WorkbenchSpecificationArtifactConcern.SCOPE,
|
|
112
|
+
roadmap: WorkbenchSpecificationArtifactConcern.DELIVERY,
|
|
113
|
+
/*
|
|
114
|
+
* `domain-plan` and `build-plan` are INCLUDED even though issues #160 and #163 build richer
|
|
115
|
+
* surfaces for them (a graph, a board). They are the same KIND of artifact as their neighbours —
|
|
116
|
+
* a landed, validated, reviewable family — and excluding them would mean hand-maintaining a
|
|
117
|
+
* subtraction from the authority's population, which is the list-that-restates-a-list shape that
|
|
118
|
+
* rots. The graph and the board are additional views of two families, not replacements for
|
|
119
|
+
* reading them.
|
|
120
|
+
*/
|
|
121
|
+
'domain-plan': WorkbenchSpecificationArtifactConcern.DELIVERY,
|
|
122
|
+
'build-plan': WorkbenchSpecificationArtifactConcern.DELIVERY,
|
|
123
|
+
'placement-plan': WorkbenchSpecificationArtifactConcern.DELIVERY,
|
|
124
|
+
'brand-brief': WorkbenchSpecificationArtifactConcern.IDENTITY,
|
|
125
|
+
'compliance-program': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,
|
|
126
|
+
'compliance-document-candidate': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,
|
|
127
|
+
'document-publication': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,
|
|
128
|
+
'document-release-policy': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,
|
|
129
|
+
'document-facts': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,
|
|
130
|
+
'document-facts-authored': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,
|
|
131
|
+
'processor-register': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,
|
|
132
|
+
};
|
|
133
|
+
/** The companion records a landing writes beside a family's own `index.ts`. */
|
|
134
|
+
const DECISION_RECORD_FILE_NAME = 'DECISIONS.md';
|
|
135
|
+
const DIAGRAM_FILE_NAME = 'DIAGRAM.md';
|
|
136
|
+
function classifyFamily(family) {
|
|
137
|
+
return FAMILY_CONCERNS[family] ?? WorkbenchSpecificationArtifactConcern.UNCLASSIFIED;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Every playbook whose declared `outputs[].family` is `family`.
|
|
141
|
+
*
|
|
142
|
+
* The durable half of "what produced this": a fact about the compiled catalog, carried in git, true
|
|
143
|
+
* whether or not any run's state still exists. A link to the RUN that produced a particular value was
|
|
144
|
+
* deliberately not built — runs, traces and the write register are a per-run cache under
|
|
145
|
+
* `one-source-of-truth.md` rule 5, so a durable artifact pointing into deletable state is dangling by
|
|
146
|
+
* design. The link runs the other way: a run may name what it wrote.
|
|
147
|
+
*
|
|
148
|
+
* Built ONCE per derivation rather than per family: the catalog read is the same 21 files either way,
|
|
149
|
+
* and looping it fifteen times would multiply the only file I/O in this behavior by fifteen.
|
|
150
|
+
*/
|
|
151
|
+
function buildPlaybookRefsByFamily() {
|
|
152
|
+
const byFamily = new Map();
|
|
153
|
+
for (const entry of listFrameworkKnowledgePlaybooks()) {
|
|
154
|
+
const hydrated = getFrameworkKnowledgePlaybook(entry.ref);
|
|
155
|
+
const outputs = hydrated?.playbook?.outputs ?? [];
|
|
156
|
+
for (const output of outputs) {
|
|
157
|
+
if (typeof output?.family !== 'string' || output.family.length === 0)
|
|
158
|
+
continue;
|
|
159
|
+
const refs = byFamily.get(output.family) ?? [];
|
|
160
|
+
if (!refs.includes(entry.ref))
|
|
161
|
+
refs.push(entry.ref);
|
|
162
|
+
byFamily.set(output.family, refs);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return byFamily;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Read a markdown record committed beside a family, or `null`.
|
|
169
|
+
*
|
|
170
|
+
* `null` for an absent file is a FACT with a precise meaning, and the two files mean different things
|
|
171
|
+
* by their absence: no `DIAGRAM.md` means this family has no diagram renderer, while no
|
|
172
|
+
* `DECISIONS.md` means the run that produced it asked the creator nothing — never that no
|
|
173
|
+
* clarification happened. The row's JSDoc carries that distinction to the reader; here both are just
|
|
174
|
+
* a missing file.
|
|
175
|
+
*/
|
|
176
|
+
function readCommittedRecord(packageRoot, familyRelativePath, fileName) {
|
|
177
|
+
const path = join(packageRoot, dirname(familyRelativePath), fileName);
|
|
178
|
+
if (!existsSync(path))
|
|
179
|
+
return null;
|
|
180
|
+
try {
|
|
181
|
+
const content = readFileSync(path, 'utf8').trim();
|
|
182
|
+
return content.length > 0 ? content : null;
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
/*
|
|
186
|
+
* A record that cannot be READ is reported as absent rather than failing the derivation. It is
|
|
187
|
+
* supporting provenance beside the artifact, not the artifact — refusing the whole page because
|
|
188
|
+
* one sibling file is unreadable would deny a reviewer the fifteen rows that are fine.
|
|
189
|
+
*/
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* The validator's findings, rendered for a reader.
|
|
195
|
+
*
|
|
196
|
+
* Errors before warnings, because the two are different instructions: an error says this artifact no
|
|
197
|
+
* longer satisfies its own contract, a warning says its authoring has drifted. Only the counts reach
|
|
198
|
+
* the list; this is what a reviewer opens the row to read.
|
|
199
|
+
*/
|
|
200
|
+
function renderIssues(errorDetails, warnCount) {
|
|
201
|
+
if (errorDetails.length === 0 && warnCount === 0)
|
|
202
|
+
return null;
|
|
203
|
+
const lines = [];
|
|
204
|
+
if (errorDetails.length > 0) {
|
|
205
|
+
lines.push(`**${errorDetails.length} error${errorDetails.length === 1 ? '' : 's'}** — the artifact does not satisfy its own contract.`, '');
|
|
206
|
+
for (const detail of errorDetails)
|
|
207
|
+
lines.push(`- ${detail}`);
|
|
208
|
+
lines.push('');
|
|
209
|
+
}
|
|
210
|
+
if (warnCount > 0) {
|
|
211
|
+
lines.push(`**${warnCount} warning${warnCount === 1 ? '' : 's'}** — authoring drift the validator reports without invalidating the artifact.`, '', 'Warning detail is not carried here: the family validators return warnings alongside errors and', 'only the errors are projected as text today. Open the file to read them.');
|
|
212
|
+
}
|
|
213
|
+
return lines.join('\n').trim();
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* One line saying HOW MUCH landed — counts and the artifact's own headline, never truncated prose.
|
|
217
|
+
*
|
|
218
|
+
* Read with plain optional access over the RAW value rather than through the family schemas: the
|
|
219
|
+
* pulse must survive an INVALID artifact (which the projection deliberately still serves), and a
|
|
220
|
+
* reader shown "3 ICPs" beside a red badge knows more than one shown nothing. A family this
|
|
221
|
+
* function does not know yields `null`, and the card simply carries no pulse — absence is honest
|
|
222
|
+
* for a sixteenth family until its line is written.
|
|
223
|
+
*/
|
|
224
|
+
function deriveContentPulse(family, snapshot) {
|
|
225
|
+
const count = (key) => (Array.isArray(snapshot[key]) ? snapshot[key].length : 0);
|
|
226
|
+
const text = (path) => {
|
|
227
|
+
let value = snapshot;
|
|
228
|
+
for (const key of path) {
|
|
229
|
+
if (!value || typeof value !== 'object')
|
|
230
|
+
return null;
|
|
231
|
+
value = value[key];
|
|
232
|
+
}
|
|
233
|
+
return typeof value === 'string' && value.trim().length > 0 ? value.trim() : null;
|
|
234
|
+
};
|
|
235
|
+
/*
|
|
236
|
+
* Each entry names its SINGULAR; the plural defaults to `+s` and is spelled out where English
|
|
237
|
+
* disagrees. "1 ICPs" on a live card is what bought this parameter.
|
|
238
|
+
*/
|
|
239
|
+
const parts = (entries) => {
|
|
240
|
+
const present = entries
|
|
241
|
+
.filter(([n]) => n > 0)
|
|
242
|
+
.map(([n, singular, plural]) => `${n} ${n === 1 ? singular : plural ?? `${singular}s`}`);
|
|
243
|
+
return present.length > 0 ? present.join(' · ') : null;
|
|
244
|
+
};
|
|
245
|
+
switch (family) {
|
|
246
|
+
case 'vision-brief':
|
|
247
|
+
return text(['idea', 'oneLiner']);
|
|
248
|
+
case 'market-snapshot':
|
|
249
|
+
return parts([[count('icps'), 'ICP'], [count('personas'), 'persona'], [count('positionings'), 'positioning'], [count('tonesOfVoice'), 'tone of voice', 'tones of voice']]);
|
|
250
|
+
case 'requirements':
|
|
251
|
+
return parts([[count('functional'), 'functional', 'functional'], [count('nonFunctional'), 'non-functional', 'non-functional']]);
|
|
252
|
+
case 'feature-drafts':
|
|
253
|
+
return parts([[count('drafts'), 'feature draft']]);
|
|
254
|
+
case 'business-model': {
|
|
255
|
+
const model = typeof snapshot.revenueModel === 'string' ? snapshot.revenueModel.toLowerCase().replace(/_/g, ' ') : null;
|
|
256
|
+
const plans = parts([[count('plans'), 'plan']]);
|
|
257
|
+
return model && plans ? `${model} · ${plans}` : model ?? plans;
|
|
258
|
+
}
|
|
259
|
+
case 'roadmap':
|
|
260
|
+
return parts([[count('phases'), 'phase']]);
|
|
261
|
+
case 'domain-plan':
|
|
262
|
+
return parts([[count('modules'), 'module'], [count('relationships'), 'relationship']]);
|
|
263
|
+
case 'build-plan':
|
|
264
|
+
return parts([[count('tasks'), 'task']]);
|
|
265
|
+
case 'placement-plan':
|
|
266
|
+
return parts([[count('groups'), 'group'], [count('decisions'), 'decision']]);
|
|
267
|
+
case 'brand-brief': {
|
|
268
|
+
const name = text(['name', 'brandName']);
|
|
269
|
+
const tagline = text(['name', 'tagline']);
|
|
270
|
+
return name ? (tagline ? `${name} — ${tagline}` : name) : null;
|
|
271
|
+
}
|
|
272
|
+
case 'compliance-program':
|
|
273
|
+
return parts([[count('roleAuthorities'), 'role authority', 'role authorities'], [count('capabilityAuthorities'), 'capability authority', 'capability authorities'], [count('implementationStatements'), 'implementation statement']]);
|
|
274
|
+
case 'compliance-document-candidate': {
|
|
275
|
+
const title = text(['title']);
|
|
276
|
+
const sections = parts([[count('sections'), 'section']]);
|
|
277
|
+
return title ? (sections ? `${title} · ${sections}` : title) : sections;
|
|
278
|
+
}
|
|
279
|
+
case 'document-publication':
|
|
280
|
+
return parts([[count('variants'), 'publication variant']]);
|
|
281
|
+
case 'document-release-policy':
|
|
282
|
+
return parts([[count('selections'), 'selection']]);
|
|
283
|
+
case 'document-facts':
|
|
284
|
+
case 'document-facts-authored':
|
|
285
|
+
return parts([[count('declarations'), 'declaration']]);
|
|
286
|
+
case 'processor-register':
|
|
287
|
+
return parts([[count('processors'), 'processor']]);
|
|
288
|
+
default:
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function projectFamily(input) {
|
|
293
|
+
const { binding, snapshot, packageRoot, appRelativePackagePrefix, playbookRefsByFamily } = input;
|
|
294
|
+
const familyRelativePath = getFamilyPackageRelativePath(binding.family);
|
|
295
|
+
const title = FAMILY_TITLES[binding.family] ?? binding.family;
|
|
296
|
+
const base = {
|
|
297
|
+
family: binding.family,
|
|
298
|
+
title,
|
|
299
|
+
/*
|
|
300
|
+
* The slug fallback keeps a sixteenth family SERVABLE before its sentence is authored — and the
|
|
301
|
+
* coverage pin beside the titles test is what turns that fallback into a red test naming the
|
|
302
|
+
* family, so it never quietly ships as a subtitle.
|
|
303
|
+
*/
|
|
304
|
+
description: FAMILY_DESCRIPTIONS[binding.family] ?? binding.family,
|
|
305
|
+
concern: classifyFamily(binding.family),
|
|
306
|
+
schemaRef: binding.schemaRef,
|
|
307
|
+
sourcePath: familyRelativePath ? `${appRelativePackagePrefix}/${familyRelativePath}` : null,
|
|
308
|
+
producedByPlaybookRefs: [...(playbookRefsByFamily.get(binding.family) ?? [])],
|
|
309
|
+
};
|
|
310
|
+
if (snapshot === undefined || snapshot === null) {
|
|
311
|
+
return {
|
|
312
|
+
...base,
|
|
313
|
+
state: WorkbenchSpecificationArtifactState.NOT_LANDED,
|
|
314
|
+
errorCount: 0,
|
|
315
|
+
warnCount: 0,
|
|
316
|
+
contentSummary: null,
|
|
317
|
+
content: null,
|
|
318
|
+
document: null,
|
|
319
|
+
issues: null,
|
|
320
|
+
decisionRecord: null,
|
|
321
|
+
diagram: null,
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
const validation = binding.validate(snapshot);
|
|
325
|
+
return {
|
|
326
|
+
...base,
|
|
327
|
+
state: validation.validation === JourneyArtifactValidationState.VALID
|
|
328
|
+
? WorkbenchSpecificationArtifactState.LANDED_VALID
|
|
329
|
+
: WorkbenchSpecificationArtifactState.LANDED_INVALID,
|
|
330
|
+
errorCount: validation.errorCount,
|
|
331
|
+
warnCount: validation.warnCount,
|
|
332
|
+
contentSummary: typeof snapshot === 'object' && !Array.isArray(snapshot)
|
|
333
|
+
? deriveContentPulse(binding.family, snapshot)
|
|
334
|
+
: null,
|
|
335
|
+
/*
|
|
336
|
+
* Both carried from the RAW snapshot, not from the validator's parsed output. The validator
|
|
337
|
+
* parses with the family schema, whose `.default()` members would inject values the author never
|
|
338
|
+
* wrote — a reviewer would then be shown, and could accept, content nobody authored. Mutation-
|
|
339
|
+
* proven on the `document` half (parsed-value render reddens the raw-value pin); `content`
|
|
340
|
+
* follows the same rule for the same reason.
|
|
341
|
+
*
|
|
342
|
+
* Every family binding's `snapshotSchema` is an object, so a landed snapshot is one; anything
|
|
343
|
+
* else is reported rather than smuggled through as a non-object the row schema would refuse.
|
|
344
|
+
*/
|
|
345
|
+
content: typeof snapshot === 'object' && !Array.isArray(snapshot) ? snapshot : null,
|
|
346
|
+
document: renderSpecificationFamilyReviewDocument({ title, value: snapshot }),
|
|
347
|
+
issues: renderIssues(validation.errorDetails, validation.warnCount),
|
|
348
|
+
decisionRecord: familyRelativePath
|
|
349
|
+
? readCommittedRecord(packageRoot, familyRelativePath, DECISION_RECORD_FILE_NAME)
|
|
350
|
+
: null,
|
|
351
|
+
diagram: familyRelativePath
|
|
352
|
+
? readCommittedRecord(packageRoot, familyRelativePath, DIAGRAM_FILE_NAME)
|
|
353
|
+
: null,
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Project every application-specification family for a human reviewer.
|
|
358
|
+
*
|
|
359
|
+
* `packageRoot` is the specifications package's absolute root, and `appRelativePackagePrefix` its
|
|
360
|
+
* directory name relative to the application — so a row can name a path a reader recognizes
|
|
361
|
+
* (`specifications/src/vision/index.ts`) rather than one that only makes sense inside the package.
|
|
362
|
+
*/
|
|
363
|
+
export function projectSpecificationArtifacts(input) {
|
|
364
|
+
const companionExports = resolveSpecificationsCompanionExports(input.moduleExports);
|
|
365
|
+
const playbookRefsByFamily = buildPlaybookRefsByFamily();
|
|
366
|
+
const artifacts = APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS.map((binding) => projectFamily({
|
|
367
|
+
binding,
|
|
368
|
+
/*
|
|
369
|
+
* A family with no `companionExportsField` is a DRAFT — it is not accepted application truth
|
|
370
|
+
* and has no slot to read (`compliance-document-candidate`). It is reported as NOT_LANDED
|
|
371
|
+
* rather than skipped, for the same reason absent families are rows at all: an omitted row and
|
|
372
|
+
* a family that does not exist look identical to a reader.
|
|
373
|
+
*/
|
|
374
|
+
snapshot: binding.companionExportsField === undefined
|
|
375
|
+
? undefined
|
|
376
|
+
: companionExports[binding.companionExportsField],
|
|
377
|
+
packageRoot: input.packageRoot,
|
|
378
|
+
appRelativePackagePrefix: input.appRelativePackagePrefix,
|
|
379
|
+
playbookRefsByFamily,
|
|
380
|
+
}));
|
|
381
|
+
return {
|
|
382
|
+
artifacts,
|
|
383
|
+
trace: {
|
|
384
|
+
families: artifacts.length,
|
|
385
|
+
landed: artifacts.filter((artifact) => artifact.state !== WorkbenchSpecificationArtifactState.NOT_LANDED).length,
|
|
386
|
+
invalid: artifacts.filter((artifact) => artifact.state === WorkbenchSpecificationArtifactState.LANDED_INVALID).length,
|
|
387
|
+
evaluatedAt: input.evaluatedAt,
|
|
388
|
+
},
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
//# sourceMappingURL=specification-artifacts.behavior.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specification-artifacts.behavior.js","sourceRoot":"","sources":["../../../../../../src/core/introspection/subprocess/specification-artifacts.behavior.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EACL,kDAAkD,EAClD,4BAA4B,EAC5B,uCAAuC,GAExC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAC/G,OAAO,EACL,qCAAqC,EACrC,mCAAmC,GACpC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AAEpG,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,aAAa,GAAqC;IACtD,cAAc,EAAE,QAAQ;IACxB,iBAAiB,EAAE,QAAQ;IAC3B,YAAY,EAAE,cAAc;IAC5B,gBAAgB,EAAE,gBAAgB;IAClC,gBAAgB,EAAE,gBAAgB;IAClC,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,aAAa;IAC5B,YAAY,EAAE,YAAY;IAC1B,gBAAgB,EAAE,gBAAgB;IAClC,aAAa,EAAE,OAAO;IACtB,oBAAoB,EAAE,qBAAqB;IAC3C,+BAA+B,EAAE,0BAA0B;IAC3D,sBAAsB,EAAE,sBAAsB;IAC9C,yBAAyB,EAAE,yBAAyB;IACpD,gBAAgB,EAAE,gBAAgB;IAClC,yBAAyB,EAAE,2BAA2B;IACtD,oBAAoB,EAAE,8BAA8B;CACrD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,mBAAmB,GAAqC;IAC5D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T,KAAK,EAAE;YACL,QAAQ,EAAE,SAAS,CAAC,MAAM;YAC1B,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,KAAK,mCAAmC,CAAC,UAAU,CAAC,CAAC,MAAM;YAChH,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,KAAK,mCAAmC,CAAC,cAAc,CAAC,CAAC,MAAM;YACrH,WAAW,EAAE,KAAK,CAAC,WAAW;SAC/B;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\n\nimport {\n APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS,\n getFamilyPackageRelativePath,\n renderSpecificationFamilyReviewDocument,\n type ApplicationSpecificationSemanticSchemaBinding,\n} from '@wildo-ai/application-creation-runtime';\nimport { getFrameworkKnowledgePlaybook, listFrameworkKnowledgePlaybooks } from '@wildo-ai/framework-knowledge';\nimport {\n WorkbenchSpecificationArtifactConcern,\n WorkbenchSpecificationArtifactState,\n} from '@wildo-ai/platform-core-shared';\nimport { JourneyArtifactValidationState } from '@wildo-ai/saas-specifications/application-creation';\n\nimport { resolveSpecificationsCompanionExports } from './companion-introspection-module-exports.utils';\n\n/**\n * The operator-facing projection of the application's specification families (issue #162).\n *\n * ## What was missing, and what was already there\n *\n * Nine companion behaviors already READ this content — `market-context-for-icp`,\n * `market-render-prompt`, `brand-render-prompt`, `compliance-primary-facts`,\n * `definition-specifications`, `specification-context-parts` and their siblings — and every one of\n * them renders PROSE FOR A LANGUAGE MODEL. The loading and resolution paths were proven; what did\n * not exist was a projection whose consumer is a human. So a creator could not review, compare or\n * revise anything the journey had decided about their product without opening TypeScript files in an\n * editor.\n *\n * Reusing one of those renderers to fill a UI would ship an LLM context block into a human surface.\n * This behavior therefore renders through `renderSpecificationFamilyReviewDocument`, whose only\n * reader is a person.\n *\n * ## Why it REPORTS where `definition-specifications` REFUSES\n *\n * That behavior runs the same validators through the same authority and THROWS on any ERROR-severity\n * issue — correct for a durable load-time guard, and exactly wrong for a review surface: it would\n * make an invalid artifact the one thing a reviewer cannot look at, precisely when they most need to\n * see it. The two cannot disagree about what is VALID, because the validator is the same object; they\n * differ only in what to do about an invalid answer.\n *\n * ## Pure, deterministic, and read-only by construction\n *\n * Reads the authored snapshots off the specifications companion exports, the two committed markdown\n * records beside each family, and the compiled playbook catalog. No LLM, no network, no write, and no\n * state: acceptance of a specification is a human git commit (`.claude/rules/one-source-of-truth.md`\n * rule 2), so there is nowhere here for an acceptance state to accumulate.\n */\n\n/**\n * The family's name in a creator's words.\n *\n * Authored rather than derived from the family slug, because the two genuinely diverge in the\n * direction that matters: `vision-brief` names a product VISION, `business-model` a pricing and\n * revenue model, `compliance-program` an assurance PROGRAMME. Humanizing the slug would produce\n * \"Vision brief\" and \"Compliance program\" — accurate about the id, and a worse answer to \"what am I\n * looking at\" than the words the domain already uses.\n *\n * A family with no entry falls back to its slug rather than being dropped; see\n * {@link classifyFamily}.\n */\nconst FAMILY_TITLES: Readonly<Record<string, string>> = {\n 'vision-brief': 'Vision',\n 'market-snapshot': 'Market',\n requirements: 'Requirements',\n 'feature-drafts': 'Feature drafts',\n 'business-model': 'Business model',\n roadmap: 'Roadmap',\n 'domain-plan': 'Domain plan',\n 'build-plan': 'Build plan',\n 'placement-plan': 'Placement plan',\n 'brand-brief': 'Brand',\n 'compliance-program': 'Assurance programme',\n 'compliance-document-candidate': 'Governed-document drafts',\n 'document-publication': 'Document publication',\n 'document-release-policy': 'Document release policy',\n 'document-facts': 'Document facts',\n 'document-facts-authored': 'Document facts you decide',\n 'processor-register': 'Who else processes your data',\n};\n\n/**\n * What each family IS, in one sentence a creator recognizes — the summary card's subtitle.\n *\n * Static and present whether or not anything landed: on a NOT_LANDED card this sentence is the\n * whole answer to \"why would I care\", and on a landed one it frames the pulse beside it. Authored\n * in the creator's vocabulary, not the framework's — \"the files this product must publish\", never\n * \"the governed-document candidate family\".\n */\nconst FAMILY_DESCRIPTIONS: Readonly<Record<string, string>> = {\n 'vision-brief': 'The founding intent — the idea, the problem it answers, and what success looks like.',\n 'market-snapshot': 'Who this product is for and how it is positioned — category, ICPs, personas, messaging.',\n requirements: 'What the product must do, functionally and non-functionally, with acceptance criteria.',\n 'feature-drafts': 'Accepted feature intent — spec-first drafts awaiting their runtime definitions.',\n 'business-model': 'How the product earns — the revenue model and its pricing plans.',\n roadmap: 'The build order — phases, their objectives, and what each one delivers.',\n 'domain-plan': 'The domain model as planned — modules, their purposes, and the relationships between resources.',\n 'build-plan': 'The task graph the coding lane executes — objectives, targets and prerequisites.',\n 'placement-plan': 'Where every destination sits in the application shell, and why.',\n 'brand-brief': 'How the product presents itself — name, logo direction and visual tone.',\n 'compliance-program': 'The controls this product commits to, and the authorities they answer.',\n 'compliance-document-candidate': 'Drafts of the public governed documents this product must publish.',\n 'document-publication': 'Which locales and jurisdictions each governed document publishes in.',\n 'document-release-policy': 'How each required document may be released — draft, attested, or reviewed.',\n 'document-facts': 'The accepted raw facts governed documents are built from.',\n 'document-facts-authored': 'The facts nobody can derive for you — the ones you decide or have reviewed.',\n 'processor-register': 'Every vendor that handles your users\\' personal data, who they legally are, and where.',\n};\n\n/**\n * Which question each family answers — the axis the workbench groups its list by.\n *\n * Lives HERE, beside the authority it must stay exhaustive over, rather than beside the enum in\n * `platform-core-shared`: that package cannot reach `@wildo-ai/application-creation-runtime`, so a\n * map declared there could never be checked against the population it classifies. A companion test\n * asserts every authority family has an entry, which is the only place both are in scope.\n */\nconst FAMILY_CONCERNS: Readonly<Record<string, WorkbenchSpecificationArtifactConcern>> = {\n 'vision-brief': WorkbenchSpecificationArtifactConcern.INTENT,\n 'market-snapshot': WorkbenchSpecificationArtifactConcern.INTENT,\n requirements: WorkbenchSpecificationArtifactConcern.SCOPE,\n 'feature-drafts': WorkbenchSpecificationArtifactConcern.SCOPE,\n 'business-model': WorkbenchSpecificationArtifactConcern.SCOPE,\n roadmap: WorkbenchSpecificationArtifactConcern.DELIVERY,\n /*\n * `domain-plan` and `build-plan` are INCLUDED even though issues #160 and #163 build richer\n * surfaces for them (a graph, a board). They are the same KIND of artifact as their neighbours —\n * a landed, validated, reviewable family — and excluding them would mean hand-maintaining a\n * subtraction from the authority's population, which is the list-that-restates-a-list shape that\n * rots. The graph and the board are additional views of two families, not replacements for\n * reading them.\n */\n 'domain-plan': WorkbenchSpecificationArtifactConcern.DELIVERY,\n 'build-plan': WorkbenchSpecificationArtifactConcern.DELIVERY,\n 'placement-plan': WorkbenchSpecificationArtifactConcern.DELIVERY,\n 'brand-brief': WorkbenchSpecificationArtifactConcern.IDENTITY,\n 'compliance-program': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,\n 'compliance-document-candidate': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,\n 'document-publication': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,\n 'document-release-policy': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,\n 'document-facts': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,\n 'document-facts-authored': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,\n 'processor-register': WorkbenchSpecificationArtifactConcern.OBLIGATIONS,\n};\n\n/** The companion records a landing writes beside a family's own `index.ts`. */\nconst DECISION_RECORD_FILE_NAME = 'DECISIONS.md';\nconst DIAGRAM_FILE_NAME = 'DIAGRAM.md';\n\n/** One family row, JSON-safe, matching `Workbench_SpecificationArtifact_Schema`. */\nexport interface SpecificationArtifactRow {\n readonly family: string;\n readonly title: string;\n /** Static per-family subtitle — see {@link FAMILY_DESCRIPTIONS}. */\n readonly description: string;\n /** One-line pulse of the landed content, `null` when nothing landed. See {@link deriveContentPulse}. */\n readonly contentSummary: string | null;\n readonly concern: WorkbenchSpecificationArtifactConcern;\n readonly state: WorkbenchSpecificationArtifactState;\n readonly schemaRef: string;\n readonly sourcePath: string | null;\n readonly errorCount: number;\n readonly warnCount: number;\n readonly producedByPlaybookRefs: string[];\n /**\n * The landed family value, RAW — exactly what the specifications package exports, never the\n * validator's parsed output (whose schema `.default()`s would inject content the author never\n * wrote). The workbench's per-family templates render from this; the markdown `document` beside\n * it is their structural fallback. `null` when the family has not landed.\n */\n readonly content: Record<string, unknown> | null;\n readonly document: string | null;\n readonly issues: string | null;\n readonly decisionRecord: string | null;\n readonly diagram: string | null;\n}\n\nexport interface SpecificationArtifactsResponse {\n readonly artifacts: SpecificationArtifactRow[];\n readonly trace: {\n readonly families: number;\n readonly landed: number;\n readonly invalid: number;\n readonly evaluatedAt: string;\n };\n}\n\nfunction classifyFamily(family: string): WorkbenchSpecificationArtifactConcern {\n return FAMILY_CONCERNS[family] ?? WorkbenchSpecificationArtifactConcern.UNCLASSIFIED;\n}\n\n/**\n * Every playbook whose declared `outputs[].family` is `family`.\n *\n * The durable half of \"what produced this\": a fact about the compiled catalog, carried in git, true\n * whether or not any run's state still exists. A link to the RUN that produced a particular value was\n * deliberately not built — runs, traces and the write register are a per-run cache under\n * `one-source-of-truth.md` rule 5, so a durable artifact pointing into deletable state is dangling by\n * design. The link runs the other way: a run may name what it wrote.\n *\n * Built ONCE per derivation rather than per family: the catalog read is the same 21 files either way,\n * and looping it fifteen times would multiply the only file I/O in this behavior by fifteen.\n */\nfunction buildPlaybookRefsByFamily(): ReadonlyMap<string, string[]> {\n const byFamily = new Map<string, string[]>();\n for (const entry of listFrameworkKnowledgePlaybooks()) {\n const hydrated = getFrameworkKnowledgePlaybook(entry.ref);\n const outputs = (hydrated?.playbook as { outputs?: readonly { family?: unknown }[] } | undefined)?.outputs ?? [];\n for (const output of outputs) {\n if (typeof output?.family !== 'string' || output.family.length === 0) continue;\n const refs = byFamily.get(output.family) ?? [];\n if (!refs.includes(entry.ref)) refs.push(entry.ref);\n byFamily.set(output.family, refs);\n }\n }\n return byFamily;\n}\n\n/**\n * Read a markdown record committed beside a family, or `null`.\n *\n * `null` for an absent file is a FACT with a precise meaning, and the two files mean different things\n * by their absence: no `DIAGRAM.md` means this family has no diagram renderer, while no\n * `DECISIONS.md` means the run that produced it asked the creator nothing — never that no\n * clarification happened. The row's JSDoc carries that distinction to the reader; here both are just\n * a missing file.\n */\nfunction readCommittedRecord(packageRoot: string, familyRelativePath: string, fileName: string): string | null {\n const path = join(packageRoot, dirname(familyRelativePath), fileName);\n if (!existsSync(path)) return null;\n try {\n const content = readFileSync(path, 'utf8').trim();\n return content.length > 0 ? content : null;\n } catch {\n /*\n * A record that cannot be READ is reported as absent rather than failing the derivation. It is\n * supporting provenance beside the artifact, not the artifact — refusing the whole page because\n * one sibling file is unreadable would deny a reviewer the fifteen rows that are fine.\n */\n return null;\n }\n}\n\n/**\n * The validator's findings, rendered for a reader.\n *\n * Errors before warnings, because the two are different instructions: an error says this artifact no\n * longer satisfies its own contract, a warning says its authoring has drifted. Only the counts reach\n * the list; this is what a reviewer opens the row to read.\n */\nfunction renderIssues(errorDetails: readonly string[], warnCount: number): string | null {\n if (errorDetails.length === 0 && warnCount === 0) return null;\n const lines: string[] = [];\n if (errorDetails.length > 0) {\n lines.push(`**${errorDetails.length} error${errorDetails.length === 1 ? '' : 's'}** — the artifact does not satisfy its own contract.`, '');\n for (const detail of errorDetails) lines.push(`- ${detail}`);\n lines.push('');\n }\n if (warnCount > 0) {\n lines.push(\n `**${warnCount} warning${warnCount === 1 ? '' : 's'}** — authoring drift the validator reports without invalidating the artifact.`,\n '',\n 'Warning detail is not carried here: the family validators return warnings alongside errors and',\n 'only the errors are projected as text today. Open the file to read them.',\n );\n }\n return lines.join('\\n').trim();\n}\n\n/**\n * One line saying HOW MUCH landed — counts and the artifact's own headline, never truncated prose.\n *\n * Read with plain optional access over the RAW value rather than through the family schemas: the\n * pulse must survive an INVALID artifact (which the projection deliberately still serves), and a\n * reader shown \"3 ICPs\" beside a red badge knows more than one shown nothing. A family this\n * function does not know yields `null`, and the card simply carries no pulse — absence is honest\n * for a sixteenth family until its line is written.\n */\nfunction deriveContentPulse(family: string, snapshot: Record<string, unknown>): string | null {\n const count = (key: string): number => (Array.isArray(snapshot[key]) ? (snapshot[key] as unknown[]).length : 0);\n const text = (path: readonly string[]): string | null => {\n let value: unknown = snapshot;\n for (const key of path) {\n if (!value || typeof value !== 'object') return null;\n value = (value as Record<string, unknown>)[key];\n }\n return typeof value === 'string' && value.trim().length > 0 ? value.trim() : null;\n };\n /*\n * Each entry names its SINGULAR; the plural defaults to `+s` and is spelled out where English\n * disagrees. \"1 ICPs\" on a live card is what bought this parameter.\n */\n const parts = (entries: ReadonlyArray<readonly [number, string, string?]>): string | null => {\n const present = entries\n .filter(([n]) => n > 0)\n .map(([n, singular, plural]) => `${n} ${n === 1 ? singular : plural ?? `${singular}s`}`);\n return present.length > 0 ? present.join(' · ') : null;\n };\n\n switch (family) {\n case 'vision-brief':\n return text(['idea', 'oneLiner']);\n case 'market-snapshot':\n return parts([[count('icps'), 'ICP'], [count('personas'), 'persona'], [count('positionings'), 'positioning'], [count('tonesOfVoice'), 'tone of voice', 'tones of voice']]);\n case 'requirements':\n return parts([[count('functional'), 'functional', 'functional'], [count('nonFunctional'), 'non-functional', 'non-functional']]);\n case 'feature-drafts':\n return parts([[count('drafts'), 'feature draft']]);\n case 'business-model': {\n const model = typeof snapshot.revenueModel === 'string' ? snapshot.revenueModel.toLowerCase().replace(/_/g, ' ') : null;\n const plans = parts([[count('plans'), 'plan']]);\n return model && plans ? `${model} · ${plans}` : model ?? plans;\n }\n case 'roadmap':\n return parts([[count('phases'), 'phase']]);\n case 'domain-plan':\n return parts([[count('modules'), 'module'], [count('relationships'), 'relationship']]);\n case 'build-plan':\n return parts([[count('tasks'), 'task']]);\n case 'placement-plan':\n return parts([[count('groups'), 'group'], [count('decisions'), 'decision']]);\n case 'brand-brief': {\n const name = text(['name', 'brandName']);\n const tagline = text(['name', 'tagline']);\n return name ? (tagline ? `${name} — ${tagline}` : name) : null;\n }\n case 'compliance-program':\n return parts([[count('roleAuthorities'), 'role authority', 'role authorities'], [count('capabilityAuthorities'), 'capability authority', 'capability authorities'], [count('implementationStatements'), 'implementation statement']]);\n case 'compliance-document-candidate': {\n const title = text(['title']);\n const sections = parts([[count('sections'), 'section']]);\n return title ? (sections ? `${title} · ${sections}` : title) : sections;\n }\n case 'document-publication':\n return parts([[count('variants'), 'publication variant']]);\n case 'document-release-policy':\n return parts([[count('selections'), 'selection']]);\n case 'document-facts':\n case 'document-facts-authored':\n return parts([[count('declarations'), 'declaration']]);\n case 'processor-register':\n return parts([[count('processors'), 'processor']]);\n default:\n return null;\n }\n}\n\nfunction projectFamily(input: {\n readonly binding: ApplicationSpecificationSemanticSchemaBinding;\n readonly snapshot: unknown;\n readonly packageRoot: string;\n readonly appRelativePackagePrefix: string;\n readonly playbookRefsByFamily: ReadonlyMap<string, string[]>;\n}): SpecificationArtifactRow {\n const { binding, snapshot, packageRoot, appRelativePackagePrefix, playbookRefsByFamily } = input;\n const familyRelativePath = getFamilyPackageRelativePath(binding.family);\n const title = FAMILY_TITLES[binding.family] ?? binding.family;\n\n const base = {\n family: binding.family,\n title,\n /*\n * The slug fallback keeps a sixteenth family SERVABLE before its sentence is authored — and the\n * coverage pin beside the titles test is what turns that fallback into a red test naming the\n * family, so it never quietly ships as a subtitle.\n */\n description: FAMILY_DESCRIPTIONS[binding.family] ?? binding.family,\n concern: classifyFamily(binding.family),\n schemaRef: binding.schemaRef,\n sourcePath: familyRelativePath ? `${appRelativePackagePrefix}/${familyRelativePath}` : null,\n producedByPlaybookRefs: [...(playbookRefsByFamily.get(binding.family) ?? [])],\n };\n\n if (snapshot === undefined || snapshot === null) {\n return {\n ...base,\n state: WorkbenchSpecificationArtifactState.NOT_LANDED,\n errorCount: 0,\n warnCount: 0,\n contentSummary: null,\n content: null,\n document: null,\n issues: null,\n decisionRecord: null,\n diagram: null,\n };\n }\n\n const validation = binding.validate(snapshot);\n return {\n ...base,\n state: validation.validation === JourneyArtifactValidationState.VALID\n ? WorkbenchSpecificationArtifactState.LANDED_VALID\n : WorkbenchSpecificationArtifactState.LANDED_INVALID,\n errorCount: validation.errorCount,\n warnCount: validation.warnCount,\n contentSummary: typeof snapshot === 'object' && !Array.isArray(snapshot)\n ? deriveContentPulse(binding.family, snapshot as Record<string, unknown>)\n : null,\n /*\n * Both carried from the RAW snapshot, not from the validator's parsed output. The validator\n * parses with the family schema, whose `.default()` members would inject values the author never\n * wrote — a reviewer would then be shown, and could accept, content nobody authored. Mutation-\n * proven on the `document` half (parsed-value render reddens the raw-value pin); `content`\n * follows the same rule for the same reason.\n *\n * Every family binding's `snapshotSchema` is an object, so a landed snapshot is one; anything\n * else is reported rather than smuggled through as a non-object the row schema would refuse.\n */\n content: typeof snapshot === 'object' && !Array.isArray(snapshot) ? snapshot as Record<string, unknown> : null,\n document: renderSpecificationFamilyReviewDocument({ title, value: snapshot }),\n issues: renderIssues(validation.errorDetails, validation.warnCount),\n decisionRecord: familyRelativePath\n ? readCommittedRecord(packageRoot, familyRelativePath, DECISION_RECORD_FILE_NAME)\n : null,\n diagram: familyRelativePath\n ? readCommittedRecord(packageRoot, familyRelativePath, DIAGRAM_FILE_NAME)\n : null,\n };\n}\n\n/**\n * Project every application-specification family for a human reviewer.\n *\n * `packageRoot` is the specifications package's absolute root, and `appRelativePackagePrefix` its\n * directory name relative to the application — so a row can name a path a reader recognizes\n * (`specifications/src/vision/index.ts`) rather than one that only makes sense inside the package.\n */\nexport function projectSpecificationArtifacts(input: {\n readonly moduleExports: Record<string, unknown>;\n readonly packageRoot: string;\n readonly appRelativePackagePrefix: string;\n readonly evaluatedAt: string;\n}): SpecificationArtifactsResponse {\n const companionExports = resolveSpecificationsCompanionExports(input.moduleExports) as unknown as Record<string, unknown>;\n const playbookRefsByFamily = buildPlaybookRefsByFamily();\n\n const artifacts = APPLICATION_SPECIFICATION_SEMANTIC_SCHEMA_BINDINGS.map((binding) =>\n projectFamily({\n binding,\n /*\n * A family with no `companionExportsField` is a DRAFT — it is not accepted application truth\n * and has no slot to read (`compliance-document-candidate`). It is reported as NOT_LANDED\n * rather than skipped, for the same reason absent families are rows at all: an omitted row and\n * a family that does not exist look identical to a reader.\n */\n snapshot: binding.companionExportsField === undefined\n ? undefined\n : companionExports[binding.companionExportsField],\n packageRoot: input.packageRoot,\n appRelativePackagePrefix: input.appRelativePackagePrefix,\n playbookRefsByFamily,\n }),\n );\n\n return {\n artifacts,\n trace: {\n families: artifacts.length,\n landed: artifacts.filter((artifact) => artifact.state !== WorkbenchSpecificationArtifactState.NOT_LANDED).length,\n invalid: artifacts.filter((artifact) => artifact.state === WorkbenchSpecificationArtifactState.LANDED_INVALID).length,\n evaluatedAt: input.evaluatedAt,\n },\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-startup-assembly.d.ts","sourceRoot":"","sources":["../../../../../src/core/runtime/companion-startup-assembly.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EAI1B,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"companion-startup-assembly.d.ts","sourceRoot":"","sources":["../../../../../src/core/runtime/companion-startup-assembly.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EAI1B,MAAM,4BAA4B,CAAC;AAyBpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAE7F;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC;IACjE,QAAQ,CAAC,aAAa,EAAE,sBAAsB,CAAC;CAChD;AA6DD;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,sBAAsB,GACpC,OAAO,CAAC,yBAAyB,CAAC,CA8GpC"}
|
|
@@ -9,6 +9,7 @@ import { buildLabellingActorSystemDefinitions } from '../../i18n-labelling/model
|
|
|
9
9
|
import { buildMetaWorkflowsActorSystemDefinitions } from '../../meta-workflows/models/meta-workflows.actors-system.definitions.js';
|
|
10
10
|
import { applicationCodingAgents } from '../../meta-workflows/models/application-coding-agent.actors-system.definitions.js';
|
|
11
11
|
import { applicationResearchAgents } from '../../meta-workflows/models/application-research-agent.actors-system.definitions.js';
|
|
12
|
+
import { briefAdequacyAgents } from '../../meta-workflows/models/brief-adequacy.actors-system.definitions.js';
|
|
12
13
|
import { buildLogoGenerationAgent } from '../../brand/models/logo-generation.actors-system.definitions.js';
|
|
13
14
|
import { buildLogoJudgeAgent } from '../../brand/models/logo-judge.actors-system.definitions.js';
|
|
14
15
|
import { buildExpertPersonaDerivationAgent } from '../../expert-personas/models/expert-persona-derivation.actors-system.definitions.js';
|
|
@@ -130,6 +131,10 @@ export async function assembleCompanionStartup(companionContext, runtimeConfig)
|
|
|
130
131
|
// The read-only sibling: same ACP transport, opposite posture. Registered beside the coding
|
|
131
132
|
// Agent so "registered exactly once" stays one list to read.
|
|
132
133
|
...applicationResearchAgents,
|
|
134
|
+
// The brief-adequacy gate (#254's rescoped shape): judges one composed brief per opted-in
|
|
135
|
+
// playbook run and proposes add-only context repairs. Registered beside its siblings so
|
|
136
|
+
// "registered exactly once" stays one list to read.
|
|
137
|
+
...briefAdequacyAgents,
|
|
133
138
|
// Companion-owned IMAGE agent (brand/logo generation step). Registered
|
|
134
139
|
// here, like labelling/meta-workflows — not shipped as an engine default.
|
|
135
140
|
buildLogoGenerationAgent(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-startup-assembly.js","sourceRoot":"","sources":["../../../../../src/core/runtime/companion-startup-assembly.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,4BAA4B,C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;IAE5E,MAAM,SAAS,GAAG,uBAAuB,CACvC,yBAAyB,EAAW,EACpC,gBAAgB,EAChB,aAAa,CACkC,CAAC;IAElD,MAAM,mBAAmB,GAAG,SAAS,CAAC,GAAG,CACvC,uBAAuB,CAAC,mBAA4B,CAC9B,CAAC;IAIzB,2EAA2E;IAC3E,uEAAuE;IACvE,6DAA6D;IAoB7D,MAAM,aAAa,GAA2B;QAC5C;;;WAGG;QACH;;;;;WAKG;QACH,iBAAiB,EAAE,CAAC,mBAAmB,CAAC;QACxC,aAAa;QACb,eAAe;QACf,mBAAmB,EAAE;YACnB,0BAA0B,EAAE;gBAC1B,GAAG,oBAAoB,CAAC,UAAU;gBAClC,GAAG,wBAAwB,CAAC,UAAU;aACvC;YACD,MAAM,EAAE;gBACN,GAAG,WAAW;gBACd,GAAG,oBAAoB,CAAC,MAAM;gBAC9B,8BAA8B;gBAC9B,GAAG,wBAAwB,CAAC,MAAM;gBAClC,iEAAiE;gBACjE,qEAAqE;gBACrE,oEAAoE;gBACpE,gEAAgE;gBAChE,iEAAiE;gBACjE,GAAG,uBAAuB;gBAC1B,4FAA4F;gBAC5F,6DAA6D;gBAC7D,GAAG,yBAAyB;gBAC5B,uEAAuE;gBACvE,0EAA0E;gBAC1E,wBAAwB,EAAE;gBAC1B,wEAAwE;gBACxE,uEAAuE;gBACvE,mBAAmB,EAAE;gBACrB,2DAA2D;gBAC3D,qEAAqE;gBACrE,uDAAuD;gBACvD,iCAAiC,EAAE;gBACnC,kEAAkE;gBAClE,iEAAiE;gBACjE,8DAA8D;gBAC9D,+BAA+B,EAAE;gBACjC,gEAAgE;gBAChE,kCAAkC,EAAE;gBACpC,8DAA8D;gBAC9D,GAAG,qBAAqB,CAAC,MAAM;aAChC;SACF;KACF,CAAC;IAEF,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;AACtC,CAAC","sourcesContent":["import {\n setupSaasBackendInjection,\n marketGenerationAgent,\n MARKET_GENERATION_AGENT_REF,\n describeCaughtError,\n} from '@wildo-ai/saas-backend-lib';\nimport type { FlowsActors_Agent } from '@wildo-ai/saas-models';\nimport { readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nimport { PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS } from '@wildo-ai/platform-config-lib';\nimport type { SaasRuntimeProvidersArtifact } from '@wildo-ai/platform-config-lib';\n\nimport { emailAgents } from '../../email/models/email-template.actors-system.definitions';\nimport {\n CompanionController,\n setupCompanionInjection,\n} from '../inject/models/container';\nimport { COMPANION_SERVICE_TYPES } from '../inject/models/service-types';\nimport { buildLabellingActorSystemDefinitions } from '../../i18n-labelling/models/labelling.actors-system.definitions';\nimport { buildMetaWorkflowsActorSystemDefinitions } from '../../meta-workflows/models/meta-workflows.actors-system.definitions';\nimport { applicationCodingAgents } from '../../meta-workflows/models/application-coding-agent.actors-system.definitions';\nimport { applicationResearchAgents } from '../../meta-workflows/models/application-research-agent.actors-system.definitions';\nimport { buildLogoGenerationAgent } from '../../brand/models/logo-generation.actors-system.definitions';\nimport { buildLogoJudgeAgent } from '../../brand/models/logo-judge.actors-system.definitions';\nimport { buildExpertPersonaDerivationAgent } from '../../expert-personas/models/expert-persona-derivation.actors-system.definitions';\nimport { buildExpertPersonaCritiqueAgent } from '../../expert-personas/models/expert-persona-critique.actors-system.definitions';\nimport { buildDeliberationTextProducerAgent } from '../../deliberations/models/deliberation-agents.actors-system.definitions';\nimport { loadCommittedExpertAgents } from '../../deliberations/utils/load-committed-expert-agents';\nimport type { CompanionContext } from '../context/companion-context';\nimport { loadBackendCompanionExports } from '../context/companion-package-loaders.companion';\nimport type { CompanionRuntimeConfig } from './models/companion-runtime.models';\nimport type { CompanionStartupConfig } from './services/start-companion-application.service';\n\n/**\n * The complete ordinary companion composition: the DI container and the exact\n * startup config object `StartCompanionApplicationService.initialize` accepts.\n */\nexport interface AssembledCompanionStartup {\n readonly container: ReturnType<typeof setupSaasBackendInjection>;\n readonly startupConfig: CompanionStartupConfig;\n}\n\n/**\n * Loads the companion's provider-runtime topology from the APPLICATION's generated JSON artifact\n * (`.wildo-saas/generated/providers/companion.runtime-providers.generated.json`).\n *\n * This used to be a compiled-in `src/generated/wildo-provider-runtime.generated.ts` module, like\n * the backend/minion/worker hosts still use. That shape cannot survive the dist-only companion\n * distribution (issue #64): the generated module is APP-SPECIFIC data, the canonical companion\n * package at `platform/factory` is app-agnostic, and the delivered drop carries no source and no\n * compiler. The artifact content is pure environment-independent topology data, and `wildo config\n * sync` already materializes it as JSON at a path this process can reach through its application\n * root — so the JSON is the one authority and no per-companion module exists any more.\n */\nasync function loadProviderRuntime(saasRoot: string): Promise<SaasRuntimeProvidersArtifact> {\n const artifactPath = join(saasRoot, PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS.companion);\n try {\n const providerRuntime = JSON.parse(await readFile(artifactPath, 'utf8')) as SaasRuntimeProvidersArtifact;\n if (!providerRuntime?.scope || providerRuntime.artifactKind !== 'companion') {\n throw new Error('Companion provider runtime artifact does not carry a companion scope.');\n }\n return providerRuntime;\n } catch (error) {\n throw new Error(\n `Missing or invalid companion provider runtime artifact at ${artifactPath}. `\n + 'Run `wildo config sync` before starting this companion. '\n + describeCaughtError(error),\n );\n }\n}\n\n/**\n * Resolve the market generation agent the companion registers under\n * `MARKET_GENERATION_AGENT_REF`.\n *\n * Returns the application-authored override\n * (`BackendCompanionExports.marketGenerationAgentOverride`) when present,\n * otherwise the framework default (`marketGenerationAgent` from\n * `@wildo-ai/saas-backend-lib`). The override must reuse the canonical ref:\n * the market service invokes the agent by that fixed ref, so an override\n * under a different ref would be dead-registered and never reached. We fail\n * fast at startup with a precise message rather than silently rewrite the\n * ref (a silent rewrite would mask the authoring mistake).\n */\nfunction resolveMarketGenerationAgent(\n override: FlowsActors_Agent | undefined,\n): FlowsActors_Agent {\n if (!override) {\n return marketGenerationAgent;\n }\n if (override.ref !== MARKET_GENERATION_AGENT_REF) {\n throw new Error(\n `Application market generation agent override must use ref \"${MARKET_GENERATION_AGENT_REF}\" `\n + `(received \"${override.ref}\"). The companion invokes the market generation agent by this fixed `\n + `ref, so an override under a different ref would never be reached. Set the override's \\`ref\\` to `\n + `the canonical value (import MARKET_GENERATION_AGENT_REF from '@wildo-ai/saas-backend-lib').`,\n );\n }\n return override;\n}\n\n/**\n * Assemble the ONE ordinary companion startup composition without starting it.\n *\n * This is the single authority for what the companion mounts and registers:\n * `src/index.ts` starts exactly this composition, and the explicit\n * first-activation maintenance operation (Step 4) boots the same assembly so\n * the startup-composition observer captures the true ordinary controller/agent\n * graph rather than a hand-maintained copy that could drift from it. Assembly\n * performs loader I/O (backend companion exports, generated provider runtime,\n * committed expert charters) and DI wiring only — no HTTP, no Mongo, no\n * continuity recovery, no durable effect.\n */\nexport async function assembleCompanionStartup(\n companionContext: CompanionContext,\n runtimeConfig: CompanionRuntimeConfig,\n): Promise<AssembledCompanionStartup> {\n const { backendConfig, marketGenerationAgentOverride } = await loadBackendCompanionExports(companionContext);\n const providerRuntime = await loadProviderRuntime(companionContext.saasRoot);\n\n // The market generation agent ships a framework default; the application\n // may override provider/model/persona via its backend companion-exports.\n const effectiveMarketGenerationAgent = resolveMarketGenerationAgent(marketGenerationAgentOverride);\n\n // Charter-built expert agents (RF-6): one deliberation agent per\n // COMMITTED ExpertPersonaCharter. Fail-open here (an app without\n // charters boots normally); the deliberation composer fail-closes.\n const committedExpertAgents = await loadCommittedExpertAgents(companionContext.saasRoot);\n\n const labellingDefinitions = buildLabellingActorSystemDefinitions();\n const metaWorkflowsDefinitions = buildMetaWorkflowsActorSystemDefinitions();\n\n const container = setupCompanionInjection(\n setupSaasBackendInjection() as never,\n companionContext,\n runtimeConfig,\n ) as ReturnType<typeof setupSaasBackendInjection>;\n\n const companionController = container.get(\n COMPANION_SERVICE_TYPES.CompanionController as never,\n ) as CompanionController;\n\n\n \n // Public-v2 assessment surface: catalog status/next reads plus token-gated\n // episode-addressed status/next and the non-terminal working-admission\n // `run`. READY posture only — see `customControllers` below.\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n const startupConfig: CompanionStartupConfig = {\n /*\n * Mounted in BOTH postures. In the healthy one it is an ordinary operator route; in the degraded one it is\n * the only way out, since a registry the companion cannot accept is exactly what closed everything else.\n */\n /*\n * The journey, public-v2 episode, workbench and assurance HTTP surfaces were deleted with the\n * accepted-state ledger they served. `companionController` is the surviving general surface; the\n * playbook-execution routes return here as the rebuild reaches them\n * (`.claude/plans/rebuild-playbook-execution.md`, P3).\n */\n customControllers: [companionController],\n backendConfig,\n providerRuntime,\n flowsActorsRegistry: {\n flowActorSystemsFactoryMap: {\n ...labellingDefinitions.factoryMap,\n ...metaWorkflowsDefinitions.factoryMap,\n },\n agents: [\n ...emailAgents,\n ...labellingDefinitions.agents,\n effectiveMarketGenerationAgent,\n ...metaWorkflowsDefinitions.agents,\n // The application coding agent (Claude Code through the ordinary\n // Flows/Actors AGENT_CLIENT_PROTOCOL path, `claude-code-acp` profile\n // authored in wildo.saas.config.ts). Registered exactly once, here,\n // in the one startup Agent collection — F2's typed task wrapper\n // resolves it by ref; there is no second dispatcher or registry.\n ...applicationCodingAgents,\n // The read-only sibling: same ACP transport, opposite posture. Registered beside the coding\n // Agent so \"registered exactly once\" stays one list to read.\n ...applicationResearchAgents,\n // Companion-owned IMAGE agent (brand/logo generation step). Registered\n // here, like labelling/meta-workflows — not shipped as an engine default.\n buildLogoGenerationAgent(),\n // Companion-owned JUDGE agent (brand/logo ACCEPT review point) — scores\n // a staged candidate against the authored brief (GENERATE_STRUCTURED).\n buildLogoJudgeAgent(),\n // Companion-owned expert-persona DERIVATION agent (agentic\n // deliberation system) — compiles app-specific persona charters from\n // framework role templates + the app's spec artifacts.\n buildExpertPersonaDerivationAgent(),\n // Companion-owned expert-persona CRITIQUE agent — the self-review\n // pass of the multi-pass derivation protocol (draft → critique →\n // finalize); a dedicated critic, separate from the generator.\n buildExpertPersonaCritiqueAgent(),\n // Deliberation TEXT producer (revision step for TEXT subjects).\n buildDeliberationTextProducerAgent(),\n // One deliberation agent per COMMITTED expert charter (RF-6).\n ...committedExpertAgents.agents,\n ],\n },\n };\n\n return { container, startupConfig };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"companion-startup-assembly.js","sourceRoot":"","sources":["../../../../../src/core/runtime/companion-startup-assembly.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,wCAAwC,EAAE,MAAM,+BAA+B,CAAC;AAGzF,OAAO,EAAE,WAAW,EAAE,MAAM,6DAA6D,CAAC;AAC1F,OAAO,EAEL,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,oCAAoC,EAAE,MAAM,iEAAiE,CAAC;AACvH,OAAO,EAAE,wCAAwC,EAAE,MAAM,sEAAsE,CAAC;AAChI,OAAO,EAAE,uBAAuB,EAAE,MAAM,gFAAgF,CAAC;AACzH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kFAAkF,CAAC;AAC7H,OAAO,EAAE,mBAAmB,EAAE,MAAM,sEAAsE,CAAC;AAC3G,OAAO,EAAE,wBAAwB,EAAE,MAAM,8DAA8D,CAAC;AACxG,OAAO,EAAE,mBAAmB,EAAE,MAAM,yDAAyD,CAAC;AAC9F,OAAO,EAAE,iCAAiC,EAAE,MAAM,kFAAkF,CAAC;AACrI,OAAO,EAAE,+BAA+B,EAAE,MAAM,gFAAgF,CAAC;AACjI,OAAO,EAAE,kCAAkC,EAAE,MAAM,0EAA0E,CAAC;AAC9H,OAAO,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AAEnG,OAAO,EAAE,2BAA2B,E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ACxE,uEAAuE;gBACvE,mBAAmB,EAAE;gBACrB,2DAA2D;gBAC3D,qEAAqE;gBACrE,uDAAuD;gBACvD,iCAAiC,EAAE;gBACnC,kEAAkE;gBAClE,iEAAiE;gBACjE,8DAA8D;gBAC9D,+BAA+B,EAAE;gBACjC,gEAAgE;gBAChE,kCAAkC,EAAE;gBACpC,8DAA8D;gBAC9D,GAAG,qBAAqB,CAAC,MAAM;aAChC;SACF;KACF,CAAC;IAEF,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;AACtC,CAAC","sourcesContent":["import {\n setupSaasBackendInjection,\n marketGenerationAgent,\n MARKET_GENERATION_AGENT_REF,\n describeCaughtError,\n} from '@wildo-ai/saas-backend-lib';\nimport type { FlowsActors_Agent } from '@wildo-ai/saas-models';\nimport { readFile } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nimport { PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS } from '@wildo-ai/platform-config-lib';\nimport type { SaasRuntimeProvidersArtifact } from '@wildo-ai/platform-config-lib';\n\nimport { emailAgents } from '../../email/models/email-template.actors-system.definitions';\nimport {\n CompanionController,\n setupCompanionInjection,\n} from '../inject/models/container';\nimport { COMPANION_SERVICE_TYPES } from '../inject/models/service-types';\nimport { buildLabellingActorSystemDefinitions } from '../../i18n-labelling/models/labelling.actors-system.definitions';\nimport { buildMetaWorkflowsActorSystemDefinitions } from '../../meta-workflows/models/meta-workflows.actors-system.definitions';\nimport { applicationCodingAgents } from '../../meta-workflows/models/application-coding-agent.actors-system.definitions';\nimport { applicationResearchAgents } from '../../meta-workflows/models/application-research-agent.actors-system.definitions';\nimport { briefAdequacyAgents } from '../../meta-workflows/models/brief-adequacy.actors-system.definitions';\nimport { buildLogoGenerationAgent } from '../../brand/models/logo-generation.actors-system.definitions';\nimport { buildLogoJudgeAgent } from '../../brand/models/logo-judge.actors-system.definitions';\nimport { buildExpertPersonaDerivationAgent } from '../../expert-personas/models/expert-persona-derivation.actors-system.definitions';\nimport { buildExpertPersonaCritiqueAgent } from '../../expert-personas/models/expert-persona-critique.actors-system.definitions';\nimport { buildDeliberationTextProducerAgent } from '../../deliberations/models/deliberation-agents.actors-system.definitions';\nimport { loadCommittedExpertAgents } from '../../deliberations/utils/load-committed-expert-agents';\nimport type { CompanionContext } from '../context/companion-context';\nimport { loadBackendCompanionExports } from '../context/companion-package-loaders.companion';\nimport type { CompanionRuntimeConfig } from './models/companion-runtime.models';\nimport type { CompanionStartupConfig } from './services/start-companion-application.service';\n\n/**\n * The complete ordinary companion composition: the DI container and the exact\n * startup config object `StartCompanionApplicationService.initialize` accepts.\n */\nexport interface AssembledCompanionStartup {\n readonly container: ReturnType<typeof setupSaasBackendInjection>;\n readonly startupConfig: CompanionStartupConfig;\n}\n\n/**\n * Loads the companion's provider-runtime topology from the APPLICATION's generated JSON artifact\n * (`.wildo-saas/generated/providers/companion.runtime-providers.generated.json`).\n *\n * This used to be a compiled-in `src/generated/wildo-provider-runtime.generated.ts` module, like\n * the backend/minion/worker hosts still use. That shape cannot survive the dist-only companion\n * distribution (issue #64): the generated module is APP-SPECIFIC data, the canonical companion\n * package at `platform/factory` is app-agnostic, and the delivered drop carries no source and no\n * compiler. The artifact content is pure environment-independent topology data, and `wildo config\n * sync` already materializes it as JSON at a path this process can reach through its application\n * root — so the JSON is the one authority and no per-companion module exists any more.\n */\nasync function loadProviderRuntime(saasRoot: string): Promise<SaasRuntimeProvidersArtifact> {\n const artifactPath = join(saasRoot, PROVIDER_RUNTIME_ARTIFACT_RELATIVE_PATHS.companion);\n try {\n const providerRuntime = JSON.parse(await readFile(artifactPath, 'utf8')) as SaasRuntimeProvidersArtifact;\n if (!providerRuntime?.scope || providerRuntime.artifactKind !== 'companion') {\n throw new Error('Companion provider runtime artifact does not carry a companion scope.');\n }\n return providerRuntime;\n } catch (error) {\n throw new Error(\n `Missing or invalid companion provider runtime artifact at ${artifactPath}. `\n + 'Run `wildo config sync` before starting this companion. '\n + describeCaughtError(error),\n );\n }\n}\n\n/**\n * Resolve the market generation agent the companion registers under\n * `MARKET_GENERATION_AGENT_REF`.\n *\n * Returns the application-authored override\n * (`BackendCompanionExports.marketGenerationAgentOverride`) when present,\n * otherwise the framework default (`marketGenerationAgent` from\n * `@wildo-ai/saas-backend-lib`). The override must reuse the canonical ref:\n * the market service invokes the agent by that fixed ref, so an override\n * under a different ref would be dead-registered and never reached. We fail\n * fast at startup with a precise message rather than silently rewrite the\n * ref (a silent rewrite would mask the authoring mistake).\n */\nfunction resolveMarketGenerationAgent(\n override: FlowsActors_Agent | undefined,\n): FlowsActors_Agent {\n if (!override) {\n return marketGenerationAgent;\n }\n if (override.ref !== MARKET_GENERATION_AGENT_REF) {\n throw new Error(\n `Application market generation agent override must use ref \"${MARKET_GENERATION_AGENT_REF}\" `\n + `(received \"${override.ref}\"). The companion invokes the market generation agent by this fixed `\n + `ref, so an override under a different ref would never be reached. Set the override's \\`ref\\` to `\n + `the canonical value (import MARKET_GENERATION_AGENT_REF from '@wildo-ai/saas-backend-lib').`,\n );\n }\n return override;\n}\n\n/**\n * Assemble the ONE ordinary companion startup composition without starting it.\n *\n * This is the single authority for what the companion mounts and registers:\n * `src/index.ts` starts exactly this composition, and the explicit\n * first-activation maintenance operation (Step 4) boots the same assembly so\n * the startup-composition observer captures the true ordinary controller/agent\n * graph rather than a hand-maintained copy that could drift from it. Assembly\n * performs loader I/O (backend companion exports, generated provider runtime,\n * committed expert charters) and DI wiring only — no HTTP, no Mongo, no\n * continuity recovery, no durable effect.\n */\nexport async function assembleCompanionStartup(\n companionContext: CompanionContext,\n runtimeConfig: CompanionRuntimeConfig,\n): Promise<AssembledCompanionStartup> {\n const { backendConfig, marketGenerationAgentOverride } = await loadBackendCompanionExports(companionContext);\n const providerRuntime = await loadProviderRuntime(companionContext.saasRoot);\n\n // The market generation agent ships a framework default; the application\n // may override provider/model/persona via its backend companion-exports.\n const effectiveMarketGenerationAgent = resolveMarketGenerationAgent(marketGenerationAgentOverride);\n\n // Charter-built expert agents (RF-6): one deliberation agent per\n // COMMITTED ExpertPersonaCharter. Fail-open here (an app without\n // charters boots normally); the deliberation composer fail-closes.\n const committedExpertAgents = await loadCommittedExpertAgents(companionContext.saasRoot);\n\n const labellingDefinitions = buildLabellingActorSystemDefinitions();\n const metaWorkflowsDefinitions = buildMetaWorkflowsActorSystemDefinitions();\n\n const container = setupCompanionInjection(\n setupSaasBackendInjection() as never,\n companionContext,\n runtimeConfig,\n ) as ReturnType<typeof setupSaasBackendInjection>;\n\n const companionController = container.get(\n COMPANION_SERVICE_TYPES.CompanionController as never,\n ) as CompanionController;\n\n\n \n // Public-v2 assessment surface: catalog status/next reads plus token-gated\n // episode-addressed status/next and the non-terminal working-admission\n // `run`. READY posture only — see `customControllers` below.\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n const startupConfig: CompanionStartupConfig = {\n /*\n * Mounted in BOTH postures. In the healthy one it is an ordinary operator route; in the degraded one it is\n * the only way out, since a registry the companion cannot accept is exactly what closed everything else.\n */\n /*\n * The journey, public-v2 episode, workbench and assurance HTTP surfaces were deleted with the\n * accepted-state ledger they served. `companionController` is the surviving general surface; the\n * playbook-execution routes return here as the rebuild reaches them\n * (`.claude/plans/rebuild-playbook-execution.md`, P3).\n */\n customControllers: [companionController],\n backendConfig,\n providerRuntime,\n flowsActorsRegistry: {\n flowActorSystemsFactoryMap: {\n ...labellingDefinitions.factoryMap,\n ...metaWorkflowsDefinitions.factoryMap,\n },\n agents: [\n ...emailAgents,\n ...labellingDefinitions.agents,\n effectiveMarketGenerationAgent,\n ...metaWorkflowsDefinitions.agents,\n // The application coding agent (Claude Code through the ordinary\n // Flows/Actors AGENT_CLIENT_PROTOCOL path, `claude-code-acp` profile\n // authored in wildo.saas.config.ts). Registered exactly once, here,\n // in the one startup Agent collection — F2's typed task wrapper\n // resolves it by ref; there is no second dispatcher or registry.\n ...applicationCodingAgents,\n // The read-only sibling: same ACP transport, opposite posture. Registered beside the coding\n // Agent so \"registered exactly once\" stays one list to read.\n ...applicationResearchAgents,\n // The brief-adequacy gate (#254's rescoped shape): judges one composed brief per opted-in\n // playbook run and proposes add-only context repairs. Registered beside its siblings so\n // \"registered exactly once\" stays one list to read.\n ...briefAdequacyAgents,\n // Companion-owned IMAGE agent (brand/logo generation step). Registered\n // here, like labelling/meta-workflows — not shipped as an engine default.\n buildLogoGenerationAgent(),\n // Companion-owned JUDGE agent (brand/logo ACCEPT review point) — scores\n // a staged candidate against the authored brief (GENERATE_STRUCTURED).\n buildLogoJudgeAgent(),\n // Companion-owned expert-persona DERIVATION agent (agentic\n // deliberation system) — compiles app-specific persona charters from\n // framework role templates + the app's spec artifacts.\n buildExpertPersonaDerivationAgent(),\n // Companion-owned expert-persona CRITIQUE agent — the self-review\n // pass of the multi-pass derivation protocol (draft → critique →\n // finalize); a dedicated critic, separate from the generator.\n buildExpertPersonaCritiqueAgent(),\n // Deliberation TEXT producer (revision step for TEXT subjects).\n buildDeliberationTextProducerAgent(),\n // One deliberation agent per COMMITTED expert charter (RF-6).\n ...committedExpertAgents.agents,\n ],\n },\n };\n\n return { container, startupConfig };\n}\n"]}
|