Skip to content

Commit 343e21e

Browse files
committed
test(verify): the two-level parent write reach is proven once the chain hop agrees with the quote's own write
PR #23091 pinned today's answer for pwr_quote_line as contradicted. With the chain hop judged by the middle master's own direct-write composition (ruling A on #23093), every persona's quote-line writes agree with its update of the quote: the object is proven and the run has no hard failure. Expectation flips only. Claude-Session: https://claude.ai/code/session_01FzQy26KznSa5j2gnf3AzsE Co-authored-by: Claude <noreply@anthropic.com>
1 parent d6b81d9 commit 343e21e

1 file changed

Lines changed: 16 additions & 18 deletions

File tree

‎packages/verify/src/parent-write-reach.test.ts‎

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -240,34 +240,32 @@ describe('runParentWriteReachProofs — the fixture app, booted with parentWrite
240240
expect(shape(report, 'pwr_quote', 'position:pwr_rep', 'own')).toEqual(NO_DELETE);
241241
});
242242

243-
it("finds today's engine refusing a two-level detail whose master the persona edits", () => {
243+
it('proves a two-level detail whose master the persona edits, for every persona, as the quote\'s own write answers', () => {
244244
// ADR-0055's amendment: the write gate walks the chain hop by hop, and a
245-
// detail whose whole chain is reachable stays writable. Measured on this
246-
// engine, a quote line is refused for every persona, its own chain
247-
// included, while the same persona's empty update of the quote is admitted.
248-
// This flips to `proven` the day the chain walk agrees with the quote's own write.
245+
// detail whose whole chain is reachable stays writable. Since the
246+
// maintainer's ruling A on #23093 the hop judges the quote by the
247+
// composition its own write is judged by, so a quote line agrees with the
248+
// same persona's update of the quote, its own chain included.
249249
const r = resultFor(report, 'pwr_quote_line');
250-
expect(r.status).toBe('contradicted');
250+
expect(r.status, formatParentWriteReachReport(report)).toBe('proven');
251251
for (const masters of ['other', 'own'] as const) {
252252
const reach = reachOf(report, 'pwr_quote_line', 'master-all-records', masters);
253253
expect(reach.masterEdit).toBe('editable');
254-
expect(reach.probes.map((p) => p.outcome)).toEqual(['contradicted', 'contradicted', 'contradicted', 'contradicted', 'contradicted']);
255-
for (const p of reach.probes) {
256-
expect(p.answer).toMatchObject({ kind: 'refused', status: 403, code: 'PERMISSION_DENIED', object: 'pwr_quote_line' });
257-
expect(p.detail).toMatch(/^the persona holds allow(Edit|Delete|Create) on pwr_quote_line and edited its master pwr_quote, and the (edit|delete|create) was refused/);
258-
}
254+
// Admitted, and the record shows each write landed (the family's own read-back).
255+
expect(shape(report, 'pwr_quote_line', 'master-all-records', masters)).toEqual(ALL_ALLOWED);
256+
for (const p of reach.probes) expect(p.answer).toMatchObject({ kind: 'written' });
259257
// Where the conjunction refuses, the refusal still holds.
260258
expect(shape(report, 'pwr_quote_line', 'detail-only', masters)).toEqual(ALL_REFUSED);
261259
}
262-
expect(formatParentWriteReachReport(report)).toContain('✗ pwr_quote_line (pwr_quote_line.quote → pwr_quote, pwr_quote.account → pwr_account) CONTRADICTED');
260+
expect(formatParentWriteReachReport(report)).toContain('✓ pwr_quote_line (pwr_quote_line.quote → pwr_quote, pwr_quote.account → pwr_account) held on');
263261
});
264262

265-
it('counts every reach and write, and the contradicted chain is its one hard failure', () => {
263+
it('counts every reach and write, and every object is proven', () => {
266264
expect(report.summary).toEqual({
267265
objects: 3,
268266
probed: 3,
269-
proven: 2,
270-
contradicted: 1,
267+
proven: 3,
268+
contradicted: 0,
271269
failed: 0,
272270
inconclusive: 0,
273271
excluded: 0,
@@ -276,12 +274,12 @@ describe('runParentWriteReachProofs — the fixture app, booted with parentWrite
276274
// 3 objects × 5 personas × 2 master chains, the rep's three chains another principal owns outside its reach.
277275
reaches: { probed: 27, unreadable: 3, unmeasured: 0 },
278276
probes: { edit: 54, delete: 54, create: 27 },
279-
held: 104,
280-
contradictions: 31,
277+
held: 135,
278+
contradictions: 0,
281279
unattributed: 0,
282280
faults: 0,
283281
notRun: 0,
284-
hardFailures: 1,
282+
hardFailures: 0,
285283
});
286284
});
287285
});

0 commit comments

Comments
 (0)