rig-review 2.4.2 → 2.4.3
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/docs/REVIEW_PACKAGE.md +9 -7
- package/package.json +1 -1
- package/src/direction-inspection.ts +7 -2
- package/src/job-session.ts +11 -3
- package/src/job-store.ts +7 -4
package/docs/REVIEW_PACKAGE.md
CHANGED
|
@@ -1001,13 +1001,15 @@ the compiled sliders available through the Turn Pad and the attachment sets
|
|
|
1001
1001
|
loaded through Play. Independent depth control is unavailable on this surface.
|
|
1002
1002
|
|
|
1003
1003
|
A manifest may declare `direction` as the literal package-relative path to a
|
|
1004
|
-
retained Create `rig-create/direction@1`
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1004
|
+
retained Create `rig-create/direction@1` or `rig-create/direction@2` document
|
|
1005
|
+
(up to 256 KiB). A `direction@2` scene reference is accepted but not inspected.
|
|
1006
|
+
Preserve the document's model path relative to the Review package root. Review
|
|
1007
|
+
requires that path and SHA-256 to match the inspected compiled model and
|
|
1008
|
+
includes the direction file in the package source hash. The panel shows authored
|
|
1009
|
+
camera keys and timing read-only while that inspected model is on stage. Create
|
|
1010
|
+
remains responsible for validating project history and citations. Viewport pan
|
|
1011
|
+
and zoom affect only inspection. Authored camera playback and camera Apply are
|
|
1012
|
+
unavailable.
|
|
1011
1013
|
|
|
1012
1014
|
The optional `sets` manifest path names a package-local Play attachment-set
|
|
1013
1015
|
sidecar for the inspected single-package build. Review includes it in the
|
package/package.json
CHANGED
|
@@ -18,10 +18,15 @@ export interface DirectionInspection {
|
|
|
18
18
|
timing: { time: number; source_time: number; easing: string }[];
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Read the inspection subset of Create's rig-create/direction@1 or rig-create/direction@2.
|
|
23
|
+
* A direction@2 scene reference is accepted but not inspected.
|
|
24
|
+
* Create validates scene, project history and citations.
|
|
25
|
+
*/
|
|
22
26
|
export function readDirectionInspection(value: unknown, file: Binding, model: Binding | null): DirectionInspection {
|
|
23
27
|
const doc = object(value, 'direction');
|
|
24
|
-
if (doc.schema !== 'rig-create/direction@1'
|
|
28
|
+
if (doc.schema !== 'rig-create/direction@1' && doc.schema !== 'rig-create/direction@2')
|
|
29
|
+
throw new Error('DIRECTION_SCHEMA: expected rig-create/direction@1 or rig-create/direction@2');
|
|
25
30
|
const rig = object(doc.rig, 'direction.rig');
|
|
26
31
|
const binding = object(rig.model, 'direction.rig.model');
|
|
27
32
|
const path = packagePath(binding.path, 'direction.rig.model.path');
|
package/src/job-session.ts
CHANGED
|
@@ -344,8 +344,6 @@ export class JobSession {
|
|
|
344
344
|
current = this.current();
|
|
345
345
|
let result: unknown;
|
|
346
346
|
this.store.update(this.jobId, current.revision, fresh => {
|
|
347
|
-
const raced = this.replay(fresh.data, key, digest);
|
|
348
|
-
if (raced) { result = raced.value; return { data: fresh.data }; }
|
|
349
347
|
this.active(fresh, input.expectedGeneration);
|
|
350
348
|
const data = fresh.data;
|
|
351
349
|
let snapshot: JobSnapshotOwner | undefined;
|
|
@@ -382,6 +380,11 @@ export class JobSession {
|
|
|
382
380
|
}
|
|
383
381
|
data.replays[key] = { digest, value: result };
|
|
384
382
|
return { data, ...(snapshot ? {snapshot} : {}) };
|
|
383
|
+
}, fresh => {
|
|
384
|
+
const raced = this.replay(fresh.data, key, digest);
|
|
385
|
+
if (!raced) return false;
|
|
386
|
+
result = raced.value;
|
|
387
|
+
return true;
|
|
385
388
|
});
|
|
386
389
|
this.notify();
|
|
387
390
|
return result;
|
|
@@ -416,7 +419,7 @@ export class JobSession {
|
|
|
416
419
|
const previous = this.replay(current.data, key, digest);
|
|
417
420
|
if (previous) return previous.value as JobAct;
|
|
418
421
|
let act: JobAct;
|
|
419
|
-
this.store.update(this.jobId,
|
|
422
|
+
this.store.update(this.jobId, null, fresh => {
|
|
420
423
|
// UI captures an observed generation. Unrelated asks may advance it while
|
|
421
424
|
// this same ask/source/publication/nonce stays valid. Agent mutation CAS
|
|
422
425
|
// remains global. Future UI generations cannot describe a displayed state.
|
|
@@ -438,6 +441,11 @@ export class JobSession {
|
|
|
438
441
|
fresh.data.replays[key] = { digest, value: act };
|
|
439
442
|
this.event(fresh.data, { type: 'act', act } as Omit<JobEvent, 'cursor' | 'jobId' | 'generation'>);
|
|
440
443
|
return { data: fresh.data };
|
|
444
|
+
}, fresh => {
|
|
445
|
+
const raced = this.replay(fresh.data, key, digest);
|
|
446
|
+
if (!raced) return false;
|
|
447
|
+
act = raced.value as JobAct;
|
|
448
|
+
return true;
|
|
441
449
|
});
|
|
442
450
|
this.notify();
|
|
443
451
|
return act!;
|
package/src/job-store.ts
CHANGED
|
@@ -199,16 +199,19 @@ export class JobStore<Data> {
|
|
|
199
199
|
|
|
200
200
|
/** Re-read under the write transaction. A callback failure rolls everything
|
|
201
201
|
* back. A successful callback publishes its complete data and replay receipt
|
|
202
|
-
* together.
|
|
202
|
+
* together. A durable replay returns before CAS without rewriting the row.
|
|
203
|
+
* A null revision delegates freshness to the UI's in-transaction predicates.
|
|
204
|
+
* Closing releases the active-root slot in the same commit.
|
|
203
205
|
*/
|
|
204
|
-
update(jobId: string, expectedRevision: number, operation: (current: StoredJob<Data>) => {
|
|
206
|
+
update(jobId: string, expectedRevision: number | null, operation: (current: StoredJob<Data>) => {
|
|
205
207
|
readonly data: Data;
|
|
206
208
|
readonly active?: boolean;
|
|
207
209
|
readonly snapshot?: JobSnapshotOwner;
|
|
208
|
-
}): StoredJob<Data> {
|
|
210
|
+
}, replay?: (current: StoredJob<Data>) => boolean): StoredJob<Data> {
|
|
209
211
|
return this.transaction(() => {
|
|
210
212
|
const current = this.get(jobId);
|
|
211
|
-
if (current
|
|
213
|
+
if (replay?.(current)) return current;
|
|
214
|
+
if (expectedRevision !== null && current.revision !== expectedRevision) throw new JobError('JOB_GENERATION_STALE');
|
|
212
215
|
const next = operation(current);
|
|
213
216
|
const active = next.active ?? current.active;
|
|
214
217
|
const document = encode(next.data);
|