Skip to content

Commit 0c2b985

Browse files
committed
docs(qa): the checklist item and the pins name the rule alone
Revision 7 of records-forms.predicate-relationship-traversal, the dogfood case and the objectql pins say what the write answers: a reference the caller cannot read is reference_not_found, before the record's validation rules. Claude-Session: https://claude.ai/code/session_01Utp6CYQjMkN514R78sCrTT Co-authored-by: Claude <noreply@anthropic.com>
1 parent 75a7c44 commit 0c2b985

3 files changed

Lines changed: 36 additions & 37 deletions

File tree

‎docs/qa/platform-checklist/areas/records-forms.json‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5561,14 +5561,14 @@
55615561
"at least one churned account and one non-churned account to invoice against"
55625562
],
55635563
"knownGaps": [
5564-
"No stock persona has showcase_invoice CRUD WITHOUT showcase_account read, and none can be made from the stock showcase objects: showcase_member_default, the everyone baseline every member holds, grants showcase_account allowRead (examples/app-showcase/src/security/permission-sets.ts), and permission sets only ever ADD grants, so no extra set takes it away (QA run #21720, parked on #22017 row 14). An earlier revision of this item said the opposite, reading packages/qa/dogfood/test/showcase-d3-d4-capabilities.dogfood.test.ts. That test's persona is its own injected fallback set, not a stock persona, and it never writes against a churned account. So acceptance[3] is scored on a scratch pair: the dogfood pin in `automated` builds one at boot, or it is scored live on the scratch substitute #21720 measured, which is runtime-only on a stock boot (QA run #27438 built and drove it at c4c515ad): POST /api/v1/packages with a declared namespace; PUT /api/v1/meta/object for a parent object, and for a child object carrying a one-hop script validation over its lookup to the parent; PUT /api/v1/meta/permission for a set granting the member the CHILD only, bound with POST /api/v1/data/sys_user_permission_set; then, as that member, write against a tripping and a non-tripping parent. The control is the member's GET of a parent row, which must answer 403: without it the leg proves nothing about an unreadable parent"
5564+
"No stock persona has showcase_invoice CRUD WITHOUT showcase_account read, and none can be made from the stock showcase objects: showcase_member_default, the everyone baseline every member holds, grants showcase_account allowRead (examples/app-showcase/src/security/permission-sets.ts), and permission sets only ever ADD grants, so no extra set takes it away (QA run #21720, parked on #22017 row 14). An earlier revision of this item said the opposite, reading packages/qa/dogfood/test/showcase-d3-d4-capabilities.dogfood.test.ts. That test's persona is its own injected fallback set, not a stock persona, and it never writes against a churned account. So acceptance[3] is scored on a scratch pair: the dogfood pin in `automated` builds one at boot, or it is scored live on the scratch substitute #21720 measured, which is runtime-only on a stock boot (QA run #27438 built and drove it at c4c515ad): POST /api/v1/packages with a declared namespace; PUT /api/v1/meta/object for a parent object, and for a child object carrying a one-hop script validation over its lookup to the parent; PUT /api/v1/meta/permission for a set granting the member the CHILD only, bound with POST /api/v1/data/sys_user_permission_set; then, as that member, write naming a parent row. The control is the member's GET of a parent row, which must answer 403: without it the leg proves nothing about an unreadable parent"
55655565
]
55665566
},
55675567
"steps": [
55685568
"POST /api/v1/data/showcase_invoice with `account` pointing at a NON-churned account",
55695569
"POST /api/v1/data/showcase_invoice with `account` pointing at a CHURNED account",
55705570
"PATCH an existing invoice to REPOINT it at a churned account (the update path reads the FK off the merged record, not the patch alone)",
5571-
"as a member with NO read on the parent (none exists on stock — fixtures.knownGaps), on the scratch pair: write against a non-tripping parent, then a tripping one"
5571+
"as a member with NO read on the parent (none exists on stock — fixtures.knownGaps), on the scratch pair: write naming a parent row"
55725572
],
55735573
"acceptance": [
55745574
{
@@ -5590,10 +5590,10 @@
55905590
"evidence": "the patch response"
55915591
},
55925592
{
5593-
"clause": "a member who cannot read the parent cannot name it: the write answers reference_not_found on the lookup, before the record's rules, whether or not the parent trips one",
5593+
"clause": "a member who cannot read the parent cannot name it: the write answers reference_not_found on the lookup, before the record's validation rules",
55945594
"oracle": "api",
5595-
"verify": "on stock showcase no such persona exists (fixtures.knownGaps), so score this on the scratch pair. For the member who cannot read the parent, the write naming the non-tripping parent and the write naming the tripping parent are each 400 VALIDATION_FAILED with exactly one fields[] entry, { field: <the lookup>, code: 'reference_not_found' } — the answer for a parent that exists nowhere — and nothing is stored. Neither answer carries the rule's authored message or the unevaluable-rule fault, and the member's own GET of the parent answers 403 (the control)",
5596-
"evidence": "both responses for the restricted persona"
5595+
"verify": "on stock showcase no such persona exists (fixtures.knownGaps), so score this on the scratch pair. For the member who cannot read the parent, the write naming it is 400 VALIDATION_FAILED with exactly one fields[] entry, { field: <the lookup>, code: 'reference_not_found' } — the answer for a parent that exists nowhere — and nothing is stored. The answer carries neither the rule's authored message nor the unevaluable-rule fault, and the member's own GET of the parent answers 403 (the control)",
5596+
"evidence": "the restricted persona's responses"
55975597
}
55985598
],
55995599
"negative": [
@@ -5606,7 +5606,7 @@
56065606
],
56075607
"automated": {
56085608
"kind": "dogfood",
5609-
"ref": "packages/qa/dogfood/test/predicate-relationship-traversal.dogfood.test.ts, at the REST data door of a booted stack: on the showcase as shipped, acceptance[0] (an invoice on an active account is 2xx and reads back, no unevaluable fault), acceptance[1] and negative[0] (an invoice on a churned account is 400 VALIDATION_FAILED with one _record rule_violation entry carrying the authored message, and nothing is stored), acceptance[2] (a PATCH carrying only the repointed account is refused and the stored account is unchanged) and negative[1] (no readable-parent case answers the unevaluable fault); on a scratch pair, acceptance[3] and negative[2] for a member no stock showcase persona is (fixtures.knownGaps): a member with create/edit on the child and no grant on the parent, whose parent read is the control (403 PERMISSION_DENIED), is answered 400 VALIDATION_FAILED with the lookup's reference_not_found against a non-tripping and a tripping parent alike, never the authored message, and nothing is stored. packages/objectql/src/engine-predicate-relationship.test.ts stays engine-layer evidence of the mechanism ('reads the related row under SYSTEM authority' and its two siblings)"
5609+
"ref": "packages/qa/dogfood/test/predicate-relationship-traversal.dogfood.test.ts, at the REST data door of a booted stack: on the showcase as shipped, acceptance[0] (an invoice on an active account is 2xx and reads back, no unevaluable fault), acceptance[1] and negative[0] (an invoice on a churned account is 400 VALIDATION_FAILED with one _record rule_violation entry carrying the authored message, and nothing is stored), acceptance[2] (a PATCH carrying only the repointed account is refused and the stored account is unchanged) and negative[1] (no readable-parent case answers the unevaluable fault); on a scratch pair, acceptance[3] and negative[2] for a member no stock showcase persona is (fixtures.knownGaps): a member with create/edit on the child and no grant on the parent, whose parent read is the control (403 PERMISSION_DENIED), is answered 400 VALIDATION_FAILED with the lookup's reference_not_found, before the record's validation rules, and nothing is stored. packages/objectql/src/engine-predicate-relationship.test.ts stays engine-layer evidence of the mechanism ('reads the related row under SYSTEM authority' and its two siblings)"
56105610
},
56115611
"source": [
56125612
"examples/app-showcase/src/data/objects/invoice.object.ts (no_invoice_for_churned_account)",
@@ -5653,7 +5653,7 @@
56535653
{
56545654
"revision": 7,
56555655
"date": "2026-11-05",
5656-
"change": "the persona that wrote a child without reading its lookup parent is retired: a non-system write may name, in a lookup or user field, only a record the caller's own read door returns, and that reference check runs before the record's validation rules (ruling records 6573561091 and 6663849489). acceptance[3], its verify, negative[2], step 4, the second persona and automated.ref now state that rule: the member who cannot read the parent is answered reference_not_found against a tripping and a non-tripping parent alike. acceptance[0]–[2] are unchanged",
5656+
"change": "the persona that wrote a child without reading its lookup parent is retired: a non-system write may name, in a lookup or user field, only a record the caller's own read door returns, and that reference check runs before the record's validation rules (ruling records 6573561091 and 6663849489). acceptance[3], its verify, negative[2], step 4, the second persona and automated.ref now state that rule: the member who cannot read the parent is answered reference_not_found, before the record's validation rules. acceptance[0]–[2] are unchanged",
56575657
"ref": "#29029"
56585658
}
56595659
]

