datanotes 3.1.0 → 3.2.0

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 (41) hide show
  1. package/dist/api/index.cjs +175 -8
  2. package/dist/api/index.js +175 -8
  3. package/dist/api/mcp.cjs +175 -8
  4. package/dist/api/mcp.js +175 -8
  5. package/dist/datanotes.cjs +591 -139
  6. package/dist/docs/api/operations/add_column.md +1 -0
  7. package/dist/docs/api/operations/add_constraint.md +2 -0
  8. package/dist/docs/api/operations/alter_column.md +1 -1
  9. package/dist/docs/api/operations/alter_table.md +3 -2
  10. package/dist/docs/api/operations/check_table.md +1 -1
  11. package/dist/docs/api/operations/create_table.md +3 -1
  12. package/dist/docs/api/operations/describe_table.md +1 -1
  13. package/dist/docs/api/operations/insert_row.md +2 -2
  14. package/dist/docs/api/operations/tags/rows-dml.md +1 -1
  15. package/dist/docs/api.md +2 -2
  16. package/dist/docs/guides/data-quality/check-constraints.md +14 -13
  17. package/dist/docs/guides/data-quality/hand-edits.md +10 -10
  18. package/dist/docs/guides/database-objects/bases.md +11 -11
  19. package/dist/docs/guides/database-objects/catalogs-and-schemas.md +16 -10
  20. package/dist/docs/guides/database-objects/columns.md +38 -38
  21. package/dist/docs/guides/database-objects/relations.md +173 -36
  22. package/dist/docs/guides/database-objects/tables.md +80 -35
  23. package/dist/docs/guides/database-objects/views.md +44 -44
  24. package/dist/docs/guides/history/change-data-feed.md +34 -34
  25. package/dist/docs/guides/history/journal-and-undo.md +12 -12
  26. package/dist/docs/guides/history/restore.md +20 -20
  27. package/dist/docs/guides/history/table-history.md +31 -31
  28. package/dist/docs/guides/read-and-write/automatic-links.md +15 -15
  29. package/dist/docs/guides/read-and-write/import-notes.md +21 -21
  30. package/dist/docs/guides/read-and-write/joins-and-aggregates.md +7 -7
  31. package/dist/docs/guides/read-and-write/read-and-filter.md +10 -10
  32. package/dist/docs/guides/read-and-write/write-rows.md +10 -10
  33. package/dist/docs/guides/search/text.md +1 -1
  34. package/dist/docs/reference/cli.md +1 -1
  35. package/dist/docs/reference/errors.md +1 -1
  36. package/dist/docs/reference/operations/auxiliary.md +2 -2
  37. package/dist/docs/reference/operations/rows.md +1 -1
  38. package/dist/docs/reference/operations/schema.md +15 -11
  39. package/dist/docs/reference/operations.md +28 -28
  40. package/dist/docs/release-notes.md +24 -0
  41. package/package.json +1 -1
package/dist/api/mcp.cjs CHANGED
@@ -378,7 +378,7 @@ var OPERATIONS = [
378
378
  },
