Skip to content

Commit 0b060f1

Browse files
committed
test(cutover): the envelope caller census records objectui instead of walking ui/, still 29 sites (bill item 44, objectstack#25803)
Respin of the census patch, as the bill's weaker alternative (PM ruling on run 2). Reading ui/ live made ui/packages/data-objectstack/src/index.ts a declared input of @objectstack/client#test, and check-ci-filter-parity reds on it: ci.yml's `core` and `crosspkg` filters do not cover that path, and ci.yml is Tier H, 4b's surface. So the walk skips the top-level `ui/` (root-relative, never a name at any depth: packages/spec/ src/ui stays walked), and OBJECTUI_CENSUS is re-recorded at the imported revision 9e1fe03: the one production site at ui/packages/data-objectstack/src/index.ts:6625, 7954 files under the walk's rule, the objectui#7028 tightening landed (reads `rows`, throws AnalyticsResultShapeError). The live count stays 28 and the first-party total reads 28 + 1 = 29. The ui/ entries in scripts/cross-package-test-inputs.mjs and turbo.json's @objectstack/client#test inputs are reverted; the live scan returns with the card that adds the path to `crosspkg`. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CUXv64KLMfYv3ia2sWi6te
1 parent 7e99e6a commit 0b060f1

3 files changed

Lines changed: 65 additions & 47 deletions

File tree

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

Lines changed: 64 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,14 @@
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 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.
113115
* - **The ratchet in section 3 is only as live as turbo's cache — for the
114116
* trees still undeclared.** This suite walks the whole workspace, while
115117
* `@objectstack/client#test` declares as inputs its own package plus the
@@ -122,10 +124,7 @@
122124
* client suite on virtually every commit, so it stays a recorded bound
123125
* rather than one bought at that price — a new call site added in another
124126
* 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,
129128
* and a call site added inside `packages/client` — where every site lives
130129
* today — invalidates normally.
131130
*/
@@ -205,9 +204,18 @@ interface Site {
205204
index: number;
206205
}
207206

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+
208215
function walk(dir: string, acc: string[] = []): string[] {
209216
for (const entry of readdirSync(dir)) {
210217
if (SKIP_DIRS.has(entry)) continue;
218+
if (dir === REPO_ROOT && SKIP_TOP_LEVEL.has(entry)) continue;
211219
const p = join(dir, entry);
212220
let st;
213221
try { st = statSync(p); } catch { continue; }
@@ -439,8 +447,6 @@ interface LedgerRow {
439447
count: number;
440448
verdict: Verdict;
441449
why: string;
442-
/** [#25803] A production call site, not a test pin. §3 holds these to the ones listed. */
443-
production?: true;
444450
}
445451

446452
/**
@@ -571,21 +577,34 @@ const LEDGER: readonly LedgerRow[] = [
571577
method: 'analytics.explain', receiver: 'sdk', count: 1, verdict: 'RESULT_INSENSITIVE',
572578
why: 'asserts POST /analytics/sql and the body; the resolved value is discarded',
573579
},
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-
},
583580
];
584581

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'";
589608

590609
/**
591610
* ⛔ `objectstack-ai/cloud` is NOT MEASURED — see the header. Post-#13079
@@ -779,38 +798,34 @@ describe('#13079 §3 — every call site is classified', () => {
779798
expect(ledgerTotal, literalNote()).toBe(CENSUS.sites.length);
780799
});
781800

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', () => {
783802
// The ratchet the convergence leaves behind. A site that reads `.data`
784803
// or the envelope's `success` off these four now reads `undefined`
785804
// (or fails to compile); the only legal way to add one is to classify
786805
// it here — and this line refuses the classification.
787806
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.
791809
// [#13874] A refusal string that quotes `client.` + the method inside a
792810
// `.mjs` gate script reads as a PRODUCTION SDK call site and breaks
793811
// exactly here — the loudest possible wrong conclusion this file can
794812
// reach, so the note travels with it.
795813
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([]);
801815
});
802816

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);
806819
expect(verdictTotal('RESULT_INSENSITIVE')).toBe(10);
807820
// [#21441] 8 -> 9: the date-bucket echo pin's producer call (§2).
808821
// [#21647] 9 -> 11: the bucket echo enumeration's two producer calls (§2).
809822
expect(verdictTotal('NOT_SDK')).toBe(11);
810823
// The three above are LEDGER sums and cannot move on a census reading;
811824
// 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);
814829
});
815830
});
816831

@@ -846,10 +861,16 @@ describe('#13079 §4 — the four end in `unwrapResponse`; `analytics.queryDatas
846861
});
847862

848863
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);
853874
});
854875

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

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,6 @@ 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',
853851
],
854852
heldBy: {
855853
// `scripts/**` is rostered TODAY through the census's own

‎turbo.json‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,7 @@
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",
322-
"$TURBO_ROOT$/ui/packages/data-objectstack/src/index.ts"
321+
"$TURBO_ROOT$/packages/services/service-analytics/src/__tests__/objectql-echo-bucket-enumeration.test.ts"
323322
]
324323
},
325324
"@objectstack/lint#test": {

0 commit comments

Comments
 (0)