@ai-matrx/records 0.29.0 → 0.36.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.
@@ -2163,10 +2163,24 @@ var PLACEHOLDER_PATTERNS = [
2163
2163
  instead: "Write the sentence this business would really send."
2164
2164
  },
2165
2165
  {
2166
+ // TWO Zs, NOT THREE (widened 2026-09-21, lane ZZ-SWEEP-2). `ZZ W4-AGG Red`,
2167
+ // `ZZ HQ`, `zz_a_deal` are the same junk as `ZZZ …` and were the larger
2168
+ // half of it: 791 of them across 88 campaign-suite files when this widened.
2169
+ //
2170
+ // BUT A LEADING `zz` ON A DATABASE TRIGGER IS NOT A NAME, IT IS AN ORDERING
2171
+ // DEVICE. PostgreSQL fires triggers in alphabetical order of their name and
2172
+ // gives no other way to say "last", so this platform spells "last" with
2173
+ // z's: 591 live triggers across 79 distinct names — `zz0_table_owner`,
2174
+ // `zz_memo_clear_i`, `zzz_history_capture_s_u`, `zzzz_unique_rule_holds` —
2175
+ // where each extra z buys another rung. A suite that asserts which triggers
2176
+ // fire on `custom.record` MUST quote those names exactly. Reddening on them
2177
+ // would be this file's own "catch the junk, never the vocabulary" rule
2178
+ // broken, so a line that is talking about triggers is exempt.
2166
2179
  id: "zzz-prefix",
2167
- test: /\bzzz+[\s_-]/gi,
2168
- why: "A 'ZZZ \u2026' name exists to sort test rows to the bottom and to be deleted; it makes every screen look broken.",
2169
- instead: "Give it the use case's own name and find it for cleanup by the organization's cleanup tag."
2180
+ test: /\bzz+[\s_-]/gi,
2181
+ unlessLineMatches: /\btriggers?\b|\btgname\b|\btgrelid\b|\btgenabled\b|\bpg_trigger\b/i,
2182
+ why: "A 'ZZ \u2026' / 'ZZZ \u2026' name exists to sort test rows to the bottom and to be deleted; it makes every screen look broken.",
2183
+ instead: "Give it the use case's own name and find it for cleanup by the organization's cleanup tag. (On a TRIGGER the prefix is a firing-order device, not a name \u2014 say 'trigger' on the line and it is exempt.)"
2170
2184
  },