379
379
  {
380
380
  "name": "describe_table",
381
- "description": "Describe a table (`catalog.schema.table` or a shorter unambiguous name): `qualified`, `name`,\n`catalog`, `schema`, `description`, `aliases`, `layout` (`folder`, `row_folder`: the folder pattern\nof new rows, `archive`), `options` (`partition`, `filename`, `archive`, `exclude`), typed `columns`\nwith label/aliases/description and the dense flag, `untyped_fields`, `row_count`, and when set:\n`tags`, `bases` (the bases it inherits from, in order), `constraints` (its CHECKs, name \u2192 where), `row_template`, `history`,\n`autolink_target`, `fields` (their values).\n\nBefore adding a column (e.g. a new metric), read `columns` and match your concept against\n`name`, `label`, `aliases` and `description`; reuse an existing column when it means the same.\n\n`missing_descriptions` (`{table, columns}`), present only when something has no description (a table\ndefined before descriptions were required), names what lacks one: write them with alter_table\n`description` and alter_column `changes.description`, asking the user when the meaning is unclear.",
381
+ "description": "Describe a table (`catalog.schema.table` or a shorter unambiguous name): `qualified`, `name`,\n`catalog`, `schema`, `description`, `aliases`, `layout` (`folder`, `row_folder`: the folder pattern\nof new rows, `archive`), `options` (`partition`, `filename`, `archive`, `exclude`), typed `columns`\nwith label/aliases/description and the dense flag, `untyped_fields`, `row_count`, and when set:\n`tags`, `bases` (the bases it inherits from, in order), `constraints` (its CHECKs, name \u2192 where), `constraint_hints` (their own hints, name \u2192 hint), `instructions` (how to fill a row: follow them before you write one), `row_template`, `history`,\n`autolink_target`, `fields` (their values).\n\nBefore adding a column (e.g. a new metric), read `columns` and match your concept against\n`name`, `label`, `aliases` and `description`; reuse an existing column when it means the same.\n\n`missing_descriptions` (`{table, columns}`), present only when something has no description (a table\ndefined before descriptions were required), names what lacks one: write them with alter_table\n`description` and alter_column `changes.description`, asking the user when the meaning is unclear.",
382
382
  "inputSchema": {
383
383
  "additionalProperties": false,
384
384
  "properties": {
@@ -501,6 +501,10 @@ var OPERATIONS = [
501
501
  "inverse": {
502
502
  "type": "string"
503
503
  },
504
+ "acyclic": {
505
+ "type": "boolean",
506
+ "description": "Link column to its own table whose links never form a cycle (a write that closes one is refused)."
507
+ },
504
508
  "ref_where": {
505
509
  "type": "object",
506
510
  "description": "Link column: the where filter every linked row must match.",
@@ -610,6 +614,17 @@ var OPERATIONS = [
610
614
  },
611
615
  "description": "Its CHECK constraints: name \u2192 the where every row must match."
612
616
  },
617
+ "constraint_hints": {
618
+ "type": "object",
619
+ "additionalProperties": {
620
+ "type": "string"
621
+ },
622
+ "description": "The hint of each CHECK that has one: name \u2192 what to do when a row breaks it."
623
+ },
624
+ "instructions": {
625
+ "type": "string",
626
+ "description": "How to fill a row of the table (alter_table instructions): follow them before you write one."
627
+ },
613
628
  "row_template": {
614
629
  "type": "string",
615
630
  "description": "The text of every new row's note."
@@ -643,7 +658,7 @@ var OPERATIONS = [
643
658
  },
644
659
  {
645
660
  "name": "create_table",
646
- "description": 'Create a table: `name`, in `catalog` and `schema` (default: the database\'s defaults); the definition\ngoes in metastore.yaml, the rows in `<root>/<catalog>/<schema>/<name>/`. Names: lowercase letters,\ndigits, `_` (no dots: pass the catalog and the schema as their own arguments).\n- `description` (required): what a row of the table records. Every column needs its own `description`\n too, what it holds: the table is refused otherwise, with every missing one listed. Descriptions are how\n agents and people understand the schema, so write them for a reader who never saw the notes. The\n engine writes those of `id` and of `identity` "uuid" / "created" columns.\n- `columns`: specs like `{"name": "kind", "type": "enum", "values": ["a","b"], "required": true,\n "description": "What kind of entry the row is"}`.\n Types: string, integer, number, boolean, date, datetime, enum, link, list (+ `items`), json.\n Attributes: required, default (`"{now}"`/`"{today}"`), min, max, step, values, `ordered` (enum in\n order: filters/avg use the position), ref (link target, full `catalog.schema.table` or "self"),\n unique, label, description, aliases, `generated` (e.g. `"date(occurred_at)"`, `"{name} {surname}"`),\n `identity` ("filename" | "created"), `vocabulary` (allowed values = names of another table\'s rows),\n `hierarchy: true` (one parent link to its own table), `dense` (written on every row),\n `inverse` on a link column: the column of the `ref` table that links back (`friends` \u2194\n `friends`, `children` \u2194 `parents`, `partner` \u2194 `partner`); writes keep both sides in step.\n- `time_column`: rows named by that date/datetime; otherwise `filename` (e.g. `"{name}"`).\n- The table\'s options, as alter_table names them: `aliases` (how agents find it, with the\n description), `partition`, `exclude`, `archive`, `history` (keep its versions; default: the\n database\'s setting), `autolink_target` (true / false: may automatic links link its rows? default:\n yes, unless its rows are named by a date or a time, as with `time_column`).\n- `row_template`: markdown body of new rows. Shared columns come from bases: `set_table_bases`.\n- `tags`: key/value labels of the table, strings (`{"domain": "health"}`); list_tables and\n describe_table return them, alter_table changes them.\nEnum columns: `values` and, for each, its meaning in `value_descriptions` (`{"stated": "the user said it", \u2026}`): describe_table shows them and a refused value lists them.\nGenerated link columns: `generated: "link({occurred_at:YYYY-MM-DD})"` with `ref` = the days table links each row to the row of `ref` named by the template (its folder read from the schema; the target may not exist yet).\nFiltered link targets (link columns): `ref_where` (a `where` every target must match) and `ref_by` (a column of the row picks the target level: `{"column": "kind", "levels": ["area", "project", "workstream"]}` or `{"column": "kind", "map": {"area": null, "project": ["area"]}}`; null = top level, no link; `target_column` when the target names it differently: an enum target column must have every value the map allows, a string one takes any value). A link to no row of the table, or to the row itself, is refused too. Existing rows that break them refuse the change; `list_link_targets` lists the valid targets of a row.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
661
+ "description": 'Create a table: `name`, in `catalog` and `schema` (default: the database\'s defaults); the definition\ngoes in metastore.yaml, the rows in `<root>/<catalog>/<schema>/<name>/`. Names: lowercase letters,\ndigits, `_` (no dots: pass the catalog and the schema as their own arguments).\n- `description` (required): what a row of the table records. Every column needs its own `description`\n too, what it holds: the table is refused otherwise, with every missing one listed. Descriptions are how\n agents and people understand the schema, so write them for a reader who never saw the notes. The\n engine writes those of `id` and of `identity` "uuid" / "created" columns.\n- `columns`: specs like `{"name": "kind", "type": "enum", "values": ["a","b"], "required": true,\n "description": "What kind of entry the row is"}`.\n Types: string, integer, number, boolean, date, datetime, enum, link, list (+ `items`), json.\n Attributes: required, default (`"{now}"`/`"{today}"`), min, max, step, values, `ordered` (enum in\n order: filters/avg use the position), ref (link target, full `catalog.schema.table` or "self"),\n unique, label, description, aliases, `generated` (e.g. `"date(occurred_at)"`, `"{name} {surname}"`),\n `identity` ("filename" | "created"), `vocabulary` (allowed values = names of another table\'s rows),\n `hierarchy: true` (one parent link to its own table), `acyclic: true` (links to rows of its own table that never loop back, such as tasks blocked by tasks; with `inverse`, the rule holds on both sides), `dense` (written on every row),\n `inverse` on a link column: the column of the `ref` table that links back (`friends` \u2194\n `friends`, `children` \u2194 `parents`, `partner` \u2194 `partner`); writes keep both sides in step.\n- `time_column`: rows named by that date/datetime; otherwise `filename` (e.g. `"{name}"`).\n- The table\'s options, as alter_table names them: `aliases` (how agents find it, with the\n description), `partition`, `exclude`, `archive`, `history` (keep its versions; default: the\n database\'s setting), `autolink_target` (true / false: may automatic links link its rows? default:\n yes, unless its rows are named by a date or a time, as with `time_column`).\n- `row_template`: markdown body of new rows. Shared columns come from bases: `set_table_bases`.\n- `instructions`: how to fill a row, for agents (Markdown); describe_table returns them.\n- `tags`: key/value labels of the table, strings (`{"domain": "health"}`); list_tables and\n describe_table return them, alter_table changes them.\nEnum columns: `values` and, for each, its meaning in `value_descriptions` (`{"stated": "the user said it", \u2026}`): describe_table shows them and a refused value lists them.\nGenerated link columns: `generated: "link({occurred_at:YYYY-MM-DD})"` with `ref` = the days table links each row to the row of `ref` named by the template (its folder read from the schema; the target may not exist yet).\nFiltered link targets (link columns): `ref_where` (a `where` every target must match) and `ref_by` (a column of the row picks the target level: `{"column": "kind", "levels": ["area", "project", "workstream"]}` or `{"column": "kind", "map": {"area": null, "project": ["area"]}}`; null = top level, no link; `target_column` when the target names it differently: an enum target column must have every value the map allows, a string one takes any value). A link to no row of the table, or to the row itself, is refused too. Existing rows that break them refuse the change; `list_link_targets` lists the valid targets of a row.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
647
662
  "inputSchema": {
648
663
  "additionalProperties": false,
649
664
  "properties": {
@@ -804,6 +819,18 @@ var OPERATIONS = [
804
819
  "default": null,
805
820
  "description": "Markdown body of new rows; {column} placeholders are filled from the row."
806
821
  },
822
+ "instructions": {
823
+ "anyOf": [
824
+ {
825
+ "type": "string"
826
+ },
827
+ {
828
+ "type": "null"
829
+ }
830
+ ],
831
+ "default": null,
832
+ "description": "How to fill a row, for agents (Markdown): which columns first, what to ask the user. describe_table returns them."
833
+ },
807
834
  "fields": {
808
835
  "anyOf": [
809
836
  {
@@ -941,6 +968,10 @@ var OPERATIONS = [
941
968
  "type": "string",
942
969
  "description": "The CHECK's name (code check)."
943
970
  },
971
+ "hint": {
972
+ "type": "string",
973
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
974
+ },
944
975
  "code": {
945
976
  "type": "string",
946
977
  "enum": [
@@ -1350,6 +1381,10 @@ var OPERATIONS = [
1350
1381
  "type": "string",
1351
1382
  "description": "The CHECK's name (code check)."
1352
1383
  },
1384
+ "hint": {
1385
+ "type": "string",
1386
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
1387
+ },
1353
1388
  "code": {
1354
1389
  "type": "string",
1355
1390
  "enum": [
@@ -1629,7 +1664,7 @@ var OPERATIONS = [
1629
1664
  },
1630
1665
  {
1631
1666
  "name": "add_column",
1632
- "description": 'Add a typed column. Sparse by default (written only on rows that have a value \u2014 use for\nmetrics, e.g. `{"name": "metric_mood", "type": "integer", "min": 1, "max": 5, "label":\n"Mood", "aliases": ["mood"], "description": "Mood of the day, 1 = bad, 5 = great"}`).\n`description` is required: what the column holds, for the agents and people who read the schema\n(the engine writes it for `identity` "uuid" / "created" columns).\n`dense: true` in the spec adds it to every row with its `default`. Call `describe_table` first: never add\na column whose meaning an existing column (name/label/aliases/description) already covers.\nColumn names are permanent identifiers; only `rename_column` changes them.\nEnum columns: `values` and, for each, its meaning in `value_descriptions` (`{"stated": "the user said it", \u2026}`): describe_table shows them and a refused value lists them.\nGenerated link columns: `generated: "link({occurred_at:YYYY-MM-DD})"` with `ref` = the days table links each row to the row of `ref` named by the template (its folder read from the schema; the target may not exist yet).\nFiltered link targets (link columns): `ref_where` (a `where` every target must match) and `ref_by` (a column of the row picks the target level: `{"column": "kind", "levels": ["area", "project", "workstream"]}` or `{"column": "kind", "map": {"area": null, "project": ["area"]}}`; null = top level, no link; `target_column` when the target names it differently: an enum target column must have every value the map allows, a string one takes any value). A link to no row of the table, or to the row itself, is refused too. Existing rows that break them refuse the change; `list_link_targets` lists the valid targets of a row.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
1667
+ "description": 'Add a typed column. Sparse by default (written only on rows that have a value \u2014 use for\nmetrics, e.g. `{"name": "metric_mood", "type": "integer", "min": 1, "max": 5, "label":\n"Mood", "aliases": ["mood"], "description": "Mood of the day, 1 = bad, 5 = great"}`).\n`description` is required: what the column holds, for the agents and people who read the schema\n(the engine writes it for `identity` "uuid" / "created" columns).\n`dense: true` in the spec adds it to every row with its `default`. Call `describe_table` first: never add\na column whose meaning an existing column (name/label/aliases/description) already covers.\nColumn names are permanent identifiers; only `rename_column` changes them.\nEnum columns: `values` and, for each, its meaning in `value_descriptions` (`{"stated": "the user said it", \u2026}`): describe_table shows them and a refused value lists them.\nGenerated link columns: `generated: "link({occurred_at:YYYY-MM-DD})"` with `ref` = the days table links each row to the row of `ref` named by the template (its folder read from the schema; the target may not exist yet).\nFiltered link targets (link columns): `ref_where` (a `where` every target must match) and `ref_by` (a column of the row picks the target level: `{"column": "kind", "levels": ["area", "project", "workstream"]}` or `{"column": "kind", "map": {"area": null, "project": ["area"]}}`; null = top level, no link; `target_column` when the target names it differently: an enum target column must have every value the map allows, a string one takes any value). A link to no row of the table, or to the row itself, is refused too. Existing rows that break them refuse the change; `list_link_targets` lists the valid targets of a row.\nAcyclic links: `acyclic: true` on a link (or list of links) to the table itself refuses every write that closes a cycle, on either side of an `inverse`; refused while existing rows form one (they are listed).\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
1633
1668
  "inputSchema": {
1634
1669
  "additionalProperties": false,
1635
1670
  "properties": {
@@ -1750,6 +1785,10 @@ var OPERATIONS = [
1750
1785
  "type": "string",
1751
1786
  "description": "The CHECK's name (code check)."
1752
1787
  },
1788
+ "hint": {
1789
+ "type": "string",
1790
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
1791
+ },
1753
1792
  "code": {
1754
1793
  "type": "string",
1755
1794
  "enum": [
@@ -2152,6 +2191,10 @@ var OPERATIONS = [
2152
2191
  "type": "string",
2153
2192
  "description": "The CHECK's name (code check)."
2154
2193
  },
2194
+ "hint": {
2195
+ "type": "string",
2196
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
2197
+ },
2155
2198
  "code": {
2156
2199
  "type": "string",
2157
2200
  "enum": [
@@ -2551,6 +2594,10 @@ var OPERATIONS = [
2551
2594
  "type": "string",
2552
2595
  "description": "The CHECK's name (code check)."
2553
2596
  },
2597
+ "hint": {
2598
+ "type": "string",
2599
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
2600
+ },
2554
2601
  "code": {
2555
2602
  "type": "string",
2556
2603
  "enum": [
@@ -2830,7 +2877,7 @@ var OPERATIONS = [
2830
2877
  },
2831
2878
  {
2832
2879
  "name": "alter_column",
2833
- "description": 'Change a column\'s attributes (type, min/max/step, values, required, default, label,\naliases, description, note, `ref_where`, `ref_by` (see list_link_targets); `null` removes an attribute, except\n`description`, which changes but never goes (null or "" is refused); `dense` true/false). Refused with\nthe list of violating rows when existing values do not satisfy the new definition. A\ndifferent scale means a different column: add a new one instead of rescaling. To rename one\nenum value use `rename_value`. Dropping an enum value that a `ref_by` (of any table) allows as a\ntarget level is refused, naming it.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
2880
+ "description": 'Change a column\'s attributes (type, min/max/step, values, required, default, label,\naliases, description, note, `ref_where`, `ref_by` (see list_link_targets), `acyclic` (refused while the rows already form a cycle: they are listed); `null` removes an attribute, except\n`description`, which changes but never goes (null or "" is refused); `dense` true/false). Refused with\nthe list of violating rows when existing values do not satisfy the new definition. A\ndifferent scale means a different column: add a new one instead of rescaling. To rename one\nenum value use `rename_value`. Dropping an enum value that a `ref_by` (of any table) allows as a\ntarget level is refused, naming it.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
2834
2881
  "inputSchema": {
2835
2882
  "additionalProperties": false,
2836
2883
  "properties": {
@@ -2955,6 +3002,10 @@ var OPERATIONS = [
2955
3002
  "type": "string",
2956
3003
  "description": "The CHECK's name (code check)."
2957
3004
  },
3005
+ "hint": {
3006
+ "type": "string",
3007
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
3008
+ },
2958
3009
  "code": {
2959
3010
  "type": "string",
2960
3011
  "enum": [
@@ -3234,7 +3285,7 @@ var OPERATIONS = [
3234
3285
  },
3235
3286
  {
3236
3287
  "name": "alter_table",
3237
- "description": 'Alter a table: move it (`catalog`, `schema`), rename it (`name`), change\n`partition` / `filename` patterns, `description` (changes, never goes: "" is refused), `aliases`,\n`exclude` folders, `row_template`\n("" removes it), `history` (true | false | "default"), `autolink_target`\n(true | false | "default": may automatic links link its rows? default: yes, unless its rows are named by\na date or a time) or `tags` (key/value\nlabels merged into the table\'s, e.g. `{"domain": "health"}`; a `null` value removes that tag;\n`clear_tags: true` removes every tag first, so with `tags` the table keeps exactly those),\n`archive` (folder name inside the table folder) or `fields` (untyped fields, name \u2192 default; a\n`null` value removes one). Rows, archive and transaction log follow; links are updated; renamed\nrows keep their old name in `aliases`. A change of metadata only (tags, description, aliases,\nhistory, autolink_target, row_template, fields) rewrites the table entry alone: no row is moved or rewritten. Refused\nwhen a row cannot fill a pattern. Renaming or moving the table is refused while a CHECK that follows\nlinks, or a `ref_where` / `ref_by`, of another table reads it through a link (link targets are not\nrewritten): the conflicts name them. Use `dry_run` to see `planned_moves`; undo with undo_migration.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
3288
+ "description": 'Alter a table: move it (`catalog`, `schema`), rename it (`name`), change\n`partition` / `filename` patterns, `description` (changes, never goes: "" is refused), `aliases`,\n`exclude` folders, `row_template`\n("" removes it), `instructions` (how to fill a row, for agents; "" removes them), `history` (true | false | "default"), `autolink_target`\n(true | false | "default": may automatic links link its rows? default: yes, unless its rows are named by\na date or a time) or `tags` (key/value\nlabels merged into the table\'s, e.g. `{"domain": "health"}`; a `null` value removes that tag;\n`clear_tags: true` removes every tag first, so with `tags` the table keeps exactly those),\n`archive` (folder name inside the table folder) or `fields` (untyped fields, name \u2192 default; a\n`null` value removes one). Rows, archive and transaction log follow; links are updated; renamed\nrows keep their old name in `aliases`. A change of metadata only (tags, description, aliases,\nhistory, autolink_target, row_template, instructions, fields) rewrites the table entry alone: no row is moved or rewritten. Refused\nwhen a row cannot fill a pattern. Renaming or moving the table is refused while a CHECK that follows\nlinks, or a `ref_where` / `ref_by`, of another table reads it through a link (link targets are not\nrewritten): the conflicts name them. Use `dry_run` to see `planned_moves`; undo with undo_migration.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
3238
3289
  "inputSchema": {
3239
3290
  "additionalProperties": false,
3240
3291
  "properties": {
@@ -3384,6 +3435,18 @@ var OPERATIONS = [
3384
3435
  "default": null,
3385
3436
  "description": 'Markdown body of new rows; "" removes it.'
3386
3437
  },
3438
+ "instructions": {
3439
+ "anyOf": [
3440
+ {
3441
+ "type": "string"
3442
+ },
3443
+ {
3444
+ "type": "null"
3445
+ }
3446
+ ],
3447
+ "default": null,
3448
+ "description": 'How to fill a row, for agents (Markdown); "" removes them.'
3449
+ },
3387
3450
  "tags": {
3388
3451
  "anyOf": [
3389
3452
  {
@@ -3544,6 +3607,10 @@ var OPERATIONS = [
3544
3607
  "type": "string",
3545
3608
  "description": "The CHECK's name (code check)."
3546
3609
  },
3610
+ "hint": {
3611
+ "type": "string",
3612
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
3613
+ },
3547
3614
  "code": {
3548
3615
  "type": "string",
3549
3616
  "enum": [
@@ -4000,6 +4067,10 @@ var OPERATIONS = [
4000
4067
  "type": "string",
4001
4068
  "description": "The CHECK's name (code check)."
4002
4069
  },
4070
+ "hint": {
4071
+ "type": "string",
4072
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
4073
+ },
4003
4074
  "code": {
4004
4075
  "type": "string",
4005
4076
  "enum": [
@@ -4401,6 +4472,10 @@ var OPERATIONS = [
4401
4472
  "type": "string",
4402
4473
  "description": "The CHECK's name (code check)."
4403
4474
  },
4475
+ "hint": {
4476
+ "type": "string",
4477
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
4478
+ },
4404
4479
  "code": {
4405
4480
  "type": "string",
4406
4481
  "enum": [
@@ -5463,6 +5538,10 @@ var OPERATIONS = [
5463
5538
  "type": "string",
5464
5539
  "description": "The CHECK's name (code check)."
5465
5540
  },
5541
+ "hint": {
5542
+ "type": "string",
5543
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
5544
+ },
5466
5545
  "code": {
5467
5546
  "type": "string",
5468
5547
  "enum": [
@@ -5869,6 +5948,10 @@ var OPERATIONS = [
5869
5948
  "type": "string",
5870
5949
  "description": "The CHECK's name (code check)."
5871
5950
  },
5951
+ "hint": {
5952
+ "type": "string",
5953
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
5954
+ },
5872
5955
  "code": {
5873
5956
  "type": "string",
5874
5957
  "enum": [
@@ -6148,7 +6231,7 @@ var OPERATIONS = [
6148
6231
  },
6149
6232
  {
6150
6233
  "name": "insert_row",
6151
- "description": "Insert a row (new note). Values are validated against the columns; the note path comes from\nthe table's `path`/`filename` patterns (e.g. an event logged today about last night lands in\nlast night's day folder when you set `occurred_at` to last night). `body` is the note text.\nGenerated / identity columns are computed (do not pass them); CHECK constraints are enforced.\nReturns `migration_id` (undo) and the created path in `planned_creates`.\n`body` links the notes it mentions by name, at their first mention (automatic links; off with\n`autolink: false` or the database's `autolink` setting). `links_added` lists the links made;\n`ambiguous_mentions` lists the mentions left as text with the notes they may name: read those,\nthen link the right one with update_row and `autolink: false`, or leave the text.",
6234
+ "description": "Insert a row (new note). When describe_table gives the table's `instructions`, fill the row as they say. Values are validated against the columns; the note path comes from\nthe table's `path`/`filename` patterns (e.g. an event logged today about last night lands in\nlast night's day folder when you set `occurred_at` to last night). `body` is the note text.\nGenerated / identity columns are computed (do not pass them); CHECK constraints are enforced.\nReturns `migration_id` (undo) and the created path in `planned_creates`.\n`body` links the notes it mentions by name, at their first mention (automatic links; off with\n`autolink: false` or the database's `autolink` setting). `links_added` lists the links made;\n`ambiguous_mentions` lists the mentions left as text with the notes they may name: read those,\nthen link the right one with update_row and `autolink: false`, or leave the text.",
6152
6235
  "inputSchema": {
6153
6236
  "additionalProperties": false,
6154
6237
  "properties": {
@@ -6303,6 +6386,10 @@ var OPERATIONS = [
6303
6386
  "type": "string",
6304
6387
  "description": "The CHECK's name (code check)."
6305
6388
  },
6389
+ "hint": {
6390
+ "type": "string",
6391
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
6392
+ },
6306
6393
  "code": {
6307
6394
  "type": "string",
6308
6395
  "enum": [
@@ -6741,6 +6828,10 @@ var OPERATIONS = [
6741
6828
  "type": "string",
6742
6829
  "description": "The CHECK's name (code check)."
6743
6830
  },
6831
+ "hint": {
6832
+ "type": "string",
6833
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
6834
+ },
6744
6835
  "code": {
6745
6836
  "type": "string",
6746
6837
  "enum": [
@@ -7254,6 +7345,10 @@ var OPERATIONS = [
7254
7345
  "type": "string",
7255
7346
  "description": "The CHECK's name (code check)."
7256
7347
  },
7348
+ "hint": {
7349
+ "type": "string",
7350
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
7351
+ },
7257
7352
  "code": {
7258
7353
  "type": "string",
7259
7354
  "enum": [
@@ -7685,6 +7780,10 @@ var OPERATIONS = [
7685
7780
  "type": "string",
7686
7781
  "description": "The CHECK's name (code check)."
7687
7782
  },
7783
+ "hint": {
7784
+ "type": "string",
7785
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
7786
+ },
7688
7787
  "code": {
7689
7788
  "type": "string",
7690
7789
  "enum": [
@@ -8133,6 +8232,10 @@ var OPERATIONS = [
8133
8232
  "type": "string",
8134
8233
  "description": "The CHECK's name (code check)."
8135
8234
  },
8235
+ "hint": {
8236
+ "type": "string",
8237
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
8238
+ },
8136
8239
  "code": {
8137
8240
  "type": "string",
8138
8241
  "enum": [
@@ -8593,6 +8696,10 @@ var OPERATIONS = [
8593
8696
  "type": "string",
8594
8697
  "description": "The CHECK's name (code check)."
8595
8698
  },
8699
+ "hint": {
8700
+ "type": "string",
8701
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
8702
+ },
8596
8703
  "code": {
8597
8704
  "type": "string",
8598
8705
  "enum": [
@@ -9101,7 +9208,7 @@ var OPERATIONS = [
9101
9208
  },
9102
9209
  {
9103
9210
  "name": "check_table",
9104
- "description": "Validate every row against the table (required, types, ranges, enums, links, unknown\ncolumns, CHECK constraints, those that follow links included, filtered link targets (ref_where / ref_by), stale generated/identity values, missing inverse links, front matter that cannot be read: code `unreadable`, with no column, for a note whose `table` line names the table but whose YAML is broken, which every other read leaves out). A CHECK violation has code `check` and the CHECK's name as `constraint` (every other code names its `column`), as in the `violations` of list_changes. Use it to find rows edited by hand that break the schema. Without `table`, every table is checked: each row then names its `table`, `tables_checked` counts the tables checked, and a table that cannot be checked is listed in `errors` ({table, error}) while the others are. The rows with violations are paged: `limit` (default 500, at most 5000) from `offset`; `total` counts them all. (Hand edits are also checked as they happen: see `violations` in list_changes.)",
9211
+ "description": "Validate every row against the table (required, types, ranges, enums, links, unknown\ncolumns, CHECK constraints, those that follow links included, filtered link targets (ref_where / ref_by), stale generated/identity values, missing inverse links, cycles of hierarchy and acyclic columns, front matter that cannot be read: code `unreadable`, with no column, for a note whose `table` line names the table but whose YAML is broken, which every other read leaves out). A CHECK violation has code `check` and the CHECK's name as `constraint` (every other code names its `column`), as in the `violations` of list_changes. Use it to find rows edited by hand that break the schema. Without `table`, every table is checked: each row then names its `table`, `tables_checked` counts the tables checked, and a table that cannot be checked is listed in `errors` ({table, error}) while the others are. The rows with violations are paged: `limit` (default 500, at most 5000) from `offset`; `total` counts them all. (Hand edits are also checked as they happen: see `violations` in list_changes.)",
9105
9212
  "inputSchema": {
9106
9213
  "additionalProperties": false,
9107
9214
  "properties": {
@@ -9214,6 +9321,10 @@ var OPERATIONS = [
9214
9321
  "type": "string",
9215
9322
  "description": "The CHECK's name (code check)."
9216
9323
  },
9324
+ "hint": {
9325
+ "type": "string",
9326
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
9327
+ },
9217
9328
  "code": {
9218
9329
  "type": "string",
9219
9330
  "enum": [
@@ -9667,6 +9778,10 @@ var OPERATIONS = [
9667
9778
  "type": "string",
9668
9779
  "description": "The CHECK's name (code check)."
9669
9780
  },
9781
+ "hint": {
9782
+ "type": "string",
9783
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
9784
+ },
9670
9785
  "code": {
9671
9786
  "type": "string",
9672
9787
  "enum": [
@@ -10110,6 +10225,10 @@ var OPERATIONS = [
10110
10225
  "type": "string",
10111
10226
  "description": "The CHECK's name (code check)."
10112
10227
  },
10228
+ "hint": {
10229
+ "type": "string",
10230
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
10231
+ },
10113
10232
  "code": {
10114
10233
  "type": "string",
10115
10234
  "enum": [
@@ -11193,6 +11312,10 @@ var OPERATIONS = [
11193
11312
  "type": "string",
11194
11313
  "description": "The CHECK's name (code check)."
11195
11314
  },
11315
+ "hint": {
11316
+ "type": "string",
11317
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
11318
+ },
11196
11319
  "code": {
11197
11320
  "type": "string",
11198
11321
  "enum": [
@@ -12630,6 +12753,10 @@ var OPERATIONS = [
12630
12753
  "type": "string",
12631
12754
  "description": "The CHECK's name (code check)."
12632
12755
  },
12756
+ "hint": {
12757
+ "type": "string",
12758
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
12759
+ },
12633
12760
  "code": {
12634
12761
  "type": "string",
12635
12762
  "enum": [
@@ -13040,6 +13167,10 @@ var OPERATIONS = [
13040
13167
  "type": "string",
13041
13168
  "description": "The CHECK's name (code check)."
13042
13169
  },
13170
+ "hint": {
13171
+ "type": "string",
13172
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
13173
+ },
13043
13174
  "code": {
13044
13175
  "type": "string",
13045
13176
  "enum": [
@@ -13506,7 +13637,7 @@ var OPERATIONS = [
13506
13637
  },
13507
13638
  {
13508
13639
  "name": "add_constraint",
13509
- "description": 'ALTER TABLE ADD CONSTRAINT `name` CHECK: `check` is a where filter every row must match,\ne.g. `{"value": {"gte": 1, "lte": 5}}`. A condition on a column the row leaves empty passes, like SQL;\ninside `or` / `and` / `not` an empty value is tested as it is (`{"exists": true}` there fails).\nA key may follow a link column to the row it names, as in queries: `{"parent.kind": "project"}`\n(further dots follow further links). An empty link passes at the top level and fails inside `or` / `and` /\n`not`; only the first link of a longer path is skipped when empty (`parent.parent.kind` fails for a row\nwhose parent has no parent). A link to a row that does not exist fails; on a list of links every linked\nrow must match. `not` turns that into a pass: `{"not": {"parent.kind": "area"}}` passes a link to a\nmissing row, so add `"parent.kind": {"exists": true}` to require a real one. Links resolve as in the\nvault (by path, from the row\'s note: same-named rows in two folders stay apart); renaming or moving a\nlinked row keeps them (they follow it).\nRefused while existing rows violate it (they are listed); then enforced on every write, by the same rule.\nA write that changes a linked row re-checks the rows that link to it and is refused, listing them, when\nit breaks them, naming the changed row (in a batch, re-link them first: each step is checked on the vault\nthe earlier ones left); the inverse links a write adds, undo_migration and restore_table are checked too.\nrename_column / rename_value follow into CHECKs; drop_column of a column a CHECK reads is refused.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
13640
+ "description": 'ALTER TABLE ADD CONSTRAINT `name` CHECK: `check` is a where filter every row must match,\ne.g. `{"value": {"gte": 1, "lte": 5}}`. A condition on a column the row leaves empty passes, like SQL;\ninside `or` / `and` / `not` an empty value is tested as it is (`{"exists": true}` there fails).\nA key may follow a link column to the row it names, as in queries: `{"parent.kind": "project"}`\n(further dots follow further links). An empty link passes at the top level and fails inside `or` / `and` /\n`not`; only the first link of a longer path is skipped when empty (`parent.parent.kind` fails for a row\nwhose parent has no parent). A link to a row that does not exist fails; on a list of links every linked\nrow must match. `not` turns that into a pass: `{"not": {"parent.kind": "area"}}` passes a link to a\nmissing row, so add `"parent.kind": {"exists": true}` to require a real one. Links resolve as in the\nvault (by path, from the row\'s note: same-named rows in two folders stay apart); renaming or moving a\nlinked row keeps them (they follow it).\nRefused while existing rows violate it (they are listed); then enforced on every write, by the same rule.\nA write that changes a linked row re-checks the rows that link to it and is refused, listing them, when\nit breaks them, naming the changed row (in a batch, re-link them first: each step is checked on the vault\nthe earlier ones left); the inverse links a write adds, undo_migration and restore_table are checked too.\nrename_column / rename_value follow into CHECKs; drop_column of a column a CHECK reads is refused.\n`hint`: what to do when a row breaks the rule, in your words; a refused write puts it first in its hint, and each violation of the CHECK carries it.\n\nThe schema changes only through operations like this one: never edit metastore.yaml by hand (no validation, no undo).',
13510
13641
  "inputSchema": {
13511
13642
  "additionalProperties": false,
13512
13643
  "properties": {
@@ -13520,6 +13651,18 @@ var OPERATIONS = [
13520
13651
  "additionalProperties": true,
13521
13652
  "type": "object"
13522
13653
  },
13654
+ "hint": {
13655
+ "anyOf": [
13656
+ {
13657
+ "type": "string"
13658
+ },
13659
+ {
13660
+ "type": "null"
13661
+ }
13662
+ ],
13663
+ "default": null,
13664
+ "description": "What a refused write tells the agent when a row breaks this CHECK: how to fix the row. It comes first in the refusal's hint; describe_table lists it in constraint_hints."
13665
+ },
13523
13666
  "dry_run": {
13524
13667
  "default": false,
13525
13668
  "type": "boolean"
@@ -13630,6 +13773,10 @@ var OPERATIONS = [
13630
13773
  "type": "string",
13631
13774
  "description": "The CHECK's name (code check)."
13632
13775
  },
13776
+ "hint": {
13777
+ "type": "string",
13778
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
13779
+ },
13633
13780
  "code": {
13634
13781
  "type": "string",
13635
13782
  "enum": [
@@ -14028,6 +14175,10 @@ var OPERATIONS = [
14028
14175
  "type": "string",
14029
14176
  "description": "The CHECK's name (code check)."
14030
14177
  },
14178
+ "hint": {
14179
+ "type": "string",
14180
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
14181
+ },
14031
14182
  "code": {
14032
14183
  "type": "string",
14033
14184
  "enum": [
@@ -14493,6 +14644,10 @@ var OPERATIONS = [
14493
14644
  "type": "string",
14494
14645
  "description": "The CHECK's name (code check)."
14495
14646
  },
14647
+ "hint": {
14648
+ "type": "string",
14649
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
14650
+ },
14496
14651
  "code": {
14497
14652
  "type": "string",
14498
14653
  "enum": [
@@ -14887,6 +15042,10 @@ var OPERATIONS = [
14887
15042
  "type": "string",
14888
15043
  "description": "The CHECK's name (code check)."
14889
15044
  },
15045
+ "hint": {
15046
+ "type": "string",
15047
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
15048
+ },
14890
15049
  "code": {
14891
15050
  "type": "string",
14892
15051
  "enum": [
@@ -15312,6 +15471,10 @@ var OPERATIONS = [
15312
15471
  "type": "string",
15313
15472
  "description": "The CHECK's name (code check)."
15314
15473
  },
15474
+ "hint": {
15475
+ "type": "string",
15476
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
15477
+ },
15315
15478
  "code": {
15316
15479
  "type": "string",
15317
15480
  "enum": [
@@ -15724,6 +15887,10 @@ var OPERATIONS = [
15724
15887
  "type": "string",
15725
15888
  "description": "The CHECK's name (code check)."
15726
15889
  },
15890
+ "hint": {
15891
+ "type": "string",
15892
+ "description": "The CHECK's own hint (code check), when the constraint has one: how to fix the row."
15893
+ },
15727
15894
  "code": {
15728
15895
  "type": "string",
15729
15896
  "enum": [