@wildo-ai/platform-core-shared 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/core/resources/resources-operations.custom.shared.definitions.d.ts.map +1 -1
- package/dist/esm/core/resources/resources-relationships.custom.shared.definitions.d.ts.map +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/runtime/application-backend-env.contracts.d.ts +20 -0
- package/dist/esm/runtime/application-backend-env.contracts.d.ts.map +1 -1
- package/dist/esm/runtime/application-backend-env.contracts.js +22 -0
- package/dist/esm/runtime/application-backend-env.contracts.js.map +1 -1
- package/dist/esm/runtime/runtime-topology.contracts.d.ts.map +1 -1
- package/dist/esm/security/authorizations/roles.custom.shared.definitions.d.ts.map +1 -1
- package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/wildo-application-executions/wildo-application-executions.custom.shared.schemas.d.ts.map +1 -1
- package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/wildo-application-tasks/wildo-application-tasks.custom.shared.schemas.d.ts.map +1 -1
- package/dist/esm/wildo-applications/wildo-applications.custom.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/wildo-applications/wildo-applications.custom.shared.resources-config.schemas.js +12 -1
- package/dist/esm/wildo-applications/wildo-applications.custom.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/wildo-applications/wildo-applications.custom.shared.schemas.d.ts.map +1 -1
- package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.resources-config.schemas.js +12 -1
- package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.resources-config.schemas.js.map +1 -1
- package/dist/esm/wildo-applications-versions/wildo-applications-versions.custom.shared.schemas.d.ts.map +1 -1
- package/dist/esm/workbench/workbench-aspect-resources.custom.shared.schemas.d.ts.map +1 -1
- package/dist/esm/workbench/workbench-creation-plane.custom.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/workbench/workbench-creation-plane.custom.shared.schemas.d.ts +1 -3
- package/dist/esm/workbench/workbench-creation-plane.custom.shared.schemas.d.ts.map +1 -1
- package/dist/esm/workbench/workbench-creation-plane.custom.shared.schemas.js +9 -4
- package/dist/esm/workbench/workbench-creation-plane.custom.shared.schemas.js.map +1 -1
- package/dist/esm/workbench/workbench-resources.custom.shared.resources-config.schemas.d.ts.map +1 -1
- package/dist/esm/workbench/workbench-resources.custom.shared.schemas.d.ts.map +1 -1
- package/dist/esm/workbench/workbench-resources.custom.shared.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workbench-creation-plane.custom.shared.schemas.js","sourceRoot":"","sources":["../../../../src/workbench/workbench-creation-plane.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,CAAN,IAAY,8BASX;AATD,WAAY,8BAA8B;IACxC,uGAAuG;IACvG,8FAA4D,CAAA;IAC5D,2GAA2G;IAC3G,sFAAoD,CAAA;IACpD,8DAA8D;IAC9D,wFAAsD,CAAA;IACtD,yCAAyC;IACzC,kFAAgD,CAAA;AAClD,CAAC,EATW,8BAA8B,KAA9B,8BAA8B,QASzC;AAED,wDAAwD;AACxD,MAAM,CAAC,MAAM,qCAAqC,GAAsB,MAAM,CAAC,MAAM,CACnF,MAAM,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAC9C,CAAC;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ators';\n\ninitZodDecorators(z);\n\n/**\n * The CREATION PLANE's shared vocabulary — schemas for the four companion-runtime resource\n * families, and the behavior ids their bindings name.\n *\n * ## What these rows are, and are not\n *\n * They are the companion's OWN RUNTIME projections for the one application it serves: the playbook\n * eligibility board, the build-plan dispatch view, the run write-register and the execution-trace\n * index. Unlike every other workbench resource, nothing here is derived from the application's\n * source by a subprocess — the behaviors materialize IN-PROCESS from the companion's running\n * services, which is why their binding declares `IntrospectionTenancyStance.APPLICATION_RUNTIME`\n * and their variants are authenticated rather than `APP_PUBLIC`.\n *\n * ## Why the vocabularies stay plain strings\n *\n * Same argument as the domain-model schema one file over: `phase`, `functionalTopic` and\n * `targetKind` are owned by `@wildo-ai/saas-specifications`, which this package deliberately does\n * not depend on (it would drag the whole specification graph into every platform consumer). The\n * companion produces the values from the real enums; binding them here would make a row a newer\n * companion legitimately produces unparseable by an older workbench — refusing to show exactly the\n * state the board exists to reveal.\n */\n\n/**\n * The behavior ids the creation-plane bindings declare — the companion's IN-PROCESS catalog.\n *\n * ONE named source, consumed from both ends: the resource configs (this package) write these into\n * `introspectionBinding.behavior`, and the companion's introspection source routes on membership —\n * an id in this set is served by `CreationPlaneProjectionCompanionService` in-process; any other id\n * flows to the subprocess lane. Deliberately NOT added to the companion's\n * `CompanionIntrospectionBehaviorIdValues`: that vocabulary's execution contract\n * (`materializationBoundary: 'subprocess'`, routing targets, service kinds) describes a machinery\n * these behaviors never enter.\n */\nexport enum WorkbenchCreationPlaneBehavior {\n /** `listPlaybookEligibility()` rows + projected `computedAt`/`phase`, behind the eligibility cache. */\n PLAYBOOK_ELIGIBILITY = 'creation-plane.playbook-eligibility',\n /** The build-plan graph's tasks with dispatch `status` computed against git (ready / landed / blocked). */\n BUILD_PLAN_TASKS = 'creation-plane.build-plan-tasks',\n /** The write register's records, pre-image bytes stripped. */\n RUN_WRITE_RECORDS = 'creation-plane.run-write-records',\n /** The execution-trace session index. */\n TRACE_SESSIONS = 'creation-plane.trace-sessions',\n}\n\n/** Membership test the companion's source routes by. */\nexport const WORKBENCH_CREATION_PLANE_BEHAVIOR_IDS: readonly string[] = Object.freeze(\n Object.values(WorkbenchCreationPlaneBehavior),\n);\n\n/**\n * The creation plane's IDENTITY RULE — part of the shared contract, deliberately, because both ends\n * apply it: the companion's projections emit each row's id from its business key\n * (`identityFields` composition refuses values outside `[a-zA-Z0-9_-]`, and playbook refs and trace\n * session ids legitimately carry dots), and a frontend surface holding only the business key\n * (an interrupted run's `playbookRef`) derives the row address the same way. Two copies of this\n * function would be the drift this package exists to prevent.\n *\n * `.` becomes `__`; anything else outside the charset becomes `-`. NOT injective in general —\n * which is why the companion's projections refuse post-sanitization duplicates rather than serving\n * two rows under one id, and why server-side lookups match sanitized forms instead of reversing.\n */\nexport function sanitizeWorkbenchCreationPlaneIdentity(value: string): string {\n return value.replaceAll('.', '__').replace(/[^a-zA-Z0-9_-]/g, '-');\n}\n\n/**\n * The dispatch status of one build-plan task — computed, never stored.\n *\n * `LANDED` = the dispatch service's landed-refs resolution (evidence in git) includes it.\n * `READY` = every prerequisite landed and it has not. `BLOCKED` = at least one prerequisite has\n * not landed. Exactly one holds per task, derived per read.\n */\nexport enum WorkbenchBuildPlanTaskStatus {\n READY = 'ready',\n LANDED = 'landed',\n BLOCKED = 'blocked',\n}\n\n/**\n * One playbook's row on the eligibility board.\n *\n * A projection of the application-creation runtime's `PlaybookEligibility` (whose docs carry the\n * semantics), flattened for a list row: the per-precondition verdict objects are NOT carried —\n * `unmet` is their already-rendered \"why not\" — and two board-level scalars are projected ONTO each\n * row (`phase`, `computedAt`) because a resource row must be complete on its own.\n */\nexport const Workbench_Playbook_Schema = z.object({\n /**\n * EMITTED BY THE BEHAVIOR — `playbookRef` sanitized to the URL-safe identity charset — NOT\n * composed by the binding's `identityFields`. Composition refuses any value outside\n * `[a-zA-Z0-9_-]`, and playbook refs legitimately carry dots (`top_down.phase-gate`), so the\n * projection service derives the field itself (`.` → `__`, anything else invalid → `-`) and\n * REFUSES on a post-sanitization duplicate rather than serving two rows under one id.\n */\n workbenchPlaybookId: z.string().min(1).isPrimaryKey().isSummaryField(),\n playbookRef: z.string().min(1).isSummaryField(),\n playbookVersion: z.string().min(1).isSummaryField(),\n /**\n * The PLAYBOOK's own taxonomy label (`top_down`, `bottom_up`, `refinement`, `cross_cutting`) — what\n * kind of reasoning it embodies.\n *\n * It said \"the derived journey phase — board-level, projected per row\" until 2026-09-04, and that is\n * what it carried: one application-level value stamped onto every row, while the workbench rendered\n * it beside each playbook as if it described that playbook. The derived application phase is gone\n * (`MetaWorkflow_Phase`); this is the label that was always true of the row.\n */\n phase: z.string().min(1).isSummaryField(),\n /** One sentence: what running this playbook produces. */\n intent: z.string().isSummaryField(),\n /** The deterministic gate's verdict: may this playbook run right now. */\n eligible: z.boolean().isSummaryField(),\n /** The `detail` of every unsatisfied precondition — \"why not\", already rendered by the runtime. */\n unmet: z.array(z.string()).isSummaryField(),\n /** Every READINESS precondition holds and only SEQUENCING ones do not: information, not a refusal. */\n blockedOnlyBySequencing: z.boolean().isSummaryField(),\n /** This playbook interviews the creator, so a run will stop and ask. */\n requiresElicitation: z.boolean().isSummaryField(),\n /** Families this playbook writes that ALREADY have content — a run implies an overwrite. */\n wouldReplace: z.array(z.string()).isSummaryField(),\n /** Families no render profile can land yet. A run would refuse; the board says so first. */\n unlandableFamilies: z.array(z.string()).isSummaryField(),\n /** Landed outputs whose declared inputs have moved since. An ANNOTATION, never a gate. */\n staleOutputs: z.array(z.object({\n family: z.string().min(1),\n changedInputs: z.array(z.string()),\n })).isSummaryField(),\n /** When the served board was computed — the cache's honesty field, rendered as \"as of\". */\n computedAt: z.string().min(1).isSummaryField(),\n});\nexport type Workbench_Playbook = z.infer<typeof Workbench_Playbook_Schema>;\n\n/**\n * One build-plan task in the DISPATCH view.\n *\n * DELIBERATELY THIN beside the `workbenchBuildTasks` aspect resource, which projects the same\n * authored population from the specification artifact with its traceability edges. This row\n * answers \"what can run next and what has landed\"; authored detail (skill refs, serves edges)\n * stays on the aspect row sharing the same `taskRef`.\n */\nexport const Workbench_BuildPlanTask_Schema = z.object({\n /** Emitted by the behavior (task refs are already URL-safe by their own regex; same lane as its siblings). */\n workbenchBuildPlanTaskId: z.string().min(1).isPrimaryKey().isSummaryField(),\n taskRef: z.string().min(1).isSummaryField(),\n /** One sentence of intent: what this task delivers. */\n objective: z.string().min(1).isSummaryField(),\n /** The target's `kind` discriminant only — the physical detail belongs to the dispatch plan. */\n targetKind: z.string().min(1).isSummaryField(),\n /** Which phase of building the application this task belongs to (context, never ordering). */\n functionalTopic: z.string().min(1).isSummaryField(),\n status: z.enum(WorkbenchBuildPlanTaskStatus).isSummaryField(),\n /** Task refs that must land first — the only thing that decides what may run next. */\n prerequisiteTaskRefs: z.array(z.string()).isSummaryField(),\n});\nexport type Workbench_BuildPlanTask = z.infer<typeof Workbench_BuildPlanTask_Schema>;\n\n/**\n * One run's write record — the evidence lane behind every dispatch.\n *\n * Pre-image BYTES (`previousContent`) are deliberately not projected: they belong to the revert\n * mechanism, and a list row carrying every pre-image would ship the working tree's history through\n * every LIST.\n */\nexport const Workbench_RunWriteRecord_Schema = z.object({\n /** Emitted by the behavior — `runId` sanitized to the identity charset (see the playbook id note). */\n workbenchRunWriteRecordId: z.string().min(1).isPrimaryKey().isSummaryField(),\n runId: z.string().min(1).isSummaryField(),\n playbookRef: z.string().min(1).isSummaryField(),\n /*\n * The JOIN KEYS (Phase 4, requirement R5), emitted by the projection as SANITIZED identities so\n * the values match the target rows' ids — `playbookRef` is the human-readable business key,\n * `workbenchPlaybookId` is the addressable one. Named exactly as the target's own field\n * identifier so the global field-identifier map resolves the reference, and declared as\n * REFERENCE relationships beside the configs so the engine's reference machinery (labels,\n * navigation, related lists) does the linking — no bespoke link code.\n */\n /** The playbook this run executed — every record has one. */\n workbenchPlaybookId: z.string().min(1).isForeignKey().isSummaryField(),\n /**\n * The execution-trace session the run recorded under, resolved by PREFIX (a runId is\n * `<sessionId>-<playbookRef>-<ts>`). NULL when no listed session matches — a register can\n * legitimately outlive its trace directory, and a dangling id would render as a broken link.\n */\n workbenchTraceSessionId: z.string().min(1).isForeignKey().isSummaryField().nullable(),\n /** When the run recorded its writes (ISO). */\n at: z.string().min(1).isSummaryField(),\n files: z.array(z.object({\n /** App-root-relative path of the written file. */\n path: z.string().min(1),\n /** What makes a revert honest: whether the file existed before the run. */\n existedBefore: z.boolean(),\n })).isSummaryField(),\n /** Projected count, so a list can say \"wrote 7 files\" without rendering the array. */\n fileCount: z.number().int().isSummaryField(),\n});\nexport type Workbench_RunWriteRecord = z.infer<typeof Workbench_RunWriteRecord_Schema>;\n\n/** One execution-trace session — the queryable index the board links from. */\nexport const Workbench_TraceSession_Schema = z.object({\n /** Emitted by the behavior — session ids admit `.` (`dev-<ISO-ish>` directory names), so sanitized (see the playbook id note). */\n workbenchTraceSessionId: z.string().min(1).isPrimaryKey().isSummaryField(),\n sessionId: z.string().min(1).isSummaryField(),\n /** When the session started (ISO-ish; embedded in the session directory name). */\n startedAt: z.string().min(1).isSummaryField(),\n label: z.string().min(1).isSummaryField().nullable(),\n eventCount: z.number().int().isSummaryField(),\n stepCount: z.number().int().isSummaryField(),\n});\nexport type Workbench_TraceSession = z.infer<typeof Workbench_TraceSession_Schema>;\n\n/*\n * ────────────────────────── Phase 3: dispatch OPERATIONS ──────────────────────────\n *\n * The creation board's dispatches as CUSTOM OPERATIONS (plan D3): declared here beside the\n * resources they act on, implemented COMPANION-SIDE as `OVERRIDE_ALL` custom implementations\n * delegating to the companion's own services — never as generated writes, which the introspection\n * repository refuses by contract. `OVERRIDE_ALL` returns before the framework's repository and\n * transaction machinery, which is exactly what a dispatch onto a derived resource needs (verified,\n * plan Phase 0), and none of these declares a transaction contract, so the\n * `override_all_not_supported_for_transaction_requiring_operation` refusal never applies.\n */\n\n/** The playbook resource's dispatch verbs. */\nexport enum WorkbenchPlaybooks_Operations {\n /** Fire one playbook run (the row is the playbook; the body carries brief/answers/dryRun). */\n RUN = 'run',\n /** Answer a run that stopped at a clarification — accept with answers, decline, or cancel. */\n RESUME = 'resume_run',\n}\n\n/** The build-plan resource's dispatch verb. */\nexport enum WorkbenchBuildPlanTasks_Operations {\n /**\n * Run the NEXT ready build-plan task — collection-level on purpose: the graph already encodes\n * the order its author intended, and a per-row dispatch would be a second scheduler disagreeing\n * with the first (the dispatch service's own doctrine).\n */\n DISPATCH_NEXT = 'dispatch_next',\n}\n\n/** The write-record resource's dispatch verb. */\nexport enum WorkbenchRunWriteRecords_Operations {\n /** Revert this run's writes. Files edited since are refused by name unless `force`. */\n REVERT = 'revert_writes',\n}\n\nexport const Workbench_PlaybookRunRequest_Schema = z.object({\n /** Optional product brief forwarded to the derivation. */\n creatorBrief: z.string().min(1).optional(),\n /**\n * Answers to a playbook's declared elicitation, when the creator pre-answers. Keyed by\n * `questionRef` — the elicitation vocabulary's own key, DISTINCT from a clarification answer's\n * `ref` (resume below): two different question planes, two different key names, kept as they are.\n */\n elicitationAnswers: z.array(z.object({\n questionRef: z.string().min(1),\n answer: z.string().min(1),\n })).optional(),\n /** Full pipe — generation, validation, rendering, judge — with NO filesystem writes. */\n dryRun: z.boolean().optional(),\n});\nexport type Workbench_PlaybookRunRequest = z.infer<typeof Workbench_PlaybookRunRequest_Schema>;\n\nexport const Workbench_PlaybookResumeRequest_Schema = z.object({\n /** The suspended run being answered — the handle `run` returned when it stopped to ask. */\n runId: z.string().min(1),\n /** `accept` (requires ≥1 answer), `decline`, or `cancel` — the industry three-action model. */\n action: z.string().min(1),\n answers: z.array(z.object({\n ref: z.string().min(1),\n answer: z.string().min(1),\n })).optional(),\n});\nexport type Workbench_PlaybookResumeRequest = z.infer<typeof Workbench_PlaybookResumeRequest_Schema>;\n\nexport const Workbench_BuildPlanDispatchNextRequest_Schema = z.object({\n /** Optional model-token ceiling forwarded to the dispatch. */\n maximumTokenBudget: z.number().int().positive().optional(),\n});\nexport type Workbench_BuildPlanDispatchNextRequest = z.infer<typeof Workbench_BuildPlanDispatchNextRequest_Schema>;\n\nexport const Workbench_RunWriteRevertRequest_Schema = z.object({\n /** Overwrite files edited since the run. NOT defaulted on — a human edit is never silently destroyed. */\n force: z.boolean().optional(),\n});\nexport type Workbench_RunWriteRevertRequest = z.infer<typeof Workbench_RunWriteRevertRequest_Schema>;\n\n/**\n * Dispatch RESPONSES are LOOSE objects, deliberately: each names the fields the board branches on\n * and forwards the rest verbatim. The companion routes already spread the whole service result, and\n * the recorded lesson stands — naming a closed subset is how five computed fields once vanished\n * from every creator's view until someone noticed live.\n */\nexport const Workbench_PlaybookRunOutcome_Schema = z.looseObject({\n runId: z.string().optional(),\n /** Present exactly when the run is HEALTHY and waiting at a clarification. */\n status: z.string().optional(),\n note: z.string().optional(),\n});\nexport type Workbench_PlaybookRunOutcome = z.infer<typeof Workbench_PlaybookRunOutcome_Schema>;\n\nexport const Workbench_BuildPlanDispatchOutcome_Schema = z.looseObject({\n taskRef: z.string().optional(),\n note: z.string().optional(),\n});\nexport type Workbench_BuildPlanDispatchOutcome = z.infer<typeof Workbench_BuildPlanDispatchOutcome_Schema>;\n\nexport const Workbench_RunWriteRevertOutcome_Schema = z.looseObject({\n runId: z.string().optional(),\n reverted: z.array(z.string()).optional(),\n /** Files whose current bytes differ from what the run wrote — refused by name, revertable with force. */\n refusedDiverged: z.array(z.string()).optional(),\n note: z.string().optional(),\n});\nexport type Workbench_RunWriteRevertOutcome = z.infer<typeof Workbench_RunWriteRevertOutcome_Schema>;\n"]}
|
|
1
|
+
{"version":3,"file":"workbench-creation-plane.custom.shared.schemas.js","sourceRoot":"","sources":["../../../src/workbench/workbench-creation-plane.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;;;;;;GAUG;AACH,MAAM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C,QAAQ,EAAE;IACxC,yGAAyG;IACzG,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IAC/C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { initZodDecorators } from '@wildo-ai/zod-decorators';\n\ninitZodDecorators(z);\n\n/**\n * The CREATION PLANE's shared vocabulary — schemas for the four companion-runtime resource\n * families, and the behavior ids their bindings name.\n *\n * ## What these rows are, and are not\n *\n * They are the companion's OWN RUNTIME projections for the one application it serves: the playbook\n * eligibility board, the build-plan dispatch view, the run write-register and the execution-trace\n * index. Unlike every other workbench resource, nothing here is derived from the application's\n * source by a subprocess — the behaviors materialize IN-PROCESS from the companion's running\n * services, which is why their binding declares `IntrospectionTenancyStance.APPLICATION_RUNTIME`\n * and their variants are authenticated rather than `APP_PUBLIC`.\n *\n * ## Why the vocabularies stay plain strings\n *\n * Same argument as the domain-model schema one file over: `phase`, `functionalTopic` and\n * `targetKind` are owned by `@wildo-ai/saas-specifications`, which this package deliberately does\n * not depend on (it would drag the whole specification graph into every platform consumer). The\n * companion produces the values from the real enums; binding them here would make a row a newer\n * companion legitimately produces unparseable by an older workbench — refusing to show exactly the\n * state the board exists to reveal.\n */\n\n/**\n * The behavior ids the creation-plane bindings declare — the companion's IN-PROCESS catalog.\n *\n * ONE named source, consumed from both ends: the resource configs (this package) write these into\n * `introspectionBinding.behavior`, and the companion's introspection source routes on membership —\n * an id in this set is served by `CreationPlaneProjectionCompanionService` in-process; any other id\n * flows to the subprocess lane. Deliberately NOT added to the companion's\n * `CompanionIntrospectionBehaviorIdValues`: that vocabulary's execution contract\n * (`materializationBoundary: 'subprocess'`, routing targets, service kinds) describes a machinery\n * these behaviors never enter.\n */\nexport enum WorkbenchCreationPlaneBehavior {\n /** `listPlaybookEligibility()` rows + projected `computedAt`/`phase`, behind the eligibility cache. */\n PLAYBOOK_ELIGIBILITY = 'creation-plane.playbook-eligibility',\n /** The build-plan graph's tasks with dispatch `status` computed against git (ready / landed / blocked). */\n BUILD_PLAN_TASKS = 'creation-plane.build-plan-tasks',\n /** The write register's records, pre-image bytes stripped. */\n RUN_WRITE_RECORDS = 'creation-plane.run-write-records',\n /** The execution-trace session index. */\n TRACE_SESSIONS = 'creation-plane.trace-sessions',\n}\n\n/** Membership test the companion's source routes by. */\nexport const WORKBENCH_CREATION_PLANE_BEHAVIOR_IDS: readonly string[] = Object.freeze(\n Object.values(WorkbenchCreationPlaneBehavior),\n);\n\n/**\n * The creation plane's IDENTITY RULE — part of the shared contract, deliberately, because both ends\n * apply it: the companion's projections emit each row's id from its business key\n * (`identityFields` composition refuses values outside `[a-zA-Z0-9_-]`, and playbook refs and trace\n * session ids legitimately carry dots), and a frontend surface holding only the business key\n * (an interrupted run's `playbookRef`) derives the row address the same way. Two copies of this\n * function would be the drift this package exists to prevent.\n *\n * `.` becomes `__`; anything else outside the charset becomes `-`. NOT injective in general —\n * which is why the companion's projections refuse post-sanitization duplicates rather than serving\n * two rows under one id, and why server-side lookups match sanitized forms instead of reversing.\n */\nexport function sanitizeWorkbenchCreationPlaneIdentity(value: string): string {\n return value.replaceAll('.', '__').replace(/[^a-zA-Z0-9_-]/g, '-');\n}\n\n/**\n * The dispatch status of one build-plan task — computed, never stored.\n *\n * `LANDED` = the dispatch service's landed-refs resolution (evidence in git) includes it.\n * `READY` = every prerequisite landed and it has not. `BLOCKED` = at least one prerequisite has\n * not landed. Exactly one holds per task, derived per read.\n */\nexport enum WorkbenchBuildPlanTaskStatus {\n READY = 'ready',\n LANDED = 'landed',\n BLOCKED = 'blocked',\n}\n\n/**\n * One playbook's row on the eligibility board.\n *\n * A projection of the application-creation runtime's `PlaybookEligibility` (whose docs carry the\n * semantics), flattened for a list row: the per-precondition verdict objects are NOT carried —\n * `unmet` is their already-rendered \"why not\" — and two board-level scalars are projected ONTO each\n * row (`phase`, `computedAt`) because a resource row must be complete on its own.\n */\nexport const Workbench_Playbook_Schema = z.object({\n /**\n * EMITTED BY THE BEHAVIOR — `playbookRef` sanitized to the URL-safe identity charset — NOT\n * composed by the binding's `identityFields`. Composition refuses any value outside\n * `[a-zA-Z0-9_-]`, and playbook refs legitimately carry dots (`top_down.phase-gate`), so the\n * projection service derives the field itself (`.` → `__`, anything else invalid → `-`) and\n * REFUSES on a post-sanitization duplicate rather than serving two rows under one id.\n */\n workbenchPlaybookId: z.string().min(1).isPrimaryKey().isSummaryField(),\n playbookRef: z.string().min(1).isSummaryField(),\n playbookVersion: z.string().min(1).isSummaryField(),\n /**\n * The PLAYBOOK's own taxonomy label (`top_down`, `bottom_up`, `refinement`, `cross_cutting`) — what\n * kind of reasoning it embodies.\n *\n * It said \"the derived journey phase — board-level, projected per row\" until 2026-09-04, and that is\n * what it carried: one application-level value stamped onto every row, while the workbench rendered\n * it beside each playbook as if it described that playbook. The derived application phase is gone\n * (`MetaWorkflow_Phase`); this is the label that was always true of the row.\n */\n phase: z.string().min(1).isSummaryField(),\n /** One sentence: what running this playbook produces. */\n intent: z.string().isSummaryField(),\n /** The deterministic gate's verdict: may this playbook run right now. */\n eligible: z.boolean().isSummaryField(),\n /** The `detail` of every unsatisfied precondition — \"why not\", already rendered by the runtime. */\n unmet: z.array(z.string()).isSummaryField(),\n /** Every READINESS precondition holds and only SEQUENCING ones do not: information, not a refusal. */\n blockedOnlyBySequencing: z.boolean().isSummaryField(),\n /** This playbook interviews the creator, so a run will stop and ask. */\n requiresElicitation: z.boolean().isSummaryField(),\n /** Families this playbook writes that ALREADY have content — a run implies an overwrite. */\n wouldReplace: z.array(z.string()).isSummaryField(),\n /** Families no render profile can land yet. A run would refuse; the board says so first. */\n unlandableFamilies: z.array(z.string()).isSummaryField(),\n /** Landed outputs whose declared inputs have moved since. An ANNOTATION, never a gate. */\n staleOutputs: z.array(z.object({\n family: z.string().min(1),\n changedInputs: z.array(z.string()),\n })).isSummaryField(),\n /** When the served board was computed — the cache's honesty field, rendered as \"as of\". */\n computedAt: z.string().min(1).isSummaryField(),\n});\nexport type Workbench_Playbook = z.infer<typeof Workbench_Playbook_Schema>;\n\n/**\n * One build-plan task in the DISPATCH view.\n *\n * DELIBERATELY THIN beside the `workbenchBuildTasks` aspect resource, which projects the same\n * authored population from the specification artifact with its traceability edges. This row\n * answers \"what can run next and what has landed\"; authored detail (skill refs, serves edges)\n * stays on the aspect row sharing the same `taskRef`.\n */\nexport const Workbench_BuildPlanTask_Schema = z.object({\n /** Emitted by the behavior (task refs are already URL-safe by their own regex; same lane as its siblings). */\n workbenchBuildPlanTaskId: z.string().min(1).isPrimaryKey().isSummaryField(),\n taskRef: z.string().min(1).isSummaryField(),\n /** One sentence of intent: what this task delivers. */\n objective: z.string().min(1).isSummaryField(),\n /** The target's `kind` discriminant only — the physical detail belongs to the dispatch plan. */\n targetKind: z.string().min(1).isSummaryField(),\n /** Which phase of building the application this task belongs to (context, never ordering). */\n functionalTopic: z.string().min(1).isSummaryField(),\n status: z.enum(WorkbenchBuildPlanTaskStatus).isSummaryField(),\n /** Task refs that must land first — the only thing that decides what may run next. */\n prerequisiteTaskRefs: z.array(z.string()).isSummaryField(),\n});\nexport type Workbench_BuildPlanTask = z.infer<typeof Workbench_BuildPlanTask_Schema>;\n\n/**\n * One run's write record — the evidence lane behind every dispatch.\n *\n * Pre-image BYTES (`previousContent`) are deliberately not projected: they belong to the revert\n * mechanism, and a list row carrying every pre-image would ship the working tree's history through\n * every LIST.\n */\nexport const Workbench_RunWriteRecord_Schema = z.object({\n /** Emitted by the behavior — `runId` sanitized to the identity charset (see the playbook id note). */\n workbenchRunWriteRecordId: z.string().min(1).isPrimaryKey().isSummaryField(),\n runId: z.string().min(1).isSummaryField(),\n playbookRef: z.string().min(1).isSummaryField(),\n /*\n * The JOIN KEYS (Phase 4, requirement R5), emitted by the projection as SANITIZED identities so\n * the values match the target rows' ids — `playbookRef` is the human-readable business key,\n * `workbenchPlaybookId` is the addressable one. Named exactly as the target's own field\n * identifier so the global field-identifier map resolves the reference, and declared as\n * REFERENCE relationships beside the configs so the engine's reference machinery (labels,\n * navigation, related lists) does the linking — no bespoke link code.\n */\n /** The playbook this run executed — every record has one. */\n workbenchPlaybookId: z.string().min(1).isForeignKey().isSummaryField(),\n /**\n * The execution-trace session the run recorded under, resolved by PREFIX (a runId is\n * `<sessionId>-<playbookRef>-<ts>`). NULL when no listed session matches — a register can\n * legitimately outlive its trace directory, and a dangling id would render as a broken link.\n */\n workbenchTraceSessionId: z.string().min(1).isForeignKey().isSummaryField().nullable(),\n /** When the run recorded its writes (ISO). */\n at: z.string().min(1).isSummaryField(),\n files: z.array(z.object({\n /** App-root-relative path of the written file. */\n path: z.string().min(1),\n /** What makes a revert honest: whether the file existed before the run. */\n existedBefore: z.boolean(),\n })).isSummaryField(),\n /** Projected count, so a list can say \"wrote 7 files\" without rendering the array. */\n fileCount: z.number().int().isSummaryField(),\n});\nexport type Workbench_RunWriteRecord = z.infer<typeof Workbench_RunWriteRecord_Schema>;\n\n/** One execution-trace session — the queryable index the board links from. */\nexport const Workbench_TraceSession_Schema = z.object({\n /** Emitted by the behavior — session ids admit `.` (`dev-<ISO-ish>` directory names), so sanitized (see the playbook id note). */\n workbenchTraceSessionId: z.string().min(1).isPrimaryKey().isSummaryField(),\n sessionId: z.string().min(1).isSummaryField(),\n /** When the session started (ISO-ish; embedded in the session directory name). */\n startedAt: z.string().min(1).isSummaryField(),\n label: z.string().min(1).isSummaryField().nullable(),\n eventCount: z.number().int().isSummaryField(),\n stepCount: z.number().int().isSummaryField(),\n});\nexport type Workbench_TraceSession = z.infer<typeof Workbench_TraceSession_Schema>;\n\n/*\n * ────────────────────────── Phase 3: dispatch OPERATIONS ──────────────────────────\n *\n * The creation board's dispatches as CUSTOM OPERATIONS (plan D3): declared here beside the\n * resources they act on, implemented COMPANION-SIDE as `OVERRIDE_ALL` custom implementations\n * delegating to the companion's own services — never as generated writes, which the introspection\n * repository refuses by contract. `OVERRIDE_ALL` returns before the framework's repository and\n * transaction machinery, which is exactly what a dispatch onto a derived resource needs (verified,\n * plan Phase 0), and none of these declares a transaction contract, so the\n * `override_all_not_supported_for_transaction_requiring_operation` refusal never applies.\n */\n\n/** The playbook resource's dispatch verbs. */\nexport enum WorkbenchPlaybooks_Operations {\n /** Fire one playbook run (the row is the playbook; the body carries brief/answers/dryRun). */\n RUN = 'run',\n /** Answer a run that stopped at a clarification — accept with answers, decline, or cancel. */\n RESUME = 'resume_run',\n}\n\n/** The build-plan resource's dispatch verb. */\nexport enum WorkbenchBuildPlanTasks_Operations {\n /**\n * Run the NEXT ready build-plan task — collection-level on purpose: the graph already encodes\n * the order its author intended, and a per-row dispatch would be a second scheduler disagreeing\n * with the first (the dispatch service's own doctrine).\n */\n DISPATCH_NEXT = 'dispatch_next',\n}\n\n/** The write-record resource's dispatch verb. */\nexport enum WorkbenchRunWriteRecords_Operations {\n /** Revert this run's writes. Files edited since are refused by name unless `force`. */\n REVERT = 'revert_writes',\n}\n\nexport const Workbench_PlaybookRunRequest_Schema = z.object({\n /** Optional product brief forwarded to the derivation. */\n creatorBrief: z.string().min(1).optional(),\n /**\n * Answers to a playbook's declared elicitation, when the creator pre-answers. Keyed by\n * `questionRef` — the elicitation vocabulary's own key, DISTINCT from a clarification answer's\n * `ref` (resume below): two different question planes, two different key names, kept as they are.\n */\n elicitationAnswers: z.array(z.object({\n questionRef: z.string().min(1),\n answer: z.string().min(1),\n })).optional(),\n /** Full pipe — generation, validation, rendering, judge — with NO filesystem writes. */\n dryRun: z.boolean().optional(),\n});\nexport type Workbench_PlaybookRunRequest = z.infer<typeof Workbench_PlaybookRunRequest_Schema>;\n\nexport const Workbench_PlaybookResumeRequest_Schema = z.object({\n /** The suspended run being answered — the handle `run` returned when it stopped to ask. */\n runId: z.string().min(1),\n /** `accept` (requires ≥1 answer), `decline`, or `cancel` — the industry three-action model. */\n action: z.string().min(1),\n answers: z.array(z.object({\n ref: z.string().min(1),\n answer: z.string().min(1),\n })).optional(),\n});\nexport type Workbench_PlaybookResumeRequest = z.infer<typeof Workbench_PlaybookResumeRequest_Schema>;\n\n/*\n * DELIBERATELY EMPTY. It carried `maximumTokenBudget`, a ceiling the caller stated and nothing\n * ever enforced: `composeBuildTaskCodingContract` dropped the input on 2026-09-08 and now DERIVES\n * the budget by summing the selected sources' `estimatedTokens`. A request field that reads as a\n * limit and binds nothing is worse than no field, so the whole chain — query parameter, body field,\n * and the three service signatures that forwarded it — is gone. The schema stays because the verb\n * still takes a (currently empty) request body.\n */\nexport const Workbench_BuildPlanDispatchNextRequest_Schema = z.object({});\nexport type Workbench_BuildPlanDispatchNextRequest = z.infer<typeof Workbench_BuildPlanDispatchNextRequest_Schema>;\n\nexport const Workbench_RunWriteRevertRequest_Schema = z.object({\n /** Overwrite files edited since the run. NOT defaulted on — a human edit is never silently destroyed. */\n force: z.boolean().optional(),\n});\nexport type Workbench_RunWriteRevertRequest = z.infer<typeof Workbench_RunWriteRevertRequest_Schema>;\n\n/**\n * Dispatch RESPONSES are LOOSE objects, deliberately: each names the fields the board branches on\n * and forwards the rest verbatim. The companion routes already spread the whole service result, and\n * the recorded lesson stands — naming a closed subset is how five computed fields once vanished\n * from every creator's view until someone noticed live.\n */\nexport const Workbench_PlaybookRunOutcome_Schema = z.looseObject({\n runId: z.string().optional(),\n /** Present exactly when the run is HEALTHY and waiting at a clarification. */\n status: z.string().optional(),\n note: z.string().optional(),\n});\nexport type Workbench_PlaybookRunOutcome = z.infer<typeof Workbench_PlaybookRunOutcome_Schema>;\n\nexport const Workbench_BuildPlanDispatchOutcome_Schema = z.looseObject({\n taskRef: z.string().optional(),\n note: z.string().optional(),\n});\nexport type Workbench_BuildPlanDispatchOutcome = z.infer<typeof Workbench_BuildPlanDispatchOutcome_Schema>;\n\nexport const Workbench_RunWriteRevertOutcome_Schema = z.looseObject({\n runId: z.string().optional(),\n reverted: z.array(z.string()).optional(),\n /** Files whose current bytes differ from what the run wrote — refused by name, revertable with force. */\n refusedDiverged: z.array(z.string()).optional(),\n note: z.string().optional(),\n});\nexport type Workbench_RunWriteRevertOutcome = z.infer<typeof Workbench_RunWriteRevertOutcome_Schema>;\n"]}
|
package/dist/esm/workbench/workbench-resources.custom.shared.resources-config.schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workbench-resources.custom.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"workbench-resources.custom.shared.resources-config.schemas.d.ts","sourceRoot":"","sources":["../../../src/workbench/workbench-resources.custom.shared.resources-config.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,qBAAqB,EAIrB,0BAA0B,EAC1B,4BAA4B,EAC5B,oBAAoB,EAMrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,OAAO,EAGL,qCAAqC,EACrC,mCAAmC,EACpC,MAAM,6CAA6C,CAAC;AAMrD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,yCAAyC,OAAO,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,wBAAwB;;;;;EA6BvC;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B;;;;;;EAK3C;AAGD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sCAAsC,EAAE,oBAAoB,EA2CxE,CAAC;AAsBF,KAAK,sCAAsC,GACvC,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,CAAC;AAE/B,eAAO,MAAM,oEAAoE,GAC9E,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkC7C,CAAC;AAiCL,KAAK,6CAA6C,GAC9C,qBAAqB,CAAC,IAAI,GAC1B,qBAAqB,CAAC,IAAI,CAAC;AAE/B,eAAO,MAAM,2EAA2E,GACrF,wBAAwB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;kBA+C7C,CAAC;AAEL,eAAO,MAAM,iDAAiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAzHnC,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8DAwEtB,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;CA0DhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workbench-resources.custom.shared.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"workbench-resources.custom.shared.schemas.d.ts","sourceRoot":"","sources":["../../../src/workbench/workbench-resources.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;iBA+DtD,CAAC;AAEH,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAC;AAE/G;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgL1C,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAEvF;;;;;GAKG;AACH,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvF,qFAAqF;AACrF,MAAM,MAAM,iCAAiC,GAAG,wBAAwB,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/F;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oBAAY,qCAAqC;IAC/C,oFAAoF;IACpF,MAAM,WAAW;IACjB,8FAA8F;IAC9F,KAAK,UAAU;IACf,6FAA6F;IAC7F,QAAQ,aAAa;IACrB,8CAA8C;IAC9C,QAAQ,aAAa;IACrB,uFAAuF;IACvF,WAAW,gBAAgB;IAC3B;;;;;;;;;;;OAWG;IACH,YAAY,iBAAiB;CAC9B;AAED;;;;;;GAMG;AACH,oBAAY,mCAAmC;IAC7C,4FAA4F;IAC5F,YAAY,iBAAiB;IAC7B,kGAAkG;IAClG,cAAc,mBAAmB;IACjC;;;;;;;OAOG;IACH,UAAU,eAAe;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;iBAoHjD,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workbench-resources.custom.shared.schemas.js","sourceRoot":"","sources":["../../../../src/workbench/workbench-resources.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAGrB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC,CAAC,MAAM,CAAC;IAClE;;;;;;;;OAQG;IACH,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CA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,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B;;;;;;OAMG;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,cAAc,EAAE;IACzD,iGAAiG;IACjG,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE;IAC3D,oFAAoF;IACpF,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,cAAc,EAAE;IAC1D;;;;;;;;;;OAUG;IACH,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,cAAc,EAAE;IAC5D;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrD;;;;;;OAMG;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B;;;;;;OAMG;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B;;;;;;;OAOG;IACH,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { initZodDecorators } from '@wildo-ai/zod-decorators';\n\ninitZodDecorators(z);\n\n\n/**\n * One relationship, as it rides on BOTH resources it joins.\n *\n * ## Why an edge appears on two rows rather than on one\n *\n * A relationship genuinely IS a property of both resources — \"what is `deals` related to?\" is a\n * question about `deals` and about everything `deals` touches — so carrying it on both is a\n * statement of what it means, not an encoding chosen to fit a row shape. Hanging every edge off one\n * arbitrarily-chosen endpoint would be the encoding, and the choice would have to be re-derived by\n * every reader.\n *\n * The consumer draws each edge once, keyed by {@link relationshipId}. The duplication costs one extra\n * copy of a small object per edge and buys a row that is complete on its own.\n *\n * ## Why the vocabularies are plain strings\n *\n * These values cross a subprocess boundary from the OBSERVED application's registry, which may be\n * built against a different engine revision than the workbench. Binding `nature` or the cardinalities to the engine enums would make a\n * row the observed application can legitimately produce unparseable here — the workbench refusing to\n * show exactly the drift it exists to reveal.\n */\nexport const Workbench_DomainResourceRelationship_Schema = z.object({\n /**\n * Stable identity for ONE edge within this projection, composed from every field carried about it.\n *\n * NOT the `resourceType1__resourceType2__foreignKeyField` triple the retired\n * `workbenchResourceRelationships` resource addressed a row by: that triple is not total here,\n * because a MANY-to-MANY edge carries\n * `jointResourceType` and no `foreignKeyField`. Two edges agreeing on every field below are\n * indistinguishable to a graph, so merging them loses nothing a reader could have seen.\n */\n relationshipId: z.string().min(1),\n resourceType1: z.string().min(1),\n resourceType2: z.string().min(1),\n cardinality1: z.string().min(1),\n cardinality2: z.string().min(1),\n /**\n * `composition`, `reference` or `association` — every member `RelationshipNature` declares — kept as\n * a plain string for the drift-tolerance reason above, not because a fourth one exists today.\n */\n nature: z.string().min(1),\n /** The field carrying the join. Absent on a junction-backed MANY-to-MANY, which has no FK column. */\n foreignKeyField: z.string().min(1).nullable(),\n /**\n * Which side's rows CARRY the foreign key — the direction an arrow must point.\n *\n * Resolved by the framework's own `resolveForeignKeyHolderResourceType`, from CARDINALITY, never\n * from declaration order: `(TODOS, USERS, MANY, ONE, { foreignKeyField })` is a valid child-first\n * declaration that puts the referenced resource in `resourceType2`, so a consumer reading position\n * draws half its arrows backwards.\n */\n foreignKeyHolderResourceType: z.string().min(1),\n /** The junction resource of a MANY-to-MANY, which the framework requires such an edge to name. */\n jointResourceType: z.string().min(1).nullable(),\n /** Whether this edge is the structural ownership anchor giving `resourceType2` its scope. */\n isPrimaryScope: z.boolean(),\n /**\n * Whether the edge is DECLARED BUT INACTIVE.\n *\n * The one field here whose absence made the graph WRONG rather than thinner: a disabled edge\n * constrains nothing at runtime, so drawing it like a live one tells a reader the application has\n * a relationship it does not have. Carried even though the dogfood application disables none\n * (measured 2026-08-31: 0 of 16) — a field that is uniformly `false` today is exactly the one that\n * silently misleads the first time it is not.\n */\n isDisabled: z.boolean(),\n /**\n * How a caller reaches rows on the far side — `requires_context`, `standalone`, and whatever else\n * the observed application's engine revision declares.\n *\n * A plain string for the same drift-tolerance reason `nature` is one.\n */\n accessScopeStrategy: z.string().min(1).nullable(),\n /** Whether the parent endpoint is `mandatory` or `optional` for the child's addressing. */\n parentResourceRequirement: z.string().min(1).nullable(),\n /**\n * WHICH resource this edge anchors scope to, when it anchors one.\n *\n * Not derivable from {@link isPrimaryScope}, which says only THAT it anchors. On an edge whose\n * endpoints are both scoped, the two answer different questions.\n */\n primaryScope: z.string().min(1).nullable(),\n /** Whether a cycle through this edge is permitted — a graph-shape fact a graph should be able to show. */\n allowCycle: z.boolean(),\n});\n\nexport type Workbench_DomainResourceRelationship = z.infer<typeof Workbench_DomainResourceRelationship_Schema>;\n\n/**\n * ONE resource of the observed application's domain model — node, module membership, specification\n * and edges in a single row.\n *\n * ## Why every field is a summary field\n *\n * A LIST renders the SUMMARY projection, and this resource's list IS its whole purpose: the graph\n * consumes the collection. A field left out of the summary is a field the graph cannot draw, and the\n * omission is silent — the row arrives, the field is simply absent. So the summary here is the full\n * row by design rather than by neglect.\n *\n * ## Why this is one row per RESOURCE rather than one row per module or one row for the graph\n *\n * Edges are resource-to-resource. A module-per-node projection would have to AGGREGATE them, which\n * destroys precisely the meanings the framework refuses to merge — nature, cardinality, foreign-key\n * direction — and a graph that draws every edge as one grey line has lost information the flat table\n * at least preserved.\n */\nexport const Workbench_DomainResource_Schema = z.object({\n /**\n * Composed by the introspection source from the binding's `identityFields` (`['resourceType']`).\n *\n * `.isSummaryField()` on the IDENTITY field is load-bearing rather than cosmetic: the projection a\n * list renders is the summary, and a row with no id is a row nothing can address — the failure that\n * made every relationship row unclickable before its id was marked.\n */\n workbenchDomainResourceId: z.string().min(1).isPrimaryKey().isSummaryField(),\n resourceType: z.string().min(1).isSummaryField(),\n /**\n * The module that registers this resource, or `null`.\n *\n * `null` is a FACT, not a gap: no module of the observed application owns this resource, which is\n * true of every ENGINE resource — and an application merges all of them, since `initializeResources`\n * applies the engine's core factory map unconditionally and both registries merge it. They are\n * carried rather than dropped because they are part of the running application, and because an edge\n * to the resource that gives a row its tenant scope is the most load-bearing edge in the graph.\n *\n * No `origin` field restates this. The absence of a module IS the distinction, and a second field\n * saying the same thing is a second thing that can disagree with the first.\n */\n moduleId: z.string().min(1).isSummaryField().nullable(),\n /** `domain` or `engine` — the kind the owning module declares, when there is one. */\n moduleKind: z.string().min(1).isSummaryField().nullable(),\n /**\n * Which part of its owner this resource belongs to — a SECOND grouping axis, under the module.\n *\n * Sourced from `ResourceSpecificationConfig.subDomain`. For engine resources that is the closed\n * `EngineResourceSubDomain` vocabulary (`auth`, `billing`, `users`, …), which exists because the\n * engine's 85 resources otherwise arrive as one flat set and every surface that has to present them\n * invents a grouping of its own.\n *\n * A plain `string` here rather than that enum, and deliberately: this schema is shared by a\n * workbench that observes an application whose own sub-domains it cannot enumerate. Pinning the\n * engine's vocabulary here would make an application's value invalid at the wire.\n *\n * `null` means the resource specification declares none — an application resource today, or an engine\n * resource with no spec at all. A consumer grouping by this must carry an \"unclassified\" bucket and\n * say so, rather than folding those rows into a real group.\n */\n subDomain: z.string().min(1).isSummaryField().nullable(),\n /**\n * Every field of the materialized `mainSchema`, with everything the framework knows about it.\n *\n * This replaced a bare `fieldNames: string[]`, whose JSDoc argued that \"a domain-model panel\n * answers what a resource HOLDS\" and that per-field extraction \"belongs to `resource-specifications`\".\n * The premise was right and the conclusion aged badly: a NAME answers \"does this field exist\",\n * which the node already implies by counting them, and a reader who opens a resource wants what\n * the field IS. The cost was then MEASURED rather than assumed — 715 fields across the 82 engine\n * resources extract to 264 KB, a fraction of what the relationship edges already cost — so the\n * reason to withhold it was gone.\n *\n * `params`, `derived` and `origin` are OPAQUE records on purpose. They are the extractor's own\n * output — authored spec prose, framework-derived structure, base-vs-variant provenance — and each\n * is an open shape that grows with the decorators. Restating them field by field here would make\n * this schema a second, always-lagging copy of a contract `@wildo-ai/saas-specifications` owns;\n * a consumer that needs one reads it through that package's type.\n */\n fields: z.array(z.object({\n fieldName: z.string().min(1),\n /** Which `{primitive}Spec()` decorator carried the authored prose, when one did. */\n specDecorator: z.string().min(1).nullable(),\n params: z.record(z.string(), z.unknown()).nullable(),\n derived: z.record(z.string(), z.unknown()).nullable(),\n origin: z.record(z.string(), z.unknown()).nullable(),\n /**\n * The field's DECORATOR record, as the schema declares it — beside `derived`, which is the\n * extractor's interpretation of it.\n *\n * It carries what the interpretation drops: `isSummaryField`, `isHidden`, `excludeFromCreate` /\n * `excludeFromUpdate`, `dataCategories`, and the index / unique / primary-key trio.\n *\n * It does NOT carry `*.ui-behavior.tsx` configuration, and that is a reachability limit rather\n * than an omission: those decorators are applied by a FRONTEND module the companion never loads,\n * because the subprocess resolves `library`, `specifications` and `service` targets and there is\n * no frontend one. Measured on the engine's resources — zero UI keys present.\n */\n metadata: z.record(z.string(), z.unknown()).nullable(),\n })).isSummaryField(),\n /**\n * Every operation the resource declares, projected to what a READER needs.\n *\n * Never the DTOs. A materialized operation carries six Zod schemas — request, response, summary,\n * context, internal, repository — each serializing to tens of kilobytes, so carrying the operation\n * objects would put megabytes on the wire to say which verbs exist. What is here is the identity,\n * the variant, the authorization and the flags that change what the operation DOES.\n *\n * An EMPTY `roles` array is a real answer — no role gate on that variant — and not a gap.\n */\n operations: z.array(z.object({\n operationIdentifier: z.string().min(1),\n /** The TRANSPORT kind: `api_call`, `internal_call`, `repository_only`, … */\n variantType: z.string().min(1).nullable(),\n /**\n * WHICH variant of that transport — `admin`, `summary`, `context` — or `null` for the default.\n *\n * The missing half of an operation's IDENTITY, and its absence was a defect rather than missing\n * detail: `organizations` declares four operations that are all `read` × `api_call`, separated\n * only by this key, and across the engine's core map 133 of 794 operations collided on the pair\n * without it.\n */\n variantKey: z.string().min(1).nullable(),\n /** For a CUSTOM operation, the core verb it behaves like. `null` for a core operation. */\n resourceOperationLike: z.string().min(1).nullable(),\n isDefault: z.boolean(),\n roles: z.array(z.string()),\n riskLevel: z.string().min(1).nullable(),\n isUnimplemented: z.boolean(),\n isDisabled: z.boolean(),\n requiresStepUpAuthentication: z.boolean(),\n admitsCrossTenantPlatformAdministration: z.boolean(),\n auditableEventType: z.string().min(1).nullable(),\n isMcpExposed: z.boolean(),\n requiredFeatures: z.array(z.string()),\n /**\n * Everything else the operation declares — HTTP verb, runtime mode, bulk and API-key posture,\n * notification fan-out, custom-implementation modes, authoritative fields.\n *\n * A DENY LIST over the operation's own keys on the producing side, for the same reason `advanced`\n * is, and this is the one that proved the argument: a hand-picked set of twelve fields shipped\n * without `variantKey`, `httpVerb`, `isBulkOperation` or `serviceRuntimeMode`. The six DTO\n * schemas are excluded by name — each serializes to tens of kilobytes.\n */\n attributes: z.record(z.string(), z.unknown()),\n /**\n * The authored specification for this operation, keyed by `operationIdentifier` — so every\n * VARIANT of one verb carries the same entry, which is what the specification describes.\n *\n * `null` means the specification does not mention the operation: a gap a reader can act on.\n */\n specification: z.record(z.string(), z.unknown()).nullable(),\n /** The authored `frontend.views` overlay for this operation, when there is one. */\n view: z.record(z.string(), z.unknown()).nullable(),\n })).isSummaryField(),\n /**\n * The operations for which the resource specification declares a FRONTEND view overlay (`frontend.views`).\n *\n * Refs only. The entries are authoring prose about how an operation surfaces, which belongs to a\n * specification reader; what a domain-model panel can act on is which operations have an authored\n * view and — by difference with `operations` — which do not.\n */\n viewRefs: z.array(z.string()).isSummaryField(),\n /**\n * The configuration facts that are neither prose nor structure — persistence, policy, bindings.\n *\n * Everything on the resource's `ResourceConfiguration` that decides how it BEHAVES rather than what\n * it holds: which database it lives in, whether it is a system resource, its retention,\n * transposition, portability and data-subject policies, its HTTP and introspection bindings.\n *\n * An OPAQUE record, and deliberately so. The producer builds it by DENY list over the\n * configuration's own keys rather than by enumerating the ones that exist today, because\n * `ResourceConfiguration` has grown several of these fields in as many months and an enumeration\n * reports the subset its author knew about. Typing it here would put that enumeration back.\n */\n advanced: z.record(z.string(), z.unknown()).isSummaryField(),\n /**\n * The authored specification's PROSE, or `null` when this resource has none.\n *\n * It rides in the row rather than being fetched on selection because a per-selection fetch is not\n * cheaper: `deriveRows` has no per-row path, so an addressed READ derives the WHOLE set and filters\n * it afterwards. \"Fetch the specification when a node is clicked\" would therefore be a second full\n * derivation of the entire application.\n */\n specification: z.object({\n /** Why this resource exists in the domain. */\n purpose: z.string(),\n /** The functional role it plays inside the business architecture. */\n businessRole: z.string(),\n /** How it evolves over time. Optional in the specification contract, so nullable here. */\n lifecycleRole: z.string().nullable(),\n /** Domain caveats not encoded structurally elsewhere. */\n businessConstraints: z.array(z.string()),\n }).isSummaryField().nullable(),\n /** Every relationship this resource participates in, on either side. */\n relationships: z.array(Workbench_DomainResourceRelationship_Schema).isSummaryField(),\n});\n\nexport type Workbench_DomainResource = z.infer<typeof Workbench_DomainResource_Schema>;\n\n/**\n * ONE FIELD of a domain resource — named so a consumer can hold one without re-deriving its type.\n *\n * Indexed off the row rather than declared separately, because the schema is the one authority for\n * the shape and a second declaration is a second thing that can drift from it.\n */\nexport type Workbench_DomainResourceField = Workbench_DomainResource['fields'][number];\n\n/** ONE OPERATION of a domain resource — indexed off the row, for the same reason. */\nexport type Workbench_DomainResourceOperation = Workbench_DomainResource['operations'][number];\n\n/**\n * The QUESTION a specification family answers — the axis the workbench groups them by.\n *\n * ## Why the families are grouped at all\n *\n * Fifteen rows in one undifferentiated list is a directory, not a review surface. A creator opening\n * the workbench is not looking for \"the `document-release-policy` family\"; they are looking for what\n * was decided about who this product is for, or about what it must promise. Grouping by the question\n * answered is what makes the list navigable without inventing twelve destinations.\n *\n * ## Why this is a display vocabulary and not a property of the family\n *\n * `ApplicationSpecificationFamilySemanticSchemaRef` names what a family MEANS and what validates it.\n * Nothing in the runtime branches on the concern below — it exists so a reader can find a row. Adding\n * it to the semantic authority would put a workbench presentation choice inside the contract the\n * journey lands artifacts against.\n *\n * The family → concern mapping deliberately lives with the projection that derives it (the\n * companion's `specification-artifacts` behavior), beside the semantic authority it must stay\n * exhaustive over, rather than here where the authority is not reachable.\n */\nexport enum WorkbenchSpecificationArtifactConcern {\n /** Why the product exists and who it is for — `vision-brief`, `market-snapshot`. */\n INTENT = 'intent',\n /** What it must do and what it costs — `requirements`, `feature-drafts`, `business-model`. */\n SCOPE = 'scope',\n /** How and when it gets built — `domain-plan`, `build-plan`, `roadmap`, `placement-plan`. */\n DELIVERY = 'delivery',\n /** How it presents itself — `brand-brief`. */\n IDENTITY = 'identity',\n /** What it must promise and publish — the assurance and governed-document families. */\n OBLIGATIONS = 'obligations',\n /**\n * A family the workbench has not been taught to group.\n *\n * A named member rather than a throw, and rather than silence. The population is derived from the\n * semantic authority, so a family added there arrives here with no classification — and the two\n * alternatives are both worse than a visible bucket: refusing the derivation would blank the whole\n * page over one unmapped row, and defaulting into a real concern would file the new family\n * somewhere plausible and wrong, which nobody would notice.\n *\n * A companion test asserts this member is currently UNUSED, so it stays a signal rather than\n * becoming a habit.\n */\n UNCLASSIFIED = 'unclassified',\n}\n\n/**\n * Whether a family has landed, and whether what landed still validates.\n *\n * THREE states, not two, because \"not landed\" and \"landed but invalid\" are the opposite instructions\n * to a reviewer: the first is work the journey has not done, the second is work it did that no longer\n * holds. A boolean `isValid` would report both as `false`.\n */\nexport enum WorkbenchSpecificationArtifactState {\n /** The family is exported by the application and its `_core` validator reports no error. */\n LANDED_VALID = 'landed_valid',\n /** The family is exported and its `_core` validator reports at least one ERROR-severity issue. */\n LANDED_INVALID = 'landed_invalid',\n /**\n * The application exports nothing for this family.\n *\n * Reported as a ROW rather than omitted — the same call `definition-specifications.behavior.ts`\n * makes for the same reason: *\"an omitted row and a family that does not exist would look the same\n * to the reader.\"* On a fresh application an empty list would say nothing; fifteen NOT_LANDED rows\n * say what the journey has left to produce.\n */\n NOT_LANDED = 'not_landed',\n}\n\n/**\n * ONE application-specification family, projected for a human reviewer.\n *\n * ## Why the prose fields are markdown strings\n *\n * `StringDisplayMode.MARKDOWN` renders GFM through the framework's own display chrome, which is what\n * lets headings, lists and paragraphs survive into the page. The alternative — modelling each\n * family's shape as nested schema fields — would have to be done fifteen times, would freeze twelve\n * `_core` contracts into this projection, and would still render as a form rather than as a document.\n *\n * The rendering is an OUTLINE, never a table. That is the acceptance criterion this resource exists\n * to satisfy: these artifacts are prose-heavy and their value is in the rationale, so a projection\n * that put them in columns would destroy exactly what makes them worth reviewing.\n *\n * ## Why the heavy fields are NOT summary fields\n *\n * `document`, `issues`, `decisionRecord` and `diagram` are excluded from the summary by omission, so\n * a list carries the INDEX while a detail page carries the documents. One derivation still computes\n * all of them either way — this bounds the RESPONSE, not the work.\n *\n * Which variant a caller gets matters, and is easy to state wrongly: the LIST operation's DEFAULT\n * variant answers the full row, and it is the operation's `summary` variant that applies this\n * projection. Measured against the live wonder-crm companion, 2026-08-31:\n * `GET /api/v1/workbench-specification-artifacts` → **149,089 B**, and\n * `…/workbench-specification-artifacts/summary` → **3,654 B** carrying the eight fields marked\n * below. A list layout renders the summary variant — which is also why the addressing field must be\n * marked, or every row in that list is unclickable.\n */\nexport const Workbench_SpecificationArtifact_Schema = z.object({\n /**\n * The family id — `vision-brief`, `market-snapshot`, `compliance-program`.\n *\n * The source's own key, marked `.isSummaryField()` because a list row with no id is a row nothing\n * can address: the summary projection is what a click reads the target from.\n */\n family: z.string().min(1).isPrimaryKey().isSummaryField(),\n /** The family's name in a creator's words — `Vision`, `Market`, `Assurance programme`. */\n title: z.string().min(1).isSummaryField(),\n /**\n * What this family IS, in one sentence a creator recognizes — static per family, present whether\n * or not anything landed. This is the summary card's subtitle: a card reading only\n * \"Governed-document drafts · Not landed\" tells a reader nothing they can act on; \"The drafts of\n * the public documents this product must publish\" does.\n */\n description: z.string().min(1).isSummaryField(),\n /**\n * A one-line PULSE of the landed content — `\"3 ICPs · 5 personas · 2 positionings\"`, the vision's\n * own one-liner — or `null` when the family has not landed.\n *\n * Derived server-side from the RAW value so the list answers \"how much is in there\" without any\n * client downloading fifteen full documents. It is a COUNT-and-headline summary, never a\n * truncation of prose: a clipped sentence reads as an accident, a count reads as an answer.\n */\n contentSummary: z.string().nullable().isSummaryField(),\n /** The question this family answers, which is the axis the list groups by. */\n concern: z.enum(WorkbenchSpecificationArtifactConcern).isSummaryField(),\n /** Landed and valid, landed and invalid, or not landed at all. */\n state: z.enum(WorkbenchSpecificationArtifactState).isSummaryField(),\n /** The `_core` contract the family's content must satisfy, verbatim from the semantic authority. */\n schemaRef: z.string().min(1),\n /**\n * Where the family's file lives, relative to the application root — the file a reader opens when\n * the rendering is not enough.\n *\n * `null` when this runtime places no file for the family. A placement and a RENDER PROFILE are\n * different things (`playbook-output-landing-target`), and only the placement is asked for here.\n */\n sourcePath: z.string().min(1).nullable().isSummaryField(),\n /** ERROR-severity issues the family's own validator reports on the landed content, right now. */\n errorCount: z.number().int().nonnegative().isSummaryField(),\n /** WARN-severity issues — authoring drift that does not invalidate the artifact. */\n warnCount: z.number().int().nonnegative().isSummaryField(),\n /**\n * Every playbook whose declared `outputs[].family` is this family.\n *\n * This is the durable half of \"what produced it\": a fact about the compiled catalog, in git, true\n * whether or not any run's state survives. A link to the RUN that produced this particular value\n * was deliberately rejected — runs, traces and the write register are a per-run cache under\n * `one-source-of-truth.md` Rule 5, so a durable artifact pointing into deletable state is dangling\n * by design. The link runs the other way: a run may name what it wrote.\n *\n * Empty for a family no playbook produces — which is a finding, not a gap.\n */\n producedByPlaybookRefs: z.array(z.string()).isSummaryField(),\n /**\n * The landed family value, RAW — exactly the object the specifications package exports.\n *\n * ## Why the raw value rides beside its rendering\n *\n * The per-family display templates (workbench `artifact-templates/`) render EDITORIALLY — an ICP\n * card, a requirement with its acceptance criteria, a placement decision with its rationale — and\n * an editorial template needs the VALUE, not a markdown projection of it. The markdown `document`\n * below stays: it is the structural fallback every family keeps behind the template error\n * boundary, and the whole rendering for a family no template covers yet.\n *\n * ## Untyped HERE, typed at the EDGE — a measured decision, not an omission\n *\n * The typed `_core` snapshot schemas live in `@wildo-ai/saas-specifications`, which depends on\n * `saas-frontend-lib` AND `saas-backend-lib` (its package.json) — while this package is the\n * platform's light contracts-only spine (`platform/CLAUDE.md`). Typing this field would drag the\n * whole engine into every consumer of this package for a shape only two consumers read. The two\n * readers type it themselves: the companion behavior validates through the semantic authority\n * before emitting, and the workbench templates narrow via TYPE-ONLY imports (erased at compile,\n * zero runtime dependency). Recorded with alternatives in\n * `.claude/plans/workbench-product-artifacts-ux-analysis.md` (D1).\n *\n * Deliberately NOT a summary field: the LIST carries the index, and this is the heaviest thing a\n * row owns. Emitted from the RAW landed value — never from a validator's parsed output, whose\n * schema `.default()`s would inject content the author never wrote.\n */\n content: z.record(z.string(), z.unknown()).nullable(),\n /**\n * The artifact rendered as a document, or `null` when the family has not landed.\n *\n * Produced by `renderSpecificationFamilyReviewDocument` — an outline over the landed value, not a\n * prompt block. The prompt renderers (`market-render-prompt`, `brand-render-prompt`) read the same\n * content for a language model and must never be reused here.\n */\n document: z.string().nullable(),\n /**\n * The validator's own findings, rendered for a reader, or `null` when there are none.\n *\n * Carried as content rather than as counts alone because a reviewer deciding whether to accept an\n * artifact needs to see WHICH rule failed and where, and the counts beside them in the list are\n * only the signal to come and look.\n */\n issues: z.string().nullable(),\n /**\n * `DECISIONS.md` committed beside the family, verbatim, or `null` when there is none.\n *\n * The strongest provenance this surface has: it names the playbook that produced the artifact and,\n * more importantly, records every question the creator was asked — including the ones they did NOT\n * answer, where \"the derivation chose for itself\". A run that asked nothing writes no such file, so\n * `null` here means \"no clarification was recorded\", never \"no clarification happened\".\n */\n decisionRecord: z.string().nullable(),\n /**\n * `DIAGRAM.md` committed beside the family, verbatim, or `null`.\n *\n * Three families have one today (`domain-plan`, `build-plan`, `roadmap`). It is surfaced rather\n * than re-derived: the diagram is already a committed output of the family, regenerated on every\n * landing, and rendering a second picture here would be a second thing that can disagree with it.\n */\n diagram: z.string().nullable(),\n});\n\nexport type Workbench_SpecificationArtifact = z.infer<typeof Workbench_SpecificationArtifact_Schema>;\n"]}
|
|
1
|
+
{"version":3,"file":"workbench-resources.custom.shared.schemas.js","sourceRoot":"","sources":["../../../src/workbench/workbench-resources.custom.shared.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,iBAAiB,CAAC,CAAC,CAAC,CAAC;AAGrB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,2CAA2C,GAAG,CAAC,CAAC,MAAM,CAAC;IAClE;;;;;;;;OAQG;IACH,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACjC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B;;;OAGG;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,qGAAqG;IACrG,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC7C;;;;;;;OAOG;IACH,4BAA4B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;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CAAC,cAAc,EAAE;IAC1D;;;;;;;;;;OAUG;IACH,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,cAAc,EAAE;IAC5D;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IACrD;;;;;;OAMG;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B;;;;;;OAMG;IACH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B;;;;;;;OAOG;IACH,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC","sourcesContent":["import { z } from 'zod';\nimport { initZodDecorators } from '@wildo-ai/zod-decorators';\n\ninitZodDecorators(z);\n\n\n/**\n * One relationship, as it rides on BOTH resources it joins.\n *\n * ## Why an edge appears on two rows rather than on one\n *\n * A relationship genuinely IS a property of both resources — \"what is `deals` related to?\" is a\n * question about `deals` and about everything `deals` touches — so carrying it on both is a\n * statement of what it means, not an encoding chosen to fit a row shape. Hanging every edge off one\n * arbitrarily-chosen endpoint would be the encoding, and the choice would have to be re-derived by\n * every reader.\n *\n * The consumer draws each edge once, keyed by {@link relationshipId}. The duplication costs one extra\n * copy of a small object per edge and buys a row that is complete on its own.\n *\n * ## Why the vocabularies are plain strings\n *\n * These values cross a subprocess boundary from the OBSERVED application's registry, which may be\n * built against a different engine revision than the workbench. Binding `nature` or the cardinalities to the engine enums would make a\n * row the observed application can legitimately produce unparseable here — the workbench refusing to\n * show exactly the drift it exists to reveal.\n */\nexport const Workbench_DomainResourceRelationship_Schema = z.object({\n /**\n * Stable identity for ONE edge within this projection, composed from every field carried about it.\n *\n * NOT the `resourceType1__resourceType2__foreignKeyField` triple the retired\n * `workbenchResourceRelationships` resource addressed a row by: that triple is not total here,\n * because a MANY-to-MANY edge carries\n * `jointResourceType` and no `foreignKeyField`. Two edges agreeing on every field below are\n * indistinguishable to a graph, so merging them loses nothing a reader could have seen.\n */\n relationshipId: z.string().min(1),\n resourceType1: z.string().min(1),\n resourceType2: z.string().min(1),\n cardinality1: z.string().min(1),\n cardinality2: z.string().min(1),\n /**\n * `composition`, `reference` or `association` — every member `RelationshipNature` declares — kept as\n * a plain string for the drift-tolerance reason above, not because a fourth one exists today.\n */\n nature: z.string().min(1),\n /** The field carrying the join. Absent on a junction-backed MANY-to-MANY, which has no FK column. */\n foreignKeyField: z.string().min(1).nullable(),\n /**\n * Which side's rows CARRY the foreign key — the direction an arrow must point.\n *\n * Resolved by the framework's own `resolveForeignKeyHolderResourceType`, from CARDINALITY, never\n * from declaration order: `(TODOS, USERS, MANY, ONE, { foreignKeyField })` is a valid child-first\n * declaration that puts the referenced resource in `resourceType2`, so a consumer reading position\n * draws half its arrows backwards.\n */\n foreignKeyHolderResourceType: z.string().min(1),\n /** The junction resource of a MANY-to-MANY, which the framework requires such an edge to name. */\n jointResourceType: z.string().min(1).nullable(),\n /** Whether this edge is the structural ownership anchor giving `resourceType2` its scope. */\n isPrimaryScope: z.boolean(),\n /**\n * Whether the edge is DECLARED BUT INACTIVE.\n *\n * The one field here whose absence made the graph WRONG rather than thinner: a disabled edge\n * constrains nothing at runtime, so drawing it like a live one tells a reader the application has\n * a relationship it does not have. Carried even though the dogfood application disables none\n * (measured 2026-08-31: 0 of 16) — a field that is uniformly `false` today is exactly the one that\n * silently misleads the first time it is not.\n */\n isDisabled: z.boolean(),\n /**\n * How a caller reaches rows on the far side — `requires_context`, `standalone`, and whatever else\n * the observed application's engine revision declares.\n *\n * A plain string for the same drift-tolerance reason `nature` is one.\n */\n accessScopeStrategy: z.string().min(1).nullable(),\n /** Whether the parent endpoint is `mandatory` or `optional` for the child's addressing. */\n parentResourceRequirement: z.string().min(1).nullable(),\n /**\n * WHICH resource this edge anchors scope to, when it anchors one.\n *\n * Not derivable from {@link isPrimaryScope}, which says only THAT it anchors. On an edge whose\n * endpoints are both scoped, the two answer different questions.\n */\n primaryScope: z.string().min(1).nullable(),\n /** Whether a cycle through this edge is permitted — a graph-shape fact a graph should be able to show. */\n allowCycle: z.boolean(),\n});\n\nexport type Workbench_DomainResourceRelationship = z.infer<typeof Workbench_DomainResourceRelationship_Schema>;\n\n/**\n * ONE resource of the observed application's domain model — node, module membership, specification\n * and edges in a single row.\n *\n * ## Why every field is a summary field\n *\n * A LIST renders the SUMMARY projection, and this resource's list IS its whole purpose: the graph\n * consumes the collection. A field left out of the summary is a field the graph cannot draw, and the\n * omission is silent — the row arrives, the field is simply absent. So the summary here is the full\n * row by design rather than by neglect.\n *\n * ## Why this is one row per RESOURCE rather than one row per module or one row for the graph\n *\n * Edges are resource-to-resource. A module-per-node projection would have to AGGREGATE them, which\n * destroys precisely the meanings the framework refuses to merge — nature, cardinality, foreign-key\n * direction — and a graph that draws every edge as one grey line has lost information the flat table\n * at least preserved.\n */\nexport const Workbench_DomainResource_Schema = z.object({\n /**\n * Composed by the introspection source from the binding's `identityFields` (`['resourceType']`).\n *\n * `.isSummaryField()` on the IDENTITY field is load-bearing rather than cosmetic: the projection a\n * list renders is the summary, and a row with no id is a row nothing can address — the failure that\n * made every relationship row unclickable before its id was marked.\n */\n workbenchDomainResourceId: z.string().min(1).isPrimaryKey().isSummaryField(),\n resourceType: z.string().min(1).isSummaryField(),\n /**\n * The module that registers this resource, or `null`.\n *\n * `null` is a FACT, not a gap: no module of the observed application owns this resource, which is\n * true of every ENGINE resource — and an application merges all of them, since `initializeResources`\n * applies the engine's core factory map unconditionally and both registries merge it. They are\n * carried rather than dropped because they are part of the running application, and because an edge\n * to the resource that gives a row its tenant scope is the most load-bearing edge in the graph.\n *\n * No `origin` field restates this. The absence of a module IS the distinction, and a second field\n * saying the same thing is a second thing that can disagree with the first.\n */\n moduleId: z.string().min(1).isSummaryField().nullable(),\n /** `domain` or `engine` — the kind the owning module declares, when there is one. */\n moduleKind: z.string().min(1).isSummaryField().nullable(),\n /**\n * Which part of its owner this resource belongs to — a SECOND grouping axis, under the module.\n *\n * Sourced from `ResourceSpecificationConfig.subDomain`. For engine resources that is the closed\n * `EngineResourceSubDomain` vocabulary (`auth`, `billing`, `users`, …), which exists because the\n * engine's 85 resources otherwise arrive as one flat set and every surface that has to present them\n * invents a grouping of its own.\n *\n * A plain `string` here rather than that enum, and deliberately: this schema is shared by a\n * workbench that observes an application whose own sub-domains it cannot enumerate. Pinning the\n * engine's vocabulary here would make an application's value invalid at the wire.\n *\n * `null` means the resource specification declares none — an application resource today, or an engine\n * resource with no spec at all. A consumer grouping by this must carry an \"unclassified\" bucket and\n * say so, rather than folding those rows into a real group.\n */\n subDomain: z.string().min(1).isSummaryField().nullable(),\n /**\n * Every field of the materialized `mainSchema`, with everything the framework knows about it.\n *\n * This replaced a bare `fieldNames: string[]`, whose JSDoc argued that \"a domain-model panel\n * answers what a resource HOLDS\" and that per-field extraction \"belongs to `resource-specifications`\".\n * The premise was right and the conclusion aged badly: a NAME answers \"does this field exist\",\n * which the node already implies by counting them, and a reader who opens a resource wants what\n * the field IS. The cost was then MEASURED rather than assumed — 715 fields across the 82 engine\n * resources extract to 264 KB, a fraction of what the relationship edges already cost — so the\n * reason to withhold it was gone.\n *\n * `params`, `derived` and `origin` are OPAQUE records on purpose. They are the extractor's own\n * output — authored spec prose, framework-derived structure, base-vs-variant provenance — and each\n * is an open shape that grows with the decorators. Restating them field by field here would make\n * this schema a second, always-lagging copy of a contract `@wildo-ai/saas-specifications` owns;\n * a consumer that needs one reads it through that package's type.\n */\n fields: z.array(z.object({\n fieldName: z.string().min(1),\n /** Which `{primitive}Spec()` decorator carried the authored prose, when one did. */\n specDecorator: z.string().min(1).nullable(),\n params: z.record(z.string(), z.unknown()).nullable(),\n derived: z.record(z.string(), z.unknown()).nullable(),\n origin: z.record(z.string(), z.unknown()).nullable(),\n /**\n * The field's DECORATOR record, as the schema declares it — beside `derived`, which is the\n * extractor's interpretation of it.\n *\n * It carries what the interpretation drops: `isSummaryField`, `isHidden`, `excludeFromCreate` /\n * `excludeFromUpdate`, `dataCategories`, and the index / unique / primary-key trio.\n *\n * It does NOT carry `*.ui-behavior.tsx` configuration, and that is a reachability limit rather\n * than an omission: those decorators are applied by a FRONTEND module the companion never loads,\n * because the subprocess resolves `library`, `specifications` and `service` targets and there is\n * no frontend one. Measured on the engine's resources — zero UI keys present.\n */\n metadata: z.record(z.string(), z.unknown()).nullable(),\n })).isSummaryField(),\n /**\n * Every operation the resource declares, projected to what a READER needs.\n *\n * Never the DTOs. A materialized operation carries six Zod schemas — request, response, summary,\n * context, internal, repository — each serializing to tens of kilobytes, so carrying the operation\n * objects would put megabytes on the wire to say which verbs exist. What is here is the identity,\n * the variant, the authorization and the flags that change what the operation DOES.\n *\n * An EMPTY `roles` array is a real answer — no role gate on that variant — and not a gap.\n */\n operations: z.array(z.object({\n operationIdentifier: z.string().min(1),\n /** The TRANSPORT kind: `api_call`, `internal_call`, `repository_only`, … */\n variantType: z.string().min(1).nullable(),\n /**\n * WHICH variant of that transport — `admin`, `summary`, `context` — or `null` for the default.\n *\n * The missing half of an operation's IDENTITY, and its absence was a defect rather than missing\n * detail: `organizations` declares four operations that are all `read` × `api_call`, separated\n * only by this key, and across the engine's core map 133 of 794 operations collided on the pair\n * without it.\n */\n variantKey: z.string().min(1).nullable(),\n /** For a CUSTOM operation, the core verb it behaves like. `null` for a core operation. */\n resourceOperationLike: z.string().min(1).nullable(),\n isDefault: z.boolean(),\n roles: z.array(z.string()),\n riskLevel: z.string().min(1).nullable(),\n isUnimplemented: z.boolean(),\n isDisabled: z.boolean(),\n requiresStepUpAuthentication: z.boolean(),\n admitsCrossTenantPlatformAdministration: z.boolean(),\n auditableEventType: z.string().min(1).nullable(),\n isMcpExposed: z.boolean(),\n requiredFeatures: z.array(z.string()),\n /**\n * Everything else the operation declares — HTTP verb, runtime mode, bulk and API-key posture,\n * notification fan-out, custom-implementation modes, authoritative fields.\n *\n * A DENY LIST over the operation's own keys on the producing side, for the same reason `advanced`\n * is, and this is the one that proved the argument: a hand-picked set of twelve fields shipped\n * without `variantKey`, `httpVerb`, `isBulkOperation` or `serviceRuntimeMode`. The six DTO\n * schemas are excluded by name — each serializes to tens of kilobytes.\n */\n attributes: z.record(z.string(), z.unknown()),\n /**\n * The authored specification for this operation, keyed by `operationIdentifier` — so every\n * VARIANT of one verb carries the same entry, which is what the specification describes.\n *\n * `null` means the specification does not mention the operation: a gap a reader can act on.\n */\n specification: z.record(z.string(), z.unknown()).nullable(),\n /** The authored `frontend.views` overlay for this operation, when there is one. */\n view: z.record(z.string(), z.unknown()).nullable(),\n })).isSummaryField(),\n /**\n * The operations for which the resource specification declares a FRONTEND view overlay (`frontend.views`).\n *\n * Refs only. The entries are authoring prose about how an operation surfaces, which belongs to a\n * specification reader; what a domain-model panel can act on is which operations have an authored\n * view and — by difference with `operations` — which do not.\n */\n viewRefs: z.array(z.string()).isSummaryField(),\n /**\n * The configuration facts that are neither prose nor structure — persistence, policy, bindings.\n *\n * Everything on the resource's `ResourceConfiguration` that decides how it BEHAVES rather than what\n * it holds: which database it lives in, whether it is a system resource, its retention,\n * transposition, portability and data-subject policies, its HTTP and introspection bindings.\n *\n * An OPAQUE record, and deliberately so. The producer builds it by DENY list over the\n * configuration's own keys rather than by enumerating the ones that exist today, because\n * `ResourceConfiguration` has grown several of these fields in as many months and an enumeration\n * reports the subset its author knew about. Typing it here would put that enumeration back.\n */\n advanced: z.record(z.string(), z.unknown()).isSummaryField(),\n /**\n * The authored specification's PROSE, or `null` when this resource has none.\n *\n * It rides in the row rather than being fetched on selection because a per-selection fetch is not\n * cheaper: `deriveRows` has no per-row path, so an addressed READ derives the WHOLE set and filters\n * it afterwards. \"Fetch the specification when a node is clicked\" would therefore be a second full\n * derivation of the entire application.\n */\n specification: z.object({\n /** Why this resource exists in the domain. */\n purpose: z.string(),\n /** The functional role it plays inside the business architecture. */\n businessRole: z.string(),\n /** How it evolves over time. Optional in the specification contract, so nullable here. */\n lifecycleRole: z.string().nullable(),\n /** Domain caveats not encoded structurally elsewhere. */\n businessConstraints: z.array(z.string()),\n }).isSummaryField().nullable(),\n /** Every relationship this resource participates in, on either side. */\n relationships: z.array(Workbench_DomainResourceRelationship_Schema).isSummaryField(),\n});\n\nexport type Workbench_DomainResource = z.infer<typeof Workbench_DomainResource_Schema>;\n\n/**\n * ONE FIELD of a domain resource — named so a consumer can hold one without re-deriving its type.\n *\n * Indexed off the row rather than declared separately, because the schema is the one authority for\n * the shape and a second declaration is a second thing that can drift from it.\n */\nexport type Workbench_DomainResourceField = Workbench_DomainResource['fields'][number];\n\n/** ONE OPERATION of a domain resource — indexed off the row, for the same reason. */\nexport type Workbench_DomainResourceOperation = Workbench_DomainResource['operations'][number];\n\n/**\n * The QUESTION a specification family answers — the axis the workbench groups them by.\n *\n * ## Why the families are grouped at all\n *\n * Fifteen rows in one undifferentiated list is a directory, not a review surface. A creator opening\n * the workbench is not looking for \"the `document-release-policy` family\"; they are looking for what\n * was decided about who this product is for, or about what it must promise. Grouping by the question\n * answered is what makes the list navigable without inventing twelve destinations.\n *\n * ## Why this is a display vocabulary and not a property of the family\n *\n * `ApplicationSpecificationFamilySemanticSchemaRef` names what a family MEANS and what validates it.\n * Nothing in the runtime branches on the concern below — it exists so a reader can find a row. Adding\n * it to the semantic authority would put a workbench presentation choice inside the contract the\n * journey lands artifacts against.\n *\n * The family → concern mapping deliberately lives with the projection that derives it (the\n * companion's `specification-artifacts` behavior), beside the semantic authority it must stay\n * exhaustive over, rather than here where the authority is not reachable.\n */\nexport enum WorkbenchSpecificationArtifactConcern {\n /** Why the product exists and who it is for — `vision-brief`, `market-snapshot`. */\n INTENT = 'intent',\n /** What it must do and what it costs — `requirements`, `feature-drafts`, `business-model`. */\n SCOPE = 'scope',\n /** How and when it gets built — `domain-plan`, `build-plan`, `roadmap`, `placement-plan`. */\n DELIVERY = 'delivery',\n /** How it presents itself — `brand-brief`. */\n IDENTITY = 'identity',\n /** What it must promise and publish — the assurance and governed-document families. */\n OBLIGATIONS = 'obligations',\n /**\n * A family the workbench has not been taught to group.\n *\n * A named member rather than a throw, and rather than silence. The population is derived from the\n * semantic authority, so a family added there arrives here with no classification — and the two\n * alternatives are both worse than a visible bucket: refusing the derivation would blank the whole\n * page over one unmapped row, and defaulting into a real concern would file the new family\n * somewhere plausible and wrong, which nobody would notice.\n *\n * A companion test asserts this member is currently UNUSED, so it stays a signal rather than\n * becoming a habit.\n */\n UNCLASSIFIED = 'unclassified',\n}\n\n/**\n * Whether a family has landed, and whether what landed still validates.\n *\n * THREE states, not two, because \"not landed\" and \"landed but invalid\" are the opposite instructions\n * to a reviewer: the first is work the journey has not done, the second is work it did that no longer\n * holds. A boolean `isValid` would report both as `false`.\n */\nexport enum WorkbenchSpecificationArtifactState {\n /** The family is exported by the application and its `_core` validator reports no error. */\n LANDED_VALID = 'landed_valid',\n /** The family is exported and its `_core` validator reports at least one ERROR-severity issue. */\n LANDED_INVALID = 'landed_invalid',\n /**\n * The application exports nothing for this family.\n *\n * Reported as a ROW rather than omitted — the same call `definition-specifications.behavior.ts`\n * makes for the same reason: *\"an omitted row and a family that does not exist would look the same\n * to the reader.\"* On a fresh application an empty list would say nothing; fifteen NOT_LANDED rows\n * say what the journey has left to produce.\n */\n NOT_LANDED = 'not_landed',\n}\n\n/**\n * ONE application-specification family, projected for a human reviewer.\n *\n * ## Why the prose fields are markdown strings\n *\n * `StringDisplayMode.MARKDOWN` renders GFM through the framework's own display chrome, which is what\n * lets headings, lists and paragraphs survive into the page. The alternative — modelling each\n * family's shape as nested schema fields — would have to be done fifteen times, would freeze twelve\n * `_core` contracts into this projection, and would still render as a form rather than as a document.\n *\n * The rendering is an OUTLINE, never a table. That is the acceptance criterion this resource exists\n * to satisfy: these artifacts are prose-heavy and their value is in the rationale, so a projection\n * that put them in columns would destroy exactly what makes them worth reviewing.\n *\n * ## Why the heavy fields are NOT summary fields\n *\n * `document`, `issues`, `decisionRecord` and `diagram` are excluded from the summary by omission, so\n * a list carries the INDEX while a detail page carries the documents. One derivation still computes\n * all of them either way — this bounds the RESPONSE, not the work.\n *\n * Which variant a caller gets matters, and is easy to state wrongly: the LIST operation's DEFAULT\n * variant answers the full row, and it is the operation's `summary` variant that applies this\n * projection. Measured against the live wonder-crm companion, 2026-08-31:\n * `GET /api/v1/workbench-specification-artifacts` → **149,089 B**, and\n * `…/workbench-specification-artifacts/summary` → **3,654 B** carrying the eight fields marked\n * below. A list layout renders the summary variant — which is also why the addressing field must be\n * marked, or every row in that list is unclickable.\n */\nexport const Workbench_SpecificationArtifact_Schema = z.object({\n /**\n * The family id — `vision-brief`, `market-snapshot`, `compliance-program`.\n *\n * The source's own key, marked `.isSummaryField()` because a list row with no id is a row nothing\n * can address: the summary projection is what a click reads the target from.\n */\n family: z.string().min(1).isPrimaryKey().isSummaryField(),\n /** The family's name in a creator's words — `Vision`, `Market`, `Assurance programme`. */\n title: z.string().min(1).isSummaryField(),\n /**\n * What this family IS, in one sentence a creator recognizes — static per family, present whether\n * or not anything landed. This is the summary card's subtitle: a card reading only\n * \"Governed-document drafts · Not landed\" tells a reader nothing they can act on; \"The drafts of\n * the public documents this product must publish\" does.\n */\n description: z.string().min(1).isSummaryField(),\n /**\n * A one-line PULSE of the landed content — `\"3 ICPs · 5 personas · 2 positionings\"`, the vision's\n * own one-liner — or `null` when the family has not landed.\n *\n * Derived server-side from the RAW value so the list answers \"how much is in there\" without any\n * client downloading fifteen full documents. It is a COUNT-and-headline summary, never a\n * truncation of prose: a clipped sentence reads as an accident, a count reads as an answer.\n */\n contentSummary: z.string().nullable().isSummaryField(),\n /** The question this family answers, which is the axis the list groups by. */\n concern: z.enum(WorkbenchSpecificationArtifactConcern).isSummaryField(),\n /** Landed and valid, landed and invalid, or not landed at all. */\n state: z.enum(WorkbenchSpecificationArtifactState).isSummaryField(),\n /** The `_core` contract the family's content must satisfy, verbatim from the semantic authority. */\n schemaRef: z.string().min(1),\n /**\n * Where the family's file lives, relative to the application root — the file a reader opens when\n * the rendering is not enough.\n *\n * `null` when this runtime places no file for the family. A placement and a RENDER PROFILE are\n * different things (`playbook-output-landing-target`), and only the placement is asked for here.\n */\n sourcePath: z.string().min(1).nullable().isSummaryField(),\n /** ERROR-severity issues the family's own validator reports on the landed content, right now. */\n errorCount: z.number().int().nonnegative().isSummaryField(),\n /** WARN-severity issues — authoring drift that does not invalidate the artifact. */\n warnCount: z.number().int().nonnegative().isSummaryField(),\n /**\n * Every playbook whose declared `outputs[].family` is this family.\n *\n * This is the durable half of \"what produced it\": a fact about the compiled catalog, in git, true\n * whether or not any run's state survives. A link to the RUN that produced this particular value\n * was deliberately rejected — runs, traces and the write register are a per-run cache under\n * `one-source-of-truth.md` Rule 5, so a durable artifact pointing into deletable state is dangling\n * by design. The link runs the other way: a run may name what it wrote.\n *\n * Empty for a family no playbook produces — which is a finding, not a gap.\n */\n producedByPlaybookRefs: z.array(z.string()).isSummaryField(),\n /**\n * The landed family value, RAW — exactly the object the specifications package exports.\n *\n * ## Why the raw value rides beside its rendering\n *\n * The per-family display templates (workbench `artifact-templates/`) render EDITORIALLY — an ICP\n * card, a requirement with its acceptance criteria, a placement decision with its rationale — and\n * an editorial template needs the VALUE, not a markdown projection of it. The markdown `document`\n * below stays: it is the structural fallback every family keeps behind the template error\n * boundary, and the whole rendering for a family no template covers yet.\n *\n * ## Untyped HERE, typed at the EDGE — a measured decision, not an omission\n *\n * The typed `_core` snapshot schemas live in `@wildo-ai/saas-specifications`, which depends on\n * `saas-frontend-lib` AND `saas-backend-lib` (its package.json) — while this package is the\n * platform's light contracts-only spine (`platform/CLAUDE.md`). Typing this field would drag the\n * whole engine into every consumer of this package for a shape only two consumers read. The two\n * readers type it themselves: the companion behavior validates through the semantic authority\n * before emitting, and the workbench templates narrow via TYPE-ONLY imports (erased at compile,\n * zero runtime dependency). Recorded with alternatives in\n * `.claude/plans/workbench-product-artifacts-ux-analysis.md` (D1).\n *\n * Deliberately NOT a summary field: the LIST carries the index, and this is the heaviest thing a\n * row owns. Emitted from the RAW landed value — never from a validator's parsed output, whose\n * schema `.default()`s would inject content the author never wrote.\n */\n content: z.record(z.string(), z.unknown()).nullable(),\n /**\n * The artifact rendered as a document, or `null` when the family has not landed.\n *\n * Produced by `renderSpecificationFamilyReviewDocument` — an outline over the landed value, not a\n * prompt block. The prompt renderers (`market-render-prompt`, `brand-render-prompt`) read the same\n * content for a language model and must never be reused here.\n */\n document: z.string().nullable(),\n /**\n * The validator's own findings, rendered for a reader, or `null` when there are none.\n *\n * Carried as content rather than as counts alone because a reviewer deciding whether to accept an\n * artifact needs to see WHICH rule failed and where, and the counts beside them in the list are\n * only the signal to come and look.\n */\n issues: z.string().nullable(),\n /**\n * `DECISIONS.md` committed beside the family, verbatim, or `null` when there is none.\n *\n * The strongest provenance this surface has: it names the playbook that produced the artifact and,\n * more importantly, records every question the creator was asked — including the ones they did NOT\n * answer, where \"the derivation chose for itself\". A run that asked nothing writes no such file, so\n * `null` here means \"no clarification was recorded\", never \"no clarification happened\".\n */\n decisionRecord: z.string().nullable(),\n /**\n * `DIAGRAM.md` committed beside the family, verbatim, or `null`.\n *\n * Three families have one today (`domain-plan`, `build-plan`, `roadmap`). It is surfaced rather\n * than re-derived: the diagram is already a committed output of the family, regenerated on every\n * landing, and rendering a second picture here would be a second thing that can disagree with it.\n */\n diagram: z.string().nullable(),\n});\n\nexport type Workbench_SpecificationArtifact = z.infer<typeof Workbench_SpecificationArtifact_Schema>;\n"]}
|