@ekairos/dataset 1.22.40-beta.development.0 → 1.22.40

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 (175) hide show
  1. package/dist/agents.d.ts +8 -0
  2. package/dist/agents.js +8 -0
  3. package/dist/builder/agentMaterializers.d.ts +9 -0
  4. package/dist/builder/agentMaterializers.js +10 -0
  5. package/dist/builder/context.d.ts +15 -0
  6. package/dist/builder/context.js +251 -0
  7. package/dist/builder/instructions.d.ts +4 -5
  8. package/dist/builder/instructions.js +15 -21
  9. package/dist/builder/materialize.d.ts +77 -10
  10. package/dist/builder/materialize.js +495 -152
  11. package/dist/builder/materializeQuery.d.ts +12 -0
  12. package/dist/builder/materializeQuery.js +31 -0
  13. package/dist/builder/persistence.d.ts +10 -6
  14. package/dist/builder/persistence.js +107 -62
  15. package/dist/builder/{sourceRows.d.ts → rows.d.ts} +0 -1
  16. package/dist/builder/{sourceRows.js → rows.js} +3 -9
  17. package/dist/builder/schemaInference.d.ts +1 -2
  18. package/dist/builder/schemaInference.js +4 -12
  19. package/dist/builder/types.d.ts +41 -26
  20. package/dist/builder/types.js +1 -3
  21. package/dist/clearDataset.tool.d.ts +2 -3
  22. package/dist/clearDataset.tool.js +13 -17
  23. package/dist/completeDataset.steps.d.ts +117 -0
  24. package/dist/completeDataset.steps.js +537 -0
  25. package/dist/completeDataset.tool.d.ts +132 -7
  26. package/dist/completeDataset.tool.js +46 -192
  27. package/dist/contextResources.d.ts +31 -0
  28. package/dist/contextResources.js +151 -0
  29. package/dist/contextWorkspace.d.ts +79 -0
  30. package/dist/contextWorkspace.js +234 -0
  31. package/dist/dataset/steps.d.ts +39 -15
  32. package/dist/dataset/steps.js +96 -39
  33. package/dist/dataset.d.ts +2 -3
  34. package/dist/dataset.js +73 -51
  35. package/dist/datasetFiles.d.ts +5 -1
  36. package/dist/datasetFiles.js +29 -27
  37. package/dist/defineNotation.tool.d.ts +49 -0
  38. package/dist/defineNotation.tool.js +154 -0
  39. package/dist/domain.d.ts +1 -2
  40. package/dist/domain.js +1 -6
  41. package/dist/executeCommand.tool.d.ts +2 -30
  42. package/dist/executeCommand.tool.js +165 -39
  43. package/dist/file/file-dataset.agent.d.ts +19 -56
  44. package/dist/file/file-dataset.agent.js +182 -136
  45. package/dist/file/file-dataset.steps.d.ts +27 -0
  46. package/dist/file/file-dataset.steps.js +47 -0
  47. package/dist/file/file-dataset.types.d.ts +64 -0
  48. package/dist/file/file-dataset.types.js +1 -0
  49. package/dist/file/filepreview.d.ts +5 -35
  50. package/dist/file/filepreview.js +60 -107
  51. package/dist/file/filepreview.types.d.ts +31 -0
  52. package/dist/file/filepreview.types.js +1 -0
  53. package/dist/file/generateSchema.tool.d.ts +2 -3
  54. package/dist/file/generateSchema.tool.js +11 -15
  55. package/dist/file/index.d.ts +1 -2
  56. package/dist/file/index.js +1 -18
  57. package/dist/file/prompts.d.ts +2 -3
  58. package/dist/file/prompts.js +152 -32
  59. package/dist/file/scripts.generated.d.ts +1 -0
  60. package/dist/file/scripts.generated.js +11 -0
  61. package/dist/file/steps.d.ts +1 -2
  62. package/dist/file/steps.js +9 -7
  63. package/dist/id.d.ts +1 -0
  64. package/dist/id.js +10 -0
  65. package/dist/index.d.ts +9 -7
  66. package/dist/index.js +9 -23
  67. package/dist/materializeDataset.tool.d.ts +35 -28
  68. package/dist/materializeDataset.tool.js +74 -68
  69. package/dist/notation.d.ts +205 -0
  70. package/dist/notation.js +424 -0
  71. package/dist/query/index.d.ts +1 -2
  72. package/dist/query/index.js +1 -18
  73. package/dist/query/queryDomain.d.ts +3 -4
  74. package/dist/query/queryDomain.js +3 -40
  75. package/dist/query/queryDomain.step.d.ts +1 -1
  76. package/dist/query/queryDomain.step.js +24 -13
  77. package/dist/sandbox/steps.d.ts +23 -15
  78. package/dist/sandbox/steps.js +73 -76
  79. package/dist/sandbox.steps.d.ts +1 -2
  80. package/dist/sandbox.steps.js +1 -18
  81. package/dist/schema.d.ts +14 -3
  82. package/dist/schema.js +27 -26
  83. package/dist/service.d.ts +12 -5
  84. package/dist/service.js +88 -15
  85. package/dist/skill.d.ts +0 -1
  86. package/dist/skill.js +12 -17
  87. package/dist/transform/filepreview.d.ts +2 -3
  88. package/dist/transform/filepreview.js +9 -26
  89. package/dist/transform/index.d.ts +2 -3
  90. package/dist/transform/index.js +2 -8
  91. package/dist/transform/prompts.d.ts +1 -34
  92. package/dist/transform/prompts.js +66 -46
  93. package/dist/transform/transform-dataset.agent.d.ts +21 -46
  94. package/dist/transform/transform-dataset.agent.js +152 -93
  95. package/dist/transform/transform-dataset.steps.d.ts +30 -0
  96. package/dist/transform/transform-dataset.steps.js +61 -0
  97. package/dist/transform/transform-dataset.types.d.ts +96 -0
  98. package/dist/transform/transform-dataset.types.js +1 -0
  99. package/dist/transform/transformDataset.d.ts +3 -3
  100. package/dist/transform/transformDataset.js +15 -18
  101. package/dist/writeDatasetRows.tool.d.ts +188 -0
  102. package/dist/writeDatasetRows.tool.js +258 -0
  103. package/package.json +33 -8
  104. package/dist/builder/instructions.d.ts.map +0 -1
  105. package/dist/builder/instructions.js.map +0 -1
  106. package/dist/builder/materialize.d.ts.map +0 -1
  107. package/dist/builder/materialize.js.map +0 -1
  108. package/dist/builder/persistence.d.ts.map +0 -1
  109. package/dist/builder/persistence.js.map +0 -1
  110. package/dist/builder/schemaInference.d.ts.map +0 -1
  111. package/dist/builder/schemaInference.js.map +0 -1
  112. package/dist/builder/sourceRows.d.ts.map +0 -1
  113. package/dist/builder/sourceRows.js.map +0 -1
  114. package/dist/builder/types.d.ts.map +0 -1
  115. package/dist/builder/types.js.map +0 -1
  116. package/dist/clearDataset.tool.d.ts.map +0 -1
  117. package/dist/clearDataset.tool.js.map +0 -1
  118. package/dist/completeDataset.tool.d.ts.map +0 -1
  119. package/dist/completeDataset.tool.js.map +0 -1
  120. package/dist/dataset/steps.d.ts.map +0 -1
  121. package/dist/dataset/steps.js.map +0 -1
  122. package/dist/dataset.d.ts.map +0 -1
  123. package/dist/dataset.js.map +0 -1
  124. package/dist/datasetFiles.d.ts.map +0 -1
  125. package/dist/datasetFiles.js.map +0 -1
  126. package/dist/domain.d.ts.map +0 -1
  127. package/dist/domain.js.map +0 -1
  128. package/dist/eventsReactRuntime.d.ts +0 -22
  129. package/dist/eventsReactRuntime.d.ts.map +0 -1
  130. package/dist/eventsReactRuntime.js +0 -29
  131. package/dist/eventsReactRuntime.js.map +0 -1
  132. package/dist/executeCommand.tool.d.ts.map +0 -1
  133. package/dist/executeCommand.tool.js.map +0 -1
  134. package/dist/file/file-dataset.agent.d.ts.map +0 -1
  135. package/dist/file/file-dataset.agent.js.map +0 -1
  136. package/dist/file/filepreview.d.ts.map +0 -1
  137. package/dist/file/filepreview.js.map +0 -1
  138. package/dist/file/generateSchema.tool.d.ts.map +0 -1
  139. package/dist/file/generateSchema.tool.js.map +0 -1
  140. package/dist/file/index.d.ts.map +0 -1
  141. package/dist/file/index.js.map +0 -1
  142. package/dist/file/prompts.d.ts.map +0 -1
  143. package/dist/file/prompts.js.map +0 -1
  144. package/dist/file/steps.d.ts.map +0 -1
  145. package/dist/file/steps.js.map +0 -1
  146. package/dist/index.d.ts.map +0 -1
  147. package/dist/index.js.map +0 -1
  148. package/dist/materializeDataset.tool.d.ts.map +0 -1
  149. package/dist/materializeDataset.tool.js.map +0 -1
  150. package/dist/query/index.d.ts.map +0 -1
  151. package/dist/query/index.js.map +0 -1
  152. package/dist/query/queryDomain.d.ts.map +0 -1
  153. package/dist/query/queryDomain.js.map +0 -1
  154. package/dist/query/queryDomain.step.d.ts.map +0 -1
  155. package/dist/query/queryDomain.step.js.map +0 -1
  156. package/dist/sandbox/steps.d.ts.map +0 -1
  157. package/dist/sandbox/steps.js.map +0 -1
  158. package/dist/sandbox.steps.d.ts.map +0 -1
  159. package/dist/sandbox.steps.js.map +0 -1
  160. package/dist/schema.d.ts.map +0 -1
  161. package/dist/schema.js.map +0 -1
  162. package/dist/service.d.ts.map +0 -1
  163. package/dist/service.js.map +0 -1
  164. package/dist/skill.d.ts.map +0 -1
  165. package/dist/skill.js.map +0 -1
  166. package/dist/transform/filepreview.d.ts.map +0 -1
  167. package/dist/transform/filepreview.js.map +0 -1
  168. package/dist/transform/index.d.ts.map +0 -1
  169. package/dist/transform/index.js.map +0 -1
  170. package/dist/transform/prompts.d.ts.map +0 -1
  171. package/dist/transform/prompts.js.map +0 -1
  172. package/dist/transform/transform-dataset.agent.d.ts.map +0 -1
  173. package/dist/transform/transform-dataset.agent.js.map +0 -1
  174. package/dist/transform/transformDataset.d.ts.map +0 -1
  175. package/dist/transform/transformDataset.js.map +0 -1
