Skip to content

Commit e52c8fd

Browse files
committed
test(cutover): the envelope caller census reads objectui live, 28 to 29 sites (objectstack#25803)
Cutover bill item 17. packages/client/src/envelope-caller-census.test.ts walks the whole workspace, and the merged tree adds one SDK call site: ui/packages/data-objectstack/src/index.ts (aggregate(), client.analytics.query), the objectui data adapter and the first production SDK call site the walk can reach. It was already known as the recorded OBJECTUI_CENSUS constant, taken in a checkout this repo could not read. The recorded constant becomes a live LEDGER row (PAYLOAD_DEPENDENT, marked production: objectui#7028 has tightened the old tolerant chain to one rows read that throws AnalyticsResultShapeError on any other shape). The production assertion becomes 'the only production sites are the ledgered ones, and none reads the envelope'. PAYLOAD_DEPENDENT moves 18 to 19, the SDK site count 28 to 29. OBJECTUI_CENSUS and OBJECTUI_CENSUS_COMMAND retire with a note, and the section-5 case now asserts the walk finds that one site. The header records that ui/** is not a declared cross-package input of @objectstack/client#test; the one ledgered file under it is, by name, like the ledgered packages/** files: scripts/cross-package-test-inputs.mjs and turbo.json's @objectstack/client#test inputs gain ui/packages/data-objectstack/src/index.ts, so check:cross-package-test-inputs stays 0 with the test naming it. Before: 3 failed / 18 passed. After: 21/21; check:cross-package-test-inputs 0 (without the declaration it reds on the ledger row). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CUXv64KLMfYv3ia2sWi6te
1 parent 5a28620 commit e52c8fd

3 files changed

Lines changed: 47 additions & 54 deletions

File tree

‎packages/client/src/envelope-caller-census.test.ts‎

Lines changed: 43 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,12 @@
104104
* - **Published npm consumers outside these repos — UNMEASURABLE.** The SDK
105105
* ships to consumers no repo sweep can see; the changeset carries their
106106
* 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.
110113
* - **The ratchet in section 3 is only as live as turbo's cache — for the
111114
* trees still undeclared.** This suite walks the whole workspace, while
112115
* `@objectstack/client#test` declares as inputs its own package plus the
@@ -119,7 +122,10 @@
119122
* client suite on virtually every commit, so it stays a recorded bound
120123
* rather than one bought at that price — a new call site added in another
121124
* 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,
123129
* and a call site added inside `packages/client` — where every site lives
124130
* today — invalidates normally.
125131
*/
@@ -433,6 +439,8 @@ interface LedgerRow {
433439
count: number;
434440
verdict: Verdict;
435441
why: string;
442+
/** [#25803] A production call site, not a test pin. §3 holds these to the ones listed. */
443+
production?: true;
436444
}
437445

438446
/**
@@ -563,44 +571,21 @@ const LEDGER: readonly LedgerRow[] = [
563571
method: 'analytics.explain', receiver: 'sdk', count: 1, verdict: 'RESULT_INSENSITIVE',
564572
why: 'asserts POST /analytics/sql and the body; the resolved value is discarded',
565573
},
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+
},
566583
];
567584

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.
604589

605590
/**
606591
* ⛔ `objectstack-ai/cloud` is NOT MEASURED — see the header. Post-#13079
@@ -794,31 +779,38 @@ describe('#13079 §3 — every call site is classified', () => {
794779
expect(ledgerTotal, literalNote()).toBe(CENSUS.sites.length);
795780
});
796781

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', () => {
798783
// The ratchet the convergence leaves behind. A site that reads `.data`
799784
// or the envelope's `success` off these four now reads `undefined`
800785
// (or fails to compile); the only legal way to add one is to classify
801786
// it here — and this line refuses the classification.
802787
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.
805791
// [#13874] A refusal string that quotes `client.` + the method inside a
806792
// `.mjs` gate script reads as a PRODUCTION SDK call site and breaks
807793
// exactly here — the loudest possible wrong conclusion this file can
808794
// reach, so the note travels with it.
809795
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([]);
811801
});
812802

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);
815806
expect(verdictTotal('RESULT_INSENSITIVE')).toBe(10);
816807
// [#21441] 8 -> 9: the date-bucket echo pin's producer call (§2).
817808
// [#21647] 9 -> 11: the bucket echo enumeration's two producer calls (§2).
818809
expect(verdictTotal('NOT_SDK')).toBe(11);
819810
// The three above are LEDGER sums and cannot move on a census reading;
820811
// 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);
822814
});
823815
});
824816

@@ -854,12 +846,10 @@ describe('#13079 §4 — the four end in `unwrapResponse`; `analytics.queryDatas
854846
});
855847

856848
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]]);
863853
});
864854

865855
it('⛔ cloud is NOT MEASURED, ruled so, and must not be read as clean', () => {

‎scripts/cross-package-test-inputs.mjs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,8 @@ export const CROSS_PACKAGE_TEST_INPUTS = {
848848
// (receiver `service`). A call added to or removed from that file moves
849849
// the census verdict, so a change to it has to re-run this suite.
850850
'packages/services/service-analytics/src/__tests__/objectql-echo-bucket-enumeration.test.ts',
851+
// [#25803] the census LEDGER row for objectui's data adapter, the one call site under ui/.
852+
'ui/packages/data-objectstack/src/index.ts',
851853
],
852854
heldBy: {
853855
// `scripts/**` is rostered TODAY through the census's own

‎turbo.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,8 @@
318318
"$TURBO_ROOT$/packages/rest/src/analytics-nested-relation-filter.test.ts",
319319
"$TURBO_ROOT$/packages/drivers/driver-memory/src/memory-exists-non-boolean-refusal.test.ts",
320320
"$TURBO_ROOT$/packages/services/service-analytics/src/__tests__/objectql-echo-date-bucket.test.ts",
321-
"$TURBO_ROOT$/packages/services/service-analytics/src/__tests__/objectql-echo-bucket-enumeration.test.ts"
321+
"$TURBO_ROOT$/packages/services/service-analytics/src/__tests__/objectql-echo-bucket-enumeration.test.ts",
322+
"$TURBO_ROOT$/ui/packages/data-objectstack/src/index.ts"
322323
]
323324
},
324325
"@objectstack/lint#test": {

0 commit comments

Comments
 (0)