@wildo-ai/dev-companion 1.1.12 → 1.1.13
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/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +8 -6
- package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.d.ts +6 -0
- package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
- package/dist/esm/companion-api/controllers/companion.controller.js +13 -1
- package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js +7 -0
- package/dist/esm/core/introspection/resources/creation-home-projection.companion.js.map +1 -1
- package/dist/esm/core/introspection/resources/launch-blockers.companion.d.ts +5 -1
- package/dist/esm/core/introspection/resources/launch-blockers.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/resources/launch-blockers.companion.js +37 -4
- package/dist/esm/core/introspection/resources/launch-blockers.companion.js.map +1 -1
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.d.ts +14 -0
- 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 +48 -0
- package/dist/esm/core/introspection/services/companion-introspection.companion.service.js.map +1 -1
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.d.ts +128 -0
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.d.ts.map +1 -0
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.js +180 -0
- package/dist/esm/core/introspection/services/introspection-dependency-tree.companion.js.map +1 -0
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.d.ts +9 -0
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.d.ts.map +1 -1
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.js +25 -3
- package/dist/esm/core/introspection/services/introspection-worker-pool.companion.js.map +1 -1
- package/dist/esm/core/runtime/restart-drain.companion.d.ts +107 -0
- package/dist/esm/core/runtime/restart-drain.companion.d.ts.map +1 -0
- package/dist/esm/core/runtime/restart-drain.companion.js +237 -0
- package/dist/esm/core/runtime/restart-drain.companion.js.map +1 -0
- package/dist/esm/executions/services/companion-executions.companion.service.d.ts +18 -1
- package/dist/esm/executions/services/companion-executions.companion.service.d.ts.map +1 -1
- package/dist/esm/executions/services/companion-executions.companion.service.js +34 -8
- package/dist/esm/executions/services/companion-executions.companion.service.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +40 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +13 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts +40 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts.map +1 -1
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js +40 -0
- package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.en.d.ts +5 -0
- package/dist/esm/i18n/system_enums/application-creation.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.en.js +6 -0
- package/dist/esm/i18n/system_enums/application-creation.en.js.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.fr.d.ts +5 -0
- package/dist/esm/i18n/system_enums/application-creation.fr.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/application-creation.fr.js +5 -0
- package/dist/esm/i18n/system_enums/application-creation.fr.js.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.d.ts +2 -0
- package/dist/esm/i18n/system_enums/workbench-build.en.d.ts.map +1 -1
- package/dist/esm/i18n/system_enums/workbench-build.en.js +2 -0
- package/dist/esm/i18n/system_enums/workbench-build.en.js.map +1 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.d.ts +5 -1
- 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 +5 -1
- package/dist/esm/meta-workflows/models/application-coding-agent.actors-system.definitions.js.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-record.models.d.ts +12 -0
- package/dist/esm/meta-workflows/models/playbook-run-record.models.d.ts.map +1 -1
- package/dist/esm/meta-workflows/models/playbook-run-record.models.js +9 -0
- package/dist/esm/meta-workflows/models/playbook-run-record.models.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +80 -4
- 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 +235 -42
- package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts +56 -3
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js +182 -33
- package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +58 -0
- 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 +116 -2
- package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts +12 -0
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js +31 -7
- package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts +2 -2
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts.map +1 -1
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js +10 -8
- package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js.map +1 -1
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +67 -2
- 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 +243 -48
- package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
- package/package.json +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creation-home-projection.companion.d.ts","sourceRoot":"","sources":["../../../../../src/core/introspection/resources/creation-home-projection.companion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AAC3H,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AAEpG,OAAO,EACL,KAAK,oBAAoB,EAOzB,wBAAwB,EAGxB,mCAAmC,EAGnC,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,EACnC,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EAClC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAuC,KAAK,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAE7I;;;;;;;;;;;;;;;;GAgBG;AAEH,qFAAqF;AACrF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,0BAA0B,EAAE,6BAA6B,CAAC,CAAC;AAClG,mFAAmF;AACnF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,yBAAyB,EAAE,4BAA4B,CAAC,CAAC;AAE/F,4EAA4E;AAC5E,eAAO,MAAM,8BAA8B,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"creation-home-projection.companion.d.ts","sourceRoot":"","sources":["../../../../../src/core/introspection/resources/creation-home-projection.companion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;AAC3H,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AAEpG,OAAO,EACL,KAAK,oBAAoB,EAOzB,wBAAwB,EAGxB,mCAAmC,EAGnC,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,8BAA8B,EACnC,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,4BAA4B,EAClC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAuC,KAAK,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAE7I;;;;;;;;;;;;;;;;GAgBG;AAEH,qFAAqF;AACrF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,0BAA0B,EAAE,6BAA6B,CAAC,CAAC;AAClG,mFAAmF;AACnF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,yBAAyB,EAAE,4BAA4B,CAAC,CAAC;AAE/F,4EAA4E;AAC5E,eAAO,MAAM,8BAA8B,IAAI,CAAC;AAsFhD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,SAAS,qBAAqB,EAAE,CAAC;IAChD,QAAQ,CAAC,UAAU,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACxD,QAAQ,CAAC,OAAO,EAAE,SAAS,4BA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O,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,8BAA8B,EAAE,wBAAwB,GAAG,IAAI,CAAC,CA2D/G,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,EAAE,SAAS;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,mCAAmC,CAAA;KAAE,EAAE,CAAC;IAChH,iHAAiH;IACjH,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5C,gCAAgC;IAChC,QAAQ,CAAC,KAAK,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAClD;;;OAGG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,2BAA2B,CAAC;IAC1D;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClD;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,kBAAkB,EAAE,CA0DjG;AAED,qHAAqH;AACrH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,uBAAuB,EAAE,QAAQ,GAAG,SAAS,CAAC,CAAC"}
|
|
@@ -80,6 +80,13 @@ const STUCK_REASON_ASK = {
|
|
|
80
80
|
* nothing runs: then the repair did not take, or a person edited a charter, whose remedy is theirs.
|
|
81
81
|
*/
|
|
82
82
|
[Workbench_BuildTaskStuckReason.STALE_EXPERT_CHARTERS]: StuckTaskAsk.ASKS_ONCE_NOTHING_RUNS,
|
|
83
|
+
/*
|
|
84
|
+
* #3709: a generation step failing the same way on unchanged inputs. Its cause needs a fix, often outside the
|
|
85
|
+
* application (an engine's examples, an engine label key), and only a person makes it: asked, like an exhausted budget.
|
|
86
|
+
*/
|
|
87
|
+
[Workbench_BuildTaskStuckReason.REPEATED_IDENTICAL_FAILURE]: StuckTaskAsk.ASKS,
|
|
88
|
+
/* #3709: a step failing on a cause the framework owns. Only a framework fix and a person's re-run clear it: asked. */
|
|
89
|
+
[Workbench_BuildTaskStuckReason.FAILURE_OUTSIDE_APPLICATION]: StuckTaskAsk.ASKS,
|
|
83
90
|
};
|
|
84
91
|
/** One leftover in a Home line's subject: the file, and the runs whose record holds it as it is now (#3267). */
|
|
85
92
|
function describeLeftoverForHome(leftover) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"creation-home-projection.companion.js","sourceRoot":"","sources":["../../../../../src/core/introspection/resources/creation-home-projection.companion.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,kBAAkB,EAAE,mCAAmC,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAEL,8BAA8B,EAC9B,wDAAwD,EACxD,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,mCAAmC,EACnC,oCAAoC,EACpC,sCAAsC,GAWvC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,mCAAmC,EAA8B,MAAM,4DAA4D,CAAC;AAyB7I,4EAA4E;AAC5E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC;AAEhD,0EAA0E;AAC1E,SAAS,kBAAkB,CAAC,IAAiB,EAAE,KAAkB;IAC/D,IAAI,IAAI,KAAK,IAAI,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IAC9C,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IAC5B,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC,CAAC;IAC9B,OAAO,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;AAC1C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,GAAqE;IACnF,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AE,EAAE,CAAC,KAAK,KAAK,OAAO,CAAC;iBACpC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,8BAA8B,CAAC,IAAI,CAAC,CAAC;YACrF,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;QACpK,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;QAC9J,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,oCAAoC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAE,CAAC,CAAC;AACnF,CAAC","sourcesContent":["import type { BuildPlanSpecificationFault, PlaybookDatedByWaitingInterview } from '@wildo-ai/application-creation-runtime';\nimport { ApplicationSpecificationFamily } from '@wildo-ai/saas-specifications/application-creation';\nimport { FlowsActors_Status, describeModelProviderAccountRefusal } from '@wildo-ai/saas-models';\nimport {\n type BuildTaskClosureKind,\n Workbench_BuildTaskStuckReason,\n WORKBENCH_BUILD_TASK_STUCK_REASONS_WAITING_ON_A_LIVE_RUN,\n Workbench_PlaybookRunState,\n WorkbenchBuildPlanTaskStatus,\n WorkbenchCreationHomeLineKind,\n WorkbenchCreationHomeSection,\n WorkbenchCreationOutcome,\n WorkbenchCreationOutcomeStatus,\n WorkbenchShared_ResourceType,\n WorkbenchSpecificationArtifactState,\n WORKBENCH_CREATION_OUTCOMES_IN_ORDER,\n sanitizeWorkbenchCreationPlaneIdentity,\n type Workbench_BuildDispatch,\n type Workbench_BuildDispatchPlan,\n type Workbench_BuildPlanTask,\n type Workbench_CreationHomeLine,\n type Workbench_CreationOutcome,\n type Workbench_GovernanceDocument,\n type Workbench_ParkedCodingQuestion,\n type Workbench_Playbook,\n type Workbench_PlaybookRun,\n type Workbench_WaitingPlaybookRun,\n} from '@wildo-ai/platform-core-shared';\n\nimport { describeCodingAgentUsageLimitResume, type CodingAgentUsageLimit } from '../../../claude-cli/models/coding-agent-usage-limit.models';\n\n/**\n * HOME, derived (#1454): the lines the conversation page opens on, and where the application\n * stands — pure functions of the creation-plane rows the projection service already computes.\n *\n * ## Why here and not in the page\n *\n * Until 2026-09-22 the workbench read seven resources on their own cadences and derived every one\n * of these facts itself, on every poll, in three modules nothing but the page could reach. A line\n * is a FACT about the application (\"this run was refused\", \"this task's writes wait to be\n * committed\", \"this step can run and its output is missing\"); facts are derived where the rows are,\n * once, and served as rows (`derive-before-you-ask.md`). The page renders; the assistant's tools read\n * the same rows; and a test of the derivation is a test of what every reader sees.\n *\n * Both builders take the ROWS — the projected shapes the resources serve — rather than the companion\n * services' own records, so a fact is decided from exactly what a reader could see, never from a\n * field the projection dropped.\n */\n\n/** The row shape the home-lines projection emits, before the identity is stamped. */\nexport type CreationHomeLineRow = Omit<Workbench_CreationHomeLine, 'workbenchCreationHomeLineId'>;\n/** The row shape the outcomes projection emits, before the identity is stamped. */\nexport type CreationOutcomeRow = Omit<Workbench_CreationOutcome, 'workbenchCreationOutcomeId'>;\n\n/** How many playbook suggestions Home shows beside the plan's next step. */\nexport const HOME_PLAYBOOK_SUGGESTION_COUNT = 3;\n\n/** Newest first; a row with no instant sorts after every row with one. */\nfunction compareNewestFirst(left: Date | null, right: Date | null): number {\n if (left === null && right === null) return 0;\n if (left === null) return 1;\n if (right === null) return -1;\n return right.getTime() - left.getTime();\n}\n\n/**\n * The RANKING of what is asked of the creator: what stops a run that is otherwise executing comes\n * first (a clarification, a parked question); a document waiting on a fact does not block a run and\n * comes after. Within a rank, newest first.\n */\nconst ASKED_RANK: Readonly<Partial<Record<WorkbenchCreationHomeLineKind, number>>> = {\n [WorkbenchCreationHomeLineKind.CLARIFICATION]: 0,\n [WorkbenchCreationHomeLineKind.PARKED_QUESTION]: 0,\n [WorkbenchCreationHomeLineKind.GOVERNANCE_DOCUMENT]: 1,\n /*\n * Below a question (which holds a live agent session) and above a document: the plan is frozen\n * until it is unblocked, and the remedy is a fixed declaration, a re-arm or an approval.\n */\n [WorkbenchCreationHomeLineKind.UNBLOCK_THE_PLAN]: 1,\n /* A question like a clarification: answering it is what lets the work it holds run (#3361). */\n [WorkbenchCreationHomeLineKind.INTERVIEW_DATES_NEXT_WORK]: 0,\n /* Ahead of the steps it holds: fixing the module is what moves them (#3258). */\n [WorkbenchCreationHomeLineKind.SPECIFICATION_FAULT_HOLDS_THE_PLAN]: 0,\n /* Beside a frozen plan: nothing runs on it, and it stays uncommitted until the creator commits or discards it (#3267). */\n [WorkbenchCreationHomeLineKind.RUN_LEFTOVER_UNCOMMITTED]: 1,\n};\n\n/** Whether a stuck task, on a plan that can dispatch nothing, is a thing waiting on the CREATOR (#2412). */\nenum StuckTaskAsk {\n /** It needs the creator: fix a declaration or the work, re-arm a task whose attempts are spent, or a missing blueprint. */\n ASKS = 'asks',\n /** It needs the creator only once no run of the plan is live; while one is, the wave that wrote it has yet to commit. */\n ASKS_ONCE_NOTHING_RUNS = 'asks-once-nothing-runs',\n /** Nobody's move, or already asked on a line of its own. */\n NEVER = 'never',\n}\n\n/**\n * How each stuck reason reads in ASKED. Total over the reasons, so a reason added tomorrow has to be classified here\n * rather than landing in ASKED by default.\n *\n * `app-creation-test-005` printed \"the build plan is stuck at …: in_flight\" three times, and three more lines for a\n * product awaiting its commit (a reason retired with #3514, since landing reads the working tree), in ONE running wave,\n * and the hook counted all six as questions. Neither was the creator's move:\n *\n * - `IN_FLIGHT` — a run of it is live and it clears when that run settles. NEVER.\n * - `PARKED_AWAITING_ANSWER` — its question is already a `PARKED_QUESTION` line, one per question. NEVER, or it is\n * asked twice.\n */\nconst STUCK_REASON_ASK: Readonly<Record<Workbench_BuildTaskStuckReason, StuckTaskAsk>> = {\n [Workbench_BuildTaskStuckReason.COMPLETED_UNLANDED]: StuckTaskAsk.ASKS,\n [Workbench_BuildTaskStuckReason.PARKED_AWAITING_ANSWER]: StuckTaskAsk.NEVER,\n [Workbench_BuildTaskStuckReason.NO_DOCUMENT_BLUEPRINT]: StuckTaskAsk.ASKS,\n [Workbench_BuildTaskStuckReason.ATTEMPTS_EXHAUSTED]: StuckTaskAsk.ASKS,\n [Workbench_BuildTaskStuckReason.IN_FLIGHT]: StuckTaskAsk.NEVER,\n /* #3204: it starts when the run writing its file settles; nobody can do anything about it. */\n [Workbench_BuildTaskStuckReason.CONTENDED]: StuckTaskAsk.NEVER,\n /* #3204: the wave's end re-checks it alone, by itself; nobody can do anything about it. */\n [Workbench_BuildTaskStuckReason.AWAITING_ISOLATED_RECHECK]: StuckTaskAsk.NEVER,\n /*\n * #3223: a generation step whose landing check could not be answered. Usually it heals by itself (an introspection or a\n * CLI still warming), and Home asks only when nothing else can run — then the check is persistently unanswerable, and the\n * dispatch refusal names the check and the command that shows what the creator has to repair.\n */\n [Workbench_BuildTaskStuckReason.LANDING_UNKNOWN]: StuckTaskAsk.ASKS,\n /* #3227: under GUIDED a derived follow-up waits for the creator's review, which only they can give. */\n [Workbench_BuildTaskStuckReason.FOLLOW_UP_AWAITING_REVIEW]: StuckTaskAsk.ASKS,\n /*\n * Stale expert charters are repaired by the build-dispatch step, which runs the staffing step on its own. Asked only once\n * nothing runs: then the repair did not take, or a person edited a charter, whose remedy is theirs.\n */\n [Workbench_BuildTaskStuckReason.STALE_EXPERT_CHARTERS]: StuckTaskAsk.ASKS_ONCE_NOTHING_RUNS,\n};\n\nexport interface CreationHomeLineInputs {\n readonly runs: readonly Workbench_PlaybookRun[];\n readonly dispatches: readonly Workbench_BuildDispatch[];\n readonly waiting: readonly Workbench_WaitingPlaybookRun[];\n readonly parked: readonly Workbench_ParkedCodingQuestion[];\n readonly documents: readonly Workbench_GovernanceDocument[];\n readonly dispatchPlan: readonly Workbench_BuildDispatchPlan[];\n readonly playbooks: readonly Workbench_Playbook[];\n /** Every family the artifact projection reports, with its state. */\n readonly artifacts: readonly { readonly family: string; readonly state: WorkbenchSpecificationArtifactState }[];\n /**\n * The coding agent's usage limit holding the build NOW (#2388) — the dispatch service's live hold, which is the\n * pause itself, so the line exists exactly while the build is paused. Absent when nothing holds it.\n */\n readonly codingAgentUsageLimit?: CodingAgentUsageLimit & { readonly taskRef: string };\n /**\n * The network loss holding coding admissions NOW (#3236, #3262) — the dispatch service's live connectivity hold, so the\n * line exists exactly while no coding turn is admitted. `route` is the probe's route in words, absent when none is known.\n */\n readonly codingAgentConnectivityHold?: { readonly observedAt: string; readonly taskRef: string; readonly route?: string };\n /**\n * The host cause holding coding admissions NOW (#3423, #3432): the dispatch service's live hold, so the line exists\n * exactly while no coding turn is admitted for it. `cause` is the cause and its remedy in one sentence\n * (`describeVerificationHostCause`): an absent command, a command lacking the verb, or a check that cannot be asked the\n * same way on two tasks.\n */\n readonly verificationToolUnavailableHold?: { readonly observedAt: string; readonly taskRef: string; readonly cause: string };\n /** The instant the resume time is worded against (its date shows when it is not today); the read's own when omitted. */\n readonly now?: Date;\n /**\n * The build tasks a person CLOSED (`wildo build close`, #3224, #3227) whose closure counts now: one SINCE line each, so\n * the feed and Home say that a person, not a probe, settled them. The line carries the person's own words only; how the\n * closure accounts for the task (its kind, what satisfied it) is on the task's record, worded from the vocabulary.\n */\n readonly closures?: readonly { readonly taskRef: string; readonly kind: BuildTaskClosureKind; readonly satisfiedBy?: string; readonly reason: string; readonly closedAt: string }[];\n /**\n * The derived follow-ups that landed while their latest completed run still reports a requirement unmet (#2583): one\n * ADVISORY suggestion each. A projection of the follow-up's landing and that run's report, never a stored state.\n */\n readonly followUpsLandedWithGaps?: readonly { readonly taskRef: string; readonly unmetRequirements: readonly { readonly requirementRef: string; readonly missing: string }[] }[];\n /**\n * Files a task's coding runs left uncommitted that no automatic door will commit (#3267; a stuck task's declared product aside, #3204), from the commit door's own\n * reading of the write register and the tree (`listUncommittedRunLeftovers`): one ASKED line per task.\n */\n readonly uncommittedLeftovers?: readonly { readonly taskRef: string; readonly path: string; readonly runTaskIds: readonly string[] }[];\n /**\n * The LANDED tasks carrying a landing advisory (#3285, `readLandedTasksWithAdvisories`): one ADVISORY suggestion each,\n * naming each setting still to set and its file. Derived from the committed tree, never stored.\n */\n readonly landedTasksWithAdvisories?: readonly { readonly taskRef: string; readonly advisories: readonly { readonly setting: string; readonly settingPath: string }[] }[];\n /**\n * The steps an unattended round withholds because an interview still waiting on the person would date them (#3361), from\n * the eligibility board (`findReadersDatedByWaitingInterviews`): one ASKED line per waiting interview.\n */\n readonly datedByWaitingInterviews?: readonly PlaybookDatedByWaitingInterview[];\n}\n\n/** One leftover in a Home line's subject: the file, and the runs whose record holds it as it is now (#3267). */\nfunction describeLeftoverForHome(leftover: { readonly path: string; readonly runTaskIds: readonly string[] }): string {\n return `${leftover.path} (recorded by ${leftover.runTaskIds.length === 1 ? 'run' : 'runs'} ${leftover.runTaskIds.join(', ')})`;\n}\n\n\n/**\n * When a build dispatch ENDED, and whether it failed — or `null` while it has not (#2523).\n *\n * Read from the dispatch's RUN — the execution it is — for both executors. Home used to read the phase, which\n * is a generation step's outcome but only a coding run's hand-off (it stops at ADMITTED by design), so no\n * coding run ever appeared as settled. A dispatch refused before its run started ends its execution too\n * (ABORTED or FAILED), so it is read the same way.\n */\nexport function dispatchEnding(dispatch: Workbench_BuildDispatch): { readonly at: Date | null; readonly failed: boolean } | null {\n if (!RUN_HAS_ENDED[dispatch.runStatus]) return null;\n return { at: dispatch.runFinishedAt ?? dispatch.settledAt ?? null, failed: dispatch.runStatus !== FlowsActors_Status.COMPLETED };\n}\n\n/**\n * Which execution statuses END a run. Total over the vocabulary, so a status added to it is a compile error\n * here rather than a run Home silently never lists. A run waiting on an answer has not ended: it parks and\n * resumes under the same execution.\n */\nconst RUN_HAS_ENDED: Record<FlowsActors_Status, boolean> = {\n [FlowsActors_Status.READY]: false,\n [FlowsActors_Status.PENDING]: false,\n [FlowsActors_Status.PROCESSING]: false,\n [FlowsActors_Status.AWAITING_APPROVAL]: false,\n [FlowsActors_Status.COMPLETED]: true,\n [FlowsActors_Status.FAILED]: true,\n [FlowsActors_Status.CANCELLED]: true,\n [FlowsActors_Status.ABORTED]: true,\n};\n\n/**\n * The re-runs inside a run's lanes that did not land while their family's earlier landing stands (#3213), latest failure\n * per playbook, in the order they first appear. A landing STANDS — the runtime's own rule (`landingStands` in the\n * choreography) — when the child re-ran over a landing the record held (`reranOverLanding`: a REFRESH, or a CURRENT\n * landing re-opened), or when an earlier round of this run landed it. A FIRST run that failed left nothing to stand and\n * is never one: `ranBecause` cannot tell them apart, since it is written for a first run too.\n */\nfunction failedRepairsOf(run: Workbench_PlaybookRun): ReadonlyArray<{ readonly playbookRef: string; readonly failure: string }> {\n const latest = new Map<string, string>();\n const landedInThisRun = new Set<string>();\n for (const round of run.choreographyRounds ?? []) {\n for (const child of round.children) {\n if (child.failure === null) {\n // A run of the playbook that landed: it delivered (so a later failure stands on it), and it repaired any earlier one.\n if (child.landed.length > 0) landedInThisRun.add(child.playbookRef);\n latest.delete(child.playbookRef);\n } else if (child.reranOverLanding === true || landedInThisRun.has(child.playbookRef)) {\n latest.set(child.playbookRef, child.failure);\n }\n }\n }\n return [...latest].map(([playbookRef, failure]) => ({ playbookRef, failure }));\n}\n\n/**\n * Every line of Home, all three sections. SINCE lines are NOT windowed here: \"since the creator was\n * last here\" is a per-viewer fact the page keeps in its own browser, so the page cuts the list; the\n * projection serves every settled run and dispatch it knows, newest first, and every interrupted\n * run whatever its date.\n */\nexport function buildCreationHomeLines(input: CreationHomeLineInputs): readonly CreationHomeLineRow[] {\n const line = (\n section: WorkbenchCreationHomeSection,\n kind: WorkbenchCreationHomeLineKind,\n target: { resourceType: WorkbenchShared_ResourceType; resourceId: string },\n facts: Partial<Pick<CreationHomeLineRow, 'at' | 'playbookRef' | 'taskRef' | 'subject' | 'failed' | 'acceptable' | 'needsAnswers' | 'stuckReason'>> = {},\n ): CreationHomeLineRow => ({\n section,\n kind,\n at: null,\n playbookRef: null,\n taskRef: null,\n subject: null,\n failed: false,\n acceptable: false,\n needsAnswers: false,\n stuckReason: null,\n targetResourceType: target.resourceType,\n targetResourceId: target.resourceId,\n ...facts,\n });\n\n /* SINCE — what happened. */\n const since: CreationHomeLineRow[] = [];\n for (const run of input.runs) {\n const target = { resourceType: WorkbenchShared_ResourceType.PLAYBOOK_RUNS, resourceId: run.workbenchPlaybookRunId };\n if (run.state === Workbench_PlaybookRunState.COMPLETED) {\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.RUN_COMPLETED, target, {\n at: run.finishedAt ?? null, playbookRef: run.playbookRef, failed: run.ok === false,\n }));\n /*\n * A RE-RUN inside the run's lanes that did not land, over a landing that stands (#3213): a NON-FATAL repair failure.\n * A failed repair of `build-decompose` used to read only as the lane's REFUSED line, so a person read the whole\n * build as failed while the plan on disk still dispatched. Said once per run, naming every such re-run: a child that\n * re-ran over a recorded landing (`reranOverLanding`, read from the rerun verdict's KIND) or over one this run landed,\n * and failed, kept that landing.\n */\n const failedRepairs = failedRepairsOf(run);\n if (failedRepairs.length > 0) {\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.REPAIR_FAILED_LANDING_STANDS, target, {\n at: run.finishedAt ?? null,\n playbookRef: failedRepairs[0]!.playbookRef,\n subject: failedRepairs.map((repair) => `${repair.playbookRef}: ${repair.failure}`).join('; '),\n failed: false,\n }));\n }\n } else if (run.state === Workbench_PlaybookRunState.INTERRUPTED) {\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.RUN_INTERRUPTED, target, {\n at: run.checkpointedAt ?? run.startedAt ?? null, playbookRef: run.playbookRef,\n }));\n }\n }\n for (const dispatch of input.dispatches) {\n const ending = dispatchEnding(dispatch);\n if (ending === null) continue;\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.DISPATCH_SETTLED,\n { resourceType: WorkbenchShared_ResourceType.BUILD_DISPATCHES, resourceId: dispatch.workbenchBuildDispatchId }, {\n at: ending.at,\n taskRef: dispatch.taskRef,\n failed: ending.failed,\n /*\n * The one state ACCEPT addresses: a coding run that completed, recorded writes and has none committed.\n * The row's `accepted === false` means exactly that, so it is read as is (#2523).\n */\n acceptable: dispatch.accepted === false,\n }));\n }\n /*\n * The coding agent's account usage limit, while it holds (#2388): one line saying the build is paused and when\n * it resumes. Read from the LIVE hold the dispatch service keeps, never re-derived from a dispatch row: a\n * coding run that started is projected ADMITTED however it ends and carries no error there, so a row-based\n * reading never fired in production (#2388 review F1). It opens the build-plan task whose run met the limit,\n * a row that exists for as long as the plan holds the task. `failed` stays false: the build is paused, not\n * failing, and the kind's own tone says so.\n */\n const limit = input.codingAgentUsageLimit;\n if (limit) {\n // A refused provider ACCOUNT (#3204) is its own kind: a person lifts it, nothing resets, so it never reads as a limit\n // that \"resumes on its own\". Its subject is the refusal's sentence: who refused, and where to fix it.\n since.push(line(WorkbenchCreationHomeSection.SINCE, limit.accountRefusal\n ? WorkbenchCreationHomeLineKind.CODING_AGENT_ACCOUNT_REFUSED\n : WorkbenchCreationHomeLineKind.CODING_AGENT_USAGE_LIMITED,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(limit.taskRef) }, {\n at: new Date(limit.observedAt),\n taskRef: limit.taskRef,\n subject: limit.accountRefusal\n ? describeModelProviderAccountRefusal(limit.accountRefusal)\n : describeCodingAgentUsageLimitResume(limit, input.now ?? new Date()),\n }));\n }\n /*\n * The coding agent lost the network (#3236, #3262): one line while the connectivity hold lasts, read from the LIVE\n * hold for the same reason as the usage limit's. Before it, a wave waiting up to twenty minutes on a probe looked\n * stalled, and the hold was a WARN in the companion's log. `failed` stays false: the build is waiting, not failing.\n */\n const connectivity = input.codingAgentConnectivityHold;\n if (connectivity) {\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.CODING_AGENT_CONNECTIVITY_LOST,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(connectivity.taskRef) }, {\n at: Number.isNaN(Date.parse(connectivity.observedAt)) ? null : new Date(connectivity.observedAt),\n taskRef: connectivity.taskRef,\n subject: connectivity.route ?? null,\n }));\n }\n /*\n * A verification check cannot be asked for a host cause (#3423, #3432): one line while the hold lasts, read from the LIVE\n * hold like the two above, its subject the cause and remedy. `failed` stays false: nothing the creation built is lost.\n */\n const toolHold = input.verificationToolUnavailableHold;\n if (toolHold) {\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.VERIFICATION_TOOL_UNAVAILABLE,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(toolHold.taskRef) }, {\n at: Number.isNaN(Date.parse(toolHold.observedAt)) ? null : new Date(toolHold.observedAt),\n taskRef: toolHold.taskRef,\n subject: toolHold.cause,\n }));\n }\n /* A person closed a build task (#3224, #3227): `subject` is their reason, in their words; the kind is on the task's record. */\n for (const closure of input.closures ?? []) {\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.BUILD_TASK_CLOSED,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(closure.taskRef) }, {\n at: Number.isNaN(Date.parse(closure.closedAt)) ? null : new Date(closure.closedAt),\n taskRef: closure.taskRef,\n subject: closure.reason,\n }));\n }\n since.sort((left, right) => compareNewestFirst(left.at, right.at));\n\n /* ASKED — what blocks something NOW and waits on the creator. */\n const asked: CreationHomeLineRow[] = [];\n for (const waiting of input.waiting) {\n /* An unreadable checkpoint is a condition to show on its own row, not a question anyone can answer. */\n if (!waiting.readable) continue;\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.CLARIFICATION,\n { resourceType: WorkbenchShared_ResourceType.WAITING_PLAYBOOK_RUNS, resourceId: waiting.workbenchWaitingPlaybookRunId },\n { at: waiting.suspendedAt ?? null, playbookRef: waiting.playbookRef ?? null }));\n }\n /*\n * An interview waiting on the creator whose answer would date work the next unattended round could run (#3361). The\n * round withholds that work, so the line is what moves it: answering lets it run once, on the answer. One line per\n * interview, naming the steps it holds; it opens the interview's playbook, whose way in is the interview.\n */\n const heldByInterview = new Map<string, string[]>();\n for (const dated of input.datedByWaitingInterviews ?? []) {\n for (const waiting of dated.waitingOn) heldByInterview.set(waiting.interviewRef, [...(heldByInterview.get(waiting.interviewRef) ?? []), dated.readerRef]);\n }\n for (const [interviewRef, readerRefs] of heldByInterview) {\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.INTERVIEW_DATES_NEXT_WORK,\n { resourceType: WorkbenchShared_ResourceType.PLAYBOOKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(interviewRef) },\n { playbookRef: interviewRef, subject: [...new Set(readerRefs)].sort().join(', '), needsAnswers: true }));\n }\n for (const parked of input.parked) {\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.PARKED_QUESTION,\n { resourceType: WorkbenchShared_ResourceType.PARKED_CODING_QUESTIONS, resourceId: parked.workbenchParkedCodingQuestionId },\n { at: parked.parkedAt ?? null, taskRef: parked.taskRef }));\n }\n /*\n * Files a build task's runs left uncommitted that nothing will commit on its own (#3267): one line per task, naming\n * each file and its runs. It never stays silently uncommitted; the CLI prints the two doors.\n */\n const leftoversByTask = new Map<string, Array<{ readonly path: string; readonly runTaskIds: readonly string[] }>>();\n for (const leftover of input.uncommittedLeftovers ?? []) leftoversByTask.set(leftover.taskRef, [...(leftoversByTask.get(leftover.taskRef) ?? []), leftover]);\n for (const [taskRef, leftovers] of leftoversByTask) {\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.RUN_LEFTOVER_UNCOMMITTED,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(taskRef) },\n { taskRef, subject: leftovers.map(describeLeftoverForHome).join('; ') }));\n }\n for (const document of input.documents) {\n /*\n * Only a document the creator ASKED FOR (a draft exists) and that still needs a fact (#1454,\n * Step 6). A permanent count of every open fact of every undrafted document would train the eye\n * to skip the number.\n */\n if (!document.drafted || document.openCount === 0) continue;\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.GOVERNANCE_DOCUMENT,\n { resourceType: WorkbenchShared_ResourceType.GOVERNANCE_DOCUMENTS, resourceId: document.workbenchGovernanceDocumentId },\n { subject: document.definitionRef }));\n }\n /*\n * The plan itself, when it can run NOTHING (#1451). The dispatch-plan row carries one entry per\n * ready task dispatch passed over, and a row with no `taskRef` that is not `exhausted` means every\n * one of them is stuck — so this is the state where the plan needs the creator rather than a\n * dispatch. One line per stuck task: each carries its own remedy.\n *\n * Beside a next task the row still lists what the selection skipped, and those are NOT shown here:\n * the plan is moving, and a line asking for something that is not blocking anything is how an\n * ASKED list stops being read.\n */\n for (const row of input.dispatchPlan) {\n // A repair owed is a run still to make, so nothing is asked of a person yet (#3258).\n if (row.taskRef !== null || row.exhausted || row.specificationRepairOwed === true) continue;\n const failingModules = row.failingSpecificationModules ?? [];\n if (failingModules.length > 0) {\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.SPECIFICATION_FAULT_HOLDS_THE_PLAN,\n { resourceType: WorkbenchShared_ResourceType.BUILD_DISPATCH_PLAN, resourceId: row.workbenchBuildDispatchPlanId },\n { subject: failingModules.join(', ') }));\n }\n const stuckTasks = row.stuckTasks ?? [];\n // A task waiting on a live run, its own or one writing its file, proves a run is live (#3204).\n const aRunIsLive = stuckTasks.some((stuck) => WORKBENCH_BUILD_TASK_STUCK_REASONS_WAITING_ON_A_LIVE_RUN.has(stuck.reason));\n for (const stuck of stuckTasks) {\n const ask = STUCK_REASON_ASK[stuck.reason];\n if (ask === StuckTaskAsk.NEVER || (ask === StuckTaskAsk.ASKS_ONCE_NOTHING_RUNS && aRunIsLive)) continue;\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.UNBLOCK_THE_PLAN,\n { resourceType: WorkbenchShared_ResourceType.BUILD_DISPATCH_PLAN, resourceId: row.workbenchBuildDispatchPlanId },\n { taskRef: stuck.taskRef, stuckReason: stuck.reason }));\n }\n }\n asked.sort((left, right) => {\n const rank = (ASKED_RANK[left.kind] ?? 9) - (ASKED_RANK[right.kind] ?? 9);\n return rank !== 0 ? rank : compareNewestFirst(left.at, right.at);\n });\n\n /*\n * SUGGESTION — what the creator could do next, outcome-first: the plan's next READY task, then\n * eligible playbooks producing a MISSING family before those refreshing a STALE one (a gap is\n * worth more than a refresh), capped.\n */\n const suggestions: CreationHomeLineRow[] = [];\n const next = input.dispatchPlan.find((row) => row.taskRef !== null && row.objective !== null);\n if (next && next.taskRef && next.objective) {\n suggestions.push(line(WorkbenchCreationHomeSection.SUGGESTION, WorkbenchCreationHomeLineKind.CONTINUE_THE_PLAN,\n { resourceType: WorkbenchShared_ResourceType.BUILD_DISPATCH_PLAN, resourceId: next.workbenchBuildDispatchPlanId },\n { taskRef: next.taskRef, subject: next.objective }));\n }\n const missingFamilies = new Set(\n input.artifacts.filter((artifact) => artifact.state === WorkbenchSpecificationArtifactState.NOT_LANDED).map((artifact) => artifact.family),\n );\n const producing: CreationHomeLineRow[] = [];\n const refreshing: CreationHomeLineRow[] = [];\n for (const playbook of input.playbooks) {\n if (!playbook.eligible) continue;\n const target = { resourceType: WorkbenchShared_ResourceType.PLAYBOOKS, resourceId: playbook.workbenchPlaybookId };\n const facts = { playbookRef: playbook.playbookRef, needsAnswers: playbook.unansweredQuestionRefs.length > 0 };\n if (playbook.outputOwners.some((owner) => missingFamilies.has(owner.family))) {\n producing.push(line(WorkbenchCreationHomeSection.SUGGESTION, WorkbenchCreationHomeLineKind.PRODUCE_MISSING, target, facts));\n } else if (playbook.staleOutputs.length > 0) {\n refreshing.push(line(WorkbenchCreationHomeSection.SUGGESTION, WorkbenchCreationHomeLineKind.REFRESH_STALE, target, facts));\n }\n }\n const playbookSuggestions = [...producing, ...refreshing].slice(0, HOME_PLAYBOOK_SUGGESTION_COUNT);\n\n /*\n * A follow-up that LANDED while its latest completed run still reports a requirement unmet (#2583). It landed\n * RAN-not-PROVEN, because holding it unlanded put the whole plan behind a person's decision, the defect\n * `application-creation-directive.md` names. So this is ADVISORY, a SUGGESTION: it never makes anything ineligible and\n * never stops the loop. It names each requirement and what the run said is missing; the door is running it again on\n * purpose, which every renderer prints beside it (`wildo build run <ref> --despite-landed --reason operator-judgement\n * --note \"<why>\"`). Without it the gap was visible only to someone who asked (`wildo context journey`).\n */\n const followUpGaps = (input.followUpsLandedWithGaps ?? []).filter((followUp) => followUp.unmetRequirements.length > 0).map((followUp) => line(\n WorkbenchCreationHomeSection.SUGGESTION, WorkbenchCreationHomeLineKind.FOLLOW_UP_LANDED_WITH_GAP,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(followUp.taskRef) },\n { taskRef: followUp.taskRef, subject: followUp.unmetRequirements.map((gap) => `${gap.requirementRef}: ${gap.missing}`).join('; ') },\n ));\n\n /*\n * A task that LANDED with something its landing does not cover left unfinished (#3285): a billing catalogue committed\n * while the backend does not enable billing. ADVISORY, like a follow-up's gap: the task stays landed and nothing stops,\n * because the remedy (a provider secret) is the person's and the switch alone fails backend startup. Without it the\n * mark was visible only on `wildo build tasks` and `wildo creation why`.\n */\n const landingAdvisories = (input.landedTasksWithAdvisories ?? []).filter((task) => task.advisories.length > 0).map((task) => line(\n WorkbenchCreationHomeSection.SUGGESTION, WorkbenchCreationHomeLineKind.LANDED_WITH_ADVISORY,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(task.taskRef) },\n { taskRef: task.taskRef, subject: task.advisories.map((advisory) => `${advisory.setting} (${advisory.settingPath})`).join('; ') },\n ));\n\n return [...since, ...asked, ...suggestions, ...followUpGaps, ...landingAdvisories, ...playbookSuggestions];\n}\n\n/**\n * Every specification family belongs to exactly ONE outcome, and the map is TOTAL by construction:\n * `Record<ApplicationSpecificationFamily, …>` makes a family added to the semantic authority a\n * compile error here until it is placed. That is the property the page's mock promised — \"derived\n * from what exists\" — and the reason this is a typed record rather than a lookup with a default.\n *\n * `RISK_REGISTER` is under the rules rather than under what-we-build: it says what the exposure\n * MEANS, which is an obligation, and its playbook is in the compliance analysis.\n *\n * `null` is a placement too, and the map stays total: `CREATOR_INPUTS` — the dossier — is INPUT the\n * creator gives, never a deliverable a step produces, so counting it toward an outcome would make\n * \"know what we build\" one answer closer to done for having been asked a question. A family placed\n * `null` is measured by nothing; the compiler still refuses a family placed nowhere.\n */\nexport const OUTCOME_BY_FAMILY: Readonly<Record<ApplicationSpecificationFamily, WorkbenchCreationOutcome | null>> = {\n [ApplicationSpecificationFamily.VISION_BRIEF]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n [ApplicationSpecificationFamily.MARKET_SNAPSHOT]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n [ApplicationSpecificationFamily.REQUIREMENTS]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n [ApplicationSpecificationFamily.FEATURE_DRAFTS]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n [ApplicationSpecificationFamily.BUSINESS_MODEL]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n [ApplicationSpecificationFamily.ROADMAP]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n [ApplicationSpecificationFamily.BRAND_BRIEF]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n /* KNOW_WHAT_WE_BUILD with the brand it names: the name is part of what the product IS. */\n [ApplicationSpecificationFamily.BRAND_NAME_SCREENING]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n /* KNOW_WHAT_WE_BUILD: the firm's method is what the product is FOR, decided before the plans built from it. */\n [ApplicationSpecificationFamily.SERVICE_METHOD]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n /* KNOW_THE_RULES: which regimes apply is the first thing the rules are (#3362). */\n [ApplicationSpecificationFamily.COMPLIANCE_POSTURE]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.COMPLIANCE_PROGRAM]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.COMPLIANCE_DOCUMENT_CANDIDATE]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.COMPLIANCE_DOCUMENT_CANDIDATE_SET]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.DOCUMENT_RELEASE_POLICY]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.DOCUMENT_FACTS]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.DOCUMENT_FACTS_AUTHORED]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.PROCESSOR_REGISTER]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.RISK_REGISTER]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.DOMAIN_PLAN]: WorkbenchCreationOutcome.APPLICATION_WORKS,\n [ApplicationSpecificationFamily.PLACEMENT_PLAN]: WorkbenchCreationOutcome.APPLICATION_WORKS,\n [ApplicationSpecificationFamily.BUILD_PLAN]: WorkbenchCreationOutcome.APPLICATION_WORKS,\n // Which optional packages the application is composed with — part of the application working, like its placement (#1491).\n [ApplicationSpecificationFamily.CAPABILITY_COMPOSITION]: WorkbenchCreationOutcome.APPLICATION_WORKS,\n /*\n * READY_FOR_A_REAL_USER, not APPLICATION_WORKS: an application works without a marketing site, and\n * what the site says is what a stranger meets first (#1492). The same reading the governed\n * documents carry — the outcome is about facing the public, not about the product functioning.\n */\n [ApplicationSpecificationFamily.WEBSITE_PLAN]: WorkbenchCreationOutcome.READY_FOR_A_REAL_USER,\n /* Same reading as the website: documentation is what a stranger meets, not what makes the product work. */\n [ApplicationSpecificationFamily.DOCUMENTATION_PLAN]: WorkbenchCreationOutcome.READY_FOR_A_REAL_USER,\n /* APPLICATION_WORKS: without a composed shell there is no route to the generated screens (#1493). */\n [ApplicationSpecificationFamily.EXPERIENCE_PLAN]: WorkbenchCreationOutcome.APPLICATION_WORKS,\n /*\n * APPLICATION_WORKS: a worker the backend delegates to, and a minion that keeps the data true,\n * are part of the product functioning — not of it facing a stranger (#1495). An application whose\n * nightly sweep was never planned works wrongly in a way no screen shows.\n */\n [ApplicationSpecificationFamily.INTEGRATION_PLAN]: WorkbenchCreationOutcome.APPLICATION_WORKS,\n /*\n * `null`, and this one is the most important null in the map (#1496): the maturity reading is a\n * MEASUREMENT OF the outcomes, so counting it toward one would let an application advance for\n * having measured itself. It is also never \"done\" by construction — the next requirement lowers\n * it — so an outcome that waited for it could never complete.\n */\n [ApplicationSpecificationFamily.APPLICATION_MATURITY]: null,\n [ApplicationSpecificationFamily.DOCUMENT_PUBLICATION]: WorkbenchCreationOutcome.READY_FOR_A_REAL_USER,\n [ApplicationSpecificationFamily.DOCUMENT_RELEASE_SET]: WorkbenchCreationOutcome.READY_FOR_A_REAL_USER,\n [ApplicationSpecificationFamily.CREATOR_INPUTS]: null,\n /*\n * `null` for the same reason as the dossier: the expert-persona charters STAFF the panels that decide\n * placement and the logo; they say nothing about the product itself, so counting them toward an outcome\n * would move \"application works\" for having hired reviewers (#572).\n */\n [ApplicationSpecificationFamily.EXPERT_PERSONAS]: null,\n};\n\nexport interface CreationOutcomeInputs {\n /** The artifact projection's rows, one per family it knows. */\n readonly artifacts: readonly { readonly family: string; readonly state: WorkbenchSpecificationArtifactState }[];\n /** Every family some playbook reports as stale — the union of `staleOutputs[].family` over the playbook rows. */\n readonly staleFamilies: ReadonlySet<string>;\n /** The build-plan task rows. */\n readonly tasks: readonly CreationOutcomeTaskRow[];\n /**\n * The build's progress fault (#3258). The rows say `landed` for a step that only ran, so the count is corrected from here,\n * and while it is present no outcome that waits on the build is done.\n */\n readonly specificationFault?: BuildPlanSpecificationFault;\n /**\n * The application's runtimes a live supervisor has paused or is crash-looping (`readUnavailableApplicationRuntimes`,\n * #3365), or undefined when none could answer (#1537).\n */\n readonly unavailableRuntimes?: readonly string[];\n}\n\n/**\n * Where the application stands, outcome by outcome — always four rows, in reading order. \"Done\" is\n * strict: every family of the outcome landed, valid and not stale; for the application working,\n * every build task landed too; for readiness, every OTHER outcome done as well — an application is\n * not ready for a real user because its documents are published while its build plan is\n * half-landed.\n *\n * A family the projection does not report is not counted against an outcome: the population is the\n * reported rows, filtered through the total map, never the map alone.\n */\nexport function buildCreationOutcomes(input: CreationOutcomeInputs): readonly CreationOutcomeRow[] {\n const isFamily = (value: string): value is ApplicationSpecificationFamily => Object.prototype.hasOwnProperty.call(OUTCOME_BY_FAMILY, value);\n\n const counts = new Map<WorkbenchCreationOutcome, { total: number; landed: number; invalid: number; missing: number; stale: number }>();\n for (const outcome of WORKBENCH_CREATION_OUTCOMES_IN_ORDER) counts.set(outcome, { total: 0, landed: 0, invalid: 0, missing: 0, stale: 0 });\n for (const artifact of input.artifacts) {\n if (!isFamily(artifact.family)) continue;\n const outcome = OUTCOME_BY_FAMILY[artifact.family];\n if (outcome === null) continue;\n const count = counts.get(outcome)!;\n count.total += 1;\n if (artifact.state === WorkbenchSpecificationArtifactState.NOT_LANDED) count.missing += 1;\n else if (artifact.state === WorkbenchSpecificationArtifactState.LANDED_INVALID || artifact.state === WorkbenchSpecificationArtifactState.UNAVAILABLE) count.invalid += 1;\n else if (input.staleFamilies.has(artifact.family)) count.stale += 1;\n else count.landed += 1;\n }\n\n const tasksTotal = input.tasks.length;\n // A step that only ran is not landed for this count (#3258), and under a live fault nothing here is done (below).\n const ranNotProven = new Set(input.specificationFault?.ranNotProvenTaskRefs ?? []);\n const tasksLanded = input.tasks.filter((task) => task.status === WorkbenchBuildPlanTaskStatus.LANDED && !ranNotProven.has(task.taskRef)).length;\n\n const statusOf = (count: { total: number; landed: number; invalid: number; stale: number }, extraDone: boolean, extraStarted: boolean): WorkbenchCreationOutcomeStatus => {\n const familiesDone = count.total > 0 && count.landed === count.total;\n if (familiesDone && extraDone) return WorkbenchCreationOutcomeStatus.DONE;\n const started = count.landed + count.invalid + count.stale > 0 || extraStarted;\n return started ? WorkbenchCreationOutcomeStatus.IN_PROGRESS : WorkbenchCreationOutcomeStatus.NOT_STARTED;\n };\n\n const rows = new Map<WorkbenchCreationOutcome, CreationOutcomeRow>();\n WORKBENCH_CREATION_OUTCOMES_IN_ORDER.forEach((outcome, position) => {\n const count = counts.get(outcome)!;\n const families = {\n familiesTotal: count.total, familiesLanded: count.landed, familiesInvalid: count.invalid, familiesMissing: count.missing, familiesStale: count.stale,\n };\n if (outcome === WorkbenchCreationOutcome.APPLICATION_WORKS) {\n /*\n * An application that cannot start does not work, whatever has landed (#1537). Measured on the\n * first end-to-end run: the backend was paused by its supervisor for hours while this row read\n * as progress. Never DONE while a runtime is down; still IN_PROGRESS, because the work landed so\n * far is real — the row says what it is, and `unavailableRuntimes` says what stops it.\n */\n const unavailableRuntimes = input.unavailableRuntimes === undefined ? null : [...input.unavailableRuntimes];\n const runtimeDown = unavailableRuntimes !== null && unavailableRuntimes.length > 0;\n rows.set(outcome, {\n outcome, position, ...families, tasksTotal, tasksLanded, unavailableRuntimes,\n status: statusOf(count, tasksTotal > 0 && tasksLanded === tasksTotal && !runtimeDown && input.specificationFault === undefined, tasksLanded > 0 || runtimeDown),\n });\n } else if (outcome === WorkbenchCreationOutcome.READY_FOR_A_REAL_USER) {\n const othersDone = WORKBENCH_CREATION_OUTCOMES_IN_ORDER\n .filter((other) => other !== outcome)\n .every((other) => rows.get(other)?.status === WorkbenchCreationOutcomeStatus.DONE);\n rows.set(outcome, { outcome, position, ...families, tasksTotal: null, tasksLanded: null, unavailableRuntimes: null, status: statusOf(count, othersDone, false) });\n } else {\n rows.set(outcome, { outcome, position, ...families, tasksTotal: null, tasksLanded: null, unavailableRuntimes: null, status: statusOf(count, true, false) });\n }\n });\n return WORKBENCH_CREATION_OUTCOMES_IN_ORDER.map((outcome) => rows.get(outcome)!);\n}\n\n/** What the outcomes read of a build-plan task row: its status, and its ref to tell a step that only ran (#3258). */\nexport type CreationOutcomeTaskRow = Pick<Workbench_BuildPlanTask, 'status' | 'taskRef'>;\n"]}
|
|
1
|
+
{"version":3,"file":"creation-home-projection.companion.js","sourceRoot":"","sources":["../../../../../src/core/introspection/resources/creation-home-projection.companion.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,kBAAkB,EAAE,mCAAmC,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAEL,8BAA8B,EAC9B,wDAAwD,EACxD,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC5B,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC5B,mCAAmC,EACnC,oCAAoC,EACpC,sCAAsC,GAWvC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,mCAAmC,EAA8B,MAAM,4DAA4D,CAAC;AAyB7I,4EAA4E;AAC5E,MAAM,C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AAE,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;QAC9J,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,oCAAoC,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAE,CAAC,CAAC;AACnF,CAAC","sourcesContent":["import type { BuildPlanSpecificationFault, PlaybookDatedByWaitingInterview } from '@wildo-ai/application-creation-runtime';\nimport { ApplicationSpecificationFamily } from '@wildo-ai/saas-specifications/application-creation';\nimport { FlowsActors_Status, describeModelProviderAccountRefusal } from '@wildo-ai/saas-models';\nimport {\n type BuildTaskClosureKind,\n Workbench_BuildTaskStuckReason,\n WORKBENCH_BUILD_TASK_STUCK_REASONS_WAITING_ON_A_LIVE_RUN,\n Workbench_PlaybookRunState,\n WorkbenchBuildPlanTaskStatus,\n WorkbenchCreationHomeLineKind,\n WorkbenchCreationHomeSection,\n WorkbenchCreationOutcome,\n WorkbenchCreationOutcomeStatus,\n WorkbenchShared_ResourceType,\n WorkbenchSpecificationArtifactState,\n WORKBENCH_CREATION_OUTCOMES_IN_ORDER,\n sanitizeWorkbenchCreationPlaneIdentity,\n type Workbench_BuildDispatch,\n type Workbench_BuildDispatchPlan,\n type Workbench_BuildPlanTask,\n type Workbench_CreationHomeLine,\n type Workbench_CreationOutcome,\n type Workbench_GovernanceDocument,\n type Workbench_ParkedCodingQuestion,\n type Workbench_Playbook,\n type Workbench_PlaybookRun,\n type Workbench_WaitingPlaybookRun,\n} from '@wildo-ai/platform-core-shared';\n\nimport { describeCodingAgentUsageLimitResume, type CodingAgentUsageLimit } from '../../../claude-cli/models/coding-agent-usage-limit.models';\n\n/**\n * HOME, derived (#1454): the lines the conversation page opens on, and where the application\n * stands — pure functions of the creation-plane rows the projection service already computes.\n *\n * ## Why here and not in the page\n *\n * Until 2026-09-22 the workbench read seven resources on their own cadences and derived every one\n * of these facts itself, on every poll, in three modules nothing but the page could reach. A line\n * is a FACT about the application (\"this run was refused\", \"this task's writes wait to be\n * committed\", \"this step can run and its output is missing\"); facts are derived where the rows are,\n * once, and served as rows (`derive-before-you-ask.md`). The page renders; the assistant's tools read\n * the same rows; and a test of the derivation is a test of what every reader sees.\n *\n * Both builders take the ROWS — the projected shapes the resources serve — rather than the companion\n * services' own records, so a fact is decided from exactly what a reader could see, never from a\n * field the projection dropped.\n */\n\n/** The row shape the home-lines projection emits, before the identity is stamped. */\nexport type CreationHomeLineRow = Omit<Workbench_CreationHomeLine, 'workbenchCreationHomeLineId'>;\n/** The row shape the outcomes projection emits, before the identity is stamped. */\nexport type CreationOutcomeRow = Omit<Workbench_CreationOutcome, 'workbenchCreationOutcomeId'>;\n\n/** How many playbook suggestions Home shows beside the plan's next step. */\nexport const HOME_PLAYBOOK_SUGGESTION_COUNT = 3;\n\n/** Newest first; a row with no instant sorts after every row with one. */\nfunction compareNewestFirst(left: Date | null, right: Date | null): number {\n if (left === null && right === null) return 0;\n if (left === null) return 1;\n if (right === null) return -1;\n return right.getTime() - left.getTime();\n}\n\n/**\n * The RANKING of what is asked of the creator: what stops a run that is otherwise executing comes\n * first (a clarification, a parked question); a document waiting on a fact does not block a run and\n * comes after. Within a rank, newest first.\n */\nconst ASKED_RANK: Readonly<Partial<Record<WorkbenchCreationHomeLineKind, number>>> = {\n [WorkbenchCreationHomeLineKind.CLARIFICATION]: 0,\n [WorkbenchCreationHomeLineKind.PARKED_QUESTION]: 0,\n [WorkbenchCreationHomeLineKind.GOVERNANCE_DOCUMENT]: 1,\n /*\n * Below a question (which holds a live agent session) and above a document: the plan is frozen\n * until it is unblocked, and the remedy is a fixed declaration, a re-arm or an approval.\n */\n [WorkbenchCreationHomeLineKind.UNBLOCK_THE_PLAN]: 1,\n /* A question like a clarification: answering it is what lets the work it holds run (#3361). */\n [WorkbenchCreationHomeLineKind.INTERVIEW_DATES_NEXT_WORK]: 0,\n /* Ahead of the steps it holds: fixing the module is what moves them (#3258). */\n [WorkbenchCreationHomeLineKind.SPECIFICATION_FAULT_HOLDS_THE_PLAN]: 0,\n /* Beside a frozen plan: nothing runs on it, and it stays uncommitted until the creator commits or discards it (#3267). */\n [WorkbenchCreationHomeLineKind.RUN_LEFTOVER_UNCOMMITTED]: 1,\n};\n\n/** Whether a stuck task, on a plan that can dispatch nothing, is a thing waiting on the CREATOR (#2412). */\nenum StuckTaskAsk {\n /** It needs the creator: fix a declaration or the work, re-arm a task whose attempts are spent, or a missing blueprint. */\n ASKS = 'asks',\n /** It needs the creator only once no run of the plan is live; while one is, the wave that wrote it has yet to commit. */\n ASKS_ONCE_NOTHING_RUNS = 'asks-once-nothing-runs',\n /** Nobody's move, or already asked on a line of its own. */\n NEVER = 'never',\n}\n\n/**\n * How each stuck reason reads in ASKED. Total over the reasons, so a reason added tomorrow has to be classified here\n * rather than landing in ASKED by default.\n *\n * `app-creation-test-005` printed \"the build plan is stuck at …: in_flight\" three times, and three more lines for a\n * product awaiting its commit (a reason retired with #3514, since landing reads the working tree), in ONE running wave,\n * and the hook counted all six as questions. Neither was the creator's move:\n *\n * - `IN_FLIGHT` — a run of it is live and it clears when that run settles. NEVER.\n * - `PARKED_AWAITING_ANSWER` — its question is already a `PARKED_QUESTION` line, one per question. NEVER, or it is\n * asked twice.\n */\nconst STUCK_REASON_ASK: Readonly<Record<Workbench_BuildTaskStuckReason, StuckTaskAsk>> = {\n [Workbench_BuildTaskStuckReason.COMPLETED_UNLANDED]: StuckTaskAsk.ASKS,\n [Workbench_BuildTaskStuckReason.PARKED_AWAITING_ANSWER]: StuckTaskAsk.NEVER,\n [Workbench_BuildTaskStuckReason.NO_DOCUMENT_BLUEPRINT]: StuckTaskAsk.ASKS,\n [Workbench_BuildTaskStuckReason.ATTEMPTS_EXHAUSTED]: StuckTaskAsk.ASKS,\n [Workbench_BuildTaskStuckReason.IN_FLIGHT]: StuckTaskAsk.NEVER,\n /* #3204: it starts when the run writing its file settles; nobody can do anything about it. */\n [Workbench_BuildTaskStuckReason.CONTENDED]: StuckTaskAsk.NEVER,\n /* #3204: the wave's end re-checks it alone, by itself; nobody can do anything about it. */\n [Workbench_BuildTaskStuckReason.AWAITING_ISOLATED_RECHECK]: StuckTaskAsk.NEVER,\n /*\n * #3223: a generation step whose landing check could not be answered. Usually it heals by itself (an introspection or a\n * CLI still warming), and Home asks only when nothing else can run — then the check is persistently unanswerable, and the\n * dispatch refusal names the check and the command that shows what the creator has to repair.\n */\n [Workbench_BuildTaskStuckReason.LANDING_UNKNOWN]: StuckTaskAsk.ASKS,\n /* #3227: under GUIDED a derived follow-up waits for the creator's review, which only they can give. */\n [Workbench_BuildTaskStuckReason.FOLLOW_UP_AWAITING_REVIEW]: StuckTaskAsk.ASKS,\n /*\n * Stale expert charters are repaired by the build-dispatch step, which runs the staffing step on its own. Asked only once\n * nothing runs: then the repair did not take, or a person edited a charter, whose remedy is theirs.\n */\n [Workbench_BuildTaskStuckReason.STALE_EXPERT_CHARTERS]: StuckTaskAsk.ASKS_ONCE_NOTHING_RUNS,\n /*\n * #3709: a generation step failing the same way on unchanged inputs. Its cause needs a fix, often outside the\n * application (an engine's examples, an engine label key), and only a person makes it: asked, like an exhausted budget.\n */\n [Workbench_BuildTaskStuckReason.REPEATED_IDENTICAL_FAILURE]: StuckTaskAsk.ASKS,\n /* #3709: a step failing on a cause the framework owns. Only a framework fix and a person's re-run clear it: asked. */\n [Workbench_BuildTaskStuckReason.FAILURE_OUTSIDE_APPLICATION]: StuckTaskAsk.ASKS,\n};\n\nexport interface CreationHomeLineInputs {\n readonly runs: readonly Workbench_PlaybookRun[];\n readonly dispatches: readonly Workbench_BuildDispatch[];\n readonly waiting: readonly Workbench_WaitingPlaybookRun[];\n readonly parked: readonly Workbench_ParkedCodingQuestion[];\n readonly documents: readonly Workbench_GovernanceDocument[];\n readonly dispatchPlan: readonly Workbench_BuildDispatchPlan[];\n readonly playbooks: readonly Workbench_Playbook[];\n /** Every family the artifact projection reports, with its state. */\n readonly artifacts: readonly { readonly family: string; readonly state: WorkbenchSpecificationArtifactState }[];\n /**\n * The coding agent's usage limit holding the build NOW (#2388) — the dispatch service's live hold, which is the\n * pause itself, so the line exists exactly while the build is paused. Absent when nothing holds it.\n */\n readonly codingAgentUsageLimit?: CodingAgentUsageLimit & { readonly taskRef: string };\n /**\n * The network loss holding coding admissions NOW (#3236, #3262) — the dispatch service's live connectivity hold, so the\n * line exists exactly while no coding turn is admitted. `route` is the probe's route in words, absent when none is known.\n */\n readonly codingAgentConnectivityHold?: { readonly observedAt: string; readonly taskRef: string; readonly route?: string };\n /**\n * The host cause holding coding admissions NOW (#3423, #3432): the dispatch service's live hold, so the line exists\n * exactly while no coding turn is admitted for it. `cause` is the cause and its remedy in one sentence\n * (`describeVerificationHostCause`): an absent command, a command lacking the verb, or a check that cannot be asked the\n * same way on two tasks.\n */\n readonly verificationToolUnavailableHold?: { readonly observedAt: string; readonly taskRef: string; readonly cause: string };\n /** The instant the resume time is worded against (its date shows when it is not today); the read's own when omitted. */\n readonly now?: Date;\n /**\n * The build tasks a person CLOSED (`wildo build close`, #3224, #3227) whose closure counts now: one SINCE line each, so\n * the feed and Home say that a person, not a probe, settled them. The line carries the person's own words only; how the\n * closure accounts for the task (its kind, what satisfied it) is on the task's record, worded from the vocabulary.\n */\n readonly closures?: readonly { readonly taskRef: string; readonly kind: BuildTaskClosureKind; readonly satisfiedBy?: string; readonly reason: string; readonly closedAt: string }[];\n /**\n * The derived follow-ups that landed while their latest completed run still reports a requirement unmet (#2583): one\n * ADVISORY suggestion each. A projection of the follow-up's landing and that run's report, never a stored state.\n */\n readonly followUpsLandedWithGaps?: readonly { readonly taskRef: string; readonly unmetRequirements: readonly { readonly requirementRef: string; readonly missing: string }[] }[];\n /**\n * Files a task's coding runs left uncommitted that no automatic door will commit (#3267; a stuck task's declared product aside, #3204), from the commit door's own\n * reading of the write register and the tree (`listUncommittedRunLeftovers`): one ASKED line per task.\n */\n readonly uncommittedLeftovers?: readonly { readonly taskRef: string; readonly path: string; readonly runTaskIds: readonly string[] }[];\n /**\n * The LANDED tasks carrying a landing advisory (#3285, `readLandedTasksWithAdvisories`): one ADVISORY suggestion each,\n * naming each setting still to set and its file. Derived from the committed tree, never stored.\n */\n readonly landedTasksWithAdvisories?: readonly { readonly taskRef: string; readonly advisories: readonly { readonly setting: string; readonly settingPath: string }[] }[];\n /**\n * The steps an unattended round withholds because an interview still waiting on the person would date them (#3361), from\n * the eligibility board (`findReadersDatedByWaitingInterviews`): one ASKED line per waiting interview.\n */\n readonly datedByWaitingInterviews?: readonly PlaybookDatedByWaitingInterview[];\n}\n\n/** One leftover in a Home line's subject: the file, and the runs whose record holds it as it is now (#3267). */\nfunction describeLeftoverForHome(leftover: { readonly path: string; readonly runTaskIds: readonly string[] }): string {\n return `${leftover.path} (recorded by ${leftover.runTaskIds.length === 1 ? 'run' : 'runs'} ${leftover.runTaskIds.join(', ')})`;\n}\n\n\n/**\n * When a build dispatch ENDED, and whether it failed — or `null` while it has not (#2523).\n *\n * Read from the dispatch's RUN — the execution it is — for both executors. Home used to read the phase, which\n * is a generation step's outcome but only a coding run's hand-off (it stops at ADMITTED by design), so no\n * coding run ever appeared as settled. A dispatch refused before its run started ends its execution too\n * (ABORTED or FAILED), so it is read the same way.\n */\nexport function dispatchEnding(dispatch: Workbench_BuildDispatch): { readonly at: Date | null; readonly failed: boolean } | null {\n if (!RUN_HAS_ENDED[dispatch.runStatus]) return null;\n return { at: dispatch.runFinishedAt ?? dispatch.settledAt ?? null, failed: dispatch.runStatus !== FlowsActors_Status.COMPLETED };\n}\n\n/**\n * Which execution statuses END a run. Total over the vocabulary, so a status added to it is a compile error\n * here rather than a run Home silently never lists. A run waiting on an answer has not ended: it parks and\n * resumes under the same execution.\n */\nconst RUN_HAS_ENDED: Record<FlowsActors_Status, boolean> = {\n [FlowsActors_Status.READY]: false,\n [FlowsActors_Status.PENDING]: false,\n [FlowsActors_Status.PROCESSING]: false,\n [FlowsActors_Status.AWAITING_APPROVAL]: false,\n [FlowsActors_Status.COMPLETED]: true,\n [FlowsActors_Status.FAILED]: true,\n [FlowsActors_Status.CANCELLED]: true,\n [FlowsActors_Status.ABORTED]: true,\n};\n\n/**\n * The re-runs inside a run's lanes that did not land while their family's earlier landing stands (#3213), latest failure\n * per playbook, in the order they first appear. A landing STANDS — the runtime's own rule (`landingStands` in the\n * choreography) — when the child re-ran over a landing the record held (`reranOverLanding`: a REFRESH, or a CURRENT\n * landing re-opened), or when an earlier round of this run landed it. A FIRST run that failed left nothing to stand and\n * is never one: `ranBecause` cannot tell them apart, since it is written for a first run too.\n */\nfunction failedRepairsOf(run: Workbench_PlaybookRun): ReadonlyArray<{ readonly playbookRef: string; readonly failure: string }> {\n const latest = new Map<string, string>();\n const landedInThisRun = new Set<string>();\n for (const round of run.choreographyRounds ?? []) {\n for (const child of round.children) {\n if (child.failure === null) {\n // A run of the playbook that landed: it delivered (so a later failure stands on it), and it repaired any earlier one.\n if (child.landed.length > 0) landedInThisRun.add(child.playbookRef);\n latest.delete(child.playbookRef);\n } else if (child.reranOverLanding === true || landedInThisRun.has(child.playbookRef)) {\n latest.set(child.playbookRef, child.failure);\n }\n }\n }\n return [...latest].map(([playbookRef, failure]) => ({ playbookRef, failure }));\n}\n\n/**\n * Every line of Home, all three sections. SINCE lines are NOT windowed here: \"since the creator was\n * last here\" is a per-viewer fact the page keeps in its own browser, so the page cuts the list; the\n * projection serves every settled run and dispatch it knows, newest first, and every interrupted\n * run whatever its date.\n */\nexport function buildCreationHomeLines(input: CreationHomeLineInputs): readonly CreationHomeLineRow[] {\n const line = (\n section: WorkbenchCreationHomeSection,\n kind: WorkbenchCreationHomeLineKind,\n target: { resourceType: WorkbenchShared_ResourceType; resourceId: string },\n facts: Partial<Pick<CreationHomeLineRow, 'at' | 'playbookRef' | 'taskRef' | 'subject' | 'failed' | 'acceptable' | 'needsAnswers' | 'stuckReason'>> = {},\n ): CreationHomeLineRow => ({\n section,\n kind,\n at: null,\n playbookRef: null,\n taskRef: null,\n subject: null,\n failed: false,\n acceptable: false,\n needsAnswers: false,\n stuckReason: null,\n targetResourceType: target.resourceType,\n targetResourceId: target.resourceId,\n ...facts,\n });\n\n /* SINCE — what happened. */\n const since: CreationHomeLineRow[] = [];\n for (const run of input.runs) {\n const target = { resourceType: WorkbenchShared_ResourceType.PLAYBOOK_RUNS, resourceId: run.workbenchPlaybookRunId };\n if (run.state === Workbench_PlaybookRunState.COMPLETED) {\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.RUN_COMPLETED, target, {\n at: run.finishedAt ?? null, playbookRef: run.playbookRef, failed: run.ok === false,\n }));\n /*\n * A RE-RUN inside the run's lanes that did not land, over a landing that stands (#3213): a NON-FATAL repair failure.\n * A failed repair of `build-decompose` used to read only as the lane's REFUSED line, so a person read the whole\n * build as failed while the plan on disk still dispatched. Said once per run, naming every such re-run: a child that\n * re-ran over a recorded landing (`reranOverLanding`, read from the rerun verdict's KIND) or over one this run landed,\n * and failed, kept that landing.\n */\n const failedRepairs = failedRepairsOf(run);\n if (failedRepairs.length > 0) {\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.REPAIR_FAILED_LANDING_STANDS, target, {\n at: run.finishedAt ?? null,\n playbookRef: failedRepairs[0]!.playbookRef,\n subject: failedRepairs.map((repair) => `${repair.playbookRef}: ${repair.failure}`).join('; '),\n failed: false,\n }));\n }\n } else if (run.state === Workbench_PlaybookRunState.INTERRUPTED) {\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.RUN_INTERRUPTED, target, {\n at: run.checkpointedAt ?? run.startedAt ?? null, playbookRef: run.playbookRef,\n }));\n }\n }\n for (const dispatch of input.dispatches) {\n const ending = dispatchEnding(dispatch);\n if (ending === null) continue;\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.DISPATCH_SETTLED,\n { resourceType: WorkbenchShared_ResourceType.BUILD_DISPATCHES, resourceId: dispatch.workbenchBuildDispatchId }, {\n at: ending.at,\n taskRef: dispatch.taskRef,\n failed: ending.failed,\n /*\n * The one state ACCEPT addresses: a coding run that completed, recorded writes and has none committed.\n * The row's `accepted === false` means exactly that, so it is read as is (#2523).\n */\n acceptable: dispatch.accepted === false,\n }));\n }\n /*\n * The coding agent's account usage limit, while it holds (#2388): one line saying the build is paused and when\n * it resumes. Read from the LIVE hold the dispatch service keeps, never re-derived from a dispatch row: a\n * coding run that started is projected ADMITTED however it ends and carries no error there, so a row-based\n * reading never fired in production (#2388 review F1). It opens the build-plan task whose run met the limit,\n * a row that exists for as long as the plan holds the task. `failed` stays false: the build is paused, not\n * failing, and the kind's own tone says so.\n */\n const limit = input.codingAgentUsageLimit;\n if (limit) {\n // A refused provider ACCOUNT (#3204) is its own kind: a person lifts it, nothing resets, so it never reads as a limit\n // that \"resumes on its own\". Its subject is the refusal's sentence: who refused, and where to fix it.\n since.push(line(WorkbenchCreationHomeSection.SINCE, limit.accountRefusal\n ? WorkbenchCreationHomeLineKind.CODING_AGENT_ACCOUNT_REFUSED\n : WorkbenchCreationHomeLineKind.CODING_AGENT_USAGE_LIMITED,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(limit.taskRef) }, {\n at: new Date(limit.observedAt),\n taskRef: limit.taskRef,\n subject: limit.accountRefusal\n ? describeModelProviderAccountRefusal(limit.accountRefusal)\n : describeCodingAgentUsageLimitResume(limit, input.now ?? new Date()),\n }));\n }\n /*\n * The coding agent lost the network (#3236, #3262): one line while the connectivity hold lasts, read from the LIVE\n * hold for the same reason as the usage limit's. Before it, a wave waiting up to twenty minutes on a probe looked\n * stalled, and the hold was a WARN in the companion's log. `failed` stays false: the build is waiting, not failing.\n */\n const connectivity = input.codingAgentConnectivityHold;\n if (connectivity) {\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.CODING_AGENT_CONNECTIVITY_LOST,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(connectivity.taskRef) }, {\n at: Number.isNaN(Date.parse(connectivity.observedAt)) ? null : new Date(connectivity.observedAt),\n taskRef: connectivity.taskRef,\n subject: connectivity.route ?? null,\n }));\n }\n /*\n * A verification check cannot be asked for a host cause (#3423, #3432): one line while the hold lasts, read from the LIVE\n * hold like the two above, its subject the cause and remedy. `failed` stays false: nothing the creation built is lost.\n */\n const toolHold = input.verificationToolUnavailableHold;\n if (toolHold) {\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.VERIFICATION_TOOL_UNAVAILABLE,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(toolHold.taskRef) }, {\n at: Number.isNaN(Date.parse(toolHold.observedAt)) ? null : new Date(toolHold.observedAt),\n taskRef: toolHold.taskRef,\n subject: toolHold.cause,\n }));\n }\n /* A person closed a build task (#3224, #3227): `subject` is their reason, in their words; the kind is on the task's record. */\n for (const closure of input.closures ?? []) {\n since.push(line(WorkbenchCreationHomeSection.SINCE, WorkbenchCreationHomeLineKind.BUILD_TASK_CLOSED,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(closure.taskRef) }, {\n at: Number.isNaN(Date.parse(closure.closedAt)) ? null : new Date(closure.closedAt),\n taskRef: closure.taskRef,\n subject: closure.reason,\n }));\n }\n since.sort((left, right) => compareNewestFirst(left.at, right.at));\n\n /* ASKED — what blocks something NOW and waits on the creator. */\n const asked: CreationHomeLineRow[] = [];\n for (const waiting of input.waiting) {\n /* An unreadable checkpoint is a condition to show on its own row, not a question anyone can answer. */\n if (!waiting.readable) continue;\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.CLARIFICATION,\n { resourceType: WorkbenchShared_ResourceType.WAITING_PLAYBOOK_RUNS, resourceId: waiting.workbenchWaitingPlaybookRunId },\n { at: waiting.suspendedAt ?? null, playbookRef: waiting.playbookRef ?? null }));\n }\n /*\n * An interview waiting on the creator whose answer would date work the next unattended round could run (#3361). The\n * round withholds that work, so the line is what moves it: answering lets it run once, on the answer. One line per\n * interview, naming the steps it holds; it opens the interview's playbook, whose way in is the interview.\n */\n const heldByInterview = new Map<string, string[]>();\n for (const dated of input.datedByWaitingInterviews ?? []) {\n for (const waiting of dated.waitingOn) heldByInterview.set(waiting.interviewRef, [...(heldByInterview.get(waiting.interviewRef) ?? []), dated.readerRef]);\n }\n for (const [interviewRef, readerRefs] of heldByInterview) {\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.INTERVIEW_DATES_NEXT_WORK,\n { resourceType: WorkbenchShared_ResourceType.PLAYBOOKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(interviewRef) },\n { playbookRef: interviewRef, subject: [...new Set(readerRefs)].sort().join(', '), needsAnswers: true }));\n }\n for (const parked of input.parked) {\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.PARKED_QUESTION,\n { resourceType: WorkbenchShared_ResourceType.PARKED_CODING_QUESTIONS, resourceId: parked.workbenchParkedCodingQuestionId },\n { at: parked.parkedAt ?? null, taskRef: parked.taskRef }));\n }\n /*\n * Files a build task's runs left uncommitted that nothing will commit on its own (#3267): one line per task, naming\n * each file and its runs. It never stays silently uncommitted; the CLI prints the two doors.\n */\n const leftoversByTask = new Map<string, Array<{ readonly path: string; readonly runTaskIds: readonly string[] }>>();\n for (const leftover of input.uncommittedLeftovers ?? []) leftoversByTask.set(leftover.taskRef, [...(leftoversByTask.get(leftover.taskRef) ?? []), leftover]);\n for (const [taskRef, leftovers] of leftoversByTask) {\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.RUN_LEFTOVER_UNCOMMITTED,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(taskRef) },\n { taskRef, subject: leftovers.map(describeLeftoverForHome).join('; ') }));\n }\n for (const document of input.documents) {\n /*\n * Only a document the creator ASKED FOR (a draft exists) and that still needs a fact (#1454,\n * Step 6). A permanent count of every open fact of every undrafted document would train the eye\n * to skip the number.\n */\n if (!document.drafted || document.openCount === 0) continue;\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.GOVERNANCE_DOCUMENT,\n { resourceType: WorkbenchShared_ResourceType.GOVERNANCE_DOCUMENTS, resourceId: document.workbenchGovernanceDocumentId },\n { subject: document.definitionRef }));\n }\n /*\n * The plan itself, when it can run NOTHING (#1451). The dispatch-plan row carries one entry per\n * ready task dispatch passed over, and a row with no `taskRef` that is not `exhausted` means every\n * one of them is stuck — so this is the state where the plan needs the creator rather than a\n * dispatch. One line per stuck task: each carries its own remedy.\n *\n * Beside a next task the row still lists what the selection skipped, and those are NOT shown here:\n * the plan is moving, and a line asking for something that is not blocking anything is how an\n * ASKED list stops being read.\n */\n for (const row of input.dispatchPlan) {\n // A repair owed is a run still to make, so nothing is asked of a person yet (#3258).\n if (row.taskRef !== null || row.exhausted || row.specificationRepairOwed === true) continue;\n const failingModules = row.failingSpecificationModules ?? [];\n if (failingModules.length > 0) {\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.SPECIFICATION_FAULT_HOLDS_THE_PLAN,\n { resourceType: WorkbenchShared_ResourceType.BUILD_DISPATCH_PLAN, resourceId: row.workbenchBuildDispatchPlanId },\n { subject: failingModules.join(', ') }));\n }\n const stuckTasks = row.stuckTasks ?? [];\n // A task waiting on a live run, its own or one writing its file, proves a run is live (#3204).\n const aRunIsLive = stuckTasks.some((stuck) => WORKBENCH_BUILD_TASK_STUCK_REASONS_WAITING_ON_A_LIVE_RUN.has(stuck.reason));\n for (const stuck of stuckTasks) {\n const ask = STUCK_REASON_ASK[stuck.reason];\n if (ask === StuckTaskAsk.NEVER || (ask === StuckTaskAsk.ASKS_ONCE_NOTHING_RUNS && aRunIsLive)) continue;\n asked.push(line(WorkbenchCreationHomeSection.ASKED, WorkbenchCreationHomeLineKind.UNBLOCK_THE_PLAN,\n { resourceType: WorkbenchShared_ResourceType.BUILD_DISPATCH_PLAN, resourceId: row.workbenchBuildDispatchPlanId },\n { taskRef: stuck.taskRef, stuckReason: stuck.reason }));\n }\n }\n asked.sort((left, right) => {\n const rank = (ASKED_RANK[left.kind] ?? 9) - (ASKED_RANK[right.kind] ?? 9);\n return rank !== 0 ? rank : compareNewestFirst(left.at, right.at);\n });\n\n /*\n * SUGGESTION — what the creator could do next, outcome-first: the plan's next READY task, then\n * eligible playbooks producing a MISSING family before those refreshing a STALE one (a gap is\n * worth more than a refresh), capped.\n */\n const suggestions: CreationHomeLineRow[] = [];\n const next = input.dispatchPlan.find((row) => row.taskRef !== null && row.objective !== null);\n if (next && next.taskRef && next.objective) {\n suggestions.push(line(WorkbenchCreationHomeSection.SUGGESTION, WorkbenchCreationHomeLineKind.CONTINUE_THE_PLAN,\n { resourceType: WorkbenchShared_ResourceType.BUILD_DISPATCH_PLAN, resourceId: next.workbenchBuildDispatchPlanId },\n { taskRef: next.taskRef, subject: next.objective }));\n }\n const missingFamilies = new Set(\n input.artifacts.filter((artifact) => artifact.state === WorkbenchSpecificationArtifactState.NOT_LANDED).map((artifact) => artifact.family),\n );\n const producing: CreationHomeLineRow[] = [];\n const refreshing: CreationHomeLineRow[] = [];\n for (const playbook of input.playbooks) {\n if (!playbook.eligible) continue;\n const target = { resourceType: WorkbenchShared_ResourceType.PLAYBOOKS, resourceId: playbook.workbenchPlaybookId };\n const facts = { playbookRef: playbook.playbookRef, needsAnswers: playbook.unansweredQuestionRefs.length > 0 };\n if (playbook.outputOwners.some((owner) => missingFamilies.has(owner.family))) {\n producing.push(line(WorkbenchCreationHomeSection.SUGGESTION, WorkbenchCreationHomeLineKind.PRODUCE_MISSING, target, facts));\n } else if (playbook.staleOutputs.length > 0) {\n refreshing.push(line(WorkbenchCreationHomeSection.SUGGESTION, WorkbenchCreationHomeLineKind.REFRESH_STALE, target, facts));\n }\n }\n const playbookSuggestions = [...producing, ...refreshing].slice(0, HOME_PLAYBOOK_SUGGESTION_COUNT);\n\n /*\n * A follow-up that LANDED while its latest completed run still reports a requirement unmet (#2583). It landed\n * RAN-not-PROVEN, because holding it unlanded put the whole plan behind a person's decision, the defect\n * `application-creation-directive.md` names. So this is ADVISORY, a SUGGESTION: it never makes anything ineligible and\n * never stops the loop. It names each requirement and what the run said is missing; the door is running it again on\n * purpose, which every renderer prints beside it (`wildo build run <ref> --despite-landed --reason operator-judgement\n * --note \"<why>\"`). Without it the gap was visible only to someone who asked (`wildo context journey`).\n */\n const followUpGaps = (input.followUpsLandedWithGaps ?? []).filter((followUp) => followUp.unmetRequirements.length > 0).map((followUp) => line(\n WorkbenchCreationHomeSection.SUGGESTION, WorkbenchCreationHomeLineKind.FOLLOW_UP_LANDED_WITH_GAP,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(followUp.taskRef) },\n { taskRef: followUp.taskRef, subject: followUp.unmetRequirements.map((gap) => `${gap.requirementRef}: ${gap.missing}`).join('; ') },\n ));\n\n /*\n * A task that LANDED with something its landing does not cover left unfinished (#3285): a billing catalogue committed\n * while the backend does not enable billing. ADVISORY, like a follow-up's gap: the task stays landed and nothing stops,\n * because the remedy (a provider secret) is the person's and the switch alone fails backend startup. Without it the\n * mark was visible only on `wildo build tasks` and `wildo creation why`.\n */\n const landingAdvisories = (input.landedTasksWithAdvisories ?? []).filter((task) => task.advisories.length > 0).map((task) => line(\n WorkbenchCreationHomeSection.SUGGESTION, WorkbenchCreationHomeLineKind.LANDED_WITH_ADVISORY,\n { resourceType: WorkbenchShared_ResourceType.BUILD_PLAN_TASKS, resourceId: sanitizeWorkbenchCreationPlaneIdentity(task.taskRef) },\n { taskRef: task.taskRef, subject: task.advisories.map((advisory) => `${advisory.setting} (${advisory.settingPath})`).join('; ') },\n ));\n\n return [...since, ...asked, ...suggestions, ...followUpGaps, ...landingAdvisories, ...playbookSuggestions];\n}\n\n/**\n * Every specification family belongs to exactly ONE outcome, and the map is TOTAL by construction:\n * `Record<ApplicationSpecificationFamily, …>` makes a family added to the semantic authority a\n * compile error here until it is placed. That is the property the page's mock promised — \"derived\n * from what exists\" — and the reason this is a typed record rather than a lookup with a default.\n *\n * `RISK_REGISTER` is under the rules rather than under what-we-build: it says what the exposure\n * MEANS, which is an obligation, and its playbook is in the compliance analysis.\n *\n * `null` is a placement too, and the map stays total: `CREATOR_INPUTS` — the dossier — is INPUT the\n * creator gives, never a deliverable a step produces, so counting it toward an outcome would make\n * \"know what we build\" one answer closer to done for having been asked a question. A family placed\n * `null` is measured by nothing; the compiler still refuses a family placed nowhere.\n */\nexport const OUTCOME_BY_FAMILY: Readonly<Record<ApplicationSpecificationFamily, WorkbenchCreationOutcome | null>> = {\n [ApplicationSpecificationFamily.VISION_BRIEF]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n [ApplicationSpecificationFamily.MARKET_SNAPSHOT]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n [ApplicationSpecificationFamily.REQUIREMENTS]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n [ApplicationSpecificationFamily.FEATURE_DRAFTS]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n [ApplicationSpecificationFamily.BUSINESS_MODEL]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n [ApplicationSpecificationFamily.ROADMAP]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n [ApplicationSpecificationFamily.BRAND_BRIEF]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n /* KNOW_WHAT_WE_BUILD with the brand it names: the name is part of what the product IS. */\n [ApplicationSpecificationFamily.BRAND_NAME_SCREENING]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n /* KNOW_WHAT_WE_BUILD: the firm's method is what the product is FOR, decided before the plans built from it. */\n [ApplicationSpecificationFamily.SERVICE_METHOD]: WorkbenchCreationOutcome.KNOW_WHAT_WE_BUILD,\n /* KNOW_THE_RULES: which regimes apply is the first thing the rules are (#3362). */\n [ApplicationSpecificationFamily.COMPLIANCE_POSTURE]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.COMPLIANCE_PROGRAM]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.COMPLIANCE_DOCUMENT_CANDIDATE]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.COMPLIANCE_DOCUMENT_CANDIDATE_SET]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.DOCUMENT_RELEASE_POLICY]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.DOCUMENT_FACTS]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.DOCUMENT_FACTS_AUTHORED]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.PROCESSOR_REGISTER]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.RISK_REGISTER]: WorkbenchCreationOutcome.KNOW_THE_RULES,\n [ApplicationSpecificationFamily.DOMAIN_PLAN]: WorkbenchCreationOutcome.APPLICATION_WORKS,\n [ApplicationSpecificationFamily.PLACEMENT_PLAN]: WorkbenchCreationOutcome.APPLICATION_WORKS,\n [ApplicationSpecificationFamily.BUILD_PLAN]: WorkbenchCreationOutcome.APPLICATION_WORKS,\n // Which optional packages the application is composed with — part of the application working, like its placement (#1491).\n [ApplicationSpecificationFamily.CAPABILITY_COMPOSITION]: WorkbenchCreationOutcome.APPLICATION_WORKS,\n /*\n * READY_FOR_A_REAL_USER, not APPLICATION_WORKS: an application works without a marketing site, and\n * what the site says is what a stranger meets first (#1492). The same reading the governed\n * documents carry — the outcome is about facing the public, not about the product functioning.\n */\n [ApplicationSpecificationFamily.WEBSITE_PLAN]: WorkbenchCreationOutcome.READY_FOR_A_REAL_USER,\n /* Same reading as the website: documentation is what a stranger meets, not what makes the product work. */\n [ApplicationSpecificationFamily.DOCUMENTATION_PLAN]: WorkbenchCreationOutcome.READY_FOR_A_REAL_USER,\n /* APPLICATION_WORKS: without a composed shell there is no route to the generated screens (#1493). */\n [ApplicationSpecificationFamily.EXPERIENCE_PLAN]: WorkbenchCreationOutcome.APPLICATION_WORKS,\n /*\n * APPLICATION_WORKS: a worker the backend delegates to, and a minion that keeps the data true,\n * are part of the product functioning — not of it facing a stranger (#1495). An application whose\n * nightly sweep was never planned works wrongly in a way no screen shows.\n */\n [ApplicationSpecificationFamily.INTEGRATION_PLAN]: WorkbenchCreationOutcome.APPLICATION_WORKS,\n /*\n * `null`, and this one is the most important null in the map (#1496): the maturity reading is a\n * MEASUREMENT OF the outcomes, so counting it toward one would let an application advance for\n * having measured itself. It is also never \"done\" by construction — the next requirement lowers\n * it — so an outcome that waited for it could never complete.\n */\n [ApplicationSpecificationFamily.APPLICATION_MATURITY]: null,\n [ApplicationSpecificationFamily.DOCUMENT_PUBLICATION]: WorkbenchCreationOutcome.READY_FOR_A_REAL_USER,\n [ApplicationSpecificationFamily.DOCUMENT_RELEASE_SET]: WorkbenchCreationOutcome.READY_FOR_A_REAL_USER,\n [ApplicationSpecificationFamily.CREATOR_INPUTS]: null,\n /*\n * `null` for the same reason as the dossier: the expert-persona charters STAFF the panels that decide\n * placement and the logo; they say nothing about the product itself, so counting them toward an outcome\n * would move \"application works\" for having hired reviewers (#572).\n */\n [ApplicationSpecificationFamily.EXPERT_PERSONAS]: null,\n};\n\nexport interface CreationOutcomeInputs {\n /** The artifact projection's rows, one per family it knows. */\n readonly artifacts: readonly { readonly family: string; readonly state: WorkbenchSpecificationArtifactState }[];\n /** Every family some playbook reports as stale — the union of `staleOutputs[].family` over the playbook rows. */\n readonly staleFamilies: ReadonlySet<string>;\n /** The build-plan task rows. */\n readonly tasks: readonly CreationOutcomeTaskRow[];\n /**\n * The build's progress fault (#3258). The rows say `landed` for a step that only ran, so the count is corrected from here,\n * and while it is present no outcome that waits on the build is done.\n */\n readonly specificationFault?: BuildPlanSpecificationFault;\n /**\n * The application's runtimes a live supervisor has paused or is crash-looping (`readUnavailableApplicationRuntimes`,\n * #3365), or undefined when none could answer (#1537).\n */\n readonly unavailableRuntimes?: readonly string[];\n}\n\n/**\n * Where the application stands, outcome by outcome — always four rows, in reading order. \"Done\" is\n * strict: every family of the outcome landed, valid and not stale; for the application working,\n * every build task landed too; for readiness, every OTHER outcome done as well — an application is\n * not ready for a real user because its documents are published while its build plan is\n * half-landed.\n *\n * A family the projection does not report is not counted against an outcome: the population is the\n * reported rows, filtered through the total map, never the map alone.\n */\nexport function buildCreationOutcomes(input: CreationOutcomeInputs): readonly CreationOutcomeRow[] {\n const isFamily = (value: string): value is ApplicationSpecificationFamily => Object.prototype.hasOwnProperty.call(OUTCOME_BY_FAMILY, value);\n\n const counts = new Map<WorkbenchCreationOutcome, { total: number; landed: number; invalid: number; missing: number; stale: number }>();\n for (const outcome of WORKBENCH_CREATION_OUTCOMES_IN_ORDER) counts.set(outcome, { total: 0, landed: 0, invalid: 0, missing: 0, stale: 0 });\n for (const artifact of input.artifacts) {\n if (!isFamily(artifact.family)) continue;\n const outcome = OUTCOME_BY_FAMILY[artifact.family];\n if (outcome === null) continue;\n const count = counts.get(outcome)!;\n count.total += 1;\n if (artifact.state === WorkbenchSpecificationArtifactState.NOT_LANDED) count.missing += 1;\n else if (artifact.state === WorkbenchSpecificationArtifactState.LANDED_INVALID || artifact.state === WorkbenchSpecificationArtifactState.UNAVAILABLE) count.invalid += 1;\n else if (input.staleFamilies.has(artifact.family)) count.stale += 1;\n else count.landed += 1;\n }\n\n const tasksTotal = input.tasks.length;\n // A step that only ran is not landed for this count (#3258), and under a live fault nothing here is done (below).\n const ranNotProven = new Set(input.specificationFault?.ranNotProvenTaskRefs ?? []);\n const tasksLanded = input.tasks.filter((task) => task.status === WorkbenchBuildPlanTaskStatus.LANDED && !ranNotProven.has(task.taskRef)).length;\n\n const statusOf = (count: { total: number; landed: number; invalid: number; stale: number }, extraDone: boolean, extraStarted: boolean): WorkbenchCreationOutcomeStatus => {\n const familiesDone = count.total > 0 && count.landed === count.total;\n if (familiesDone && extraDone) return WorkbenchCreationOutcomeStatus.DONE;\n const started = count.landed + count.invalid + count.stale > 0 || extraStarted;\n return started ? WorkbenchCreationOutcomeStatus.IN_PROGRESS : WorkbenchCreationOutcomeStatus.NOT_STARTED;\n };\n\n const rows = new Map<WorkbenchCreationOutcome, CreationOutcomeRow>();\n WORKBENCH_CREATION_OUTCOMES_IN_ORDER.forEach((outcome, position) => {\n const count = counts.get(outcome)!;\n const families = {\n familiesTotal: count.total, familiesLanded: count.landed, familiesInvalid: count.invalid, familiesMissing: count.missing, familiesStale: count.stale,\n };\n if (outcome === WorkbenchCreationOutcome.APPLICATION_WORKS) {\n /*\n * An application that cannot start does not work, whatever has landed (#1537). Measured on the\n * first end-to-end run: the backend was paused by its supervisor for hours while this row read\n * as progress. Never DONE while a runtime is down; still IN_PROGRESS, because the work landed so\n * far is real — the row says what it is, and `unavailableRuntimes` says what stops it.\n */\n const unavailableRuntimes = input.unavailableRuntimes === undefined ? null : [...input.unavailableRuntimes];\n const runtimeDown = unavailableRuntimes !== null && unavailableRuntimes.length > 0;\n rows.set(outcome, {\n outcome, position, ...families, tasksTotal, tasksLanded, unavailableRuntimes,\n status: statusOf(count, tasksTotal > 0 && tasksLanded === tasksTotal && !runtimeDown && input.specificationFault === undefined, tasksLanded > 0 || runtimeDown),\n });\n } else if (outcome === WorkbenchCreationOutcome.READY_FOR_A_REAL_USER) {\n const othersDone = WORKBENCH_CREATION_OUTCOMES_IN_ORDER\n .filter((other) => other !== outcome)\n .every((other) => rows.get(other)?.status === WorkbenchCreationOutcomeStatus.DONE);\n rows.set(outcome, { outcome, position, ...families, tasksTotal: null, tasksLanded: null, unavailableRuntimes: null, status: statusOf(count, othersDone, false) });\n } else {\n rows.set(outcome, { outcome, position, ...families, tasksTotal: null, tasksLanded: null, unavailableRuntimes: null, status: statusOf(count, true, false) });\n }\n });\n return WORKBENCH_CREATION_OUTCOMES_IN_ORDER.map((outcome) => rows.get(outcome)!);\n}\n\n/** What the outcomes read of a build-plan task row: its status, and its ref to tell a step that only ran (#3258). */\nexport type CreationOutcomeTaskRow = Pick<Workbench_BuildPlanTask, 'status' | 'taskRef'>;\n"]}
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
* - so do the brand, the brand-name screening, the market snapshot and the dossier the brand name's standing is
|
|
13
13
|
* derived from (#2338), and the compliance programme whose HARD obligations are read (#55);
|
|
14
14
|
* - the providers' compliance profiles come through the application's own discovery, and the residency answer from the
|
|
15
|
-
* dossier, at the moment of the read (#2294)
|
|
15
|
+
* dossier, at the moment of the read (#2294);
|
|
16
|
+
* - each environment's `wildo.infra.<env>.config.ts` is re-loaded fresh, for what it declares about its agents'
|
|
17
|
+
* guardrails (#2292).
|
|
16
18
|
*
|
|
17
19
|
* ## Read failures are carried, never swallowed into "nothing open"
|
|
18
20
|
*
|
|
@@ -45,6 +47,8 @@ export interface LaunchBlockerPorts {
|
|
|
45
47
|
readonly readAssuranceProgram: () => Promise<NonNullable<LaunchBlockerInputs['assuranceProgram']>>;
|
|
46
48
|
/** The data-serving providers, their compliance profiles and the residency answer, for the configuration just read (#2294). */
|
|
47
49
|
readonly readProviderDataResidency: (applicationConfig: WildoSaasConfig) => Promise<NonNullable<LaunchBlockerInputs['providerDataResidency']>>;
|
|
50
|
+
/** What each authored environment declares about its agents' guardrails, its infra config loaded fresh (#2292). */
|
|
51
|
+
readonly readEnvironmentAgentGuardrails: () => Promise<NonNullable<LaunchBlockerInputs['environmentAgentGuardrails']>>;
|
|
48
52
|
}
|
|
49
53
|
/**
|
|
50
54
|
* The ports bound to this companion: the configuration re-loaded fresh (NOT `companionContext.saasConfig`, resolved
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch-blockers.companion.d.ts","sourceRoot":"","sources":["../../../../../src/core/introspection/resources/launch-blockers.companion.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"launch-blockers.companion.d.ts","sourceRoot":"","sources":["../../../../../src/core/introspection/resources/launch-blockers.companion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,OAAO,EAOL,KAAK,eAAe,EACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,EAAoG,KAAK,uBAAuB,EAAuB,MAAM,uBAAuB,CAAC;AAE5L,OAAO,EAQL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,oDAAoD,CAAC;AAG5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGxE,oFAAoF;AACpF,MAAM,WAAW,kBAAkB;IACjC,kFAAkF;IAClF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,gFAAgF;IAChF,QAAQ,CAAC,qBAAqB,EAAE,MAAM,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IACtE,sGAAsG;IACtG,QAAQ,CAAC,uBAAuB,EAAE,MAAM,OAAO,CAAC,SAAS,wBAAwB,EAAE,CAAC,CAAC;IACrF,8GAA8G;IAC9G,QAAQ,CAAC,oBAAoB,EAAE,MAAM,OAAO,CAAC,SAAS,uBAAuB,EAAE,CAAC,CAAC;IACjF,6GAA6G;IAC7G,QAAQ,CAAC,eAAe,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACzF,8FAA8F;IAC9F,QAAQ,CAAC,oBAAoB,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IACnG,+HAA+H;IAC/H,QAAQ,CAAC,yBAAyB,EAAE,CAAC,iBAAiB,EAAE,eAAe,KAAK,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAC/I,mHAAmH;IACnH,QAAQ,CAAC,8BAA8B,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC;CACxH;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,gBAAgB,EAAE,gBAAgB,EAClC,uBAAuB,EAAE,kBAAkB,CAAC,yBAAyB,CAAC,GACrE,kBAAkB,CAmDpB;AAwBD,kCAAkC;AAClC,wBAAsB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,GAAE,IAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAmFtH"}
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
* - so do the brand, the brand-name screening, the market snapshot and the dossier the brand name's standing is
|
|
13
13
|
* derived from (#2338), and the compliance programme whose HARD obligations are read (#55);
|
|
14
14
|
* - the providers' compliance profiles come through the application's own discovery, and the residency answer from the
|
|
15
|
-
* dossier, at the moment of the read (#2294)
|
|
15
|
+
* dossier, at the moment of the read (#2294);
|
|
16
|
+
* - each environment's `wildo.infra.<env>.config.ts` is re-loaded fresh, for what it declares about its agents'
|
|
17
|
+
* guardrails (#2292).
|
|
16
18
|
*
|
|
17
19
|
* ## Read failures are carried, never swallowed into "nothing open"
|
|
18
20
|
*
|
|
@@ -24,9 +26,9 @@
|
|
|
24
26
|
* set as "nothing drafted" (logged at debug). In that case the queue holds no governance question and this list reports
|
|
25
27
|
* none, without an unevaluated source — the queue itself cannot tell the two apart. Closing it belongs to the queue.
|
|
26
28
|
*/
|
|
27
|
-
import { existsSync } from 'node:fs';
|
|
28
|
-
import { join } from 'node:path';
|
|
29
|
-
import { dataServingProviderRefs, loadSaasConfig, resolveProviderComplianceProfiles } from '@wildo-ai/platform-config-lib';
|
|
29
|
+
import { existsSync, readdirSync } from 'node:fs';
|
|
30
|
+
import { join, relative } from 'node:path';
|
|
31
|
+
import { dataServingProviderRefs, loadInfraEnvConfig, loadSaasConfig, resolveAppLayout, resolveProviderComplianceProfiles, WildoLocationType, } from '@wildo-ai/platform-config-lib';
|
|
30
32
|
import { JurisdictionSlugListReadingKind, LEGAL_NOTICE_GENERATED_RELATIVE_PATH, parseJurisdictionSlugList, describeCaughtError } from '@wildo-ai/saas-models';
|
|
31
33
|
import { DATA_RESIDENCY_TERRITORIES_PLAYBOOK_REF, DATA_RESIDENCY_TERRITORIES_QUESTION_REF, createCompanionExportsFamilyReader } from '@wildo-ai/application-creation-runtime';
|
|
32
34
|
import { ApplicationCreatorInputsSchema, ApplicationSpecificationFamily, deriveLaunchBlockers, readCreatorInputAnswersForPlaybook, LaunchBlockerSource, SUBJECT_DATA_RECIPIENTS_GENERATED_RELATIVE_PATH, } from '@wildo-ai/saas-specifications/application-creation';
|
|
@@ -41,6 +43,7 @@ export function companionLaunchBlockerPorts(companionContext, readGovernanceQues
|
|
|
41
43
|
return {
|
|
42
44
|
saasRoot: companionContext.saasRoot,
|
|
43
45
|
readApplicationConfig: () => loadSaasConfig(join(companionContext.saasRoot, 'wildo.saas.config.ts'), { freshModuleCache: true }),
|
|
46
|
+
readEnvironmentAgentGuardrails: () => readEnvironmentAgentGuardrails(companionContext.saasRoot),
|
|
44
47
|
readGovernanceQuestions,
|
|
45
48
|
readDocumentReleases: async () => {
|
|
46
49
|
// No specifications package records no release — which IS the open sign-up decision, not an unread source.
|
|
@@ -88,6 +91,28 @@ export function companionLaunchBlockerPorts(companionContext, readGovernanceQues
|
|
|
88
91
|
},
|
|
89
92
|
};
|
|
90
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Each authored environment's `agentContentGuardrails` (#2292): every directory under the application's infrastructure
|
|
96
|
+
* home whose infra config loads, as the CLI enumerates environments. A directory without a config is not an environment.
|
|
97
|
+
* One that fails to load THROWS, so the source is reported unevaluated rather than read as "nothing declared".
|
|
98
|
+
*/
|
|
99
|
+
async function readEnvironmentAgentGuardrails(saasRoot) {
|
|
100
|
+
const home = resolveAppLayout(saasRoot).authoredInfrastructureHome;
|
|
101
|
+
const names = existsSync(home) ? readdirSync(home, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort() : [];
|
|
102
|
+
const entries = [];
|
|
103
|
+
for (const environment of names) {
|
|
104
|
+
const loaded = await loadInfraEnvConfig(saasRoot, environment, { freshModuleCache: true });
|
|
105
|
+
if (loaded === null)
|
|
106
|
+
continue;
|
|
107
|
+
entries.push({
|
|
108
|
+
environment,
|
|
109
|
+
local: loaded.config.locationType === WildoLocationType.LOCAL,
|
|
110
|
+
...(loaded.config.agentContentGuardrails ? { declaration: loaded.config.agentContentGuardrails } : {}),
|
|
111
|
+
declaredIn: relative(saasRoot, loaded.path),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
return entries;
|
|
115
|
+
}
|
|
91
116
|
/** The launch list, as of now. */
|
|
92
117
|
export async function readLaunchBlockers(ports, now = new Date()) {
|
|
93
118
|
const unreadableReasons = {};
|
|
@@ -134,6 +159,13 @@ export async function readLaunchBlockers(ports, now = new Date()) {
|
|
|
134
159
|
catch (error) {
|
|
135
160
|
unreadableReasons[LaunchBlockerSource.ASSURANCE_PROGRAM] = describeCaughtError(error);
|
|
136
161
|
}
|
|
162
|
+
let environmentAgentGuardrails;
|
|
163
|
+
try {
|
|
164
|
+
environmentAgentGuardrails = await ports.readEnvironmentAgentGuardrails();
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
unreadableReasons[LaunchBlockerSource.ENVIRONMENT_CONFIGS] = describeCaughtError(error);
|
|
168
|
+
}
|
|
137
169
|
let providerDataResidency;
|
|
138
170
|
if (applicationConfig !== undefined) {
|
|
139
171
|
try {
|
|
@@ -163,6 +195,7 @@ export async function readLaunchBlockers(ports, now = new Date()) {
|
|
|
163
195
|
...(brandNaming ? { brandNaming } : {}),
|
|
164
196
|
...(assuranceProgram ? { assuranceProgram } : {}),
|
|
165
197
|
...(providerDataResidency ? { providerDataResidency } : {}),
|
|
198
|
+
...(environmentAgentGuardrails ? { environmentAgentGuardrails } : {}),
|
|
166
199
|
unreadableReasons,
|
|
167
200
|
});
|
|
168
201
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch-blockers.companion.js","sourceRoot":"","sources":["../../../../../src/core/introspection/resources/launch-blockers.companion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,iCAAiC,EAAwB,MAAM,+BAA+B,CAAC;AAEjJ,OAAO,EAAE,+BAA+B,EAAE,oCAAoC,EAAE,yBAAyB,EAAgC,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5L,OAAO,EAAE,uCAAuC,EAAE,uCAAuC,EAAE,kCAAkC,EAAE,MAAM,wCAAwC,CAAC;AAC9K,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,oBAAoB,EACpB,kCAAkC,EAClC,mBAAmB,EACnB,+CAA+C,GAIhD,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,kDAAkD,EAAE,MAAM,yCAAyC,CAAC;AAG7G,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAoBhG;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,gBAAkC,EAClC,uBAAsE;IAEtE,OAAO;QACL,QAAQ,EAAE,gBAAgB,CAAC,QAAQ;QACnC,qBAAqB,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,gBAAgB,C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,CAAC,EAAE,CAAC;QAC3D,iBAAiB;KAClB,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * The companion's half of the \"before you can launch\" list (#2238): it READS each input fresh and hands them\n * to `deriveLaunchBlockers`, the one derivation the list has. It decides nothing itself.\n *\n * ## Fresh on every read, because settling an item must remove it\n *\n * - the configuration is re-loaded with `freshModuleCache`, not taken from `companionContext.saasConfig`,\n * which is resolved once at boot and would keep a declared legal entity on the list until a restart;\n * - the generated modules are probed on disk at the moment of the read;\n * - the question queue is the creation plane's projection, which an answer invalidates;\n * - the releases come from the specifications exports, whose cache is keyed by the package's tree signature;\n * - so do the brand, the brand-name screening, the market snapshot and the dossier the brand name's standing is\n * derived from (#2338), and the compliance programme whose HARD obligations are read (#55);\n * - the providers' compliance profiles come through the application's own discovery, and the residency answer from the\n * dossier, at the moment of the read (#2294).\n *\n * ## Read failures are carried, never swallowed into \"nothing open\"\n *\n * Each read is caught on its own and reported as an unevaluated source with its reason. An unreadable\n * configuration must not hide the governance questions, and it must not read as a clean list either.\n *\n * RESIDUAL, stated rather than hidden: the question queue decides whether a governance fact is asked from the set of\n * DRAFTED documents, and `DossierCompanionService.listDraftedGovernedDocumentDefinitionRefs` reads an unreadable draft\n * set as \"nothing drafted\" (logged at debug). In that case the queue holds no governance question and this list reports\n * none, without an unevaluated source — the queue itself cannot tell the two apart. Closing it belongs to the queue.\n */\n\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\n\nimport { dataServingProviderRefs, loadSaasConfig, resolveProviderComplianceProfiles, type WildoSaasConfig } from '@wildo-ai/platform-config-lib';\nimport type { CreationConsole_Question } from '@wildo-ai/platform-core-shared';\nimport { JurisdictionSlugListReadingKind, LEGAL_NOTICE_GENERATED_RELATIVE_PATH, parseJurisdictionSlugList, type GovernedDocumentRelease, describeCaughtError } from '@wildo-ai/saas-models';\nimport { DATA_RESIDENCY_TERRITORIES_PLAYBOOK_REF, DATA_RESIDENCY_TERRITORIES_QUESTION_REF, createCompanionExportsFamilyReader } from '@wildo-ai/application-creation-runtime';\nimport {\n ApplicationCreatorInputsSchema,\n ApplicationSpecificationFamily,\n deriveLaunchBlockers,\n readCreatorInputAnswersForPlaybook,\n LaunchBlockerSource,\n SUBJECT_DATA_RECIPIENTS_GENERATED_RELATIVE_PATH,\n type LaunchBlockerGovernanceQuestion,\n type LaunchBlockerInputs,\n type LaunchBlockerList,\n} from '@wildo-ai/saas-specifications/application-creation';\nimport { GOVERNED_DOCUMENT_RELEASES_GENERATED_RELATIVE_PATH } from '@wildo-ai/saas-specifications/assurance';\n\nimport type { CompanionContext } from '../../context/companion-context';\nimport { loadSpecificationFamilyData } from '../../context/specification-family-data.companion';\n\n/** What the list reads, bound by the controller to the companion's own services. */\nexport interface LaunchBlockerPorts {\n /** The application root: where `wildo.saas.config.ts` and `backend-api/` live. */\n readonly saasRoot: string;\n /** `wildo.saas.config.ts`, loaded fresh. `null` when it could not be loaded. */\n readonly readApplicationConfig: () => Promise<WildoSaasConfig | null>;\n /** The question queue's `GOVERNANCE_FACT` items — the same read `wildo creation questions` serves. */\n readonly readGovernanceQuestions: () => Promise<readonly CreationConsole_Question[]>;\n /** The recorded releases (`documentReleaseSet`); empty when the application has no specifications package. */\n readonly readDocumentReleases: () => Promise<readonly GovernedDocumentRelease[]>;\n /** The landed families the brand name's standing is derived from, raw; each absent one reads `undefined`. */\n readonly readBrandNaming: () => Promise<NonNullable<LaunchBlockerInputs['brandNaming']>>;\n /** The landed compliance programme, raw; `program` reads `undefined` when none has landed. */\n readonly readAssuranceProgram: () => Promise<NonNullable<LaunchBlockerInputs['assuranceProgram']>>;\n /** The data-serving providers, their compliance profiles and the residency answer, for the configuration just read (#2294). */\n readonly readProviderDataResidency: (applicationConfig: WildoSaasConfig) => Promise<NonNullable<LaunchBlockerInputs['providerDataResidency']>>;\n}\n\n/**\n * The ports bound to this companion: the configuration re-loaded fresh (NOT `companionContext.saasConfig`, resolved\n * once at boot, which would keep a declared field on the list until a restart) and the releases from the\n * specifications exports. The question queue is the controller's, because it owns the creation plane's ports.\n */\nexport function companionLaunchBlockerPorts(\n companionContext: CompanionContext,\n readGovernanceQuestions: LaunchBlockerPorts['readGovernanceQuestions'],\n): LaunchBlockerPorts {\n return {\n saasRoot: companionContext.saasRoot,\n readApplicationConfig: () => loadSaasConfig(join(companionContext.saasRoot, 'wildo.saas.config.ts'), { freshModuleCache: true }),\n readGovernanceQuestions,\n readDocumentReleases: async () => {\n // No specifications package records no release — which IS the open sign-up decision, not an unread source.\n if (companionContext.resolvedSpecifications?.packageRoot === undefined) return [];\n const exports = (await loadSpecificationFamilyData(companionContext)) as {\n documentReleaseSet?: { releases?: readonly GovernedDocumentRelease[] };\n } | undefined;\n return exports?.documentReleaseSet?.releases ?? [];\n },\n readBrandNaming: async () => {\n // No specifications package lands no brand: nothing to stand against a screening, not an unread source.\n const exports = companionContext.resolvedSpecifications?.packageRoot === undefined\n ? undefined\n : (await loadSpecificationFamilyData(companionContext)) as unknown as Readonly<Record<string, unknown>> | undefined;\n const families = createCompanionExportsFamilyReader(exports);\n return {\n brand: families.readFamily(ApplicationSpecificationFamily.BRAND_BRIEF),\n screening: families.readFamily(ApplicationSpecificationFamily.BRAND_NAME_SCREENING),\n market: families.readFamily(ApplicationSpecificationFamily.MARKET_SNAPSHOT),\n creatorInputs: families.readFamily(ApplicationSpecificationFamily.CREATOR_INPUTS),\n };\n },\n readAssuranceProgram: async () => {\n // No specifications package lands no programme: nothing is obligated yet, not an unread source.\n if (companionContext.resolvedSpecifications?.packageRoot === undefined) return { program: undefined };\n const exports = (await loadSpecificationFamilyData(companionContext)) as unknown as Readonly<Record<string, unknown>> | undefined;\n return { program: createCompanionExportsFamilyReader(exports).readFamily(ApplicationSpecificationFamily.COMPLIANCE_PROGRAM) };\n },\n readProviderDataResidency: async (applicationConfig) => {\n const { profilesByProviderRef } = await resolveProviderComplianceProfiles({ saasRoot: companionContext.saasRoot, saasConfig: applicationConfig });\n const exports = companionContext.resolvedSpecifications?.packageRoot === undefined\n ? undefined\n : (await loadSpecificationFamilyData(companionContext)) as unknown as Readonly<Record<string, unknown>> | undefined;\n const rawCreatorInputs = createCompanionExportsFamilyReader(exports).readFamily(ApplicationSpecificationFamily.CREATOR_INPUTS);\n // A dossier that landed and does not parse is an unread source, never \"no residency answered\".\n const creatorInputs = rawCreatorInputs === undefined ? undefined : ApplicationCreatorInputsSchema.parse(rawCreatorInputs);\n const answer = readCreatorInputAnswersForPlaybook(creatorInputs, DATA_RESIDENCY_TERRITORIES_PLAYBOOK_REF)\n .find((candidate) => candidate.questionRef === DATA_RESIDENCY_TERRITORIES_QUESTION_REF)?.answer;\n const reading = answer === undefined ? undefined : parseJurisdictionSlugList(answer);\n return {\n ...(reading?.kind === JurisdictionSlugListReadingKind.SLUGS ? { answeredTerritories: reading.slugs } : {}),\n providerRefs: dataServingProviderRefs(applicationConfig.providers.scopes),\n profilesByProviderRef,\n };\n },\n };\n}\n\n/** The launch list, as of now. */\nexport async function readLaunchBlockers(ports: LaunchBlockerPorts, now: Date = new Date()): Promise<LaunchBlockerList> {\n const unreadableReasons: Partial<Record<LaunchBlockerSource, string>> = {};\n\n let applicationConfig: WildoSaasConfig | undefined;\n try {\n const loaded = await ports.readApplicationConfig();\n if (loaded === null) unreadableReasons[LaunchBlockerSource.APPLICATION_CONFIG] = `${join(ports.saasRoot, 'wildo.saas.config.ts')} could not be loaded`;\n else applicationConfig = loaded;\n } catch (error) {\n unreadableReasons[LaunchBlockerSource.APPLICATION_CONFIG] = describeCaughtError(error);\n }\n\n let governanceQuestions: LaunchBlockerGovernanceQuestion[] | undefined;\n try {\n governanceQuestions = (await ports.readGovernanceQuestions()).map((question) => ({\n questionId: question.questionId,\n definitionRef: question.definitionRef,\n prompt: question.fields.map((field) => field.question).join(' / '),\n }));\n } catch (error) {\n unreadableReasons[LaunchBlockerSource.QUESTION_QUEUE] = describeCaughtError(error);\n }\n\n let documentReleases: readonly GovernedDocumentRelease[] | undefined;\n try {\n documentReleases = await ports.readDocumentReleases();\n } catch (error) {\n unreadableReasons[LaunchBlockerSource.DOCUMENT_RELEASES] = describeCaughtError(error);\n }\n\n let brandNaming: LaunchBlockerInputs['brandNaming'];\n try {\n brandNaming = await ports.readBrandNaming();\n } catch (error) {\n unreadableReasons[LaunchBlockerSource.BRAND_NAMING] = describeCaughtError(error);\n }\n\n let assuranceProgram: LaunchBlockerInputs['assuranceProgram'];\n try {\n assuranceProgram = await ports.readAssuranceProgram();\n } catch (error) {\n unreadableReasons[LaunchBlockerSource.ASSURANCE_PROGRAM] = describeCaughtError(error);\n }\n\n let providerDataResidency: LaunchBlockerInputs['providerDataResidency'];\n if (applicationConfig !== undefined) {\n try {\n providerDataResidency = await ports.readProviderDataResidency(applicationConfig);\n } catch (error) {\n unreadableReasons[LaunchBlockerSource.PROVIDER_DATA_RESIDENCY] = describeCaughtError(error);\n }\n }\n\n return deriveLaunchBlockers({\n computedAt: now.toISOString(),\n ...(applicationConfig\n ? {\n applicationConfig: {\n ...(applicationConfig.operatorComplianceIdentity ? { operatorComplianceIdentity: applicationConfig.operatorComplianceIdentity } : {}),\n ...(applicationConfig.dataRetention ? { dataRetention: applicationConfig.dataRetention } : {}),\n ...(applicationConfig.brandNameClearances ? { brandNameClearances: applicationConfig.brandNameClearances } : {}),\n ...(applicationConfig.providerComplianceChoices ? { providerComplianceChoices: applicationConfig.providerComplianceChoices } : {}),\n },\n }\n : {}),\n subjectDataRecipientsModulePresent: existsSync(join(ports.saasRoot, SUBJECT_DATA_RECIPIENTS_GENERATED_RELATIVE_PATH)),\n legalNoticeModulePresent: existsSync(join(ports.saasRoot, LEGAL_NOTICE_GENERATED_RELATIVE_PATH)),\n ...(governanceQuestions ? { governanceQuestions } : {}),\n ...(documentReleases ? { documentReleases } : {}),\n documentReleasesModulePresent: existsSync(join(ports.saasRoot, GOVERNED_DOCUMENT_RELEASES_GENERATED_RELATIVE_PATH)),\n ...(brandNaming ? { brandNaming } : {}),\n ...(assuranceProgram ? { assuranceProgram } : {}),\n ...(providerDataResidency ? { providerDataResidency } : {}),\n unreadableReasons,\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"launch-blockers.companion.js","sourceRoot":"","sources":["../../../../../src/core/introspection/resources/launch-blockers.companion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,iCAAiC,EACjC,iBAAiB,GAElB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,+BAA+B,EAAE,oCAAoC,EAAE,yBAAyB,EAAgC,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5L,OAAO,EAAE,uCAAuC,EAAE,uCAAuC,EAAE,kCAAkC,EAAE,MAAM,wCAAwC,CAAC;AAC9K,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,oBAAoB,EACpB,kCAAkC,EAClC,mBAAmB,EACnB,+CAA+C,GAIhD,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,kDAAkD,EAAE,MAAM,yCAAyC,CAAC;AAG7G,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAsBhG;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,gBAAkC,EAClC,uBAAsE;IAEtE,OAAO;QACL,QAAQ,EAAE,gBAAgB,CAAC,QAAQ;QACnC,qBAAqB,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,sBAAsB,CAAC,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC;QAChI,8BAA8B,EAAE,GAAG,EAAE,CAAC,8BAA8B,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QAC/F,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EAAE,qBAAqB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,GAAG,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,0BAA0B,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,iBAAiB;KAClB,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * The companion's half of the \"before you can launch\" list (#2238): it READS each input fresh and hands them\n * to `deriveLaunchBlockers`, the one derivation the list has. It decides nothing itself.\n *\n * ## Fresh on every read, because settling an item must remove it\n *\n * - the configuration is re-loaded with `freshModuleCache`, not taken from `companionContext.saasConfig`,\n * which is resolved once at boot and would keep a declared legal entity on the list until a restart;\n * - the generated modules are probed on disk at the moment of the read;\n * - the question queue is the creation plane's projection, which an answer invalidates;\n * - the releases come from the specifications exports, whose cache is keyed by the package's tree signature;\n * - so do the brand, the brand-name screening, the market snapshot and the dossier the brand name's standing is\n * derived from (#2338), and the compliance programme whose HARD obligations are read (#55);\n * - the providers' compliance profiles come through the application's own discovery, and the residency answer from the\n * dossier, at the moment of the read (#2294);\n * - each environment's `wildo.infra.<env>.config.ts` is re-loaded fresh, for what it declares about its agents'\n * guardrails (#2292).\n *\n * ## Read failures are carried, never swallowed into \"nothing open\"\n *\n * Each read is caught on its own and reported as an unevaluated source with its reason. An unreadable\n * configuration must not hide the governance questions, and it must not read as a clean list either.\n *\n * RESIDUAL, stated rather than hidden: the question queue decides whether a governance fact is asked from the set of\n * DRAFTED documents, and `DossierCompanionService.listDraftedGovernedDocumentDefinitionRefs` reads an unreadable draft\n * set as \"nothing drafted\" (logged at debug). In that case the queue holds no governance question and this list reports\n * none, without an unevaluated source — the queue itself cannot tell the two apart. Closing it belongs to the queue.\n */\n\nimport { existsSync, readdirSync } from 'node:fs';\nimport { join, relative } from 'node:path';\n\nimport {\n dataServingProviderRefs,\n loadInfraEnvConfig,\n loadSaasConfig,\n resolveAppLayout,\n resolveProviderComplianceProfiles,\n WildoLocationType,\n type WildoSaasConfig,\n} from '@wildo-ai/platform-config-lib';\nimport type { CreationConsole_Question } from '@wildo-ai/platform-core-shared';\nimport { JurisdictionSlugListReadingKind, LEGAL_NOTICE_GENERATED_RELATIVE_PATH, parseJurisdictionSlugList, type GovernedDocumentRelease, describeCaughtError } from '@wildo-ai/saas-models';\nimport { DATA_RESIDENCY_TERRITORIES_PLAYBOOK_REF, DATA_RESIDENCY_TERRITORIES_QUESTION_REF, createCompanionExportsFamilyReader } from '@wildo-ai/application-creation-runtime';\nimport {\n ApplicationCreatorInputsSchema,\n ApplicationSpecificationFamily,\n deriveLaunchBlockers,\n readCreatorInputAnswersForPlaybook,\n LaunchBlockerSource,\n SUBJECT_DATA_RECIPIENTS_GENERATED_RELATIVE_PATH,\n type LaunchBlockerGovernanceQuestion,\n type LaunchBlockerInputs,\n type LaunchBlockerList,\n} from '@wildo-ai/saas-specifications/application-creation';\nimport { GOVERNED_DOCUMENT_RELEASES_GENERATED_RELATIVE_PATH } from '@wildo-ai/saas-specifications/assurance';\n\nimport type { CompanionContext } from '../../context/companion-context';\nimport { loadSpecificationFamilyData } from '../../context/specification-family-data.companion';\n\n/** What the list reads, bound by the controller to the companion's own services. */\nexport interface LaunchBlockerPorts {\n /** The application root: where `wildo.saas.config.ts` and `backend-api/` live. */\n readonly saasRoot: string;\n /** `wildo.saas.config.ts`, loaded fresh. `null` when it could not be loaded. */\n readonly readApplicationConfig: () => Promise<WildoSaasConfig | null>;\n /** The question queue's `GOVERNANCE_FACT` items — the same read `wildo creation questions` serves. */\n readonly readGovernanceQuestions: () => Promise<readonly CreationConsole_Question[]>;\n /** The recorded releases (`documentReleaseSet`); empty when the application has no specifications package. */\n readonly readDocumentReleases: () => Promise<readonly GovernedDocumentRelease[]>;\n /** The landed families the brand name's standing is derived from, raw; each absent one reads `undefined`. */\n readonly readBrandNaming: () => Promise<NonNullable<LaunchBlockerInputs['brandNaming']>>;\n /** The landed compliance programme, raw; `program` reads `undefined` when none has landed. */\n readonly readAssuranceProgram: () => Promise<NonNullable<LaunchBlockerInputs['assuranceProgram']>>;\n /** The data-serving providers, their compliance profiles and the residency answer, for the configuration just read (#2294). */\n readonly readProviderDataResidency: (applicationConfig: WildoSaasConfig) => Promise<NonNullable<LaunchBlockerInputs['providerDataResidency']>>;\n /** What each authored environment declares about its agents' guardrails, its infra config loaded fresh (#2292). */\n readonly readEnvironmentAgentGuardrails: () => Promise<NonNullable<LaunchBlockerInputs['environmentAgentGuardrails']>>;\n}\n\n/**\n * The ports bound to this companion: the configuration re-loaded fresh (NOT `companionContext.saasConfig`, resolved\n * once at boot, which would keep a declared field on the list until a restart) and the releases from the\n * specifications exports. The question queue is the controller's, because it owns the creation plane's ports.\n */\nexport function companionLaunchBlockerPorts(\n companionContext: CompanionContext,\n readGovernanceQuestions: LaunchBlockerPorts['readGovernanceQuestions'],\n): LaunchBlockerPorts {\n return {\n saasRoot: companionContext.saasRoot,\n readApplicationConfig: () => loadSaasConfig(join(companionContext.saasRoot, 'wildo.saas.config.ts'), { freshModuleCache: true }),\n readEnvironmentAgentGuardrails: () => readEnvironmentAgentGuardrails(companionContext.saasRoot),\n readGovernanceQuestions,\n readDocumentReleases: async () => {\n // No specifications package records no release — which IS the open sign-up decision, not an unread source.\n if (companionContext.resolvedSpecifications?.packageRoot === undefined) return [];\n const exports = (await loadSpecificationFamilyData(companionContext)) as {\n documentReleaseSet?: { releases?: readonly GovernedDocumentRelease[] };\n } | undefined;\n return exports?.documentReleaseSet?.releases ?? [];\n },\n readBrandNaming: async () => {\n // No specifications package lands no brand: nothing to stand against a screening, not an unread source.\n const exports = companionContext.resolvedSpecifications?.packageRoot === undefined\n ? undefined\n : (await loadSpecificationFamilyData(companionContext)) as unknown as Readonly<Record<string, unknown>> | undefined;\n const families = createCompanionExportsFamilyReader(exports);\n return {\n brand: families.readFamily(ApplicationSpecificationFamily.BRAND_BRIEF),\n screening: families.readFamily(ApplicationSpecificationFamily.BRAND_NAME_SCREENING),\n market: families.readFamily(ApplicationSpecificationFamily.MARKET_SNAPSHOT),\n creatorInputs: families.readFamily(ApplicationSpecificationFamily.CREATOR_INPUTS),\n };\n },\n readAssuranceProgram: async () => {\n // No specifications package lands no programme: nothing is obligated yet, not an unread source.\n if (companionContext.resolvedSpecifications?.packageRoot === undefined) return { program: undefined };\n const exports = (await loadSpecificationFamilyData(companionContext)) as unknown as Readonly<Record<string, unknown>> | undefined;\n return { program: createCompanionExportsFamilyReader(exports).readFamily(ApplicationSpecificationFamily.COMPLIANCE_PROGRAM) };\n },\n readProviderDataResidency: async (applicationConfig) => {\n const { profilesByProviderRef } = await resolveProviderComplianceProfiles({ saasRoot: companionContext.saasRoot, saasConfig: applicationConfig });\n const exports = companionContext.resolvedSpecifications?.packageRoot === undefined\n ? undefined\n : (await loadSpecificationFamilyData(companionContext)) as unknown as Readonly<Record<string, unknown>> | undefined;\n const rawCreatorInputs = createCompanionExportsFamilyReader(exports).readFamily(ApplicationSpecificationFamily.CREATOR_INPUTS);\n // A dossier that landed and does not parse is an unread source, never \"no residency answered\".\n const creatorInputs = rawCreatorInputs === undefined ? undefined : ApplicationCreatorInputsSchema.parse(rawCreatorInputs);\n const answer = readCreatorInputAnswersForPlaybook(creatorInputs, DATA_RESIDENCY_TERRITORIES_PLAYBOOK_REF)\n .find((candidate) => candidate.questionRef === DATA_RESIDENCY_TERRITORIES_QUESTION_REF)?.answer;\n const reading = answer === undefined ? undefined : parseJurisdictionSlugList(answer);\n return {\n ...(reading?.kind === JurisdictionSlugListReadingKind.SLUGS ? { answeredTerritories: reading.slugs } : {}),\n providerRefs: dataServingProviderRefs(applicationConfig.providers.scopes),\n profilesByProviderRef,\n };\n },\n };\n}\n\n/**\n * Each authored environment's `agentContentGuardrails` (#2292): every directory under the application's infrastructure\n * home whose infra config loads, as the CLI enumerates environments. A directory without a config is not an environment.\n * One that fails to load THROWS, so the source is reported unevaluated rather than read as \"nothing declared\".\n */\nasync function readEnvironmentAgentGuardrails(saasRoot: string): Promise<NonNullable<LaunchBlockerInputs['environmentAgentGuardrails']>> {\n const home = resolveAppLayout(saasRoot).authoredInfrastructureHome;\n const names = existsSync(home) ? readdirSync(home, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort() : [];\n const entries: NonNullable<LaunchBlockerInputs['environmentAgentGuardrails']>[number][] = [];\n for (const environment of names) {\n const loaded = await loadInfraEnvConfig(saasRoot, environment, { freshModuleCache: true });\n if (loaded === null) continue;\n entries.push({\n environment,\n local: loaded.config.locationType === WildoLocationType.LOCAL,\n ...(loaded.config.agentContentGuardrails ? { declaration: loaded.config.agentContentGuardrails } : {}),\n declaredIn: relative(saasRoot, loaded.path),\n });\n }\n return entries;\n}\n\n/** The launch list, as of now. */\nexport async function readLaunchBlockers(ports: LaunchBlockerPorts, now: Date = new Date()): Promise<LaunchBlockerList> {\n const unreadableReasons: Partial<Record<LaunchBlockerSource, string>> = {};\n\n let applicationConfig: WildoSaasConfig | undefined;\n try {\n const loaded = await ports.readApplicationConfig();\n if (loaded === null) unreadableReasons[LaunchBlockerSource.APPLICATION_CONFIG] = `${join(ports.saasRoot, 'wildo.saas.config.ts')} could not be loaded`;\n else applicationConfig = loaded;\n } catch (error) {\n unreadableReasons[LaunchBlockerSource.APPLICATION_CONFIG] = describeCaughtError(error);\n }\n\n let governanceQuestions: LaunchBlockerGovernanceQuestion[] | undefined;\n try {\n governanceQuestions = (await ports.readGovernanceQuestions()).map((question) => ({\n questionId: question.questionId,\n definitionRef: question.definitionRef,\n prompt: question.fields.map((field) => field.question).join(' / '),\n }));\n } catch (error) {\n unreadableReasons[LaunchBlockerSource.QUESTION_QUEUE] = describeCaughtError(error);\n }\n\n let documentReleases: readonly GovernedDocumentRelease[] | undefined;\n try {\n documentReleases = await ports.readDocumentReleases();\n } catch (error) {\n unreadableReasons[LaunchBlockerSource.DOCUMENT_RELEASES] = describeCaughtError(error);\n }\n\n let brandNaming: LaunchBlockerInputs['brandNaming'];\n try {\n brandNaming = await ports.readBrandNaming();\n } catch (error) {\n unreadableReasons[LaunchBlockerSource.BRAND_NAMING] = describeCaughtError(error);\n }\n\n let assuranceProgram: LaunchBlockerInputs['assuranceProgram'];\n try {\n assuranceProgram = await ports.readAssuranceProgram();\n } catch (error) {\n unreadableReasons[LaunchBlockerSource.ASSURANCE_PROGRAM] = describeCaughtError(error);\n }\n\n let environmentAgentGuardrails: LaunchBlockerInputs['environmentAgentGuardrails'];\n try {\n environmentAgentGuardrails = await ports.readEnvironmentAgentGuardrails();\n } catch (error) {\n unreadableReasons[LaunchBlockerSource.ENVIRONMENT_CONFIGS] = describeCaughtError(error);\n }\n\n let providerDataResidency: LaunchBlockerInputs['providerDataResidency'];\n if (applicationConfig !== undefined) {\n try {\n providerDataResidency = await ports.readProviderDataResidency(applicationConfig);\n } catch (error) {\n unreadableReasons[LaunchBlockerSource.PROVIDER_DATA_RESIDENCY] = describeCaughtError(error);\n }\n }\n\n return deriveLaunchBlockers({\n computedAt: now.toISOString(),\n ...(applicationConfig\n ? {\n applicationConfig: {\n ...(applicationConfig.operatorComplianceIdentity ? { operatorComplianceIdentity: applicationConfig.operatorComplianceIdentity } : {}),\n ...(applicationConfig.dataRetention ? { dataRetention: applicationConfig.dataRetention } : {}),\n ...(applicationConfig.brandNameClearances ? { brandNameClearances: applicationConfig.brandNameClearances } : {}),\n ...(applicationConfig.providerComplianceChoices ? { providerComplianceChoices: applicationConfig.providerComplianceChoices } : {}),\n },\n }\n : {}),\n subjectDataRecipientsModulePresent: existsSync(join(ports.saasRoot, SUBJECT_DATA_RECIPIENTS_GENERATED_RELATIVE_PATH)),\n legalNoticeModulePresent: existsSync(join(ports.saasRoot, LEGAL_NOTICE_GENERATED_RELATIVE_PATH)),\n ...(governanceQuestions ? { governanceQuestions } : {}),\n ...(documentReleases ? { documentReleases } : {}),\n documentReleasesModulePresent: existsSync(join(ports.saasRoot, GOVERNED_DOCUMENT_RELEASES_GENERATED_RELATIVE_PATH)),\n ...(brandNaming ? { brandNaming } : {}),\n ...(assuranceProgram ? { assuranceProgram } : {}),\n ...(providerDataResidency ? { providerDataResidency } : {}),\n ...(environmentAgentGuardrails ? { environmentAgentGuardrails } : {}),\n unreadableReasons,\n });\n}\n"]}
|
|
@@ -109,6 +109,8 @@ export declare class CompanionIntrospectionService {
|
|
|
109
109
|
private readonly compileQueue;
|
|
110
110
|
/** Test seam only; production always retains Node's real child-process spawn. */
|
|
111
111
|
private spawnSubprocess;
|
|
112
|
+
/** Waits out a dependency install under the live companion (#3703). Replaced only by tests. */
|
|
113
|
+
private dependencyTreeGate;
|
|
112
114
|
/**
|
|
113
115
|
* Whether compiled state may be retained at all.
|
|
114
116
|
*
|
|
@@ -237,7 +239,19 @@ export declare class CompanionIntrospectionService {
|
|
|
237
239
|
shutdownWorkers(): void;
|
|
238
240
|
/** Live pooled workers. A diagnostic for tests and profiling runs. */
|
|
239
241
|
get liveWorkerCount(): number;
|
|
242
|
+
/**
|
|
243
|
+
* Derive, surviving a dependency install under the live companion (#3703).
|
|
244
|
+
*
|
|
245
|
+
* Every derivation's child resolves its packages from the application's `node_modules` when it starts, so a child
|
|
246
|
+
* started while an install re-creates that tree dies on its first bare import (`Cannot find package 'zod'`). Two
|
|
247
|
+
* decisions, both the gate's (see `introspection-dependency-tree.companion.ts`): nothing starts while a RECORDED
|
|
248
|
+
* install is in flight, and a derivation that failed on a declared package the resolver could not find is derived
|
|
249
|
+
* again once that package resolves, after every pooled worker started before the tree settled is retired, so the
|
|
250
|
+
* retry runs in a process that read the settled tree. Any other failure is returned as it was. The waits happen
|
|
251
|
+
* outside the concurrency queue, so a held derivation keeps no slot.
|
|
252
|
+
*/
|
|
240
253
|
private deriveThroughQueue;
|
|
254
|
+
private deriveOnceThroughQueue;
|
|
241
255
|
/**
|
|
242
256
|
* Derive through a worker bound to the observed source state (#3208), see {@link IntrospectionWorkerPool}.
|
|
243
257
|
*
|