Skip to content

Commit 35d40a9

Browse files
committed
test(lint): re-judge the door roster pins and the foreign-dataset fixtures
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufziFPBpGc76tAFHbB8v
1 parent 0dca581 commit 35d40a9

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

‎packages/lint/src/runtime-gate.object-writes.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,16 @@ describe('the object write door dispatches at the adjudicated scope (#4716)', ()
260260
// Each was measured over the shipped object corpus before crossing (116
261261
// objects, 0 findings, precision 1.0); the comments on the members carry
262262
// the populations, and the four controls below are the non-vacuity half.
263+
// [#26847] `validateChartBindings` is the fourth, for an object's built-in
264+
// `listViews` charts: resolved against `stack.datasets`, a collection every
265+
// per-write snapshot carries. Measured over the shipped object corpus (no
266+
// object list view charts, 0 findings); its door pins live in
267+
// `validate-chart-bindings.test.ts`.
263268
expect(crossed).toEqual([
264269
'validateSearchableFields',
265270
'validateListViewFieldRefs',
266271
'validateObjectFieldRefs',
272+
'validateChartBindings',
267273
]);
268274
// `validateSortableFields` measured equally clean but was NOT crossed:
269275
// that is its own adjudication, and this pin is where it has to be made.

‎packages/lint/src/runtime-gate.view-writes.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,19 @@ describe('a flattened list overlay at the runtime publish gate (#9313)', () => {
244244
// #9313 failure inverted: the standalone list view a Studio tenant or an
245245
// MCP/AI author writes goes through `PUT /api/v1/meta/view` and no CLI, so
246246
// a build-time-only rule never reaches the author who made the typo.
247+
// [#26847] The fifth crossing, a different collection on purpose: a list
248+
// view's chart binding (`dataset` / `dimensions` / `values`), resolved
249+
// against `stack.datasets`, which every per-write snapshot also carries.
250+
// The rule's list-view walk opens the flattened overlay and the ViewItem
251+
// `config` for it; its report and page surfaces find nothing on a view
252+
// snapshot. Measured over the shipped view corpus before crossing (two
253+
// chart list views, 0 findings); the door pins live in
254+
// `validate-chart-bindings.test.ts`.
247255
expect(crossed).toEqual([
248256
'validateSearchableFields',
249257
'validateSortableFields',
250258
'validateListViewFieldRefs',
259+
'validateChartBindings',
251260
]);
252261
// And every member still judges flow snapshots — the #4463 P1 surface is
253262
// not narrowed by the member axis existing.

‎packages/lint/src/validate-list-view-field-refs.test.ts‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,18 @@ describe('[#26719] a list-view chart bound to a dataset over another object', ()
14181418
}
14191419

14201420
describe('at the runtime save door', () => {
1421+
// [#26847] The door also resolves the chart's `dimensions` / `values`
1422+
// against the bound dataset (`validateChartBindings`), so each probe
1423+
// selects names its dataset declares: the foreign object is the only
1424+
// thing wrong with it.
1425+
const OWN_SELECTION: Record<string, AnyRec> = {
1426+
duly_task_metrics: { dimensions: ['status'], values: ['task_count'] },
1427+
duly_person_metrics: { dimensions: ['name'], values: ['person_count'] },
1428+
};
1429+
const doorChart = (dataset: string, extra: AnyRec = {}): AnyRec => {
1430+
const view = chartOn(dataset, extra);
1431+
return { ...view, chart: { ...(view.chart as AnyRec), ...OWN_SELECTION[dataset] } };
1432+
};
14211433
const SCOPE = { packageId: 'com.qa.gap', dependencies: [] as string[] };
14221434
const owned = (o: AnyRec, pkg: string) => ({ ...o, _packageId: pkg });
14231435
const objects = [owned(OBJECTS[0], 'com.qa.gap'), owned(OBJECTS[1], 'com.other.app')];
@@ -1427,7 +1439,7 @@ describe('[#26719] a list-view chart bound to a dataset over another object', ()
14271439
object: 'duly_task',
14281440
viewKind: 'list',
14291441
label: 'By status',
1430-
config: chartOn(dataset),
1442+
config: doorChart(dataset),
14311443
});
14321444
const write = (dataset: string) =>
14331445
runRuntimeAuthoringRules({ type: 'view', item: item(dataset), context: { objects, datasets }, packageScope: SCOPE });
@@ -1458,7 +1470,7 @@ describe('[#26719] a list-view chart bound to a dataset over another object', ()
14581470
const writeObject = (dataset: string) =>
14591471
runRuntimeAuthoringRules({
14601472
type: 'object',
1461-
item: { ...doorTask, listViews: { by_status: chartOn(dataset, { data: undefined }) } },
1473+
item: { ...doorTask, listViews: { by_status: doorChart(dataset, { data: undefined }) } },
14621474
context: { objects: [doorTask, objects[1]], datasets },
14631475
packageScope: SCOPE,
14641476
});

0 commit comments

Comments
 (0)