2171
2185
  {
2172
2186
  id: "test-table",
@@ -2198,6 +2212,38 @@ var PLACEHOLDER_PATTERNS = [
2198
2212
  why: "A repeated stand-in person is the tell that nobody modelled the domain.",
2199
2213
  instead: "Synthesize varied, plausible people who belong to nobody \u2014 and never copy a real person."
2200
2214
  },
2215
+ {
2216
+ // THE CHAIR'S RULING, 2026-09-21. People in a template are fictional but
2217
+ // REALISTIC, and a realistic person's mailbox is a mailbox — not a mailbox
2218
+ // with a counter welded to the end of it. `linda.reyes0@…`,
2219
+ // `wei.singh.m34@…` are the tell that a loop wrote the row, and the owner
2220
+ // reads a whole column of them as one fake person repeated.
2221
+ //
2222
+ // NARROW ON PURPOSE: it fires only when the local part is name-shaped
2223
+ // (two or more words joined by . _ or -) AND ends in a bare counter. That
2224
+ // is exactly the generator's signature and leaves the real mailboxes a
2225
+ // business has — `support365@`, `ap2@`, `frontdesk@` — alone.
2226
+ id: "suffixed-mailbox",
2227
+ test: /\b[a-z]+(?:[._-][a-z]+)+\d{1,3}@/gi,
2228
+ why: "A mailbox whose name ends in a counter (linda.reyes0@, wei.singh.m34@) is a generated row wearing a person's name.",
2229
+ instead: "Give each person their own mailbox on the fictional business's own domain \u2014 'linda.reyes@handsandhopealliance.org' \u2014 and vary the people instead of numbering one."
2230
+ },
2231
+ {
2232
+ // THE CHAIR'S RULING, 2026-09-21. "Test fixture" is a CLASSIFICATION, and a
2233
+ // classification lives in the organization's kind/metadata — the
2234
+ // `test_fixture` flag in its settings, which is how cleanup finds it. It is
2235
+ // never part of a NAME, because a name is what the owner reads on the
2236
+ // screen and "Birchwood Ave Renovation (test fixture)" tells him the
2237
+ // product is a rehearsal.
2238
+ //
2239
+ // The settings KEY is the right place, so a line that is writing the key is
2240
+ // exempt; a line that is writing the words into text is not.
2241
+ id: "fixture-in-name",
2242
+ test: /\(\s*test\s+fixture\s*\)|\btest[\s_-]fixture\b|\bfixture[\s_-]org(?:anization|anisation)?\b/gi,
2243
+ unlessLineMatches: /["'`]?test_fixture["'`]?\s*[:=]|\bp_settings\b|\bcleanupTag\b|\bsettings\.[a-z_]*fixture\b/i,
2244
+ why: "'Test fixture' is a classification, not a name. In a name it tells the owner the screen he is looking at is a rehearsal.",
2245
+ instead: "Name the organization after the business the use case is about, and carry the classification in its settings (`test_fixture: true`), which is also how cleanup finds it."
2246
+ },
2201
2247
  {
2202
2248
  id: "keyboard-mash",
2203
2249
  test: /\basdf+\b|\bqwerty\b|\bxxx+\b|\btodo name\b|\bfixme\b|\btbd\b/gi,
@@ -2233,6 +2279,7 @@ function describePlaceholder(hit) {
2233
2279
  var STORAGE_MODES = ["light", "heavy"];
2234
2280
  var PARITY_FIELD_TYPES = [
2235
2281
  { parity_type: "attachment", behavior: "relation", made_of: "REC-31: a File record reached through a relation, target the kernel `File` Table" },
2282
+ { parity_type: "checkbox", behavior: "boolean", made_of: "a ticked or unticked answer, stored as a REAL boolean \u2014 and a record that never answered holds neither, so filters and group-by see three states, not two" },
2236
2283
  { parity_type: "currency", behavior: "range", made_of: "FLD-N-1: a number whose UNIT is the currency and whose format is currency \u2014 on the Field, never in presentation" },
2237
2284
  { parity_type: "datetime", behavior: "range", made_of: "a range of kind date or datetime \u2014 the dated modifier says the VALUES are dated, which is a different question" },
2238
2285
  { parity_type: "email", behavior: "text", made_of: "text whose format is email" },
@@ -2286,6 +2333,21 @@ var MIN_ROWS_IN_PRIMARY_TABLE = 5;
2286
2333
  function fieldsByKey(table) {
2287
2334
  return new Map(table.fields.map((f) => [f.key, f]));
2288
2335
  }
2336
+ var FIXTURE_IN_NAME = /\(\s*test\s+fixture\s*\)|\btest[\s_-]fixture\b|^\s*fixtures?\b/i;
2337
+ function nameFields(useCase5) {
2338
+ const out = [
2339
+ ["business.name", useCase5.business?.name],
2340
+ ["business.legalName", useCase5.business?.legalName],
2341
+ ["form.name", useCase5.form?.name],
2342
+ ["pipeline.name", useCase5.pipeline?.name]
2343
+ ];
2344
+ useCase5.tables?.forEach((table, ti) => {
2345
+ out.push([`tables[${ti}].name`, table.name]);
2346
+ out.push([`tables[${ti}].labelSingular`, table.labelSingular]);
2347
+ out.push([`tables[${ti}].labelPlural`, table.labelPlural]);
2348
+ });
2349
+ return out;
2350
+ }
2289
2351
  function validateUseCase(useCase5) {
2290
2352
  const problems = [];
2291
2353
  const say = (at, says) => problems.push({ at, says });
@@ -2302,6 +2364,15 @@ function validateUseCase(useCase5) {
2302
2364
  for (const hit of findPlaceholders(JSON.stringify(useCase5, null, 1))) {
2303
2365
  say(useCase5.id, describePlaceholder(hit));
2304
2366
  }
2367
+ for (const [at, value] of nameFields(useCase5)) {
2368
+ if (!value) continue;
2369
+ if (FIXTURE_IN_NAME.test(value)) {
2370
+ say(
2371
+ at,
2372
+ `"${value}" carries the test-fixture classification in a name. Name it after the business this use case is about, and carry the classification where it belongs \u2014 \`test_fixture: true\` in the organization's settings, which is also how cleanup finds it (never by a junk name).`
2373
+ );
2374
+ }
2375
+ }
2305
2376
  if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(useCase5.id ?? "")) {
2306
2377
  say("id", `The id "${useCase5.id}" should be kebab-case, like "harbor-dental-new-patient-intake".`);
2307
2378
  }