Skip to content

Commit b2ea2ae

Browse files
committed
test(lint): re-pin the shipped predicate census after the object form's expression gate went
The object form's `expression` row no longer carries `visibleWhen: "data.type == 'formula'"`, so the three census counts in validate-predicate-path-refs.test.ts each drop by one: 89 -> 88 shipped predicates, 66 -> 65 literal comparisons, 19 -> 18 object-form `data.type`-rooted predicates. Claude-Session: https://claude.ai/code/session_01D6F9axfoPzR7t8G1J7Ytzz Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4288258 commit b2ea2ae

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

‎packages/lint/src/validate-predicate-path-refs.test.ts‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,12 @@ describe('#7010 corpus — shipped METADATA_FORM_REGISTRY', () => {
682682
// It is 89 today, an ADDITION of ONE: #23735 offered the field form's
683683
// `referenceDeletedWhen` composite row, gated like `referenceVia` on
684684
// `data.type == 'text'`. It reaches the literal-comparison census below.
685-
expect(predicates, 'the shipped metadata forms carry no predicates at all').toBe(89);
685+
// It is 88 today, a REMOVAL of ONE: #24735 dropped the object form's
686+
// `object :: expression :: data.type == 'formula'` gate. `FieldSchema`
687+
// accepts `expression` on every type and the engine computes and stores it
688+
// on a non-formula field, so the formula-only row hid a live key; the row
689+
// is now shown for every type, as the field form's own row already was.
690+
expect(predicates, 'the shipped metadata forms carry no predicates at all').toBe(88);
686691

687692
const findings = validatePredicatePathRefs(corrupted);
688693
expect(findings).toHaveLength(predicates);
@@ -793,7 +798,9 @@ describe('#7010 corpus — shipped METADATA_FORM_REGISTRY', () => {
793798
// `data.type == 'email'`, a single-quoted literal comparison.
794799
// It is 66 today: #23735's `field :: referenceDeletedWhen` row is gated on
795800
// `data.type == 'text'`, a single-quoted literal comparison.
796-
expect(comparisons, 'no shipped predicate carries an `==`/`!=` literal comparison').toBe(66);
801+
// It is 65 today: #24735 removed the object form's `expression` gate,
802+
// `data.type == 'formula'`, one single-quoted literal comparison.
803+
expect(comparisons, 'no shipped predicate carries an `==`/`!=` literal comparison').toBe(65);
797804

798805
const rhsFindings = validatePredicatePathRefs(corrupted)
799806
.filter((f) => f.rule === PREDICATE_RHS_PATH_SHAPED);
@@ -822,7 +829,9 @@ describe('#7010 corpus — shipped METADATA_FORM_REGISTRY', () => {
822829
// tree adds over its merge base — the two corpora were enumerated and
823830
// differenced by `<form>::<field>::<source>`, and the object-form half of
824831
// the two-entry delta is exactly it. #6254's own measurement was 16 and
825-
// stays 16 — that number is history, this one is a census.
832+
// stays 16 — that number is history, this one is a census. It is 18 today:
833+
// #24735 removed the `expression` row's `data.type == 'formula'` gate, so
834+
// that row is shown for every field type.
826835
const objectForm = structuredClone(METADATA_FORM_REGISTRY.object) as Record<string, unknown>;
827836
let restored = 0;
828837
const debare = (node: unknown): void => {
@@ -852,10 +861,10 @@ describe('#7010 corpus — shipped METADATA_FORM_REGISTRY', () => {
852861
expect(
853862
restored,
854863
"the object form's `data.type`-rooted predicates are no longer where this test looks",
855-
).toBe(19);
864+
).toBe(18);
856865

857866
const findings = validatePredicatePathRefs({ views: [objectForm] });
858-
expect(findings).toHaveLength(19);
867+
expect(findings).toHaveLength(18);
859868
expect(new Set(findings.map((f) => f.rule))).toEqual(new Set([PREDICATE_PATH_UNROOTED]));
860869
expect(findings[0].message).toContain('`type`');
861870
});

0 commit comments

Comments
 (0)