rig-review 1.16.1 → 1.16.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rig-review",
3
- "version": "1.16.1",
3
+ "version": "1.16.2",
4
4
  "type": "module",
5
5
  "description": "Local human rig inspection and structured feedback export",
6
6
  "license": "MIT",
@@ -1,68 +1,125 @@
1
1
  ---
2
2
  name: rig-review
3
- description: Hand a rig build or rig-parts/rig-pose output to a person for local inspection and retrieve their structured feedback with rig-review (@rig-c/review). Validate the delivery package (rig-review check), start or reuse a loopback inspection workspace and print its capability URL (rig-review open), read back submitted verdicts, frame intervals, stage-comment crop PNGs and applied producer edits (rig-review feedback --format json|issue), export comparison or feedback frame strips headlessly (rig-review strip), or steer an opted-in open page (rig-review control). Not for compiling a rig (use rigc or rig-parts) or grading a rig without a person's submission.
3
+ description: Hand a rig build or rig-parts/rig-pose output to a person for local inspection and retrieve their structured feedback with rig-review (@rig-c/review). Validate the delivery package (rig-review check), guide a person through parts and mesh, the Create choice interview, rig and animation, and direction, start or reuse a loopback inspection workspace and print its capability URL (rig-review open), read back submitted verdicts, frame intervals, stage-comment crop PNGs and applied producer edits (rig-review feedback --format json|issue), export comparison or feedback frame strips headlessly (rig-review strip), or steer an opted-in open page (rig-review control). Not for compiling a rig (use rigc or rig-parts) or grading a rig without a person's submission.
4
4
  license: MIT
5
5
  compatibility: Requires Bun 1.3.0 or later on PATH. The canonical npm package is @rig-c/review (npm i -D @rig-c/review, or bun add -d @rig-c/review; rig-review is the convenience install name); the command it installs is rig-review, and @rig-c/play is installed as a dependency.
6
6
  ---
7
7
 
8
8
  # rig-review — human inspection handoff and feedback retrieval
9
9
 
10
- Load this when a rig or animation is **ready for a person to inspect**, or when
11
- the person has submitted a review and you need to **read back what they asked to
12
- change**. The workspace's reader is a person in a browser; this file states what
13
- an agent can actually drive from the CLI, what only the person does, and where
14
- every rule lives.
10
+ Use this to hand separated parts, a rig or a post to a person for inspection,
11
+ or to read back their submitted review.
15
12
 
16
13
  ## What an agent drives vs. what the person drives
17
14
 