‎packages/objectql/src/engine-unreadable-reference-target.test.ts‎

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ const ITEM_OBJECT = {
6262

6363
/**
6464
* [#29029] A task whose validation rules read each reference one hop: each
65-
* trips on a target named `tripping`. The reference check runs BEFORE them.
65+
* refuses a target named `flagged`. The reference check runs BEFORE them.
6666
*/
6767
const RULED = 'urt_ruled_task';
68-
const TRIPPED = 'URT29029: the named target trips the rule';
69-
const TITLE_TRIPPED = 'URT29029: the title trips the rule';
68+
const RULE_MESSAGE = 'URT29029: the rule refuses the named target';
69+
const TITLE_RULE_MESSAGE = 'URT29029: the rule refuses the title';
7070
const RULED_OBJECT = {
7171
name: RULED,
7272
label: 'Ruled task',
@@ -80,9 +80,9 @@ const RULED_OBJECT = {
8080
// Checked only while the reference is set, as an author guards a traversal.
8181
name: `urt_${field}_when_set`, type: 'conditional', severity: 'error', message: 'unused',
8282
when: `record.${field} != null`,
83-
then: { name: `urt_${field}_trips`, type: 'script', severity: 'error', message: TRIPPED, condition: `record.${field}.name == 'tripping'` },
83+
then: { name: `urt_${field}_rule`, type: 'script', severity: 'error', message: RULE_MESSAGE, condition: `record.${field}.name == 'flagged'` },
8484
})).concat([
85-
{ name: 'urt_title_trips', type: 'script', severity: 'error', message: TITLE_TRIPPED, condition: "record.title == 'trip'" } as any,
85+
{ name: 'urt_title_rule', type: 'script', severity: 'error', message: TITLE_RULE_MESSAGE, condition: "record.title == 'flagged'" } as any,
8686
]),
8787
};
8888

