@cleocode/core 2026.6.7 → 2026.6.9

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.
Files changed (67) hide show
  1. package/dist/db/index.d.ts +5 -1
  2. package/dist/db/index.d.ts.map +1 -1
  3. package/dist/db/index.js +5 -1
  4. package/dist/db/index.js.map +1 -1
  5. package/dist/docs/build-provenance-graph.d.ts +12 -0
  6. package/dist/docs/build-provenance-graph.d.ts.map +1 -1
  7. package/dist/docs/build-provenance-graph.js +52 -0
  8. package/dist/docs/build-provenance-graph.js.map +1 -1
  9. package/dist/docs/display-alias.d.ts +97 -0
  10. package/dist/docs/display-alias.d.ts.map +1 -0
  11. package/dist/docs/display-alias.js +136 -0
  12. package/dist/docs/display-alias.js.map +1 -0
  13. package/dist/docs/docs-read-model.d.ts +47 -0
  14. package/dist/docs/docs-read-model.d.ts.map +1 -1
  15. package/dist/docs/docs-read-model.js +40 -2
  16. package/dist/docs/docs-read-model.js.map +1 -1
  17. package/dist/docs/export-document.js +929 -732
  18. package/dist/docs/export-document.js.map +3 -3
  19. package/dist/docs/index.d.ts +6 -0
  20. package/dist/docs/index.d.ts.map +1 -1
  21. package/dist/docs/index.js +3 -0
  22. package/dist/docs/index.js.map +1 -1
  23. package/dist/docs/numbering.d.ts +29 -0
  24. package/dist/docs/numbering.d.ts.map +1 -1
  25. package/dist/docs/numbering.js +41 -0
  26. package/dist/docs/numbering.js.map +1 -1
  27. package/dist/docs/read-doc.d.ts +60 -0
  28. package/dist/docs/read-doc.d.ts.map +1 -0
  29. package/dist/docs/read-doc.js +188 -0
  30. package/dist/docs/read-doc.js.map +1 -0
  31. package/dist/docs/wikilinks.d.ts +119 -0
  32. package/dist/docs/wikilinks.d.ts.map +1 -0
  33. package/dist/docs/wikilinks.js +217 -0
  34. package/dist/docs/wikilinks.js.map +1 -0
  35. package/dist/internal.d.ts +3 -1
  36. package/dist/internal.d.ts.map +1 -1
  37. package/dist/internal.js +2 -1
  38. package/dist/internal.js.map +1 -1
  39. package/dist/llm/plugin-facade.js +973 -778
  40. package/dist/llm/plugin-facade.js.map +3 -3
  41. package/dist/store/attachment-store.d.ts +5 -0
  42. package/dist/store/attachment-store.d.ts.map +1 -1
  43. package/dist/store/attachment-store.js +7 -1
  44. package/dist/store/attachment-store.js.map +1 -1
  45. package/dist/store/dual-scope-db.d.ts +83 -0
  46. package/dist/store/dual-scope-db.d.ts.map +1 -1
  47. package/dist/store/dual-scope-db.js +135 -6
  48. package/dist/store/dual-scope-db.js.map +1 -1
  49. package/dist/store/exodus/abort-events.d.ts +116 -0
  50. package/dist/store/exodus/abort-events.d.ts.map +1 -0
  51. package/dist/store/exodus/abort-events.js +130 -0
  52. package/dist/store/exodus/abort-events.js.map +1 -0
  53. package/dist/store/exodus/index.d.ts +1 -0
  54. package/dist/store/exodus/index.d.ts.map +1 -1
  55. package/dist/store/exodus/index.js +1 -0
  56. package/dist/store/exodus/index.js.map +1 -1
  57. package/dist/store/repair-malformed-dbs.d.ts +87 -0
  58. package/dist/store/repair-malformed-dbs.d.ts.map +1 -0
  59. package/dist/store/repair-malformed-dbs.js +188 -0
  60. package/dist/store/repair-malformed-dbs.js.map +1 -0
  61. package/dist/store/schema/attachments.d.ts +149 -0
  62. package/dist/store/schema/attachments.d.ts.map +1 -1
  63. package/dist/store/schema/attachments.js +93 -0
  64. package/dist/store/schema/attachments.js.map +1 -1
  65. package/migrations/drizzle-tasks/20260605000001_t11826-docs-wikilinks/migration.sql +110 -0
  66. package/migrations/drizzle-tasks/20260606000001_t11875-attachments-display-alias/migration.sql +46 -0
  67. package/package.json +12 -12
