@ai-matrx/records 0.56.0 → 0.57.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
1
1
  # Changelog — @ai-matrx/records
2
2
 
3
+ ## 0.57.1 (unpublished — lane RECORDS-UI-FIX, guide re-walk 2026-09-23)
4
+
5
+ * **A refusal is not an app error.** The default error sink printed every refusal through
6
+ `console.error`, and matrx-frontend's error capture counts every `console.error`, so one
7
+ refused value lit a red "2 errors" pill. The codes a person causes (`refused_by_rule`,
8
+ `stale_write`, `invalid_argument`, `already_exists`, `missing_reference`) now go to
9
+ `console.info`; everything else stays `console.error`. New exports (core):
10
+ `isAPersonsRefusal`, `A_PERSONS_REFUSAL`. Test: `src/__tests__/a-refusal-is-never-an-app-error.test.ts`.
11
+ * **Every screen hears the writes made on its page.** `recordUpdate`, `recordDelete`,
12
+ `recordRestore`, `restoreVersion` and `valueRestore` announce the record they wrote on
13
+ success. New exports: core `announceRecordChanged` / `onRecordChanged`, react
14
+ `useRecordChangeRevision(recordId)`; `useRecord` re-reads on it.
15
+
16
+ ## Unreleased — STORE-RULE-GAPS (2026-09-23)
17
+
18
+ * `FieldRule` gains `example` (a pattern's "how to write it") and `min` (a length's shortest);
19
+ `value` is optional for a min-only length rule. `NewFieldDeclaration.allow_other` (sent as
20
+ `config.allow_other`) and `FieldPatch.allow_other`; `allowsOtherValues(field)`.
21
+ `PredictedRefusal.detail`.
22
+ * The mirror predicts the store's new sentences word for word ("… has to be at least 20
23
+ characters long"; a pattern with an example hints "Enter it like …" with `detail.example`),
24
+ and no longer predicts a refusal for a list value that is not a uuid — the store holds option
25
+ KEYS (CHOICE-VALUE) and a list that takes other values adds an unknown word.
26
+ * Needs matrx-frontend `storerulegaps_an_example_a_shortest_length_and_other_choices.sql`.
27
+
28
+ ## 0.57.0
29
+
30
+ **The grid primitives are live, so their doors are in the catalogue.** (published by lane
31
+ PUBLISH-SWEEP-4; built by GRID-PRIMITIVES.) The 2026-09-23 chair window applied G1–G8 to the main
32
+ database and `pnpm records:generate` was re-run (`8df00afbb3`, `fa3434f967`): `store.generated.ts`
33
+ now lists 605 doors, so `tableDecorate`, `gridLayout`, `actionRun`, the table webhooks and the rest
34
+ of 0.56.0's grid methods reach the store instead of answering `door_absent`.
35
+
36
+ * **`recordChangeTrigger(tableId, { actions, changedFields })`** (G8) builds the event-schedule
37
+ trigger that runs an agent when a row changes, the same way in either store; the scheduler's
38
+ one matcher hears it, and the store switch is honoured.
39
+ * **`54000` maps to `store_limit`.** The grid doors refuse past an organization ceiling
40
+ (`custom/example_rows_max`, `custom/table_webhooks_max`, the action-selection and decoration
41
+ limits) with 54000 and the knob named in the hint; before this it would have read as `internal`.
42
+ * The refusal census now exempts exactly one raise: `custom.action_run`'s self-caught P0001 probe,
43
+ and only while it is the sole raiser and the probe sentence is still in the live body.
44
+
45
+ Suite 111/111, `check:store-registry` OK against the live store.
46
+
3
47
  ## 0.56.0
4
48
 
5
49
  **A Person or File column takes an id** (lane RELATION-TARGETS): `coerceTypedAnswer`'s member and
