rig-review 2.8.0 → 2.9.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.
@@ -22,7 +22,7 @@ is written), `--painting <png>` (the original painting), `--by <name>` (launch-o
22
22
 
23
23
  ## What it shows
24
24
 
25
- - **Every part on its own**, on a sentinel background (green, magenta, black, white or checker), at native scale with
25
+ - **Every part on its own**, on a checker background by default (green, magenta, black and white are also available), at native scale with
26
26
  Fit and exact **1:1**, cursor-anchored wheel zoom, pinch and drag pan in the shared rig/reference viewport pair. Sampling stays nearest-neighbour. **Alpha only** shows the alpha channel as grey (white is opaque).
27
27
  - **Footprints of parts in front** (parts mode): the alpha of every part later in `parts.json` whose box meets the
28
28
  selected part's box, placed by its rig box and tinted cyan at 50 %. Where the selected part has no pixel under its
@@ -97,11 +97,18 @@ The occlusion-coverage report (rig-c/parts#998) is not read yet; the footprint t
97
97
  Standalone sign-off uses saved files. The active Create and Parts cycle uses finalized acts through the
98
98
  [standing live job workflow](WORKFLOWS.md#standing-live-job-workflow).
99
99
 
100
- **Approve all** marks every pending part and available mesh clean, then saves an explicit approved sign-off. It preserves notes and existing clean outcomes; any flagged part or mesh refuses with `PARTS_APPROVE_ALL_FLAGGED` before changes are made. Individual approval remains available. `tests/parts-approve-all.test.ts` exercises the page action and unchanged verdict guard; `tests/parts-approve-all-browser.ts` checks the real save and refusal flows.
100
+ The shared workspace keeps pointed issues in the persistent **Issues** sidebar, including an empty state.
101
+ **Save sign-off** saves the current issue collection. An empty collection approves the inspection, and a
102
+ non-empty collection requests changes. The live job host submits the same issue collection through its
103
+ review dialog. Reviewer wording stays verbatim.
101
104
 
102
- Each item is **pending**, **clean** or **flagged** with a note (a note is optional on clean). **Save sign-off**
103
- writes `parts-review.json` beside `parts.json` (atlas mode: beside the model), or to `--verdict`.
104
- An unnamed save has the following `/2` shape.
105
+ Historically, **Approve all** marked every pending part and available mesh clean and saved an approved
106
+ sign-off. It preserved notes and existing clean outcomes, and refused flagged items with
107
+ `PARTS_APPROVE_ALL_FLAGGED`. Per-part approval and mesh outcomes belong to that historical UI and
108
+ `/1`–`/3` read compatibility. The existing `tests/parts-approve-all.test.ts` and
109
+ `tests/parts-approve-all-browser.ts` now exercise the shared mount and current issue-based save flows.
110
+
111
+ New saves write `schema: "rig-review-parts-verdict/4"` (`status: "approved"` when `issues` is empty, `"changes-requested"` when `issues` is non-empty, `issues: PartsIssue[]`, `updatedAt`, and optional `by`) to `parts-review.json` beside `parts.json` (atlas mode: beside the model), or to `--verdict`. In historical `/1`..`/3` saves, each item was **pending**, **clean** or **flagged** with a note (a note is optional on clean), and an unnamed historical `/2` save had the following shape (preserved on read):
105
112
 
106
113
  ```json
107
114
  {
@@ -126,12 +133,12 @@ An unnamed save has the following `/2` shape.
126
133
  - `source.sha256` is the SHA-256 of the UTF-8 lines `<path>\t<sha256>\n`, one per `source.files` entry, sorted by path
127
134
  bytewise. Review revalidates inspected inputs when reading a saved verdict.
128
135
  - `source.flags` lists the producer files the flags were read from; `parts.<name>.flags` the historical producer-attribution IDs defined above, not the classified sidebar count.
129
- - `status`: `approved` only when every part is clean; `changes-requested` only with at least one part flagged;
130
- otherwise `pending`.
136
+ - Historical `/2` `status` is `approved` when every part is clean, `changes-requested` with at least one
137
+ flagged part, and otherwise `pending`.
131
138
 
132
- Refusals, by name: `PARTS_VERDICT_MISSING_PART`, `PARTS_VERDICT_UNKNOWN_PART`, `PARTS_VERDICT_NOTE_REQUIRED`,
133
- `PARTS_VERDICT_NOT_CLEAN`, `PARTS_VERDICT_NOTHING_FLAGGED`, `PARTS_VERDICT_INVALID`, and `PARTS_VIEW_SOURCE_CHANGED`
134
- when a file changed after the view opened.
139
+ Historical per-part validation refusals include `PARTS_VERDICT_MISSING_PART`, `PARTS_VERDICT_UNKNOWN_PART`, `PARTS_VERDICT_NOTE_REQUIRED`,
140
+ `PARTS_VERDICT_NOT_CLEAN` and `PARTS_VERDICT_NOTHING_FLAGGED`. Current saves retain `PARTS_VERDICT_INVALID`
141
+ for invalid verdicts and `PARTS_VIEW_SOURCE_CHANGED` when an inspected file changes after opening.
135
142
 
136
143
  A verdict destination matching a protected part, producer report, rig/package input, model or atlas image is
137
144
  refused as `PARTS_VERDICT_INPUT_COLLISION`, including normalized paths, symbolic links and filesystem aliases.
@@ -170,17 +177,16 @@ no attribution authority. Opening and reading preserve the saved bytes.
170
177
  | --- | --- |
171
178
  | Legacy `rig-review-parts-verdict/1` or `/2` | `by: null`, including an ignored historical `by` extension |
172
179
  | Named `rig-review-parts-verdict/3` | Required nonblank `by`, preserved verbatim |
173
- | Explicit resave from an unnamed launch | New ordinary `/2` save with `by: null` on read, clearing the earlier name |
180
+ | Pointed-issue `rig-review-parts-verdict/4` | `issues: PartsIssue[]` (`rig-review-parts-comment/2`), optional nonblank `by` (`null` on CLI read when omitted) |
181
+ | Explicit resave from an unnamed launch | New `/4` save (historical `/2` before `/4`) with `by: null` on read, clearing the earlier name |
174
182
 
175
- Named `/3` keeps the existing verdict fields and adds required `by`. A missing, null, non-string or
176
- whitespace-only `/3` name refuses `PARTS_VERDICT_INVALID`. Older executables accepting only `/1` and `/2`
183
+ Named `/3` keeps the existing historical verdict fields and adds required `by`. Pointed-issue `/4` replaces the per-part outcome map with `issues` (`rig-review-parts-comment/2`) and optional `by`; historical `/1`, `/2` and `/3` saves that are `pending` or contain bare flagged part or mesh notes without a matching comment surface in the UI as read-only legacy verdicts (`PARTS_VERDICT_LEGACY_FORMAT`, `flaggedCount`) and preserve their historical `/1`..`/3` schema and `parts` map on `parts <input> --format json`. A missing, null, non-string or
184
+ whitespace-only `/3` (or present `/4`) name refuses `PARTS_VERDICT_INVALID`. Older executables accepting only `/1` and `/2`
177
185
  reject named `/3` with that refusal. This opt-in saved-format compatibility cost is part of the contract.
178
186
 
179
- Ordinary `parts <input> --format json` returns normalized `schema: "rig-review-parts-verdict/2"` with
180
- every existing field, including `mode`, `tool`, `source`, `status`, all per-part outcomes, notes and flags,
181
- available mesh outcomes and notes, `comments` and `updatedAt`. It adds root `by: string | null` and
187
+ Ordinary `parts <input> --format json` returns `schema: "rig-review-parts-verdict/4"` (`mode`, `tool`, `source`, `status`, `issues` with resolved `crop.path` and `nativeCrop.path`, and `updatedAt`) for `/4` saves and for historical `/1`..`/3` saves whose flags are all covered by pointed comments (or that are approved with no issues, where `/1` normalizes to `issues: []`), while historical `/1`..`/3` saves that are `pending` or carry bare flagged part or mesh notes retain their historical `schema` (`"rig-review-parts-verdict/1"`, `"/2"`, or `"/3"`), per-part outcomes, notes and flags, available mesh outcomes and notes, optional `comments`, `issues` and `updatedAt`. Every CLI JSON read adds root `by: string | null` and
182
188
  `savedFileSha256`, a 64-character lowercase hexadecimal SHA-256 of the exact saved bytes, including any
183
- final LF. Legacy reads retain their original byte digest and `/1` normalizes to empty comments.
189
+ final LF, retaining the original byte digest on legacy reads.
184
190
 
185
191
  The core, recorded name and digest derive from one validated saved-file snapshot, with current source
186
192
  and producer-flag checks. `source.sha256`, `source.files` and `source.flags` retain the inspected-input
@@ -230,13 +236,21 @@ Crash-proof exactly-once delivery requires an additional acknowledgment/replay p
230
236
  ## Mesh geometry
231
237
 
232
238
  In parts mode, a `rig.json` beside `parts.json` supplies optional mesh geometry;
233
- `--rig <file>` selects an explicit input instead. The per-part **mesh from
234
- rig.json UVs** toggle starts off. It draws edges and vertices over the sentinel
235
- background, and tints nontransparent art pixels pink when their centres lie
236
- outside every nondegenerate triangle (triangle boundaries count as covered).
237
- The mesh outcome has its own Pending / Clean / Flagged states and note; Flagged
238
- requires a note. Approval requires both part and mesh outcomes to be Clean.
239
- A part without a mesh has no mesh controls or outcome.
239
+ `--rig <file>` selects an explicit input instead. The workspace-wide **mesh from
240
+ rig.json UVs** toggle starts off and retains its setting across part selection, assembled view,
241
+ Overlay and Difference in both standalone and live job hosts. It draws edges and vertices for
242
+ visible mesh-bearing parts. The selected part also tints nontransparent art pixels pink when their
243
+ centres lie outside every nondegenerate triangle (triangle boundaries count as covered).
244
+ Other assembled meshes use reduced-opacity wire lines. The selected part's geometry panel names
245
+ unavailable geometry explicitly. A draft with no mesh geometry retains a **Mesh (none 0/n)** control
246
+ and an unavailable message. A mesh attachment that declares a plain-object `generator` without inline
247
+ `uvs` or `triangles` is accepted without reconstructing geometry. Its part raster renders normally
248
+ without a mesh overlay, the item reports `meshUnavailable: "PARTS_MESH_GENERATED"`, and the **Mesh
249
+ geometry** panel states `PARTS_MESH_GENERATED: No mesh geometry is available for this part.` Non-object
250
+ `generator` values or attachments combining `generator` with `uvs` or `triangles` still refuse by name.
251
+
252
+ Historical per-part mesh outcomes had Pending / Clean / Flagged states and a note. Flagged required a
253
+ note, and approval required clean part and mesh outcomes. These fields remain legacy read data.
240
254
 
241
255
  Image-space positions are `(u × width, v × height)` from each attachment's own
242
256
  UVs and dimensions, never reconstructed through bones or weights. The mesh's raster
@@ -257,8 +271,8 @@ not an exact recovery of the producer's original unrounded positions.
257
271
  Mode, vertex count, triangle count, `art_coverage` and `stray_cleared` are copied
258
272
  from the part's `mesh_report.json` row without recomputing them. Absent fields
259
273
  say **not reported**; faint islands remain in Producer flags. A report count may
260
- differ from the loaded geometry; it is the producer's reading. The verdict's
261
- `parts[name].mesh` contains `{outcome,note}` only for a mesh-bearing part.
274
+ differ from the loaded geometry. These are producer readings. Historical verdicts stored
275
+ `parts[name].mesh` as `{outcome,note}` only for a mesh-bearing part.
262
276
  `rig.json` and the loaded mesh report enter `source.files`, and the mesh report
263
277
  also remains in `source.flags`. Changes invalidate the saved sign-off. No rig
264
278
  means the existing parts view and verdict format remain unchanged.
@@ -289,27 +303,35 @@ The four-stage navigator preserves this entry and its explicit save behavior. Co
289
303
  ## Pointed parts comments
290
304
 
291
305
  **Comment · C (n)** uses the same capture toggle, dragged region, composer and pins as the rig stage.
292
- While capture is on, drag draws only a region; close the toggle to pan. Enter adds the comment;
293
- **Save sign-off** persists the verdict. Select a comment row or pin after reopening to restore its
294
- part, both cameras, background, alpha, footprints, mesh and painting comparison view. There is no frame, animation or slot
295
- placeholder in a parts comment. Atlas inspection remains read only for pointed comments.
296
-
297
- `rig-review-parts-verdict/2` adds `comments[]`; a `/1` file reads with an empty comment array.
298
- Each closed `rig-review-parts-comment/1` carries `id`, original reviewer `summary`, `part`,
299
- `imageHash` (SHA-256 of the original part PNG), `sourceHash` (the verdict source identity),
300
- `imageRegion`, `rigRegion`, `view`, `crop` and `nativeCrop`. `imageRegion` has integer native
301
- pixel edges snapped outward from the drag. `rigRegion` is exact placement plus that region,
306
+ The **Issues** list stays visible in the side panel while C opens or closes capture. While capture is
307
+ on, drag within the rig pane away from existing pins and controls to mark a region. Close capture to
308
+ pan. Enter adds the issue,
309
+ and **Save sign-off** persists the verdict. Escape cancels the composer or capture while the inline
310
+ list stays visible. Rows and pins use the same edit, delete and jump actions.
311
+
312
+ Select an issue row or pin after reopening to restore its item or assembled view, both cameras,
313
+ background, alpha, footprints, mesh and painting comparison. Atlas inspection remains read only for
314
+ pointed comments. Joined compiled Stage 1 refuses issue authoring with
315
+ `PARTS_JOINED_ISSUE_UNSUPPORTED` and directs the reviewer to the standing live job route. Its
316
+ zero-issue approval path remains available.
317
+
318
+ `rig-review-parts-verdict/4` stores `issues[]` of closed `rig-review-parts-comment/2` records (historical `rig-review-parts-verdict/2` and `/3` stored `comments[]` of `rig-review-parts-comment/1`; a historical `/1` verdict file reads with an empty array).
319
+ Each historical closed `rig-review-parts-comment/1` carries `id`, original reviewer `summary`, `part`,
320
+ `imageHash` (SHA-256 of the original part PNG), `sourceHash` (the verdict source identity, or the server-retained publication `sourceHash` when prepared in a live job),
321
+ `imageRegion`, `rigRegion`, `view`, `crop` and `nativeCrop`; `rig-review-parts-comment/2` generalizes `part` + `imageHash` to a non-empty unique `parts: [{name, imageHash}]` array and supports `view.mode: "item"` (requiring integer `imageRegion`, exact `rigRegion = placement(parts[0]) + imageRegion`, and server-cut `nativeCrop`) and `view.mode: "assembled"` (`imageRegion: null`, `nativeCrop: null`, and integer `rigRegion` fully contained within the union bounding box of `parts`). `imageRegion` has integer native
322
+ pixel edges snapped outward from the drag. In item mode, `rigRegion` is exact placement plus that region,
302
323
  including fractional placement; it is never rounded. `view.camera` records native scale,
303
324
  center and viewport extent, plus `cameraSync` and the actual `referenceCamera` (or null), alongside `background`, `alpha`, `footprints` and `mesh`. New comments add optional
304
325
  `view.comparison: {mode:"part"|"overlay", opacity:0..1}`; older comments omit it and restore the
305
326
  ordinary part view. Unknown modes/keys and out-of-range opacity refuse `PARTS_COMPARISON_INVALID`.
306
327
 
307
328
  The viewport `crop` comes from the shared displayed-pixel compositor and includes its mark.
308
- `nativeCrop` is cut on the server from the hash-bound original PNG, preserving all RGBA bytes,
309
- including alpha. Both use the common PNG validator/content-addressed store; paths are selected
310
- by the server. The native crop has no alpha-mask, background or zoom transform. The saved
311
- viewport crop includes its private inline PNG; exported JSON and issue Markdown replace it
312
- with a resolved file path and hash. Both exports name the part and both regions and crops.
329
+ In item mode, `nativeCrop` is cut on the server from the hash-bound original PNG, preserving all
330
+ RGBA bytes, including alpha. It has no alpha-mask, background or zoom transform. Assembled issues
331
+ retain their rig-space region and viewport crop, with `imageRegion` and `nativeCrop` both null.
332
+ Crops use the common PNG validator/content-addressed store and server-selected paths. The saved
333
+ viewport crop includes its private inline PNG. Exported JSON and issue Markdown resolve stored
334
+ crops to file paths and hashes and retain the referenced parts and regions.
313
335
 
314
336
  ```sh
315
337
  npx rig-review parts <out>/rig --painting painting.png
@@ -318,7 +340,7 @@ npx rig-review parts <out>/rig --painting painting.png --format issue
318
340
  ```
319
341
 
320
342
  The optional painting must be a PNG contained in the parts package (including symlink resolution),
321
- with a portable source path. Format, size and hash derive from one buffer read. Its original dimensions
343
+ with a portable source path. In the live job host, a painting loaded from a retained snapshot via `paintingRoot` must instead resolve inside that snapshot root and match its retained seal. Format, size and hash derive from one buffer read. Its original dimensions
322
344
  must satisfy `trunc(width × scale_rig_per_source) = rig_size[0]` and the equivalent height check
323
345
  (`PARTS_PAINTING_SIZE`); missing/invalid declared geometry refuses `PARTS_PAINTING_MAPPING`.
324
346
  The painting stays in `source.files` and the protected input set. Adding it to an older verdict changes
@@ -333,7 +355,7 @@ Both use the existing canvas host/camera/capture. The original source rectangle
333
355
  `(x × originalWidth/rigWidth, y × originalHeight/rigHeight, w × originalWidth/rigWidth,
334
356
  h × originalHeight/rigHeight)`, retaining fractional placement. Browser image interpolation displays
335
357
  this continuous rectangle; it does not reproduce the producer's resampling or claim native pixel equality.
336
- Alpha-only and mesh diagnostics are disabled in Overlay; front footprints remain available.
358
+ Overlay retains the global mesh setting and front footprints. Alpha-only applies to the ordinary part raster.
337
359
  Without a painting the comparison controls are absent and the reference pane names
338
360
  `PARTS_REFERENCE_UNAVAILABLE`. No comparison changes the verdict. These behaviors are guarded by
339
361
  `tests/parts-comparison.test.ts`; `tests/parts-overlay-browser.ts` separately exercises trusted input,
@@ -357,9 +379,13 @@ For real scaled evidence, `scripts/prepare-parts-overlay-demo.ts` fetches hash-v
357
379
  inputs at `ba99e403d4058fc1cfe40699bdcde8aaf00a90c0`, then runs explicitly installed `@rig-c/parts@2.17.0`
358
380
  assemble in a separate fixture directory. It is an evidence script, never an app action.
359
381
 
360
- **Difference remains absent** pending the producer-declared rig-space painting raster and
361
- [the waiting consumer #390](https://github.com/rig-c/review/issues/390). Review adds no producer resampler.
362
- Neither visual comparison nor opening a package supplies an approval.
382
+ The earlier visual-comparison release deferred Difference to
383
+ [consumer #390](https://github.com/rig-c/review/issues/390). The current producer-declared operand and
384
+ metric are documented under [Declared-grid Difference](#declared-grid-difference).
385
+
386
+ Hold **P** to show the original painting at full opacity in item or assembled view. Capture is
387
+ suspended during the hold. Releasing P, leaving the active mount, hiding the document or losing
388
+ window focus restores the inspection view. The hold is temporary inspection state.
363
389
 
364
390
  Parts native zoom ranges from `min(fit, 1)` to 16. Exact native 1 is always reachable for a valid,
365
391
  successfully rendered frame. **Fit** is
@@ -389,30 +415,41 @@ while the existing verdict cannot be revalidated. Real source/flag identity chan
389
415
  separate stale warning. `PARTS_PAINTING_OUTSIDE` and `PARTS_PAINTING_PNG` refuse external or non-PNG
390
416
  painting inputs. `tests/parts-comments.test.ts` covers these read and cross-encoding boundaries;
391
417
  `tests/parts-async-navigation.test.ts` guards reordered painting loads and actionable atlas clicks.
392
- A downstream create consumer must support verdict/2 before a review release can ship.
418
+ The historical verdict/2 rollout required downstream create read support before release.
393
419
 
394
420
  ### Assembled package
395
421
 
396
- **Assembled** toggles the existing rig/reference pair from the selected part to the declared
422
+ **Assembled** switches the existing rig/reference pair from the selected part to the declared
397
423
  `rig_size` canvas. Parts draw back to front in package order at their exact fractional rig-pixel
398
- placements. The checkbox beside each part controls assembly visibility only; the verdict remains
399
- per part. List rows occupy one line, with full part names available to assistive technology and on hover, separate source counts and the outcome badge. The former **Visible / 표시** caption is removed; the checkbox retains its per-part accessible name (`tests/parts-approve-all.test.ts`, with full-list geometry in `tests/parts-approve-all-browser.ts`). A tap selects the frontmost visible part with nonzero native source alpha, including
400
- through transparent holes; drags remain camera gestures. The selected part's alpha edge is a
401
- separate outline, outside the comparison raster. Background, alpha-only, Fit, 1:1 and the shared
402
- camera controls remain available. `tests/parts-assembly.test.ts` guards fractional placement,
403
- order controls, picking, hidden layers, separate outline pixels and per-part verdict invariance.
404
-
405
- With `--painting`, the reference pane and optional Overlay use the same whole-canvas visual
406
- mapping described above. No producer resampler, Difference or assembled verdict is added.
407
- Without painting the reference keeps `PARTS_REFERENCE_UNAVAILABLE`; atlas assembly is disabled
408
- because atlas regions carry no rig placement, and missing `rig_size` is named separately.
409
- Comments remain bound to individual original PNGs: switch out of assembly to capture one;
410
- restoring a saved comment returns to its individual part view. Assembly visibility is temporary
411
- inspection state and is never saved into a verdict or comment. `tests/parts-assembly-browser.ts`
412
- checks real EN/KO assembly/reference pixels against an independent browser draw after a
413
- base-vs-base control, tap/hole/hide selection, pan, camera preservation, background, alpha,
414
- verdict save and missing-input refusals. Existing `tests/parts-comparison.test.ts` and
415
- `tests/parts-comments.test.ts` retain the painting-size and protected-input guards.
424
+ placements. Each part's checkbox controls assembly visibility. A tap selects the frontmost visible
425
+ part with nonzero native alpha, including through transparent holes. Hover outlines that part and
426
+ shows its name. Double-click opens its individual view. Escape returns from an individual part to
427
+ assembly when comment capture or a draft does not own the key. Drags with capture off remain camera
428
+ gestures. Selected, hovered and issue-referenced outlines stay separate from the comparison raster.
429
+ Background, alpha-only, Fit, 1:1 and shared camera controls remain available.
430
+
431
+ The one-line part rows retain full accessible names and source counts. The historical outcome badge
432
+ and **Visible / 표시** caption belong to the earlier per-part sign-off UI. Existing
433
+ `tests/parts-assembly.test.ts` guards placement, ordering, alpha picking, hidden layers and outlines.
434
+
435
+ An assembled issue can span several parts. The composer autoattaches part-name chips by sampling
436
+ frontmost visible nontransparent art within the marked region. Review the chips and add or remove
437
+ visible parts as needed. At least one referenced part is required, and the rig-space region must
438
+ remain inside their combined bounding box. Editing chips or wording validates and prepares the
439
+ candidate through the same source-bound crop pipeline before replacing the existing issue. A rejected
440
+ edit preserves the existing issue. Restoring an issue restores assembled view and highlights its
441
+ referenced parts. Assembly visibility stays temporary and is excluded from saved issues and verdicts.
442
+
443
+ With `--painting`, the reference pane and Overlay use the same whole-canvas visual mapping described
444
+ above. Without painting the reference names `PARTS_REFERENCE_UNAVAILABLE`. Atlas assembly is disabled
445
+ because atlas regions carry no rig placement, and missing `rig_size` is named separately. Difference
446
+ uses the individual part view described below.
447
+
448
+ `tests/parts-assembly-browser.ts` covers EN/KO assembly/reference pixels against an independent browser
449
+ draw, alpha picking, hidden layers, pan and camera preservation. `tests/parts-comments-browser.ts`
450
+ covers assembled seam capture, chip edits, saved-view restoration, crop evidence and source immutability
451
+ in both languages. `tests/parts-mesh-browser.ts` covers the global mesh control and unavailable states.
452
+ The live job host's `tests/job-window-browser.ts` covers the same mount through submission and reconnect.
416
453
 
417
454
  ## Draft mesh correction connection
418
455
 
@@ -31,7 +31,7 @@ The CLI also accepts an existing output directory. It reads a root `review.json`
31
31
  }
32
32
  ```
33
33
 
34
- An optional `producer` block declares the producer handoff: `"producer": {"config": "rig/config.json", "parts": "rig/out", "source": "inputs/painting.png", "full": "inputs/full", "head": "inputs/head"}` (only `config` is required; `source` and `full` go together, `head` only with them; no other key). See *Producer handoff* below.
34
+ An optional `producer` block declares the producer handoff: `"producer": {"config": "rig/config.json", "parts": "rig/out", "source": "inputs/painting.png", "full": "inputs/full", "head": "inputs/head"}`. Only `config` is required, `source` may be declared alone, `full` requires `source`, and `head` requires `full`. See *Producer handoff* below. An optional `panels` block (`{"schema": "rig-review/panels@1", "left": ["parts.list"], "stage": ["parts.canvas"], "toolbar": ["parts.layers"], "side": ["parts.issues", "act.submit"]}`) declares the panel composition across the closed slots `left`, `stage`, `toolbar` and `side` (`stage.length === 1` and `side` ending with `"act.submit"`); malformed `panels` blocks refuse with `JOB_PANELS_INVALID` in `parsePanelComposition` and fall back to `panels: undefined` in `parseManifest`.
35
35
 
36
36
  The illustrative `look` animation in `axes` must also be declared in `animations`. Omit axes when no real angle animation exists. All animation identifiers name actual compiled-model animations; the frontend reports runtime load/lookup errors rather than inventing them. Metadata duration is optional; the player supplies actual duration.
37
37
 
@@ -149,7 +149,7 @@ The active compiled model supplies rig identity. Without one, a known root or un
149
149
  An Apply rebuilds through the installed producer from the files the inspected rig was built from: the producer config, its parts directory (`parts.json`, `parts/`) and the inspected rig directory `<parts>/rig/`. Review finds them in this order, first match wins, never by searching:
150
150
 
151
151
  1. **Declared on the command line**: `rig-review open <dir> --config <path> [--parts <dir>] [--source <png> --full <dir> [--head <dir>]] [--keypoints <file>]`. `feedback` and `control` take the same flags so retrieval binds the same identity. Paths are resolved from the working directory and canonicalized; the worker and every reload read exactly those files.
152
- 2. **Declared in review.json**: the `producer` block, package-relative literal portable paths (no `..`, no absolute path, no encoding).
152
+ 2. **Declared in review.json**: the `producer` block, package-relative literal portable paths (no `..`, no absolute path, no encoding). Unlike the CLI `--source`/`--full` pair, `producer.source` may be declared without `producer.full`, while `full` still requires `source` and `head` requires `full`.
153
153
  3. **Discovered inside the opened folder**: `config.json`, then `rig/config.json`.
154
154
  4. **Discovered beside an opened `out/`**: `../config.json`. It is outside the opened folder, so the record says `"how": "discovered", "outside": true` and the editor bar says *discovered outside the opened folder*, with its path and SHA-256. This step runs only when the opened folder is named `out`, and only for a regular file there (a symlink is refused).
155
155
 
@@ -611,7 +611,7 @@ Browser players retain play's default DOM mode and default mesh backend. Rigid
611
611
  parts remain DOM images; a WebGL mesh label does not claim full-frame GL drawing.
612
612
  WebGL is requested by the published default, with Canvas2D as the supported mesh
613
613
  fallback. Accurate public actual-flush telemetry requires play 1.11.1 or later;
614
- this checkout consumes pinned 1.23.0. The consumer does not probe GL or inspect
614
+ this checkout consumes pinned 1.24.0. The consumer does not probe GL or inspect
615
615
  private renderer state. The separate Node strip exporter remains Canvas2D.
616
616
 
617
617
  The backend badge is sampled only after successful draw/frame calls. Fresh mesh
@@ -843,8 +843,7 @@ Stage comment capture refuses unrecorded authoring effects, by `COMMENT_UNAPPLIE
843
843
 
844
844
  ### Parts pointed evidence
845
845
 
846
- Pre-rig parts uses `rig-review-parts-verdict/2` and the closed `rig-review-parts-comment/1`;
847
- existing verdict/1 records read with no comments. This identity comes from the existing
846
+ Pre-rig parts saves `rig-review-parts-verdict/4` with pointed `issues` (`rig-review-parts-comment/2`, carrying `parts: [{name, imageHash}]` and item or assembled view geometry) while preserving historical `rig-review-parts-verdict/1`, `rig-review-parts-verdict/2`, `rig-review-parts-verdict/3` and `rig-review-parts-comment/1` records on read (existing verdict/1 records read with no issues, `/2` and `/3` records with only comment-backed flags convert to `/4`, and `/1`..`/3` records with bare flagged part or mesh notes surface as read-only legacy verdicts with `PARTS_VERDICT_LEGACY_FORMAT`). This identity comes from the existing
848
847
  parts verdict source digest and actual original PNG SHA-256, without a fabricated review
849
848
  manifest id, revision or compiled model. The rig's `rig-review-comment/1` schema stays closed.
850
849
  See [the parts contract and validation instruments](PARTS_VIEW.md#pointed-parts-comments).
@@ -1144,7 +1143,7 @@ signatures and the host-owned integration example are in
1144
1143
  - **Five enabled kinds and two reserved disabled kinds.** `JOB_ENABLED_ACT_KINDS` enables `'interview-picks'`, `'checkpoint'`, `'parts-verdict'`, `'review-verdict'` and `'signoff'`. `JOB_RESERVED_ACT_KINDS` reserves `'described-correction'` and `'mesh-edit'`, which have no accepted value shape in this contract and refuse with `JOB_ACT_KIND_DISABLED`. `described-correction` awaits the joint [Create #182](https://github.com/rig-c/create/issues/182) context allowlist. `mesh-edit` awaits the joint [Parts #1159](https://github.com/rig-c/parts/issues/1159) freeze (proposal `6ff03ec9` discusses slot, attachment and skin identity, setup basis, vertex, triangle and hull counts and at most 300 closed `move`, `add`, `remove`, `edge` and `unedge` operations in crop pixels, while the exact attachment bytes behind `source.hash` and the canonical payload digest replacing `delta_sha256` remain unresolved and undefined in C3 as in C2, and UI drafts are never consumer acts).
1145
1144
  - **`interview-picks`.** `JobActValues['interview-picks']` carries `questionId`, ordered `selections` (`itemId`, `optionId`, nullable `otherText`) and `note`, with non-null `source.optionSet` (`id` and `sha256`).
1146
1145
  - **`checkpoint`.** `JobActValues['checkpoint']` carries `checkpointId`, `planStepId`, `outcome` restricted to `'pass'` or `'fail'` and required `words` as a `string`. `pending` stays in the UI draft only and never produces a finalized act. Only `'pass'` is eligible for Create's checkpoint sign-off writer, whereas `'fail'` is feedback or a named consumer refusal and never an approval write. `words` is preserved verbatim including empty or whitespace-only strings, matching Create's writer without adding a UI gate. In `JobSubject`, `checkpointId` defaults to the Create plan step ID and optional `planStepId` is required when the displayed Review checkpoint ID differs, matching [Create #184](https://github.com/rig-c/create/issues/184) without alias inference or browser trust. The browser supplies `checkpointId`, `outcome` and `words` only (`JobUIActValues['checkpoint']`), the daemon copies resolved `planStepId` from the validated ask and requires `source.plan`, and Create derives execution stage from its authoritative step phase and order without Review stamping a stage.
1147
- - **`parts-verdict`.** `JobActValues['parts-verdict']` carries `verdict` (`'pending'`, `'approved'` or `'changes-requested'`), `parts` (`partId`, `part` outcome and note, `mesh` outcome and note with `JobPartOutcome` as `'pending'`, `'clean'` or `'flagged'`) and `words`, requiring non-null `source.projectHash`, a `draft` selector and `source.parts`.
1146
+ - **`parts-verdict`.** `JobActValues['parts-verdict']` is `PartsVerdictValue` (`verdict` as `'approved'` or `'changes-requested'`, `issues` as `readonly PartsIssue[]` under `rig-review-parts-comment/2` — empty on `'approved'` and non-empty on `'changes-requested'`, bound to `source.sourceHash`, retained `partIds`, and `source.parts.images` hashes — and `words`), emitted in new finalized `rig-review/act@5` acts (`JobPartsVerdictAct`) and requiring non-null `source.projectHash`, a `draft` selector and `source.parts`. Historical `rig-review/act@2` `parts-verdict` acts remain in the `JobAct` union via `JobLegacyAct` with `value: JobLegacyPartsVerdictValue` (`verdict` as `'pending'`, `'approved'` or `'changes-requested'`, `parts` with `partId`, `part` outcome and note, `mesh` outcome and note with `JobPartOutcome` as `'pending'`, `'clean'` or `'flagged'`, and `words`).
1148
1147
  - **`review-verdict`.** The original model branch carries `stage` (`'rig-review'` or `'direction-review'`), `verdict` and `words`, requiring a `rig` or `post` selector and non-null `source.model` with runtime stage, selector and direction consistency checks. The HQ-approved #522 image branch uses `'image-review'`, `source.subject = "image-set"`, daemon-derived image identities, digest and duplicate groups, with `model` and `selector` absent. It retains the same human verdict act and supports optional name-bound image notes. [Image-set verdict extension](STABILITY.md#image-set-verdict-extension).
1149
1148
  - **`signoff`.** `JobActValues['signoff']` carries `stage` (validated by Create's writer), `decision` restricted to `'approved'` only (changes requested are a verdict, never a signoff) and required `words` preserved verbatim including empty or whitespace-only strings. A verdict, a signoff and a Create stage transition are three separate writes, and `JobAct` grants no transition authority. Every stage in `JOB_PLAN_BOUND_SIGNOFF_STAGES` (`'plan-approved'`, `'rigging-interview'`, `'post-interview'`) requires non-null `source.plan` with exact displayed step IDs and hashes before act creation, while other stages keep `source.plan` nullable where appropriate.
1150
1149
  - **Create-published step IDs and hashes.** `JobPlanIdentity` holds `steps` (`id` and `hash`) published by [Create #184](https://github.com/rig-c/create/issues/184) for the displayed plan. Review retains these values without importing or recomputing Create's internal `stepHash`. Create validates them through its existing `steps` and `step_hashes` writer logic, with no separate plan revision hash or additional revision gate in this contract.
package/docs/STABILITY.md CHANGED
@@ -561,7 +561,7 @@ model binding nor a valid image-set binding uses `JOB_ASK_INVALID`.
561
561
 
562
562
  ## Named export inventory
563
563
 
564
- The backend rig-still extension retains the original twelve runtime exports and `JOB_ACT_SCHEMA` at act@2. `JobAct` additionally includes `JobRigReviewAct` at act@3 with top-level `JobRigStill`. The facade adds type-only `JobLegacyAct`, `JobRigReviewAct`, `JobRigStill` and `JobRigCapture` exports, [Review #563](https://github.com/rig-c/review/issues/563) adds five type-only exports (`JobHostListenerIncarnation`, `JobHostReuseBinding`, `JobHostReuseExpectation`, `JobHostAttachField` and `JobHostAttachFailure`), and [Review #555](https://github.com/rig-c/review/issues/555) adds four type-only interview diagnostic exports (`JobInterviewJson`, `JobInterviewRecord`, `JobInterviewDiagnostic` and `JobInterviewDiagnostics`). [Review #588](https://github.com/rig-c/review/issues/588) activates record mode when `readRecordPublished` and `recordReaderId` are supplied to a host or session (`publicationMode: 'record-and-package'`), serving `rig-review/job-api@3` (`JOB_API_V3_SCHEMA`), `rig-review/act@4` (`JOB_RECORD_ACT_SCHEMA`) and normal owner URL model-free record inspection while keeping default package-only hosts and exact `package-only` `job-ui/<jobId>.json` descriptor bytes at @2 and enforcing `publicationMode` / `recordReaderId` reuse compatibility across ordinary reuse and strict `reuseOnly` attachment. It exports six additional record-mode runtime symbols (`JOB_API_V3_SCHEMA`, `JOB_RECORD_ACT_SCHEMA`, `JOB_RECORD_READER_ID`, `parseRecordAct`, `prepareJobRecordAct` and `prepareJobRecordSource`, for eighteen runtime exports total) and the V3/record type surface listed below. The rig revision constant, transport limits and the internal `POST /jobs/<jobId>/host` helper remain internal to their modules. Consumer checks distinguish these act revisions as described in [Rig verdict still backend](REVIEW_PACKAGE.md#rig-verdict-still-backend) and [Model-free record mode and source seam](REVIEW_PACKAGE.md#model-free-record-mode-and-source-seam).
564
+ The backend rig-still extension retains the original twelve runtime exports and `JOB_ACT_SCHEMA` at act@2. `JobAct` additionally includes `JobRigReviewAct` at act@3 with top-level `JobRigStill` and `JobPartsVerdictAct` at act@5 (`PartsVerdictValue` with pointed `issues` and `words`, while preserving `JobLegacyPartsVerdictValue` at act@2 for historical acts). The facade adds type-only `JobLegacyAct`, `JobRigReviewAct`, `JobPartsVerdictAct`, `JobLegacyPartsVerdictValue`, `PartsVerdictValue`, `JobPanelComposition`, `PanelComponent`, `JobRigStill` and `JobRigCapture` exports, [Review #563](https://github.com/rig-c/review/issues/563) adds five type-only exports (`JobHostListenerIncarnation`, `JobHostReuseBinding`, `JobHostReuseExpectation`, `JobHostAttachField` and `JobHostAttachFailure`), and [Review #555](https://github.com/rig-c/review/issues/555) adds four type-only interview diagnostic exports (`JobInterviewJson`, `JobInterviewRecord`, `JobInterviewDiagnostic` and `JobInterviewDiagnostics`). [Review #588](https://github.com/rig-c/review/issues/588) activates record mode when `readRecordPublished` and `recordReaderId` are supplied to a host or session (`publicationMode: 'record-and-package'`), serving `rig-review/job-api@3` (`JOB_API_V3_SCHEMA`), `rig-review/act@4` (`JOB_RECORD_ACT_SCHEMA`) and normal owner URL model-free record inspection while keeping default package-only hosts and exact `package-only` `job-ui/<jobId>.json` descriptor bytes at @2 and enforcing `publicationMode` / `recordReaderId` reuse compatibility across ordinary reuse and strict `reuseOnly` attachment. It exports six additional record-mode runtime symbols (`JOB_API_V3_SCHEMA`, `JOB_RECORD_ACT_SCHEMA`, `JOB_RECORD_READER_ID`, `parseRecordAct`, `prepareJobRecordAct` and `prepareJobRecordSource`, for eighteen runtime exports total) and the V3/record type surface listed below. The rig and parts-verdict act revision constants, transport limits and the internal `POST /jobs/<jobId>/host` helper remain internal to their modules. Consumer checks distinguish these act revisions as described in [Rig verdict still backend](REVIEW_PACKAGE.md#rig-verdict-still-backend) and [Model-free record mode and source seam](REVIEW_PACKAGE.md#model-free-record-mode-and-source-seam).
565
565
 
566
566
  The exact runtime exports are listed below. Constants preserve their literal
567
567
  values from the frozen semantic contract.
@@ -641,6 +641,11 @@ without aliases or copied wire shapes.
641
641
  - `JobReviewStage`
642
642
  - `JobLegacyAct`
643
643
  - `JobRigReviewAct`
644
+ - `JobPartsVerdictAct`
645
+ - `JobLegacyPartsVerdictValue`
646
+ - `PartsVerdictValue`
647
+ - `JobPanelComposition`
648
+ - `PanelComponent`
644
649
  - `JobRigStill`
645
650
  - `JobRigCapture`
646
651
  - `JobActValues`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rig-review",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "type": "module",
5
5
  "description": "Local human rig inspection and structured feedback export",
6
6
  "license": "MIT",
@@ -20,12 +20,12 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@napi-rs/canvas": "1.0.11",
23
- "@rig-c/play": "1.23.0",
23
+ "@rig-c/play": "1.24.0",
24
24
  "@types/pngjs": "6.0.5",
25
25
  "pngjs": "7.0.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@rig-c/parts": "2.35.0",
28
+ "@rig-c/parts": "2.37.0",
29
29
  "@types/bun": "^1.3.0",
30
30
  "typescript": "^5.9.3"
31
31
  },
package/src/build.ts CHANGED
@@ -1,7 +1,15 @@
1
+ import { join } from 'node:path';
1
2
  import { fileURLToPath } from 'node:url';
2
3
  export const appRoot=fileURLToPath(new URL('..',import.meta.url));
3
- export async function buildWeb(mode:'single'|'compare'|'parts'|'interview'|'workspace'|'job-hub'='single'):Promise<Blob> {
4
- const result=await Bun.build({entrypoints:[appRoot+(mode==='job-hub'?'web/job-hub.ts':mode==='workspace'?'web/owner-workspace.ts':mode==='compare'?'web/compare.ts':mode==='parts'?'web/parts.ts':mode==='interview'?'web/interview.ts':'web/main.ts')],target:'browser',format:'esm',minify:false});
4
+ export const PLAY_SOURCE_CONDITION='@rig-c/source';
5
+ export function playBuildConditions(root:string=appRoot):string[] {
6
+ try{return /[\\/]src[\\/]index\.ts$/.test(Bun.resolveSync('@rig-c/play',root))?[PLAY_SOURCE_CONDITION]:[];}
7
+ catch{return [];}
8
+ }
9
+ export async function buildWeb(mode:'single'|'compare'|'parts'|'interview'|'workspace'|'job-hub'='single',root:string=appRoot):Promise<Blob> {
10
+ const conditions=playBuildConditions(root);
11
+ const entry=join(root,mode==='job-hub'?'web/job-hub.ts':mode==='workspace'?'web/owner-workspace.ts':mode==='compare'?'web/compare.ts':mode==='parts'?'web/parts-page.ts':mode==='interview'?'web/interview.ts':'web/main.ts');
12
+ const result=await Bun.build({entrypoints:[entry],target:'browser',format:'esm',minify:false,...(conditions.length?{conditions}:{})});
5
13
  if(!result.success)throw new Error(result.logs.map(v=>v.message).join('\n'));
6
14
  const output=result.outputs.find(v=>v.path.endsWith('.js'));if(!output)throw new Error('frontend bundle: JavaScript output missing');return output;
7
15
  }
package/src/cli.ts CHANGED
@@ -18,7 +18,7 @@ import { readFeedbackSession, readFeedbackCompareSession } from './session-histo
18
18
  import { startServer } from './server.ts';
19
19
  import { loadCompare } from './compare.ts';
20
20
  import { startCompareServer } from './compare-server.ts';
21
- import { loadPartsView, readVerdict, readPartsVerdictJson, exportPartsVerdict, exportPartsCorrection, assertPartsUnchanged, type PartsViewOptions } from './parts-view.ts';
21
+ import { loadPartsView, readVerdict, readPartsVerdictForCli, readPartsVerdictJson, exportPartsVerdict, exportPartsCorrection, assertPartsUnchanged, type PartsViewOptions } from './parts-view.ts';
22
22
  import { startPartsServer } from './parts-server.ts';
23
23
  import { readSession, parseSession, sessionFile, type Feedback } from './session.ts';
24
24
  import { readCompareSession } from './compare-session.ts';
@@ -217,16 +217,15 @@ async function partsCommand(args:string[]){
217
217
  if((itemId||partNote||inventory)&&(!format||!itemId||!inventory))throw new Error('CORRECTION_SELECTOR_INVALID: parts correction requires --format, --correction and --parts-file');
218
218
  const pkg=await loadPartsView(input,options);
219
219
  if(format&&itemId&&inventory){
220
- const saved=await readVerdict(pkg);
221
- if(!saved.verdict)throw new Error('PARTS_VERDICT_UNAVAILABLE: save a current verdict first');
220
+ const verdict=await readPartsVerdictForCli(pkg);
221
+ if(!verdict)throw new Error('PARTS_VERDICT_UNAVAILABLE: save a current verdict first');
222
222
  await assertPartsUnchanged(pkg);
223
- const verdict=saved.verdict;
224
223
  const projected=projectPartsDescription({verdict,source:verdict.source,selector:{stage:'parts-review',kind:'parts',inventory},selection:partNote?{kind:'note',itemId,part:partNote}:{kind:'comment',itemId}});
225
224
  process.stdout.write(format==='json'?exportPartsCorrection(verdict,projected):formatCorrectionIssue(projected)+'\n');
226
225
  return;
227
226
  }
228
227
  if(format==='json'){process.stdout.write(await readPartsVerdictJson(pkg));return;}
229
- if(format){const saved=await readVerdict(pkg);if(!saved.verdict)throw new Error('PARTS_VERDICT_UNAVAILABLE: save a verdict first');process.stdout.write(exportPartsVerdict(saved.verdict,format));return;}
228
+ if(format){const verdict=await readPartsVerdictForCli(pkg);if(!verdict)throw new Error('PARTS_VERDICT_UNAVAILABLE: save a verdict first');process.stdout.write(exportPartsVerdict(verdict,format));return;}
230
229
  const capability=randomBytes(32).toString('hex');
231
230
  let outputFailure: Error | null = null;
232
231
  let rejectWrite: ((error: Error) => void) | undefined;
@@ -196,9 +196,21 @@ export function projectSessionCorrection(input: SessionInput) {
196
196
  return { ...common, kind: 'checked-patch' as const, applied, sessionBytes, patchBytes: patchText(patch), outcome: null };
197
197
  }
198
198
 
199
+ type PartsCorrectionVerdict = PartsVerdict | {
200
+ schema?: string;
201
+ mode: PartsVerdict['mode'];
202
+ tool?: { name: string; version: string };
203
+ source: PartsVerdict['source'];
204
+ status?: string;
205
+ parts?: Record<string, { outcome: string; note: string; flags: string[] }>;
206
+ comments?: import('./parts-comment.ts').PartsComment[];
207
+ issues?: import('./parts-comment.ts').PartsIssue[];
208
+ updatedAt?: string;
209
+ };
210
+
199
211
  /** Standalone parts notes and pointed comments keep their original parts identity. */
200
212
  export function projectPartsDescription(input: {
201
- verdict: PartsVerdict;
213
+ verdict: PartsCorrectionVerdict;
202
214
  source: PartsVerdict['source'];
203
215
  selector: Extract<Selector, { kind: 'parts' }>;
204
216
  selection: { kind: 'comment'; itemId: string } | { kind: 'note'; itemId: string; part: string };
@@ -210,13 +222,24 @@ export function projectPartsDescription(input: {
210
222
  }
211
223
  const { itemId } = selection;
212
224
  if (selection.kind === 'comment') {
213
- const matches = verdict.comments.filter(comment => comment.id === itemId);
225
+ if ('issues' in verdict && Array.isArray(verdict.issues)) {
226
+ const matches = verdict.issues.filter(issue => issue.id === itemId);
227
+ const item = matches[0];
228
+ if (matches.length !== 1 || !item || item.sourceHash !== source.sha256) {
229
+ return refuse('CORRECTION_ITEM_INVALID', 'expected one source-bound parts comment');
230
+ }
231
+ const primary = item.parts[0]!;
232
+ return { kind: 'described' as const, itemId, verbatim: itemWords(itemId, item.summary), stage: selector.stage, on, source, part: primary.name, imageHash: primary.imageHash, parts: item.parts, comment: item, outcome: null };
233
+ }
234
+ const comments = ('comments' in verdict && Array.isArray(verdict.comments)) ? verdict.comments : [];
235
+ const matches = comments.filter(comment => comment.id === itemId);
214
236
  const item = matches[0];
215
237
  if (matches.length !== 1 || !item || item.sourceHash !== source.sha256) {
216
238
  return refuse('CORRECTION_ITEM_INVALID', 'expected one source-bound parts comment');
217
239
  }
218
240
  return { kind: 'described' as const, itemId, verbatim: itemWords(itemId, item.summary), stage: selector.stage, on, source, part: item.part, imageHash: item.imageHash, comment: item, outcome: null };
219
241
  }
220
- if (!Object.hasOwn(verdict.parts, selection.part)) return refuse('CORRECTION_ITEM_INVALID', 'expected a saved part note');
221
- return { kind: 'described' as const, itemId, verbatim: itemWords(itemId, verdict.parts[selection.part]!.note), stage: selector.stage, on, source, part: selection.part, outcome: null };
242
+ const parts = ('parts' in verdict && verdict.parts) ? verdict.parts : null;
243
+ if (!parts || !Object.hasOwn(parts, selection.part)) return refuse('CORRECTION_ITEM_INVALID', 'expected a saved part note');
244
+ return { kind: 'described' as const, itemId, verbatim: itemWords(itemId, parts[selection.part]!.note), stage: selector.stage, on, source, part: selection.part, outcome: null };
222
245
  }
@@ -247,7 +247,7 @@ export function formatFeedbackIssues(input: ParsedFeedbackSession): string {
247
247
 
248
248
  /** Selected handoff uses the existing issue export surface with exact JSON-escaped words and evidence. */
249
249
  export function formatCorrectionIssue(
250
- correction: {kind:string;itemId:string;stage:string;on:readonly string[];verbatim:string;source:unknown;createSource?:string;operation?:string;patchBytes?:string;target?:unknown;part?:string;imageHash?:string;comment?:import('./parts-comment.ts').PartsComment},
250
+ correction: {kind:string;itemId:string;stage:string;on:readonly string[];verbatim:string;source:unknown;createSource?:string;operation?:string;patchBytes?:string;target?:unknown;part?:string;imageHash?:string;comment?:import('./parts-comment.ts').PartsComment|import('./parts-comment.ts').PartsIssue},
251
251
  context?:Json,
252
252
  ): string {
253
253
  const state=correction.kind==='described'?'Unresolved request':
package/src/front.ts CHANGED
@@ -12,6 +12,7 @@ import {lstat,readFile,readdir,realpath,rename,unlink,writeFile,open as openFile
12
12
  import {dirname,join} from 'node:path';
13
13
  import {fileURLToPath} from 'node:url';
14
14
  import {acquireClaim,alive,openFingerprint,readRecord,releaseClaim,running,smallJson,type RecordFile} from './open.ts';
15
+ import {playBuildConditions} from './build.ts';
15
16
  import {capabilityHeader,openKeyHeader,openNonceHeader,sameSecret} from './open-protocol.ts';
16
17
  import {DEFAULT_CLOSE_GRACE_MS,LIVE_PATH} from './live-lifecycle.ts';
17
18
  export const defaultFrontPort=4318; // Foreground `review <dir>` keeps 4317.
@@ -40,7 +41,7 @@ export async function ensureFront(options:{control:string;port:number;fingerprin
40
41
  const row=await reuse();if(row)return row.origin;
41
42
  request=join(control,`${name}.${nonce}.request.json`);const log=join(control,`${name}.${nonce}.log`);
42
43
  const spec:FrontRequest={schema:'rig-review-front-request/1',control,request,record:recordPath,port,nonce,fingerprint,idleMs};await writeFile(request,JSON.stringify(spec),{mode:0o600,flag:'wx'});
43
- const logHandle=await openFile(log,'a',0o600);try{child=spawn(process.execPath,[join(appRoot,'src/front-worker.ts'),request],{cwd:control,detached:true,stdio:['ignore',logHandle.fd,logHandle.fd],env:process.env});child.unref();}finally{await logHandle.close();}
44
+ const logHandle=await openFile(log,'a',0o600);try{child=spawn(process.execPath,[...playBuildConditions().map(c=>`--conditions=${c}`),join(appRoot,'src/front-worker.ts'),request],{cwd:control,detached:true,stdio:['ignore',logHandle.fd,logHandle.fd],env:process.env});child.unref();}finally{await logHandle.close();}
44
45
  let exited:string|undefined;child.on('error',error=>{exited=error.message;});child.on('exit',(code,signal)=>{exited=`exit ${code} ${signal??''}`;});
45
46
  while(performance.now()<deadline){const live=await reuse();if(live){handedOff=true;return live.origin;}
46
47
  if(exited){if(/FRONT_PORT_BUSY/.test(await readFile(log,'utf8').catch(()=>'')))throw new Error(`FRONT_PORT_BUSY: 127.0.0.1:${port} is held by another listener; use --direct (or set RIG_REVIEW_FRONT_PORT)`);throw new Error(`FRONT_START: ${exited}; front log ${log}`);}
package/src/handoff.ts CHANGED
@@ -430,7 +430,7 @@ export async function resolveHandoff(root: string, declared: HandoffDeclaration
430
430
  const full = declared.full !== undefined ? await blockPath(root, declared.full, 'producer.full', 'dir') : undefined;
431
431
  const head = declared.head !== undefined ? await blockPath(root, declared.head, 'producer.head', 'dir') : undefined;
432
432
  const keypoints = declared.keypoints !== undefined ? await blockPath(root, declared.keypoints, 'producer.keypoints', 'file') : undefined;
433
- if ((source === undefined) !== (full === undefined) || (head !== undefined && full === undefined)) throw new HandoffError('HANDOFF_FLAGS_INVALID', 'producer', 'source and full are given together, head only with them');
433
+ if ((full !== undefined && source === undefined) || (head !== undefined && full === undefined)) throw new HandoffError('HANDOFF_FLAGS_INVALID', 'producer', 'full requires source, and head requires full');
434
434
  return { handoff: await record(root, root, 'declared', 'review.json producer', config, parts, { source, full, head, keypoints }, declared.parts !== undefined, options), reason: null };
435
435
  }
436
436
  for (const name of ['config.json', 'rig/config.json']) {