@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.
- package/CHANGELOG.md +111 -0
- package/dist/core/index.cjs +93 -12
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +52 -7
- package/dist/core/index.d.ts +52 -7
- package/dist/core/index.js +93 -12
- package/dist/core/index.js.map +1 -1
- package/dist/{field-DrOTIPCF.d.cts → field-CWBdZfFv.d.cts} +277 -9
- package/dist/{field-DrOTIPCF.d.ts → field-CWBdZfFv.d.ts} +277 -9
- package/dist/index.cjs +35 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +165 -141
- package/dist/index.d.ts +165 -141
- package/dist/index.js +35 -8
- package/dist/index.js.map +1 -1
- package/dist/react/index.cjs +93 -12
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +481 -149
- package/dist/react/index.d.ts +481 -149
- package/dist/react/index.js +93 -12
- package/dist/react/index.js.map +1 -1
- package/dist/use-cases/index.cjs +74 -3
- package/dist/use-cases/index.cjs.map +1 -1
- package/dist/use-cases/index.d.cts +1 -1
- package/dist/use-cases/index.d.ts +1 -1
- package/dist/use-cases/index.js +74 -3
- package/dist/use-cases/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TableType, a as TableDisplay, S as StorageMode, F as FieldTypeWord, b as FieldSource, C as ComputeOn, c as FieldRule, d as FieldSensitivity, e as ContextPolicy, R as RelationFlavor, f as RelationCardinality, O as OnDelete } from '../field-
|
|
1
|
+
import { T as TableType, a as TableDisplay, S as StorageMode, F as FieldTypeWord, b as FieldSource, C as ComputeOn, c as FieldRule, d as FieldSensitivity, e as ContextPolicy, R as RelationFlavor, f as RelationCardinality, O as OnDelete } from '../field-CWBdZfFv.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Who the data belongs to. A test organization is created under this name — the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TableType, a as TableDisplay, S as StorageMode, F as FieldTypeWord, b as FieldSource, C as ComputeOn, c as FieldRule, d as FieldSensitivity, e as ContextPolicy, R as RelationFlavor, f as RelationCardinality, O as OnDelete } from '../field-
|
|
1
|
+
import { T as TableType, a as TableDisplay, S as StorageMode, F as FieldTypeWord, b as FieldSource, C as ComputeOn, c as FieldRule, d as FieldSensitivity, e as ContextPolicy, R as RelationFlavor, f as RelationCardinality, O as OnDelete } from '../field-CWBdZfFv.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Who the data belongs to. A test organization is created under this name — the
|
package/dist/use-cases/index.js
CHANGED
|
@@ -2130,10 +2130,24 @@ var PLACEHOLDER_PATTERNS = [
|
|
|
2130
2130
|
instead: "Write the sentence this business would really send."
|
|
2131
2131
|
},
|
|
2132
2132
|
{
|
|
2133
|
+
// TWO Zs, NOT THREE (widened 2026-09-21, lane ZZ-SWEEP-2). `ZZ W4-AGG Red`,
|
|
2134
|
+
// `ZZ HQ`, `zz_a_deal` are the same junk as `ZZZ …` and were the larger
|
|
2135
|
+
// half of it: 791 of them across 88 campaign-suite files when this widened.
|
|
2136
|
+
//
|
|
2137
|
+
// BUT A LEADING `zz` ON A DATABASE TRIGGER IS NOT A NAME, IT IS AN ORDERING
|
|
2138
|
+
// DEVICE. PostgreSQL fires triggers in alphabetical order of their name and
|
|
2139
|
+
// gives no other way to say "last", so this platform spells "last" with
|
|
2140
|
+
// z's: 591 live triggers across 79 distinct names — `zz0_table_owner`,
|
|
2141
|
+
// `zz_memo_clear_i`, `zzz_history_capture_s_u`, `zzzz_unique_rule_holds` —
|
|
2142
|
+
// where each extra z buys another rung. A suite that asserts which triggers
|
|
2143
|
+
// fire on `custom.record` MUST quote those names exactly. Reddening on them
|
|
2144
|
+
// would be this file's own "catch the junk, never the vocabulary" rule
|
|
2145
|
+
// broken, so a line that is talking about triggers is exempt.
|
|
2133
2146
|
id: "zzz-prefix",
|
|
2134
|
-
test: /\
|
|
2135
|
-
|
|
2136
|
-
|
|
2147
|
+
test: /\bzz+[\s_-]/gi,
|
|
2148
|
+
unlessLineMatches: /\btriggers?\b|\btgname\b|\btgrelid\b|\btgenabled\b|\bpg_trigger\b/i,
|
|
2149
|
+
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.",
|
|
2150
|
+
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.)"
|
|
2137
2151
|
},
|
|
2138
2152
|
{
|
|
2139
2153
|
id: "test-table",
|
|
@@ -2165,6 +2179,38 @@ var PLACEHOLDER_PATTERNS = [
|
|
|
2165
2179
|
why: "A repeated stand-in person is the tell that nobody modelled the domain.",
|
|
2166
2180
|
instead: "Synthesize varied, plausible people who belong to nobody \u2014 and never copy a real person."
|
|
2167
2181
|
},
|
|
2182
|
+
{
|
|
2183
|
+
// THE CHAIR'S RULING, 2026-09-21. People in a template are fictional but
|
|
2184
|
+
// REALISTIC, and a realistic person's mailbox is a mailbox — not a mailbox
|
|
2185
|
+
// with a counter welded to the end of it. `linda.reyes0@…`,
|
|
2186
|
+
// `wei.singh.m34@…` are the tell that a loop wrote the row, and the owner
|
|
2187
|
+
// reads a whole column of them as one fake person repeated.
|
|
2188
|
+
//
|
|
2189
|
+
// NARROW ON PURPOSE: it fires only when the local part is name-shaped
|
|
2190
|
+
// (two or more words joined by . _ or -) AND ends in a bare counter. That
|
|
2191
|
+
// is exactly the generator's signature and leaves the real mailboxes a
|
|
2192
|
+
// business has — `support365@`, `ap2@`, `frontdesk@` — alone.
|
|
2193
|
+
id: "suffixed-mailbox",
|
|
2194
|
+
test: /\b[a-z]+(?:[._-][a-z]+)+\d{1,3}@/gi,
|
|
2195
|
+
why: "A mailbox whose name ends in a counter (linda.reyes0@, wei.singh.m34@) is a generated row wearing a person's name.",
|
|
2196
|
+
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."
|
|
2197
|
+
},
|
|
2198
|
+
{
|
|
2199
|
+
// THE CHAIR'S RULING, 2026-09-21. "Test fixture" is a CLASSIFICATION, and a
|
|
2200
|
+
// classification lives in the organization's kind/metadata — the
|
|
2201
|
+
// `test_fixture` flag in its settings, which is how cleanup finds it. It is
|
|
2202
|
+
// never part of a NAME, because a name is what the owner reads on the
|
|
2203
|
+
// screen and "Birchwood Ave Renovation (test fixture)" tells him the
|
|
2204
|
+
// product is a rehearsal.
|
|
2205
|
+
//
|
|
2206
|
+
// The settings KEY is the right place, so a line that is writing the key is
|
|
2207
|
+
// exempt; a line that is writing the words into text is not.
|
|
2208
|
+
id: "fixture-in-name",
|
|
2209
|
+
test: /\(\s*test\s+fixture\s*\)|\btest[\s_-]fixture\b|\bfixture[\s_-]org(?:anization|anisation)?\b/gi,
|
|
2210
|
+
unlessLineMatches: /["'`]?test_fixture["'`]?\s*[:=]|\bp_settings\b|\bcleanupTag\b|\bsettings\.[a-z_]*fixture\b/i,
|
|
2211
|
+
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.",
|
|
2212
|
+
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."
|
|
2213
|
+
},
|
|
2168
2214
|
{
|
|
2169
2215
|
id: "keyboard-mash",
|
|
2170
2216
|
test: /\basdf+\b|\bqwerty\b|\bxxx+\b|\btodo name\b|\bfixme\b|\btbd\b/gi,
|
|
@@ -2200,6 +2246,7 @@ function describePlaceholder(hit) {
|
|
|
2200
2246
|
var STORAGE_MODES = ["light", "heavy"];
|
|
2201
2247
|
var PARITY_FIELD_TYPES = [
|
|
2202
2248
|
{ parity_type: "attachment", behavior: "relation", made_of: "REC-31: a File record reached through a relation, target the kernel `File` Table" },
|
|
2249
|
+
{ 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" },
|
|
2203
2250
|
{ 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" },
|
|
2204
2251
|
{ 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" },
|
|
2205
2252
|
{ parity_type: "email", behavior: "text", made_of: "text whose format is email" },
|
|
@@ -2253,6 +2300,21 @@ var MIN_ROWS_IN_PRIMARY_TABLE = 5;
|
|
|
2253
2300
|
function fieldsByKey(table) {
|
|
2254
2301
|
return new Map(table.fields.map((f) => [f.key, f]));
|
|
2255
2302
|
}
|
|
2303
|
+
var FIXTURE_IN_NAME = /\(\s*test\s+fixture\s*\)|\btest[\s_-]fixture\b|^\s*fixtures?\b/i;
|
|
2304
|
+
function nameFields(useCase5) {
|
|
2305
|
+
const out = [
|
|
2306
|
+
["business.name", useCase5.business?.name],
|
|
2307
|
+
["business.legalName", useCase5.business?.legalName],
|
|
2308
|
+
["form.name", useCase5.form?.name],
|
|
2309
|
+
["pipeline.name", useCase5.pipeline?.name]
|
|
2310
|
+
];
|
|
2311
|
+
useCase5.tables?.forEach((table, ti) => {
|
|
2312
|
+
out.push([`tables[${ti}].name`, table.name]);
|
|
2313
|
+
out.push([`tables[${ti}].labelSingular`, table.labelSingular]);
|
|
2314
|
+
out.push([`tables[${ti}].labelPlural`, table.labelPlural]);
|
|
2315
|
+
});
|
|
2316
|
+
return out;
|
|
2317
|
+
}
|
|
2256
2318
|
function validateUseCase(useCase5) {
|
|
2257
2319
|
const problems = [];
|
|
2258
2320
|
const say = (at, says) => problems.push({ at, says });
|
|
@@ -2269,6 +2331,15 @@ function validateUseCase(useCase5) {
|
|
|
2269
2331
|
for (const hit of findPlaceholders(JSON.stringify(useCase5, null, 1))) {
|
|
2270
2332
|
say(useCase5.id, describePlaceholder(hit));
|
|
2271
2333
|
}
|
|
2334
|
+
for (const [at, value] of nameFields(useCase5)) {
|
|
2335
|
+
if (!value) continue;
|
|
2336
|
+
if (FIXTURE_IN_NAME.test(value)) {
|
|
2337
|
+
say(
|
|
2338
|
+
at,
|
|
2339
|
+
`"${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).`
|
|
2340
|
+
);
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2272
2343
|
if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(useCase5.id ?? "")) {
|
|
2273
2344
|
say("id", `The id "${useCase5.id}" should be kebab-case, like "harbor-dental-new-patient-intake".`);
|
|
2274
2345
|
}
|