|
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 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. |
| 107 | + * - **`objectui` is a RECORDED constant, not a live scan.** A test in this |
| 108 | + * repo could not read that checkout. Since objectui was imported under `ui/` |
| 109 | + * (objectstack#25803) it can, but the walk still skips the top-level `ui/`: |
| 110 | + * reading it would make `ui/**` an input of `@objectstack/client#test`, |
| 111 | + * and ci.yml's `crosspkg` filter does not cover that path yet |
| 112 | + * (`check-ci-filter-parity`). `OBJECTUI_CENSUS` is re-recorded at the |
| 113 | + * imported revision, and the live scan returns with the card that adds the |
| 114 | + * path to that filter. |
113 | 115 | * - **The ratchet in section 3 is only as live as turbo's cache — for the |
114 | 116 | * trees still undeclared.** This suite walks the whole workspace, while |
115 | 117 | * `@objectstack/client#test` declares as inputs its own package plus the |
|
122 | 124 | * client suite on virtually every commit, so it stays a recorded bound |
123 | 125 | * rather than one bought at that price — a new call site added in another |
124 | 126 | * PACKAGE can still leave this suite cached-green until something else |
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, |
| 127 | + * invalidates it. On a cold cache and in CI's full run the count is exact, |
129 | 128 | * and a call site added inside `packages/client` — where every site lives |
130 | 129 | * today — invalidates normally. |
131 | 130 | */ |
@@ -205,9 +204,18 @@ interface Site { |
205 | 204 | index: number; |
206 | 205 | } |
207 | 206 |
|
| 207 | +/** |
| 208 | + * [#25803] Top-level directories of THIS repository the walk does not enter: |
| 209 | + * the imported objectui tree, recorded as `OBJECTUI_CENSUS` instead (see the |
| 210 | + * header). Matched at the repository root only, never as a name at any depth |
| 211 | + * the way `SKIP_DIRS` is: `packages/spec/src/ui` is this census's own ground. |
| 212 | + */ |
| 213 | +const SKIP_TOP_LEVEL = new Set(['ui']); |
| 214 | + |
208 | 215 | function walk(dir: string, acc: string[] = []): string[] { |
209 | 216 | for (const entry of readdirSync(dir)) { |
210 | 217 | if (SKIP_DIRS.has(entry)) continue; |
| 218 | + if (dir === REPO_ROOT && SKIP_TOP_LEVEL.has(entry)) continue; |
211 | 219 | const p = join(dir, entry); |
212 | 220 | let st; |
213 | 221 | try { st = statSync(p); } catch { continue; } |
@@ -439,8 +447,6 @@ interface LedgerRow { |
439 | 447 | count: number; |
440 | 448 | verdict: Verdict; |
441 | 449 | why: string; |
442 | | - /** [#25803] A production call site, not a test pin. §3 holds these to the ones listed. */ |
443 | | - production?: true; |
444 | 450 | } |
445 | 451 |
|
446 | 452 | /** |
@@ -571,21 +577,34 @@ const LEDGER: readonly LedgerRow[] = [ |
571 | 577 | method: 'analytics.explain', receiver: 'sdk', count: 1, verdict: 'RESULT_INSENSITIVE', |
572 | 578 | why: 'asserts POST /analytics/sql and the body; the resolved value is discarded', |
573 | 579 | }, |
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 | | - }, |
583 | 580 | ]; |
584 | 581 |
|
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. |
| 582 | +/** |
| 583 | + * `objectui` @ 9e1fe032866965c7cb0460cff2b6af09350236b7, the revision imported |
| 584 | + * under `ui/` (objectstack#25803; first recorded at b84dc18549, 2026-08-31). |
| 585 | + * Recorded, not live-scanned: the walk skips `ui/` (see the header). Reproduce |
| 586 | + * with `OBJECTUI_CENSUS_COMMAND`; the file count is the walk's own rule applied |
| 587 | + * to the tracked `ui/` tree. |
| 588 | + * |
| 589 | + * ⭐ The single production call site in either tree. `aggregate()` used to feed |
| 590 | + * the resolved value through a tolerant chain that accepted both the |
| 591 | + * pre-#13079 envelope and the post-unwrap `AnalyticsResult`. objectui#7028, the |
| 592 | + * tightening this record named as owed, has landed: the adapter reads `rows` |
| 593 | + * off the post-unwrap result and throws `AnalyticsResultShapeError` on any |
| 594 | + * other shape, so it is payload-dependent and reads no envelope. |
| 595 | + */ |
| 596 | +const OBJECTUI_CENSUS = { |
| 597 | + revision: '9e1fe032866965c7cb0460cff2b6af09350236b7', |
| 598 | + filesScanned: 7954, |
| 599 | + sdkCallSites: 1, |
| 600 | + productionCallSites: 1, |
| 601 | + wouldBreak: 0, |
| 602 | + site: 'ui/packages/data-objectstack/src/index.ts:6625 (analytics.query, via this.client)', |
| 603 | + tighteningOwner: 'objectui#7028', |
| 604 | +} as const; |
| 605 | + |
| 606 | +const OBJECTUI_CENSUS_COMMAND = |
| 607 | + "git grep -nE 'analytics\\s*\\.\\s*(query|meta|explain)\\s*\\(|automation\\s*\\.\\s*trigger\\s*\\(' HEAD -- 'ui/*.ts' 'ui/*.tsx' 'ui/*.js'"; |
589 | 608 |
|
590 | 609 | /** |
591 | 610 | * ⛔ `objectstack-ai/cloud` is NOT MEASURED — see the header. Post-#13079 |
@@ -779,38 +798,34 @@ describe('#13079 §3 — every call site is classified', () => { |
779 | 798 | expect(ledgerTotal, literalNote()).toBe(CENSUS.sites.length); |
780 | 799 | }); |
781 | 800 |
|
782 | | - it('⭐ THE NUMBER, post-convergence: ZERO call sites still read the envelope, and the only production site is the ledgered consumer', () => { |
| 801 | + it('⭐ THE NUMBER, post-convergence: ZERO call sites still read the envelope, and none is production code', () => { |
783 | 802 | // The ratchet the convergence leaves behind. A site that reads `.data` |
784 | 803 | // or the envelope's `success` off these four now reads `undefined` |
785 | 804 | // (or fails to compile); the only legal way to add one is to classify |
786 | 805 | // it here — and this line refuses the classification. |
787 | 806 | expect(verdictTotal('ENVELOPE_DEPENDENT')).toBe(0); |
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. |
| 807 | + // Every site is a test pin. There is still no production call site in |
| 808 | + // this repo, so the migration in-repo was exactly this change's diff. |
791 | 809 | // [#13874] A refusal string that quotes `client.` + the method inside a |
792 | 810 | // `.mjs` gate script reads as a PRODUCTION SDK call site and breaks |
793 | 811 | // exactly here — the loudest possible wrong conclusion this file can |
794 | 812 | // reach, so the note travels with it. |
795 | 813 | const production = sdkSites.filter((s) => !/\.test\.tsx?$/.test(s.file)); |
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([]); |
| 814 | + expect(production, literalNote()).toEqual([]); |
801 | 815 | }); |
802 | 816 |
|
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); |
| 817 | + it('records the split: 18 payload pins, 10 result-insensitive, 11 not-SDK', () => { |
| 818 | + expect(verdictTotal('PAYLOAD_DEPENDENT')).toBe(18); |
806 | 819 | expect(verdictTotal('RESULT_INSENSITIVE')).toBe(10); |
807 | 820 | // [#21441] 8 -> 9: the date-bucket echo pin's producer call (§2). |
808 | 821 | // [#21647] 9 -> 11: the bucket echo enumeration's two producer calls (§2). |
809 | 822 | expect(verdictTotal('NOT_SDK')).toBe(11); |
810 | 823 | // The three above are LEDGER sums and cannot move on a census reading; |
811 | 824 | // this one is census-derived, so it carries the note. [#13874] |
812 | | - // [#25803] 28 -> 29: the walk reaches ui/ since the objectui import. |
813 | | - expect(sdkSites.length, literalNote()).toBe(29); |
| 825 | + expect(sdkSites.length, literalNote()).toBe(28); |
| 826 | + // [#25803] 28 -> 29 first-party SDK sites since the objectui import: the |
| 827 | + // walk's 28 plus the recorded objectui one, which it does not enter. |
| 828 | + expect(sdkSites.length + OBJECTUI_CENSUS.sdkCallSites, literalNote()).toBe(29); |
814 | 829 | }); |
815 | 830 | }); |
816 | 831 |
|
@@ -846,10 +861,16 @@ describe('#13079 §4 — the four end in `unwrapResponse`; `analytics.queryDatas |
846 | 861 | }); |
847 | 862 |
|
848 | 863 | describe('#13079 §5 — what was NOT measured', () => { |
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]]); |
| 864 | + it('objectui is recorded with its revision, its one production site survives, and its tightening has an owner', () => { |
| 865 | + expect(OBJECTUI_CENSUS.productionCallSites).toBe(1); |
| 866 | + expect(OBJECTUI_CENSUS.wouldBreak).toBe(0); |
| 867 | + expect(OBJECTUI_CENSUS.revision).toMatch(/^[0-9a-f]{40}$/); |
| 868 | + expect(OBJECTUI_CENSUS.tighteningOwner).toBe('objectui#7028'); |
| 869 | + expect(OBJECTUI_CENSUS.site.startsWith('ui/')).toBe(true); |
| 870 | + expect(OBJECTUI_CENSUS_COMMAND).toContain("'ui/*.ts'"); |
| 871 | + // [#25803] And the walk really does not enter it, so the record is the |
| 872 | + // only reading of that tree here. |
| 873 | + expect(CENSUS.sites.some((s) => s.file.startsWith('ui/'))).toBe(false); |
853 | 874 | }); |
854 | 875 |
|
855 | 876 | it('⛔ cloud is NOT MEASURED, ruled so, and must not be read as clean', () => { |
|
0 commit comments