@@ -1,86 +1,92 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.materializeDatasetToolInputSchema = void 0;
4
- exports.createMaterializeDatasetTool = createMaterializeDatasetTool;
5
- const ai_1 = require("ai");
6
- const zod_1 = require("zod");
7
- const dataset_1 = require("./dataset");
8
- const fileSourceSchema = zod_1.z.object({
9
- kind: zod_1.z.literal("file"),
10
- fileId: zod_1.z.string(),
11
- description: zod_1.z.string().optional(),
1
+ import { tool } from "ai";
2
+ import { z } from "zod";
3
+ import { dataset } from "./dataset.js";
4
+ const fileResourceSchema = z.object({
5
+ kind: z.literal("file"),
6
+ fileId: z.string(),
7
+ description: z.string().optional(),
12
8
  });
13
- const textSourceSchema = zod_1.z.object({
14
- kind: zod_1.z.literal("text"),
15
- text: zod_1.z.string(),
16
- mimeType: zod_1.z.string().optional(),
17
- name: zod_1.z.string().optional(),
18
- description: zod_1.z.string().optional(),
9
+ const textResourceSchema = z.object({
10
+ kind: z.literal("text"),
11
+ text: z.string(),
12
+ mimeType: z.string().optional(),
13
+ name: z.string().optional(),
14
+ description: z.string().optional(),
19
15
  });
20
- const datasetSourceSchema = zod_1.z.object({
21
- kind: zod_1.z.literal("dataset"),
22
- datasetId: zod_1.z.string(),
23
- description: zod_1.z.string().optional(),
16
+ const datasetResourceSchema = z.object({
17
+ kind: z.literal("dataset"),
18
+ datasetId: z.string(),
19
+ description: z.string().optional(),
24
20
  });
25
- const querySourceSchema = zod_1.z.object({
26
- kind: zod_1.z.literal("query"),
27
- query: zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
28
- title: zod_1.z.string().optional(),
29
- explanation: zod_1.z.string().optional(),
21
+ const queryResourceSchema = z.object({
22
+ kind: z.literal("query"),
23
+ query: z.record(z.string(), z.any()),
24
+ title: z.string().optional(),
25
+ explanation: z.string().optional(),
30
26
  });
31
- const datasetSchemaSchema = zod_1.z.object({
32
- title: zod_1.z.string().optional(),
33
- description: zod_1.z.string().optional(),
34
- schema: zod_1.z.any(),
27
+ const contextInputSchema = z.union([
28
+ z.object({ id: z.string() }),
29
+ z.object({ key: z.string() }),
30
+ ]);
31
+ const datasetSchemaSchema = z.object({
32
+ title: z.string().optional(),
33
+ description: z.string().optional(),
34
+ schema: z.any(),
35
35
  });
36
- const materializeDatasetToolInputSchema = zod_1.z.object({
37
- datasetId: zod_1.z.string().optional(),
38
- sandboxId: zod_1.z.string().optional(),
39
- title: zod_1.z.string().optional(),
40
- sources: zod_1.z
41
- .array(zod_1.z.discriminatedUnion("kind", [
42
- fileSourceSchema,
43
- textSourceSchema,
44
- datasetSourceSchema,
45
- querySourceSchema,
46
- ]))
47
- .min(1),
48
- instructions: zod_1.z.string().optional(),
49
- mode: zod_1.z.enum(["auto", "schema"]).optional(),
50
- output: zod_1.z.enum(["rows", "object"]).optional(),
36
+ const materializeDatasetToolInputSchema = z.object({
37
+ datasetId: z.string().optional(),
38
+ sandboxId: z.string().optional(),
39
+ title: z.string().optional(),
40
+ context: contextInputSchema.optional(),
41
+ files: z.array(fileResourceSchema.omit({ kind: true })).optional(),
42
+ texts: z.array(textResourceSchema.omit({ kind: true })).optional(),
43
+ datasets: z.array(datasetResourceSchema.omit({ kind: true })).optional(),
44
+ queries: z.array(queryResourceSchema.omit({ kind: true })).optional(),
45
+ instructions: z.string().optional(),
46
+ mode: z.enum(["auto", "schema"]).optional(),
47
+ output: z.enum(["rows", "object"]).optional(),
51
48
  schema: datasetSchemaSchema.optional(),
52
- first: zod_1.z.boolean().optional(),
49
+ first: z.boolean().optional(),
53
50
  });
54
- exports.materializeDatasetToolInputSchema = materializeDatasetToolInputSchema;
55
- function createMaterializeDatasetTool(params) {
56
- return (0, ai_1.tool)({
57
- description: "Materialize a dataset from declarative sources. Returns only the target datasetId. Query sources use the preconfigured runtime domain.",
51
+ export function createMaterializeDatasetTool(params) {
52
+ return tool({
53
+ description: "Materialize a dataset from declarative resources. Returns only the target datasetId. Query resources use the preconfigured runtime domain.",
58
54
  inputSchema: materializeDatasetToolInputSchema,
59
55
  execute: async (input) => {
60
- let builder = (0, dataset_1.dataset)(params.runtime);
56
+ let builder = dataset(params.runtime);
61
57
  if (input.title?.trim()) {
62
58
  builder = builder.title(input.title);
63
59
  }
64
60
  if (input.sandboxId?.trim()) {
65
61
  builder = builder.sandbox({ sandboxId: input.sandboxId });
66
62
  }
67
- for (const source of input.sources) {
68
- if (source.kind === "file") {
69
- builder = builder.fromFile(source);
70
- continue;
71
- }
72
- if (source.kind === "text") {
73
- builder = builder.fromText(source);
74
- continue;
75
- }
76
- if (source.kind === "dataset") {
77
- builder = builder.fromDataset(source);
78
- continue;
79
- }
63
+ const materialCount = (input.files?.length ?? 0) +
64
+ (input.texts?.length ?? 0) +
65
+ (input.datasets?.length ?? 0) +
66
+ (input.queries?.length ?? 0);
67
+ if (input.context && materialCount > 0) {
68
+ throw new Error("dataset_context_resource_is_exclusive");
69
+ }
70
+ if (!input.context && materialCount === 0) {
71
+ throw new Error("dataset_context_or_material_required");
72
+ }
73
+ if (input.context) {
74
+ builder = builder.fromContext(input.context);
75
+ }
76
+ for (const resource of input.files ?? []) {
77
+ builder = builder.fromFile(resource);
78
+ }
79
+ for (const resource of input.texts ?? []) {
80
+ builder = builder.fromText(resource);
81
+ }
82
+ for (const resource of input.datasets ?? []) {
83
+ builder = builder.fromDataset(resource);
84
+ }
85
+ for (const resource of input.queries ?? []) {
80
86
  builder = builder.fromQuery(params.queryDomain, {
81
- query: source.query,
82
- title: source.title,
83
- explanation: source.explanation,
87
+ query: resource.query,
88
+ title: resource.title,
89
+ explanation: resource.explanation,
84
90
  });
85
91
  }
86
92
  if (input.output === "object") {
@@ -109,4 +115,4 @@ function createMaterializeDatasetTool(params) {
109
115
  },
110
116
  });
111
117
  }
112
- //# sourceMappingURL=materializeDataset.tool.js.map
118
+ export { materializeDatasetToolInputSchema };
@@ -0,0 +1,205 @@
1
+ /**
2
+ * Formal notation for datasets — the dataset stated intensionally.
3
+ *
4
+ * A dataset has TWO CO-EQUAL FACES at the same level:
5
+ * - its formal DEFINITION (this notation: the proposition that defines the
6
+ * set, in LaTeX), and
7
+ * - its MATERIALIZATION (the rows + the code that produces them).
8
+ * The notation is not a comment about the data; it IS the dataset, written
9
+ * as a logical statement. The materialization is the same set written
10
+ * extensionally. Neither is subordinate to the other.
11
+ *
12
+ * The SAME notation plays two roles across the lifecycle: it is the PLAN
13
+ * (status "plan": stated first, the materialization is built to realize it)
14
+ * and, once finalized, the RESULT (status "result": it describes exactly
15
+ * what was produced). It is iterated in between — every revision keeps the
16
+ * prior version in `history`, so the discovery trail stays visible.
17
+ *
18
+ * The definition is a logical proposition, possibly DERIVED (a syllogism),
19
+ * so it is NOT, in general, mechanically verifiable: a predicate may be
20
+ * semantic ("x es una frase divertida") and the set is still well-formed.
21
+ * We TRUST the formality and the produced dataset — there is no verdict.
22
+ *
23
+ * SOME predicates happen to be arithmetic (a row count, a field type, a
24
+ * preserved total). For those, and only those, we attach OPTIONAL evidence
25
+ * computed over the rows. It is advisory: a contradiction is a hint, never
26
+ * a claim that the dataset is invalid. Predicates with no arithmetic form
27
+ * are "asserted" — trusted. Nothing here blocks or changes a build; the
28
+ * notation rides on dataset_datasets.notation.
29
+ */
30
+ export type DatasetNotationSymbolKind = "set" | "variable" | "function" | "constant" | "predicate";
31
+ export type DatasetNotationSymbol = {
32
+ /** plain identifier, e.g. "D", "w", "Orders" */
33
+ name: string;
34
+ /** LaTeX for the symbol, e.g. "\\mathcal{D}" (defaults to the name) */
35
+ latex?: string;
36
+ kind: DatasetNotationSymbolKind;
37
+ description: string;
38
+ };
39
+ export type NotationCmpOp = "=" | "!=" | "<" | "<=" | ">" | ">=";
40
+ /**
41
+ * OPTIONAL arithmetic evidence for the subset of predicates that happen to
42
+ * be mechanical (counts, types, ranges, totals). Evaluated over the rows;
43
+ * field access supports dot-paths into nested records ("company.taxId").
44
+ * Leaf checks are dataset-level propositions; and/or/not/implies compose
45
+ * them propositionally. A predicate WITHOUT a check is a formal/semantic
46
+ * claim we trust — that is the normal case, not an exception.
47
+ */
48
+ export type NotationCheck = {
49
+ kind: "row_count";
50
+ op: NotationCmpOp;
51
+ value: number;
52
+ } | {
53
+ kind: "field_type";
54
+ field: string;
55
+ type: "number" | "integer" | "string" | "boolean";
56
+ allowNull?: boolean;
57
+ } | {
58
+ kind: "field_range";
59
+ field: string;
60
+ min?: number;
61
+ max?: number;
62
+ } | {
63
+ kind: "field_in";
64
+ field: string;
65
+ values: Array<string | number | boolean>;
66
+ } | {
67
+ kind: "field_nonnull";
68
+ field: string;
69
+ } | {
70
+ kind: "field_matches";
71
+ field: string;
72
+ pattern: string;
73
+ } | {
74
+ kind: "unique";
75
+ fields: string[];
76
+ } | {
77
+ kind: "aggregate";
78
+ fn: "sum" | "count" | "min" | "max" | "avg";
79
+ /** omit for fn = "count" */
80
+ field?: string;
81
+ op: NotationCmpOp;
82
+ value: number;
83
+ /** absolute tolerance for float comparison (default 1e-9) */
84
+ tolerance?: number;
85
+ } | {
86
+ kind: "and";
87
+ checks: NotationCheck[];
88
+ } | {
89
+ kind: "or";
90
+ checks: NotationCheck[];
91
+ } | {
92
+ kind: "not";
93
+ check: NotationCheck;
94
+ } | {
95
+ kind: "implies";
96
+ if: NotationCheck;
97
+ then: NotationCheck;
98
+ };
99
+ export type DatasetNotationPredicate = {
100
+ /** stable id within the notation, e.g. "p1", "rowCount" */
101
+ id: string;
102
+ description: string;
103
+ /** the claim in LaTeX, e.g. "\\forall r \\in D:\\; r.amount > 0" */
104
+ latex: string;
105
+ /**
106
+ * OPTIONAL arithmetic form. Absent (the common case) = a formal/semantic
107
+ * claim we trust without mechanical checking.
108
+ */
109
+ check?: NotationCheck;
110
+ };
111
+ /**
112
+ * Advisory evidence for one predicate. Never a verdict on the dataset:
113
+ * - "asserted" formal/semantic claim, trusted, no mechanical check
114
+ * - "supported" arithmetic evidence agrees with the stated claim
115
+ * - "contradicted" arithmetic evidence disagrees — a hint, not a failure
116
+ */
117
+ export type DatasetNotationCheckResult = {
118
+ predicateId: string;
119
+ status: "asserted" | "supported" | "contradicted";
120
+ detail?: string;
121
+ };
122
+ export type DatasetNotationRevision = {
123
+ version: number;
124
+ latex: string;
125
+ /** why this revision happened — the discovery that triggered it */
126
+ reason: string;
127
+ at: number;
128
+ };
129
+ /**
130
+ * The role the notation currently plays — the two ends of its life:
131
+ * - "plan": stated before/while building; the materialization realizes it
132
+ * - "result": finalized; it describes the dataset that was produced
133
+ * There is intentionally NO "verified"/"violated" verdict — validity is
134
+ * trusted, not proven. Iteration is tracked by `version`/`history`; advisory
135
+ * arithmetic evidence lives in `checks`, separate from this role.
136
+ */
137
+ export type DatasetNotationStatus = "plan" | "result";
138
+ export type DatasetNotation = {
139
+ version: number;
140
+ status: DatasetNotationStatus;
141
+ /** the main definition: the dataset as a set, in LaTeX */
142
+ latex: string;
143
+ symbols: DatasetNotationSymbol[];
144
+ predicates: DatasetNotationPredicate[];
145
+ /** advisory per-predicate evidence (asserted/supported/contradicted) */
146
+ checks?: DatasetNotationCheckResult[];
147
+ /** when the advisory evidence was last computed */
148
+ evidenceAt?: number;
149
+ history: DatasetNotationRevision[];
150
+ };
151
+ export type NotationRevisionInput = {
152
+ latex: string;
153
+ symbols?: DatasetNotationSymbol[];
154
+ predicates?: DatasetNotationPredicate[];
155
+ reason: string;
156
+ /** "final" marks the notation as describing the produced dataset */
157
+ final?: boolean;
158
+ };
159
+ /**
160
+ * Iterate the notation: every revision bumps the version and appends to
161
+ * history, so the discovery trail (sets/variables found along the way)
162
+ * stays visible.
163
+ */
164
+ export declare function reviseDatasetNotation(previous: DatasetNotation | null | undefined, input: NotationRevisionInput): DatasetNotation;
165
+ /** escape an identifier for use inside \text{} */
166
+ export declare function latexIdentifier(name: string): string;
167
+ type JsonSchemaLike = {
168
+ title?: string;
169
+ schema?: Record<string, any>;
170
+ properties?: Record<string, any>;
171
+ };
172
+ /**
173
+ * A query-backed dataset has a complete deterministic description: the
174
+ * dataset is the image of a known query over a known domain. No model is
175
+ * involved, so here the formal definition and its predicates derive
176
+ * mechanically from the query, the inferred schema and the row count — and
177
+ * those predicates DO carry arithmetic evidence (the special case where the
178
+ * formal claims happen to be fully mechanical).
179
+ */
180
+ export declare function inferQueryNotation(params: {
181
+ entityNames: string[];
182
+ rowCount: number;
183
+ schema?: JsonSchemaLike | null;
184
+ explanation?: string;
185
+ }): DatasetNotation;
186
+ type CheckOutcome = {
187
+ ok: boolean;
188
+ detail: string;
189
+ };
190
+ export declare function evaluateNotationCheck(rows: any[], check: NotationCheck): CheckOutcome;
191
+ /**
192
+ * Annotate a notation with ADVISORY arithmetic evidence over the produced
193
+ * rows. Never throws, never blocks, and never changes the notation's
194
+ * lifecycle status — the dataset's validity is trusted, not proven here.
195
+ *
196
+ * Each predicate is reported as:
197
+ * - "asserted" no arithmetic form (formal/semantic claim, trusted)
198
+ * - "supported" arithmetic evidence agrees
199
+ * - "contradicted" arithmetic evidence disagrees (a hint to look, not a
200
+ * verdict that the dataset is wrong)
201
+ * A check that can't be evaluated stays "asserted" — we don't downgrade a
202
+ * trusted claim because of a malformed mechanical form.
203
+ */
204
+ export declare function annotateNotationEvidence(notation: DatasetNotation, rows: any[]): DatasetNotation;
205
+ export {};