@@ -2199,6 +2199,7 @@ __export(core_exports, {
2199
2199
  ARCHIVE_LANES: () => ARCHIVE_LANES,
2200
2200
  ARCHIVE_LANE_LABEL: () => ARCHIVE_LANE_LABEL,
2201
2201
  ARCHIVE_LANE_MEANS: () => ARCHIVE_LANE_MEANS,
2202
+ A_PERSONS_REFUSAL: () => A_PERSONS_REFUSAL,
2202
2203
  COMPUTE_ON: () => COMPUTE_ON,
2203
2204
  CONTEXT_POLICIES: () => CONTEXT_POLICIES,
2204
2205
  DECLARABLE_FIELD_KINDS: () => DECLARABLE_FIELD_KINDS,
@@ -2245,6 +2246,8 @@ __export(core_exports, {
2245
2246
  VALUE_ALTERNATE_KEYS: () => VALUE_ALTERNATE_KEYS,
2246
2247
  VALUE_ENVELOPE_KEYS: () => VALUE_ENVELOPE_KEYS,
2247
2248
  actionRefusals: () => actionRefusals,
2249
+ allowsOtherValues: () => allowsOtherValues,
2250
+ announceRecordChanged: () => announceRecordChanged,
2248
2251
  archivedByLine: () => archivedByLine,
2249
2252
  archivedWhen: () => archivedWhen,
2250
2253
  asPermissionLevel: () => asPermissionLevel,
@@ -2277,6 +2280,7 @@ __export(core_exports, {
2277
2280
  importXlsx: () => importXlsx,
2278
2281
  indexedDbStore: () => indexedDbStore,
2279
2282
  intersectIds: () => intersectIds,
2283
+ isAPersonsRefusal: () => isAPersonsRefusal,
2280
2284
  isArchiveLane: () => isArchiveLane,
2281
2285
  isDecided: () => isDecided,
2282
2286
  isOwnOp: () => isOwnOp,
@@ -2291,6 +2295,7 @@ __export(core_exports, {
2291
2295
  mintClientKey: () => mintClientKey,
2292
2296
  mintOpId: () => mintOpId,
2293
2297
  ok: () => ok,
2298
+ onRecordChanged: () => onRecordChanged,
2294
2299
  openCaptureQueue: () => openCaptureQueue,
2295
2300
  optionKey: () => optionKey,
2296
2301
  optionLabel: () => optionLabel,
@@ -2305,6 +2310,7 @@ __export(core_exports, {
2305
2310
  predictValueRefusals: () => predictValueRefusals,
2306
2311
  predictWriteRefusals: () => predictWriteRefusals,
2307
2312
  publicFormPath: () => publicFormPath,
2313
+ recordChangeTrigger: () => recordChangeTrigger,
2308
2314
  rememberedOpCount: () => rememberedOpCount,
2309
2315
  sameDocument: () => sameDocument,
2310
2316
  scopeChip: () => scopeChip,
@@ -2438,6 +2444,11 @@ function highestLevel(left, right) {
2438
2444
  return ORDINAL[left] >= ORDINAL[right] ? left : right;
2439
2445
  }
2440
2446
 
2447
+ // src/field.ts
2448
+ function allowsOtherValues(field) {
2449
+ return field.type === "list" && field.config?.["allow_other"] === true;
2450
+ }
2451
+
2441
2452
  // src/choice.ts
2442
2453
  var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
2443
2454
  function optionKey(option) {
@@ -2828,6 +2839,15 @@ async function exportPageXlsx(page, labels = {}, sheetLabel = "Records") {
2828
2839
  }
2829
2840
  return XLSX.write(workbook, { type: "array", bookType: "xlsx", compression: true });
2830
2841
  }
2842
+ function recordChangeTrigger(tableId, options = {}) {
2843
+ return {
2844
+ type: "event",
2845
+ entity_type: `custom_record:${tableId}`,
2846
+ table_id: tableId,
2847
+ ...options.actions && options.actions.length > 0 ? { actions: options.actions } : {},
2848
+ ...options.changedFields && options.changedFields.length > 0 ? { changed_fields: options.changedFields } : {}
2849
+ };
2850
+ }
2831
2851
 
2832
2852
  // src/capture-queue.ts
2833
2853
  var DB_NAME = "matrx-capture";
@@ -3209,6 +3229,48 @@ var RULE_NODE_KINDS = [
3209
3229
  { node: "div", evaluated_by: "W1-RULE" },
3210
3230
  { node: "eq", evaluated_by: "W1-RULE" },
3211
3231
  { node: "field", evaluated_by: "W1-RULE" },
3232
+ { node: "fx.abs", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3233
+ { node: "fx.add", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3234
+ { node: "fx.and", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3235
+ { node: "fx.autonumber", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3236
+ { node: "fx.average", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3237
+ { node: "fx.blank", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3238
+ { node: "fx.concatenate", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3239
+ { node: "fx.contains", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3240
+ { node: "fx.created_time", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3241
+ { node: "fx.dateadd", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3242
+ { node: "fx.datediff", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3243
+ { node: "fx.day", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3244
+ { node: "fx.div", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3245
+ { node: "fx.eq", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3246
+ { node: "fx.gt", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3247
+ { node: "fx.gte", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3248
+ { node: "fx.if", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3249
+ { node: "fx.isblank", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3250
+ { node: "fx.left", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3251
+ { node: "fx.len", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3252
+ { node: "fx.lower", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3253
+ { node: "fx.lt", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3254
+ { node: "fx.lte", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3255
+ { node: "fx.max", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3256
+ { node: "fx.min", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3257
+ { node: "fx.mod", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3258
+ { node: "fx.modified_time", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3259
+ { node: "fx.month", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3260
+ { node: "fx.mul", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3261
+ { node: "fx.ne", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3262
+ { node: "fx.neg", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3263
+ { node: "fx.not", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3264
+ { node: "fx.now", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3265
+ { node: "fx.or", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3266
+ { node: "fx.right", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3267
+ { node: "fx.round", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3268
+ { node: "fx.sub", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3269
+ { node: "fx.sum", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3270
+ { node: "fx.today", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3271
+ { node: "fx.trim", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3272
+ { node: "fx.upper", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3273
+ { node: "fx.year", evaluated_by: "GRID-PRIMITIVES G3 (custom.formula_eval)" },
3212
3274
  { node: "gt", evaluated_by: "W1-RULE" },
3213
3275
  { node: "gte", evaluated_by: "W1-RULE" },
3214
3276
  { node: "length", evaluated_by: "W1-RULE" },
@@ -3240,6 +3302,8 @@ var KERNEL_TABLES = [
3240
3302
  ];
3241
3303
  var STORE_DOORS = [
3242
3304
  { name: "absence_reasons", args: "", returns: "text[]", security: "invoker" },
3305
+ { name: "action_declare", args: "p_organization_id uuid, p_table_id uuid, p_actions jsonb", returns: "jsonb", security: "definer" },
3306
+ { name: "action_run", args: "p_organization_id uuid, p_action_id uuid, p_record_ids uuid[]", returns: "jsonb", security: "definer" },
3243
3307
  { name: "actor_vocabulary", args: "", returns: "text[]", security: "invoker" },
3244
3308
  { name: "actor_word", args: "p_declared text", returns: "text", security: "invoker" },
3245
3309
  { name: "addressed_cap", args: "p_user_id uuid, p_type text, p_id uuid, p_organization_id uuid DEFAULT NULL::uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "permission_level", security: "definer" },
@@ -3291,6 +3355,7 @@ var STORE_DOORS = [
3291
3355
  { name: "assert_organization_admin", args: "p_organization_id uuid, p_door text, p_what text", returns: "void", security: "invoker" },
3292
3356
  { name: "assert_organization_wall", args: "p_kind text, p_organization_id uuid, p_row jsonb", returns: "void", security: "invoker" },
3293
3357
  { name: "assert_store_door", args: "p_organization_id uuid, p_door text", returns: "void", security: "invoker" },
3358
+ { name: "autonumber_backfill", args: "p_organization_id uuid, p_field_id uuid", returns: "jsonb", security: "definer" },
3294
3359
  { name: "booking_cancel", args: "p_booking_ref text, p_origin text DEFAULT NULL::text", returns: "TABLE(booking_ref text, record_id uuid, slot_key text, state text, message text)", security: "definer" },
3295
3360
  { name: "booking_confirm", args: "p_form_id uuid, p_hold_id uuid, p_origin text, p_payload jsonb, p_bucket text, p_honeypot text DEFAULT NULL::text, p_client_key text DEFAULT NULL::text", returns: "TABLE(booking_ref text, record_id uuid, submission_id uuid, slot_key text, slot_at timestamp with time zone, state text, message text)", security: "definer" },
3296
3361
  { name: "booking_declare", args: "p_organization_id uuid, p_table_id uuid, p_title text, p_questions jsonb, p_availability jsonb DEFAULT '{}'::jsonb, p_presentation jsonb DEFAULT '{}'::jsonb, p_submission_cap integer DEFAULT NULL::integer, p_quarantine_rule_id uuid DEFAULT NULL::uuid, p_notify_rule_id uuid DEFAULT NULL::uuid, p_form_id uuid DEFAULT NULL::uuid, p_slug text DEFAULT NULL::text, p_home_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
@@ -3363,6 +3428,8 @@ var STORE_DOORS = [
3363
3428
  { name: "dashboard_stuck", args: "p_organization_id uuid, p_table_id uuid, p_state_key text, p_days integer DEFAULT 14, p_filter jsonb DEFAULT '{}'::jsonb, p_limit integer DEFAULT 50, p_required text DEFAULT 'viewer'::text", returns: "TABLE(record_id uuid, title text, state text, last_changed_at timestamp with time zone, days_unchanged numeric, measured_from text)", security: "definer" },
3364
3429
  { name: "dashboard_window_sql", args: "p_key text, p_window jsonb", returns: "text", security: "invoker" },
3365
3430
  { name: "dashboards", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(dashboard_id uuid, table_id uuid, name text, blocks jsonb, presentation jsonb, block_count integer, version integer, created_at timestamp with time zone, updated_at timestamp with time zone)", security: "definer" },
3431
+ { name: "decoration_colors", args: "", returns: "text[]", security: "invoker" },
3432
+ { name: "decoration_rule_ops", args: "", returns: "TABLE(op text, takes_value boolean, label text)", security: "invoker" },
3366
3433
  { name: "delete_cascade_closure", args: "p_organization_id uuid, p_record_id uuid", returns: "uuid[]", security: "invoker" },
3367
3434
  { name: "delete_preview", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
3368
3435
  { name: "delete_rule", args: "p_organization_id uuid, p_record_id uuid, p_apply boolean DEFAULT true", returns: "jsonb", security: "definer" },
@@ -3372,6 +3439,7 @@ var STORE_DOORS = [
3372
3439
  { name: "derived_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb, p_values jsonb DEFAULT NULL::jsonb", returns: "jsonb", security: "invoker" },
3373
3440
  { name: "derived_values", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
3374
3441
  { name: "derived_values_of", args: "v_rec custom.record", returns: "jsonb", security: "invoker" },
3442
+ { name: "display_format_ids", args: "", returns: "text[]", security: "invoker" },
3375
3443
  { name: "doc_content_hash", args: "p_body text", returns: "text", security: "invoker" },
3376
3444
  { name: "doc_format_value", args: "p_field_data jsonb, p_value jsonb", returns: "text", security: "invoker" },
3377
3445
  { name: "doc_letterhead", args: "p_organization_id uuid", returns: "jsonb", security: "definer" },
@@ -3450,8 +3518,13 @@ var STORE_DOORS = [
3450
3518
  { name: "form_slug", args: "p_organization_id uuid, p_title text, p_form_id uuid DEFAULT NULL::uuid", returns: "text", security: "invoker" },
3451
3519
  { name: "form_submit", args: "p_form_id uuid, p_origin text, p_payload jsonb, p_bucket text, p_honeypot text DEFAULT NULL::text, p_client_key text DEFAULT NULL::text", returns: "TABLE(submission_id uuid, record_id uuid, state text, message text)", security: "definer" },
3452
3520
  { name: "forms", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "TABLE(form_id uuid, table_id uuid, title text, slug text, published_at timestamp with time zone, closed_at timestamp with time zone, submission_cap integer, responses bigint, in_table bigint, held bigint, rejected bigint, state text, quarantine_rule_id uuid, notify_rule_id uuid, presentation jsonb)", security: "definer" },
3521
+ { name: "formula_eval", args: "p_organization_id uuid, p_expr jsonb, p_values jsonb, p_context jsonb DEFAULT '{}'::jsonb", returns: "jsonb", security: "invoker" },
3522
+ { name: "formula_node_kinds", args: "", returns: "TABLE(node text, min_args integer, max_args integer, result text, signature text, says text)", security: "invoker" },
3523
+ { name: "formula_parse", args: "p_organization_id uuid, p_table_id uuid, p_text text", returns: "jsonb", security: "definer" },
3453
3524
  { name: "formula_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb, p_values jsonb DEFAULT NULL::jsonb", returns: "jsonb", security: "invoker" },
3454
3525
  { name: "freshness_verdict", args: "p_written_at timestamp with time zone, p_ceiling_seconds numeric", returns: "jsonb", security: "definer" },
3526
+ { name: "grid_layout", args: "p_organization_id uuid, p_table_id uuid, p_view_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
3527
+ { name: "grid_layout_check", args: "p_layout jsonb, p_scope text DEFAULT 'view'::text", returns: "jsonb", security: "invoker" },
3455
3528
  { name: "guard_refusals_are_complete", args: "", returns: "TABLE(guard text, said text)", security: "invoker" },
3456
3529
  { name: "has_visibility", args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level", returns: "boolean", security: "definer" },
3457
3530
  { name: "has_visibility_at", args: "p_user_id uuid, p_type text, p_id uuid, p_required permission_level DEFAULT 'viewer'::permission_level, p_organization_id uuid DEFAULT NULL::uuid, p_min_version bigint DEFAULT NULL::bigint", returns: "boolean", security: "definer" },
@@ -3467,6 +3540,7 @@ var STORE_DOORS = [
3467
3540
  { name: "history_retention_set", args: "p_organization_id uuid, p_table_id uuid, p_days integer", returns: "integer", security: "definer" },
3468
3541
  { name: "home_add", args: "p_organization_id uuid, p_table_id uuid, p_home_record_id uuid", returns: "uuid", security: "definer" },
3469
3542
  { name: "home_relations", args: "", returns: "TABLE(table_id uuid, home_record_id uuid, organization_id uuid, relation_id uuid)", security: "invoker" },
3543
+ { name: "hub_changed_by", args: "p_organization_id uuid, p_kind text, p_ids uuid[]", returns: "TABLE(id uuid, at timestamp with time zone, who text)", security: "definer" },
3470
3544
  { name: "inbound_addresses", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
3471
3545
  { name: "inbound_declare", args: "p_organization_id uuid, p_table_id uuid, p_label text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
3472
3546
  { name: "inbound_domain", args: "p_organization_id uuid", returns: "text", security: "invoker" },
@@ -3535,6 +3609,7 @@ var STORE_DOORS = [
3535
3609
  { name: "migrate_promote", args: "p_organization_id uuid, p_table_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
3536
3610
  { name: "migrate_purge", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_dry_run boolean DEFAULT true", returns: "jsonb", security: "definer" },
3537
3611
  { name: "migrate_purge_hard", args: "p_organization_id uuid, p_table_id uuid DEFAULT NULL::uuid, p_compliance_reason text DEFAULT NULL::text, p_chunk integer DEFAULT 200, p_dry_run boolean DEFAULT true", returns: "jsonb", security: "definer" },
3612
+ { name: "migrate_purge_hard_request", args: "p_organization_id uuid, p_table_id uuid, p_compliance_reason text", returns: "void", security: "definer" },
3538
3613
  { name: "migrate_reclass", args: "p_organization_id uuid, p_id uuid, p_to text DEFAULT 'field'::text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
3539
3614
  { name: "migrate_rename", args: "p_organization_id uuid, p_id uuid, p_to text, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
3540
3615
  { name: "migrate_reparent", args: "p_organization_id uuid, p_id uuid, p_parent_id uuid, p_note text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
@@ -3570,6 +3645,7 @@ var STORE_DOORS = [
3570
3645
  { name: "pipeline_pending", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
3571
3646
  { name: "pipeline_read", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
3572
3647
  { name: "pipeline_transition_refusal", args: "p_organization_id uuid, p_record_id uuid, p_to text", returns: "jsonb", security: "definer" },
3648
+ { name: "pipelines", args: "p_organization_id uuid", returns: "TABLE(table_id uuid, table_name text, stage_field text, stage_label text, stages integer, rules integer, broken text, updated_at timestamp with time zone, updated_by uuid)", security: "definer" },
3573
3649
  { name: "portal_admits", args: "p_organization_id uuid, p_user_id uuid DEFAULT NULL::uuid", returns: "boolean", security: "definer" },
3574
3650
  { name: "portal_archive", args: "p_organization_id uuid, p_portal_id uuid, p_confirm_title text, p_reason text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
3575
3651
  { name: "portal_card", args: "p_organization_id uuid, p_portal_id uuid", returns: "jsonb", security: "definer" },
@@ -3667,12 +3743,16 @@ var STORE_DOORS = [
3667
3743
  { name: "refusals_claiming_a_level_never_asked", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
3668
3744
  { name: "relation_carry", args: "p_organization_id uuid, p_container_id uuid, p_item_id uuid", returns: "uuid", security: "definer" },
3669
3745
  { name: "relation_edges_withdraw", args: "p_organization_id uuid, p_field_ids uuid[], p_why text", returns: "integer", security: "definer" },
3746
+ { name: "relation_halves_disagreements", args: "p_organization_id uuid DEFAULT NULL::uuid, p_record_id uuid DEFAULT NULL::uuid", returns: "TABLE(organization_id uuid, record_id uuid, field_key text, field_id uuid, target_id uuid, direction text, remedy text, why text)", security: "definer" },
3747
+ { name: "relation_halves_repair", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "definer" },
3748
+ { name: "relation_kernel_record", args: "p_organization_id uuid, p_kernel_table_id uuid, p_id uuid", returns: "uuid", security: "definer" },
3670
3749
  { name: "relation_own", args: "p_organization_id uuid, p_owner_id uuid, p_target_id uuid", returns: "uuid", security: "definer" },
3671
3750
  { name: "relation_target_card", args: "p_organization_id uuid, p_record_id uuid, p_via_key text DEFAULT NULL::text", returns: "TABLE(target_id uuid, target_organization_id uuid, is_foreign boolean, masked boolean, reader_level permission_level, card jsonb, why text)", security: "definer" },
3672
3751
  { name: "relation_target_external", args: "p_connection_token text, p_external_table text, p_external_key text", returns: "jsonb", security: "definer" },
3673
3752
  { name: "relation_target_ours", args: "p_entity_token text, p_row_id uuid", returns: "jsonb", security: "definer" },
3674
3753
  { name: "relation_targets", args: "p_organization_id uuid, p_record_id uuid, p_via_key text", returns: "SETOF uuid", security: "definer" },
3675
3754
  { name: "relation_uncarry", args: "p_organization_id uuid, p_container_id uuid, p_item_id uuid", returns: "integer", security: "definer" },
3755
+ { name: "relation_value_target_ok", args: "p_organization_id uuid, p_field_id uuid, p_field_data jsonb, p_target_id uuid", returns: "boolean", security: "invoker" },
3676
3756
  { name: "relation_words", args: "p_organization_id uuid, p_field_id uuid, p_value text", returns: "text", security: "definer" },
3677
3757
  { name: "relation_words_many", args: "p_organization_id uuid, p_field_id uuid, p_record_ids uuid[]", returns: "TABLE(record_id uuid, words text)", security: "definer" },
3678
3758
  { name: "reopen_declared_doors", args: "", returns: "TABLE(reopened text)", security: "definer" },
@@ -3681,6 +3761,7 @@ var STORE_DOORS = [
3681
3761
  { name: "resolve_id", args: "p_organization_id uuid, p_id uuid", returns: "uuid", security: "invoker" },
3682
3762
  { name: "retired_actor_words", args: "", returns: "jsonb", security: "invoker" },
3683
3763
  { name: "rollup_value", args: "p_organization_id uuid, p_record_id uuid, p_field_data jsonb", returns: "jsonb", security: "invoker" },
3764
+ { name: "row_actions", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
3684
3765
  { name: "rule_applies", args: "p_organization_id uuid, p_rule_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
3685
3766
  { name: "rule_context", args: "p_organization_id uuid, p_record_id uuid", returns: "jsonb", security: "invoker" },
3686
3767
  { name: "rule_declare", args: "p_organization_id uuid, p_spec jsonb, p_rule_id uuid DEFAULT NULL::uuid", returns: "uuid", security: "definer" },
@@ -3706,6 +3787,7 @@ var STORE_DOORS = [
3706
3787
  { name: "share_revoke", args: "p_organization_id uuid, p_subject_id uuid, p_principal_kind text, p_principal_id uuid", returns: "jsonb", security: "definer" },
3707
3788
  { name: "share_subject_name", args: "p_organization_id uuid, p_type text, p_id uuid", returns: "text", security: "definer" },
3708
3789
  { name: "shared_only_disagreements", args: "p_pretend text DEFAULT NULL::text", returns: "TABLE(organization_id uuid, organization_name text, member_id uuid, record_id uuid, table_id uuid, ladder boolean, read_door boolean, rls_mirror boolean, why text)", security: "invoker" },
3790
+ { name: "shares_outside", args: "p_organization_id uuid", returns: "TABLE(invitation_id uuid, table_id uuid, table_name text, email text, level text, level_label text, status text, joined boolean, expired boolean, invited_at timestamp with time zone, expires_at timestamp with time zone, say text)", security: "definer" },
3709
3791
  { name: "sign_request_cancel", args: "p_organization_id uuid, p_request_id uuid, p_reason text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
3710
3792
  { name: "sign_request_create", args: "p_organization_id uuid, p_render_id uuid, p_field_key text, p_signer_email text, p_signer_name text, p_expires_in interval DEFAULT '14 days'::interval", returns: "jsonb", security: "definer" },
3711
3793
  { name: "sign_request_decline", args: "p_token text, p_reason text DEFAULT NULL::text, p_ip text DEFAULT NULL::text, p_user_agent text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
@@ -3739,6 +3821,9 @@ var STORE_DOORS = [
3739
3821
  { name: "table_column_source", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "invoker" },
3740
3822
  { name: "table_contents", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(record_id uuid, kind text, goes_at integer)", security: "invoker" },
3741
3823
  { name: "table_declare", args: "p_organization_id uuid, p_spec jsonb", returns: "uuid", security: "definer" },
3824
+ { name: "table_decorate", args: "p_organization_id uuid, p_table_id uuid, p_path text[], p_value jsonb DEFAULT NULL::jsonb", returns: "jsonb", security: "definer" },
3825
+ { name: "table_decorations", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "definer" },
3826
+ { name: "table_from_example", args: "p_organization_id uuid, p_home_id uuid, p_example jsonb", returns: "jsonb", security: "definer" },
3742
3827
  { name: "table_has_a_visible_record", args: "p_user uuid, p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "definer" },
3743
3828
  { name: "table_is_live", args: "p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "invoker" },
3744
3829
  { name: "table_is_options_table", args: "p_organization_id uuid, p_table_id uuid", returns: "boolean", security: "invoker" },
@@ -3756,9 +3841,13 @@ var STORE_DOORS = [
3756
3841
  { name: "table_storage", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "invoker" },
3757
3842
  { name: "table_type_field", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "definer" },
3758
3843
  { name: "table_unique_rule_fields", args: "p_organization_id uuid, p_table_id uuid", returns: "jsonb", security: "invoker" },
3844
+ { name: "table_webhook_archive", args: "p_organization_id uuid, p_webhook_id uuid", returns: "boolean", security: "definer" },
3845
+ { name: "table_webhook_declare", args: "p_organization_id uuid, p_table_id uuid, p_target_url text, p_events text[] DEFAULT NULL::text[], p_description text DEFAULT NULL::text", returns: "jsonb", security: "definer" },
3846
+ { name: "table_webhooks", args: "p_organization_id uuid, p_table_id uuid", returns: "TABLE(webhook_id uuid, target_url text, description text, events text[], is_active boolean, last_attempt_at timestamp with time zone, last_success_at timestamp with time zone, consecutive_failures integer, owner_id uuid, created_at timestamp with time zone)", security: "definer" },
3759
3847
  { name: "table_work_kind", args: "p_organization_id uuid, p_table_id uuid", returns: "text", security: "invoker" },
3760
3848
  { name: "tables_at_home", args: "p_organization_id uuid, p_home_ids uuid[]", returns: "TABLE(table_id uuid, home_record_id uuid, kind text)", security: "definer" },
3761
3849
  { name: "tables_described_without_asking", args: "", returns: "TABLE(function_name text, identity_args text, why text)", security: "invoker" },
3850
+ { name: "tables_shared_with_me", args: "", returns: "TABLE(table_id uuid, organization_id uuid, organization text, table_name text, level text, level_label text, shared_at timestamp with time zone, opens boolean, say text)", security: "definer" },
3762
3851
  { name: "trg_associations_bump_visibility", args: "", returns: "trigger", security: "definer" },
3763
3852
  { name: "undeclared_keys", args: "p_organization_id uuid, p_table_id uuid, p_data jsonb", returns: "text[]", security: "invoker" },
3764
3853
  { name: "validate_custom_fields", args: "p_token text, p_organization_id uuid, p_values jsonb", returns: "void", security: "invoker" },
@@ -3820,9 +3909,10 @@ var STORE_DOORS = [
3820
3909
  ];
3821
3910
  var STORE_KNOBS = [
3822
3911
  { key: "accessible_entity_ids_guard", value: "true", type: "boolean" },
3912
+ { key: "action_run_records_max", value: "5000", type: "integer" },
3823
3913
  { key: "agent_schema_changes", value: '"ask"', type: "string" },
3824
3914
  { key: "associations_guard", value: "true", type: "boolean" },
3825
- { key: "code_paths_enabled", value: "false", type: "boolean" },
3915
+ { key: "code_paths_enabled", value: "true", type: "boolean" },
3826
3916
  { key: "consumer_chat_seeding_enabled", value: "false", type: "boolean" },
3827
3917
  { key: "consumer_checkout_enabled", value: "false", type: "boolean" },
3828
3918
  { key: "consumer_context_enabled", value: "false", type: "boolean" },
@@ -3834,6 +3924,8 @@ var STORE_KNOBS = [
3834
3924
  { key: "consumer_scopes_enabled", value: "false", type: "boolean" },
3835
3925
  { key: "containment_depth_ceiling", value: "16", type: "integer" },
3836
3926
  { key: "cross_organization_links", value: "false", type: "boolean" },
3927
+ { key: "decoration_rules_max", value: "50", type: "integer" },
3928
+ { key: "decorations_max_bytes", value: "262144", type: "integer" },
3837
3929
  { key: "document_letterhead", value: "{}", type: "json" },
3838
3930
  { key: "document_max_bytes", value: "1048576", type: "integer" },
3839
3931
  { key: "emergency_door_guard", value: "false", type: "boolean" },
@@ -3845,10 +3937,12 @@ var STORE_KNOBS = [
3845
3937
  { key: "enrichment_sensitivity_ceiling", value: '"internal"', type: "string" },
3846
3938
  { key: "entity_custom_fields_guard", value: "false", type: "boolean" },
3847
3939
  { key: "entity_types_guard", value: "false", type: "boolean" },
3940
+ { key: "example_rows_max", value: "500", type: "integer" },
3848
3941
  { key: "export_rows_ceiling", value: "100000", type: "integer" },
3849
3942
  { key: "external_principal_enabled", value: "false", type: "boolean" },
3850
3943
  { key: "field_index_guard", value: "false", type: "boolean" },
3851
3944
  { key: "field_sensitivity_levels", value: '{"edit": {"public": "editor", "internal": "editor", "restricted": "admin", "confidential": "admin"}, "read": {"public": "viewer", "internal": "viewer", "restricted": "admin", "confidential": "editor"}}', type: "json" },
3945
+ { key: "grid_layout", value: '{"mode": "auto", "wrap": false, "row_height": "normal", "fit_max_columns": 8, "freeze_first_column": false}', type: "json" },
3852
3946
  { key: "inbound_domain", value: '"inbound.matrxserver.com"', type: "string" },
3853
3947
  { key: "member_default_level", value: '"viewer"', type: "enum" },
3854
3948
  { key: "member_default_visibility", value: '"all_records"', type: "enum" },
@@ -3856,6 +3950,8 @@ var STORE_KNOBS = [
3856
3950
  { key: "page_size_ceiling", value: "1000", type: "integer" },
3857
3951
  { key: "provenance_retention_days", value: "30", type: "number" },
3858
3952
  { key: "records_tool_default", value: "true", type: "boolean" },
3953
+ { key: "row_action_steps_max", value: "60", type: "integer" },
3954
+ { key: "row_actions_max", value: "24", type: "integer" },
3859
3955
  { key: "row_versions_guard", value: "false", type: "boolean" },
3860
3956
  { key: "sandbox_expanded_frame_height_px", value: "20000", type: "integer" },
3861
3957
  { key: "sandbox_frame_height_px", value: "4000", type: "integer" },
@@ -3863,27 +3959,30 @@ var STORE_KNOBS = [
3863
3959
  { key: "sandbox_org_components", value: "true", type: "boolean" },
3864
3960
  { key: "signup_provisioning_guard", value: "false", type: "boolean" },
3865
3961
  { key: "stage_rule_enforcement", value: '"refuse"', type: "enum" },
3866
- { key: "system_enabled", value: "false", type: "boolean" },
3962
+ { key: "system_enabled", value: "true", type: "boolean" },
3867
3963
  { key: "table_record_ceiling", value: "150000", type: "integer" },
3964
+ { key: "table_webhooks_max", value: "10", type: "integer" },
3868
3965
  { key: "value_max_bytes", value: "100000", type: "integer" },
3869
3966
  { key: "world_publish_enabled", value: "false", type: "boolean" }
3870
3967
  ];
3871
3968
  var STORE_REFUSAL_CODES = [
3872
- { code: "02000", raised_by: "_checklist_instantiate,_portal_invite_payload,_share_write_person,_table_share_invite_payload,checklist_declare,checklist_run,checklist_step_complete,checklist_step_refusal,checklist_template_shape,conversation_scope_bind,dashboard_delete,dashboard_run,doc_letterhead,doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_delete,doc_template_read,doc_template_save,enrich_pin,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,io_restore,migrate_delete,migrate_extract_parent,migrate_merge,migrate_reclass,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,portal_archive,portal_card,portal_declare,portal_invite,portal_invite_accept,portal_preview,portal_principal_bind,portal_restore,portal_revoke,read_record,record_delete,record_restore,record_restore_preview,record_table,record_update,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,sign_request_cancel,sign_request_create,sign_request_remind,sign_request_unchanged,table_archive,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,table_share_outside_revoke,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
3969
+ { code: "02000", raised_by: "_checklist_instantiate,_portal_invite_payload,_share_write_person,_table_share_invite_payload,checklist_declare,checklist_run,checklist_step_complete,checklist_step_refusal,checklist_template_shape,conversation_scope_bind,dashboard_delete,dashboard_run,doc_letterhead,doc_render_body,doc_render_document,doc_render_read,doc_sign,doc_signature_intact,doc_signature_read,doc_template_delete,doc_template_read,doc_template_save,enrich_pin,entity_field_retire,entity_field_update,entity_record_read,entity_value_write,external_history_event,external_rows,external_stub_upsert,external_writes_set,io_restore,migrate_delete,migrate_extract_parent,migrate_merge,migrate_reclass,migrate_rename,migrate_reparent,migrate_retype,migrate_split,migrate_undo,organization_clear,portal_archive,portal_card,portal_declare,portal_invite,portal_invite_accept,portal_preview,portal_principal_bind,portal_restore,portal_revoke,read_record,record_delete,record_restore,record_restore_preview,record_table,record_update,relation_halves_repair,relation_uncarry,share_access,share_grant,share_lane_set,share_people,share_revoke,sign_request_cancel,sign_request_create,sign_request_remind,sign_request_unchanged,table_archive,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,table_share_outside_revoke,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_assign,work_record_states,work_set_state" },
3873
3970
  { code: "0A000", raised_by: "checklist_step_complete,external_rows,external_source_declare,external_write_through,promote_field,promoted_index_expr,promoted_query_sql,promoted_read,rule_eval,work_assign" },
3874
3971
  { code: "22003", raised_by: "context_resolve" },
3875
- { code: "22004", raised_by: "_entity_custom_fields_guard,_share_write_person,_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,booking_declare,capture_submit,checklist_declare,context_resolve,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,enrich_land,enrich_normalize,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,field_history,form_declare,form_submit,home_add,io_comment_write,io_import_begin,io_infer_column,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_purge_hard,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,pipeline_declare,pipeline_gate_preview,portal_declare,portal_invite,portal_principal_bind,provenance_retention_days,provenance_write,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,record_write_graph,record_write_many,relation_carry,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,subscription_declare,table_archive,table_declare,table_share_outside_invite,value_restore,view_declare,work_approval_decide,work_approval_request,work_template_declare" },
3972
+ { code: "22004", raised_by: "_entity_custom_fields_guard,_share_write_person,_value_envelope,actor_word,agg_assert_key,agg_sql,anon_capture,anon_token_issue,anon_write,assert_client_may_reach,booking_declare,capture_submit,checklist_declare,context_resolve,dashboard_block_normalize,dashboard_declare,dashboard_window_sql,doc_render_write,doc_sign,doc_signature_write,doc_template_save,enrich_land,enrich_normalize,external_history_event,external_rows,external_source_declare,external_stub_upsert,external_write_through,external_writes_set,field_history,form_declare,form_submit,home_add,io_comment_write,io_import_begin,io_infer_column,io_outbox_drain,io_restore,migrate_choice_keys,migrate_purge,migrate_purge_hard,migrate_reclass,migrate_split,migrate_undo,organization_clear,organization_contents,pipeline_declare,pipeline_gate_preview,portal_declare,portal_invite,portal_principal_bind,provenance_retention_days,provenance_write,query_across_homes,query_by_coordinates,query_rollup,record_delete,record_reparent,record_resolve,record_restore,record_update,record_write,record_write_graph,record_write_many,relation_carry,relation_halves_repair,relation_own,rule_declare,share_grant,sign_request_create,sign_request_sign,subscription_declare,table_archive,table_declare,table_share_outside_invite,value_restore,view_declare,work_approval_decide,work_approval_request,work_template_declare" },
3876
3973
  { code: "22007", raised_by: "dashboard_window_sql" },
3877
- { code: "22012", raised_by: "rule_eval" },
3878
- { code: "22023", raised_by: "_booking_availability,_entity_custom_fields_guard,_take_op_id,_value_envelope,_work_shape_guard,actor_word,agg_assert_key,agg_sql,anon_token_issue,booking_declare,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,field_update,io_export,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,list_portals,migrate_merge,migrate_reclass,my_levels,organization_clear,page_size,pin_agent_cells,pipeline_move,portal_declare,provenance_write,query_by_coordinates,query_rollup,read_records_archived,record_update,record_write_graph,record_write_many,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,sign_request_create,sign_request_sign,subscription_declare,table_rules,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
3879
- { code: "23503", raised_by: "_booking_availability,_checklist_instantiate,_containment_guard,_display_spec_for,_field_document_for,_field_type_parity_guard,_pipeline_stage_key,_record_rule_uses,agg_digest_assemble,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,booking_cancel,booking_confirm,booking_declare,booking_hold,booking_reschedule,capture_publish,checklist_declare,checklist_steps_table,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,enrich_declare,enrich_due,enrich_land,form_declare,form_submit,home_add,inbound_declare,inbound_mail_land,inbound_set,io_comment_write,io_import_begin,io_import_finish,io_import_report,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,pipeline_board,pipeline_declare,pipeline_move,pipeline_read,pipeline_transition_refusal,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_declare,rule_eval,rule_members,rule_run,sign_request_create,subscription_mute,subscription_preview,view_declare,work_set_state,work_take_assignment,work_template_instantiate" },
3974
+ { code: "22012", raised_by: "formula_eval,rule_eval" },
3975
+ { code: "22023", raised_by: "_action_check,_booking_availability,_decorations_check,_entity_custom_fields_guard,_fx_date,_fx_num,_fx_unit,_fxp_level,_fxp_resolve,_fxp_tokens,_take_op_id,_value_envelope,_work_shape_guard,action_run,actor_word,agg_assert_key,agg_sql,anon_token_issue,booking_declare,containment_parent,dashboard_block_normalize,dashboard_window_sql,doc_render_body,doc_render_write,doc_signature_write,enrich_declare,enrich_land,enrich_normalize,enrich_pin,entity_value_write,external_history_event,external_source_declare,external_stub_upsert,external_write_through,field_history,field_update,formula_eval,formula_parse,grid_layout_check,hub_changed_by,io_export,io_import_begin,io_import_finish,io_import_plan,io_import_report,io_proposal_accept,list_portals,migrate_merge,migrate_reclass,my_levels,organization_clear,page_size,pin_agent_cells,pipeline_move,portal_declare,provenance_write,query_by_coordinates,query_rollup,read_records_archived,record_update,record_write_graph,record_write_many,relation_carry,rule_eval,rule_members,share_grant,share_lane_set,sign_request_create,sign_request_sign,subscription_declare,table_from_example,table_rules,table_webhook_declare,visibility_as_of,work_approval_request,work_list,work_slot_hold" },
3976
+ { code: "23503", raised_by: "_action_check,_booking_availability,_checklist_instantiate,_containment_guard,_decorations_check,_display_spec_for,_field_document_for,_field_type_parity_guard,_pipeline_stage_key,_record_rule_uses,action_declare,action_run,agg_digest_assemble,anon_publish,anon_rate_take,anon_token_issue,anon_write,assert_organization_wall,autonumber_backfill,booking_cancel,booking_confirm,booking_declare,booking_hold,booking_reschedule,capture_publish,checklist_declare,checklist_steps_table,comment_write,dashboard_declare,delete_rule,doc_sign,doc_template_save,enrich_declare,enrich_due,enrich_land,form_declare,form_submit,grid_layout,home_add,inbound_declare,inbound_mail_land,inbound_set,io_comment_write,io_import_begin,io_import_finish,io_import_report,io_import_rows,io_proposal_accept,migrate_demote,migrate_promote,pipeline_board,pipeline_declare,pipeline_move,pipeline_read,pipeline_transition_refusal,promote_field,promote_table,record_applicability,record_reparent,relation_carry,relation_own,resolve_first_match,rule_applies,rule_declare,rule_eval,rule_members,rule_run,sign_request_create,subscription_mute,subscription_preview,table_decorate,table_from_example,table_webhook_archive,table_webhook_declare,view_declare,work_set_state,work_take_assignment,work_template_instantiate" },
3880
3977
  { code: "23505", raised_by: "_share_write_person,_unique_rule_holds,doc_sign,doc_signature_write,entity_field_declare,field_declare,home_add,inbound_declare,io_proposal_accept,relation_carry,relation_own,sign_request_cancel,sign_request_create,table_share_outside_resend,work_approval_decide,work_slot_hold" },
3881
- { code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_spec_for,_entity_custom_fields_guard,_field_class_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_relation_halves_agree,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_with_display,_work_shape_guard,_workdoors_approval_guard,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,checklist_declare,checklist_step_complete,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,io_comment_write,io_import_rows,migrate_merge,migrate_purge_hard,portal_archive,portal_restore,record_write_graph,relation_carry,relation_own,sign_request_create,sign_request_sign,table_declare,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
3978
+ { code: "23514", raised_by: "_checklist_instantiate,_checklist_step_guard,_containment_guard,_dated_values_guard,_derived_fields,_display_format_check,_display_spec_for,_entity_custom_fields_guard,_field_class_guard,_field_document_for,_field_shape_guard,_field_type_parity_guard,_merge_field_shape_guard,_merge_field_temporal_guard,_promoted_field_cap_guard,_record_rule_uses,_relation_halves_agree,_relation_kernel_targets,_resolve_choice_words,_rule_shape_guard,_rule_topology_guard,_store_relation_edge_names_its_field,_table_columns_word_guard,_table_shape_guard,_undeclared_key_guard,_value_envelope,_with_display,_work_shape_guard,_workdoors_approval_guard,action_run,assert_columns_are_defined,assert_entity_is_organization_scoped,booking_declare,capture_publish,capture_sheet_declare,checklist_declare,checklist_step_complete,doc_sign,doc_signature_write,doc_template_save,entity_field_declare,entity_field_retire,entity_field_update,entity_records_find,entity_table,field_declare,field_retire,field_update,home_add,io_comment_write,io_import_rows,migrate_merge,migrate_purge_hard,portal_archive,portal_restore,record_write_graph,relation_carry,relation_halves_repair,relation_own,sign_request_create,sign_request_sign,table_declare,table_from_example,validate_value_envelope,validate_values,work_set_state,work_slots_declare,work_take_assignment,work_template_instantiate" },
3882
3979
  { code: "40001", raised_by: "has_visibility_at" },
3883
- { code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,agent_table_claim,anon_capture,anon_inbound_land,anon_publish,anon_token_issue,anon_token_verify,anon_write,assert_client_may_change,assert_client_may_open,assert_client_may_reach,assert_may_know_table,assert_organization_admin,assert_store_door,booking_confirm,booking_declare,booking_hold,capture_submit,checklist_run,comment_write,conversation_scope_bind,conversation_scope_unbind,doc_sign,enrich_declare,enrich_due,enrich_land,enrich_normalize,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,inbound_mail_land,io_comment_resolve,io_comment_write,io_import_begin,io_import_finish,io_restore,migrate_purge,migrate_purge_hard,migrate_reclass,my_levels,organization_clear,portal_declare,portal_invitation,portal_invite,portal_invite_accept,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,read_records_archived,read_records_by_ids,read_records_matching,record_table,record_write_graph,share_grant,subscription_mute,subscription_preview,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
3980
+ { code: "42501", raised_by: "_doc_render_immutable,_doc_signature_immutable,_field_definition_write,_field_write_door,_rule_definition_write,_store_door,agent_table_claim,anon_capture,anon_inbound_land,anon_publish,anon_token_issue,anon_token_verify,anon_write,assert_client_may_change,assert_client_may_open,assert_client_may_reach,assert_may_know_table,assert_organization_admin,assert_store_door,booking_confirm,booking_declare,booking_hold,capture_submit,checklist_run,comment_write,conversation_scope_bind,conversation_scope_unbind,doc_sign,enrich_declare,enrich_due,enrich_land,enrich_normalize,entity_field_declare,entity_field_retire,entity_field_update,entity_value_write,external_write_through,form_declare,form_submit,inbound_mail_land,io_comment_resolve,io_comment_write,io_import_begin,io_import_finish,io_restore,migrate_purge,migrate_purge_hard,migrate_purge_hard_request,migrate_reclass,my_levels,organization_clear,portal_declare,portal_invitation,portal_invite,portal_invite_accept,portal_principal_bind,promote_table,query_visibility_parity,read_record,read_records,read_records_archived,read_records_by_ids,read_records_matching,record_table,record_write_graph,relation_halves_disagreements,relation_halves_repair,share_grant,subscription_mute,subscription_preview,table_share_outside_accept,table_share_outside_invite,table_share_outside_resend,table_webhook_declare,visibility_as_of,work_approval_decide,work_approval_read,work_approval_request,work_person" },
3884
3981
  { code: "42703", raised_by: "entity_table,portal_declare" },
3885
3982
  { code: "53400", raised_by: "anon_rate_take,delete_cascade_closure,enrich_due,enrich_land,promote_field" },
3983
+ { code: "54000", raised_by: "action_run,hub_changed_by,table_decorate,table_from_example,table_webhook_declare" },
3886
3984
  { code: "54001", raised_by: "record_delete" },
3985
+ { code: "P0001", raised_by: "action_run" },
3887
3986
  { code: "PT409", raised_by: "record_update" },
3888
3987
  { code: "PT428", raised_by: "_record_rule_uses" }
3889
3988
  ];
@@ -3914,6 +4013,7 @@ var ENTITY_TOKENS = [
3914
4013
  "agent_shortcut",
3915
4014
  "agent_surface_binding",
3916
4015
  "agent_template",
4016
+ "agent_term_list",
3917
4017
  "agent_usage",
3918
4018
  "agent_user_kv",
3919
4019
  "ai_api",
@@ -5516,6 +5616,13 @@ var BY_SQLSTATE = {
5516
5616
  // stack. It is a LIMIT of the store, and the store's own sentence names what
5517
5617
  // to do about it, so it reads as one.
5518
5618
  "54001": "store_limit",
5619
+ // 54000 — the grid primitives' organization ceilings (GRID-PRIMITIVES, 2026-09-23):
5620
+ // `custom.action_run` on a selection past its knob, `custom.table_decorate` past the
5621
+ // rule count, `custom.table_from_example` past `custom/example_rows_max`,
5622
+ // `custom.table_webhook_declare` past `custom/table_webhooks_max`, and
5623
+ // `custom.hub_changed_by`. Each names its knob in the hint and writes nothing, so it
5624
+ // reads exactly like 54001: a limit of the store, in the store's own sentence.
5625
+ "54000": "store_limit",
5519
5626
  // VIS: `custom.has_visibility_at` refuses to answer from a snapshot older
5520
5627
  // than a write this reader has already seen, rather than returning something
5521
5628
  // they just lost access to. It is retryable on a fresher connection, which is
@@ -5600,6 +5707,22 @@ function staleWriteDetail(error) {
5600
5707
  };
5601
5708
  }
5602
5709
 
5710
+ // src/core/recordChanges.ts
5711
+ var listeners = /* @__PURE__ */ new Set();
5712
+ function announceRecordChanged(recordId) {
5713
+ for (const listener of [...listeners]) {
5714
+ try {
5715
+ listener(recordId);
5716
+ } catch (thrown) {
5717
+ console.error("[@ai-matrx/records] a record-change listener threw", thrown);
5718
+ }
5719
+ }
5720
+ }
5721
+ function onRecordChanged(listener) {
5722
+ listeners.add(listener);
5723
+ return () => listeners.delete(listener);
5724
+ }
5725
+
5603
5726
  // src/core/query.ts
5604
5727
  var DEFAULT_PAGE_SIZE = 50;
5605
5728
  function planQuery(query) {
@@ -5641,12 +5764,22 @@ function intersectIds(sets) {
5641
5764
 
5642
5765
  // src/core/client.ts
5643
5766
  var DEFAULT_SCHEMA = "custom";
5767
+ var A_PERSONS_REFUSAL = /* @__PURE__ */ new Set([
5768
+ "refused_by_rule",
5769
+ "stale_write",
5770
+ "invalid_argument",
5771
+ "already_exists",
5772
+ "missing_reference"
5773
+ ]);
5774
+ function isAPersonsRefusal(code) {
5775
+ return A_PERSONS_REFUSAL.has(code);
5776
+ }
5644
5777
  function sink(config) {
5645
- return config.onError ?? ((e) => (
5646
- // The defined degradation, stated: loud, with the store's own words, and
5647
- // naming where it happened. Never silence.
5648
- console.error(`[@ai-matrx/records] ${e.where}: ${e.code} \u2014 ${e.message}${e.hint ? ` (${e.hint})` : ""}`)
5649
- ));
5778
+ return config.onError ?? ((e) => {
5779
+ const line = `[@ai-matrx/records] ${e.where}: ${e.code} \u2014 ${e.message}${e.hint ? ` (${e.hint})` : ""}`;
5780
+ if (isAPersonsRefusal(e.code)) console.info(line);
5781
+ else console.error(line);
5782
+ });
5650
5783
  }
5651
5784
  function createRecordsClient(config) {
5652
5785
  const schema = config.schema ?? DEFAULT_SCHEMA;
@@ -5753,21 +5886,26 @@ function createRecordsClient(config) {
5753
5886
  },
5754
5887
  "recordUpdate"
5755
5888
  );
5889
+ if (result.ok) announceRecordChanged(record_id);
5756
5890
  return result;
5757
5891
  },
5758
5892
  async recordDelete({ record_id }) {
5759
- return callDoor(
5893
+ const result = await callDoor(
5760
5894
  DOORS.recordDelete,
5761
5895
  { p_organization_id: org, p_record_id: record_id },
5762
5896
  "recordDelete"
5763
5897
  );
5898
+ if (result.ok) announceRecordChanged(record_id);
5899
+ return result;
5764
5900
  },
5765
5901
  async recordRestore({ record_id }) {
5766
- return callDoor(
5902
+ const result = await callDoor(
5767
5903
  DOORS.recordRestore,
5768
5904
  { p_organization_id: org, p_record_id: record_id },
5769
5905
  "recordRestore"
5770
5906
  );
5907
+ if (result.ok) announceRecordChanged(record_id);
5908
+ return result;
5771
5909
  },
5772
5910
  async tableArchive({ table_id, chunk, includeTable }) {
5773
5911
  return callDoor(
@@ -5817,6 +5955,24 @@ function createRecordsClient(config) {
5817
5955
  })
5818
5956
  );
5819
5957
  },
5958
+ async tableArchived({ table_id }) {
5959
+ const kernel = await callDoor(DOORS.tableKernelId, {}, "tableArchived.kernel");
5960
+ if (!kernel.ok) return err(kernel.error);
5961
+ const PAGE = 200;
5962
+ for (let page = 0; page < 25; page += 1) {
5963
+ const answered = await this.listArchived({
5964
+ table_id: kernel.data,
5965
+ lane: "org",
5966
+ limit: PAGE,
5967
+ offset: page * PAGE
5968
+ });
5969
+ if (!answered.ok) return err(answered.error);
5970
+ const hit = answered.data.rows.find((row) => row.id === table_id);
5971
+ if (hit) return ok(hit);
5972
+ if (answered.data.total !== null) return ok(null);
5973
+ }
5974
+ return ok(null);
5975
+ },
5820
5976
  async listArchived({ table_id, lane = DEFAULT_ARCHIVE_LANE, limit = 50, offset = 0 }) {
5821
5977
  const door = await callDoor(
5822
5978
  DOORS.readRecordsArchived,
@@ -6018,9 +6174,11 @@ function createRecordsClient(config) {
6018
6174
  );
6019
6175
  },
6020
6176
  async fieldDeclare({ table_id, spec }) {
6177
+ const { allow_other, ...rest } = spec;
6178
+ const p_spec = allow_other === void 0 ? rest : { ...rest, config: { ...rest.config ?? {}, allow_other } };
6021
6179
  return callDoor(
6022
6180
  DOORS.fieldDeclare,
6023
- { p_organization_id: org, p_table_id: table_id, p_spec: spec },
6181
+ { p_organization_id: org, p_table_id: table_id, p_spec },
6024
6182
  "fieldDeclare"
6025
6183
  );
6026
6184
  },
@@ -6988,14 +7146,16 @@ function createRecordsClient(config) {
6988
7146
  );
6989
7147
  },
6990
7148
  async restoreVersion({ record_id, version }) {
6991
- return callDoor(
7149
+ const result = await callDoor(
6992
7150
  DOORS.restoreVersion,
6993
7151
  { p_organization_id: org, p_record_id: record_id, p_version: version },
6994
7152
  "restoreVersion"
6995
7153
  );
7154
+ if (result.ok) announceRecordChanged(record_id);
7155
+ return result;
6996
7156
  },
6997
7157
  async valueRestore({ record_id, field_key, version }) {
6998
- return callDoor(
7158
+ const answered = await callDoor(
6999
7159
  DOORS.valueRestore,
7000
7160
  {
7001
7161
  p_organization_id: org,
@@ -7005,6 +7165,8 @@ function createRecordsClient(config) {
7005
7165
  },
7006
7166
  "valueRestore"
7007
7167
  );
7168
+ if (answered.ok) announceRecordChanged(record_id);
7169
+ return answered;
7008
7170
  },
7009
7171
  async commentThread({ record_id, include_resolved }) {
7010
7172
  return callDoor(
@@ -7786,12 +7948,30 @@ function ruleRefusal(field, rule, item, values) {
7786
7948
  }
7787
7949
  return null;
7788
7950
  case "length":
7789
- if (typeof item === "string" && item.length > Number(rule.value)) {
7951
+ if (typeof item !== "string") return null;
7952
+ if (rule.value !== void 0 && rule.value !== null && rule.value !== "" && item.length > Number(rule.value)) {
7790
7953
  return { ...base, message: `${label} is longer than ${rule.value} characters`, hint: "FLD-3." };
7791
7954
  }
7955
+ if (typeof rule.min === "number" && item !== "" && item.length < rule.min) {
7956
+ return {
7957
+ ...base,
7958
+ message: `${label} has to be at least ${rule.min} characters long`,
7959
+ hint: "FLD-3.",
7960
+ detail: { field_key: field.key, rule: "length", min: rule.min }
7961
+ };
7962
+ }
7792
7963
  return null;
7793
7964
  case "pattern":
7794
7965
  if (typeof item === "string" && !new RegExp(String(rule.value)).test(item)) {
7966
+ const example = typeof rule.example === "string" ? rule.example.trim() : "";
7967
+ if (example !== "") {
7968
+ return {
7969
+ ...base,
7970
+ message: `${label} is not written the way this field expects`,
7971
+ hint: `Enter it like ${example}.`,
7972
+ detail: { field_key: field.key, rule: "pattern", example }
7973
+ };
7974
+ }
7795
7975
  return { ...base, message: `${label} is not written the way this field expects`, hint: "FLD-3." };
7796
7976
  }
7797
7977
  return null;
@@ -7876,12 +8056,6 @@ function predictValueRefusals(fields, values, recordType) {
7876
8056
  message: `${label} takes one of its choices, and it was given a ${jsonType(item)}`,
7877
8057
  hint: "FLD-5 / FLD-6: a list field stores the id of the option RECORD, because every pick-list is already a Table."
7878
8058
  });
7879
- } else if (!UUID2.test(item)) {
7880
- found.push({
7881
- ...base,
7882
- message: `${label} was given a choice that is not one of its choices`,
7883
- hint: `REC-51: option membership. ${label} stores the id of an option record, and what it was given is not an id at all.`
7884
- });
7885
8059
  }
7886
8060
  } else if (field.type === "relation") {
7887
8061
  if (typeof item !== "string") {