18
- 1. **Validate and hand off (agent):**
15
+ Use the installed CLI. For compiled packages, run `rig-review check <package>`
16
+ before handoff to validate the package and read its source SHA-256. Use managed
17
+ `rig-review open` for joined inspection and embedded saves. Give the reviewer
18
+ its URL from stdout privately and keep the exact feedback command from stderr.
19
+ The stage buttons navigate within that source binding.
20
+
21
+ 1. **Parts + mesh.** Open the recorded Create draft's compiled check directory.
22
+ The picks and verdict directories must already exist inside the project,
23
+ separate from its inputs.
24
+ ```sh
25
+ rig-review open <draft-check-dir> --project <project> --project-draft <id> --picks-dir <picks-dir> --parts-verdict-dir <verdict-dir>
26
+ ```
27
+ The person inspects separated parts and their mapped draft meshes, leaves
28
+ notes or described corrections, and inspects scratch results when available.
29
+ Mesh Apply requires an eligible handoff and an installed producer that
30
+ supports the declared operation. If Apply is unavailable, report the named
31
+ refusal. Read the **Save sign-off** verdict from the designated directory,
32
+ including the original source binding, part and mesh outcomes and notes. Keep it at its saved location. An approved,
33
+ current verdict is evidence for Create's `parts-review` sign-off. Draft
34
+ geometry is structure evidence. Without a
35
+ compatible draft, `rig-review parts <parts> --verdict <output-file>` provides
36
+ standalone inspection and named limits on direct correction.
37
+ 2. **Interview.** In the joined draft workspace choose **2 Interview**. For
38
+ choices bound to a recorded rig, open its package with the Stage 3 command.
39
+ The standalone entry is `rig-review interview <project> --picks-dir <picks-dir>`.
40
+ Beside the bound parts or source image, the person chooses among the saved
41
+ options with the agent's recommendation and rationale, then uses
42
+ **Save explicit picks**. Read the `rig-review/interview-picks@1` file for the
43
+ exact question set, including the person's picks and note. Ingest it in
44
+ Create for the `rigging-interview` or `post-interview` sign-off as appropriate.
45
+ Other and Auto can remain pending. Follow [Create's interview guide](https://github.com/rig-c/create/blob/main/docs/INTERVIEW.md).
46
+ 3. **Rig + animation.** Open the recorded rig version's materialized package
47
+ and choose **3 Rig + animation**.
19
48
  ```sh
20
- npx rig-review check /absolute/path/to/output
21
- npx rig-review open /absolute/path/to/output [--reference /abs/video.mp4] [--compare /abs/other] [--animation <name>] [--config /abs/config.json [--parts <dir>] [--source <png> --full <dir> [--head <dir>]] [--keypoints <file>]] [--control]
49
+ rig-review open <rig-package> --project <project> --project-version <rig> --picks-dir <picks-dir>
22
50
  ```
23
- `check` verifies the delivery contract and source SHA-256 without starting a
24
- server. `open` starts or reuses a loopback worker behind the managed front
25
- (`127.0.0.1:4318`, or `--direct`), prints the writable `#cap=…` URL alone on
26
- stdout for the person to open, and prints the exact matching
27
- `rig-review feedback …` command on stderr — [Owner handoff](https://github.com/rig-c/review/blob/main/docs/WORKFLOWS.md#one-command-owner-handoff).
28
- 2. **Inspect, rebuild in scratch and submit (person in the browser):**
29
- `rig-review` never opens a browser itself. Only the person holding the
30
- `#cap=…` tab can inspect panels, run `Apply · Rebuild` through the installed
31
- producer (`rig-parts`, `rig-pose`) into scratch, place, read or edit **Comment · C (n)** crops,
32
- choose **approved** or **changes-requested** in **Write review**, and click
33
- **Submit review** — [Feedback ownership](https://github.com/rig-c/review/blob/main/docs/WORKFLOWS.md#feedback-ownership).
34
- 3. **Act on what comes back (agent):**
51
+ The person inspects setup and motion, marks details with **Comment · C (n)**,
52
+ and can Apply · Rebuild supported edits through the installed producer in
53
+ scratch. They choose **approved** or **changes-requested** and submit in
54
+ **Write review**. Run the printed feedback command with `--format json`.
55
+ Read the status, reviewed source and tool versions, frame intervals and
56
+ targets, comments and crop paths, and recorded Apply data. Inspect the
57
+ actual producer check and named refusals even if the UI shows a rebuild or
58
+ an applied badge. Report which clip, frames and edits were actually verified.
59
+ The submitted feedback informs the versioned Create verdict and
60
+ `rig-review` sign-off.
61
+ 4. **Direction.** Open the rig package with the post that explicitly names
62
+ that rig and binds its authored direction.
35
63
  ```sh
36
- npx rig-review feedback /absolute/path/to/output [...same flags as open...] [--format json|issue]
37
- npx rig-review strip /absolute/path/to/output --reference-video /abs/video.mp4 --animation <name> (--frames FIRST:LAST | --all-feedback) [--json] [--out /abs/outside/strip.png]
64
+ rig-review open <rig-package> --project <project> --project-version <rig> --picks-dir <picks-dir> --post-version <post>
38
65
  ```
39
- Read `status` (`pending` means the person has not submitted yet; opening
40
- never approves), `reviewedSource` (rig/motion SHA-256 and tool versions),
41
- `applied` (the exact config patches, pose-map/retarget flags and producer
42
- lines the person applied in scratch), `feedback` (inclusive frame intervals,
43
- bone/slot/rig targets, `defect`|`quality` category and summary), and
44
- `comments` (pin/box coordinates, nearest drawn slots, and derived crop PNG
45
- paths under `~/.local/state/rig-c-review/` that you can open directly without
46
- a browser). Apply the requested fixes in the upstream producer (`rig-parts`,
47
- `rig-pose` or `rigc`), rebuild, and run `rig-review open` again.
48
- 4. **Optional live view steering (agent, only while the person's tab is open):**
49
- When opened with `--control` and a browser tab is connected,
50
- `npx rig-review control <dir> [...same flags...] [--page <id> --expected-revision <n> --request-id <id> --command <JSON>]`
51
- reads or steers camera, time, animation and layers; it cannot submit or
52
- approve a review or mutate source files — [Control](https://github.com/rig-c/review/blob/main/docs/WORKFLOWS.md#control-the-current-inspection-page).
66
+ In **4 Direction**, the person reviews framing, depth and timing, inspects
67
+ authored camera keys and timing read-only, and submits their decision or
68
+ described correction for the selected post. Camera Apply is
69
+ `CAMERA_APPLY_UNSUPPORTED`. Read back the submitted feedback with the printed
70
+ command and match the post, direction and model bindings before handing it
71
+ to Create for that version's verdict and `direction-review` sign-off.
72
+
73
+ Create owns answer ingestion, review verdicts and signatures. Follow
74
+ [Create's sign-off contract](https://github.com/rig-c/create/blob/main/docs/PROJECT.md#recording-a-sign-off)
75
+ and [version targets](https://github.com/rig-c/create/blob/main/docs/PROJECT.md#targets-of-review-signatures).
76
+ Opening, navigating and saving Review records confer no Create authority.
77
+
78
+ ## Correction readback
79
+
80
+ In **Write review**, the person marks the feedback as described or made under
81
+ **Correction handoff**, supplies the Create selector, and submits. Look for an
82
+ explicit `context.correction` in submitted feedback. Its selector
83
+ must identify the Create draft, rig or post. For a post it also carries the
84
+ model path. Use the printed `rig-review feedback` command, preserving its
85
+ handoff arguments, and append `--correction <item-id> --format issue` for the
86
+ selected handoff or `--correction <item-id> --format json` for the saved session.
87
+
88
+ - **Described.** Read the exact words, source selector and inspection context.
89
+ Standalone parts notes and comments instead use
90
+ `rig-review parts <parts> --verdict <output-file> --correction <item-id> --parts-file <inventory> --format issue`.
91
+ Add `--part-note <part>` for a part note. Preserve the words byte for byte and
92
+ hand the request to Create as open. For authored direction verify the exported
93
+ `createSource` against the selected post, direction and model before import.
94
+ Address the request upstream, rebuild, and return the new revision for review.
95
+ - **Made.** Read the selected item's `context.applied` and retain the exact
96
+ session and item ID. Check the producer line, input and result bindings and
97
+ actual check before claiming a checked scratch result. Require exit zero, a
98
+ passing gate and at least one PASS bar. Report missing, stale or failed
99
+ evidence with its refusal. For an unsupported operation, retain the original
100
+ evidence and named refusal. For a supported checked handoff, record it in
101
+ Create as pending, then reproduce the edit through the producer on the bound
102
+ inputs and verify the resulting revision. A pending record supplies no closure or
103
+ acceptance.
104
+
105
+ Follow [Review's correction handoff](https://github.com/rig-c/review/blob/main/docs/WORKFLOWS.md#correction-handoff),
106
+ including the [authored direction binding](https://github.com/rig-c/review/blob/main/docs/REVIEW_PACKAGE.md#correction-handoff),
107
+ and [Create's correction contract](https://github.com/rig-c/create/blob/main/docs/PROJECT.md#correction-paths-described-and-made).
53
108
 
54
109
  ## Non-negotiables
55
110
 
56
111
  - **Supplied packages and models stay immutable.** Review never edits
57
- `motion.json`, `skeleton.model.json` or source art; producer edits run in
58
- scratch and feedback is stored under `~/.local/state/rig-c-review/` (or
59
- `RIG_REVIEW_STATE_DIR` outside every input package) bound to the exact content
60
- SHA-256 — [REVIEW_PACKAGE.md](https://github.com/rig-c/review/blob/main/docs/REVIEW_PACKAGE.md).
61
- - **Pass the exact handoff flags to `feedback` and `control`.** `--reference`,
62
- `--compare`, `--animation` and `--config` (`--parts`, `--source`, `--full`,
63
- `--head`, `--keypoints`) are hashed into the session identity; omitting one
64
- reads a different session, and changing any input byte starts a fresh
65
- `pending` session — [WORKFLOWS.md](https://github.com/rig-c/review/blob/main/docs/WORKFLOWS.md#one-command-owner-handoff).
112
+ `motion.json`, `skeleton.model.json` or source art. Producer edits run in
113
+ scratch. Keep every input unchanged, including producer config, parts,
114
+ requirements and authored animation files. Use dedicated output paths for
115
+ picks, verdicts and exports. A verdict destination must never alias an input
116
+ through a symlink or hard link (`PARTS_VERDICT_INPUT_COLLISION`). Feedback
117
+ binds to the exact content SHA-256 and stays under `~/.local/state/rig-c-review/`
118
+ (or `RIG_REVIEW_STATE_DIR` outside every input package) — [REVIEW_PACKAGE.md](https://github.com/rig-c/review/blob/main/docs/REVIEW_PACKAGE.md).
119
+ - **Keep the exact handoff inputs for `feedback` and `control`.** Reuse the
120
+ printed lookup arguments, including reference, comparison, animation,
121
+ producer and joined Create selectors as applicable. A changed bound input
122
+ needs a fresh session. `pending` conveys no approval.
66
123
  - **Never leak the `#cap=` fragment into public logs or commits.** The fragment
67
124
  is the per-instance 256-bit write capability; share it only with the person
68
125
  reviewing on the local machine — [Managed front](https://github.com/rig-c/review/blob/main/docs/WORKFLOWS.md#managed-front-and-write-capability).
@@ -71,19 +128,17 @@ every rule lives.
71
128
  report plus `ffmpeg` (≥ 5.1) and `ffprobe` on `PATH` for PNG video decoding —
72
129
  [Frame strip export](https://github.com/rig-c/review/blob/main/docs/WORKFLOWS.md#frame-strip-export).
73
130
 
74
- ## Read, in this order
131
+ ## Optional CLI and references
75
132
 
76
- 1. [docs/WORKFLOWS.md](https://github.com/rig-c/review/blob/main/docs/WORKFLOWS.md) —
77
- `open`, `check`, `compare`, `feedback` (`--format json|issue`), `strip`,
78
- `control`, the launcher stdout/stderr/exit-code contract and `OPEN_*` /
79
- `FRONT_*` refusal codes.
80
- 2. [docs/REVIEW_PACKAGE.md](https://github.com/rig-c/review/blob/main/docs/REVIEW_PACKAGE.md) —
81
- folder discovery (`skeleton.model.json`, `build/skeleton.model.json`, and
82
- `rig-parts build` roots), `review.json`, producer handoff (`HANDOFF_*`),
83
- session/feedback schema and historical retrieval.
84
- 3. [docs/PANELS.md](https://github.com/rig-c/review/blob/main/docs/PANELS.md) and
85
- [docs/ANIMATION_INSPECTION.md](https://github.com/rig-c/review/blob/main/docs/ANIMATION_INSPECTION.md) —
86
- what each browser panel writes into `applied`, `feedback` and `comments`.
87
-
88
- Every guide linked above ships in the installed package under
89
- `node_modules/@rig-c/review/docs/`, matching the installed version.
133
+ - With `rig-review open <package> --control` and the person's tab connected,
134
+ `rig-review control <package>` with the same binding arguments reads or
135
+ steers the inspection view. The person retains submission authority.
136
+ [Control](https://github.com/rig-c/review/blob/main/docs/WORKFLOWS.md#control-the-current-inspection-page).
137
+ - `rig-review strip <package> --reference <declared-video-id> --animation <name> --frames FIRST:LAST --out <new-png>`
138
+ exports an inclusive interval. Use `--all-feedback` in place of `--frames`
139
+ for saved intervals, or `--json` for the selection/provenance plan.
140
+ [Frame strip export](https://github.com/rig-c/review/blob/main/docs/WORKFLOWS.md#frame-strip-export).
141
+ - Read [WORKFLOWS](https://github.com/rig-c/review/blob/main/docs/WORKFLOWS.md)
142
+ for launcher and refusal details, [REVIEW_PACKAGE](https://github.com/rig-c/review/blob/main/docs/REVIEW_PACKAGE.md)
143
+ for source and feedback bindings, and [PANELS](https://github.com/rig-c/review/blob/main/docs/PANELS.md)
144
+ for inspection controls. Review guides ship under `node_modules/@rig-c/review/docs/`.
package/src/rebuild.ts CHANGED
@@ -20,6 +20,7 @@ import { meshEditText } from './mesh-edit.ts';
20
20
  import { CONFIG_NAMED_FILES, CONFIG_SKELETON_NAMES, HANDOFF_DECLARATION, type Handoff, type HandoffRecord } from './handoff.ts';
21
21
  import { assertWholeRigBaseline, BaselineError, baselineKey, producerDiff, runBaseline, runInspectedCheck, runningInspectedCheck, type BaselineResult, type InspectedCheck } from './baseline.ts';
22
22
  import { applyConfigPatch, assertOpNames, assertPatchFresh, ConfigPatchError, parseConfigPatch, PATCH_FLAGS, patchSha256, patchText, remeshPart, type ConfigPatch, type JsonValue } from './config-patch.ts';
23
+ import { barLine } from './physics-tuning.ts';
23
24
  import { checkSummary, filesDiffText, MAX_ANIMATION_OPS, MAX_RETARGET_LINES, type CheckSummary, type FilesDiff } from './applied-context.ts';
24
25
  import { AnimationOpBuilder, animationOpsText, parseAnimationSourceOp, type AnimationSourceOp } from './animation-ops.ts';
25
26
  import { idleKeying, idleSource, type IdleStatus } from './idle-tracks.ts';
@@ -279,7 +280,7 @@ export interface AppliedEntry {
279
280
  job: RebuildJob | PatchJob | DeltaJob | RetargetJob | AnimationJob;
280
281
  }
281
282
  /** `GET /api/rebuild/history`: the applied records in order, the last one on the stage; `kept`: its build is still on disk. */
282
- export interface AppliedHistory { schema: 'rig-review-applied-history/1'; depth: number; records: { id: string; kind: 'regions' | 'patch' | 'delta' | 'retarget' | 'animation'; op: string; what: string; modelHash: string; kept: boolean }[] }
283
+ export interface AppliedHistory { schema: 'rig-review-applied-history/1'; depth: number; records: { id: string; kind: 'regions' | 'patch' | 'delta' | 'retarget' | 'animation'; op: string; what: string; modelHash: string; kept: boolean; check?: CheckSummary | null; failedBarLines?: string[] }[] }
283
284
 
284
285
  export type RebuildStatus = 'running' | 'built' | 'refused' | 'failed';
285
286
  export interface RebuildBuild { model: string; modelUrl: string; modelHash: string; files: Record<string, string> }
@@ -1079,7 +1080,15 @@ export function createRebuilds(p: ReviewPackage, options: RebuildOptions) {
1079
1080
  : job.kind === 'animation' ? `${job.request.ops.length} op(s) on ${[...new Set(job.request.ops.map(o => o.animation))].join(', ')}`
1080
1081
  : `retarget "${job.request.record.flags.animation}"`;
1081
1082
  const kept = await exists(join(last ? rebuildRoot(options.stateDir, p.sourceHash) : keptRoot(options.stateDir, p.sourceHash), e.id));
1082
- records.push({ id: e.id, kind, op: 'op' in job ? job.op : 'remesh', what, modelHash: e.modelHash, kept });
1083
+ const check = 'check' in job ? job.check : undefined;
1084
+ const failedBarLines = Object.entries(check?.bars ?? {})
1085
+ .filter(([, status]) => status === 'FAIL')
1086
+ .map(([name]) => barLine(name, job.lines, check ?? null));
1087
+ records.push({
1088
+ id: e.id, kind, op: 'op' in job ? job.op : 'remesh', what, modelHash: e.modelHash, kept,
1089
+ ...(check !== undefined ? {check} : {}),
1090
+ ...(failedBarLines.length ? {failedBarLines} : {}),
1091
+ });
1083
1092
  }
1084
1093
  return { schema: 'rig-review-applied-history/1', depth: stack.length, records };
1085
1094
  }
package/web/catalog-en.ts CHANGED
@@ -1,4 +1,9 @@
1
1
  export const enCatalog: Readonly<Record<string, string>> = {
2
+ "Producer check passed": "Producer check passed",
3
+ "Producer check failed": "Producer check failed",
4
+ "Producer check unavailable": "Producer check unavailable",
5
+ "Check failed": "Check failed",
6
+ "Check unavailable": "Check unavailable",
2
7
  "RIG_VERSION_UNAVAILABLE: this draft has no recorded rig review package.": "RIG_VERSION_UNAVAILABLE: this draft has no recorded rig review package.",
3
8
  "DIRECTION_VERSION_UNAVAILABLE: this draft has no recorded rig review package.": "DIRECTION_VERSION_UNAVAILABLE: this draft has no recorded rig review package.",
4
9
  "PARTS_VERDICT_READ_ONLY: a pending parts review and an explicit verdict output directory are required.": "PARTS_VERDICT_READ_ONLY: a pending parts review and an explicit verdict output directory are required.",
package/web/catalog-ko.ts CHANGED
@@ -1,4 +1,9 @@
1
1
  export const koCatalog: Readonly<Record<string, string>> = {
2
+ "Producer check passed": "프로듀서 검사 통과",
3
+ "Producer check failed": "프로듀서 검사 실패",
4
+ "Producer check unavailable": "프로듀서 검사 결과 없음",
5
+ "Check failed": "검사 실패",
6
+ "Check unavailable": "검사 결과 없음",
2
7
  "RIG_VERSION_UNAVAILABLE: this draft has no recorded rig review package.": "RIG_VERSION_UNAVAILABLE: 이 초안에는 기록된 리그 검토 패키지가 없습니다.",
3
8
  "DIRECTION_VERSION_UNAVAILABLE: this draft has no recorded rig review package.": "DIRECTION_VERSION_UNAVAILABLE: 이 초안에는 기록된 리그 검토 패키지가 없습니다.",
4
9
  "PARTS_VERDICT_READ_ONLY: a pending parts review and an explicit verdict output directory are required.": "PARTS_VERDICT_READ_ONLY: 대기 중인 파츠 검토와 명시적으로 지정한 판정 출력 디렉터리가 필요합니다.",
@@ -42,7 +42,7 @@ import { bindRequirementsPanel, type RequirementsCatalogView, type RequirementsJ
42
42
  import { bindRetargetPanel, type PoseMap, type RetargetPanel } from './retarget-panel.ts';
43
43
  import type { RetargetFlags } from '../src/retarget.ts';
44
44
  import {
45
- historyRow, isPatchJob, recordFor, refusedText, restoredOutcomeForJob, retargetStage, undoControl,
45
+ appliedCheckState, renderAppliedHistory, isPatchJob, recordFor, refusedText, restoredOutcomeForJob, retargetStage, undoControl,
46
46
  animationAppliedRecord, animationOutcomeLine, appliedRecord, deltaAppliedRecord, deltaOutcomeLine, chestSeed, designatedRegions, handoffText,
47
47
  landmarksRequest, noContourReason, seedLandmarks, makePatch, outcomeLine, patchAppliedRecord, patchOutcomeLine,
48
48
  pickBustPart, pickPart, runRebuild, seedFields, stageModel, retargetAppliedRecord, retargetOutcomeLine, stripPendingAfter,
@@ -837,7 +837,9 @@ export function mountComparePickedTools(host: ComparePickedToolsHost): ComparePi
837
837
  const on = appliedPanelOps(state.appliedOnStage);
838
838
  cutsPanel?.applied(on.cuts); clothPanel?.applied(on.cloth);
839
839
  physicsPanel?.applied(on.physics); bonesPanel?.applied(on.bones);
840
- idlePanel?.applied(on.idle); rigFieldsPanel?.applied(on['rig-fields']);
840
+ const applied = state.appliedOnStage;
841
+ idlePanel?.applied(on.idle, appliedCheckState(applied && 'check' in applied ? applied.check : null));
842
+ rigFieldsPanel?.applied(on['rig-fields']);
841
843
  const restored = restoredJob ? restoredOutcomeForJob(restoredJob) : null;
842
844
  animationPanel?.reconcileStageApplied(
843
845
  state.appliedOnStage?.schema === 'rig-review-applied/5' ? state.appliedOnStage : null,
@@ -905,13 +907,7 @@ export function mountComparePickedTools(host: ComparePickedToolsHost): ComparePi
905
907
  const state = currentState(), h = state.appliedHistory;
906
908
  section.hidden = !h || h.depth === 0;
907
909
  const list = el('applied-list');
908
- list.replaceChildren(...(h?.records ?? []).map((r, i) => {
909
- const li = document.createElement('li');
910
- li.textContent = historyRow(h!, i);
911
- li.dataset.buildId = r.id;
912
- li.classList.toggle('on-stage', i === h!.records.length - 1 && state.appliedOnStage?.buildId === r.id);
913
- return li;
914
- }));
910
+ renderAppliedHistory(list, h, state.appliedOnStage?.buildId ?? null);
915
911
  const control = undoControl(h, state.appliedOnStage?.buildId ?? null, rebuildBusy || !!host.readOnly());
916
912
  const undo = button('applied-undo');
917
913
  undo.textContent = control.label; undo.disabled = !control.enabled; undo.title = control.title;
@@ -1582,7 +1578,6 @@ export function mountComparePickedTools(host: ComparePickedToolsHost): ComparePi
1582
1578
  const outcome = patchOutcomeLine(result);
1583
1579
  if (pickedSide === side) idlePanel?.status(outcome.text, outcome.error);
1584
1580
  if ('id' in result && result.status === 'built') {
1585
- if (pickedSide === side) idlePanel?.applied(result.request.patch.ops);
1586
1581
  const after = { lines: [...result.lines], check: result.check };
1587
1582
  const show = () => { if (pickedSide === side) idlePanel?.readout(readoutRows(before, before ? null : inspectedCheckView(side), after, IDLE_READOUT_BARS)); };
1588
1583
  show(); if (!before) void followInspectedCheck(show, side);
package/web/idle-panel.ts CHANGED
@@ -42,7 +42,7 @@ export interface IdlePanel {
42
42
  previewing():{on:boolean;label:string;plan:PreviewPlan|null};
43
43
  setPreview(on:boolean):void;
44
44
  restore():void;clear():void;
45
- applied(ops:readonly PatchOp[]|null):void;
45
+ applied(ops:readonly PatchOp[]|null,check?:IdleOpCheck):void;
46
46
  status(text:string,error:boolean):void;
47
47
  readout(lines:{name:string;before:string;after:string}[]):void;
48
48
  busy(value:boolean):void;
@@ -59,6 +59,24 @@ export const PREVIEW_LABEL='preview — Apply decides';
59
59
  const DEG_PER_PX=0.02;
60
60
  const THUMB=14;
61
61
 
62
+ type IdleOpCheck = 'passed'|'failed'|'unavailable';
63
+
64
+ export function renderIdlePendingRow(op:PatchOp,check:IdleOpCheck|null,busy:boolean,revertOp:()=>void):HTMLLIElement {
65
+ const revert=make('button',{type:'button',textContent:'Revert',disabled:busy});
66
+ revert.setAttribute('aria-label',`Revert ${op.op} ${op.path}`);
67
+ revert.onclick=revertOp;
68
+ const row=make('li',{className:check==='passed'?'applied':''},make('code',{textContent:`${op.op} ${op.path}`}),op.op==='remove'?'':` → ${JSON.stringify(op.value)}`);
69
+ if(check){
70
+ const label=check==='failed'?'Check failed':'Check unavailable';
71
+ // Keep the separator with the status so i18n recognizes the existing prose atom.
72
+ const state=make('span',{textContent:check==='passed'?' · applied':' · '+label});
73
+ state.dataset.idleOpCheck=check;
74
+ row.append(state);
75
+ }
76
+ row.append(revert);
77
+ return row;
78
+ }
79
+
62
80
  export function bindIdlePanel(deps:IdlePanelDeps):IdlePanel {
63
81
  const stateLine=node('idle-tracks-state'),keysLine=node('idle-keys-line'),list=node('idle-track-list'),editor=node('idle-track-editor'),blinkArea=node('idle-blink'),precheckArea=node('idle-precheck'),pending=node('idle-pending-list');
64
82
  const applyButton=node<HTMLButtonElement>('idle-apply'),resetButton=node<HTMLButtonElement>('idle-reset'),status=node('idle-apply-status'),readoutArea=node('idle-readout'),draft=node<HTMLTextAreaElement>('idle-pending'),label=node('idle-preview-label');
@@ -167,13 +185,12 @@ export function bindIdlePanel(deps:IdlePanelDeps):IdlePanel {
167
185
  precheckArea.replaceChildren(...lines.map(l=>make('code',{className:'error idle-refusal',textContent:l,title:l})),...previewNotes.map(l=>make('code',{className:'idle-note',textContent:l,title:l})));
168
186
  return lines;
169
187
  }
188
+ let appliedCheck:IdleOpCheck='unavailable';
170
189
  function renderPending(){
171
190
  const items=ops();
172
191
  pending.replaceChildren(...items.map((op,i)=>{
173
192
  const applied=appliedOps.includes(JSON.stringify(op));
174
- const revert=make('button',{type:'button',textContent:'Revert',disabled:busy});revert.setAttribute('aria-label',`Revert ${op.op} ${op.path}`);
175
- revert.onclick=()=>tryChange(()=>revertOp(i));
176
- return make('li',{className:applied?'applied':''},make('code',{textContent:`${op.op} ${op.path}`}),op.op==='remove'?'':` → ${JSON.stringify(op.value)}`,applied?' · applied':'',revert);
193
+ return renderIdlePendingRow(op,applied?appliedCheck:null,busy,()=>tryChange(()=>revertOp(i)));
177
194
  }));
178
195
  if(!items.length)pending.append(make('li',{className:'hint',textContent:'No pending ops.'}));
179
196
  const refused=renderPrecheck().length>0;
@@ -268,7 +285,7 @@ export function bindIdlePanel(deps:IdlePanelDeps):IdlePanel {
268
285
  setPreview(on){previewBox.checked=on;previewBox.dispatchEvent(new Event('change'));},
269
286
  restore(){if(source){state=idleDraftState(draft.value,source);render();}},
270
287
  clear(){stopPreview();if(source){state=initialState(source);save();}render();},
271
- applied(list){appliedOps=(list??[]).map(o=>JSON.stringify(o));renderPending();},
288
+ applied(list,check='unavailable'){appliedOps=(list??[]).map(o=>JSON.stringify(o));appliedCheck=check;renderPending();},
272
289
  status:panelStatus,
273
290
  readout(lines){readoutArea.replaceChildren(...lines.flatMap(l=>[make('div',{className:'physics-readout-line'},make('span',{className:'eyebrow',textContent:'BEFORE'}),make('code',{textContent:l.before,title:l.before})),make('div',{className:'physics-readout-line'},make('span',{className:'eyebrow',textContent:'AFTER'}),make('code',{textContent:l.after,title:l.after}))]));},
274
291
  busy(value){busy=value;render();},
package/web/main.ts CHANGED
@@ -31,7 +31,7 @@ import {bindClothPanel,type ClothPanel} from './cloth-panel.ts';
31
31
  import {animationAppliedRecord,animationOutcomeLine,retargetAppliedRecord,retargetOutcomeLine,stripPendingAfter,type AnimationJobView,type AnimationRequestBody,type AnimationSourceOp,type StageChange,type AppliedAnimation,type AppliedRetarget,type RetargetJobView,type RetargetRequestBody} from './rebuild-client.ts';
32
32
  import {bindRetargetPanel,type PoseMap,type RetargetPanel} from './retarget-panel.ts';
33
33
  import type {RetargetFlags} from '../src/retarget.ts';
34
- import {historyRow,isPatchJob,recordFor,refusedText,restoredOutcomeForJob,retargetStage,undoControl,type AppliedHistoryView,type UndoView,type AnyJobView,appliedRecord,deltaAppliedRecord,deltaOutcomeLine,chestPartFields,chestStatusForPart,chestSeed,designatedRegions,handoffText,landmarksRequest,noContourReason,seedLandmarks,makePatch,outcomeLine,patchAppliedRecord,patchOutcomeLine,pickBustPart,pickPart,runRebuild,seedFields,stageModel,type AppliedDelta,type AppliedPatch,type AppliedRecord,type DeltaJobView,type DeltaRequestBody,type ConfigPatch,type PatchJobView,type RebuildJobView,type RebuildRefusal,type RebuildRequestBody,type RebuildStatusView} from './rebuild-client.ts';
34
+ import {appliedCheckState,renderAppliedHistory,isPatchJob,recordFor,refusedText,restoredOutcomeForJob,retargetStage,undoControl,type AppliedHistoryView,type UndoView,type AnyJobView,appliedRecord,deltaAppliedRecord,deltaOutcomeLine,chestPartFields,chestStatusForPart,chestSeed,designatedRegions,handoffText,landmarksRequest,noContourReason,seedLandmarks,makePatch,outcomeLine,patchAppliedRecord,patchOutcomeLine,pickBustPart,pickPart,runRebuild,seedFields,stageModel,type AppliedDelta,type AppliedPatch,type AppliedRecord,type DeltaJobView,type DeltaRequestBody,type ConfigPatch,type PatchJobView,type RebuildJobView,type RebuildRefusal,type RebuildRequestBody,type RebuildStatusView} from './rebuild-client.ts';
35
35
  import {meshEditBinding,meshEditText,type MeshEditDocument} from '../src/mesh-edit.ts';
36
36
  import {chestRegionsBinding,cropWorldMapping,type CropWorldMapping} from '../src/chest-regions.ts';
37
37
  import {bindWorkspaceUI,selectedInspector,type WorkspaceUI} from './workspace-ui.ts';
@@ -1619,7 +1619,8 @@ function renderAppliedBlocks(restoredJob:AnyJobView|null=null):void {
1619
1619
  const on=appliedPanelOps(appliedOnStage);
1620
1620
  cutsPanel?.applied(on.cuts);clothPanel?.applied(on.cloth);
1621
1621
  physicsPanel?.applied(on.physics);bonesPanel?.applied(on.bones);
1622
- idlePanel?.applied(on.idle);rigFieldsPanel?.applied(on['rig-fields']);
1622
+ idlePanel?.applied(on.idle,appliedCheckState(appliedOnStage&&'check' in appliedOnStage?appliedOnStage.check:null));
1623
+ rigFieldsPanel?.applied(on['rig-fields']);
1623
1624
  const restored=restoredJob?restoredOutcomeForJob(restoredJob):null;
1624
1625
  animationPanel?.reconcileStageApplied(
1625
1626
  appliedOnStage?.schema==='rig-review-applied/5'?appliedOnStage:null,
@@ -1682,7 +1683,7 @@ function renderApplied():void {
1682
1683
  renderAppliedBlocks();
1683
1684
  const section=document.getElementById('applied-records');if(!section)return;
1684
1685
  const h=appliedHistory;section.hidden=!h||h.depth===0;
1685
- const list=el('applied-list');list.replaceChildren(...(h?.records??[]).map((r,i)=>{const li=document.createElement('li');li.textContent=historyRow(h!,i);li.dataset.buildId=r.id;li.classList.toggle('on-stage',i===h!.records.length-1&&appliedOnStage?.buildId===r.id);return li;}));
1686
+ renderAppliedHistory(el('applied-list'),h,appliedOnStage?.buildId??null);
1686
1687
  const control=undoControl(h,appliedOnStage?.buildId??null,rebuildBusy||!!readOnly),undo=button('applied-undo');
1687
1688
  undo.textContent=control.label;undo.disabled=!control.enabled;undo.title=control.title;
1688
1689
  }
@@ -2126,7 +2127,6 @@ async function applyIdle(ops:PatchOp[],keys:'ctl'|'direct'|null):Promise<PatchJo
2126
2127
  const result=await applyPatch(patch,world);
2127
2128
  const outcome=patchOutcomeLine(result);idlePanel?.status(outcome.text,outcome.error);
2128
2129
  if('id' in result&&result.status==='built'){
2129
- idlePanel?.applied(result.request.patch.ops);
2130
2130
  const after={lines:[...result.lines],check:result.check};
2131
2131
  const show=()=>idlePanel?.readout(readoutRows(before,before?null:inspectedCheckView(),after,IDLE_READOUT_BARS));
2132
2132
  show();if(!before)void followInspectedCheck(show);
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * Apply · Rebuild, page side (#99): the chest editor's rows become the producer's region entries, one typed request
3
- * goes to `/api/rebuild`, the job's lines stream back by polling, and the applied state is recorded. No DOM here
4
- * (main.ts owns the elements and the player); the server owns every path and the producer's flags.
3
+ * goes to `/api/rebuild`, the job's lines stream back by polling, and the applied state is recorded. The client formats
4
+ * the applied history for the page; the server owns every path and the producer's flags.
5
5
  */
6
+ import {setSourceText} from './i18n.ts';
6
7
  import {ellipsePolygon,fitChestEllipse,CHEST_ELLIPSE_MIN_POINTS} from '../src/chest-regions.ts';
7
8
  import {deriveBust,parseBustSpec,type BustSpec} from '../src/chest-landmarks.ts';
8
9
  import {CONFIG_PATCH_SCHEMA,type ConfigPatch,type PatchCmd,type PatchOp} from '../src/config-patch.ts';
@@ -359,7 +360,23 @@ export function handoffText(status:Pick<RebuildStatusView,'handoff'|'baseline'|'
359
360
  }
360
361
 
361
362
  /** #166: `GET /api/rebuild/history` — the session's applied records in order; the last is on the stage; `kept`: its build is on disk. */
362
- export interface AppliedHistoryView {schema:'rig-review-applied-history/1';depth:number;records:{id:string;kind:'regions'|'patch'|'delta'|'retarget'|'animation';op:string;what:string;modelHash:string;kept:boolean}[]}
363
+ export type AppliedHistoryView = import('../src/rebuild.ts').AppliedHistory;
364
+
365
+ export function appliedCheckState(check:CheckSummary|null|undefined):'passed'|'failed'|'unavailable' {
366
+ if(check?.pass==null)return 'unavailable';
367
+ return check.pass&&check.exitCode===0?'passed':'failed';
368
+ }
369
+
370
+ /** Write English source text so the DOM locale machinery can translate and switch languages in place. */
371
+ export function renderHistoryCheck(node:HTMLElement, record:AppliedHistoryView['records'][number]):void {
372
+ const state=appliedCheckState(record.check);
373
+ node.dataset.checkVerdict=state;
374
+ const label=state==='passed'?'Producer check passed':state==='failed'?'Producer check failed':'Producer check unavailable';
375
+ const failedBars=record.failedBarLines;
376
+ const details=state==='failed'&&failedBars?.length?failedBars
377
+ :state!=='passed'&&record.check?.line?[record.check.line]:[];
378
+ setSourceText(node,[label,...details].join(' · '));
379
+ }
363
380
  /** #166: `POST /api/rebuild/undo {from}` — the predecessor's build (kept, or re-run and still running), the inspected build, or a refusal. */
364
381
  export type UndoView=
365
382
  |{status:'inspected';undone:string;history:AppliedHistoryView}
@@ -386,6 +403,29 @@ export function historyRow(history:AppliedHistoryView,index:number):string {
386
403
  const r=history.records[index]!,last=index===history.records.length-1;
387
404
  return `${index+1}. ${r.kind} (${r.op}) · ${r.what} · model ${r.modelHash.slice(0,12)}…${last?' · on the stage':r.kept?'':' · build evicted, an undo to it re-runs its step'}`;
388
405
  }
406
+ export function renderAppliedHistory(list:HTMLElement,history:AppliedHistoryView|null,stageId:string|null):void {
407
+ const previousLast=(list.lastElementChild as HTMLElement|null)?.dataset.buildId;
408
+ const {scrollLeft,scrollTop}=list;
409
+ list.replaceChildren(...(history?.records??[]).map((record,index)=>{
410
+ const row=list.ownerDocument.createElement('li');
411
+ const verdict=list.ownerDocument.createElement('span');
412
+ row.dataset.buildId=record.id;
413
+ row.classList.toggle('on-stage',index===history!.records.length-1&&stageId===record.id);
414
+ renderHistoryCheck(verdict,record);
415
+ row.append(verdict,` · ${historyRow(history!,index)}`);
416
+ return row;
417
+ }));
418
+ if(previousLast===history?.records.at(-1)?.id){
419
+ list.scrollLeft=scrollLeft;
420
+ list.scrollTop=scrollTop;
421
+ }else{
422
+ // Single review stacks rows vertically. Compare lays them out horizontally.
423
+ const first=list.firstElementChild?.getBoundingClientRect();
424
+ const last=list.lastElementChild?.getBoundingClientRect();
425
+ list.scrollLeft=first&&last?last.left-first.left:0;
426
+ list.scrollTop=first&&last?last.top-first.top:0;
427
+ }
428
+ }
389
429
  /** #166: the Undo control's label and whether it can run: the depth, and what the stage returns to. */
390
430
  export function undoControl(history:AppliedHistoryView|null,stageId:string|null,busy:boolean):{label:string;enabled:boolean;title:string} {
391
431
  const depth=history?.depth??0,top=history?.records.at(-1)??null;
package/web/styles.css CHANGED
@@ -272,12 +272,15 @@ footer.status-bar{flex-wrap:nowrap}
272
272
  #stage-comment{white-space:nowrap;flex:none}#stage-comment-refusal{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.stage-comment-refusal-note{display:block;margin-top:4px;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;color:var(--fg-muted)}
273
273
  .inspector-body{display:flex;flex-direction:column;min-height:0;overflow:hidden}
274
274
  .inspector-body>[data-inspector-panel]{flex:1 1 0;min-height:0}
275
- .applied-records:not([hidden]){display:flex;align-items:center;gap:8px;padding:1px 10px;height:20px;min-height:20px;max-height:20px;box-sizing:border-box;overflow:hidden;flex:none}
275
+ .applied-records:not([hidden]){display:flex;align-items:center;gap:8px;padding:1px 10px;min-height:20px;box-sizing:border-box;overflow:hidden;flex:none}
276
276
  .applied-records .row{margin:0;flex:none;gap:6px}
277
277
  .applied-records button{padding:1px 6px;height:16px;font-size:9.5px;line-height:1}
278
- .applied-list{margin:0;max-height:18px;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:10px;overflow-x:auto;overflow-y:hidden;flex:1 1 auto;min-width:0}
279
- .applied-list li{font:9.5px/16px var(--font-mono);white-space:nowrap;flex:none}
280
- #applied-status{margin:0;flex:0 1 auto;min-width:0;font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
278
+ .applied-list{margin:0;max-height:64px;display:block;overflow-y:auto;flex:1 1 0;min-width:0}
279
+ .applied-list li{font:11px/16px var(--font-mono)}
280
+ .applied-list [data-check-verdict]{font-weight:600}
281
+ .applied-list [data-check-verdict="failed"],#idle-pending-list [data-idle-op-check="failed"]{color:var(--fail)}
282
+ .applied-list [data-check-verdict="passed"]{color:var(--pass)}
283
+ #applied-status{margin:0;flex:0 1 auto;max-width:30%;min-width:0;font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
281
284
  .inspector #inspector-playback{padding:3px 10px;box-sizing:border-box}
282
285
  .inspector #inspector-playback:not([hidden]){display:grid;grid-template-columns:minmax(0,1.55fr) minmax(320px,1fr);gap:10px;flex:1 1 0;min-height:0;overflow:hidden}
283
286
  .workspace-layout:has(>.parts-explorer) .inspector #inspector-playback:not([hidden]){grid-template-columns:minmax(0,2.2fr) minmax(220px,.85fr);gap:8px}