@@ -7926,7 +7926,7 @@ var init_operations_registry = __esm({
7926
7926
  gateway: "mutate",
7927
7927
  domain: "docs",
7928
7928
  operation: "add",
7929
- description: "docs.add (mutate) \u2014 attach a local file or URL to a CLEO owner entity (task, session, observation)",
7929
+ description: "docs.add (mutate) \u2014 attach a local file, URL, or inline content to a CLEO owner entity (task, session, observation)",
7930
7930
  tier: 1,
7931
7931
  idempotent: false,
7932
7932
  sessionRequired: false,
@@ -7950,6 +7950,12 @@ var init_operations_registry = __esm({
7950
7950
  required: false,
7951
7951
  description: "Remote URL to attach"
7952
7952
  },
7953
+ {
7954
+ name: "content",
7955
+ type: "string",
7956
+ required: false,
7957
+ description: "Inline document body (T10965); mutually exclusive with file/url"
7958
+ },
7953
7959
  {
7954
7960
  name: "desc",
7955
7961
  type: "string",
@@ -9656,7 +9662,8 @@ var init_provenance = __esm({
9656
9662
  "superseded-by",
9657
9663
  "related-task",
9658
9664
  "linked-decision",
9659
- "derived-from"
9665
+ "derived-from",
9666
+ "shares-topic"
9660
9667
  ];
9661
9668
  DOC_LIFECYCLE_STATUSES = [
9662
9669
  "active",
@@ -9731,6 +9738,41 @@ var init_provenance = __esm({
9731
9738
  }
9732
9739
  });
9733
9740
 
9741
+ // packages/contracts/src/docs/read.ts
9742
+ import { z as z8 } from "zod";
9743
+ var docFrontmatterSchema, docBodySchema, docReadResponseSchema;
9744
+ var init_read = __esm({
9745
+ "packages/contracts/src/docs/read.ts"() {
9746
+ "use strict";
9747
+ docFrontmatterSchema = z8.object({
9748
+ slug: z8.string(),
9749
+ kind: z8.string().nullable(),
9750
+ title: z8.string().nullable(),
9751
+ summary: z8.string().nullable(),
9752
+ lifecycleStatus: z8.string(),
9753
+ docVersion: z8.number().int(),
9754
+ ownerVersion: z8.string().nullable(),
9755
+ supersedes: z8.string().nullable(),
9756
+ supersededBy: z8.string().nullable(),
9757
+ topics: z8.array(z8.string()).readonly(),
9758
+ relatedTasks: z8.array(z8.string()).readonly(),
9759
+ sha256: z8.string(),
9760
+ createdAt: z8.string()
9761
+ });
9762
+ docBodySchema = z8.object({
9763
+ encoding: z8.enum(["utf-8", "base64"]),
9764
+ text: z8.string().optional(),
9765
+ base64: z8.string().optional(),
9766
+ sizeBytes: z8.number().int().nonnegative(),
9767
+ mimeType: z8.string().nullable()
9768
+ });
9769
+ docReadResponseSchema = z8.object({
9770
+ frontmatter: docFrontmatterSchema,
9771
+ body: docBodySchema
9772
+ });
9773
+ }
9774
+ });
9775
+
9734
9776
  // packages/contracts/src/engine-result.ts
9735
9777
  var init_engine_result = __esm({
9736
9778
  "packages/contracts/src/engine-result.ts"() {
@@ -9906,72 +9948,72 @@ var init_errors = __esm({
9906
9948
  });
9907
9949
 
9908
9950
  // packages/contracts/src/evidence-atom-schema.ts
9909
- import { z as z8 } from "zod";
9951
+ import { z as z9 } from "zod";
9910
9952
  var commitAtomSchema, filesAtomSchema, testRunAtomSchema, toolAtomSchema, urlAtomSchema, noteAtomSchema, decisionAtomSchema, prAtomSchema, locDropAtomSchema, callsiteCoverageAtomSchema, AC_UUID_REGEX, AC_ALIAS_REGEX, SATISFIES_TASK_ID_REGEX, SATISFIES_VERSION_PIN_REGEX, satisfiesAtomSchema, EvidenceAtomSchema, GATE_EVIDENCE_REQUIREMENTS, ATOM_EXAMPLES;
9911
9953
  var init_evidence_atom_schema = __esm({
9912
9954
  "packages/contracts/src/evidence-atom-schema.ts"() {
9913
9955
  "use strict";
9914
- commitAtomSchema = z8.object({
9915
- kind: z8.literal("commit"),
9916
- sha: z8.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
9956
+ commitAtomSchema = z9.object({
9957
+ kind: z9.literal("commit"),
9958
+ sha: z9.string().regex(/^[0-9a-f]{7,40}$/i, "commit sha must be 7-40 hex characters")
9917
9959
  });
9918
- filesAtomSchema = z8.object({
9919
- kind: z8.literal("files"),
9920
- paths: z8.array(z8.string().min(1)).min(1, "files atom requires at least one path")
9960
+ filesAtomSchema = z9.object({
9961
+ kind: z9.literal("files"),
9962
+ paths: z9.array(z9.string().min(1)).min(1, "files atom requires at least one path")
9921
9963
  });
9922
- testRunAtomSchema = z8.object({
9923
- kind: z8.literal("test-run"),
9924
- path: z8.string().min(1, "test-run atom requires a non-empty path")
9964
+ testRunAtomSchema = z9.object({
9965
+ kind: z9.literal("test-run"),
9966
+ path: z9.string().min(1, "test-run atom requires a non-empty path")
9925
9967
  });
9926
- toolAtomSchema = z8.object({
9927
- kind: z8.literal("tool"),
9928
- tool: z8.string().min(1, "tool atom requires a non-empty tool name")
9968
+ toolAtomSchema = z9.object({
9969
+ kind: z9.literal("tool"),
9970
+ tool: z9.string().min(1, "tool atom requires a non-empty tool name")
9929
9971
  });
9930
- urlAtomSchema = z8.object({
9931
- kind: z8.literal("url"),
9932
- url: z8.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
9972
+ urlAtomSchema = z9.object({
9973
+ kind: z9.literal("url"),
9974
+ url: z9.string().min(1).regex(/^https?:\/\//, "url atom must start with http:// or https://")
9933
9975
  });
9934
- noteAtomSchema = z8.object({
9935
- kind: z8.literal("note"),
9936
- note: z8.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
9976
+ noteAtomSchema = z9.object({
9977
+ kind: z9.literal("note"),
9978
+ note: z9.string().min(1, "note atom must be non-empty").max(512, "note atom is too long (max 512 chars)")
9937
9979
  });
9938
- decisionAtomSchema = z8.object({
9939
- kind: z8.literal("decision"),
9940
- decisionId: z8.string().min(1, "decision atom requires a non-empty decision ID")
9980
+ decisionAtomSchema = z9.object({
9981
+ kind: z9.literal("decision"),
9982
+ decisionId: z9.string().min(1, "decision atom requires a non-empty decision ID")
9941
9983
  });
9942
- prAtomSchema = z8.object({
9943
- kind: z8.literal("pr"),
9944
- prNumber: z8.number().int().positive("pr atom requires a positive integer PR number")
9984
+ prAtomSchema = z9.object({
9985
+ kind: z9.literal("pr"),
9986
+ prNumber: z9.number().int().positive("pr atom requires a positive integer PR number")
9945
9987
  });
9946
- locDropAtomSchema = z8.object({
9947
- kind: z8.literal("loc-drop"),
9948
- fromLines: z8.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
9949
- toLines: z8.number().int().nonnegative("loc-drop toLines must be \u2265 0")
9988
+ locDropAtomSchema = z9.object({
9989
+ kind: z9.literal("loc-drop"),
9990
+ fromLines: z9.number().int().nonnegative("loc-drop fromLines must be \u2265 0"),
9991
+ toLines: z9.number().int().nonnegative("loc-drop toLines must be \u2265 0")
9950
9992
  });
9951
- callsiteCoverageAtomSchema = z8.object({
9952
- kind: z8.literal("callsite-coverage"),
9953
- symbolName: z8.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
9954
- relativeSourcePath: z8.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
9993
+ callsiteCoverageAtomSchema = z9.object({
9994
+ kind: z9.literal("callsite-coverage"),
9995
+ symbolName: z9.string().min(1, "callsite-coverage atom requires a non-empty symbolName"),
9996
+ relativeSourcePath: z9.string().min(1, "callsite-coverage atom requires a non-empty relativeSourcePath")
9955
9997
  });
9956
9998
  AC_UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[45][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
9957
9999
  AC_ALIAS_REGEX = /^AC[0-9]{1,4}$/;
9958
10000
  SATISFIES_TASK_ID_REGEX = /^T[0-9]{1,7}$/;
9959
10001
  SATISFIES_VERSION_PIN_REGEX = /^[0-9]{14}$/;
9960
- satisfiesAtomSchema = z8.object({
9961
- kind: z8.literal("satisfies"),
10002
+ satisfiesAtomSchema = z9.object({
10003
+ kind: z9.literal("satisfies"),
9962
10004
  /** Target task ID — `T<1-7 digits>` per ADR-079-r2 §2.1. */
9963
- targetTaskId: z8.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
10005
+ targetTaskId: z9.string().regex(SATISFIES_TASK_ID_REGEX, "satisfies atom targetTaskId must match /^T[0-9]{1,7}$/"),
9964
10006
  /** Lowercase UUIDv4/v5 — populated for the canonical form; undefined for alias form. */
9965
- targetAcId: z8.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
10007
+ targetAcId: z9.string().regex(AC_UUID_REGEX, "satisfies atom targetAcId must be a lowercase UUIDv4/v5").optional(),
9966
10008
  /** Positional alias `AC<1-4 digits>` — populated for alias form; undefined for UUID form. */
9967
- targetAcAlias: z8.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
10009
+ targetAcAlias: z9.string().regex(AC_ALIAS_REGEX, "satisfies atom targetAcAlias must match /^AC[0-9]{1,4}$/").optional(),
9968
10010
  /** Optional `@<14-digit YYYYMMDDhhmmss>` pin captured at mint time. */
9969
- versionPin: z8.string().regex(
10011
+ versionPin: z9.string().regex(
9970
10012
  SATISFIES_VERSION_PIN_REGEX,
9971
10013
  "satisfies atom versionPin must be 14 digits (YYYYMMDDhhmmss)"
9972
10014
  ).optional()
9973
10015
  });
9974
- EvidenceAtomSchema = z8.discriminatedUnion("kind", [
10016
+ EvidenceAtomSchema = z9.discriminatedUnion("kind", [
9975
10017
  commitAtomSchema,
9976
10018
  filesAtomSchema,
9977
10019
  testRunAtomSchema,
@@ -10018,58 +10060,58 @@ var init_evidence_atom_schema = __esm({
10018
10060
  });
10019
10061
 
10020
10062
  // packages/contracts/src/evidence-record-schema.ts
10021
- import { z as z9 } from "zod";
10063
+ import { z as z10 } from "zod";
10022
10064
  var evidenceBaseSchema, implDiffRecordSchema, validateSpecCheckRecordSchema, testOutputRecordSchema, lintReportRecordSchema, commandOutputRecordSchema, evidenceRecordSchema;
10023
10065
  var init_evidence_record_schema = __esm({
10024
10066
  "packages/contracts/src/evidence-record-schema.ts"() {
10025
10067
  "use strict";
10026
- evidenceBaseSchema = z9.object({
10068
+ evidenceBaseSchema = z10.object({
10027
10069
  /** Identity string of the agent that produced this record. */
10028
- agentIdentity: z9.string().min(1),
10070
+ agentIdentity: z10.string().min(1),
10029
10071
  /** SHA-256 hex digest (64 chars) of the attached artifact. */
10030
- attachmentSha256: z9.string().length(64),
10072
+ attachmentSha256: z10.string().length(64),
10031
10073
  /** ISO 8601 timestamp at which the action ran. */
10032
- ranAt: z9.string().datetime(),
10074
+ ranAt: z10.string().datetime(),
10033
10075
  /** Wall-clock duration of the action in milliseconds. */
10034
- durationMs: z9.number().nonnegative()
10076
+ durationMs: z10.number().nonnegative()
10035
10077
  });
10036
10078
  implDiffRecordSchema = evidenceBaseSchema.extend({
10037
- kind: z9.literal("impl-diff"),
10038
- phase: z9.literal("implement"),
10039
- filesChanged: z9.array(z9.string().min(1)).min(1),
10040
- linesAdded: z9.number().int().nonnegative(),
10041
- linesRemoved: z9.number().int().nonnegative()
10079
+ kind: z10.literal("impl-diff"),
10080
+ phase: z10.literal("implement"),
10081
+ filesChanged: z10.array(z10.string().min(1)).min(1),
10082
+ linesAdded: z10.number().int().nonnegative(),
10083
+ linesRemoved: z10.number().int().nonnegative()
10042
10084
  });
10043
10085
  validateSpecCheckRecordSchema = evidenceBaseSchema.extend({
10044
- kind: z9.literal("validate-spec-check"),
10045
- phase: z9.literal("validate"),
10046
- reqIdsChecked: z9.array(z9.string().min(1)).min(1),
10047
- passed: z9.boolean(),
10048
- details: z9.string().min(1)
10086
+ kind: z10.literal("validate-spec-check"),
10087
+ phase: z10.literal("validate"),
10088
+ reqIdsChecked: z10.array(z10.string().min(1)).min(1),
10089
+ passed: z10.boolean(),
10090
+ details: z10.string().min(1)
10049
10091
  });
10050
10092
  testOutputRecordSchema = evidenceBaseSchema.extend({
10051
- kind: z9.literal("test-output"),
10052
- phase: z9.literal("test"),
10053
- command: z9.string().min(1),
10054
- exitCode: z9.number().int(),
10055
- testsPassed: z9.number().int().nonnegative(),
10056
- testsFailed: z9.number().int().nonnegative()
10093
+ kind: z10.literal("test-output"),
10094
+ phase: z10.literal("test"),
10095
+ command: z10.string().min(1),
10096
+ exitCode: z10.number().int(),
10097
+ testsPassed: z10.number().int().nonnegative(),
10098
+ testsFailed: z10.number().int().nonnegative()
10057
10099
  });
10058
10100
  lintReportRecordSchema = evidenceBaseSchema.extend({
10059
- kind: z9.literal("lint-report"),
10060
- phase: z9.enum(["implement", "test"]),
10061
- tool: z9.string().min(1),
10062
- passed: z9.boolean(),
10063
- warnings: z9.number().int().nonnegative(),
10064
- errors: z9.number().int().nonnegative()
10101
+ kind: z10.literal("lint-report"),
10102
+ phase: z10.enum(["implement", "test"]),
10103
+ tool: z10.string().min(1),
10104
+ passed: z10.boolean(),
10105
+ warnings: z10.number().int().nonnegative(),
10106
+ errors: z10.number().int().nonnegative()
10065
10107
  });
10066
10108
  commandOutputRecordSchema = evidenceBaseSchema.extend({
10067
- kind: z9.literal("command-output"),
10068
- phase: z9.enum(["implement", "validate", "test"]),
10069
- cmd: z9.string().min(1),
10070
- exitCode: z9.number().int()
10109
+ kind: z10.literal("command-output"),
10110
+ phase: z10.enum(["implement", "validate", "test"]),
10111
+ cmd: z10.string().min(1),
10112
+ exitCode: z10.number().int()
10071
10113
  });
10072
- evidenceRecordSchema = z9.discriminatedUnion("kind", [
10114
+ evidenceRecordSchema = z10.discriminatedUnion("kind", [
10073
10115
  implDiffRecordSchema,
10074
10116
  validateSpecCheckRecordSchema,
10075
10117
  testOutputRecordSchema,
@@ -10727,7 +10769,7 @@ var init_status_registry = __esm({
10727
10769
  });
10728
10770
 
10729
10771
  // packages/contracts/src/workgraph.ts
10730
- import { z as z10 } from "zod";
10772
+ import { z as z11 } from "zod";
10731
10773
  var E_WORKGRAPH_PARENT_TYPE_MATRIX, taskTypeSchema, taskPrioritySchema, taskStatusSchema, verificationGateSchema, workGraphRelationKindSchema, workGraphTraversalDirectionSchema, workGraphEdgeDirectionSchema, paginationParamsSchema, workGraphNodeSchema, workGraphEdgeSchema, workGraphHierarchyEdgeSchema, workGraphPageInfoSchema, workGraphRollupCountsSchema, workGraphSubtreePercentagesSchema, workGraphProjectionMismatchSchema, workGraphReadyFrontierTaskSchema, workGraphRelationEdgeSchema, workGraphDependencyEdgeSchema, workGraphOmissionReasonSchema, workGraphContextBudgetSchema, workGraphOmissionSchema, workGraphDirectEdgeSchema, workGraphContextPackParamsSchema, workGraphSliceParamsSchema, workGraphSliceSchema, workGraphReadinessParamsSchema, workGraphReadinessResultSchema, workGraphContextPackSchema, workGraphScaffoldValidateParamsSchema, workGraphScaffoldValidationIssueSchema, workGraphScaffoldValidateResultSchema, workGraphScaffoldApplyParamsSchema, workGraphScaffoldApplyResultSchema, workGraphPlanningDocParamsSchema, workGraphPlanningDocSchema, tasksTraverseParamsSchema, tasksTraverseResultSchema, tasksTreeParamsSchema, tasksTreeResultSchema, tasksRollupParamsSchema, tasksRollupResultSchema, tasksFrontierParamsSchema, tasksFrontierResultSchema, tasksWorkGraphAuditParamsSchema, tasksWorkGraphAuditResultSchema;
10732
10774
  var init_workgraph = __esm({
10733
10775
  "packages/contracts/src/workgraph.ts"() {
@@ -10735,10 +10777,10 @@ var init_workgraph = __esm({
10735
10777
  init_enums();
10736
10778
  init_status_registry();
10737
10779
  E_WORKGRAPH_PARENT_TYPE_MATRIX = "E_WORKGRAPH_PARENT_TYPE_MATRIX";
10738
- taskTypeSchema = z10.enum(["saga", "epic", "task", "subtask"]);
10739
- taskPrioritySchema = z10.enum(["critical", "high", "medium", "low"]);
10740
- taskStatusSchema = z10.enum(TASK_STATUSES);
10741
- verificationGateSchema = z10.enum([
10780
+ taskTypeSchema = z11.enum(["saga", "epic", "task", "subtask"]);
10781
+ taskPrioritySchema = z11.enum(["critical", "high", "medium", "low"]);
10782
+ taskStatusSchema = z11.enum(TASK_STATUSES);
10783
+ verificationGateSchema = z11.enum([
10742
10784
  "implemented",
10743
10785
  "testsPassed",
10744
10786
  "qaPassed",
@@ -10747,7 +10789,7 @@ var init_workgraph = __esm({
10747
10789
  "documented",
10748
10790
  "nexusImpact"
10749
10791
  ]);
10750
- workGraphRelationKindSchema = z10.enum([
10792
+ workGraphRelationKindSchema = z11.enum([
10751
10793
  "contains",
10752
10794
  "depends_on",
10753
10795
  "blocks",
@@ -10755,317 +10797,317 @@ var init_workgraph = __esm({
10755
10797
  "groups",
10756
10798
  "satisfies"
10757
10799
  ]);
10758
- workGraphTraversalDirectionSchema = z10.enum([
10800
+ workGraphTraversalDirectionSchema = z11.enum([
10759
10801
  "ancestors",
10760
10802
  "descendants",
10761
10803
  "upstream",
10762
10804
  "downstream"
10763
10805
  ]);
10764
- workGraphEdgeDirectionSchema = z10.enum(["out", "in", "both"]);
10765
- paginationParamsSchema = z10.object({
10766
- cursor: z10.string().min(1).optional(),
10767
- limit: z10.number().int().positive().max(500).optional()
10806
+ workGraphEdgeDirectionSchema = z11.enum(["out", "in", "both"]);
10807
+ paginationParamsSchema = z11.object({
10808
+ cursor: z11.string().min(1).optional(),
10809
+ limit: z11.number().int().positive().max(500).optional()
10768
10810
  });
10769
- workGraphNodeSchema = z10.object({
10770
- id: z10.string().min(1),
10811
+ workGraphNodeSchema = z11.object({
10812
+ id: z11.string().min(1),
10771
10813
  type: taskTypeSchema,
10772
- title: z10.string(),
10814
+ title: z11.string(),
10773
10815
  status: taskStatusSchema,
10774
10816
  priority: taskPrioritySchema,
10775
- parentId: z10.string().min(1).optional()
10817
+ parentId: z11.string().min(1).optional()
10776
10818
  });
10777
- workGraphEdgeSchema = z10.object({
10778
- fromId: z10.string().min(1),
10779
- toId: z10.string().min(1),
10819
+ workGraphEdgeSchema = z11.object({
10820
+ fromId: z11.string().min(1),
10821
+ toId: z11.string().min(1),
10780
10822
  kind: workGraphRelationKindSchema
10781
10823
  });
10782
- workGraphHierarchyEdgeSchema = z10.object({
10783
- fromId: z10.string().min(1),
10784
- toId: z10.string().min(1),
10785
- kind: z10.literal("contains")
10824
+ workGraphHierarchyEdgeSchema = z11.object({
10825
+ fromId: z11.string().min(1),
10826
+ toId: z11.string().min(1),
10827
+ kind: z11.literal("contains")
10786
10828
  }).strict();
10787
- workGraphPageInfoSchema = z10.object({
10788
- nextCursor: z10.string().min(1).optional(),
10789
- hasMore: z10.boolean()
10829
+ workGraphPageInfoSchema = z11.object({
10830
+ nextCursor: z11.string().min(1).optional(),
10831
+ hasMore: z11.boolean()
10790
10832
  });
10791
- workGraphRollupCountsSchema = z10.object({
10792
- total: z10.number().int().nonnegative(),
10793
- byStatus: z10.partialRecord(taskStatusSchema, z10.number().int().nonnegative()),
10794
- byType: z10.partialRecord(taskTypeSchema, z10.number().int().nonnegative())
10833
+ workGraphRollupCountsSchema = z11.object({
10834
+ total: z11.number().int().nonnegative(),
10835
+ byStatus: z11.partialRecord(taskStatusSchema, z11.number().int().nonnegative()),
10836
+ byType: z11.partialRecord(taskTypeSchema, z11.number().int().nonnegative())
10795
10837
  });
10796
- workGraphSubtreePercentagesSchema = z10.object({
10797
- done: z10.number().nonnegative(),
10798
- active: z10.number().nonnegative(),
10799
- blocked: z10.number().nonnegative(),
10800
- pending: z10.number().nonnegative(),
10801
- cancelled: z10.number().nonnegative()
10838
+ workGraphSubtreePercentagesSchema = z11.object({
10839
+ done: z11.number().nonnegative(),
10840
+ active: z11.number().nonnegative(),
10841
+ blocked: z11.number().nonnegative(),
10842
+ pending: z11.number().nonnegative(),
10843
+ cancelled: z11.number().nonnegative()
10802
10844
  });
10803
- workGraphProjectionMismatchSchema = z10.object({
10804
- field: z10.string().min(1),
10805
- expected: z10.number().int().nonnegative(),
10806
- actual: z10.number().int().nonnegative()
10845
+ workGraphProjectionMismatchSchema = z11.object({
10846
+ field: z11.string().min(1),
10847
+ expected: z11.number().int().nonnegative(),
10848
+ actual: z11.number().int().nonnegative()
10807
10849
  });
10808
10850
  workGraphReadyFrontierTaskSchema = workGraphNodeSchema.extend({
10809
- role: z10.string().min(1).optional(),
10810
- dependencyBlockers: z10.array(z10.object({ taskId: z10.string().min(1), status: taskStatusSchema })),
10811
- gateBlockers: z10.array(z10.object({ gate: verificationGateSchema }))
10851
+ role: z11.string().min(1).optional(),
10852
+ dependencyBlockers: z11.array(z11.object({ taskId: z11.string().min(1), status: taskStatusSchema })),
10853
+ gateBlockers: z11.array(z11.object({ gate: verificationGateSchema }))
10812
10854
  });
10813
10855
  workGraphRelationEdgeSchema = workGraphEdgeSchema.extend({
10814
- source: z10.literal("relation"),
10815
- relationType: z10.enum(TASK_RELATION_TYPES),
10816
- reason: z10.string().min(1).optional()
10856
+ source: z11.literal("relation"),
10857
+ relationType: z11.enum(TASK_RELATION_TYPES),
10858
+ reason: z11.string().min(1).optional()
10817
10859
  });
10818
10860
  workGraphDependencyEdgeSchema = workGraphEdgeSchema.extend({
10819
- source: z10.literal("dependency"),
10820
- kind: z10.literal("depends_on")
10861
+ source: z11.literal("dependency"),
10862
+ kind: z11.literal("depends_on")
10821
10863
  });
10822
- workGraphOmissionReasonSchema = z10.enum([
10864
+ workGraphOmissionReasonSchema = z11.enum([
10823
10865
  "budget_exceeded",
10824
10866
  "not_requested",
10825
10867
  "not_available",
10826
10868
  "redacted",
10827
10869
  "truncated"
10828
10870
  ]);
10829
- workGraphContextBudgetSchema = z10.object({
10830
- tokenBudget: z10.number().int().nonnegative(),
10831
- estimatedTokens: z10.number().int().nonnegative(),
10832
- remainingTokens: z10.number().int().nonnegative(),
10833
- truncated: z10.boolean()
10871
+ workGraphContextBudgetSchema = z11.object({
10872
+ tokenBudget: z11.number().int().nonnegative(),
10873
+ estimatedTokens: z11.number().int().nonnegative(),
10874
+ remainingTokens: z11.number().int().nonnegative(),
10875
+ truncated: z11.boolean()
10834
10876
  });
10835
- workGraphOmissionSchema = z10.object({
10836
- path: z10.string().min(1),
10877
+ workGraphOmissionSchema = z11.object({
10878
+ path: z11.string().min(1),
10837
10879
  reason: workGraphOmissionReasonSchema,
10838
- message: z10.string().min(1),
10839
- estimatedTokens: z10.number().int().nonnegative().optional()
10880
+ message: z11.string().min(1),
10881
+ estimatedTokens: z11.number().int().nonnegative().optional()
10840
10882
  });
10841
- workGraphDirectEdgeSchema = z10.discriminatedUnion("source", [
10883
+ workGraphDirectEdgeSchema = z11.discriminatedUnion("source", [
10842
10884
  workGraphRelationEdgeSchema,
10843
10885
  workGraphDependencyEdgeSchema
10844
10886
  ]);
10845
10887
  workGraphContextPackParamsSchema = paginationParamsSchema.extend({
10846
- rootId: z10.string().min(1),
10847
- tokenBudget: z10.number().int().positive().optional(),
10848
- includeRelations: z10.boolean().optional(),
10849
- includeReadiness: z10.boolean().optional(),
10850
- includeRollup: z10.boolean().optional()
10888
+ rootId: z11.string().min(1),
10889
+ tokenBudget: z11.number().int().positive().optional(),
10890
+ includeRelations: z11.boolean().optional(),
10891
+ includeReadiness: z11.boolean().optional(),
10892
+ includeRollup: z11.boolean().optional()
10851
10893
  });
10852
10894
  workGraphSliceParamsSchema = paginationParamsSchema.extend({
10853
- rootId: z10.string().min(1),
10895
+ rootId: z11.string().min(1),
10854
10896
  direction: workGraphTraversalDirectionSchema.optional(),
10855
- maxDepth: z10.number().int().nonnegative().optional(),
10856
- includeRelations: z10.boolean().optional()
10897
+ maxDepth: z11.number().int().nonnegative().optional(),
10898
+ includeRelations: z11.boolean().optional()
10857
10899
  });
10858
- workGraphSliceSchema = z10.object({
10859
- rootId: z10.string().min(1),
10900
+ workGraphSliceSchema = z11.object({
10901
+ rootId: z11.string().min(1),
10860
10902
  direction: workGraphTraversalDirectionSchema,
10861
- nodes: z10.array(workGraphNodeSchema),
10862
- edges: z10.array(workGraphEdgeSchema),
10903
+ nodes: z11.array(workGraphNodeSchema),
10904
+ edges: z11.array(workGraphEdgeSchema),
10863
10905
  pageInfo: workGraphPageInfoSchema,
10864
- omissions: z10.array(workGraphOmissionSchema).optional()
10906
+ omissions: z11.array(workGraphOmissionSchema).optional()
10865
10907
  });
10866
- workGraphReadinessParamsSchema = z10.object({
10867
- rootId: z10.string().min(1),
10868
- role: z10.string().min(1).optional(),
10869
- includeGateBlockers: z10.boolean().optional()
10908
+ workGraphReadinessParamsSchema = z11.object({
10909
+ rootId: z11.string().min(1),
10910
+ role: z11.string().min(1).optional(),
10911
+ includeGateBlockers: z11.boolean().optional()
10870
10912
  });
10871
- workGraphReadinessResultSchema = z10.object({
10872
- rootId: z10.string().min(1),
10873
- role: z10.string().min(1).optional(),
10874
- ready: z10.boolean(),
10875
- warnings: z10.array(z10.string()),
10876
- groups: z10.object({
10877
- ready: z10.array(workGraphReadyFrontierTaskSchema),
10878
- blocked: z10.array(workGraphReadyFrontierTaskSchema),
10879
- blockedBy: z10.array(
10880
- z10.discriminatedUnion("kind", [
10881
- z10.object({
10882
- kind: z10.literal("dependency"),
10883
- blockerId: z10.string().min(1),
10884
- blocks: z10.array(z10.string().min(1))
10913
+ workGraphReadinessResultSchema = z11.object({
10914
+ rootId: z11.string().min(1),
10915
+ role: z11.string().min(1).optional(),
10916
+ ready: z11.boolean(),
10917
+ warnings: z11.array(z11.string()),
10918
+ groups: z11.object({
10919
+ ready: z11.array(workGraphReadyFrontierTaskSchema),
10920
+ blocked: z11.array(workGraphReadyFrontierTaskSchema),
10921
+ blockedBy: z11.array(
10922
+ z11.discriminatedUnion("kind", [
10923
+ z11.object({
10924
+ kind: z11.literal("dependency"),
10925
+ blockerId: z11.string().min(1),
10926
+ blocks: z11.array(z11.string().min(1))
10885
10927
  }),
10886
- z10.object({
10887
- kind: z10.literal("gate"),
10928
+ z11.object({
10929
+ kind: z11.literal("gate"),
10888
10930
  gate: verificationGateSchema,
10889
- blocks: z10.array(z10.string().min(1))
10931
+ blocks: z11.array(z11.string().min(1))
10890
10932
  })
10891
10933
  ])
10892
10934
  )
10893
10935
  })
10894
10936
  });
10895
- workGraphContextPackSchema = z10.object({
10896
- rootId: z10.string().min(1),
10897
- generatedAt: z10.string().min(1),
10937
+ workGraphContextPackSchema = z11.object({
10938
+ rootId: z11.string().min(1),
10939
+ generatedAt: z11.string().min(1),
10898
10940
  budget: workGraphContextBudgetSchema,
10899
10941
  slice: workGraphSliceSchema,
10900
- relationEdges: z10.object({
10901
- rootId: z10.string().min(1),
10942
+ relationEdges: z11.object({
10943
+ rootId: z11.string().min(1),
10902
10944
  direction: workGraphEdgeDirectionSchema,
10903
- edges: z10.array(workGraphDirectEdgeSchema)
10945
+ edges: z11.array(workGraphDirectEdgeSchema)
10904
10946
  }).optional(),
10905
10947
  readiness: workGraphReadinessResultSchema.optional(),
10906
- rollup: z10.lazy(() => tasksRollupResultSchema).optional(),
10907
- omissions: z10.array(workGraphOmissionSchema)
10948
+ rollup: z11.lazy(() => tasksRollupResultSchema).optional(),
10949
+ omissions: z11.array(workGraphOmissionSchema)
10908
10950
  });
10909
- workGraphScaffoldValidateParamsSchema = z10.object({
10910
- rootId: z10.string().min(1),
10911
- nodes: z10.array(
10912
- z10.object({
10913
- id: z10.string().min(1),
10951
+ workGraphScaffoldValidateParamsSchema = z11.object({
10952
+ rootId: z11.string().min(1),
10953
+ nodes: z11.array(
10954
+ z11.object({
10955
+ id: z11.string().min(1),
10914
10956
  type: taskTypeSchema,
10915
- parentId: z10.string().min(1).nullable().optional()
10957
+ parentId: z11.string().min(1).nullable().optional()
10916
10958
  })
10917
10959
  ),
10918
- edges: z10.array(workGraphDirectEdgeSchema).optional(),
10919
- dryRun: z10.boolean().optional()
10960
+ edges: z11.array(workGraphDirectEdgeSchema).optional(),
10961
+ dryRun: z11.boolean().optional()
10920
10962
  });
10921
- workGraphScaffoldValidationIssueSchema = z10.object({
10922
- code: z10.string().min(1),
10923
- message: z10.string().min(1),
10924
- taskId: z10.string().min(1).optional(),
10925
- severity: z10.enum(["error", "warning"])
10963
+ workGraphScaffoldValidationIssueSchema = z11.object({
10964
+ code: z11.string().min(1),
10965
+ message: z11.string().min(1),
10966
+ taskId: z11.string().min(1).optional(),
10967
+ severity: z11.enum(["error", "warning"])
10926
10968
  });
10927
- workGraphScaffoldValidateResultSchema = z10.object({
10928
- rootId: z10.string().min(1),
10929
- valid: z10.boolean(),
10930
- dryRun: z10.boolean(),
10931
- issues: z10.array(workGraphScaffoldValidationIssueSchema),
10932
- hierarchy: z10.object({
10933
- valid: z10.boolean(),
10934
- violations: z10.array(
10935
- z10.object({
10936
- code: z10.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
10937
- taskId: z10.string().min(1),
10969
+ workGraphScaffoldValidateResultSchema = z11.object({
10970
+ rootId: z11.string().min(1),
10971
+ valid: z11.boolean(),
10972
+ dryRun: z11.boolean(),
10973
+ issues: z11.array(workGraphScaffoldValidationIssueSchema),
10974
+ hierarchy: z11.object({
10975
+ valid: z11.boolean(),
10976
+ violations: z11.array(
10977
+ z11.object({
10978
+ code: z11.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
10979
+ taskId: z11.string().min(1),
10938
10980
  taskType: taskTypeSchema,
10939
- parentId: z10.string().min(1).nullable(),
10981
+ parentId: z11.string().min(1).nullable(),
10940
10982
  parentType: taskTypeSchema.optional(),
10941
- message: z10.string().min(1)
10983
+ message: z11.string().min(1)
10942
10984
  })
10943
10985
  )
10944
10986
  })
10945
10987
  });
10946
10988
  workGraphScaffoldApplyParamsSchema = workGraphScaffoldValidateParamsSchema.extend({
10947
- apply: z10.boolean().optional()
10989
+ apply: z11.boolean().optional()
10948
10990
  });
10949
10991
  workGraphScaffoldApplyResultSchema = workGraphScaffoldValidateResultSchema.extend({
10950
- applied: z10.boolean(),
10951
- nodesChanged: z10.number().int().nonnegative(),
10952
- edgesChanged: z10.number().int().nonnegative()
10992
+ applied: z11.boolean(),
10993
+ nodesChanged: z11.number().int().nonnegative(),
10994
+ edgesChanged: z11.number().int().nonnegative()
10953
10995
  });
10954
- workGraphPlanningDocParamsSchema = z10.object({
10955
- rootId: z10.string().min(1),
10956
- audience: z10.enum(["agent", "maintainer"]),
10957
- tokenBudget: z10.number().int().positive().optional(),
10958
- includeRelations: z10.boolean().optional(),
10959
- includeReadiness: z10.boolean().optional(),
10960
- includeRollup: z10.boolean().optional()
10996
+ workGraphPlanningDocParamsSchema = z11.object({
10997
+ rootId: z11.string().min(1),
10998
+ audience: z11.enum(["agent", "maintainer"]),
10999
+ tokenBudget: z11.number().int().positive().optional(),
11000
+ includeRelations: z11.boolean().optional(),
11001
+ includeReadiness: z11.boolean().optional(),
11002
+ includeRollup: z11.boolean().optional()
10961
11003
  });
10962
- workGraphPlanningDocSchema = z10.object({
10963
- rootId: z10.string().min(1),
10964
- generatedAt: z10.string().min(1),
10965
- audience: z10.enum(["agent", "maintainer"]),
10966
- title: z10.string().min(1),
10967
- content: z10.string(),
10968
- sections: z10.array(z10.string().min(1)),
10969
- estimatedTokens: z10.number().int().nonnegative(),
10970
- budget: z10.object({
10971
- tokenBudget: z10.number().int().positive(),
10972
- truncated: z10.boolean()
11004
+ workGraphPlanningDocSchema = z11.object({
11005
+ rootId: z11.string().min(1),
11006
+ generatedAt: z11.string().min(1),
11007
+ audience: z11.enum(["agent", "maintainer"]),
11008
+ title: z11.string().min(1),
11009
+ content: z11.string(),
11010
+ sections: z11.array(z11.string().min(1)),
11011
+ estimatedTokens: z11.number().int().nonnegative(),
11012
+ budget: z11.object({
11013
+ tokenBudget: z11.number().int().positive(),
11014
+ truncated: z11.boolean()
10973
11015
  }).optional()
10974
11016
  });
10975
11017
  tasksTraverseParamsSchema = paginationParamsSchema.extend({
10976
- rootId: z10.string().min(1),
11018
+ rootId: z11.string().min(1),
10977
11019
  direction: workGraphTraversalDirectionSchema,
10978
- maxDepth: z10.number().int().nonnegative().optional(),
10979
- includeRelations: z10.boolean().optional()
11020
+ maxDepth: z11.number().int().nonnegative().optional(),
11021
+ includeRelations: z11.boolean().optional()
10980
11022
  });
10981
- tasksTraverseResultSchema = z10.object({
10982
- rootId: z10.string().min(1),
11023
+ tasksTraverseResultSchema = z11.object({
11024
+ rootId: z11.string().min(1),
10983
11025
  direction: workGraphTraversalDirectionSchema,
10984
- nodes: z10.array(workGraphNodeSchema),
10985
- edges: z10.array(workGraphEdgeSchema),
11026
+ nodes: z11.array(workGraphNodeSchema),
11027
+ edges: z11.array(workGraphEdgeSchema),
10986
11028
  pageInfo: workGraphPageInfoSchema
10987
11029
  });
10988
11030
  tasksTreeParamsSchema = paginationParamsSchema.extend({
10989
- rootId: z10.string().min(1),
10990
- maxDepth: z10.number().int().nonnegative().optional()
11031
+ rootId: z11.string().min(1),
11032
+ maxDepth: z11.number().int().nonnegative().optional()
10991
11033
  });
10992
- tasksTreeResultSchema = z10.object({
10993
- rootId: z10.string().min(1),
10994
- nodes: z10.array(workGraphNodeSchema.extend({ depth: z10.number().int().positive() })),
10995
- edges: z10.array(workGraphHierarchyEdgeSchema),
11034
+ tasksTreeResultSchema = z11.object({
11035
+ rootId: z11.string().min(1),
11036
+ nodes: z11.array(workGraphNodeSchema.extend({ depth: z11.number().int().positive() })),
11037
+ edges: z11.array(workGraphHierarchyEdgeSchema),
10996
11038
  pageInfo: workGraphPageInfoSchema
10997
11039
  });
10998
- tasksRollupParamsSchema = z10.object({
10999
- rootId: z10.string().min(1),
11040
+ tasksRollupParamsSchema = z11.object({
11041
+ rootId: z11.string().min(1),
11000
11042
  expectedDirectRollup: workGraphRollupCountsSchema.optional()
11001
11043
  });
11002
- tasksRollupResultSchema = z10.object({
11003
- rootId: z10.string().min(1),
11044
+ tasksRollupResultSchema = z11.object({
11045
+ rootId: z11.string().min(1),
11004
11046
  direct: workGraphRollupCountsSchema,
11005
11047
  subtree: workGraphRollupCountsSchema,
11006
- percentDenominator: z10.object({
11007
- basis: z10.literal("subtree-total"),
11008
- total: z10.number().int().nonnegative(),
11009
- description: z10.string().min(1)
11048
+ percentDenominator: z11.object({
11049
+ basis: z11.literal("subtree-total"),
11050
+ total: z11.number().int().nonnegative(),
11051
+ description: z11.string().min(1)
11010
11052
  }),
11011
11053
  percentages: workGraphSubtreePercentagesSchema,
11012
- staleProjection: z10.boolean(),
11013
- projectionMismatches: z10.array(workGraphProjectionMismatchSchema)
11054
+ staleProjection: z11.boolean(),
11055
+ projectionMismatches: z11.array(workGraphProjectionMismatchSchema)
11014
11056
  });
11015
- tasksFrontierParamsSchema = z10.object({
11016
- rootId: z10.string().min(1),
11017
- role: z10.string().min(1).optional()
11057
+ tasksFrontierParamsSchema = z11.object({
11058
+ rootId: z11.string().min(1),
11059
+ role: z11.string().min(1).optional()
11018
11060
  });
11019
- tasksFrontierResultSchema = z10.object({
11020
- rootId: z10.string().min(1),
11021
- role: z10.string().min(1).optional(),
11022
- groups: z10.object({
11023
- ready: z10.array(workGraphReadyFrontierTaskSchema),
11024
- blocked: z10.array(workGraphReadyFrontierTaskSchema),
11025
- blockedBy: z10.array(
11026
- z10.discriminatedUnion("kind", [
11027
- z10.object({
11028
- kind: z10.literal("dependency"),
11029
- blockerId: z10.string().min(1),
11030
- blocks: z10.array(z10.string().min(1))
11061
+ tasksFrontierResultSchema = z11.object({
11062
+ rootId: z11.string().min(1),
11063
+ role: z11.string().min(1).optional(),
11064
+ groups: z11.object({
11065
+ ready: z11.array(workGraphReadyFrontierTaskSchema),
11066
+ blocked: z11.array(workGraphReadyFrontierTaskSchema),
11067
+ blockedBy: z11.array(
11068
+ z11.discriminatedUnion("kind", [
11069
+ z11.object({
11070
+ kind: z11.literal("dependency"),
11071
+ blockerId: z11.string().min(1),
11072
+ blocks: z11.array(z11.string().min(1))
11031
11073
  }),
11032
- z10.object({
11033
- kind: z10.literal("gate"),
11074
+ z11.object({
11075
+ kind: z11.literal("gate"),
11034
11076
  gate: verificationGateSchema,
11035
- blocks: z10.array(z10.string().min(1))
11077
+ blocks: z11.array(z11.string().min(1))
11036
11078
  })
11037
11079
  ])
11038
11080
  )
11039
11081
  })
11040
11082
  });
11041
11083
  tasksWorkGraphAuditParamsSchema = paginationParamsSchema.extend({
11042
- rootId: z10.string().min(1),
11043
- maxDepth: z10.number().int().nonnegative().optional(),
11044
- includeRelations: z10.boolean().optional()
11084
+ rootId: z11.string().min(1),
11085
+ maxDepth: z11.number().int().nonnegative().optional(),
11086
+ includeRelations: z11.boolean().optional()
11045
11087
  });
11046
- tasksWorkGraphAuditResultSchema = z10.object({
11047
- rootId: z10.string().min(1),
11048
- hierarchy: z10.object({
11049
- valid: z10.boolean(),
11050
- violations: z10.array(
11051
- z10.object({
11052
- code: z10.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
11053
- taskId: z10.string().min(1),
11088
+ tasksWorkGraphAuditResultSchema = z11.object({
11089
+ rootId: z11.string().min(1),
11090
+ hierarchy: z11.object({
11091
+ valid: z11.boolean(),
11092
+ violations: z11.array(
11093
+ z11.object({
11094
+ code: z11.literal(E_WORKGRAPH_PARENT_TYPE_MATRIX),
11095
+ taskId: z11.string().min(1),
11054
11096
  taskType: taskTypeSchema,
11055
- parentId: z10.string().min(1).nullable(),
11097
+ parentId: z11.string().min(1).nullable(),
11056
11098
  parentType: taskTypeSchema.optional(),
11057
- message: z10.string().min(1)
11099
+ message: z11.string().min(1)
11058
11100
  })
11059
11101
  )
11060
11102
  }),
11061
11103
  traversal: tasksTraverseResultSchema,
11062
11104
  frontier: tasksFrontierResultSchema,
11063
11105
  rollup: tasksRollupResultSchema,
11064
- relationEdges: z10.object({
11065
- rootId: z10.string().min(1),
11106
+ relationEdges: z11.object({
11107
+ rootId: z11.string().min(1),
11066
11108
  direction: workGraphEdgeDirectionSchema,
11067
- edges: z10.array(
11068
- z10.discriminatedUnion("source", [
11109
+ edges: z11.array(
11110
+ z11.discriminatedUnion("source", [
11069
11111
  workGraphRelationEdgeSchema,
11070
11112
  workGraphDependencyEdgeSchema
11071
11113
  ])
@@ -11420,31 +11462,31 @@ var init_peer = __esm({
11420
11462
  });
11421
11463
 
11422
11464
  // packages/contracts/src/release/evidence-atoms.ts
11423
- import { z as z11 } from "zod";
11465
+ import { z as z12 } from "zod";
11424
11466
  var parsedPrEvidenceAtomSchema, prEvidenceStateModifierSchema, ghPrViewSchema, PR_REQUIRED_WORKFLOWS;
11425
11467
  var init_evidence_atoms = __esm({
11426
11468
  "packages/contracts/src/release/evidence-atoms.ts"() {
11427
11469
  "use strict";
11428
- parsedPrEvidenceAtomSchema = z11.object({
11429
- kind: z11.literal("pr"),
11430
- prNumber: z11.number().int().positive()
11470
+ parsedPrEvidenceAtomSchema = z12.object({
11471
+ kind: z12.literal("pr"),
11472
+ prNumber: z12.number().int().positive()
11431
11473
  });
11432
- prEvidenceStateModifierSchema = z11.object({
11433
- kind: z11.literal("state"),
11434
- value: z11.literal("MERGED")
11474
+ prEvidenceStateModifierSchema = z12.object({
11475
+ kind: z12.literal("state"),
11476
+ value: z12.literal("MERGED")
11435
11477
  });
11436
- ghPrViewSchema = z11.object({
11437
- state: z11.enum(["OPEN", "CLOSED", "MERGED"]),
11438
- mergedAt: z11.string().nullable(),
11439
- headRefOid: z11.string().optional(),
11440
- mergeable: z11.string().optional(),
11441
- statusCheckRollup: z11.array(
11442
- z11.object({
11443
- __typename: z11.string().optional(),
11444
- name: z11.string().optional(),
11445
- workflowName: z11.string().optional(),
11446
- conclusion: z11.string().nullable().optional(),
11447
- status: z11.string().optional()
11478
+ ghPrViewSchema = z12.object({
11479
+ state: z12.enum(["OPEN", "CLOSED", "MERGED"]),
11480
+ mergedAt: z12.string().nullable(),
11481
+ headRefOid: z12.string().optional(),
11482
+ mergeable: z12.string().optional(),
11483
+ statusCheckRollup: z12.array(
11484
+ z12.object({
11485
+ __typename: z12.string().optional(),
11486
+ name: z12.string().optional(),
11487
+ workflowName: z12.string().optional(),
11488
+ conclusion: z12.string().nullable().optional(),
11489
+ status: z12.string().optional()
11448
11490
  }).passthrough()
11449
11491
  ).optional().default([])
11450
11492
  }).passthrough();
@@ -11457,7 +11499,7 @@ var init_evidence_atoms = __esm({
11457
11499
  });
11458
11500
 
11459
11501
  // packages/contracts/src/release/plan.ts
11460
- import { z as z12 } from "zod";
11502
+ import { z as z13 } from "zod";
11461
11503
  var RELEASE_CHANNEL, RELEASE_SCHEME, RELEASE_KIND, RELEASE_STATUS, GATE_STATUS, GATE_NAME, PLATFORM_TUPLE, PUBLISHER, TASK_KIND, IMPACT, RESOLVED_SOURCE, ReleaseChannelSchema, ReleaseSchemeSchema, ReleaseKindSchema, ReleaseStatusSchema, GateStatusSchema, GateNameSchema, PlatformTupleSchema, PublisherSchema, TaskKindSchema, ImpactSchema, ResolvedSourceSchema, Iso8601, NonEmptyString, ReleasePlanTaskSchema, ReleaseGateSchema, ReleasePlatformMatrixEntrySchema, ReleasePreflightSummarySchema, ReleasePlanChangelogSchema, ReleasePlanMetaSchema, ReleasePlanSchema;
11462
11504
  var init_plan = __esm({
11463
11505
  "packages/contracts/src/release/plan.ts"() {
@@ -11500,20 +11542,20 @@ var init_plan = __esm({
11500
11542
  ];
11501
11543
  IMPACT = ["major", "minor", "patch"];
11502
11544
  RESOLVED_SOURCE = ["project-context", "language-default", "legacy-alias"];
11503
- ReleaseChannelSchema = z12.enum(RELEASE_CHANNEL);
11504
- ReleaseSchemeSchema = z12.enum(RELEASE_SCHEME);
11505
- ReleaseKindSchema = z12.enum(RELEASE_KIND);
11506
- ReleaseStatusSchema = z12.enum(RELEASE_STATUS);
11507
- GateStatusSchema = z12.enum(GATE_STATUS);
11508
- GateNameSchema = z12.enum(GATE_NAME);
11509
- PlatformTupleSchema = z12.enum(PLATFORM_TUPLE);
11510
- PublisherSchema = z12.enum(PUBLISHER);
11511
- TaskKindSchema = z12.enum(TASK_KIND);
11512
- ImpactSchema = z12.enum(IMPACT);
11513
- ResolvedSourceSchema = z12.enum(RESOLVED_SOURCE);
11514
- Iso8601 = z12.iso.datetime({ offset: true });
11515
- NonEmptyString = z12.string().min(1);
11516
- ReleasePlanTaskSchema = z12.object({
11545
+ ReleaseChannelSchema = z13.enum(RELEASE_CHANNEL);
11546
+ ReleaseSchemeSchema = z13.enum(RELEASE_SCHEME);
11547
+ ReleaseKindSchema = z13.enum(RELEASE_KIND);
11548
+ ReleaseStatusSchema = z13.enum(RELEASE_STATUS);
11549
+ GateStatusSchema = z13.enum(GATE_STATUS);
11550
+ GateNameSchema = z13.enum(GATE_NAME);
11551
+ PlatformTupleSchema = z13.enum(PLATFORM_TUPLE);
11552
+ PublisherSchema = z13.enum(PUBLISHER);
11553
+ TaskKindSchema = z13.enum(TASK_KIND);
11554
+ ImpactSchema = z13.enum(IMPACT);
11555
+ ResolvedSourceSchema = z13.enum(RESOLVED_SOURCE);
11556
+ Iso8601 = z13.iso.datetime({ offset: true });
11557
+ NonEmptyString = z13.string().min(1);
11558
+ ReleasePlanTaskSchema = z13.object({
11517
11559
  /** Task ID (e.g. "T10001"). Format intentionally loose so historical IDs validate. */
11518
11560
  id: NonEmptyString,
11519
11561
  /** Conventional-commit-aligned task classification. */
@@ -11521,20 +11563,20 @@ var init_plan = __esm({
11521
11563
  /** SemVer impact classification. */
11522
11564
  impact: ImpactSchema,
11523
11565
  /** Human-readable changelog line for this task. */
11524
- userFacingSummary: z12.string(),
11566
+ userFacingSummary: z13.string(),
11525
11567
  /**
11526
11568
  * ADR-051 evidence atoms attesting the task's gate results. Format is
11527
11569
  * `kind:value` (e.g. `commit:abc123`, `test-run:vitest.json`). The contract
11528
11570
  * accepts empty arrays so legacy plans validate; `cleo release plan`
11529
11571
  * enforces non-empty via R-301.
11530
11572
  */
11531
- evidenceAtoms: z12.array(NonEmptyString),
11573
+ evidenceAtoms: z13.array(NonEmptyString),
11532
11574
  /** IVTR phase at plan time — informational only per R-316. */
11533
- ivtrPhaseAtPlan: z12.string().optional(),
11575
+ ivtrPhaseAtPlan: z13.string().optional(),
11534
11576
  /** Epic this task rolls up to, locked at plan time per R-303. */
11535
11577
  epicAncestor: NonEmptyString
11536
11578
  });
11537
- ReleaseGateSchema = z12.object({
11579
+ ReleaseGateSchema = z13.object({
11538
11580
  /** Canonical gate name. */
11539
11581
  name: GateNameSchema,
11540
11582
  /** ADR-051 atom string identifying the resolved tool (e.g. `tool:test`). */
@@ -11544,11 +11586,11 @@ var init_plan = __esm({
11544
11586
  /** ISO-8601 timestamp the gate was last verified. */
11545
11587
  lastVerifiedAt: Iso8601,
11546
11588
  /** Resolved shell command (e.g. `pnpm run test`). Optional for unresolved gates. */
11547
- resolvedCommand: z12.string().optional(),
11589
+ resolvedCommand: z13.string().optional(),
11548
11590
  /** Provenance of the resolved command. Optional for unresolved gates. */
11549
11591
  resolvedSource: ResolvedSourceSchema.optional()
11550
11592
  });
11551
- ReleasePlatformMatrixEntrySchema = z12.object({
11593
+ ReleasePlatformMatrixEntrySchema = z13.object({
11552
11594
  /** Target platform tuple. */
11553
11595
  platform: PlatformTupleSchema,
11554
11596
  /** Distribution backend. */
@@ -11556,47 +11598,47 @@ var init_plan = __esm({
11556
11598
  /** Package identifier on the target backend (e.g. `@cleocode/cleo`). */
11557
11599
  package: NonEmptyString,
11558
11600
  /** Whether to run the GHA smoke job for this matrix entry. */
11559
- smoke: z12.boolean().default(true).optional()
11601
+ smoke: z13.boolean().default(true).optional()
11560
11602
  });
11561
- ReleasePreflightSummarySchema = z12.object({
11603
+ ReleasePreflightSummarySchema = z13.object({
11562
11604
  /** True if esbuild externals are out of sync with package.json. */
11563
- esbuildExternalsDrift: z12.boolean(),
11605
+ esbuildExternalsDrift: z13.boolean(),
11564
11606
  /** True if `pnpm-lock.yaml` diverges from the workspace manifest. */
11565
- lockfileDrift: z12.boolean(),
11607
+ lockfileDrift: z13.boolean(),
11566
11608
  /** True if all epic children are in terminal lifecycle states. */
11567
- epicCompletenessClean: z12.boolean(),
11609
+ epicCompletenessClean: z13.boolean(),
11568
11610
  /** True if no task appears in multiple in-flight release plans. */
11569
- doubleListingClean: z12.boolean(),
11611
+ doubleListingClean: z13.boolean(),
11570
11612
  /** Non-fatal preflight warnings (e.g. unresolved tools per R-024). */
11571
- preflightWarnings: z12.array(z12.string()).default([]).optional()
11613
+ preflightWarnings: z13.array(z13.string()).default([]).optional()
11572
11614
  });
11573
- ReleasePlanChangelogSchema = z12.object({
11615
+ ReleasePlanChangelogSchema = z13.object({
11574
11616
  /** `kind=feat` tasks. */
11575
- features: z12.array(NonEmptyString).default([]),
11617
+ features: z13.array(NonEmptyString).default([]),
11576
11618
  /** `kind=fix` or `kind=hotfix` tasks. */
11577
- fixes: z12.array(NonEmptyString).default([]),
11619
+ fixes: z13.array(NonEmptyString).default([]),
11578
11620
  /** `kind=chore`, `docs`, `refactor`, `test`, `perf` tasks. */
11579
- chores: z12.array(NonEmptyString).default([]),
11621
+ chores: z13.array(NonEmptyString).default([]),
11580
11622
  /** `kind=breaking` or `kind=revert` tasks. */
11581
- breaking: z12.array(NonEmptyString).default([])
11623
+ breaking: z13.array(NonEmptyString).default([])
11582
11624
  });
11583
- ReleasePlanMetaSchema = z12.object({
11625
+ ReleasePlanMetaSchema = z13.object({
11584
11626
  /** True if this is the project's first ever release. */
11585
- firstEverRelease: z12.boolean().optional(),
11627
+ firstEverRelease: z13.boolean().optional(),
11586
11628
  /** Canonical tool names that could not be resolved at plan time. */
11587
- unresolvedTools: z12.array(z12.string()).optional(),
11629
+ unresolvedTools: z13.array(z13.string()).optional(),
11588
11630
  /** Project archetype detected at plan time. */
11589
- archetype: z12.string().optional()
11590
- }).catchall(z12.unknown());
11591
- ReleasePlanSchema = z12.object({
11631
+ archetype: z13.string().optional()
11632
+ }).catchall(z13.unknown());
11633
+ ReleasePlanSchema = z13.object({
11592
11634
  /** Schema URL for this plan version. */
11593
- $schema: z12.string().optional(),
11635
+ $schema: z13.string().optional(),
11594
11636
  /** Requested version string (e.g. "v2026.6.0"). Includes the leading `v`. */
11595
11637
  version: NonEmptyString,
11596
11638
  /** Resolved version string after suffix application (e.g. "v2026.6.0.2"). */
11597
11639
  resolvedVersion: NonEmptyString,
11598
11640
  /** True if a `calver-suffix` was applied to disambiguate a same-day hotfix. */
11599
- suffixApplied: z12.boolean(),
11641
+ suffixApplied: z13.boolean(),
11600
11642
  /** Versioning scheme governing `version` / `resolvedVersion`. */
11601
11643
  scheme: ReleaseSchemeSchema,
11602
11644
  /** npm dist-tag channel for this release. */
@@ -11613,27 +11655,27 @@ var init_plan = __esm({
11613
11655
  * Version of the previous release on the same channel. MUST be `null` only
11614
11656
  * for first-ever releases (R-300, enforced at the verb layer).
11615
11657
  */
11616
- previousVersion: z12.string().nullable(),
11658
+ previousVersion: z13.string().nullable(),
11617
11659
  /** Git tag of the previous release (typically `previousVersion` prefixed). */
11618
- previousTag: z12.string().nullable(),
11660
+ previousTag: z13.string().nullable(),
11619
11661
  /** ISO-8601 timestamp the previous release was published. */
11620
11662
  previousShippedAt: Iso8601.nullable(),
11621
11663
  /** Tasks rolled into this release. */
11622
- tasks: z12.array(ReleasePlanTaskSchema),
11664
+ tasks: z13.array(ReleasePlanTaskSchema),
11623
11665
  /** Bucketed changelog. */
11624
11666
  changelog: ReleasePlanChangelogSchema,
11625
11667
  /** Per-gate verification status. */
11626
- gates: z12.array(ReleaseGateSchema),
11668
+ gates: z13.array(ReleaseGateSchema),
11627
11669
  /** Platform / publisher matrix. */
11628
- platformMatrix: z12.array(ReleasePlatformMatrixEntrySchema),
11670
+ platformMatrix: z13.array(ReleasePlatformMatrixEntrySchema),
11629
11671
  /** Preflight summary from `cleo release plan`. */
11630
11672
  preflightSummary: ReleasePreflightSummarySchema,
11631
11673
  /** URL of the GHA workflow run (populated by `release-prepare.yml`). */
11632
- workflowRunUrl: z12.string().nullable(),
11674
+ workflowRunUrl: z13.string().nullable(),
11633
11675
  /** URL of the bump PR (populated by `cleo release open`). */
11634
- prUrl: z12.string().nullable(),
11676
+ prUrl: z13.string().nullable(),
11635
11677
  /** Merge commit SHA on `main` (populated by `release-publish.yml`). */
11636
- mergeCommitSha: z12.string().nullable(),
11678
+ mergeCommitSha: z13.string().nullable(),
11637
11679
  /** Current FSM state per R-302. */
11638
11680
  status: ReleaseStatusSchema,
11639
11681
  /** Informational / forward-compat metadata. */
@@ -11689,52 +11731,52 @@ var init_session2 = __esm({
11689
11731
  });
11690
11732
 
11691
11733
  // packages/contracts/src/session-journal.ts
11692
- import { z as z13 } from "zod";
11734
+ import { z as z14 } from "zod";
11693
11735
  var SESSION_JOURNAL_SCHEMA_VERSION, sessionJournalDoctorSummarySchema, sessionJournalDebriefSummarySchema, sessionJournalEntrySchema;
11694
11736
  var init_session_journal = __esm({
11695
11737
  "packages/contracts/src/session-journal.ts"() {
11696
11738
  "use strict";
11697
11739
  SESSION_JOURNAL_SCHEMA_VERSION = "1.0";
11698
- sessionJournalDoctorSummarySchema = z13.object({
11740
+ sessionJournalDoctorSummarySchema = z14.object({
11699
11741
  /** `true` when zero noise patterns were detected. */
11700
- isClean: z13.boolean(),
11742
+ isClean: z14.boolean(),
11701
11743
  /** Total number of noise findings across all patterns. */
11702
- findingsCount: z13.number().int().nonnegative(),
11744
+ findingsCount: z14.number().int().nonnegative(),
11703
11745
  /** Pattern names that were detected (empty when isClean). */
11704
- patterns: z13.array(z13.string()),
11746
+ patterns: z14.array(z14.string()),
11705
11747
  /** Total brain entries scanned. `0` = empty or unavailable. */
11706
- totalScanned: z13.number().int().nonnegative()
11748
+ totalScanned: z14.number().int().nonnegative()
11707
11749
  });
11708
- sessionJournalDebriefSummarySchema = z13.object({
11750
+ sessionJournalDebriefSummarySchema = z14.object({
11709
11751
  /** First 200 characters of the session end note (if provided). */
11710
- noteExcerpt: z13.string().max(200).optional(),
11752
+ noteExcerpt: z14.string().max(200).optional(),
11711
11753
  /** Number of tasks completed during the session. */
11712
- tasksCompletedCount: z13.number().int().nonnegative(),
11754
+ tasksCompletedCount: z14.number().int().nonnegative(),
11713
11755
  /** Up to 5 task IDs (not titles) that were the focus of the session. */
11714
- tasksFocused: z13.array(z13.string()).max(5).optional()
11756
+ tasksFocused: z14.array(z14.string()).max(5).optional()
11715
11757
  });
11716
- sessionJournalEntrySchema = z13.object({
11758
+ sessionJournalEntrySchema = z14.object({
11717
11759
  // Identity
11718
11760
  /** Schema version for forward-compatibility. Always `'1.0'` in this release. */
11719
- schemaVersion: z13.literal(SESSION_JOURNAL_SCHEMA_VERSION),
11761
+ schemaVersion: z14.literal(SESSION_JOURNAL_SCHEMA_VERSION),
11720
11762
  /** ISO 8601 timestamp when the entry was written. */
11721
- timestamp: z13.string(),
11763
+ timestamp: z14.string(),
11722
11764
  /** CLEO session ID (e.g. `ses_20260424055456_ede571`). */
11723
- sessionId: z13.string(),
11765
+ sessionId: z14.string(),
11724
11766
  /** Event type that triggered this journal entry. */
11725
- eventType: z13.enum(["session_start", "session_end", "observation", "decision", "error"]),
11767
+ eventType: z14.enum(["session_start", "session_end", "observation", "decision", "error"]),
11726
11768
  // Session metadata (set on session_start / session_end)
11727
11769
  /** Agent identifier (e.g. `cleo-prime`, `claude-code`). */
11728
- agentIdentifier: z13.string().optional(),
11770
+ agentIdentifier: z14.string().optional(),
11729
11771
  /** Provider adapter ID active for this session. */
11730
- providerId: z13.string().optional(),
11772
+ providerId: z14.string().optional(),
11731
11773
  /** Session scope string (e.g. `'global'` or `'epic:T1263'`). */
11732
- scope: z13.string().optional(),
11774
+ scope: z14.string().optional(),
11733
11775
  // Session-end fields
11734
11776
  /** Duration of the session in seconds (session_end only). */
11735
- duration: z13.number().int().nonnegative().optional(),
11777
+ duration: z14.number().int().nonnegative().optional(),
11736
11778
  /** Task IDs (not titles) completed during the session. */
11737
- tasksCompleted: z13.array(z13.string()).optional(),
11779
+ tasksCompleted: z14.array(z14.string()).optional(),
11738
11780
  // Doctor summary (T1262 absorbed)
11739
11781
  /** Compact result of `scanBrainNoise` run at session-end. */
11740
11782
  doctorSummary: sessionJournalDoctorSummarySchema.optional(),
@@ -11743,7 +11785,7 @@ var init_session_journal = __esm({
11743
11785
  debriefSummary: sessionJournalDebriefSummarySchema.optional(),
11744
11786
  // Optional hash chain
11745
11787
  /** SHA-256 hex of the previous entry's raw JSON string (for integrity chain). */
11746
- prevEntryHash: z13.string().optional()
11788
+ prevEntryHash: z14.string().optional()
11747
11789
  });
11748
11790
  }
11749
11791
  });
@@ -11756,52 +11798,52 @@ var init_task = __esm({
11756
11798
  });
11757
11799
 
11758
11800
  // packages/contracts/src/task-evidence.ts
11759
- import { z as z14 } from "zod";
11801
+ import { z as z15 } from "zod";
11760
11802
  var fileEvidenceSchema, logEvidenceSchema, screenshotEvidenceSchema, testOutputEvidenceSchema, commandOutputEvidenceSchema, taskEvidenceSchema;
11761
11803
  var init_task_evidence = __esm({
11762
11804
  "packages/contracts/src/task-evidence.ts"() {
11763
11805
  "use strict";
11764
- fileEvidenceSchema = z14.object({
11765
- kind: z14.literal("file"),
11766
- sha256: z14.string().length(64),
11767
- timestamp: z14.string().datetime(),
11768
- path: z14.string().min(1),
11769
- mime: z14.string().optional(),
11770
- description: z14.string().optional()
11806
+ fileEvidenceSchema = z15.object({
11807
+ kind: z15.literal("file"),
11808
+ sha256: z15.string().length(64),
11809
+ timestamp: z15.string().datetime(),
11810
+ path: z15.string().min(1),
11811
+ mime: z15.string().optional(),
11812
+ description: z15.string().optional()
11771
11813
  });
11772
- logEvidenceSchema = z14.object({
11773
- kind: z14.literal("log"),
11774
- sha256: z14.string().length(64),
11775
- timestamp: z14.string().datetime(),
11776
- source: z14.string().min(1),
11777
- description: z14.string().optional()
11814
+ logEvidenceSchema = z15.object({
11815
+ kind: z15.literal("log"),
11816
+ sha256: z15.string().length(64),
11817
+ timestamp: z15.string().datetime(),
11818
+ source: z15.string().min(1),
11819
+ description: z15.string().optional()
11778
11820
  });
11779
- screenshotEvidenceSchema = z14.object({
11780
- kind: z14.literal("screenshot"),
11781
- sha256: z14.string().length(64),
11782
- timestamp: z14.string().datetime(),
11783
- mime: z14.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
11784
- description: z14.string().optional()
11821
+ screenshotEvidenceSchema = z15.object({
11822
+ kind: z15.literal("screenshot"),
11823
+ sha256: z15.string().length(64),
11824
+ timestamp: z15.string().datetime(),
11825
+ mime: z15.enum(["image/png", "image/jpeg", "image/webp"]).optional(),
11826
+ description: z15.string().optional()
11785
11827
  });
11786
- testOutputEvidenceSchema = z14.object({
11787
- kind: z14.literal("test-output"),
11788
- sha256: z14.string().length(64),
11789
- timestamp: z14.string().datetime(),
11790
- passed: z14.number().int().nonnegative(),
11791
- failed: z14.number().int().nonnegative(),
11792
- skipped: z14.number().int().nonnegative(),
11793
- exitCode: z14.number().int(),
11794
- description: z14.string().optional()
11828
+ testOutputEvidenceSchema = z15.object({
11829
+ kind: z15.literal("test-output"),
11830
+ sha256: z15.string().length(64),
11831
+ timestamp: z15.string().datetime(),
11832
+ passed: z15.number().int().nonnegative(),
11833
+ failed: z15.number().int().nonnegative(),
11834
+ skipped: z15.number().int().nonnegative(),
11835
+ exitCode: z15.number().int(),
11836
+ description: z15.string().optional()
11795
11837
  });
11796
- commandOutputEvidenceSchema = z14.object({
11797
- kind: z14.literal("command-output"),
11798
- sha256: z14.string().length(64),
11799
- timestamp: z14.string().datetime(),
11800
- cmd: z14.string().min(1),
11801
- exitCode: z14.number().int(),
11802
- description: z14.string().optional()
11838
+ commandOutputEvidenceSchema = z15.object({
11839
+ kind: z15.literal("command-output"),
11840
+ sha256: z15.string().length(64),
11841
+ timestamp: z15.string().datetime(),
11842
+ cmd: z15.string().min(1),
11843
+ exitCode: z15.number().int(),
11844
+ description: z15.string().optional()
11803
11845
  });
11804
- taskEvidenceSchema = z14.discriminatedUnion("kind", [
11846
+ taskEvidenceSchema = z15.discriminatedUnion("kind", [
11805
11847
  fileEvidenceSchema,
11806
11848
  logEvidenceSchema,
11807
11849
  screenshotEvidenceSchema,
@@ -11812,12 +11854,12 @@ var init_task_evidence = __esm({
11812
11854
  });
11813
11855
 
11814
11856
  // packages/contracts/src/tasks/archive.ts
11815
- import { z as z15 } from "zod";
11857
+ import { z as z16 } from "zod";
11816
11858
  var ArchiveReason, ARCHIVE_REASON_VALUES;
11817
11859
  var init_archive = __esm({
11818
11860
  "packages/contracts/src/tasks/archive.ts"() {
11819
11861
  "use strict";
11820
- ArchiveReason = z15.enum([
11862
+ ArchiveReason = z16.enum([
11821
11863
  "verified",
11822
11864
  "reconciled",
11823
11865
  "superseded",
@@ -11830,47 +11872,47 @@ var init_archive = __esm({
11830
11872
  });
11831
11873
 
11832
11874
  // packages/contracts/src/tasks.ts
11833
- import { z as z16 } from "zod";
11875
+ import { z as z17 } from "zod";
11834
11876
  var taskMutationWarningSeveritySchema, taskMutationWarningSchema, taskMutationDryRunSummarySchema, taskMutationTaskRecordSchema, taskMutationEnvelopeSchema, completionTaskStatusSchema, completionCriterionKindSchema, completionCriterionStatusSchema, completionBlockerReasonSchema, completionStaleReasonSchema, completionProjectionRepairErrorCodeSchema, completionCriterionWaiverSchema, completionCriterionReplacementSchema, completionCriterionEvaluationSchema, unsatisfiedCompletionCriterionSchema, completionTotalsSchema, completionContextPackSchema, completionEvaluationSchema, completionExplanationSchema, completionListParamsSchema, completionListResultSchema, completionEvaluateParamsSchema, completionProjectionRepairErrorSchema, completionProjectionRepairParamsSchema, completionProjectionRepairResultSchema;
11835
11877
  var init_tasks2 = __esm({
11836
11878
  "packages/contracts/src/tasks.ts"() {
11837
11879
  "use strict";
11838
11880
  init_status_registry();
11839
- taskMutationWarningSeveritySchema = z16.enum(["info", "warning"]);
11840
- taskMutationWarningSchema = z16.object({
11841
- code: z16.string().min(1),
11842
- message: z16.string().min(1),
11881
+ taskMutationWarningSeveritySchema = z17.enum(["info", "warning"]);
11882
+ taskMutationWarningSchema = z17.object({
11883
+ code: z17.string().min(1),
11884
+ message: z17.string().min(1),
11843
11885
  severity: taskMutationWarningSeveritySchema.optional(),
11844
- taskId: z16.string().min(1).optional(),
11845
- field: z16.string().min(1).optional(),
11846
- index: z16.number().int().nonnegative().optional()
11886
+ taskId: z17.string().min(1).optional(),
11887
+ field: z17.string().min(1).optional(),
11888
+ index: z17.number().int().nonnegative().optional()
11847
11889
  });
11848
- taskMutationDryRunSummarySchema = z16.object({
11849
- dryRun: z16.literal(true),
11850
- wouldCreate: z16.number().int().nonnegative(),
11851
- wouldUpdate: z16.number().int().nonnegative(),
11852
- wouldDelete: z16.number().int().nonnegative(),
11853
- wouldAffect: z16.number().int().nonnegative(),
11854
- validatedCount: z16.number().int().nonnegative(),
11855
- insertedCount: z16.literal(0),
11856
- updatedCount: z16.literal(0),
11857
- deletedCount: z16.literal(0),
11858
- warnings: z16.array(taskMutationWarningSchema)
11890
+ taskMutationDryRunSummarySchema = z17.object({
11891
+ dryRun: z17.literal(true),
11892
+ wouldCreate: z17.number().int().nonnegative(),
11893
+ wouldUpdate: z17.number().int().nonnegative(),
11894
+ wouldDelete: z17.number().int().nonnegative(),
11895
+ wouldAffect: z17.number().int().nonnegative(),
11896
+ validatedCount: z17.number().int().nonnegative(),
11897
+ insertedCount: z17.literal(0),
11898
+ updatedCount: z17.literal(0),
11899
+ deletedCount: z17.literal(0),
11900
+ warnings: z17.array(taskMutationWarningSchema)
11859
11901
  });
11860
- taskMutationTaskRecordSchema = z16.object({ id: z16.string().min(1) }).passthrough();
11861
- taskMutationEnvelopeSchema = z16.object({
11862
- dryRun: z16.boolean().optional(),
11863
- created: z16.array(taskMutationTaskRecordSchema),
11864
- updated: z16.array(taskMutationTaskRecordSchema),
11865
- deleted: z16.array(taskMutationTaskRecordSchema),
11866
- affectedCount: z16.number().int().nonnegative(),
11867
- mutationWarnings: z16.array(taskMutationWarningSchema),
11902
+ taskMutationTaskRecordSchema = z17.object({ id: z17.string().min(1) }).passthrough();
11903
+ taskMutationEnvelopeSchema = z17.object({
11904
+ dryRun: z17.boolean().optional(),
11905
+ created: z17.array(taskMutationTaskRecordSchema),
11906
+ updated: z17.array(taskMutationTaskRecordSchema),
11907
+ deleted: z17.array(taskMutationTaskRecordSchema),
11908
+ affectedCount: z17.number().int().nonnegative(),
11909
+ mutationWarnings: z17.array(taskMutationWarningSchema),
11868
11910
  dryRunSummary: taskMutationDryRunSummarySchema.optional()
11869
11911
  });
11870
- completionTaskStatusSchema = z16.enum(TASK_STATUSES);
11871
- completionCriterionKindSchema = z16.enum(["text", "evidence_bound", "child_task"]);
11872
- completionCriterionStatusSchema = z16.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
11873
- completionBlockerReasonSchema = z16.enum([
11912
+ completionTaskStatusSchema = z17.enum(TASK_STATUSES);
11913
+ completionCriterionKindSchema = z17.enum(["text", "evidence_bound", "child_task"]);
11914
+ completionCriterionStatusSchema = z17.enum(["satisfied", "unsatisfied", "waived", "replaced"]);
11915
+ completionBlockerReasonSchema = z17.enum([
11874
11916
  "missing_evidence_binding",
11875
11917
  "child_not_done",
11876
11918
  "child_cancelled_requires_waiver",
@@ -11878,68 +11920,68 @@ var init_tasks2 = __esm({
11878
11920
  "child_missing",
11879
11921
  "done_parent_stale"
11880
11922
  ]);
11881
- completionStaleReasonSchema = z16.enum(["done_parent_has_unsatisfied_criteria"]);
11882
- completionProjectionRepairErrorCodeSchema = z16.enum([
11923
+ completionStaleReasonSchema = z17.enum(["done_parent_has_unsatisfied_criteria"]);
11924
+ completionProjectionRepairErrorCodeSchema = z17.enum([
11883
11925
  "projection_not_stale",
11884
11926
  "criteria_missing",
11885
11927
  "binding_target_missing",
11886
11928
  "repair_conflict"
11887
11929
  ]);
11888
- completionCriterionWaiverSchema = z16.object({
11889
- criterionAcId: z16.string().min(1),
11890
- childTaskId: z16.string().min(1),
11891
- reason: z16.string().min(1),
11892
- actor: z16.string().min(1),
11893
- waivedAt: z16.string().min(1)
11930
+ completionCriterionWaiverSchema = z17.object({
11931
+ criterionAcId: z17.string().min(1),
11932
+ childTaskId: z17.string().min(1),
11933
+ reason: z17.string().min(1),
11934
+ actor: z17.string().min(1),
11935
+ waivedAt: z17.string().min(1)
11894
11936
  });
11895
- completionCriterionReplacementSchema = z16.object({
11896
- criterionAcId: z16.string().min(1),
11897
- originalChildTaskId: z16.string().min(1),
11898
- replacementChildTaskId: z16.string().min(1),
11899
- reason: z16.string().min(1),
11900
- actor: z16.string().min(1),
11901
- replacedAt: z16.string().min(1)
11937
+ completionCriterionReplacementSchema = z17.object({
11938
+ criterionAcId: z17.string().min(1),
11939
+ originalChildTaskId: z17.string().min(1),
11940
+ replacementChildTaskId: z17.string().min(1),
11941
+ reason: z17.string().min(1),
11942
+ actor: z17.string().min(1),
11943
+ replacedAt: z17.string().min(1)
11902
11944
  });
11903
- completionCriterionEvaluationSchema = z16.object({
11904
- acId: z16.string().min(1),
11905
- alias: z16.string().min(1),
11906
- text: z16.string(),
11945
+ completionCriterionEvaluationSchema = z17.object({
11946
+ acId: z17.string().min(1),
11947
+ alias: z17.string().min(1),
11948
+ text: z17.string(),
11907
11949
  kind: completionCriterionKindSchema,
11908
11950
  status: completionCriterionStatusSchema,
11909
11951
  reason: completionBlockerReasonSchema.optional(),
11910
- targetTaskId: z16.string().min(1).optional(),
11952
+ targetTaskId: z17.string().min(1).optional(),
11911
11953
  targetTaskStatus: completionTaskStatusSchema.optional(),
11912
11954
  waiver: completionCriterionWaiverSchema.optional(),
11913
11955
  replacement: completionCriterionReplacementSchema.optional(),
11914
11956
  replacementTaskStatus: completionTaskStatusSchema.optional(),
11915
- evidenceBindings: z16.number().int().nonnegative()
11957
+ evidenceBindings: z17.number().int().nonnegative()
11916
11958
  });
11917
11959
  unsatisfiedCompletionCriterionSchema = completionCriterionEvaluationSchema.extend({
11918
- status: z16.literal("unsatisfied"),
11960
+ status: z17.literal("unsatisfied"),
11919
11961
  reason: completionBlockerReasonSchema
11920
11962
  });
11921
- completionTotalsSchema = z16.object({
11922
- criteria: z16.number().int().nonnegative(),
11923
- satisfied: z16.number().int().nonnegative(),
11924
- unsatisfied: z16.number().int().nonnegative(),
11925
- waived: z16.number().int().nonnegative(),
11926
- replaced: z16.number().int().nonnegative()
11963
+ completionTotalsSchema = z17.object({
11964
+ criteria: z17.number().int().nonnegative(),
11965
+ satisfied: z17.number().int().nonnegative(),
11966
+ unsatisfied: z17.number().int().nonnegative(),
11967
+ waived: z17.number().int().nonnegative(),
11968
+ replaced: z17.number().int().nonnegative()
11927
11969
  });
11928
- completionContextPackSchema = z16.object({
11929
- taskId: z16.string().min(1),
11930
- generatedAt: z16.string().min(1),
11931
- source: z16.literal("audit_log"),
11932
- window: z16.object({
11933
- limit: z16.number().int().positive(),
11934
- since: z16.string().min(1).optional(),
11935
- relationDepth: z16.number().int().nonnegative(),
11936
- relatedTaskIds: z16.array(z16.string().min(1))
11970
+ completionContextPackSchema = z17.object({
11971
+ taskId: z17.string().min(1),
11972
+ generatedAt: z17.string().min(1),
11973
+ source: z17.literal("audit_log"),
11974
+ window: z17.object({
11975
+ limit: z17.number().int().positive(),
11976
+ since: z17.string().min(1).optional(),
11977
+ relationDepth: z17.number().int().nonnegative(),
11978
+ relatedTaskIds: z17.array(z17.string().min(1))
11937
11979
  }),
11938
- events: z16.array(
11939
- z16.object({
11940
- id: z16.string().min(1),
11941
- timestamp: z16.string().min(1),
11942
- action: z16.enum([
11980
+ events: z17.array(
11981
+ z17.object({
11982
+ id: z17.string().min(1),
11983
+ timestamp: z17.string().min(1),
11984
+ action: z17.enum([
11943
11985
  "task_completed",
11944
11986
  "task_reopened",
11945
11987
  "task_cancelled",
@@ -11947,77 +11989,77 @@ var init_tasks2 = __esm({
11947
11989
  "task_reparented",
11948
11990
  "ac_projection_rebuilt"
11949
11991
  ]),
11950
- taskId: z16.string().min(1),
11951
- relation: z16.enum(["self", "parent", "child", "sibling", "related"]),
11952
- actor: z16.string().min(1),
11953
- details: z16.record(z16.string(), z16.unknown()).optional(),
11954
- before: z16.record(z16.string(), z16.unknown()).optional(),
11955
- after: z16.record(z16.string(), z16.unknown()).optional()
11992
+ taskId: z17.string().min(1),
11993
+ relation: z17.enum(["self", "parent", "child", "sibling", "related"]),
11994
+ actor: z17.string().min(1),
11995
+ details: z17.record(z17.string(), z17.unknown()).optional(),
11996
+ before: z17.record(z17.string(), z17.unknown()).optional(),
11997
+ after: z17.record(z17.string(), z17.unknown()).optional()
11956
11998
  })
11957
11999
  ),
11958
- summary: z16.object({
11959
- totalEvents: z16.number().int().nonnegative(),
11960
- byAction: z16.record(z16.string(), z16.number().int().nonnegative()),
11961
- byRelation: z16.record(z16.string(), z16.number().int().nonnegative()),
11962
- latestEventAt: z16.string().nullable()
12000
+ summary: z17.object({
12001
+ totalEvents: z17.number().int().nonnegative(),
12002
+ byAction: z17.record(z17.string(), z17.number().int().nonnegative()),
12003
+ byRelation: z17.record(z17.string(), z17.number().int().nonnegative()),
12004
+ latestEventAt: z17.string().nullable()
11963
12005
  })
11964
12006
  });
11965
- completionEvaluationSchema = z16.object({
11966
- taskId: z16.string().min(1),
12007
+ completionEvaluationSchema = z17.object({
12008
+ taskId: z17.string().min(1),
11967
12009
  taskStatus: completionTaskStatusSchema,
11968
- ready: z16.boolean(),
11969
- stale: z16.boolean(),
11970
- staleReasons: z16.array(completionStaleReasonSchema),
12010
+ ready: z17.boolean(),
12011
+ stale: z17.boolean(),
12012
+ staleReasons: z17.array(completionStaleReasonSchema),
11971
12013
  contextPack: completionContextPackSchema.optional(),
11972
- satisfied: z16.array(completionCriterionEvaluationSchema),
11973
- unsatisfied: z16.array(unsatisfiedCompletionCriterionSchema),
11974
- waived: z16.array(completionCriterionEvaluationSchema),
11975
- replaced: z16.array(completionCriterionEvaluationSchema),
12014
+ satisfied: z17.array(completionCriterionEvaluationSchema),
12015
+ unsatisfied: z17.array(unsatisfiedCompletionCriterionSchema),
12016
+ waived: z17.array(completionCriterionEvaluationSchema),
12017
+ replaced: z17.array(completionCriterionEvaluationSchema),
11976
12018
  totals: completionTotalsSchema
11977
12019
  });
11978
- completionExplanationSchema = z16.object({
11979
- taskId: z16.string().min(1),
11980
- ready: z16.boolean(),
11981
- stale: z16.boolean(),
11982
- summary: z16.string(),
12020
+ completionExplanationSchema = z17.object({
12021
+ taskId: z17.string().min(1),
12022
+ ready: z17.boolean(),
12023
+ stale: z17.boolean(),
12024
+ summary: z17.string(),
11983
12025
  contextPack: completionContextPackSchema.optional(),
11984
- blockers: z16.array(completionCriterionEvaluationSchema)
12026
+ blockers: z17.array(completionCriterionEvaluationSchema)
11985
12027
  });
11986
- completionListParamsSchema = z16.object({
11987
- taskId: z16.string().min(1),
12028
+ completionListParamsSchema = z17.object({
12029
+ taskId: z17.string().min(1),
11988
12030
  status: completionCriterionStatusSchema.optional(),
11989
12031
  kind: completionCriterionKindSchema.optional()
11990
12032
  });
11991
- completionListResultSchema = z16.object({
11992
- taskId: z16.string().min(1),
11993
- criteria: z16.array(completionCriterionEvaluationSchema),
12033
+ completionListResultSchema = z17.object({
12034
+ taskId: z17.string().min(1),
12035
+ criteria: z17.array(completionCriterionEvaluationSchema),
11994
12036
  totals: completionTotalsSchema
11995
12037
  });
11996
- completionEvaluateParamsSchema = z16.object({
11997
- taskId: z16.string().min(1),
11998
- includeContext: z16.boolean().optional(),
11999
- limit: z16.number().int().positive().optional(),
12000
- since: z16.string().min(1).optional(),
12001
- relationDepth: z16.number().int().nonnegative().optional()
12038
+ completionEvaluateParamsSchema = z17.object({
12039
+ taskId: z17.string().min(1),
12040
+ includeContext: z17.boolean().optional(),
12041
+ limit: z17.number().int().positive().optional(),
12042
+ since: z17.string().min(1).optional(),
12043
+ relationDepth: z17.number().int().nonnegative().optional()
12002
12044
  });
12003
- completionProjectionRepairErrorSchema = z16.object({
12045
+ completionProjectionRepairErrorSchema = z17.object({
12004
12046
  code: completionProjectionRepairErrorCodeSchema,
12005
- message: z16.string().min(1),
12006
- taskId: z16.string().min(1),
12007
- acId: z16.string().min(1).optional(),
12008
- evidenceAtomId: z16.string().min(1).optional()
12047
+ message: z17.string().min(1),
12048
+ taskId: z17.string().min(1),
12049
+ acId: z17.string().min(1).optional(),
12050
+ evidenceAtomId: z17.string().min(1).optional()
12009
12051
  });
12010
- completionProjectionRepairParamsSchema = z16.object({
12011
- taskId: z16.string().min(1),
12012
- dryRun: z16.boolean().optional()
12052
+ completionProjectionRepairParamsSchema = z17.object({
12053
+ taskId: z17.string().min(1),
12054
+ dryRun: z17.boolean().optional()
12013
12055
  });
12014
- completionProjectionRepairResultSchema = z16.object({
12015
- taskId: z16.string().min(1),
12016
- repaired: z16.boolean(),
12017
- dryRun: z16.boolean(),
12018
- staleBefore: z16.boolean(),
12019
- staleAfter: z16.boolean(),
12020
- errors: z16.array(completionProjectionRepairErrorSchema)
12056
+ completionProjectionRepairResultSchema = z17.object({
12057
+ taskId: z17.string().min(1),
12058
+ repaired: z17.boolean(),
12059
+ dryRun: z17.boolean(),
12060
+ staleBefore: z17.boolean(),
12061
+ staleAfter: z17.boolean(),
12062
+ errors: z17.array(completionProjectionRepairErrorSchema)
12021
12063
  });
12022
12064
  }
12023
12065
  });
@@ -12528,7 +12570,7 @@ var init_taxonomy = __esm({
12528
12570
  });
12529
12571
 
12530
12572
  // packages/contracts/src/templates/manifest.ts
12531
- import { z as z17 } from "zod";
12573
+ import { z as z18 } from "zod";
12532
12574
  var TEMPLATE_KINDS, TEMPLATE_SUBSTITUTIONS, TEMPLATE_UPDATE_STRATEGIES, PLACEHOLDER_SOURCES, PlaceholderSpecSchema, TemplateManifestEntrySchema;
12533
12575
  var init_manifest2 = __esm({
12534
12576
  "packages/contracts/src/templates/manifest.ts"() {
@@ -12549,85 +12591,85 @@ var init_manifest2 = __esm({
12549
12591
  "tool-resolver",
12550
12592
  "literal"
12551
12593
  ];
12552
- PlaceholderSpecSchema = z17.object({
12594
+ PlaceholderSpecSchema = z18.object({
12553
12595
  /**
12554
12596
  * Placeholder identifier as it appears in the template body
12555
12597
  * (e.g. `NODE_VERSION` matches `{{NODE_VERSION}}`).
12556
12598
  */
12557
- name: z17.string().min(1, "placeholder name must be non-empty"),
12599
+ name: z18.string().min(1, "placeholder name must be non-empty"),
12558
12600
  /** Resolver source the installer consults for this placeholder. */
12559
- source: z17.enum(PLACEHOLDER_SOURCES),
12601
+ source: z18.enum(PLACEHOLDER_SOURCES),
12560
12602
  /**
12561
12603
  * Path expression evaluated against `source` (e.g. `engines.node` against
12562
12604
  * `project-context`, `defaults.branchModel` against `.cleo/config`).
12563
12605
  * For `literal` source, this MAY be the literal value's identifier.
12564
12606
  */
12565
- sourcePath: z17.string().min(1, "placeholder sourcePath must be non-empty"),
12607
+ sourcePath: z18.string().min(1, "placeholder sourcePath must be non-empty"),
12566
12608
  /**
12567
12609
  * Fallback value used when `source[sourcePath]` resolves to `undefined`.
12568
12610
  * `null` is permitted to explicitly mark "no default — failure required".
12569
12611
  */
12570
- defaultValue: z17.union([z17.string(), z17.number(), z17.boolean(), z17.null()]).optional()
12612
+ defaultValue: z18.union([z18.string(), z18.number(), z18.boolean(), z18.null()]).optional()
12571
12613
  });
12572
- TemplateManifestEntrySchema = z17.object({
12614
+ TemplateManifestEntrySchema = z18.object({
12573
12615
  /** Stable identifier for this template entry. */
12574
- id: z17.string().min(1, "id must be non-empty"),
12616
+ id: z18.string().min(1, "id must be non-empty"),
12575
12617
  /** Category of file this template represents. */
12576
- kind: z17.enum(TEMPLATE_KINDS),
12618
+ kind: z18.enum(TEMPLATE_KINDS),
12577
12619
  /** Repo-relative path of the template source file. */
12578
- sourcePath: z17.string().min(1, "sourcePath must be non-empty"),
12620
+ sourcePath: z18.string().min(1, "sourcePath must be non-empty"),
12579
12621
  /** Project-relative path where the rendered template installs. */
12580
- installPath: z17.string().min(1, "installPath must be non-empty"),
12622
+ installPath: z18.string().min(1, "installPath must be non-empty"),
12581
12623
  /** Substitution strategy the installer applies to `sourcePath`. */
12582
- substitution: z17.enum(TEMPLATE_SUBSTITUTIONS),
12624
+ substitution: z18.enum(TEMPLATE_SUBSTITUTIONS),
12583
12625
  /** Declared placeholders this template requires. May be empty. */
12584
- placeholders: z17.array(PlaceholderSpecSchema),
12626
+ placeholders: z18.array(PlaceholderSpecSchema),
12585
12627
  /** Reconciliation policy on upgrade. */
12586
- updateStrategy: z17.enum(TEMPLATE_UPDATE_STRATEGIES)
12628
+ updateStrategy: z18.enum(TEMPLATE_UPDATE_STRATEGIES)
12587
12629
  });
12588
12630
  }
12589
12631
  });
12590
12632
 
12591
12633
  // packages/contracts/src/validator/index.ts
12592
- import { z as z18 } from "zod";
12634
+ import { z as z19 } from "zod";
12593
12635
  var VALIDATOR_ID_REGEX, validatorFindingSchema, validatorAttestationSchema, validatorRejectionSchema, validatorVerdictSchema;
12594
12636
  var init_validator = __esm({
12595
12637
  "packages/contracts/src/validator/index.ts"() {
12596
12638
  "use strict";
12597
12639
  VALIDATOR_ID_REGEX = /^validator-[a-z0-9][a-z0-9-]*$/;
12598
- validatorFindingSchema = z18.object({
12599
- acId: z18.string().min(1, "acId must be non-empty"),
12600
- status: z18.enum(["pass", "fail", "inconclusive"]),
12601
- reasoning: z18.string().min(1, "reasoning must be non-empty"),
12602
- evidenceRefs: z18.array(z18.string()).optional(),
12603
- checkedAt: z18.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
12640
+ validatorFindingSchema = z19.object({
12641
+ acId: z19.string().min(1, "acId must be non-empty"),
12642
+ status: z19.enum(["pass", "fail", "inconclusive"]),
12643
+ reasoning: z19.string().min(1, "reasoning must be non-empty"),
12644
+ evidenceRefs: z19.array(z19.string()).optional(),
12645
+ checkedAt: z19.string().min(1, "checkedAt must be a non-empty ISO-8601 string")
12604
12646
  });
12605
- validatorAttestationSchema = z18.object({
12606
- verdict: z18.literal("attest"),
12607
- taskId: z18.string().min(1),
12608
- validatorId: z18.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
12609
- findings: z18.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
12647
+ validatorAttestationSchema = z19.object({
12648
+ verdict: z19.literal("attest"),
12649
+ taskId: z19.string().min(1),
12650
+ validatorId: z19.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
12651
+ findings: z19.array(validatorFindingSchema).min(1, "attestation must contain at least one finding").refine(
12610
12652
  (findings) => findings.every((f) => f.status === "pass"),
12611
12653
  'attestation requires every finding to have status="pass"'
12612
12654
  ),
12613
- summary: z18.string().optional(),
12614
- attestedAt: z18.string().min(1),
12615
- schemaVersion: z18.literal("1")
12655
+ summary: z19.string().optional(),
12656
+ attestedAt: z19.string().min(1),
12657
+ schemaVersion: z19.literal("1")
12616
12658
  });
12617
- validatorRejectionSchema = z18.object({
12618
- verdict: z18.literal("reject"),
12619
- taskId: z18.string().min(1),
12620
- validatorId: z18.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
12621
- findings: z18.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
12659
+ validatorRejectionSchema = z19.object({
12660
+ verdict: z19.literal("reject"),
12661
+ taskId: z19.string().min(1),
12662
+ validatorId: z19.string().regex(VALIDATOR_ID_REGEX, "validatorId must match the pattern validator-<discriminator>"),
12663
+ findings: z19.array(validatorFindingSchema).min(1, "rejection must contain at least one finding").refine(
12622
12664
  (findings) => findings.some((f) => f.status !== "pass"),
12623
12665
  'rejection requires at least one finding with status "fail" or "inconclusive"'
12624
12666
  ),
12625
- summary: z18.string().min(1, "rejection summary must be non-empty"),
12626
- remediationHints: z18.array(z18.string()).optional(),
12627
- rejectedAt: z18.string().min(1),
12628
- schemaVersion: z18.literal("1")
12667
+ summary: z19.string().min(1, "rejection summary must be non-empty"),
12668
+ remediationHints: z19.array(z19.string()).optional(),
12669
+ rejectedAt: z19.string().min(1),
12670
+ schemaVersion: z19.literal("1")
12629
12671
  });
12630
- validatorVerdictSchema = z18.discriminatedUnion("verdict", [
12672
+ validatorVerdictSchema = z19.discriminatedUnion("verdict", [
12631
12673
  validatorAttestationSchema,
12632
12674
  validatorRejectionSchema
12633
12675
  ]);
@@ -12651,6 +12693,7 @@ var init_src = __esm({
12651
12693
  init_identity();
12652
12694
  init_operations_registry();
12653
12695
  init_provenance();
12696
+ init_read();
12654
12697
  init_docs_taxonomy();
12655
12698
  init_engine_result();
12656
12699
  init_enums();
@@ -14071,10 +14114,10 @@ var init_subquery = __esm({
14071
14114
  init_entity();
14072
14115
  Subquery = class {
14073
14116
  static [entityKind] = "Subquery";
14074
- constructor(sql31, fields, alias, isWith = false, usedTables = []) {
14117
+ constructor(sql32, fields, alias, isWith = false, usedTables = []) {
14075
14118
  this._ = {
14076
14119
  brand: "Subquery",
14077
- sql: sql31,
14120
+ sql: sql32,
14078
14121
  selectedFields: fields,
14079
14122
  alias,
14080
14123
  isWith,
@@ -14688,8 +14731,8 @@ var init_sql = __esm({
14688
14731
  isSelectionField = false;
14689
14732
  /** @internal */
14690
14733
  origin;
14691
- constructor(sql31, fieldAlias) {
14692
- this.sql = sql31;
14734
+ constructor(sql32, fieldAlias) {
14735
+ this.sql = sql32;
14693
14736
  this.fieldAlias = fieldAlias;
14694
14737
  }
14695
14738
  getSQL() {
@@ -16258,17 +16301,17 @@ var init_custom = __esm({
16258
16301
  mapFromJsonValue(value) {
16259
16302
  return typeof this.mapJson === "function" ? this.mapJson(value) : this.mapFromDriverValue(value);
16260
16303
  }
16261
- jsonSelectIdentifier(identifier, sql31) {
16262
- if (typeof this.forJsonSelect === "function") return this.forJsonSelect(identifier, sql31);
16304
+ jsonSelectIdentifier(identifier, sql32) {
16305
+ if (typeof this.forJsonSelect === "function") return this.forJsonSelect(identifier, sql32);
16263
16306
  const rawType = this.getSQLType().toLowerCase();
16264
16307
  const parenPos = rawType.indexOf("(");
16265
16308
  switch (parenPos + 1 ? rawType.slice(0, parenPos) : rawType) {
16266
16309
  case "numeric":
16267
16310
  case "decimal":
16268
16311
  case "bigint":
16269
- return sql31`cast(${identifier} as text)`;
16312
+ return sql32`cast(${identifier} as text)`;
16270
16313
  case "blob":
16271
- return sql31`hex(${identifier})`;
16314
+ return sql32`hex(${identifier})`;
16272
16315
  default:
16273
16316
  return identifier;
16274
16317
  }
@@ -20556,8 +20599,8 @@ var init_dialect = __esm({
20556
20599
  const returningSql = returning ? sql` returning ${this.buildSelection(returning, { isSingleTable: true })}` : void 0;
20557
20600
  return sql`${withSql}insert into ${table} ${insertOrder} ${valuesSql}${onConflict?.length ? sql.join(onConflict) : void 0}${returningSql}`;
20558
20601
  }
20559
- sqlToQuery(sql31, invokeSource) {
20560
- return sql31.toQuery({
20602
+ sqlToQuery(sql32, invokeSource) {
20603
+ return sql32.toQuery({
20561
20604
  escapeName: this.escapeName,
20562
20605
  escapeParam: this.escapeParam,
20563
20606
  escapeString: this.escapeString,
@@ -22074,8 +22117,8 @@ var init_db = __esm({
22074
22117
  });
22075
22118
 
22076
22119
  // node_modules/.pnpm/drizzle-orm@1.0.0-rc.3_@opentelemetry+api@1.9.0_@sinclair+typebox@0.34.49_@types+mssql@_e8baa2fb26279933413bcd023f31ad8f/node_modules/drizzle-orm/cache/core/cache.js
22077
- async function hashQuery(sql31, params) {
22078
- const dataToHash = `${sql31}-${JSON.stringify(params, (_, v) => typeof v === "bigint" ? `${v}n` : v)}`;
22120
+ async function hashQuery(sql32, params) {
22121
+ const dataToHash = `${sql32}-${JSON.stringify(params, (_, v) => typeof v === "bigint" ? `${v}n` : v)}`;
22079
22122
  const data = new TextEncoder().encode(dataToHash);
22080
22123
  const hashBuffer = await crypto.subtle.digest("SHA-256", data);
22081
22124
  return [...new Uint8Array(hashBuffer)].map((b) => b.toString(16).padStart(2, "0")).join("");
@@ -22254,8 +22297,8 @@ var init_session3 = __esm({
22254
22297
  values(query) {
22255
22298
  return this.prepareOneTimeQuery(this.dialect.sqlToQuery(query), void 0, "run").values();
22256
22299
  }
22257
- async count(sql31) {
22258
- return (await this.values(sql31))[0][0];
22300
+ async count(sql32) {
22301
+ return (await this.values(sql32))[0][0];
22259
22302
  }
22260
22303
  /** @internal */
22261
22304
  extractRawValuesValueFromBatchResult(_result) {
@@ -22516,6 +22559,48 @@ var init_logger2 = __esm({
22516
22559
  }
22517
22560
  });
22518
22561
 
22562
+ // packages/core/src/store/exodus/abort-events.ts
22563
+ var abort_events_exports = {};
22564
+ __export(abort_events_exports, {
22565
+ clearExodusAborts: () => clearExodusAborts,
22566
+ emitExodusAbort: () => emitExodusAbort,
22567
+ exodusAbortEvents: () => exodusAbortEvents,
22568
+ getRecordedExodusAbort: () => getRecordedExodusAbort
22569
+ });
22570
+ import { EventEmitter } from "node:events";
22571
+ function emitExodusAbort(detail) {
22572
+ _abortedScopes.set(detail.scope, detail);
22573
+ try {
22574
+ return exodusAbortEvents.emit("abort", detail);
22575
+ } catch {
22576
+ return false;
22577
+ }
22578
+ }
22579
+ function getRecordedExodusAbort(scope) {
22580
+ if (scope !== void 0) return _abortedScopes.get(scope);
22581
+ let latest;
22582
+ for (const detail of _abortedScopes.values()) {
22583
+ if (!latest || detail.at >= latest.at) latest = detail;
22584
+ }
22585
+ return latest;
22586
+ }
22587
+ function clearExodusAborts(scope) {
22588
+ if (scope !== void 0) {
22589
+ _abortedScopes.delete(scope);
22590
+ return;
22591
+ }
22592
+ _abortedScopes.clear();
22593
+ }
22594
+ var exodusAbortEvents, _abortedScopes;
22595
+ var init_abort_events = __esm({
22596
+ "packages/core/src/store/exodus/abort-events.ts"() {
22597
+ "use strict";
22598
+ exodusAbortEvents = new EventEmitter();
22599
+ exodusAbortEvents.setMaxListeners(50);
22600
+ _abortedScopes = /* @__PURE__ */ new Map();
22601
+ }
22602
+ });
22603
+
22519
22604
  // node_modules/.pnpm/drizzle-orm@1.0.0-rc.3_@opentelemetry+api@1.9.0_@sinclair+typebox@0.34.49_@types+mssql@_e8baa2fb26279933413bcd023f31ad8f/node_modules/drizzle-orm/migrator.js
22520
22605
  import crypto2 from "node:crypto";
22521
22606
  import fs, { existsSync, readdirSync } from "node:fs";
@@ -27101,7 +27186,8 @@ var init_conduit2 = __esm({
27101
27186
  });
27102
27187
 
27103
27188
  // packages/core/src/store/schema/attachments.ts
27104
- var ATTACHMENT_OWNER_TYPES, ATTACHMENT_LIFECYCLE_STATUSES, attachments, attachmentRefs;
27189
+ import { sql as sql11 } from "drizzle-orm";
27190
+ var ATTACHMENT_OWNER_TYPES, ATTACHMENT_LIFECYCLE_STATUSES, attachments, attachmentRefs, DOCS_WIKILINK_RELATIONS, docsWikilinks;
27105
27191
  var init_attachments = __esm({
27106
27192
  "packages/core/src/store/schema/attachments.ts"() {
27107
27193
  "use strict";
@@ -27240,12 +27326,42 @@ var init_attachments = __esm({
27240
27326
  *
27241
27327
  * @task T11181 (Epic T10518 / Saga T10516)
27242
27328
  */
27243
- docVersion: integer("doc_version").notNull().default(1)
27329
+ docVersion: integer("doc_version").notNull().default(1),
27330
+ /**
27331
+ * Optional explicit display-alias NUMBER for the doc, DECOUPLED from the
27332
+ * slug string.
27333
+ *
27334
+ * Background (T11875 · ADR reconcile T11676): under the ratified
27335
+ * slug-primary model the kebab `slug` is the canonical handle and the
27336
+ * displayed number (e.g. ADR "051") is a DISPLAY ALIAS only. Previously
27337
+ * that number was DERIVED by parsing the digits out of the slug
27338
+ * (`adr-051-*` → 051), so three distinct ADRs that all slug as `adr-051-*`
27339
+ * collided on the rendered number with no way to disambiguate.
27340
+ *
27341
+ * When non-null, this column is the authoritative display number and is
27342
+ * PREFERRED over the slug-derived number by
27343
+ * {@link import('../../docs/numbering.js').resolveDisplayNumber}. When null,
27344
+ * rendering falls back to the slug-derived number unchanged — so docs that
27345
+ * never had an alias assigned keep their historical behaviour.
27346
+ *
27347
+ * Uniqueness among `type='adr'` docs is enforced at the dispatch layer (not
27348
+ * via a SQL UNIQUE constraint) by
27349
+ * {@link import('../../docs/display-alias.js').setDisplayAlias}, mirroring
27350
+ * the dispatch-validated discipline used for `lifecycle_status` /
27351
+ * `relation` so future taxonomy changes never require a schema migration.
27352
+ *
27353
+ * @task T11875 (Epic T11781 / Saga T11778)
27354
+ */
27355
+ displayAlias: integer("display_alias")
27244
27356
  },
27245
27357
  (table) => [
27246
27358
  index("idx_attachments_sha256").on(table.sha256),
27247
27359
  index("idx_attachments_lifecycle_status").on(table.lifecycleStatus),
27248
- index("idx_attachments_supersedes").on(table.supersedes)
27360
+ index("idx_attachments_supersedes").on(table.supersedes),
27361
+ // Speeds the per-type uniqueness scan in `setDisplayAlias` (T11875). Not a
27362
+ // UNIQUE index — uniqueness is scoped to `type='adr'` and enforced at the
27363
+ // dispatch layer so non-adr kinds may reuse numbers freely.
27364
+ index("idx_attachments_display_alias").on(table.displayAlias)
27249
27365
  ]
27250
27366
  );
27251
27367
  attachmentRefs = sqliteTable(
@@ -27270,11 +27386,38 @@ var init_attachments = __esm({
27270
27386
  index("idx_attachment_refs_owner").on(table.ownerType, table.ownerId)
27271
27387
  ]
27272
27388
  );
27389
+ DOCS_WIKILINK_RELATIONS = [
27390
+ "supersedes",
27391
+ "superseded-by",
27392
+ "related-task",
27393
+ "topic"
27394
+ ];
27395
+ docsWikilinks = sqliteTable(
27396
+ "docs_wikilinks",
27397
+ {
27398
+ /** Source doc slug (→ `attachments.slug`). Always a doc. */
27399
+ fromSlug: text("from_slug").notNull(),
27400
+ /** Target slug — a doc slug, or a `T####` task id when `toIsTask = 1`. */
27401
+ toSlug: text("to_slug").notNull(),
27402
+ /** Which provenance column produced this edge — dispatch-validated, no SQL CHECK. */
27403
+ relation: text("relation", { enum: DOCS_WIKILINK_RELATIONS }).notNull(),
27404
+ /** 1 when `to_slug` is a task id (`related-task` edges); 0 for doc→doc edges. */
27405
+ toIsTask: integer("to_is_task", { mode: "boolean" }).notNull().default(false),
27406
+ /** ISO-8601 UTC instant this edge was last (re)derived. */
27407
+ derivedAt: text("derived_at").notNull().default(sql11`(datetime('now'))`)
27408
+ },
27409
+ (table) => [
27410
+ primaryKey({ columns: [table.fromSlug, table.toSlug, table.relation] }),
27411
+ index("idx_docs_wikilinks_from").on(table.fromSlug),
27412
+ index("idx_docs_wikilinks_to").on(table.toSlug),
27413
+ index("idx_docs_wikilinks_relation").on(table.relation)
27414
+ ]
27415
+ );
27273
27416
  }
27274
27417
  });
27275
27418
 
27276
27419
  // packages/core/src/store/schema/cleo-project/docs.ts
27277
- import { sql as sql11 } from "drizzle-orm";
27420
+ import { sql as sql12 } from "drizzle-orm";
27278
27421
  var docsAttachments, docsAttachmentRefs, docsManifestEntries, docsPipelineManifest;
27279
27422
  var init_docs2 = __esm({
27280
27423
  "packages/core/src/store/schema/cleo-project/docs.ts"() {
@@ -27297,7 +27440,7 @@ var init_docs2 = __esm({
27297
27440
  */
27298
27441
  attachmentJson: text("attachment_json").notNull(),
27299
27442
  /** ISO-8601 UTC creation instant (canonical TEXT timestamp, §4). */
27300
- createdAt: text("created_at").notNull().default(sql11`(datetime('now'))`),
27443
+ createdAt: text("created_at").notNull().default(sql12`(datetime('now'))`),
27301
27444
  /** Number of `docs_attachment_refs` rows pointing here; GC-eligible at 0. */
27302
27445
  refCount: integer("ref_count").notNull().default(0),
27303
27446
  /** Optional human-friendly slug, unique per project. */
@@ -27382,7 +27525,7 @@ var init_docs2 = __esm({
27382
27525
  /** Agent identity (or `"human"`) that created the entry. */
27383
27526
  createdBy: text("created_by"),
27384
27527
  /** ISO-8601 UTC creation instant (canonical TEXT timestamp, §4). */
27385
- createdAt: text("created_at").notNull().default(sql11`(datetime('now'))`)
27528
+ createdAt: text("created_at").notNull().default(sql12`(datetime('now'))`)
27386
27529
  },
27387
27530
  (table) => [
27388
27531
  index("idx_docs_manifest_entries_pipeline_id").on(table.pipelineId),
@@ -27429,7 +27572,7 @@ var init_docs2 = __esm({
27429
27572
  /** Optional serialized metadata (TEXT per JSON audit). */
27430
27573
  metadataJson: text("metadata_json"),
27431
27574
  /** ISO-8601 UTC creation instant (canonical TEXT timestamp, §4). */
27432
- createdAt: text("created_at").notNull().default(sql11`(datetime('now'))`),
27575
+ createdAt: text("created_at").notNull().default(sql12`(datetime('now'))`),
27433
27576
  /** ISO-8601 UTC archival instant; NULL while active (canonical TEXT, §4). */
27434
27577
  archivedAt: text("archived_at")
27435
27578
  },
@@ -27445,7 +27588,7 @@ var init_docs2 = __esm({
27445
27588
  });
27446
27589
 
27447
27590
  // packages/core/src/store/schema/cleo-project/lifecycle.ts
27448
- import { sql as sql12 } from "drizzle-orm";
27591
+ import { sql as sql13 } from "drizzle-orm";
27449
27592
  var LIFECYCLE_VALIDATION_STATUSES, tasksLifecyclePipelines, tasksLifecycleStages, tasksLifecycleGateResults, tasksLifecycleEvidence, tasksLifecycleTransitions;
27450
27593
  var init_lifecycle3 = __esm({
27451
27594
  "packages/core/src/store/schema/cleo-project/lifecycle.ts"() {
@@ -27472,11 +27615,11 @@ var init_lifecycle3 = __esm({
27472
27615
  /** Current stage id pointer. */
27473
27616
  currentStageId: text("current_stage_id"),
27474
27617
  /** ISO-8601 UTC start instant (canonical TEXT, §4). */
27475
- startedAt: text("started_at").notNull().default(sql12`(datetime('now'))`),
27618
+ startedAt: text("started_at").notNull().default(sql13`(datetime('now'))`),
27476
27619
  /** ISO-8601 UTC completion instant; NULL while active (canonical TEXT, §4). */
27477
27620
  completedAt: text("completed_at"),
27478
27621
  /** ISO-8601 UTC last-update instant (canonical TEXT, §4). */
27479
- updatedAt: text("updated_at").default(sql12`(datetime('now'))`),
27622
+ updatedAt: text("updated_at").default(sql13`(datetime('now'))`),
27480
27623
  /** Optimistic-concurrency version counter. */
27481
27624
  version: integer("version").notNull().default(1)
27482
27625
  },
@@ -27546,7 +27689,7 @@ var init_lifecycle3 = __esm({
27546
27689
  /** Result — CHECK-backed via {@link LIFECYCLE_GATE_RESULTS}. */
27547
27690
  result: text("result", { enum: LIFECYCLE_GATE_RESULTS }).notNull(),
27548
27691
  /** ISO-8601 UTC check instant (canonical TEXT, §4). */
27549
- checkedAt: text("checked_at").notNull().default(sql12`(datetime('now'))`),
27692
+ checkedAt: text("checked_at").notNull().default(sql13`(datetime('now'))`),
27550
27693
  /** Checker identity. */
27551
27694
  checkedBy: text("checked_by").notNull(),
27552
27695
  /** Optional detail payload. */
@@ -27568,7 +27711,7 @@ var init_lifecycle3 = __esm({
27568
27711
  /** Evidence type — CHECK-backed via {@link LIFECYCLE_EVIDENCE_TYPES}. */
27569
27712
  type: text("type", { enum: LIFECYCLE_EVIDENCE_TYPES }).notNull(),
27570
27713
  /** ISO-8601 UTC record instant (canonical TEXT, §4). */
27571
- recordedAt: text("recorded_at").notNull().default(sql12`(datetime('now'))`),
27714
+ recordedAt: text("recorded_at").notNull().default(sql13`(datetime('now'))`),
27572
27715
  /** Recorder identity. */
27573
27716
  recordedBy: text("recorded_by"),
27574
27717
  /** Optional description. */
@@ -27592,7 +27735,7 @@ var init_lifecycle3 = __esm({
27592
27735
  /** Actor identity. */
27593
27736
  transitionedBy: text("transitioned_by"),
27594
27737
  /** ISO-8601 UTC creation instant (canonical TEXT, §4). */
27595
- createdAt: text("created_at").notNull().default(sql12`(datetime('now'))`)
27738
+ createdAt: text("created_at").notNull().default(sql13`(datetime('now'))`)
27596
27739
  },
27597
27740
  (table) => [index("idx_tasks_lifecycle_transitions_pipeline_id").on(table.pipelineId)]
27598
27741
  );
@@ -27600,7 +27743,7 @@ var init_lifecycle3 = __esm({
27600
27743
  });
27601
27744
 
27602
27745
  // packages/core/src/store/schema/cleo-project/nexus-graph.ts
27603
- import { sql as sql13 } from "drizzle-orm";
27746
+ import { sql as sql14 } from "drizzle-orm";
27604
27747
  var NEXUS_NODE_KINDS, NEXUS_RELATION_TYPES, NEXUS_CONTRACT_TYPES, CODE_INDEX_KINDS, nexusNodes, nexusRelations, nexusRelationWeights, nexusContracts, nexusCodeIndex;
27605
27748
  var init_nexus_graph = __esm({
27606
27749
  "packages/core/src/store/schema/cleo-project/nexus-graph.ts"() {
@@ -27740,7 +27883,7 @@ var init_nexus_graph = __esm({
27740
27883
  /** Whether this node is an external/unresolved module (E10 §3a — typed boolean). */
27741
27884
  isExternal: integer("is_external", { mode: "boolean" }).notNull().default(false),
27742
27885
  /** ISO-8601 UTC last-indexed instant (canonical TEXT, §4). */
27743
- indexedAt: text("indexed_at").notNull().default(sql13`(datetime('now'))`)
27886
+ indexedAt: text("indexed_at").notNull().default(sql14`(datetime('now'))`)
27744
27887
  },
27745
27888
  (table) => [
27746
27889
  index("idx_nexus_nodes_kind").on(table.kind),
@@ -27770,7 +27913,7 @@ var init_nexus_graph = __esm({
27770
27913
  /** Step index within an execution flow (for step_in_process relations). */
27771
27914
  step: integer("step"),
27772
27915
  /** ISO-8601 UTC last-indexed instant (canonical TEXT, §4). */
27773
- indexedAt: text("indexed_at").notNull().default(sql13`(datetime('now'))`)
27916
+ indexedAt: text("indexed_at").notNull().default(sql14`(datetime('now'))`)
27774
27917
  // T998 plasticity columns (`weight`, `last_accessed_at`, `co_accessed_count`)
27775
27918
  // PARTITIONED out into the sibling `nexus_relation_weights` table by T11545
27776
27919
  // (ADR-090 §5.3). See {@link nexusRelationWeights}.
@@ -27825,9 +27968,9 @@ var init_nexus_graph = __esm({
27825
27968
  /** Human-readable description. */
27826
27969
  description: text("description"),
27827
27970
  /** ISO-8601 UTC creation instant (canonical TEXT, §4). */
27828
- createdAt: text("created_at").notNull().default(sql13`(datetime('now'))`),
27971
+ createdAt: text("created_at").notNull().default(sql14`(datetime('now'))`),
27829
27972
  /** ISO-8601 UTC last-update instant (canonical TEXT, §4). */
27830
- updatedAt: text("updated_at").notNull().default(sql13`(datetime('now'))`)
27973
+ updatedAt: text("updated_at").notNull().default(sql14`(datetime('now'))`)
27831
27974
  },
27832
27975
  (table) => [
27833
27976
  index("idx_nexus_contracts_type").on(table.type),
@@ -27875,7 +28018,7 @@ var init_nexus_graph = __esm({
27875
28018
  });
27876
28019
 
27877
28020
  // packages/core/src/store/schema/provenance/commits.ts
27878
- import { sql as sql14 } from "drizzle-orm";
28021
+ import { sql as sql15 } from "drizzle-orm";
27879
28022
  var COMMIT_CONVENTIONAL_TYPES, COMMIT_LINK_KINDS, COMMIT_LINK_SOURCES, COMMIT_FILE_CHANGE_TYPES, commits, taskCommits, commitFiles;
27880
28023
  var init_commits = __esm({
27881
28024
  "packages/core/src/store/schema/provenance/commits.ts"() {
@@ -27957,7 +28100,7 @@ var init_commits = __esm({
27957
28100
  */
27958
28101
  projectHash: text("project_hash"),
27959
28102
  /** ISO-8601 timestamp when this row was inserted into tasks.db. */
27960
- createdAt: text("created_at").notNull().default(sql14`(datetime('now'))`)
28103
+ createdAt: text("created_at").notNull().default(sql15`(datetime('now'))`)
27961
28104
  },
27962
28105
  (table) => [
27963
28106
  index("idx_commits_short_sha").on(table.shortSha),
@@ -27989,7 +28132,7 @@ var init_commits = __esm({
27989
28132
  */
27990
28133
  linkSource: text("link_source").notNull(),
27991
28134
  /** ISO-8601 timestamp when this link was created. */
27992
- createdAt: text("created_at").notNull().default(sql14`(datetime('now'))`)
28135
+ createdAt: text("created_at").notNull().default(sql15`(datetime('now'))`)
27993
28136
  },
27994
28137
  (table) => [
27995
28138
  primaryKey({ columns: [table.taskId, table.commitSha, table.linkKind] }),
@@ -28032,7 +28175,7 @@ var init_commits = __esm({
28032
28175
  });
28033
28176
 
28034
28177
  // packages/core/src/store/schema/cleo-project/provenance-commits.ts
28035
- import { sql as sql15 } from "drizzle-orm";
28178
+ import { sql as sql16 } from "drizzle-orm";
28036
28179
  var tasksCommits, tasksTaskCommits, tasksCommitFiles;
28037
28180
  var init_provenance_commits = __esm({
28038
28181
  "packages/core/src/store/schema/cleo-project/provenance-commits.ts"() {
@@ -28090,7 +28233,7 @@ var init_provenance_commits = __esm({
28090
28233
  /** Project hash correlating commits to a specific CLEO project. */
28091
28234
  projectHash: text("project_hash"),
28092
28235
  /** ISO-8601 UTC insertion instant (canonical TEXT timestamp, §4). */
28093
- createdAt: text("created_at").notNull().default(sql15`(datetime('now'))`)
28236
+ createdAt: text("created_at").notNull().default(sql16`(datetime('now'))`)
28094
28237
  },
28095
28238
  (table) => [
28096
28239
  index("idx_tasks_commits_short_sha").on(table.shortSha),
@@ -28113,7 +28256,7 @@ var init_provenance_commits = __esm({
28113
28256
  /** How this link was discovered — E10 §5b CHECK-backed. */
28114
28257
  linkSource: text("link_source", { enum: COMMIT_LINK_SOURCES }).notNull(),
28115
28258
  /** ISO-8601 UTC link-creation instant (canonical TEXT timestamp, §4). */
28116
- createdAt: text("created_at").notNull().default(sql15`(datetime('now'))`)
28259
+ createdAt: text("created_at").notNull().default(sql16`(datetime('now'))`)
28117
28260
  },
28118
28261
  (table) => [
28119
28262
  primaryKey({ columns: [table.taskId, table.commitSha, table.linkKind] }),
@@ -28150,7 +28293,7 @@ var init_provenance_commits = __esm({
28150
28293
  });
28151
28294
 
28152
28295
  // packages/core/src/store/schema/cleo-project/provenance-orphans.ts
28153
- import { sql as sql16 } from "drizzle-orm";
28296
+ import { sql as sql17 } from "drizzle-orm";
28154
28297
  var BRAIN_RELEASE_LINK_TYPES_CONSOLIDATED, tasksAgentCredentials, tasksBrainReleaseLinks;
28155
28298
  var init_provenance_orphans = __esm({
28156
28299
  "packages/core/src/store/schema/cleo-project/provenance-orphans.ts"() {
@@ -28188,9 +28331,9 @@ var init_provenance_orphans = __esm({
28188
28331
  /** Unix epoch of most recent use (milliseconds). Null = never used. */
28189
28332
  lastUsedAt: integer("last_used_at"),
28190
28333
  /** Unix epoch when this credential was created (milliseconds). */
28191
- createdAt: integer("created_at").notNull().default(sql16`(unixepoch())`),
28334
+ createdAt: integer("created_at").notNull().default(sql17`(unixepoch())`),
28192
28335
  /** Unix epoch when this credential was last updated (milliseconds). */
28193
- updatedAt: integer("updated_at").notNull().default(sql16`(unixepoch())`)
28336
+ updatedAt: integer("updated_at").notNull().default(sql17`(unixepoch())`)
28194
28337
  },
28195
28338
  (table) => [
28196
28339
  index("idx_tasks_agent_cred_active").on(table.isActive),
@@ -28210,7 +28353,7 @@ var init_provenance_orphans = __esm({
28210
28353
  /** Semantic relationship type. */
28211
28354
  linkType: text("link_type", { enum: BRAIN_RELEASE_LINK_TYPES_CONSOLIDATED }).notNull(),
28212
28355
  /** ISO-8601 timestamp when this link was created. */
28213
- createdAt: text("created_at").notNull().default(sql16`(datetime('now'))`),
28356
+ createdAt: text("created_at").notNull().default(sql17`(datetime('now'))`),
28214
28357
  /** Identity of the agent or user that created this link. */
28215
28358
  createdBy: text("created_by")
28216
28359
  },
@@ -28225,7 +28368,7 @@ var init_provenance_orphans = __esm({
28225
28368
  });
28226
28369
 
28227
28370
  // packages/core/src/store/schema/provenance/pull-requests.ts
28228
- import { sql as sql17 } from "drizzle-orm";
28371
+ import { sql as sql18 } from "drizzle-orm";
28229
28372
  var PR_STATES, PR_LINK_SOURCES, PR_LINK_KINDS, pullRequests, prCommits, prTasks;
28230
28373
  var init_pull_requests = __esm({
28231
28374
  "packages/core/src/store/schema/provenance/pull-requests.ts"() {
@@ -28304,9 +28447,9 @@ var init_pull_requests = __esm({
28304
28447
  */
28305
28448
  projectHash: text("project_hash"),
28306
28449
  /** ISO-8601 timestamp when this row was first inserted into tasks.db. */
28307
- createdAt: text("created_at").notNull().default(sql17`(datetime('now'))`),
28450
+ createdAt: text("created_at").notNull().default(sql18`(datetime('now'))`),
28308
28451
  /** ISO-8601 timestamp of the last update to this row. */
28309
- updatedAt: text("updated_at").notNull().default(sql17`(datetime('now'))`)
28452
+ updatedAt: text("updated_at").notNull().default(sql18`(datetime('now'))`)
28310
28453
  },
28311
28454
  (table) => [
28312
28455
  index("idx_pr_number").on(table.prNumber),
@@ -28353,7 +28496,7 @@ var init_pull_requests = __esm({
28353
28496
  */
28354
28497
  linkKind: text("link_kind").notNull(),
28355
28498
  /** ISO-8601 timestamp when this link was created. */
28356
- createdAt: text("created_at").notNull().default(sql17`(datetime('now'))`)
28499
+ createdAt: text("created_at").notNull().default(sql18`(datetime('now'))`)
28357
28500
  },
28358
28501
  (table) => [
28359
28502
  primaryKey({ columns: [table.prId, table.taskId, table.linkKind] }),
@@ -28366,7 +28509,7 @@ var init_pull_requests = __esm({
28366
28509
  });
28367
28510
 
28368
28511
  // packages/core/src/store/schema/provenance/releases.ts
28369
- import { sql as sql18 } from "drizzle-orm";
28512
+ import { sql as sql19 } from "drizzle-orm";
28370
28513
  var RELEASE_SCHEMES, RELEASE_CHANNELS, RELEASE_KINDS, RELEASE_STATUSES, RELEASE_CHANGE_TYPES, RELEASE_IMPACTS, RELEASE_CLASSIFIED_BY, RELEASE_ARTIFACT_TYPES, BRAIN_RELEASE_LINK_TYPES, releases, releaseCommits, releaseChanges, releaseChangesets, releaseArtifacts, brainReleaseLinks;
28371
28514
  var init_releases = __esm({
28372
28515
  "packages/core/src/store/schema/provenance/releases.ts"() {
@@ -28476,7 +28619,7 @@ var init_releases = __esm({
28476
28619
  /** URL of the GitHub Actions workflow run that built and published this release. */
28477
28620
  workflowRunUrl: text("workflow_run_url"),
28478
28621
  /** ISO-8601 timestamp when this row was inserted. */
28479
- createdAt: text("created_at").notNull().default(sql18`(datetime('now'))`),
28622
+ createdAt: text("created_at").notNull().default(sql19`(datetime('now'))`),
28480
28623
  /** ISO-8601 timestamp when `cleo release plan` created the plan (new pipeline). */
28481
28624
  plannedAt: text("planned_at"),
28482
28625
  /** ISO-8601 timestamp when the bump-PR was opened (new pipeline). */
@@ -28598,7 +28741,7 @@ var init_releases = __esm({
28598
28741
  */
28599
28742
  classifiedBy: text("classified_by", { enum: RELEASE_CLASSIFIED_BY }).notNull().default("auto"),
28600
28743
  /** ISO-8601 timestamp when this change was classified. */
28601
- classifiedAt: text("classified_at").notNull().default(sql18`(datetime('now'))`)
28744
+ classifiedAt: text("classified_at").notNull().default(sql19`(datetime('now'))`)
28602
28745
  },
28603
28746
  (table) => [
28604
28747
  index("idx_release_changes_release_id").on(table.releaseId),
@@ -28629,7 +28772,7 @@ var init_releases = __esm({
28629
28772
  /** Migration note when `kind = 'breaking'`, nullable. */
28630
28773
  breaking: text("breaking"),
28631
28774
  /** ISO-8601 timestamp when this row was inserted. */
28632
- createdAt: text("created_at").notNull().default(sql18`(datetime('now'))`)
28775
+ createdAt: text("created_at").notNull().default(sql19`(datetime('now'))`)
28633
28776
  },
28634
28777
  (table) => [
28635
28778
  index("release_changesets_release_id_idx").on(table.releaseId),
@@ -28684,7 +28827,7 @@ var init_releases = __esm({
28684
28827
  */
28685
28828
  linkType: text("link_type", { enum: BRAIN_RELEASE_LINK_TYPES }).notNull(),
28686
28829
  /** ISO-8601 timestamp when this link was created. */
28687
- createdAt: text("created_at").notNull().default(sql18`(datetime('now'))`),
28830
+ createdAt: text("created_at").notNull().default(sql19`(datetime('now'))`),
28688
28831
  /** Identifier of the agent or user that created this link. Nullable. */
28689
28832
  createdBy: text("created_by")
28690
28833
  },
@@ -28699,7 +28842,7 @@ var init_releases = __esm({
28699
28842
  });
28700
28843
 
28701
28844
  // packages/core/src/store/schema/cleo-project/provenance-rest.ts
28702
- import { sql as sql19 } from "drizzle-orm";
28845
+ import { sql as sql20 } from "drizzle-orm";
28703
28846
  var tasksPullRequests, tasksPrCommits, tasksPrTasks, tasksReleases, tasksReleaseCommits, tasksReleaseChanges, tasksReleaseChangesets, tasksReleaseArtifacts;
28704
28847
  var init_provenance_rest = __esm({
28705
28848
  "packages/core/src/store/schema/cleo-project/provenance-rest.ts"() {
@@ -28748,9 +28891,9 @@ var init_provenance_rest = __esm({
28748
28891
  /** Project correlation hash. */
28749
28892
  projectHash: text("project_hash"),
28750
28893
  /** ISO-8601 UTC creation instant (canonical TEXT, §4). */
28751
- createdAt: text("created_at").notNull().default(sql19`(datetime('now'))`),
28894
+ createdAt: text("created_at").notNull().default(sql20`(datetime('now'))`),
28752
28895
  /** ISO-8601 UTC last-update instant (canonical TEXT, §4). */
28753
- updatedAt: text("updated_at").notNull().default(sql19`(datetime('now'))`)
28896
+ updatedAt: text("updated_at").notNull().default(sql20`(datetime('now'))`)
28754
28897
  },
28755
28898
  (table) => [
28756
28899
  index("idx_tasks_pull_requests_pr_number").on(table.prNumber),
@@ -28790,7 +28933,7 @@ var init_provenance_rest = __esm({
28790
28933
  /** Relationship classification — E10 §5b CHECK-backed via {@link PR_LINK_KINDS}. */
28791
28934
  linkKind: text("link_kind", { enum: PR_LINK_KINDS }).notNull(),
28792
28935
  /** ISO-8601 UTC creation instant (canonical TEXT, §4). */
28793
- createdAt: text("created_at").notNull().default(sql19`(datetime('now'))`)
28936
+ createdAt: text("created_at").notNull().default(sql20`(datetime('now'))`)
28794
28937
  },
28795
28938
  (table) => [
28796
28939
  primaryKey({ columns: [table.prId, table.taskId, table.linkKind] }),
@@ -28825,7 +28968,7 @@ var init_provenance_rest = __esm({
28825
28968
  /** GitHub Actions workflow run URL. */
28826
28969
  workflowRunUrl: text("workflow_run_url"),
28827
28970
  /** ISO-8601 UTC creation instant (canonical TEXT, §4). */
28828
- createdAt: text("created_at").notNull().default(sql19`(datetime('now'))`),
28971
+ createdAt: text("created_at").notNull().default(sql20`(datetime('now'))`),
28829
28972
  /** ISO-8601 UTC planned instant (canonical TEXT, §4). */
28830
28973
  plannedAt: text("planned_at"),
28831
28974
  /** ISO-8601 UTC PR-opened instant (canonical TEXT, §4). */
@@ -28919,7 +29062,7 @@ var init_provenance_rest = __esm({
28919
29062
  /** Classification provenance — CHECK-backed via {@link RELEASE_CLASSIFIED_BY}. */
28920
29063
  classifiedBy: text("classified_by", { enum: RELEASE_CLASSIFIED_BY }).notNull().default("auto"),
28921
29064
  /** ISO-8601 UTC classification instant (canonical TEXT, §4). */
28922
- classifiedAt: text("classified_at").notNull().default(sql19`(datetime('now'))`)
29065
+ classifiedAt: text("classified_at").notNull().default(sql20`(datetime('now'))`)
28923
29066
  },
28924
29067
  (table) => [
28925
29068
  index("idx_tasks_release_changes_release_id").on(table.releaseId),
@@ -28950,7 +29093,7 @@ var init_provenance_rest = __esm({
28950
29093
  /** Breaking-change migration note. */
28951
29094
  breaking: text("breaking"),
28952
29095
  /** ISO-8601 UTC creation instant (canonical TEXT, §4). */
28953
- createdAt: text("created_at").notNull().default(sql19`(datetime('now'))`)
29096
+ createdAt: text("created_at").notNull().default(sql20`(datetime('now'))`)
28954
29097
  },
28955
29098
  (table) => [
28956
29099
  index("idx_tasks_release_changesets_release_id").on(table.releaseId),
@@ -28987,7 +29130,7 @@ var init_provenance_rest = __esm({
28987
29130
  });
28988
29131
 
28989
29132
  // packages/core/src/store/schema/agent-schema.ts
28990
- import { sql as sql20 } from "drizzle-orm";
29133
+ import { sql as sql21 } from "drizzle-orm";
28991
29134
  var AGENT_INSTANCE_STATUSES2, AGENT_TYPES2, agentInstances, agentErrorLog;
28992
29135
  var init_agent_schema = __esm({
28993
29136
  "packages/core/src/store/schema/agent-schema.ts"() {
@@ -29024,8 +29167,8 @@ var init_agent_schema = __esm({
29024
29167
  // cross-db-annotation-ok: intra-DB FK to tasks.sessions.id (no .references() because the row may pre-date the session being created)
29025
29168
  taskId: text("task_id"),
29026
29169
  // cross-db-annotation-ok: intra-DB FK to tasks.tasks.id (no .references() because agent may not be bound to any task)
29027
- startedAt: text("started_at").notNull().default(sql20`(datetime('now'))`),
29028
- lastHeartbeat: text("last_heartbeat").notNull().default(sql20`(datetime('now'))`),
29170
+ startedAt: text("started_at").notNull().default(sql21`(datetime('now'))`),
29171
+ lastHeartbeat: text("last_heartbeat").notNull().default(sql21`(datetime('now'))`),
29029
29172
  stoppedAt: text("stopped_at"),
29030
29173
  errorCount: integer("error_count").notNull().default(0),
29031
29174
  totalTasksCompleted: integer("total_tasks_completed").notNull().default(0),
@@ -29054,7 +29197,7 @@ var init_agent_schema = __esm({
29054
29197
  }).notNull(),
29055
29198
  message: text("message").notNull(),
29056
29199
  stack: text("stack"),
29057
- occurredAt: text("occurred_at").notNull().default(sql20`(datetime('now'))`),
29200
+ occurredAt: text("occurred_at").notNull().default(sql21`(datetime('now'))`),
29058
29201
  resolved: integer("resolved", { mode: "boolean" }).notNull().default(false)
29059
29202
  },
29060
29203
  (table) => [
@@ -29067,7 +29210,7 @@ var init_agent_schema = __esm({
29067
29210
  });
29068
29211
 
29069
29212
  // packages/core/src/store/schema/chain-schema.ts
29070
- import { sql as sql21 } from "drizzle-orm";
29213
+ import { sql as sql22 } from "drizzle-orm";
29071
29214
  var WARP_CHAIN_INSTANCE_STATUSES, warpChains, warpChainInstances;
29072
29215
  var init_chain_schema = __esm({
29073
29216
  "packages/core/src/store/schema/chain-schema.ts"() {
@@ -29090,8 +29233,8 @@ var init_chain_schema = __esm({
29090
29233
  definition: text("definition").notNull(),
29091
29234
  // JSON-serialized WarpChain
29092
29235
  validated: integer("validated", { mode: "boolean" }).default(false),
29093
- createdAt: text("created_at").default(sql21`(datetime('now'))`),
29094
- updatedAt: text("updated_at").default(sql21`(datetime('now'))`)
29236
+ createdAt: text("created_at").default(sql22`(datetime('now'))`),
29237
+ updatedAt: text("updated_at").default(sql22`(datetime('now'))`)
29095
29238
  },
29096
29239
  (table) => [index("idx_warp_chains_name").on(table.name)]
29097
29240
  );
@@ -29109,8 +29252,8 @@ var init_chain_schema = __esm({
29109
29252
  currentStage: text("current_stage"),
29110
29253
  gateResults: text("gate_results"),
29111
29254
  // JSON array of GateResult
29112
- createdAt: text("created_at").default(sql21`(datetime('now'))`),
29113
- updatedAt: text("updated_at").default(sql21`(datetime('now'))`)
29255
+ createdAt: text("created_at").default(sql22`(datetime('now'))`),
29256
+ updatedAt: text("updated_at").default(sql22`(datetime('now'))`)
29114
29257
  },
29115
29258
  (table) => [
29116
29259
  index("idx_warp_instances_chain").on(table.chainId),
@@ -29122,7 +29265,7 @@ var init_chain_schema = __esm({
29122
29265
  });
29123
29266
 
29124
29267
  // packages/core/src/store/schema/cleo-project/runtime.ts
29125
- import { sql as sql22 } from "drizzle-orm";
29268
+ import { sql as sql23 } from "drizzle-orm";
29126
29269
  var AGENT_ERROR_TYPES, PLAYBOOK_RUN_STATUSES, PLAYBOOK_APPROVAL_STATUSES, tasksWarpChains, tasksWarpChainInstances, tasksAgentInstances, tasksAgentErrorLog, tasksPlaybookRuns, tasksPlaybookApprovals;
29127
29270
  var init_runtime = __esm({
29128
29271
  "packages/core/src/store/schema/cleo-project/runtime.ts"() {
@@ -29159,9 +29302,9 @@ var init_runtime = __esm({
29159
29302
  /** Whether the definition validated. §3a boolean — already typed, preserved. */
29160
29303
  validated: integer("validated", { mode: "boolean" }).default(false),
29161
29304
  /** ISO-8601 UTC creation instant (canonical TEXT, §4). */
29162
- createdAt: text("created_at").default(sql22`(datetime('now'))`),
29305
+ createdAt: text("created_at").default(sql23`(datetime('now'))`),
29163
29306
  /** ISO-8601 UTC last-update instant (canonical TEXT, §4). */
29164
- updatedAt: text("updated_at").default(sql22`(datetime('now'))`)
29307
+ updatedAt: text("updated_at").default(sql23`(datetime('now'))`)
29165
29308
  },
29166
29309
  (table) => [index("idx_tasks_warp_chains_name").on(table.name)]
29167
29310
  );
@@ -29185,9 +29328,9 @@ var init_runtime = __esm({
29185
29328
  /** JSON array of gate results (TEXT per JSON audit). */
29186
29329
  gateResults: text("gate_results"),
29187
29330
  /** ISO-8601 UTC creation instant (canonical TEXT, §4). */
29188
- createdAt: text("created_at").default(sql22`(datetime('now'))`),
29331
+ createdAt: text("created_at").default(sql23`(datetime('now'))`),
29189
29332
  /** ISO-8601 UTC last-update instant (canonical TEXT, §4). */
29190
- updatedAt: text("updated_at").default(sql22`(datetime('now'))`)
29333
+ updatedAt: text("updated_at").default(sql23`(datetime('now'))`)
29191
29334
  },
29192
29335
  (table) => [
29193
29336
  index("idx_tasks_warp_chain_instances_chain").on(table.chainId),
@@ -29209,9 +29352,9 @@ var init_runtime = __esm({
29209
29352
  /** Intra-DB soft ref → `tasks_tasks.id`. */
29210
29353
  taskId: text("task_id"),
29211
29354
  /** ISO-8601 UTC start instant (canonical TEXT, §4). */
29212
- startedAt: text("started_at").notNull().default(sql22`(datetime('now'))`),
29355
+ startedAt: text("started_at").notNull().default(sql23`(datetime('now'))`),
29213
29356
  /** ISO-8601 UTC last-heartbeat instant (canonical TEXT, §4). */
29214
- lastHeartbeat: text("last_heartbeat").notNull().default(sql22`(datetime('now'))`),
29357
+ lastHeartbeat: text("last_heartbeat").notNull().default(sql23`(datetime('now'))`),
29215
29358
  /** ISO-8601 UTC stop instant (canonical TEXT, §4). */
29216
29359
  stoppedAt: text("stopped_at"),
29217
29360
  /** Error count. */
@@ -29248,7 +29391,7 @@ var init_runtime = __esm({
29248
29391
  /** Optional stack trace. */
29249
29392
  stack: text("stack"),
29250
29393
  /** ISO-8601 UTC occurrence instant (canonical TEXT, §4). */
29251
- occurredAt: text("occurred_at").notNull().default(sql22`(datetime('now'))`),
29394
+ occurredAt: text("occurred_at").notNull().default(sql23`(datetime('now'))`),
29252
29395
  /** Whether the error was resolved. §3a boolean — already typed, preserved. */
29253
29396
  resolved: integer("resolved", { mode: "boolean" }).notNull().default(false)
29254
29397
  },
@@ -29280,7 +29423,7 @@ var init_runtime = __esm({
29280
29423
  /** Optional session id (cross-table soft ref → `tasks_sessions.id`). */
29281
29424
  sessionId: text("session_id"),
29282
29425
  /** ISO-8601 UTC start instant (canonical TEXT, §4). */
29283
- startedAt: text("started_at").notNull().default(sql22`(datetime('now'))`),
29426
+ startedAt: text("started_at").notNull().default(sql23`(datetime('now'))`),
29284
29427
  /** ISO-8601 UTC completion instant (canonical TEXT, §4). */
29285
29428
  completedAt: text("completed_at")
29286
29429
  });
@@ -29294,7 +29437,7 @@ var init_runtime = __esm({
29294
29437
  /** HMAC resume token (unique). */
29295
29438
  token: text("token").notNull().unique(),
29296
29439
  /** ISO-8601 UTC request instant (canonical TEXT, §4). */
29297
- requestedAt: text("requested_at").notNull().default(sql22`(datetime('now'))`),
29440
+ requestedAt: text("requested_at").notNull().default(sql23`(datetime('now'))`),
29298
29441
  /** ISO-8601 UTC approval instant (canonical TEXT, §4). */
29299
29442
  approvedAt: text("approved_at"),
29300
29443
  /** Approver identity. */
@@ -29318,7 +29461,7 @@ import {
29318
29461
  TASK_SEVERITIES as TASK_SEVERITIES3,
29319
29462
  TASK_SIZES as TASK_SIZES3
29320
29463
  } from "@cleocode/contracts/enums";
29321
- import { sql as sql23 } from "drizzle-orm";
29464
+ import { sql as sql24 } from "drizzle-orm";
29322
29465
  var TASK_AC_KINDS, tasksTasks, tasksTaskAcceptanceCriteria, tasksAcceptanceProjectionState, tasksAcceptanceProjectionDirty, tasksTaskDependencies, tasksTaskRelations, tasksSessions, tasksSessionHandoffEntries, tasksTaskWorkHistory, tasksTaskAcceptanceCriteriaHistory, tasksExternalTaskLinks;
29323
29466
  var init_tasks_core = __esm({
29324
29467
  "packages/core/src/store/schema/cleo-project/tasks-core.ts"() {
@@ -29377,7 +29520,7 @@ var init_tasks_core = __esm({
29377
29520
  /** Whether auto-complete is suppressed. §3a boolean — already typed, preserved. */
29378
29521
  noAutoComplete: integer("no_auto_complete", { mode: "boolean" }),
29379
29522
  /** ISO-8601 UTC creation instant (canonical TEXT, §4). */
29380
- createdAt: text("created_at").notNull().default(sql23`(datetime('now'))`),
29523
+ createdAt: text("created_at").notNull().default(sql24`(datetime('now'))`),
29381
29524
  /** ISO-8601 UTC last-update instant (canonical TEXT, §4). */
29382
29525
  updatedAt: text("updated_at"),
29383
29526
  /** ISO-8601 UTC completion instant (canonical TEXT, §4). */
@@ -29433,7 +29576,7 @@ var init_tasks_core = __esm({
29433
29576
  index("idx_tasks_tasks_role").on(table.kind),
29434
29577
  index("idx_tasks_tasks_scope").on(table.scope),
29435
29578
  index("idx_tasks_tasks_role_status").on(table.kind, table.status),
29436
- index("idx_tasks_tasks_created_date").on(sql23`date(${table.createdAt})`),
29579
+ index("idx_tasks_tasks_created_date").on(sql24`date(${table.createdAt})`),
29437
29580
  unique("uq_tasks_tasks_idempotency_key").on(table.idempotencyKey)
29438
29581
  ]
29439
29582
  );
@@ -29459,7 +29602,7 @@ var init_tasks_core = __esm({
29459
29602
  /** The AC statement. */
29460
29603
  text: text("text").notNull(),
29461
29604
  /** ISO-8601 UTC creation instant (canonical TEXT, §4). */
29462
- createdAt: text("created_at").notNull().default(sql23`(CURRENT_TIMESTAMP)`),
29605
+ createdAt: text("created_at").notNull().default(sql24`(CURRENT_TIMESTAMP)`),
29463
29606
  /** ISO-8601 UTC last-edit instant (canonical TEXT, §4). */
29464
29607
  updatedAt: text("updated_at"),
29465
29608
  /** Optional sha256(text) drift snapshot. */
@@ -29488,7 +29631,7 @@ var init_tasks_core = __esm({
29488
29631
  /** Source frontier fingerprint. */
29489
29632
  sourceFingerprint: text("source_fingerprint"),
29490
29633
  /** ISO-8601 UTC creation instant (canonical TEXT, §4). */
29491
- createdAt: text("created_at").notNull().default(sql23`(CURRENT_TIMESTAMP)`),
29634
+ createdAt: text("created_at").notNull().default(sql24`(CURRENT_TIMESTAMP)`),
29492
29635
  /** ISO-8601 UTC last-update instant (canonical TEXT, §4). */
29493
29636
  updatedAt: text("updated_at")
29494
29637
  },
@@ -29512,7 +29655,7 @@ var init_tasks_core = __esm({
29512
29655
  /** ISO-8601 UTC source-update that triggered this (canonical TEXT, §4). */
29513
29656
  sourceUpdatedAt: text("source_updated_at"),
29514
29657
  /** ISO-8601 UTC queue-insertion instant (canonical TEXT, §4). */
29515
- queuedAt: text("queued_at").notNull().default(sql23`(CURRENT_TIMESTAMP)`),
29658
+ queuedAt: text("queued_at").notNull().default(sql24`(CURRENT_TIMESTAMP)`),
29516
29659
  /** JSON producer context (TEXT per JSON audit). */
29517
29660
  payloadJson: text("payload_json")
29518
29661
  },
@@ -29585,7 +29728,7 @@ var init_tasks_core = __esm({
29585
29728
  /** JSON handoff payload (TEXT per JSON audit). */
29586
29729
  handoffJson: text("handoff_json"),
29587
29730
  /** ISO-8601 UTC start instant (canonical TEXT, §4). */
29588
- startedAt: text("started_at").notNull().default(sql23`(datetime('now'))`),
29731
+ startedAt: text("started_at").notNull().default(sql24`(datetime('now'))`),
29589
29732
  /** ISO-8601 UTC end instant (canonical TEXT, §4). */
29590
29733
  endedAt: text("ended_at"),
29591
29734
  /** Previous session pointer (self-FK). */
@@ -29647,7 +29790,7 @@ var init_tasks_core = __esm({
29647
29790
  /** Serialised handoff/debrief JSON (TEXT per JSON audit). */
29648
29791
  handoffJson: text("handoff_json").notNull(),
29649
29792
  /** ISO-8601 UTC creation instant (canonical TEXT, §4). */
29650
- createdAt: text("created_at").notNull().default(sql23`(datetime('now'))`)
29793
+ createdAt: text("created_at").notNull().default(sql24`(datetime('now'))`)
29651
29794
  },
29652
29795
  (table) => [index("idx_tasks_session_handoff_entries_session_id").on(table.sessionId)]
29653
29796
  );
@@ -29661,7 +29804,7 @@ var init_tasks_core = __esm({
29661
29804
  /** FK → `tasks_tasks.id`. ON DELETE CASCADE. */
29662
29805
  taskId: text("task_id").notNull().references(() => tasksTasks.id, { onDelete: "cascade" }),
29663
29806
  /** ISO-8601 UTC set instant (canonical TEXT, §4). */
29664
- setAt: text("set_at").notNull().default(sql23`(datetime('now'))`),
29807
+ setAt: text("set_at").notNull().default(sql24`(datetime('now'))`),
29665
29808
  /** ISO-8601 UTC cleared instant (canonical TEXT, §4). */
29666
29809
  clearedAt: text("cleared_at")
29667
29810
  },
@@ -29675,7 +29818,7 @@ var init_tasks_core = __esm({
29675
29818
  /** AC id this row records (NOT an FK — survives AC deletion). */
29676
29819
  acId: text("ac_id").notNull(),
29677
29820
  /** ISO-8601 UTC record instant (canonical TEXT, §4). */
29678
- recordedAt: text("recorded_at").notNull().default(sql23`(datetime('now'))`),
29821
+ recordedAt: text("recorded_at").notNull().default(sql24`(datetime('now'))`),
29679
29822
  /** AC text BEFORE this change. */
29680
29823
  previousText: text("previous_text").notNull(),
29681
29824
  /**
@@ -29689,7 +29832,7 @@ var init_tasks_core = __esm({
29689
29832
  (table) => [
29690
29833
  index("idx_tasks_task_acceptance_criteria_history_ac_id_recorded_at").on(
29691
29834
  table.acId,
29692
- sql23`${table.recordedAt} desc`
29835
+ sql24`${table.recordedAt} desc`
29693
29836
  )
29694
29837
  ]
29695
29838
  );
@@ -29715,7 +29858,7 @@ var init_tasks_core = __esm({
29715
29858
  /** JSON provider metadata (TEXT per JSON audit; empty-object default). */
29716
29859
  metadataJson: text("metadata_json").default("{}"),
29717
29860
  /** ISO-8601 UTC link-creation instant (canonical TEXT, §4). */
29718
- linkedAt: text("linked_at").notNull().default(sql23`(datetime('now'))`),
29861
+ linkedAt: text("linked_at").notNull().default(sql24`(datetime('now'))`),
29719
29862
  /** ISO-8601 UTC last-sync instant (canonical TEXT, §4). */
29720
29863
  lastSyncAt: text("last_sync_at")
29721
29864
  },
@@ -29782,7 +29925,7 @@ var init_background_jobs = __esm({
29782
29925
  });
29783
29926
 
29784
29927
  // packages/core/src/store/schema/evidence-bindings.ts
29785
- import { sql as sql24 } from "drizzle-orm";
29928
+ import { sql as sql25 } from "drizzle-orm";
29786
29929
  var EVIDENCE_BINDING_TYPES, evidenceAcBindings;
29787
29930
  var init_evidence_bindings = __esm({
29788
29931
  "packages/core/src/store/schema/evidence-bindings.ts"() {
@@ -29807,7 +29950,7 @@ var init_evidence_bindings = __esm({
29807
29950
  enum: EVIDENCE_BINDING_TYPES
29808
29951
  }).notNull(),
29809
29952
  /** ISO-8601 timestamp of binding creation. */
29810
- createdAt: text("created_at").notNull().default(sql24`(datetime('now'))`)
29953
+ createdAt: text("created_at").notNull().default(sql25`(datetime('now'))`)
29811
29954
  },
29812
29955
  (table) => [
29813
29956
  // One binding per atom/ac/type triple — idempotent re-inserts collapse.
@@ -29826,7 +29969,7 @@ var init_evidence_bindings = __esm({
29826
29969
  });
29827
29970
 
29828
29971
  // packages/core/src/store/schema/cleo-project/tasks-core-batch2.ts
29829
- import { sql as sql25 } from "drizzle-orm";
29972
+ import { sql as sql26 } from "drizzle-orm";
29830
29973
  var tasksBackgroundJobs, tasksExperiments, tasksEvidenceAcBindings, tasksTaskLabels;
29831
29974
  var init_tasks_core_batch2 = __esm({
29832
29975
  "packages/core/src/store/schema/cleo-project/tasks-core-batch2.ts"() {
@@ -29844,7 +29987,7 @@ var init_tasks_core_batch2 = __esm({
29844
29987
  /** Current lifecycle status — CHECK-backed via {@link BACKGROUND_JOB_STATUSES}. */
29845
29988
  status: text("status", { enum: BACKGROUND_JOB_STATUSES }).notNull().default("pending"),
29846
29989
  /** ISO-8601 UTC creation instant (was ms epoch, §4 / §8.1). */
29847
- startedAt: text("started_at").notNull().default(sql25`(datetime('now'))`),
29990
+ startedAt: text("started_at").notNull().default(sql26`(datetime('now'))`),
29848
29991
  /** ISO-8601 UTC completion instant; NULL while running (was ms epoch, §4). */
29849
29992
  completedAt: text("completed_at"),
29850
29993
  /** JSON-serialised result payload; NULL on failure or while running (TEXT). */
@@ -29854,7 +29997,7 @@ var init_tasks_core_batch2 = __esm({
29854
29997
  /** Execution progress 0-100; NULL until progress is reported. */
29855
29998
  progress: integer("progress"),
29856
29999
  /** ISO-8601 UTC last-heartbeat instant (was ms epoch, §4 / §8.1). */
29857
- heartbeatAt: text("heartbeat_at").notNull().default(sql25`(datetime('now'))`),
30000
+ heartbeatAt: text("heartbeat_at").notNull().default(sql26`(datetime('now'))`),
29858
30001
  /** Agent or session ID that claimed this job; NULL if unclaimed. */
29859
30002
  claimedBy: text("claimed_by"),
29860
30003
  /**
@@ -29906,7 +30049,7 @@ var init_tasks_core_batch2 = __esm({
29906
30049
  /** One of {direct, satisfies, coverage} — CHECK-backed via {@link EVIDENCE_BINDING_TYPES}. */
29907
30050
  bindingType: text("binding_type", { enum: EVIDENCE_BINDING_TYPES }).notNull(),
29908
30051
  /** ISO-8601 UTC binding-creation instant (already canonical TEXT, §4). */
29909
- createdAt: text("created_at").notNull().default(sql25`(datetime('now'))`)
30052
+ createdAt: text("created_at").notNull().default(sql26`(datetime('now'))`)
29910
30053
  },
29911
30054
  (table) => [
29912
30055
  uniqueIndex("uq_tasks_evidence_ac_bindings_atom_ac_type").on(
@@ -30074,7 +30217,7 @@ var init_cleo_project = __esm({
30074
30217
  });
30075
30218
 
30076
30219
  // packages/core/src/store/schema/cleo-global/agent-registry.ts
30077
- import { sql as sql26 } from "drizzle-orm";
30220
+ import { sql as sql27 } from "drizzle-orm";
30078
30221
  var AGENT_REGISTRY_USER_ROLES, AGENT_REGISTRY_AGENT_STATUSES, agentRegistryUsers, agentRegistryOrganization, agentRegistryAgents, agentRegistryClaimCodes, agentRegistryCapabilities, agentRegistrySkills, agentRegistryAgentCapabilities, agentRegistryAgentSkills, agentRegistryAgentConnections, agentRegistryAccounts, agentRegistrySessions, agentRegistryVerifications, agentRegistryOrgAgentKeys;
30079
30222
  var init_agent_registry = __esm({
30080
30223
  "packages/core/src/store/schema/cleo-global/agent-registry.ts"() {
@@ -30140,9 +30283,9 @@ var init_agent_registry = __esm({
30140
30283
  /** Owner user id (soft FK → agent_registry_users.id). */
30141
30284
  ownerId: text("owner_id"),
30142
30285
  /** ISO-8601 UTC creation instant (E10 §4: epoch → TEXT ISO8601). */
30143
- createdAt: text("created_at").notNull().default(sql26`(datetime('now'))`),
30286
+ createdAt: text("created_at").notNull().default(sql27`(datetime('now'))`),
30144
30287
  /** ISO-8601 UTC last-update instant (E10 §4: epoch → TEXT ISO8601). */
30145
- updatedAt: text("updated_at").notNull().default(sql26`(datetime('now'))`)
30288
+ updatedAt: text("updated_at").notNull().default(sql27`(datetime('now'))`)
30146
30289
  },
30147
30290
  (table) => [index("idx_agent_registry_organization_slug").on(table.slug)]
30148
30291
  );
@@ -30315,7 +30458,7 @@ var init_agent_registry = __esm({
30315
30458
  /** Skill-attachment provenance (cant / manual / computed). */
30316
30459
  source: text("source").notNull().default("manual"),
30317
30460
  /** ISO-8601 UTC attachment instant (already canonical TEXT, §4). */
30318
- attachedAt: text("attached_at").notNull().default(sql26`(datetime('now'))`)
30461
+ attachedAt: text("attached_at").notNull().default(sql27`(datetime('now'))`)
30319
30462
  },
30320
30463
  (table) => [
30321
30464
  primaryKey({ columns: [table.agentId, table.skillId] }),
@@ -30453,7 +30596,7 @@ var init_agent_registry = __esm({
30453
30596
  });
30454
30597
 
30455
30598
  // packages/core/src/store/schema/cleo-global/nexus.ts
30456
- import { sql as sql27 } from "drizzle-orm";
30599
+ import { sql as sql28 } from "drizzle-orm";
30457
30600
  var SIGIL_ROLES, nexusProjectRegistry, nexusProjectIdAliases, nexusAuditLog, nexusSchemaMeta, nexusUserProfile, nexusSigils;
30458
30601
  var init_nexus2 = __esm({
30459
30602
  "packages/core/src/store/schema/cleo-global/nexus.ts"() {
@@ -30481,9 +30624,9 @@ var init_nexus2 = __esm({
30481
30624
  /** Human-readable project name. */
30482
30625
  name: text("name").notNull(),
30483
30626
  /** ISO-8601 UTC registration instant (canonical TEXT, §4). */
30484
- registeredAt: text("registered_at").notNull().default(sql27`(datetime('now'))`),
30627
+ registeredAt: text("registered_at").notNull().default(sql28`(datetime('now'))`),
30485
30628
  /** ISO-8601 UTC last-seen instant (canonical TEXT, §4). */
30486
- lastSeen: text("last_seen").notNull().default(sql27`(datetime('now'))`),
30629
+ lastSeen: text("last_seen").notNull().default(sql28`(datetime('now'))`),
30487
30630
  /** Health status string (e.g. "healthy", "warning", "unknown"). */
30488
30631
  healthStatus: text("health_status").notNull().default("unknown"),
30489
30632
  /** ISO-8601 UTC last health-check instant; NULL until first check. */
@@ -30491,7 +30634,7 @@ var init_nexus2 = __esm({
30491
30634
  /** Permission level ("read" / "write"). */
30492
30635
  permissions: text("permissions").notNull().default("read"),
30493
30636
  /** ISO-8601 UTC last-sync instant (canonical TEXT, §4). */
30494
- lastSync: text("last_sync").notNull().default(sql27`(datetime('now'))`),
30637
+ lastSync: text("last_sync").notNull().default(sql28`(datetime('now'))`),
30495
30638
  /** Cached task count for the project. */
30496
30639
  taskCount: integer("task_count").notNull().default(0),
30497
30640
  /** JSON array of project labels (serialized TEXT per JSON-Column Audit). */
@@ -30520,7 +30663,7 @@ var init_nexus2 = __esm({
30520
30663
  /** Canonical 12-hex-char ID this alias maps to (soft FK → nexus_project_registry). */
30521
30664
  canonicalId: text("canonical_id").notNull(),
30522
30665
  /** ISO-8601 UTC creation instant (canonical TEXT, §4). */
30523
- createdAt: text("created_at").notNull().default(sql27`(datetime('now'))`)
30666
+ createdAt: text("created_at").notNull().default(sql28`(datetime('now'))`)
30524
30667
  },
30525
30668
  (table) => [index("idx_nexus_project_id_aliases_canonical").on(table.canonicalId)]
30526
30669
  );
@@ -30530,7 +30673,7 @@ var init_nexus2 = __esm({
30530
30673
  /** UUID primary key. */
30531
30674
  id: text("id").primaryKey(),
30532
30675
  /** ISO-8601 UTC instant of the audited operation (canonical TEXT, §4). */
30533
- timestamp: text("timestamp").notNull().default(sql27`(datetime('now'))`),
30676
+ timestamp: text("timestamp").notNull().default(sql28`(datetime('now'))`),
30534
30677
  /** Audited action name. */
30535
30678
  action: text("action").notNull(),
30536
30679
  /** Project hash context; NULL for global operations. */
@@ -30625,9 +30768,9 @@ var init_nexus2 = __esm({
30625
30768
  /** JSON-encoded capability flags object (serialized TEXT); NULL until set. */
30626
30769
  capabilityFlags: text("capability_flags"),
30627
30770
  /** ISO-8601 UTC creation instant (E10 §4: Drizzle-Date → TEXT ISO8601). */
30628
- createdAt: text("created_at").notNull().default(sql27`(datetime('now'))`),
30771
+ createdAt: text("created_at").notNull().default(sql28`(datetime('now'))`),
30629
30772
  /** ISO-8601 UTC last-update instant (E10 §4: Drizzle-Date → TEXT ISO8601). */
30630
- updatedAt: text("updated_at").notNull().default(sql27`(datetime('now'))`)
30773
+ updatedAt: text("updated_at").notNull().default(sql28`(datetime('now'))`)
30631
30774
  },
30632
30775
  (table) => [
30633
30776
  index("idx_nexus_sigils_display_name").on(table.displayName),
@@ -30638,7 +30781,7 @@ var init_nexus2 = __esm({
30638
30781
  });
30639
30782
 
30640
30783
  // packages/core/src/store/schema/cleo-global/skills.ts
30641
- import { sql as sql28 } from "drizzle-orm";
30784
+ import { sql as sql29 } from "drizzle-orm";
30642
30785
  var SKILL_SOURCE_TYPES, SKILL_LIFECYCLE_STATES, SKILL_REVIEW_OUTCOMES, SKILL_PATCH_STATUSES, skillsSkills, skillsSkillUsage, skillsSkillReviews, skillsSkillPatches;
30643
30786
  var init_skills2 = __esm({
30644
30787
  "packages/core/src/store/schema/cleo-global/skills.ts"() {
@@ -30693,7 +30836,7 @@ var init_skills2 = __esm({
30693
30836
  /** Logical FK to {@link skillsSkills}.name — denormalised for query speed. */
30694
30837
  skillName: text("skill_name").notNull(),
30695
30838
  /** ISO-8601 wall-clock timestamp of the load/invoke event (canonical TEXT, §4). */
30696
- observedAt: text("observed_at").notNull().default(sql28`(datetime('now'))`),
30839
+ observedAt: text("observed_at").notNull().default(sql29`(datetime('now'))`),
30697
30840
  /** Event kind — `load`, `invoke`, `error`, etc. */
30698
30841
  eventKind: text("event_kind").notNull(),
30699
30842
  /**
@@ -30733,7 +30876,7 @@ var init_skills2 = __esm({
30733
30876
  /** Logical FK to {@link skillsSkills}.name. */
30734
30877
  skillName: text("skill_name").notNull(),
30735
30878
  /** ISO-8601 timestamp of the review (canonical TEXT, §4). */
30736
- reviewedAt: text("reviewed_at").notNull().default(sql28`(datetime('now'))`),
30879
+ reviewedAt: text("reviewed_at").notNull().default(sql29`(datetime('now'))`),
30737
30880
  /** Outcome verdict from {@link SKILL_REVIEW_OUTCOMES} (E10 §5a). */
30738
30881
  outcome: text("outcome", { enum: SKILL_REVIEW_OUTCOMES }).notNull(),
30739
30882
  /** Numeric grade (0-100); NULL if review was council-only. */
@@ -30756,7 +30899,7 @@ var init_skills2 = __esm({
30756
30899
  /** Logical FK to {@link skillsSkills}.name. */
30757
30900
  skillName: text("skill_name").notNull(),
30758
30901
  /** ISO-8601 timestamp the patch was proposed (canonical TEXT, §4). */
30759
- proposedAt: text("proposed_at").notNull().default(sql28`(datetime('now'))`),
30902
+ proposedAt: text("proposed_at").notNull().default(sql29`(datetime('now'))`),
30760
30903
  /** ISO-8601 timestamp the patch was applied; NULL while proposed (canonical TEXT, §4). */
30761
30904
  appliedAt: text("applied_at"),
30762
30905
  /** Logical FK to {@link skillsSkillReviews}.id that gated this patch. */
@@ -30777,7 +30920,7 @@ var init_skills2 = __esm({
30777
30920
  });
30778
30921
 
30779
30922
  // packages/core/src/store/schema/cleo-global/telemetry.ts
30780
- import { sql as sql29 } from "drizzle-orm";
30923
+ import { sql as sql30 } from "drizzle-orm";
30781
30924
  var telemetryEvents, telemetrySchemaMeta;
30782
30925
  var init_telemetry = __esm({
30783
30926
  "packages/core/src/store/schema/cleo-global/telemetry.ts"() {
@@ -30806,7 +30949,7 @@ var init_telemetry = __esm({
30806
30949
  /** Machine-readable error code when exit_code != 0. NULL on success. */
30807
30950
  errorCode: text("error_code"),
30808
30951
  /** ISO-8601 UTC instant of the invocation (canonical TEXT timestamp, §4). */
30809
- timestamp: text("timestamp").notNull().default(sql29`(datetime('now'))`)
30952
+ timestamp: text("timestamp").notNull().default(sql30`(datetime('now'))`)
30810
30953
  },
30811
30954
  (table) => [
30812
30955
  index("idx_telemetry_command").on(table.command),
@@ -33547,12 +33690,16 @@ __export(exodus_exports, {
33547
33690
  archiveStrandedResidue: () => archiveStrandedResidue,
33548
33691
  buildExodusHealth: () => buildExodusHealth,
33549
33692
  buildExodusPlan: () => buildExodusPlan,
33693
+ clearExodusAborts: () => clearExodusAborts,
33550
33694
  clearExodusJournal: () => clearExodusJournal,
33551
33695
  computeCountParity: () => computeCountParity,
33552
33696
  deriveStagingDirName: () => deriveStagingDirName,
33553
33697
  detectStrandedResidue: () => detectStrandedResidue,
33698
+ emitExodusAbort: () => emitExodusAbort,
33699
+ exodusAbortEvents: () => exodusAbortEvents,
33554
33700
  exodusArchiveDir: () => exodusArchiveDir,
33555
33701
  exodusMarkerPath: () => exodusMarkerPath,
33702
+ getRecordedExodusAbort: () => getRecordedExodusAbort,
33556
33703
  hasExodusCompleteMarker: () => hasExodusCompleteMarker,
33557
33704
  isDerivedOrInternalTable: () => isDerivedOrInternalTable,
33558
33705
  resolveConsolidatedTableName: () => resolveConsolidatedTableName,
@@ -33568,6 +33715,7 @@ __export(exodus_exports, {
33568
33715
  var init_exodus = __esm({
33569
33716
  "packages/core/src/store/exodus/index.ts"() {
33570
33717
  "use strict";
33718
+ init_abort_events();
33571
33719
  init_archive2();
33572
33720
  init_count_parity();
33573
33721
  init_health2();
@@ -33825,7 +33973,9 @@ var init_on_open = __esm({
33825
33973
  // packages/core/src/store/dual-scope-db.ts
33826
33974
  var dual_scope_db_exports = {};
33827
33975
  __export(dual_scope_db_exports, {
33976
+ ExodusAbortWriteUnsafeError: () => ExodusAbortWriteUnsafeError,
33828
33977
  _resetDualScopeDbCache: () => _resetDualScopeDbCache,
33978
+ assertWriteDurable: () => assertWriteDurable,
33829
33979
  insertIdempotent: () => insertIdempotent,
33830
33980
  openDualScopeDb: () => openDualScopeDb,
33831
33981
  openDualScopeDbAtPath: () => openDualScopeDbAtPath,
@@ -33835,6 +33985,17 @@ __export(dual_scope_db_exports, {
33835
33985
  import { existsSync as existsSync11, mkdirSync as mkdirSync3 } from "node:fs";
33836
33986
  import { createRequire as createRequire4 } from "node:module";
33837
33987
  import { dirname as dirname4, join as join10 } from "node:path";
33988
+ function assertWriteDurable(handle) {
33989
+ if (handle.exodusAbort) {
33990
+ throw new ExodusAbortWriteUnsafeError(handle.exodusAbort);
33991
+ }
33992
+ }
33993
+ function assertNoRecordedExodusAbort() {
33994
+ const detail = getRecordedExodusAbort();
33995
+ if (detail) {
33996
+ throw new ExodusAbortWriteUnsafeError(detail);
33997
+ }
33998
+ }
33838
33999
  function cacheKey(scope, dbPath) {
33839
34000
  return `${scope}::${dbPath}`;
33840
34001
  }
@@ -33974,13 +34135,25 @@ async function openDualScopeDbAtPath(scope, dbPath, exodusCwd, options) {
33974
34135
  const { maybeRunExodusOnOpen: maybeRunExodusOnOpen2 } = await Promise.resolve().then(() => (init_on_open(), on_open_exports));
33975
34136
  const result = await maybeRunExodusOnOpen2(scope, dbPath, nativeDb, exodusCwd);
33976
34137
  if (result.outcome === "migrated" || result.outcome === "aborted") {
34138
+ const reopened = scope === "project" ? await openDualScopeDbAtPath("project", dbPath) : await openDualScopeDbAtPath("global", dbPath);
33977
34139
  if (result.outcome === "aborted") {
34140
+ const abort = {
34141
+ scope,
34142
+ dbPath,
34143
+ reason: result.reason,
34144
+ at: Date.now()
34145
+ };
33978
34146
  log7.warn(
33979
34147
  { scope, reason: result.reason },
33980
- "exodus-on-open aborted; consolidated cleo.db left empty, legacy kept as source"
34148
+ "exodus-on-open aborted; consolidated cleo.db left empty, legacy kept as source \u2014 mutating callers must check handle.exodusAbort / call assertWriteDurable (T11828)"
33981
34149
  );
34150
+ const { emitExodusAbort: emitExodusAbort2 } = await Promise.resolve().then(() => (init_abort_events(), abort_events_exports));
34151
+ emitExodusAbort2(abort);
34152
+ return { ...reopened, exodusAbort: abort };
33982
34153
  }
33983
- return scope === "project" ? openDualScopeDbAtPath("project", dbPath) : openDualScopeDbAtPath("global", dbPath);
34154
+ const { clearExodusAborts: clearExodusAborts2 } = await Promise.resolve().then(() => (init_abort_events(), abort_events_exports));
34155
+ clearExodusAborts2(scope);
34156
+ return reopened;
33984
34157
  }
33985
34158
  } catch (err) {
33986
34159
  log7.warn(
@@ -34018,10 +34191,12 @@ function _resetDualScopeDbCache(scope) {
34018
34191
  }
34019
34192
  }
34020
34193
  async function insertIdempotent(db, table, row, _keyColumn) {
34194
+ assertNoRecordedExodusAbort();
34021
34195
  const result = await db.insert(table).values(row).onConflictDoNothing().returning();
34022
34196
  return result.length;
34023
34197
  }
34024
34198
  async function upsertIdempotent(db, table, row, _keyColumn, conflictTarget, set2) {
34199
+ assertNoRecordedExodusAbort();
34025
34200
  const updateSet = set2 ?? row;
34026
34201
  const result = await db.insert(table).values(row).onConflictDoUpdate({
34027
34202
  target: conflictTarget,
@@ -34030,15 +34205,35 @@ async function upsertIdempotent(db, table, row, _keyColumn, conflictTarget, set2
34030
34205
  }).returning();
34031
34206
  return result.length;
34032
34207
  }
34033
- var _cache, _require2, _drizzle, _DatabaseSyncCtor, _projectSchema, _globalSchema;
34208
+ var ExodusAbortWriteUnsafeError, _cache, _require2, _drizzle, _DatabaseSyncCtor, _projectSchema, _globalSchema;
34034
34209
  var init_dual_scope_db = __esm({
34035
34210
  "packages/core/src/store/dual-scope-db.ts"() {
34036
34211
  "use strict";
34037
34212
  init_logger2();
34038
34213
  init_paths();
34214
+ init_abort_events();
34039
34215
  init_migration_manager();
34040
34216
  init_resolve_migrations_folder();
34041
34217
  init_sqlite_pragmas();
34218
+ ExodusAbortWriteUnsafeError = class extends Error {
34219
+ /** Stable string error code for envelope `codeName` / log correlation. */
34220
+ codeName = "E_EXODUS_ABORT_WRITE_UNSAFE";
34221
+ /** The structured abort detail carried by the handle. */
34222
+ detail;
34223
+ /** Remediation hint surfaced to the operator. */
34224
+ fix;
34225
+ /**
34226
+ * @param detail - The {@link ExodusAbortDetail} stamped on the handle.
34227
+ */
34228
+ constructor(detail) {
34229
+ super(
34230
+ `Refusing to write to consolidated ${detail.scope} cleo.db \u2014 exodus-on-open ABORTED (${detail.reason}). The DB is empty; legacy data is the source of truth. Run \`cleo doctor exodus-health\` then \`cleo exodus migrate\` (or restore via \`cleo doctor repair --role ${detail.scope === "project" ? "tasks" : "nexus"}\`) before writing.`
34231
+ );
34232
+ this.name = "ExodusAbortWriteUnsafeError";
34233
+ this.detail = detail;
34234
+ this.fix = "Resolve the aborted migration (`cleo doctor exodus-health` \u2192 `cleo exodus migrate`) so the consolidated cleo.db carries your data before mutating it.";
34235
+ }
34236
+ };
34042
34237
  _cache = /* @__PURE__ */ new Map();
34043
34238
  _require2 = createRequire4(import.meta.url);
34044
34239
  _drizzle = null;
@@ -34066,7 +34261,7 @@ __export(nexus_schema_exports, {
34066
34261
  sigils: () => sigils,
34067
34262
  userProfile: () => userProfile
34068
34263
  });
34069
- import { sql as sql30 } from "drizzle-orm";
34264
+ import { sql as sql31 } from "drizzle-orm";
34070
34265
  var projectRegistry, projectIdAliases, nexusAuditLog2, nexusSchemaMeta2, NEXUS_NODE_KINDS2, nexusNodes2, NEXUS_RELATION_TYPES2, nexusRelations2, nexusRelationWeights2, NEXUS_CONTRACT_TYPES2, nexusContracts2, userProfile, SIGIL_ROLES2, sigils;
34071
34266
  var init_nexus_schema = __esm({
34072
34267
  "packages/core/src/store/schema/nexus-schema.ts"() {
@@ -34094,12 +34289,12 @@ var init_nexus_schema = __esm({
34094
34289
  */
34095
34290
  projectPath: text("project_path").notNull().unique(),
34096
34291
  name: text("name").notNull(),
34097
- registeredAt: text("registered_at").notNull().default(sql30`(datetime('now'))`),
34098
- lastSeen: text("last_seen").notNull().default(sql30`(datetime('now'))`),
34292
+ registeredAt: text("registered_at").notNull().default(sql31`(datetime('now'))`),
34293
+ lastSeen: text("last_seen").notNull().default(sql31`(datetime('now'))`),
34099
34294
  healthStatus: text("health_status").notNull().default("unknown"),
34100
34295
  healthLastCheck: text("health_last_check"),
34101
34296
  permissions: text("permissions").notNull().default("read"),
34102
- lastSync: text("last_sync").notNull().default(sql30`(datetime('now'))`),
34297
+ lastSync: text("last_sync").notNull().default(sql31`(datetime('now'))`),
34103
34298
  taskCount: integer("task_count").notNull().default(0),
34104
34299
  labelsJson: text("labels_json").notNull().default("[]"),
34105
34300
  /**
@@ -34138,7 +34333,7 @@ var init_nexus_schema = __esm({
34138
34333
  /** The canonical 12-hex-char ID this alias maps to. */
34139
34334
  canonicalId: text("canonical_id").notNull(),
34140
34335
  /** ISO 8601 timestamp when this alias was recorded. */
34141
- createdAt: text("created_at").notNull().default(sql30`(datetime('now'))`)
34336
+ createdAt: text("created_at").notNull().default(sql31`(datetime('now'))`)
34142
34337
  },
34143
34338
  (table) => [index("idx_nexus_project_id_aliases_canonical").on(table.canonicalId)]
34144
34339
  );
@@ -34146,7 +34341,7 @@ var init_nexus_schema = __esm({
34146
34341
  "nexus_audit_log",
34147
34342
  {
34148
34343
  id: text("id").primaryKey(),
34149
- timestamp: text("timestamp").notNull().default(sql30`(datetime('now'))`),
34344
+ timestamp: text("timestamp").notNull().default(sql31`(datetime('now'))`),
34150
34345
  action: text("action").notNull(),
34151
34346
  projectHash: text("project_hash"),
34152
34347
  /** @cross-db nexus.project_registry.project_id — intra-DB soft FK (kept here for symmetry with the audit-log shape). */
@@ -34273,7 +34468,7 @@ var init_nexus_schema = __esm({
34273
34468
  * an import specifier cannot be resolved to a local file. */
34274
34469
  isExternal: integer("is_external", { mode: "boolean" }).notNull().default(false),
34275
34470
  /** ISO 8601 timestamp when this node was last indexed. */
34276
- indexedAt: text("indexed_at").notNull().default(sql30`(datetime('now'))`)
34471
+ indexedAt: text("indexed_at").notNull().default(sql31`(datetime('now'))`)
34277
34472
  },
34278
34473
  (table) => [
34279
34474
  // `idx_nexus_nodes_project` + the two `project_id`-leading composite indexes
@@ -34356,7 +34551,7 @@ var init_nexus_schema = __esm({
34356
34551
  /** Step index within an execution flow (for step_in_process relations). */
34357
34552
  step: integer("step"),
34358
34553
  /** ISO 8601 timestamp when this relation was last indexed. */
34359
- indexedAt: text("indexed_at").notNull().default(sql30`(datetime('now'))`)
34554
+ indexedAt: text("indexed_at").notNull().default(sql31`(datetime('now'))`)
34360
34555
  // T998 plasticity columns (`weight`, `last_accessed_at`, `co_accessed_count`)
34361
34556
  // were PARTITIONED out into the sibling `nexus_relation_weights` table by
34362
34557
  // T11545 (ADR-090 §5.3) to keep the read-mostly structural graph row narrow
@@ -34419,9 +34614,9 @@ var init_nexus_schema = __esm({
34419
34614
  /** Human-readable description. */
34420
34615
  description: text("description"),
34421
34616
  /** ISO 8601 timestamp when contract was extracted. */
34422
- createdAt: text("created_at").notNull().default(sql30`(datetime('now'))`),
34617
+ createdAt: text("created_at").notNull().default(sql31`(datetime('now'))`),
34423
34618
  /** ISO 8601 timestamp of last update. */
34424
- updatedAt: text("updated_at").notNull().default(sql30`(datetime('now'))`)
34619
+ updatedAt: text("updated_at").notNull().default(sql31`(datetime('now'))`)
34425
34620
  },
34426
34621
  (table) => [
34427
34622
  // `idx_nexus_contracts_project` + `idx_nexus_contracts_project_type` DROPPED
@@ -40193,7 +40388,7 @@ var init_structured_output = __esm({
40193
40388
 
40194
40389
  // packages/core/src/llm/transports/anthropic.ts
40195
40390
  import Anthropic from "@anthropic-ai/sdk";
40196
- import { z as z19 } from "zod";
40391
+ import { z as z20 } from "zod";
40197
40392
  function isTextBlock(block) {
40198
40393
  return block.type === "text";
40199
40394
  }
@@ -40265,8 +40460,8 @@ function mapUsage(usage) {
40265
40460
  function zodSchemaFrom(responseFormat) {
40266
40461
  if (responseFormat == null) return null;
40267
40462
  const asAny = responseFormat;
40268
- if (asAny["schema"] instanceof z19.ZodType) return asAny["schema"];
40269
- if (responseFormat instanceof z19.ZodType) return responseFormat;
40463
+ if (asAny["schema"] instanceof z20.ZodType) return asAny["schema"];
40464
+ if (responseFormat instanceof z20.ZodType) return responseFormat;
40270
40465
  return null;
40271
40466
  }
40272
40467
  function getJsonSchemaString(responseFormat) {
@@ -40672,7 +40867,7 @@ ${schemaJson}`
40672
40867
  content = typeof validated === "string" ? validated : JSON.stringify(validated);
40673
40868
  } catch {
40674
40869
  try {
40675
- const repaired = repairResponseModelJson(rawContent, zodSchema2 ?? z19.unknown(), modelName);
40870
+ const repaired = repairResponseModelJson(rawContent, zodSchema2 ?? z20.unknown(), modelName);
40676
40871
  content = typeof repaired === "string" ? repaired : JSON.stringify(repaired);
40677
40872
  } catch {
40678
40873
  content = rawContent || null;
@@ -42108,7 +42303,7 @@ var init_caching = __esm({
42108
42303
 
42109
42304
  // packages/core/src/llm/transports/gemini.ts
42110
42305
  import { GoogleGenerativeAI } from "@google/generative-ai";
42111
- import { z as z20 } from "zod";
42306
+ import { z as z21 } from "zod";
42112
42307
  function messagesToRaw(messages, system) {
42113
42308
  const raw = [];
42114
42309
  if (system) {
@@ -42496,7 +42691,7 @@ var init_gemini2 = __esm({
42496
42691
  const parsed = response["parsed"];
42497
42692
  if (parsed !== null && parsed !== void 0) {
42498
42693
  try {
42499
- const zodResult = z20.string().safeParse(String(parsed));
42694
+ const zodResult = z21.string().safeParse(String(parsed));
42500
42695
  if (!zodResult.success) {
42501
42696
  content = JSON.stringify(parsed);
42502
42697
  } else {
@@ -56893,7 +57088,7 @@ function resolveRef(ref, ctx) {
56893
57088
  function convertBaseSchema(schema, ctx) {
56894
57089
  if (schema.not !== void 0) {
56895
57090
  if (typeof schema.not === "object" && Object.keys(schema.not).length === 0) {
56896
- return z21.never();
57091
+ return z22.never();
56897
57092
  }
56898
57093
  throw new Error("not is not supported in Zod (except { not: {} } for never)");
56899
57094
  }
@@ -56915,7 +57110,7 @@ function convertBaseSchema(schema, ctx) {
56915
57110
  return ctx.refs.get(refPath);
56916
57111
  }
56917
57112
  if (ctx.processing.has(refPath)) {
56918
- return z21.lazy(() => {
57113
+ return z22.lazy(() => {
56919
57114
  if (!ctx.refs.has(refPath)) {
56920
57115
  throw new Error(`Circular reference not resolved: ${refPath}`);
56921
57116
  }
@@ -56932,25 +57127,25 @@ function convertBaseSchema(schema, ctx) {
56932
57127
  if (schema.enum !== void 0) {
56933
57128
  const enumValues = schema.enum;
56934
57129
  if (ctx.version === "openapi-3.0" && schema.nullable === true && enumValues.length === 1 && enumValues[0] === null) {
56935
- return z21.null();
57130
+ return z22.null();
56936
57131
  }
56937
57132
  if (enumValues.length === 0) {
56938
- return z21.never();
57133
+ return z22.never();
56939
57134
  }
56940
57135
  if (enumValues.length === 1) {
56941
- return z21.literal(enumValues[0]);
57136
+ return z22.literal(enumValues[0]);
56942
57137
  }
56943
57138
  if (enumValues.every((v) => typeof v === "string")) {
56944
- return z21.enum(enumValues);
57139
+ return z22.enum(enumValues);
56945
57140
  }
56946
- const literalSchemas = enumValues.map((v) => z21.literal(v));
57141
+ const literalSchemas = enumValues.map((v) => z22.literal(v));
56947
57142
  if (literalSchemas.length < 2) {
56948
57143
  return literalSchemas[0];
56949
57144
  }
56950
- return z21.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
57145
+ return z22.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);
56951
57146
  }
56952
57147
  if (schema.const !== void 0) {
56953
- return z21.literal(schema.const);
57148
+ return z22.literal(schema.const);
56954
57149
  }
56955
57150
  const type = schema.type;
56956
57151
  if (Array.isArray(type)) {
@@ -56959,68 +57154,68 @@ function convertBaseSchema(schema, ctx) {
56959
57154
  return convertBaseSchema(typeSchema, ctx);
56960
57155
  });
56961
57156
  if (typeSchemas.length === 0) {
56962
- return z21.never();
57157
+ return z22.never();
56963
57158
  }
56964
57159
  if (typeSchemas.length === 1) {
56965
57160
  return typeSchemas[0];
56966
57161
  }
56967
- return z21.union(typeSchemas);
57162
+ return z22.union(typeSchemas);
56968
57163
  }
56969
57164
  if (!type) {
56970
- return z21.any();
57165
+ return z22.any();
56971
57166
  }
56972
57167
  let zodSchema2;
56973
57168
  switch (type) {
56974
57169
  case "string": {
56975
- let stringSchema = z21.string();
57170
+ let stringSchema = z22.string();
56976
57171
  if (schema.format) {
56977
57172
  const format = schema.format;
56978
57173
  if (format === "email") {
56979
- stringSchema = stringSchema.check(z21.email());
57174
+ stringSchema = stringSchema.check(z22.email());
56980
57175
  } else if (format === "uri" || format === "uri-reference") {
56981
- stringSchema = stringSchema.check(z21.url());
57176
+ stringSchema = stringSchema.check(z22.url());
56982
57177
  } else if (format === "uuid" || format === "guid") {
56983
- stringSchema = stringSchema.check(z21.uuid());
57178
+ stringSchema = stringSchema.check(z22.uuid());
56984
57179
  } else if (format === "date-time") {
56985
- stringSchema = stringSchema.check(z21.iso.datetime());
57180
+ stringSchema = stringSchema.check(z22.iso.datetime());
56986
57181
  } else if (format === "date") {
56987
- stringSchema = stringSchema.check(z21.iso.date());
57182
+ stringSchema = stringSchema.check(z22.iso.date());
56988
57183
  } else if (format === "time") {
56989
- stringSchema = stringSchema.check(z21.iso.time());
57184
+ stringSchema = stringSchema.check(z22.iso.time());
56990
57185
  } else if (format === "duration") {
56991
- stringSchema = stringSchema.check(z21.iso.duration());
57186
+ stringSchema = stringSchema.check(z22.iso.duration());
56992
57187
  } else if (format === "ipv4") {
56993
- stringSchema = stringSchema.check(z21.ipv4());
57188
+ stringSchema = stringSchema.check(z22.ipv4());
56994
57189
  } else if (format === "ipv6") {
56995
- stringSchema = stringSchema.check(z21.ipv6());
57190
+ stringSchema = stringSchema.check(z22.ipv6());
56996
57191
  } else if (format === "mac") {
56997
- stringSchema = stringSchema.check(z21.mac());
57192
+ stringSchema = stringSchema.check(z22.mac());
56998
57193
  } else if (format === "cidr") {
56999
- stringSchema = stringSchema.check(z21.cidrv4());
57194
+ stringSchema = stringSchema.check(z22.cidrv4());
57000
57195
  } else if (format === "cidr-v6") {
57001
- stringSchema = stringSchema.check(z21.cidrv6());
57196
+ stringSchema = stringSchema.check(z22.cidrv6());
57002
57197
  } else if (format === "base64") {
57003
- stringSchema = stringSchema.check(z21.base64());
57198
+ stringSchema = stringSchema.check(z22.base64());
57004
57199
  } else if (format === "base64url") {
57005
- stringSchema = stringSchema.check(z21.base64url());
57200
+ stringSchema = stringSchema.check(z22.base64url());
57006
57201
  } else if (format === "e164") {
57007
- stringSchema = stringSchema.check(z21.e164());
57202
+ stringSchema = stringSchema.check(z22.e164());
57008
57203
  } else if (format === "jwt") {
57009
- stringSchema = stringSchema.check(z21.jwt());
57204
+ stringSchema = stringSchema.check(z22.jwt());
57010
57205
  } else if (format === "emoji") {
57011
- stringSchema = stringSchema.check(z21.emoji());
57206
+ stringSchema = stringSchema.check(z22.emoji());
57012
57207
  } else if (format === "nanoid") {
57013
- stringSchema = stringSchema.check(z21.nanoid());
57208
+ stringSchema = stringSchema.check(z22.nanoid());
57014
57209
  } else if (format === "cuid") {
57015
- stringSchema = stringSchema.check(z21.cuid());
57210
+ stringSchema = stringSchema.check(z22.cuid());
57016
57211
  } else if (format === "cuid2") {
57017
- stringSchema = stringSchema.check(z21.cuid2());
57212
+ stringSchema = stringSchema.check(z22.cuid2());
57018
57213
  } else if (format === "ulid") {
57019
- stringSchema = stringSchema.check(z21.ulid());
57214
+ stringSchema = stringSchema.check(z22.ulid());
57020
57215
  } else if (format === "xid") {
57021
- stringSchema = stringSchema.check(z21.xid());
57216
+ stringSchema = stringSchema.check(z22.xid());
57022
57217
  } else if (format === "ksuid") {
57023
- stringSchema = stringSchema.check(z21.ksuid());
57218
+ stringSchema = stringSchema.check(z22.ksuid());
57024
57219
  }
57025
57220
  }
57026
57221
  if (typeof schema.minLength === "number") {
@@ -57037,7 +57232,7 @@ function convertBaseSchema(schema, ctx) {
57037
57232
  }
57038
57233
  case "number":
57039
57234
  case "integer": {
57040
- let numberSchema = type === "integer" ? z21.number().int() : z21.number();
57235
+ let numberSchema = type === "integer" ? z22.number().int() : z22.number();
57041
57236
  if (typeof schema.minimum === "number") {
57042
57237
  numberSchema = numberSchema.min(schema.minimum);
57043
57238
  }
@@ -57061,11 +57256,11 @@ function convertBaseSchema(schema, ctx) {
57061
57256
  break;
57062
57257
  }
57063
57258
  case "boolean": {
57064
- zodSchema2 = z21.boolean();
57259
+ zodSchema2 = z22.boolean();
57065
57260
  break;
57066
57261
  }
57067
57262
  case "null": {
57068
- zodSchema2 = z21.null();
57263
+ zodSchema2 = z22.null();
57069
57264
  break;
57070
57265
  }
57071
57266
  case "object": {
@@ -57078,14 +57273,14 @@ function convertBaseSchema(schema, ctx) {
57078
57273
  }
57079
57274
  if (schema.propertyNames) {
57080
57275
  const keySchema = convertSchema(schema.propertyNames, ctx);
57081
- const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z21.any();
57276
+ const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === "object" ? convertSchema(schema.additionalProperties, ctx) : z22.any();
57082
57277
  if (Object.keys(shape).length === 0) {
57083
- zodSchema2 = z21.record(keySchema, valueSchema);
57278
+ zodSchema2 = z22.record(keySchema, valueSchema);
57084
57279
  break;
57085
57280
  }
57086
- const objectSchema2 = z21.object(shape).passthrough();
57087
- const recordSchema = z21.looseRecord(keySchema, valueSchema);
57088
- zodSchema2 = z21.intersection(objectSchema2, recordSchema);
57281
+ const objectSchema2 = z22.object(shape).passthrough();
57282
+ const recordSchema = z22.looseRecord(keySchema, valueSchema);
57283
+ zodSchema2 = z22.intersection(objectSchema2, recordSchema);
57089
57284
  break;
57090
57285
  }
57091
57286
  if (schema.patternProperties) {
@@ -57094,28 +57289,28 @@ function convertBaseSchema(schema, ctx) {
57094
57289
  const looseRecords = [];
57095
57290
  for (const pattern of patternKeys) {
57096
57291
  const patternValue = convertSchema(patternProps[pattern], ctx);
57097
- const keySchema = z21.string().regex(new RegExp(pattern));
57098
- looseRecords.push(z21.looseRecord(keySchema, patternValue));
57292
+ const keySchema = z22.string().regex(new RegExp(pattern));
57293
+ looseRecords.push(z22.looseRecord(keySchema, patternValue));
57099
57294
  }
57100
57295
  const schemasToIntersect = [];
57101
57296
  if (Object.keys(shape).length > 0) {
57102
- schemasToIntersect.push(z21.object(shape).passthrough());
57297
+ schemasToIntersect.push(z22.object(shape).passthrough());
57103
57298
  }
57104
57299
  schemasToIntersect.push(...looseRecords);
57105
57300
  if (schemasToIntersect.length === 0) {
57106
- zodSchema2 = z21.object({}).passthrough();
57301
+ zodSchema2 = z22.object({}).passthrough();
57107
57302
  } else if (schemasToIntersect.length === 1) {
57108
57303
  zodSchema2 = schemasToIntersect[0];
57109
57304
  } else {
57110
- let result = z21.intersection(schemasToIntersect[0], schemasToIntersect[1]);
57305
+ let result = z22.intersection(schemasToIntersect[0], schemasToIntersect[1]);
57111
57306
  for (let i = 2; i < schemasToIntersect.length; i++) {
57112
- result = z21.intersection(result, schemasToIntersect[i]);
57307
+ result = z22.intersection(result, schemasToIntersect[i]);
57113
57308
  }
57114
57309
  zodSchema2 = result;
57115
57310
  }
57116
57311
  break;
57117
57312
  }
57118
- const objectSchema = z21.object(shape);
57313
+ const objectSchema = z22.object(shape);
57119
57314
  if (schema.additionalProperties === false) {
57120
57315
  zodSchema2 = objectSchema.strict();
57121
57316
  } else if (typeof schema.additionalProperties === "object") {
@@ -57132,33 +57327,33 @@ function convertBaseSchema(schema, ctx) {
57132
57327
  const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));
57133
57328
  const rest = items && typeof items === "object" && !Array.isArray(items) ? convertSchema(items, ctx) : void 0;
57134
57329
  if (rest) {
57135
- zodSchema2 = z21.tuple(tupleItems).rest(rest);
57330
+ zodSchema2 = z22.tuple(tupleItems).rest(rest);
57136
57331
  } else {
57137
- zodSchema2 = z21.tuple(tupleItems);
57332
+ zodSchema2 = z22.tuple(tupleItems);
57138
57333
  }
57139
57334
  if (typeof schema.minItems === "number") {
57140
- zodSchema2 = zodSchema2.check(z21.minLength(schema.minItems));
57335
+ zodSchema2 = zodSchema2.check(z22.minLength(schema.minItems));
57141
57336
  }
57142
57337
  if (typeof schema.maxItems === "number") {
57143
- zodSchema2 = zodSchema2.check(z21.maxLength(schema.maxItems));
57338
+ zodSchema2 = zodSchema2.check(z22.maxLength(schema.maxItems));
57144
57339
  }
57145
57340
  } else if (Array.isArray(items)) {
57146
57341
  const tupleItems = items.map((item) => convertSchema(item, ctx));
57147
57342
  const rest = schema.additionalItems && typeof schema.additionalItems === "object" ? convertSchema(schema.additionalItems, ctx) : void 0;
57148
57343
  if (rest) {
57149
- zodSchema2 = z21.tuple(tupleItems).rest(rest);
57344
+ zodSchema2 = z22.tuple(tupleItems).rest(rest);
57150
57345
  } else {
57151
- zodSchema2 = z21.tuple(tupleItems);
57346
+ zodSchema2 = z22.tuple(tupleItems);
57152
57347
  }
57153
57348
  if (typeof schema.minItems === "number") {
57154
- zodSchema2 = zodSchema2.check(z21.minLength(schema.minItems));
57349
+ zodSchema2 = zodSchema2.check(z22.minLength(schema.minItems));
57155
57350
  }
57156
57351
  if (typeof schema.maxItems === "number") {
57157
- zodSchema2 = zodSchema2.check(z21.maxLength(schema.maxItems));
57352
+ zodSchema2 = zodSchema2.check(z22.maxLength(schema.maxItems));
57158
57353
  }
57159
57354
  } else if (items !== void 0) {
57160
57355
  const element = convertSchema(items, ctx);
57161
- let arraySchema = z21.array(element);
57356
+ let arraySchema = z22.array(element);
57162
57357
  if (typeof schema.minItems === "number") {
57163
57358
  arraySchema = arraySchema.min(schema.minItems);
57164
57359
  }
@@ -57167,7 +57362,7 @@ function convertBaseSchema(schema, ctx) {
57167
57362
  }
57168
57363
  zodSchema2 = arraySchema;
57169
57364
  } else {
57170
- zodSchema2 = z21.array(z21.any());
57365
+ zodSchema2 = z22.array(z22.any());
57171
57366
  }
57172
57367
  break;
57173
57368
  }
@@ -57184,37 +57379,37 @@ function convertBaseSchema(schema, ctx) {
57184
57379
  }
57185
57380
  function convertSchema(schema, ctx) {
57186
57381
  if (typeof schema === "boolean") {
57187
- return schema ? z21.any() : z21.never();
57382
+ return schema ? z22.any() : z22.never();
57188
57383
  }
57189
57384
  let baseSchema = convertBaseSchema(schema, ctx);
57190
57385
  const hasExplicitType = schema.type || schema.enum !== void 0 || schema.const !== void 0;
57191
57386
  if (schema.anyOf && Array.isArray(schema.anyOf)) {
57192
57387
  const options = schema.anyOf.map((s) => convertSchema(s, ctx));
57193
- const anyOfUnion = z21.union(options);
57194
- baseSchema = hasExplicitType ? z21.intersection(baseSchema, anyOfUnion) : anyOfUnion;
57388
+ const anyOfUnion = z22.union(options);
57389
+ baseSchema = hasExplicitType ? z22.intersection(baseSchema, anyOfUnion) : anyOfUnion;
57195
57390
  }
57196
57391
  if (schema.oneOf && Array.isArray(schema.oneOf)) {
57197
57392
  const options = schema.oneOf.map((s) => convertSchema(s, ctx));
57198
- const oneOfUnion = z21.xor(options);
57199
- baseSchema = hasExplicitType ? z21.intersection(baseSchema, oneOfUnion) : oneOfUnion;
57393
+ const oneOfUnion = z22.xor(options);
57394
+ baseSchema = hasExplicitType ? z22.intersection(baseSchema, oneOfUnion) : oneOfUnion;
57200
57395
  }
57201
57396
  if (schema.allOf && Array.isArray(schema.allOf)) {
57202
57397
  if (schema.allOf.length === 0) {
57203
- baseSchema = hasExplicitType ? baseSchema : z21.any();
57398
+ baseSchema = hasExplicitType ? baseSchema : z22.any();
57204
57399
  } else {
57205
57400
  let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
57206
57401
  const startIdx = hasExplicitType ? 0 : 1;
57207
57402
  for (let i = startIdx; i < schema.allOf.length; i++) {
57208
- result = z21.intersection(result, convertSchema(schema.allOf[i], ctx));
57403
+ result = z22.intersection(result, convertSchema(schema.allOf[i], ctx));
57209
57404
  }
57210
57405
  baseSchema = result;
57211
57406
  }
57212
57407
  }
57213
57408
  if (schema.nullable === true && ctx.version === "openapi-3.0") {
57214
- baseSchema = z21.nullable(baseSchema);
57409
+ baseSchema = z22.nullable(baseSchema);
57215
57410
  }
57216
57411
  if (schema.readOnly === true) {
57217
- baseSchema = z21.readonly(baseSchema);
57412
+ baseSchema = z22.readonly(baseSchema);
57218
57413
  }
57219
57414
  const extraMeta = {};
57220
57415
  const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
@@ -57241,7 +57436,7 @@ function convertSchema(schema, ctx) {
57241
57436
  }
57242
57437
  function fromJSONSchema(schema, params) {
57243
57438
  if (typeof schema === "boolean") {
57244
- return schema ? z21.any() : z21.never();
57439
+ return schema ? z22.any() : z22.never();
57245
57440
  }
57246
57441
  const version2 = detectVersion(schema, params?.defaultTarget);
57247
57442
  const defs = schema.$defs || schema.definitions || {};
@@ -57255,14 +57450,14 @@ function fromJSONSchema(schema, params) {
57255
57450
  };
57256
57451
  return convertSchema(schema, ctx);
57257
57452
  }
57258
- var z21, RECOGNIZED_KEYS;
57453
+ var z22, RECOGNIZED_KEYS;
57259
57454
  var init_from_json_schema = __esm({
57260
57455
  "node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/from-json-schema.js"() {
57261
57456
  init_registries();
57262
57457
  init_checks2();
57263
57458
  init_iso();
57264
57459
  init_schemas2();
57265
- z21 = {
57460
+ z22 = {
57266
57461
  ...schemas_exports2,
57267
57462
  ...checks_exports2,
57268
57463
  iso: iso_exports