@rig-c/review 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/REVIEW_PACKAGE.md +32 -0
- package/package.json +1 -1
- package/src/cli.ts +1 -1
- package/src/correction-handoff.ts +30 -1
- package/src/feedback-export.ts +2 -2
- package/src/server.ts +2 -1
- package/web/catalog-en.ts +2 -0
- package/web/catalog-ko.ts +2 -0
- package/web/main.ts +11 -2
package/docs/REVIEW_PACKAGE.md
CHANGED
|
@@ -904,6 +904,38 @@ explicit handoff data. The package revision and inspector navigation do not
|
|
|
904
904
|
supply it. The named model path is data for Create and is never opened by
|
|
905
905
|
Review. Only explicitly marked correction rows can carry multiline text.
|
|
906
906
|
|
|
907
|
+
For a described request on a package with authored direction, use the
|
|
908
|
+
inspected compiled model's relative path as `modelFile` and explicitly select
|
|
909
|
+
the Create post number. Review checks the model path against the package and
|
|
910
|
+
refuses a described direction request captured on a scratch Apply. A promoted
|
|
911
|
+
stage comment keeps its original camera, inspection time and marked screen and
|
|
912
|
+
world regions. For unmarked feedback the export carries the saved inspection
|
|
913
|
+
view and a null marked region.
|
|
914
|
+
|
|
915
|
+
Use `rig-review feedback <package> --correction <item-id> --format issue`.
|
|
916
|
+
The issue JSON carries the exact human `verbatim`, `selectorArgs` and a
|
|
917
|
+
`createSource` string (JSON, at most 32 KiB) with the post number, inspected
|
|
918
|
+
model and direction path/hash pairs, package revision and source hash, and
|
|
919
|
+
inspection context. To import into Create:
|
|
920
|
+
|
|
921
|
+
1. With Create at [76a96dc](https://github.com/rig-c/create/commit/76a96dc528e07804a4df5e6c6e99ec5fc66b751c),
|
|
922
|
+
run `rig-create direction check <post> <project> --json`. Compare its
|
|
923
|
+
`post`, `direction` and `document.rig.model` to the matching fields in
|
|
924
|
+
the decoded `createSource`. Stop on any mismatch, including a different
|
|
925
|
+
post that uses the same compiled model.
|
|
926
|
+
2. Write the decoded `verbatim` to a UTF-8 file without trimming or appending
|
|
927
|
+
a newline. Run `rig-create correction record <project> --id <item-id>
|
|
928
|
+
--path described --stage direction-review --version <post>
|
|
929
|
+
--model-file <model-path> --by <reviewer> --verbatim-file <words>
|
|
930
|
+
--source <createSource> --json`. Pass the decoded `createSource` string
|
|
931
|
+
as one argument. The writer returns `rig-create/correction@2` with
|
|
932
|
+
`on.model` and `on.direction`, and an open description (`outcome: null`).
|
|
933
|
+
Create retains `source` as opaque text. Review runs no Create command.
|
|
934
|
+
|
|
935
|
+
Packages without authored direction continue to use their explicit legacy
|
|
936
|
+
selector. Direction patch Apply is unavailable. Existing supported rig and
|
|
937
|
+
draft Apply records keep their producer and result evidence.
|
|
938
|
+
|
|
907
939
|
A supported made item must match the server-owned settled Apply seal and
|
|
908
940
|
retained scratch model and pages when the item is added or changed and on
|
|
909
941
|
selected export. Older unchanged items remain saved as historical evidence
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -174,7 +174,7 @@ export async function main(args:string[],options:{stateDir?:string}={}){
|
|
|
174
174
|
await assertReviewUnchanged(p);
|
|
175
175
|
const rebuilds=createRebuilds(p,{stateDir,starts:[p.root,process.cwd()],unchanged:()=>assertReviewUnchanged(p),bones:p.feedbackCatalog.bones});
|
|
176
176
|
const settled=correction.path==='made'&&correction.selector.kind!=='post'?await rebuilds.correctionEvidence(appliedValue(item)):undefined;
|
|
177
|
-
const projected=projectSessionCorrection({...correction,session,sessionBytes:bytes,source,itemId:item.id,settled});
|
|
177
|
+
const projected=projectSessionCorrection({...correction,session,sessionBytes:bytes,source,itemId:item.id,settled,direction:p.direction});
|
|
178
178
|
if(projected.kind==='unsupported')console.error('CORRECTION_OPERATION_UNSUPPORTED: '+projected.operation);
|
|
179
179
|
process.stdout.write(format==='json'?bytes:formatCorrectionIssue(projected,item.context)+'\n');
|
|
180
180
|
return;
|
|
@@ -4,6 +4,8 @@ import { APPLIED_ANIMATION_SCHEMA, APPLIED_DELTA_SCHEMA, APPLIED_PATCH_SCHEMA, A
|
|
|
4
4
|
import { patchSha256, patchText } from './config-patch.ts';
|
|
5
5
|
import type { PartsVerdict } from './parts-view.ts';
|
|
6
6
|
import type { Feedback, ReviewSession } from './session.ts';
|
|
7
|
+
import type { DirectionInspection } from './direction-inspection.ts';
|
|
8
|
+
import { hasStageComment, parseStageComment } from './stage-comment.ts';
|
|
7
9
|
|
|
8
10
|
type Selector =
|
|
9
11
|
| { stage: 'parts-review'; kind: 'parts'; inventory: string }
|
|
@@ -34,6 +36,7 @@ type SessionInput = {
|
|
|
34
36
|
source: SessionSource;
|
|
35
37
|
selector: SessionSelector;
|
|
36
38
|
itemId: string;
|
|
39
|
+
direction?: DirectionInspection;
|
|
37
40
|
} & ({ path: 'described' } | { path: 'made'; settled?: SettledEvidence });
|
|
38
41
|
|
|
39
42
|
const hash = (value: string) => /^[a-f0-9]{64}$/.test(value);
|
|
@@ -116,7 +119,33 @@ export function projectSessionCorrection(input: SessionInput) {
|
|
|
116
119
|
if (matches.length !== 1 || !item) return refuse('CORRECTION_ITEM_INVALID', 'expected one saved feedback item');
|
|
117
120
|
const verbatim = itemWords(itemId, item.summary);
|
|
118
121
|
const common = { itemId, verbatim, stage: selector.stage, on, source, target: item.target };
|
|
119
|
-
if (input.path === 'described')
|
|
122
|
+
if (input.path === 'described') {
|
|
123
|
+
const direction = input.direction?.file;
|
|
124
|
+
if (selector.kind !== 'post' || !direction) return { ...common, kind: 'described' as const, outcome: null };
|
|
125
|
+
const model = source.reviewedSource.rig;
|
|
126
|
+
if (!model || selector.modelFile !== model.path || appliedValue(item) != null) {
|
|
127
|
+
return refuse('CORRECTION_DIRECTION_SOURCE', 'select the inspected compiled model and its authored direction');
|
|
128
|
+
}
|
|
129
|
+
const context = item.context as Record<string, unknown> | undefined;
|
|
130
|
+
const comment = hasStageComment(context?.comment) ? parseStageComment(context?.comment) : null;
|
|
131
|
+
const createSource = JSON.stringify({
|
|
132
|
+
source, post: selector.version, model, direction,
|
|
133
|
+
animation: comment ? comment.animation : context?.animation,
|
|
134
|
+
time: comment ? comment.time : context?.time,
|
|
135
|
+
sourceTime: context?.sourceTime,
|
|
136
|
+
frame: comment ? comment.frame : context?.frame,
|
|
137
|
+
interval: comment?.frame === null ? null : { frameStart: item.frameStart, frameEnd: item.frameEnd, inclusive: true },
|
|
138
|
+
target: item.target,
|
|
139
|
+
camera: comment ? comment.camera : context?.camera,
|
|
140
|
+
region: comment ? { viewport: comment.viewport, screen: comment.screen, world: comment.world } : null,
|
|
141
|
+
reference: comment ? { id: comment.referenceId, sha256: comment.referenceHash } : context?.reference,
|
|
142
|
+
view: context?.view,
|
|
143
|
+
});
|
|
144
|
+
if (Buffer.byteLength(createSource) > 32 * 1024) {
|
|
145
|
+
return refuse('CORRECTION_DIRECTION_CONTEXT_SIZE', 'direction correction source exceeds 32 KiB');
|
|
146
|
+
}
|
|
147
|
+
return { ...common, kind: 'described' as const, outcome: null, createSource };
|
|
148
|
+
}
|
|
120
149
|
|
|
121
150
|
const value = appliedValue(item);
|
|
122
151
|
if (value == null) return refuse('CORRECTION_APPLY_PENDING', 'no settled Apply in the saved item');
|
package/src/feedback-export.ts
CHANGED
|
@@ -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;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},
|
|
251
251
|
context?:Json,
|
|
252
252
|
): string {
|
|
253
253
|
const state=correction.kind==='described'?'Unresolved request':
|
|
@@ -256,5 +256,5 @@ export function formatCorrectionIssue(
|
|
|
256
256
|
const evidence=comment?{...comment,crop:{...comment.crop,png:undefined}}:undefined;
|
|
257
257
|
return ['## Correction handoff','',state,'',
|
|
258
258
|
jsonBlock({itemId:correction.itemId,stage:correction.stage,selectorArgs:correction.on,
|
|
259
|
-
source:correction.source,verbatim:correction.verbatim,target:correction.target,part:correction.part,imageHash:correction.imageHash,comment:evidence,...(correction.patchBytes===undefined?{}:{patchBytes:correction.patchBytes}),context})].join('\n');
|
|
259
|
+
source:correction.source,verbatim:correction.verbatim,target:correction.target,part:correction.part,imageHash:correction.imageHash,comment:evidence,...(correction.patchBytes===undefined?{}:{patchBytes:correction.patchBytes}),createSource:correction.createSource,context})].join('\n');
|
|
260
260
|
}
|
package/src/server.ts
CHANGED
|
@@ -87,8 +87,9 @@ export async function startServer(p:ReviewPackage,options:{port?:number;stateDir
|
|
|
87
87
|
const applied=appliedValue(feedback);
|
|
88
88
|
await rebuilds.validateApplied(applied);
|
|
89
89
|
if(correction){
|
|
90
|
+
if(correction.path==='described'&&isDeepStrictEqual(previousRows.get(feedback.id),feedback))continue;
|
|
90
91
|
const settled=correction.path==='made'&&correction.selector.kind!=='post'?await rebuilds.correctionEvidence(applied):undefined;
|
|
91
|
-
projectSessionCorrection({...correction,source,session,sessionBytes,itemId:feedback.id,settled});
|
|
92
|
+
projectSessionCorrection({...correction,source,session,sessionBytes,itemId:feedback.id,settled,direction:p.direction});
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
95
|
await unchanged();
|
package/web/catalog-en.ts
CHANGED
|
@@ -3252,6 +3252,8 @@ export const enCatalog: Readonly<Record<string, string>> = {
|
|
|
3252
3252
|
"Declared post model path": "Declared post model path",
|
|
3253
3253
|
"Exact correction text (optional UTF-8 file)": "Exact correction text (optional UTF-8 file)",
|
|
3254
3254
|
"Choose the explicit Create source identity.": "Choose the explicit Create source identity.",
|
|
3255
|
+
"Direction request · bound to inspected model and direction": "Direction request · bound to inspected model and direction",
|
|
3256
|
+
"Use the inspected compiled model path for an authored direction request.": "Use the inspected compiled model path for an authored direction request.",
|
|
3255
3257
|
"Unresolved correction request": "Unresolved correction request",
|
|
3256
3258
|
"Made correction evidence": "Made correction evidence",
|
|
3257
3259
|
"Use as described correction": "Use as described correction",
|
package/web/catalog-ko.ts
CHANGED
|
@@ -3252,6 +3252,8 @@ export const koCatalog: Readonly<Record<string, string>> = {
|
|
|
3252
3252
|
"Declared post model path": "선언된 후반 작업 모델 경로",
|
|
3253
3253
|
"Exact correction text (optional UTF-8 file)": "수정 원문 (UTF-8 파일 선택)",
|
|
3254
3254
|
"Choose the explicit Create source identity.": "Create의 소스 식별자를 지정해 주세요.",
|
|
3255
|
+
"Direction request · bound to inspected model and direction": "연출 수정 요청 · 검사한 모델과 연출 문서에 연결됨",
|
|
3256
|
+
"Use the inspected compiled model path for an authored direction request.": "작성된 연출에 대한 수정 요청에는 검사한 컴파일 모델 경로를 사용하세요.",
|
|
3255
3257
|
"Unresolved correction request": "미해결 수정 요청",
|
|
3256
3258
|
"Made correction evidence": "직접 적용한 수정의 근거",
|
|
3257
3259
|
"Use as described correction": "이 댓글을 수정 요청으로 사용",
|
package/web/main.ts
CHANGED
|
@@ -756,7 +756,11 @@ function renderProposals(): void {
|
|
|
756
756
|
const label = document.createElement('p');
|
|
757
757
|
const schema=(context?.applied as {schema?:string}|undefined)?.schema;
|
|
758
758
|
const unsupported=correction.selector?.kind==='post'||schema!=='rig-review-applied/2';
|
|
759
|
-
setSourceText(label, correction.path === 'described'
|
|
759
|
+
setSourceText(label, correction.path === 'described'
|
|
760
|
+
? correction.selector?.kind === 'post' && data.direction && !context?.applied
|
|
761
|
+
? 'Direction request · bound to inspected model and direction'
|
|
762
|
+
: 'Unresolved correction request'
|
|
763
|
+
:
|
|
760
764
|
unsupported ? 'Unsupported correction operation' : 'Made correction evidence');
|
|
761
765
|
item.append(label);
|
|
762
766
|
}
|
|
@@ -792,7 +796,12 @@ function correctionSelection(path: 'described' | 'made'): Json {
|
|
|
792
796
|
if (/^[1-9][0-9]*$/.test(identity) && Number.isSafeInteger(version)) {
|
|
793
797
|
if (stage === 'rig-review') return { path, selector: { stage, kind: 'rig', version } };
|
|
794
798
|
const modelFile = input('correction-model').value;
|
|
795
|
-
if (stage === 'direction-review'
|
|
799
|
+
if (stage === 'direction-review') {
|
|
800
|
+
if (path === 'described' && data.direction && modelFile !== data.reviewedSource.rig?.path) {
|
|
801
|
+
throw new Error(tr('Use the inspected compiled model path for an authored direction request.'));
|
|
802
|
+
}
|
|
803
|
+
if (modelFile) return { path, selector: { stage, kind: 'post', version, modelFile } };
|
|
804
|
+
}
|
|
796
805
|
}
|
|
797
806
|
throw new Error(tr('Choose the explicit Create source identity.'));
|
|
798
807
|
}
|