@ultimat3/testing 30.8.0 → 31.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +49 -62
- package/README.md +179 -39
- package/package.json +23 -17
- package/src/ai-conformance-answer.ts +67 -0
- package/src/ai-gateway-conformance.ts +105 -0
- package/src/ai-provider-conformance.ts +69 -0
- package/src/ai-provider-transport-conformance.ts +170 -0
- package/src/audit-sink-conformance.ts +204 -0
- package/src/auth-adapter-conformance-credentials.ts +124 -0
- package/src/auth-adapter-conformance-mfa.ts +70 -0
- package/src/auth-adapter-conformance-passkeys.ts +133 -0
- package/src/auth-adapter-conformance-sessions.ts +115 -0
- package/src/auth-adapter-conformance-support.ts +71 -0
- package/src/auth-adapter-conformance-users.ts +128 -0
- package/src/auth-adapter-conformance.ts +34 -0
- package/src/auth-limiter-factory-conformance.ts +224 -0
- package/src/auth-server-store-conformance-records.ts +69 -0
- package/src/auth-server-store-conformance.ts +208 -0
- package/src/cache-tier-conformance-checks.ts +142 -0
- package/src/cache-tier-conformance.ts +24 -0
- package/src/cassette-format.ts +8 -13
- package/src/cassette-record.ts +1 -1
- package/src/cdp-browser.ts +10 -11
- package/src/cdp-e2e-page.ts +2 -2
- package/src/cdp-e2e-session.ts +2 -2
- package/src/cdp-network-probe.ts +1 -1
- package/src/cdp-offline-script.ts +2 -2
- package/src/clock-conformance.ts +126 -0
- package/src/conformance.ts +239 -0
- package/src/e2e-browser-handle.ts +1 -2
- package/src/e2e-error-codes.ts +17 -16
- package/src/e2e-run.ts +4 -3
- package/src/embedder-conformance.ts +101 -0
- package/src/entity-conformance-aggregates.ts +210 -0
- package/src/entity-conformance-batches.ts +216 -0
- package/src/entity-conformance-bulk.ts +379 -0
- package/src/entity-conformance-checks.ts +27 -0
- package/src/entity-conformance-entities.ts +52 -0
- package/src/entity-conformance-locks.ts +286 -0
- package/src/entity-conformance-matrix.ts +397 -0
- package/src/entity-conformance-reads.ts +241 -0
- package/src/entity-conformance-support.ts +56 -0
- package/src/entity-conformance-tenancy.ts +296 -0
- package/src/entity-conformance-values.ts +305 -0
- package/src/entity-conformance-versions.ts +60 -0
- package/src/entity-conformance-writes.ts +348 -0
- package/src/entity-driver-conformance.ts +103 -0
- package/src/error-groups-store-conformance.ts +198 -0
- package/src/error-reporter-conformance.ts +119 -0
- package/src/errors.ts +41 -11
- package/src/event-bus-conformance.ts +161 -0
- package/src/exercise-drift-hint.ts +4 -1
- package/src/exercise-judge.ts +5 -3
- package/src/exercise-override-input.ts +22 -9
- package/src/exercise-override-line.ts +98 -0
- package/src/exercise-report.ts +30 -51
- package/src/exercise-sweeps.ts +3 -1
- package/src/exercise.ts +38 -19
- package/src/factories.ts +192 -179
- package/src/factory-api.ts +131 -0
- package/src/factory-associations.ts +67 -0
- package/src/factory-errors.ts +38 -0
- package/src/factory-lint.ts +92 -0
- package/src/factory-persist.ts +74 -16
- package/src/factory-pipeline.ts +191 -0
- package/src/factory-registry.ts +2 -1
- package/src/factory-types.ts +131 -0
- package/src/failure-store-conformance.ts +137 -0
- package/src/fixture-jobs.ts +50 -15
- package/src/fixture-mail.ts +7 -7
- package/src/fixture-seed.ts +111 -0
- package/src/fixture-statements.ts +68 -52
- package/src/framework-fixtures.ts +1 -1
- package/src/idempotency-store-conformance.ts +186 -0
- package/src/idempotency-store-replay-conformance.ts +140 -0
- package/src/idempotency-store-tx-conformance.ts +132 -0
- package/src/idempotency-store-world-conformance.ts +82 -0
- package/src/identity-provider-conformance.ts +144 -0
- package/src/image-transform-conformance.ts +89 -0
- package/src/index.ts +68 -157
- package/src/isr-store-conformance.ts +113 -0
- package/src/job-sim-effects.ts +19 -31
- package/src/job-sim-world.ts +6 -15
- package/src/lease-store-conformance.ts +195 -0
- package/src/mail-driver-conformance.ts +108 -0
- package/src/matcher-doubles.ts +104 -0
- package/src/matcher-stub.ts +78 -0
- package/src/matcher-surface.ts +21 -0
- package/src/matchers.ts +19 -1
- package/src/mcp-confirmation-store-conformance.ts +262 -0
- package/src/meter-store-conformance.ts +135 -0
- package/src/notify-digest-conformance.ts +133 -0
- package/src/notify-inbox-conformance.ts +130 -0
- package/src/notify-ledger-conformance.ts +134 -0
- package/src/notify-preference-conformance.ts +49 -0
- package/src/notify-stores-conformance.ts +73 -0
- package/src/outbox-store-conformance-claims.ts +112 -0
- package/src/outbox-store-conformance-subject.ts +65 -0
- package/src/outbox-store-conformance.ts +71 -0
- package/src/per-test-reset.ts +55 -20
- package/src/plan-oracle.ts +10 -3
- package/src/plan-sweep.ts +37 -12
- package/src/preload.ts +4 -2
- package/src/purge-conformance.ts +79 -0
- package/src/push-device-conformance.ts +124 -0
- package/src/push-subscription-conformance.ts +123 -0
- package/src/quiet-logs.ts +4 -4
- package/src/rate-limit-store-conformance.ts +178 -0
- package/src/registry-leak-error.ts +8 -1
- package/src/scale-sweep-run.ts +3 -1
- package/src/scrape-driver-conformance-frame-checks.ts +97 -0
- package/src/scrape-driver-conformance-page-checks.ts +114 -0
- package/src/scrape-driver-conformance-site.ts +84 -0
- package/src/scrape-driver-conformance.ts +34 -0
- package/src/sealed-dns-resolver.ts +56 -0
- package/src/sealed-dns.ts +63 -64
- package/src/sealed-network.ts +13 -12
- package/src/sealed-node-sockets.ts +63 -0
- package/src/sealed-sockets.ts +13 -8
- package/src/sealed-udp.ts +118 -0
- package/src/search-index-conformance-list.ts +76 -0
- package/src/search-index-conformance-support.ts +69 -0
- package/src/search-index-conformance-versions.ts +66 -0
- package/src/search-index-conformance.ts +126 -0
- package/src/secret-source-conformance.ts +91 -0
- package/src/seed-factories.ts +57 -0
- package/src/seed-writer.ts +8 -19
- package/src/semantic-cache-factory-conformance.ts +86 -0
- package/src/sms-transport-conformance.ts +102 -0
- package/src/step-store-conformance.ts +171 -0
- package/src/storage-conformance-read-checks.ts +132 -0
- package/src/storage-conformance-shape.ts +121 -0
- package/src/storage-conformance-stream-checks.ts +226 -0
- package/src/storage-conformance.ts +34 -0
- package/src/stub-action.ts +24 -0
- package/src/stub-errors.ts +86 -0
- package/src/stub-job.ts +30 -0
- package/src/stub-query.ts +25 -0
- package/src/stub-script.ts +76 -0
- package/src/stub-stack.ts +29 -0
- package/src/stub.ts +73 -0
- package/src/swap-adapter.ts +135 -0
- package/src/test-scope.ts +96 -0
- package/src/test-types.ts +1 -1
- package/src/totp-replay-guard-conformance.ts +76 -0
- package/src/transport-conformance.ts +179 -0
- package/src/upload-scanner-conformance.ts +112 -0
- package/src/vector-store-conformance-checks.ts +174 -0
- package/src/vector-store-conformance.ts +21 -0
- package/src/cdp-connection.ts +0 -291
- package/src/cdp-errors.ts +0 -179
- package/src/cdp-launch-attempt.ts +0 -224
- package/src/cdp-launch-candidates.ts +0 -62
- package/src/cdp-launch-profile.ts +0 -106
- package/src/cdp-launch-reap.ts +0 -68
- package/src/cdp-launch-wire.ts +0 -171
- package/src/cdp-launch.ts +0 -175
- package/src/cdp-pipe.ts +0 -77
- package/src/cdp-wire-watch.ts +0 -113
package/src/exercise-report.ts
CHANGED
|
@@ -2,15 +2,9 @@
|
|
|
2
2
|
// every allow and mock cleared, the mail fixture, the clock frozen, statements and committed rows
|
|
3
3
|
// observed. Every seam is process-global, so the room hands back exactly what it found.
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
expectedSeqScanReason,
|
|
9
|
-
setStatementObserver,
|
|
10
|
-
statementFingerprint,
|
|
11
|
-
statementObserver,
|
|
12
|
-
} from '@ultimat3/db';
|
|
13
|
-
import type { RowObserver } from '@ultimat3/entity';
|
|
5
|
+
import type { DbStatementEvent } from '@ultimat3/core';
|
|
6
|
+
import { isSelfOrigin, peerAddressClass, subscribe } from '@ultimat3/core';
|
|
7
|
+
import { expectedSeqScanReason, statementFingerprint } from '@ultimat3/db';
|
|
14
8
|
import { captureDeterminism, installDeterminism, restoreCapturedDeterminism } from './determinism';
|
|
15
9
|
import type { ExerciseDefect } from './exercise-defect';
|
|
16
10
|
import { testMail } from './fixture-mail';
|
|
@@ -168,17 +162,6 @@ export interface EffectPayload {
|
|
|
168
162
|
readonly value: unknown;
|
|
169
163
|
}
|
|
170
164
|
|
|
171
|
-
const IDENTIFIER = /^[A-Za-z_$][\w$]*$/;
|
|
172
|
-
|
|
173
|
-
/** `publishPost: { actor, input: (drawn) => ({ ...drawn, postId: '<…>' }) },` — valid TS to paste. */
|
|
174
|
-
export function overrideLine(name: string, idFields: readonly string[]): string {
|
|
175
|
-
const key = IDENTIFIER.test(name) ? name : JSON.stringify(name);
|
|
176
|
-
const bound = idFields
|
|
177
|
-
.map((field) => `, ${IDENTIFIER.test(field) ? field : JSON.stringify(field)}: '<a real id>'`)
|
|
178
|
-
.join('');
|
|
179
|
-
return `${key}: { actor: <an actor its policy permits>, input: (drawn) => ({ ...drawn${bound} }) },`;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
165
|
const hostOf = (url: string): string => (URL.canParse(url) ? new URL(url).host : url);
|
|
183
166
|
|
|
184
167
|
/** `sealed-network.ts`'s own exemption: this machine and a server this process booted. */
|
|
@@ -218,7 +201,6 @@ export interface ExerciseRoom extends AsyncDisposable {
|
|
|
218
201
|
}
|
|
219
202
|
|
|
220
203
|
export async function openExerciseRoom(): Promise<ExerciseRoom> {
|
|
221
|
-
const { setRowObserver } = await import('@ultimat3/entity');
|
|
222
204
|
const clock = captureDeterminism();
|
|
223
205
|
if (!clock.installed) installDeterminism();
|
|
224
206
|
const network = captureNetwork();
|
|
@@ -234,35 +216,32 @@ export async function openExerciseRoom(): Promise<ExerciseRoom> {
|
|
|
234
216
|
const rows: string[] = [];
|
|
235
217
|
const shapes = new Map<string, { count: number; unexpected: number; expected?: string }>();
|
|
236
218
|
const sent = new Map<string, { primitives: Set<string>; scan?: string }>();
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
if (scan !== undefined) one.scan = scan;
|
|
255
|
-
sent.set(text, one);
|
|
256
|
-
},
|
|
257
|
-
};
|
|
258
|
-
setStatementObserver(counting);
|
|
259
|
-
const rowObserver: RowObserver = {
|
|
260
|
-
onChange: (change) => rows.push(`${change.entity}\u0000${change.op}`),
|
|
261
|
-
onBulk: (change) => {
|
|
262
|
-
for (let i = 0; i < change.rows; i += 1) rows.push(`${change.entity}\u0000${change.op}`);
|
|
263
|
-
},
|
|
219
|
+
const counting = (event: DbStatementEvent): void => {
|
|
220
|
+
statements += 1;
|
|
221
|
+
const fingerprint = statementFingerprint(event);
|
|
222
|
+
const shape = shapes.get(fingerprint) ?? { count: 0, unexpected: 0 };
|
|
223
|
+
shape.count += 1;
|
|
224
|
+
if (event.expected === undefined) shape.unexpected += 1;
|
|
225
|
+
else shape.expected = event.expected;
|
|
226
|
+
shapes.set(fingerprint, shape);
|
|
227
|
+
if (subject === undefined) return;
|
|
228
|
+
// Whitespace collapsed, so one builder's two indentations are one statement to plan.
|
|
229
|
+
const text = event.text.replace(/\s+/g, ' ').trim();
|
|
230
|
+
const one = sent.get(text) ?? { primitives: new Set<string>() };
|
|
231
|
+
one.primitives.add(subject);
|
|
232
|
+
// Read here, in the sender's own async context: the scope is the statement's, not the room's.
|
|
233
|
+
const scan = expectedSeqScanReason();
|
|
234
|
+
if (scan !== undefined) one.scan = scan;
|
|
235
|
+
sent.set(text, one);
|
|
264
236
|
};
|
|
265
|
-
|
|
237
|
+
// Subscribers on the bus, beside any outer one — released at dispose, never displacing it.
|
|
238
|
+
const offStatements = subscribe('db.statement', (event) => counting(event.payload));
|
|
239
|
+
const offRows = subscribe('entity', (event) => {
|
|
240
|
+
if (event.name === 'entity.row') rows.push(`${event.payload.entity}\u0000${event.payload.op}`);
|
|
241
|
+
if (event.name !== 'entity.bulk') return;
|
|
242
|
+
const { entity, op } = event.payload;
|
|
243
|
+
for (let i = 0; i < event.payload.rows; i += 1) rows.push(`${entity}\u0000${op}`);
|
|
244
|
+
});
|
|
266
245
|
|
|
267
246
|
return {
|
|
268
247
|
begin: (name) => {
|
|
@@ -327,8 +306,8 @@ export async function openExerciseRoom(): Promise<ExerciseRoom> {
|
|
|
327
306
|
try {
|
|
328
307
|
mail[Symbol.dispose]();
|
|
329
308
|
} finally {
|
|
330
|
-
|
|
331
|
-
|
|
309
|
+
offRows();
|
|
310
|
+
offStatements();
|
|
332
311
|
restoreCapturedNetwork(network);
|
|
333
312
|
if (!sealedBefore) unsealNetwork();
|
|
334
313
|
restoreCapturedDeterminism(clock);
|
package/src/exercise-sweeps.ts
CHANGED
|
@@ -69,7 +69,9 @@ export async function sizedCall(
|
|
|
69
69
|
const lookup = seededIds(graph, options.entities, { ...scope, self });
|
|
70
70
|
const drawn = bindIds(drawInput(sampler, subject.input, 0, 0), lookup);
|
|
71
71
|
const bindInput = overrideInput(subject.name, override);
|
|
72
|
-
|
|
72
|
+
// On the sized call's own queue, installed by the sweep before this setup (`scale-sweep-run.ts`).
|
|
73
|
+
const given =
|
|
74
|
+
bindInput === undefined ? drawn : await bindInput(drawn, actor, { onCallQueue: true });
|
|
73
75
|
return { actor, input: seatIn(subject, given, tenant) };
|
|
74
76
|
}
|
|
75
77
|
|
package/src/exercise.ts
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// what the input sent is never the call's, and a name two kinds share has an entry per kind.
|
|
11
11
|
|
|
12
12
|
import type { Actor, ExerciseAttempt, ExerciseVerdict } from '@ultimat3/core';
|
|
13
|
-
import { runExercise } from '@ultimat3/core';
|
|
14
|
-
import { registeredJobs } from '@ultimat3/jobs';
|
|
13
|
+
import { runExercise, subscribe } from '@ultimat3/core';
|
|
14
|
+
import { LIVE_STATES, registeredJobs } from '@ultimat3/jobs';
|
|
15
15
|
import type { ExerciseOverride, ExerciseOverrides } from './define-exercise';
|
|
16
16
|
import { assertOverridesKnown, overrideFor, unknownDeclaration } from './define-exercise';
|
|
17
17
|
import type { RoleGrants } from './exercise-actor';
|
|
@@ -26,6 +26,7 @@ import { judged, labelFor } from './exercise-judge';
|
|
|
26
26
|
import { mergeObserved } from './exercise-observed';
|
|
27
27
|
import type { OverrideInput } from './exercise-override-input';
|
|
28
28
|
import { inputThrew, overrideInput } from './exercise-override-input';
|
|
29
|
+
import { actorHintOf, type OverrideHint, seededIn } from './exercise-override-line';
|
|
29
30
|
import type {
|
|
30
31
|
EffectPayload,
|
|
31
32
|
ExerciseEffect,
|
|
@@ -39,7 +40,6 @@ import { withExerciseSetup } from './exercise-setup';
|
|
|
39
40
|
import type { Subject } from './exercise-subjects';
|
|
40
41
|
import { fixedTenant, seatIn, subjectsOf } from './exercise-subjects';
|
|
41
42
|
import { actorRowsOf, attachSweeps, seated, sizedCall } from './exercise-sweeps';
|
|
42
|
-
import type { RunJobs } from './fixture-jobs';
|
|
43
43
|
import { testJobs } from './fixture-jobs';
|
|
44
44
|
import { deferredMayStayNull, pairGraph, seedPass, tenantPair } from './seed-graph-pass';
|
|
45
45
|
import type { SeedGraph, SeedWriter } from './seed-graph-plan';
|
|
@@ -70,18 +70,27 @@ const isOff = (overrides: ExerciseOverrides | undefined, subject: Subject): bool
|
|
|
70
70
|
return override !== undefined && 'off' in override;
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
+
/** The ids of every row the call's queue holds now: what an attempt adds is the call's. */
|
|
74
|
+
const queuedIds = async (): Promise<ReadonlySet<string>> =>
|
|
75
|
+
new Set((await ambientJobRows()).map((record) => record.id));
|
|
76
|
+
|
|
73
77
|
/**
|
|
74
|
-
* Jobs the primitive queued
|
|
75
|
-
* an action's are (`exercise-job-run.ts`)
|
|
78
|
+
* Jobs the primitive queued — rows an ATTEMPT added (`mine`), still live — its own job excepted.
|
|
79
|
+
* Never run: a job's children are left queued as an action's are (`exercise-job-run.ts`). A row
|
|
80
|
+
* the override's input added between calls is on the same queue, so the call can find it, and is
|
|
81
|
+
* not in `mine`: the input's enqueue is never the primitive's.
|
|
76
82
|
*/
|
|
77
|
-
async function enqueued(subject: Subject,
|
|
78
|
-
const
|
|
79
|
-
for (const
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
async function enqueued(subject: Subject, mine: ReadonlySet<string>) {
|
|
84
|
+
const counts = new Map<string, number>();
|
|
85
|
+
for (const record of await ambientJobRows()) {
|
|
86
|
+
if (!mine.has(record.id) || !LIVE_STATES.has(record.state)) continue;
|
|
87
|
+
if (subject.kind === 'job' && record.name === subject.name) continue;
|
|
88
|
+
counts.set(record.name, (counts.get(record.name) ?? 0) + 1);
|
|
83
89
|
}
|
|
84
|
-
|
|
90
|
+
const order = registeredJobs().map((handle) => handle.name);
|
|
91
|
+
return [...counts]
|
|
92
|
+
.sort(([a], [b]) => order.indexOf(a) - order.indexOf(b))
|
|
93
|
+
.map(([job, count]): ExerciseEffect => ({ kind: 'enqueue', job, count }));
|
|
85
94
|
}
|
|
86
95
|
|
|
87
96
|
/**
|
|
@@ -109,6 +118,8 @@ interface Prepared {
|
|
|
109
118
|
readonly declaredRuns: number | undefined;
|
|
110
119
|
readonly lookups: readonly [IdLookup, IdLookup];
|
|
111
120
|
readonly bindInput: OverrideInput | undefined;
|
|
121
|
+
/** The actor the pass picked, as the paste line spells it (`exercise-override-line.ts`). */
|
|
122
|
+
readonly actorHint: OverrideHint['actor'];
|
|
112
123
|
}
|
|
113
124
|
|
|
114
125
|
/** Thrown out of 39's loop by a bind that failed: the record is the entry's, never the loop's. */
|
|
@@ -134,6 +145,7 @@ async function control(
|
|
|
134
145
|
let lastInput: unknown;
|
|
135
146
|
let output: unknown;
|
|
136
147
|
const segments: Observed[] = [];
|
|
148
|
+
const mine = new Set<string>();
|
|
137
149
|
const started = performance.now();
|
|
138
150
|
let verdict: ExerciseVerdict;
|
|
139
151
|
try {
|
|
@@ -146,7 +158,9 @@ async function control(
|
|
|
146
158
|
bind: async (drawn) => {
|
|
147
159
|
const bound = bindIds(drawn, lookups[binds++ === 0 ? 0 : 1]);
|
|
148
160
|
try {
|
|
149
|
-
|
|
161
|
+
// On the call's own queue: a job the input enqueues is there when the call looks it up.
|
|
162
|
+
const given =
|
|
163
|
+
bindInput === undefined ? bound : await bindInput(bound, actor, { onCallQueue: true });
|
|
150
164
|
lastInput = seatIn(subject, given, tenant);
|
|
151
165
|
} catch (error) {
|
|
152
166
|
throw new BindThrew(error);
|
|
@@ -156,6 +170,7 @@ async function control(
|
|
|
156
170
|
accepts: async (input) =>
|
|
157
171
|
(await subject.input['~standard'].validate(input)).issues === undefined,
|
|
158
172
|
attempt: async (input): Promise<ExerciseAttempt> => {
|
|
173
|
+
const before = await queuedIds();
|
|
159
174
|
room.begin(key);
|
|
160
175
|
try {
|
|
161
176
|
const answer = await subject.call(input, actor, tenant, jobs);
|
|
@@ -171,6 +186,7 @@ async function control(
|
|
|
171
186
|
return { ok: false, reached: false, error };
|
|
172
187
|
} finally {
|
|
173
188
|
segments.push(room.end());
|
|
189
|
+
for (const id of await queuedIds()) if (!before.has(id)) mine.add(id);
|
|
174
190
|
}
|
|
175
191
|
},
|
|
176
192
|
statusOf: (await import('@ultimat3/http')).statusFor,
|
|
@@ -190,8 +206,9 @@ async function control(
|
|
|
190
206
|
}
|
|
191
207
|
const ms = Math.round(performance.now() - started);
|
|
192
208
|
const observed = mergeObserved(segments);
|
|
193
|
-
const effects = [...observed.effects, ...(await enqueued(subject,
|
|
194
|
-
const
|
|
209
|
+
const effects = [...observed.effects, ...(await enqueued(subject, mine))];
|
|
210
|
+
const hint = { actor: run.actorHint, ids: seededIn(lastInput, lookups) };
|
|
211
|
+
const outcome = { verdict, answered, lastError, lastInput, hint };
|
|
195
212
|
const verdictOf = judged(subject, key, outcome, observed, sampler);
|
|
196
213
|
// A 5xx's cause, statement and fields: the code alone sent the author to reproduce it by hand.
|
|
197
214
|
const defect =
|
|
@@ -226,10 +243,11 @@ async function attack(
|
|
|
226
243
|
// which proves nothing), so the attack that matters is a job of B's carrying A's ids.
|
|
227
244
|
const sent = seatIn(subject, input, tenant);
|
|
228
245
|
// Every `crossTenant()` B's call opened: a job's declared sweep is told from a leak by it alone.
|
|
229
|
-
//
|
|
230
|
-
const { setCrossTenantObserver } = await import('@ultimat3/entity');
|
|
246
|
+
// On the bus, so the barrel stays entity-free (`seed-writer.ts`'s rule) with no import at all.
|
|
231
247
|
const crossings: string[] = [];
|
|
232
|
-
|
|
248
|
+
const offCrossings = subscribe('entity.cross_tenant', (event) => {
|
|
249
|
+
crossings.push(event.payload.reason);
|
|
250
|
+
});
|
|
233
251
|
try {
|
|
234
252
|
const answer = await subject.call(sent, actor, tenant, jobs);
|
|
235
253
|
output = answer.output;
|
|
@@ -237,7 +255,7 @@ async function attack(
|
|
|
237
255
|
// B's refusal is the answer a scoped primitive gives: only what B got back, and what B's call
|
|
238
256
|
// did to A's rows, is judged — never whether B was refused.
|
|
239
257
|
} finally {
|
|
240
|
-
|
|
258
|
+
offCrossings();
|
|
241
259
|
}
|
|
242
260
|
const observed = room.end();
|
|
243
261
|
const payloads = [...observed.payloads, ...(await queuedPayloads(subject))];
|
|
@@ -295,6 +313,7 @@ async function exerciseOne(
|
|
|
295
313
|
declaredRuns,
|
|
296
314
|
lookups,
|
|
297
315
|
bindInput,
|
|
316
|
+
actorHint: actorHintOf(chosen, override),
|
|
298
317
|
};
|
|
299
318
|
// A's own first input, A's ids in it: B sends exactly what A legitimately would.
|
|
300
319
|
const drawn = bindIds(drawInput(sampler, subject.input, 0, 0), lookups[0]);
|