@@ -187,9 +187,9 @@ function makeEngine() {
187187
rows.set('t_mine', { id: 't_mine', name: 'mine', owner_name: 'alice' });
188188
rows.set('t_mine_2', { id: 't_mine_2', name: 'mine too', owner_name: 'alice' });
189189
rows.set('t_other', { id: 't_other', name: 'other', owner_name: 'bob' });
190-
// [#29029] A readable and an unreadable target that trip the ruled task's rules.
191-
rows.set('t_trip_mine', { id: 't_trip_mine', name: 'tripping', owner_name: 'alice' });
192-
rows.set('t_trip_other', { id: 't_trip_other', name: 'tripping', owner_name: 'bob' });
190+
// [#29029] A readable and an unreadable target the ruled task's rules refuse.
191+
rows.set('t_flagged_mine', { id: 't_flagged_mine', name: 'flagged', owner_name: 'alice' });
192+
rows.set('t_flagged_other', { id: 't_flagged_other', name: 'flagged', owner_name: 'bob' });
193193
}
194194
return { engine, targetReads, ...store };
195195
}
@@ -360,48 +360,48 @@ describe('[#29029] an unreadable reference answers reference_not_found before th
360360
{ field: 'assignee', kind: 'user' },
361361
{ field: 'header', kind: 'master_detail' },
362362
] as const)('a $kind field', ({ field }) => {
363-
it.each(DOORS)('%s — a target the caller cannot read that a rule would trip on answers reference_not_found, not the rule', async (door) => {
364-
const err = await refusalOf(() => write(door, { [field]: 't_trip_other' }));
363+
it.each(DOORS)('%s — a target the caller cannot read answers reference_not_found, before the record\'s validation rules', async (door) => {
364+
const err = await refusalOf(() => write(door, { [field]: 't_flagged_other' }));
365365
expect(envelopeOf(err)).toEqual(notFound(field));
366-
expect(String((err as Error).message)).not.toContain(TRIPPED);
366+
expect(String((err as Error).message)).not.toContain(RULE_MESSAGE);
367367
expect(storedRuled()).toEqual([{ id: 'r1', title: 'stored' }]);
368368
});
369369

370-
it.each(DOORS)('%s — control: a readable target the rule trips on answers the rule', async (door) => {
371-
const err = await refusalOf(() => write(door, { [field]: 't_trip_mine' }));
370+
it.each(DOORS)('%s — control: a readable target reaches the record\'s validation rules', async (door) => {
371+
const err = await refusalOf(() => write(door, { [field]: 't_flagged_mine' }));
372372
expect(ruleRefusal(err).code).toBe('VALIDATION_FAILED');
373-
expect(ruleRefusal(err).messages.some((m: string) => m.includes(TRIPPED))).toBe(true);
373+
expect(ruleRefusal(err).messages.some((m: string) => m.includes(RULE_MESSAGE))).toBe(true);
374374
expect(storedRuled()).toEqual([{ id: 'r1', title: 'stored' }]);
375375
});
376376

377377
it.each(DOORS)('%s — control: a system write naming that target answers the rule, as before', async (door) => {
378-
const err = await refusalOf(() => write(door, { [field]: 't_trip_other' }, SYSTEM));
379-
expect(ruleRefusal(err).messages.some((m: string) => m.includes(TRIPPED))).toBe(true);
378+
const err = await refusalOf(() => write(door, { [field]: 't_flagged_other' }, SYSTEM));
379+
expect(ruleRefusal(err).messages.some((m: string) => m.includes(RULE_MESSAGE))).toBe(true);
380380
expect(envelopeOf(err).fields.map((f) => f.code)).not.toContain('reference_not_found');
381381
});
382382
});
383383

384-
it.each(DOORS)('%s — a reference to a record that exists nowhere answers reference_not_found before a rule the record trips', async (door) => {
385-
const err = await refusalOf(() => write(door, { title: 'trip', duty: 't_missing' }));
384+
it.each(DOORS)('%s — a reference to a record that exists nowhere answers reference_not_found, before the record\'s validation rules', async (door) => {
385+
const err = await refusalOf(() => write(door, { title: 'flagged', duty: 't_missing' }));
386386
expect(envelopeOf(err)).toEqual(notFound('duty'));
387-
expect(String((err as Error).message)).not.toContain(TITLE_TRIPPED);
387+
expect(String((err as Error).message)).not.toContain(TITLE_RULE_MESSAGE);
388388
});
389389

390-
it.each(DOORS)('%s — control: a flow run\'s system write keeps the rules first — the rule its record trips answers, not the reference check', async (door) => {
390+
it.each(DOORS)('%s — control: a flow run\'s system write keeps the validation rules first', async (door) => {
391391
const flowRun = markFlowWriteReferenceCheck({ ...SYSTEM });
392-
const err = await refusalOf(() => write(door, { title: 'trip', duty: 't_missing' }, flowRun));
393-
expect(ruleRefusal(err).messages.some((m: string) => m.includes(TITLE_TRIPPED))).toBe(true);
392+
const err = await refusalOf(() => write(door, { title: 'flagged', duty: 't_missing' }, flowRun));
393+
expect(ruleRefusal(err).messages.some((m: string) => m.includes(TITLE_RULE_MESSAGE))).toBe(true);
394394
expect(envelopeOf(err).fields.map((f) => f.code)).not.toContain('reference_not_found');
395395
});
396396

397397
it('the validate preview answers as the insert does: reference_not_found for the unreadable target, the rule for the readable one', async () => {
398-
const unreadable = (await engine.validate(RULED, { title: 'preview', duty: 't_trip_other' }, { mode: 'insert', context: ALICE } as any)).results?.[0];
398+
const unreadable = (await engine.validate(RULED, { title: 'preview', duty: 't_flagged_other' }, { mode: 'insert', context: ALICE } as any)).results?.[0];
399399
expect(unreadable?.valid).toBe(false);
400400
expect((unreadable?.errors ?? []).map((e: any) => ({ field: e.field, code: e.code }))).toEqual([{ field: 'duty', code: 'reference_not_found' }]);
401-
expect(JSON.stringify(unreadable?.errors ?? [])).not.toContain(TRIPPED);
402-
const readable = (await engine.validate(RULED, { title: 'preview', duty: 't_trip_mine' }, { mode: 'insert', context: ALICE } as any)).results?.[0];
401+
expect(JSON.stringify(unreadable?.errors ?? [])).not.toContain(RULE_MESSAGE);
402+
const readable = (await engine.validate(RULED, { title: 'preview', duty: 't_flagged_mine' }, { mode: 'insert', context: ALICE } as any)).results?.[0];
403403
expect(readable?.valid).toBe(false);
404-
expect((readable?.errors ?? []).some((e: any) => String(e.message).includes(TRIPPED))).toBe(true);
404+
expect((readable?.errors ?? []).some((e: any) => String(e.message).includes(RULE_MESSAGE))).toBe(true);
405405
});
406406
});
407407

‎packages/qa/dogfood/test/predicate-relationship-traversal.dogfood.test.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
// (the item's fixtures.knownGaps). Such a member may not name the parent at
2020
// all (#29029, revision 7): a write naming a parent the caller's own read
2121
// door does not return answers `reference_not_found` on the lookup, before
22-
// the record's rules, whether or not the parent trips one (acceptance[3],
23-
// negative[2]). A read of the parent as that member is the control that the
22+
// the record's validation rules (acceptance[3], negative[2]). A read of the parent as that member is the control that the
2423
// member really cannot read it.
2524
//
2625
// The rule's refusal is scored on the envelope — 400 VALIDATION_FAILED, the
@@ -206,12 +205,12 @@ describe('records-forms.predicate-relationship-traversal — a member who cannot
206205
expect(read.json.code).toBe('PERMISSION_DENIED');
207206
});
208207

209-
it('acceptance[3]: a write naming a non-tripping parent the member cannot read answers reference_not_found, and stores nothing', async () => {
208+
it('acceptance[3]: a write naming a parent the member cannot read answers reference_not_found, and stores nothing', async () => {
210209
expectReferenceRefusal(await call('POST', `/data/${CHILD}`, { name: 'prt-open', parent: openId }), 'parent');
211210
expect(await stack.rows(CHILD, { name: 'prt-open' })).toHaveLength(0);
212211
});
213212

214-
it('acceptance[3], negative[2]: a write naming a tripping parent the member cannot read answers the same, never the rule\'s message', async () => {
213+
it('acceptance[3], negative[2]: the reference check answers before the record\'s validation rules, never a rule\'s message', async () => {
215214
const answer = await call('POST', `/data/${CHILD}`, { name: 'prt-blocked', parent: blockedId });
216215
expectReferenceRefusal(answer, 'parent');
217216
expect(JSON.stringify(answer.json)).not.toContain(BLOCKED_MESSAGE);

0 commit comments

Comments
 (0)