|
104 | 104 | * - **Published npm consumers outside these repos — UNMEASURABLE.** The SDK |
105 | 105 | * ships to consumers no repo sweep can see; the changeset carries their |
106 | 106 | * migration. This census bounds the first-party population only. |
107 | | - * - **`objectui` is a RECORDED constant, not a live scan.** A test in this |
108 | | - * repo cannot read that checkout. `OBJECTUI_CENSUS` carries the revision it |
109 | | - * was measured at and the command that reproduces it. |
| 107 | + * - **`objectui` is a LIVE scan now, no longer a recorded constant.** |
| 108 | + * [#25803] It used to be `OBJECTUI_CENSUS`, a reading taken in an objectui |
| 109 | + * checkout this repo could not see. Since objectui was imported under `ui/` |
| 110 | + * the walk reaches it, and its one call site -- the data adapter's |
| 111 | + * `aggregate()`, the first-party PRODUCTION consumer the convergence was |
| 112 | + * for -- is a `LEDGER` row like any other. |
110 | 113 | * - **The ratchet in section 3 is only as live as turbo's cache — for the |
111 | 114 | * trees still undeclared.** This suite walks the whole workspace, while |
112 | 115 | * `@objectstack/client#test` declares as inputs its own package plus the |
|
119 | 122 | * client suite on virtually every commit, so it stays a recorded bound |
120 | 123 | * rather than one bought at that price — a new call site added in another |
121 | 124 | * PACKAGE can still leave this suite cached-green until something else |
122 | | - * invalidates it. On a cold cache and in CI's full run the count is exact, |
| 125 | + * invalidates it. `ui/**` is undeclared for the same reason [#25803], so a |
| 126 | + * new objectui call site is bounded the same way; the one ledgered there, |
| 127 | + * `ui/packages/data-objectstack/src/index.ts`, is declared by name, as the |
| 128 | + * ledgered `packages/**` files are. On a cold cache and in CI's full run the count is exact, |
123 | 129 | * and a call site added inside `packages/client` — where every site lives |
124 | 130 | * today — invalidates normally. |
125 | 131 | */ |
@@ -433,6 +439,8 @@ interface LedgerRow { |
433 | 439 | count: number; |
434 | 440 | verdict: Verdict; |
435 | 441 | why: string; |
| 442 | + /** [#25803] A production call site, not a test pin. §3 holds these to the ones listed. */ |
| 443 | + production?: true; |
436 | 444 | } |
437 | 445 |
|
438 | 446 | /** |
@@ -563,44 +571,21 @@ const LEDGER: readonly LedgerRow[] = [ |
563 | 571 | method: 'analytics.explain', receiver: 'sdk', count: 1, verdict: 'RESULT_INSENSITIVE', |
564 | 572 | why: 'asserts POST /analytics/sql and the body; the resolved value is discarded', |
565 | 573 | }, |
| 574 | + // ── the one PRODUCTION consumer: objectui's data adapter, live since the import ── |
| 575 | + // [#25803] Was `OBJECTUI_CENSUS`, recorded at objectui b84dc18549 when this |
| 576 | + // repo could not read that checkout. objectui#7028, the tightening that |
| 577 | + // record's owner field named, has landed: the tolerant chain is gone. |
| 578 | + { |
| 579 | + file: 'ui/packages/data-objectstack/src/index.ts', |
| 580 | + method: 'analytics.query', receiver: 'sdk', count: 1, verdict: 'PAYLOAD_DEPENDENT', production: true, |
| 581 | + why: '`aggregate()` reads `rows` off the post-unwrap AnalyticsResult and throws AnalyticsResultShapeError on any other shape (objectui#7028)', |
| 582 | + }, |
566 | 583 | ]; |
567 | 584 |
|
568 | | -/** |
569 | | - * `objectui` @ b84dc1854922c266850d6e573daf3ad59cbd0623 (origin/main, |
570 | | - * 2026-08-31). Recorded, not live-scanned — a test here cannot read that |
571 | | - * checkout. Reproduce with `OBJECTUI_CENSUS_COMMAND`. |
572 | | - * |
573 | | - * ⭐ The single production call site in either reachable repo, and it SURVIVES |
574 | | - * the convergence untouched. `aggregate()` feeds the resolved value through a |
575 | | - * tolerant chain that accepts both spellings: |
576 | | - * |
577 | | - * const rawRows = Array.isArray(data) ? data |
578 | | - * : data?.rows && Array.isArray(data.rows) ? data.rows // post-#13079: this branch |
579 | | - * : data?.data && Array.isArray(data.data) ? data.data |
580 | | - * : data?.data?.rows && Array.isArray(data.data.rows) ? data.data.rows // pre-#13079: this branch |
581 | | - * : data?.results && Array.isArray(data.results) ? data.results |
582 | | - * : []; |
583 | | - * |
584 | | - * Before #13079 branch 4 matched; after it branch 2 matches. ⚠️ It survives |
585 | | - * by DEFENSIVE CODING, not by a designed migration path — the adapter was |
586 | | - * written tolerant because the producer was ambiguous, which is the shape a |
587 | | - * contract-first fix removes rather than relies on. Ruling item 3: objectui#7028 |
588 | | - * tightens the chain to the single post-unwrap spelling, time-gated behind |
589 | | - * this convergence landing and objectui taking the SDK version — the chain is |
590 | | - * load-bearing until then, so it is deliberately NOT part of this change. |
591 | | - */ |
592 | | -const OBJECTUI_CENSUS = { |
593 | | - revision: 'b84dc1854922c266850d6e573daf3ad59cbd0623', |
594 | | - filesScanned: 4024, |
595 | | - sdkCallSites: 1, |
596 | | - productionCallSites: 1, |
597 | | - wouldBreak: 0, |
598 | | - site: 'packages/data-objectstack/src/index.ts:4846 (analytics.query, via this.client)', |
599 | | - tighteningOwner: 'objectui#7028', |
600 | | -} as const; |
601 | | - |
602 | | -const OBJECTUI_CENSUS_COMMAND = |
603 | | - "git -C <objectui> grep -nE 'analytics\\s*\\.\\s*(query|meta|explain)\\s*\\(|automation\\s*\\.\\s*trigger\\s*\\(' origin/main -- '*.ts' '*.tsx' '*.js'"; |
| 585 | +// [#25803] `OBJECTUI_CENSUS` and `OBJECTUI_CENSUS_COMMAND` retired with the |
| 586 | +// objectui import: the recorded constant (objectui b84dc18549, one production |
| 587 | +// site, 0 would break, tightening owned by objectui#7028) is the live `LEDGER` |
| 588 | +// row above, and the walk that reads it is this file's own. |
604 | 589 |
|
605 | 590 | /** |
606 | 591 | * ⛔ `objectstack-ai/cloud` is NOT MEASURED — see the header. Post-#13079 |
@@ -794,31 +779,38 @@ describe('#13079 §3 — every call site is classified', () => { |
794 | 779 | expect(ledgerTotal, literalNote()).toBe(CENSUS.sites.length); |
795 | 780 | }); |
796 | 781 |
|
797 | | - it('⭐ THE NUMBER, post-convergence: ZERO call sites still read the envelope, and none is production code', () => { |
| 782 | + it('⭐ THE NUMBER, post-convergence: ZERO call sites still read the envelope, and the only production site is the ledgered consumer', () => { |
798 | 783 | // The ratchet the convergence leaves behind. A site that reads `.data` |
799 | 784 | // or the envelope's `success` off these four now reads `undefined` |
800 | 785 | // (or fails to compile); the only legal way to add one is to classify |
801 | 786 | // it here — and this line refuses the classification. |
802 | 787 | expect(verdictTotal('ENVELOPE_DEPENDENT')).toBe(0); |
803 | | - // Every site is a test pin. There is still no production call site in |
804 | | - // this repo, so the migration in-repo was exactly this change's diff. |
| 788 | + // Every other site is a test pin. [#25803] The one production call site |
| 789 | + // is objectui's data adapter, ledgered `production` and read as the |
| 790 | + // payload; a second one, or the first reading the envelope, reds here. |
805 | 791 | // [#13874] A refusal string that quotes `client.` + the method inside a |
806 | 792 | // `.mjs` gate script reads as a PRODUCTION SDK call site and breaks |
807 | 793 | // exactly here — the loudest possible wrong conclusion this file can |
808 | 794 | // reach, so the note travels with it. |
809 | 795 | const production = sdkSites.filter((s) => !/\.test\.tsx?$/.test(s.file)); |
810 | | - expect(production, literalNote()).toEqual([]); |
| 796 | + const ledgeredProduction = LEDGER.filter((r) => r.production); |
| 797 | + expect(production.map((s) => `${s.file}|${s.method}`), literalNote()).toEqual( |
| 798 | + ledgeredProduction.flatMap((r) => Array.from({ length: r.count }, () => `${r.file}|${r.method}`)), |
| 799 | + ); |
| 800 | + expect(ledgeredProduction.filter((r) => r.verdict === 'ENVELOPE_DEPENDENT')).toEqual([]); |
811 | 801 | }); |
812 | 802 |
|
813 | | - it('records the split: 18 payload pins, 10 result-insensitive, 11 not-SDK', () => { |
814 | | - expect(verdictTotal('PAYLOAD_DEPENDENT')).toBe(18); |
| 803 | + it('records the split: 18 payload pins plus the production consumer, 10 result-insensitive, 11 not-SDK', () => { |
| 804 | + // [#25803] 18 -> 19: the objectui data adapter reads the payload too. |
| 805 | + expect(verdictTotal('PAYLOAD_DEPENDENT')).toBe(19); |
815 | 806 | expect(verdictTotal('RESULT_INSENSITIVE')).toBe(10); |
816 | 807 | // [#21441] 8 -> 9: the date-bucket echo pin's producer call (§2). |
817 | 808 | // [#21647] 9 -> 11: the bucket echo enumeration's two producer calls (§2). |
818 | 809 | expect(verdictTotal('NOT_SDK')).toBe(11); |
819 | 810 | // The three above are LEDGER sums and cannot move on a census reading; |
820 | 811 | // this one is census-derived, so it carries the note. [#13874] |
821 | | - expect(sdkSites.length, literalNote()).toBe(28); |
| 812 | + // [#25803] 28 -> 29: the walk reaches ui/ since the objectui import. |
| 813 | + expect(sdkSites.length, literalNote()).toBe(29); |
822 | 814 | }); |
823 | 815 | }); |
824 | 816 |
|
@@ -854,12 +846,10 @@ describe('#13079 §4 — the four end in `unwrapResponse`; `analytics.queryDatas |
854 | 846 | }); |
855 | 847 |
|
856 | 848 | describe('#13079 §5 — what was NOT measured', () => { |
857 | | - it('objectui is recorded with its revision, its one production site survives, and its tightening has an owner', () => { |
858 | | - expect(OBJECTUI_CENSUS.productionCallSites).toBe(1); |
859 | | - expect(OBJECTUI_CENSUS.wouldBreak).toBe(0); |
860 | | - expect(OBJECTUI_CENSUS.revision).toMatch(/^[0-9a-f]{40}$/); |
861 | | - expect(OBJECTUI_CENSUS.tighteningOwner).toBe('objectui#7028'); |
862 | | - expect(OBJECTUI_CENSUS_COMMAND).toContain('origin/main'); |
| 849 | + it('[#25803] objectui is MEASURED now: its one production site is found by the walk, not recorded', () => { |
| 850 | + const objectui = sdkSites.filter((s) => s.file.startsWith('ui/')); |
| 851 | + expect(objectui.map((s) => `${s.file}|${s.method}`)).toEqual(['ui/packages/data-objectstack/src/index.ts|analytics.query']); |
| 852 | + expect(LEDGER.filter((r) => r.file.startsWith('ui/')).map((r) => [r.verdict, r.production])).toEqual([['PAYLOAD_DEPENDENT', true]]); |
863 | 853 | }); |
864 | 854 |
|
865 | 855 | it('⛔ cloud is NOT MEASURED, ruled so, and must not be read as clean', () => { |
|
0 commit comments