cuelo 0.10.62 → 0.10.63

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.
Files changed (61) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +27 -27
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.js +1 -1
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/_global-error.html +1 -1
  9. package/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/_not-found.html +1 -1
  18. package/.next/server/app/_not-found.rsc +2 -2
  19. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  20. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  22. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  24. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  25. package/.next/server/app/api/updates/route.js +1 -1
  26. package/.next/server/app/index.html +1 -1
  27. package/.next/server/app/index.rsc +4 -4
  28. package/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  29. package/.next/server/app/index.segments/_full.segment.rsc +4 -4
  30. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  31. package/.next/server/app/index.segments/_index.segment.rsc +2 -2
  32. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  33. package/.next/server/app/page.js +2 -2
  34. package/.next/server/app/page_client-reference-manifest.js +1 -1
  35. package/.next/server/app/recover/page_client-reference-manifest.js +1 -1
  36. package/.next/server/app/recover.html +1 -1
  37. package/.next/server/app/recover.rsc +2 -2
  38. package/.next/server/app/recover.segments/_full.segment.rsc +2 -2
  39. package/.next/server/app/recover.segments/_head.segment.rsc +1 -1
  40. package/.next/server/app/recover.segments/_index.segment.rsc +2 -2
  41. package/.next/server/app/recover.segments/_tree.segment.rsc +1 -1
  42. package/.next/server/app/recover.segments/recover/__PAGE__.segment.rsc +1 -1
  43. package/.next/server/app/recover.segments/recover.segment.rsc +1 -1
  44. package/.next/server/app-paths-manifest.json +27 -27
  45. package/.next/server/middleware-build-manifest.js +1 -1
  46. package/.next/server/pages/404.html +1 -1
  47. package/.next/server/pages/500.html +1 -1
  48. package/.next/server/server-reference-manifest.json +1 -1
  49. package/.next/static/chunks/app/{layout-568e822083f41ae8.js → layout-c5595de9530a89ce.js} +1 -1
  50. package/.next/static/chunks/app/{page-3301a0c66f913316.js → page-e8392556c750db83.js} +2 -2
  51. package/.next/trace +108 -108
  52. package/.next/trace-build +1 -1
  53. package/Tools/CUELO_Setup/files/native-runtime-patch.js +1 -1
  54. package/Tools/OMP_Global_Config/agent/extensions/cross-review.ts +4 -2
  55. package/Tools/OMP_Global_Config/agent/extensions/lib/cross-review.ts +91 -13
  56. package/Tools/OMP_Global_Config/agent/extensions/lib/routing-ledger.ts +2 -2
  57. package/Tools/OMP_Global_Config/agent/rules/harness-policy.json +2 -1
  58. package/Tools/OMP_Global_Config/agent/rules/subagent.md +6 -2
  59. package/package.json +1 -1
  60. /package/.next/static/{3A0qt58DkyMFfFBRLNRtU → kdP9_fbz33acOidpEPBo6}/_buildManifest.js +0 -0
  61. /package/.next/static/{3A0qt58DkyMFfFBRLNRtU → kdP9_fbz33acOidpEPBo6}/_ssgManifest.js +0 -0
package/.next/trace-build CHANGED
@@ -1 +1 @@
1
- [{"name":"run-webpack","duration":90215821,"timestamp":533899,"id":14,"parentId":1,"tags":{},"startTime":1792753085178,"traceId":"ac6ebc65dd28973a"},{"name":"run-typescript","duration":18852110,"timestamp":91097499,"id":11027,"parentId":1,"tags":{},"startTime":1792753175741,"traceId":"ac6ebc65dd28973a"},{"name":"static-check","duration":3463166,"timestamp":110031904,"id":11030,"parentId":1,"tags":{},"startTime":1792753194676,"traceId":"ac6ebc65dd28973a"},{"name":"static-generation","duration":9730417,"timestamp":113588323,"id":11202,"parentId":1,"tags":{},"startTime":1792753198232,"traceId":"ac6ebc65dd28973a"},{"name":"collect-build-traces","duration":19265236,"timestamp":113565695,"id":11199,"parentId":1,"tags":{},"startTime":1792753198209,"traceId":"ac6ebc65dd28973a"},{"name":"telemetry-flush","duration":81,"timestamp":132835399,"id":11211,"parentId":1,"tags":{},"startTime":1792753217479,"traceId":"ac6ebc65dd28973a"},{"name":"next-build","duration":132388422,"timestamp":447085,"id":1,"tags":{"buildMode":"default","version":"16.2.12","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1792753085091,"traceId":"ac6ebc65dd28973a"}]
1
+ [{"name":"run-webpack","duration":80997882,"timestamp":472882,"id":14,"parentId":1,"tags":{},"startTime":1792760165718,"traceId":"fff5c2a206a37431"},{"name":"run-typescript","duration":17548310,"timestamp":81867552,"id":11027,"parentId":1,"tags":{},"startTime":1792760247113,"traceId":"fff5c2a206a37431"},{"name":"static-check","duration":3226599,"timestamp":99499068,"id":11030,"parentId":1,"tags":{},"startTime":1792760264745,"traceId":"fff5c2a206a37431"},{"name":"static-generation","duration":9644150,"timestamp":102814621,"id":11202,"parentId":1,"tags":{},"startTime":1792760268060,"traceId":"fff5c2a206a37431"},{"name":"collect-build-traces","duration":18887398,"timestamp":102795204,"id":11199,"parentId":1,"tags":{},"startTime":1792760268041,"traceId":"fff5c2a206a37431"},{"name":"telemetry-flush","duration":70,"timestamp":121686442,"id":11211,"parentId":1,"tags":{},"startTime":1792760286932,"traceId":"fff5c2a206a37431"},{"name":"next-build","duration":121290312,"timestamp":396223,"id":1,"tags":{"buildMode":"default","version":"16.2.12","bundler":"webpack","has-custom-webpack-config":"true","use-build-worker":"false"},"startTime":1792760165642,"traceId":"fff5c2a206a37431"}]
@@ -9,7 +9,7 @@ const MEMORY_RE = /(const phase1Model = await resolveMemoryModel\(\{[^}]*?fallba
9
9
  const MEMORY_DONE = /const phase1Model = await resolveMemoryModel\(\{[^}]*?fallbackRole: "smol"/;
10
10
  const EXPECTED = {
11
11
  name: 'cuelo',
12
- version: '0.10.62',
12
+ version: '0.10.63',
13
13
  distribution: 'cuelo',
14
14
  coreVersion: '18.12.6',
15
15
  };
@@ -85,6 +85,7 @@ export interface CrossReviewParams {
85
85
  authors?: string[];
86
86
  highRisk?: boolean;
87
87
  previousReviewId?: string;
88
+ base?: string;
88
89
  inputs?: string[];
89
90
  references?: string[];
90
91
  probeResults?: { findingId: string; command: string; exitCode: number; output: string }[];
@@ -117,7 +118,7 @@ export async function executeCrossReview(
117
118
  if (params.action === "review") {
118
119
  const input: ReviewInput = {
119
120
  files: params.files ?? [], acceptance: params.acceptance ?? "", authors: params.authors ?? [],
120
- highRisk: params.highRisk, previousReviewId: params.previousReviewId, inputs: params.inputs, references: params.references, probeResults: params.probeResults,
121
+ highRisk: params.highRisk, previousReviewId: params.previousReviewId, base: params.base, inputs: params.inputs, references: params.references, probeResults: params.probeResults,
121
122
  };
122
123
  return runReview(input, deps, signal);
123
124
  }
@@ -133,7 +134,7 @@ export default function crossReview(pi: ExtensionAPI): void {
133
134
  const z = pi.zod;
134
135
  pi.registerTool({
135
136
  name: "cross_review", label: "Cross Review", loadMode: "essential", approval: "read",
136
- description: "계열 교차검증. review는 Main과 Maker가 부를 수 있고 resolve는 Main 전용이다(Maker는 자기 high-risk 코드의 review 체인을 돌린 뒤 reviewId 체인과 finding별 제안 status·근거를 보고하고, Main이 확인해 resolve한다). action=review: files(cwd 기준 상대 경로)의 변경을 반대 계열 reviewer(Anthropic 저자→Astra, OpenAI·그 밖의 저자→Opus)가 acceptance 기준으로 적대적으로 읽고 {reviewId, reviewer 모델, round, triggers, findings[]}를 돌려준다. authors는 코드를 쓴 모델 selector이며 두 계열이면 둘 다 돌린다. Main 세션은 \"main\"(자기 현재 모델)도 쓸 수 있지만 subagent 세션에서 \"main\"은 거절되므로 자기 모델 selector를 주고, subagent 세션의 1회차 authors에 세션 자신의 모델과 같은 계열이 없으면 거절된다. previousReviewId를 주면 다음 라운드이고 체인은 최대 3회(probe 라운드 1회 + probe가 아닌 라운드 2회)다: probe가 아닌 라운드는 직전 라운드가 본 내용 이후의 delta만 보며 바뀐 것이 없으면 거절한다. reviewer는 코드만으로 가릴 수 없는 의심에 finding.probe{steps, expectIfReal, expectIfNot?}(재현 실험)를 붙일 수 있다. Main이나 Maker가 그 실험을 돌린 뒤 previousReviewId와 probeResults[{findingId, command, exitCode, output}]를 주면 probe 라운드가 되어 코드 변경이 없어도 실험 결과로 한 번 더 판단받고, reviewer가 finding마다 verdicts{confirmed|withdrawn|unresolved}를 낸다(판단이 빠지면 unresolved). 체인에 없는 findingId·중복 결과·두 번째 probe 라운드·개인키 블록이 든 결과는 거절하며, output은 발췌로 결과당 8KB(넘으면 앞뒤만 남김)·합계 40KB(넘으면 거절)이고 비밀 값은 가려 신뢰하지 않는 자료로 전달한다. verdict는 자문일 뿐 finding을 자동으로 닫거나 통과시키지 않는다. references(선택, 최대 10개)는 심사 대상이 아닌 맥락용 기존·신규 파일(예: 작업 기록, 계약 파일)의 현재 내용을 변경 뒤에 읽기 전용으로 싣는다. 명시한 경로만이며 통과 지문을 덮지 않고 references만으로는 심사하지 않는다. 비밀 경로·gitignore·심볼릭 링크·바이너리·파일당 64KB/합계 100KB 초과, 읽는 동안 열린 파일의 실제 경로가 고정한 저장소 루트 아래 요청 경로와 달라진 경우는 빠지고 skippedReferences에 이유가 나온다. 이 경로 확인은 Linux(WSL 포함)의 /proc/self/fd에 의존하므로 native Windows/macOS에서는 references를 읽지 않고 skippedReferences에 unsupported 이유를 남긴다(변경 파일 심사는 그대로). inputs(선택, 최대 10개)는 변경이 일관돼야 하는 명세·계약·스키마·호출자 파일이며, references와 같은 읽기·필터·제한으로 별도 블록에 싣고(심사 대상 아님, 빠진 것은 skippedInputs) files와 겹치면 거절한다. references와 달리 통과에 묶여서, resolve 뒤 입력이 바뀌거나 지워지면 git_finalize가 그 통과를 덮지 않는 것으로 보고 다시 검토를 요구한다(inputs 없는 검토는 그대로). 이어지는 라운드는 앞 라운드의 입력을 이어받고 더할 수 있으며, 이어받은 입력을 더 읽을 수 없으면 거절하므로 빼려면 previousReviewId 없이 새로 시작한다. 파일 내용은 OpenAI 또는 Anthropic으로 전송되며 비밀 이름·내용·바이너리·큰 입력은 거절/제외한다. action=resolve(Main 전용, 다른 세션이 시작한 체인도 닫을 수 있다): reviewId 체인의 모든 finding에 {id, status fixed|refuted|limit, evidence}가 있어야 pass:true이고 그 시점 파일 내용(git blob)이 통과 지문으로 기록된다(withdrawn 판단도 자동으로 닫지 않는다). git_finalize는 trigger·표본에 걸린 코드 파일에 이 통과 기록을 요구한다. reviewer의 PASS 표현은 근거가 아니다.",
137
+ description: "계열 교차검증. review는 Main과 Maker가 부를 수 있고 resolve는 Main 전용이다(Maker는 자기 high-risk 코드의 review 체인을 돌린 뒤 reviewId 체인과 finding별 제안 status·근거를 보고하고, Main이 확인해 resolve한다). action=review: files(cwd 기준 상대 경로)의 변경을 반대 계열 reviewer(Anthropic 저자→Astra, OpenAI·그 밖의 저자→Opus)가 acceptance 기준으로 적대적으로 읽고 {reviewId, reviewer 모델, round, triggers, findings[]}를 돌려준다. authors는 코드를 쓴 모델 selector이며 두 계열이면 둘 다 돌린다. Main 세션은 \"main\"(자기 현재 모델)도 쓸 수 있지만 subagent 세션에서 \"main\"은 거절되므로 자기 모델 selector를 주고, subagent 세션의 1회차 authors에 세션 자신의 모델과 같은 계열이 없으면 거절된다. previousReviewId를 주면 다음 라운드이고 체인은 최대 5회(probe 라운드 1회 + probe가 아닌 라운드 4회)다: probe가 아닌 라운드는 직전 라운드가 본 내용 이후의 delta만 보며 바뀐 것이 없으면 거절한다. finding을 고친 뒤에는 다음 라운드로 그 수정을 reviewer에게 다시 보이는 것이 정상 흐름이며, 마지막 라운드의 내용과 다른 파일이 resolve 때 있으면 결과의 unreviewedChanges로 알린다(안내일 뿐 통과 판정은 바꾸지 않는다). base(선택, 1회차 전용, 빈 문자열은 주지 않은 것으로 읽는다)는 이미 커밋된 변경을 심사할 때 쓰는 HEAD 또는 그 조상 커밋이며, 그 커밋부터 HEAD까지의 변경을 보여 준다. 대상 파일의 작업 트리가 HEAD와 같아야 하고(수정·삭제·추적 안 한 새 파일은 거절, git이 무시하는 새 파일은 건너뜀) base가 없으면 HEAD와 작업 트리를 비교한다(커밋 뒤에도 같은 체인을 previousReviewId로 이어 가는 것은 base 없이 된다). reviewer는 코드만으로 가릴 수 없는 의심에 finding.probe{steps, expectIfReal, expectIfNot?}(재현 실험)를 붙일 수 있다. Main이나 Maker가 그 실험을 돌린 뒤 previousReviewId와 probeResults[{findingId, command, exitCode, output}]를 주면 probe 라운드가 되어 코드 변경이 없어도 실험 결과로 한 번 더 판단받고, reviewer가 finding마다 verdicts{confirmed|withdrawn|unresolved}를 낸다(판단이 빠지면 unresolved). 체인에 없는 findingId·중복 결과·두 번째 probe 라운드·개인키 블록이 든 결과는 거절하며, output은 발췌로 결과당 8KB(넘으면 앞뒤만 남김)·합계 40KB(넘으면 거절)이고 비밀 값은 가려 신뢰하지 않는 자료로 전달한다. verdict는 자문일 뿐 finding을 자동으로 닫거나 통과시키지 않는다. references(선택, 최대 10개)는 심사 대상이 아닌 맥락용 기존·신규 파일(예: 작업 기록, 계약 파일)의 현재 내용을 변경 뒤에 읽기 전용으로 싣는다. 명시한 경로만이며 통과 지문을 덮지 않고 references만으로는 심사하지 않는다. 비밀 경로·gitignore·심볼릭 링크·바이너리·파일당 64KB/합계 100KB 초과, 읽는 동안 열린 파일의 실제 경로가 고정한 저장소 루트 아래 요청 경로와 달라진 경우는 빠지고 skippedReferences에 이유가 나온다. 이 경로 확인은 Linux(WSL 포함)의 /proc/self/fd에 의존하므로 native Windows/macOS에서는 references를 읽지 않고 skippedReferences에 unsupported 이유를 남긴다(변경 파일 심사는 그대로). inputs(선택, 최대 10개)는 변경이 일관돼야 하는 명세·계약·스키마·호출자 파일이며, references와 같은 읽기·필터·제한으로 별도 블록에 싣고(심사 대상 아님, 빠진 것은 skippedInputs) files와 겹치면 거절한다. references와 달리 통과에 묶여서, resolve 뒤 입력이 바뀌거나 지워지면 git_finalize가 그 통과를 덮지 않는 것으로 보고 다시 검토를 요구한다(inputs 없는 검토는 그대로). 이어지는 라운드는 앞 라운드의 입력을 이어받고 더할 수 있으며, 이어받은 입력을 더 읽을 수 없으면 거절하므로 빼려면 previousReviewId 없이 새로 시작한다. 파일 내용은 OpenAI 또는 Anthropic으로 전송되며 비밀 이름·내용·바이너리·큰 입력은 거절/제외한다. action=resolve(Main 전용, 다른 세션이 시작한 체인도 닫을 수 있다): reviewId 체인의 모든 finding에 {id, status fixed|refuted|limit, evidence}가 있어야 pass:true이고 그 시점 파일 내용(git blob)이 통과 지문으로 기록된다(withdrawn 판단도 자동으로 닫지 않는다). git_finalize는 trigger·표본에 걸린 코드 파일에 이 통과 기록을 요구한다. reviewer의 PASS 표현은 근거가 아니다.",
137
138
  parameters: z.object({
138
139
  action: z.string(),
139
140
  files: z.array(z.string()).optional(),
@@ -141,6 +142,7 @@ export default function crossReview(pi: ExtensionAPI): void {
141
142
  authors: z.array(z.string()).optional(),
142
143
  highRisk: z.boolean().optional(),
143
144
  previousReviewId: z.string().optional(),
145
+ base: z.string().optional(),
144
146
  inputs: z.array(z.string()).optional(),
145
147
  references: z.array(z.string()).optional(),
146
148
  probeResults: z.array(z.object({ findingId: z.string(), command: z.string(), exitCode: z.number(), output: z.string() })).optional(),
@@ -34,9 +34,14 @@ import { SECRET_CONTENT, SECRET_EXTENSION, SECRET_NAME } from "../skim";
34
34
  export type Family = "openai" | "anthropic";
35
35
  export type Exec = (command: string, args: string[], options: { cwd: string; stdin?: Buffer }) => Promise<{ code: number; stdout: string; stderr?: string }>;
36
36
 
37
- /** 한 체인의 최대 라운드 수. probe 라운드는 이 중 최대 하나이고, probe가 아닌 라운드는 최대 MAX_PLAIN_ROUNDS다. */
38
- export const MAX_ROUNDS = 3;
39
- export const MAX_PLAIN_ROUNDS = 2;
37
+ /**
38
+ * 한 체인의 최대 라운드 수. probe 라운드는 이 중 최대 하나이고, probe가 아닌 라운드는 최대 MAX_PLAIN_ROUNDS다.
39
+ * 2026-10-23 실측(10-11~10-23, 체인 135개): 여러 라운드를 돈 체인 69개 중 64개가 non-probe 2회를 다 썼고 26개는 마지막 라운드에 finding이
40
+ * 남은 채 한도에서 끝나 그 수정은 reviewer가 보지 못했다(non-probe 2회차의 finding 비율 26/62). 같은 비율이 이어진다고 보면 4회에서 한도에 걸려
41
+ * 수정이 안 보이는 체인은 전체의 약 2%다. 이전 체인(최대 3회, non-probe 2회)은 그대로 읽힌다.
42
+ */
43
+ export const MAX_ROUNDS = 5;
44
+ export const MAX_PLAIN_ROUNDS = 4;
40
45
  export const MAX_PROBE_ROUNDS = 1;
41
46
  /** probe 결과 한 건의 출력 발췌 상한(UTF-8 바이트, 비밀 가림 뒤). 넘으면 앞뒤 절반씩 남기고 가운데를 자른다. */
42
47
  export const MAX_PROBE_OUTPUT_BYTES = 8 * 1024;
@@ -329,6 +334,62 @@ export async function hashBytes(exec: Exec, git: string, root: string, path: str
329
334
  return blob;
330
335
  }
331
336
 
337
+ /** base 심사의 커밋 범위. 둘 다 전체 sha이며, headSha는 호출 시점의 HEAD를 한 번 고정한 값이다(수집 도중 HEAD가 옮겨져도 이 값만 쓴다). */
338
+ export interface BaseRange { baseSha: string; headSha: string }
339
+
340
+ /**
341
+ * 이미 커밋된 변경을 심사하려는 1회차용 기준 revision. HEAD 또는 HEAD의 조상 커밋만 받는다. 값은 다듬지 않고 검사한다(앞뒤 공백도 거절).
342
+ * 옵션처럼 읽히는 값·커밋이 아닌 값·조상이 아닌 값은 reviewer를 부르기 전에 거절한다. 조상 확인과 이후 수집이 같은 HEAD를 쓰도록 HEAD를 sha로 고정해 돌려준다.
343
+ */
344
+ export async function resolveBaseRevision(exec: Exec, git: string, root: string, base: string): Promise<BaseRange> {
345
+ if (!base || base.startsWith("-") || /[\s\0]/.test(base)) throw new Error(`base ${JSON.stringify(base)} is not a usable git revision (no whitespace, must not start with "-").`);
346
+ const [baseParsed, headParsed] = await Promise.all([`${base}^{commit}`, "HEAD^{commit}"].map((revision) => exec(git, ["rev-parse", "--verify", "--quiet", revision], { cwd: root })));
347
+ const baseSha = baseParsed.stdout.trim();
348
+ const headSha = headParsed.stdout.trim();
349
+ if (baseParsed.code !== 0 || !/^[0-9a-f]{40,64}$/.test(baseSha)) throw new Error(`base ${base} is not a commit in ${root}.`);
350
+ if (headParsed.code !== 0 || !/^[0-9a-f]{40,64}$/.test(headSha)) throw new Error(`HEAD is not a commit in ${root}.`);
351
+ const ancestor = await exec(git, ["merge-base", "--is-ancestor", baseSha, headSha], { cwd: root });
352
+ if (ancestor.code === 1) throw new Error(`base ${base} is not HEAD or one of its ancestors; a base must be an earlier commit of the checked-out history.`);
353
+ if (ancestor.code !== 0) throw new Error(`could not check that base ${base} is an ancestor of HEAD: ${(ancestor.stderr || ancestor.stdout).trim()}`);
354
+ return { baseSha, headSha };
355
+ }
356
+
357
+ /**
358
+ * 커밋된 변경(baseSha→headSha)을 collectChanges와 같은 모양으로 모은다. 작업 트리가 headSha와 같은 파일만 받는다: 그래야 reviewer가 보는 diff가
359
+ * 기록하는 blob(작업 트리 내용)의 HEAD 기준 변경 전부이고, 기준을 골라 변경 일부(예: HEAD의 수정을 기준 값으로 되돌린 부분)를 가리지 못한다.
360
+ * 작업 트리가 HEAD와 다르면(수정·삭제·추적 안 한 새 파일) 거절한다. git이 무시하는 새 파일은 collectChanges처럼 변경으로 보지 않는다.
361
+ * reviewer가 보는 본문은 모두 고정한 커밋의 git 객체에서 만들고(수정·삭제는 객체끼리의 diff, 새 파일은 객체 내용), 작업 트리 내용은 한 번만 읽어
362
+ * 그 blob이 headSha의 blob과 같을 때만 사본·기록에 쓴다. 게이트(collectChanges·decideGate)는 건드리지 않는다.
363
+ */
364
+ export async function collectChangesSince(exec: Exec, git: string, root: string, paths: string[], range: BaseRange): Promise<{ changed: ChangedFile[]; unchanged: string[] }> {
365
+ const { baseSha, headSha } = range;
366
+ const changed: ChangedFile[] = [];
367
+ const unchanged: string[] = [];
368
+ for (const path of paths) {
369
+ const absolute = join(root, ...path.split("/"));
370
+ const [inHead, inBase] = await Promise.all([headSha, baseSha].map(async (revision) => (await exec(git, ["rev-parse", "--verify", "--quiet", `${revision}:${path}`], { cwd: root })).stdout.trim()));
371
+ const content = existsSync(absolute) ? await readFile(absolute) : null;
372
+ // HEAD에 없는 파일이 작업 트리에 있으면 git이 무시하는 파일(종료 코드 0)만 건너뛰고, 그 밖의 추적 안 한/스테이지된 새 파일은 아래에서 커밋 전 내용으로 거절한다.
373
+ if (!inHead && content !== null && (await exec(git, ["check-ignore", "-q", "--", path], { cwd: root })).code === 0) { unchanged.push(path); continue; }
374
+ const blob = content ? await hashBytes(exec, git, root, path, content) : DELETED_BLOB;
375
+ if (content === null ? inHead !== "" : blob !== inHead) throw new Error(`${path} has uncommitted or untracked content (the working tree differs from HEAD); a base review covers committed content only. Commit it first, or review without base.`);
376
+ if (inHead === inBase) { unchanged.push(path); continue; }
377
+ const kind: ChangedFile["status"] = !inHead ? "deleted" : !inBase ? "added" : "modified";
378
+ if (content && kind === "added") {
379
+ const shown = await exec(git, ["cat-file", "blob", inHead], { cwd: root });
380
+ if (shown.code !== 0) throw new Error(`git cat-file blob ${inHead} failed for ${path}: ${(shown.stderr || shown.stdout).trim()}`);
381
+ const binary = shown.stdout.includes("\0");
382
+ const text = binary ? "" : shown.stdout.replace(/^\uFEFF/, "");
383
+ changed.push({ path, status: kind, blob, binary, changedLines: binary ? [] : text.replace(/\r\n/g, "\n").split("\n").map((line, index) => ({ line: index + 1, text: line })), text: binary ? "" : numbered(text), content });
384
+ continue;
385
+ }
386
+ const diff = await exec(git, ["--literal-pathspecs", "diff", baseSha, headSha, "--full-index", "--no-color", "--no-ext-diff", "--no-renames", "--no-textconv", "-U12", "--", path], { cwd: root });
387
+ if (diff.code !== 0) throw new Error(`git diff ${baseSha.slice(0, 12)} ${headSha.slice(0, 12)} failed for ${path}: ${(diff.stderr || diff.stdout).trim()}`);
388
+ changed.push({ path, status: kind, blob, binary: /^Binary files /m.test(diff.stdout), changedLines: parseChangedLines(diff.stdout), text: diff.stdout, content });
389
+ }
390
+ return { changed, unchanged };
391
+ }
392
+
332
393
  // ── 게이트 판정 ──────────────────────────────────────────────────────────────
333
394
 
334
395
  export interface RequiredFile { path: string; blob: string; reasons: string[] }
@@ -721,7 +782,7 @@ export const MAX_REFERENCE_TOTAL_BYTES = 100 * 1024;
721
782
  * probeResults: 앞 라운드 finding의 probe를 실제로 돌린 결과. 있으면 이 호출이 체인의 probe 라운드이며 코드 변경이 없어도 된다.
722
783
  */
723
784
  export interface ProbeResultInput { findingId: string; command: string; exitCode: number; output: string }
724
- export interface ReviewInput { files: string[]; acceptance: string; authors: string[]; highRisk?: boolean; previousReviewId?: string; inputs?: string[]; references?: string[]; probeResults?: ProbeResultInput[] }
785
+ export interface ReviewInput { files: string[]; acceptance: string; authors: string[]; highRisk?: boolean; previousReviewId?: string; base?: string; inputs?: string[]; references?: string[]; probeResults?: ProbeResultInput[] }
725
786
  export interface ReviewerCompletion { model: string; text: string }
726
787
  export class ReviewerCallError extends Error {
727
788
  /** partial: 모델이 중간까지 낸 답(출력 한도·오류로 끝난 경우). 통과는 못 하지만 원문은 기록한다. */
@@ -746,7 +807,7 @@ export interface ReviewDeps {
746
807
 
747
808
  export interface ReviewResult {
748
809
  reviewId: string;
749
- round: 1 | 2 | 3;
810
+ round: number;
750
811
  reviewers: { family: Family; model: string; status: CrossReviewReviewer["status"]; elapsedSec: number; raw?: string; rawChars?: number; rawFile?: string; error?: string }[];
751
812
  triggers: string[];
752
813
  highRisk: boolean;
@@ -761,6 +822,8 @@ export interface ReviewResult {
761
822
  references: { path: string; bytes: number; blob: string; redacted?: number }[];
762
823
  /** 참고에서 빠진 파일과 이유. */
763
824
  skippedReferences: { path: string; reason: string }[];
825
+ /** base를 줬을 때만: 변경을 비교한 기준 커밋(전체 sha). */
826
+ base?: string;
764
827
  /** 입력을 선언했거나 앞 라운드가 묶은 입력이 있을 때만: reviewer가 본 입력(경로·크기·blob)과 읽히지 않아 묶이지 않은 입력. 입력은 심사 대상이 아니다. */
765
828
  inputs?: { path: string; bytes: number; blob: string; redacted?: number }[];
766
829
  skippedInputs?: { path: string; reason: string }[];
@@ -840,13 +903,13 @@ function describeNext(state: NextState): string {
840
903
  const limit = "Round limit reached: no further review is allowed. Close every finding with resolve (fixed / refuted with evidence / limit documented).";
841
904
  if (state.probeRound) {
842
905
  const counts = (["confirmed", "withdrawn", "unresolved"] as const).map((kind) => `${state.verdicts.filter((verdict) => verdict.verdict === kind).length} ${kind}`).join(", ");
843
- return `Probe verdicts (${counts}) are advisory: a withdrawn finding is NOT closed. Fix only the confirmed findings${canDelta ? `, then optionally ${delta}` : ""}. Then ${RESOLVE_HINT} (withdrawn: refuted with the probe evidence; unresolved: your own judgment or limit documented).${canDelta ? "" : ` ${limit}`}`;
906
+ return `Probe verdicts (${counts}) are advisory: a withdrawn finding is NOT closed. Fix only the confirmed findings${canDelta ? `, then ${delta} so the fixes themselves are reviewed (${MAX_PLAIN_ROUNDS - state.plainUsed} non-probe round(s) left)` : ""}. Then ${RESOLVE_HINT} (withdrawn: refuted with the probe evidence; unresolved: your own judgment or limit documented).${canDelta ? "" : ` ${limit}`}`;
844
907
  }
845
908
  if (state.findings === 0) return "No findings. Call cross_review {action:\"resolve\", reviewId, resolutions:[]} to record the pass for the current file contents.";
846
909
  if (!canProbe && !canDelta) return `${limit} Findings of this chain still open need resolve before the pass.`;
847
910
  const parts = ["Fix or refute each finding."];
848
911
  if (state.probeFindings > 0 && canProbe) parts.push(`${state.probeFindings} finding(s) carry a probe: run it yourself or through the existing Maker, then call cross_review review with previousReviewId and probeResults:[{findingId, command, exitCode, output}] (one probe round per chain; no code change needed; output is an excerpt of at most ${MAX_PROBE_OUTPUT_BYTES} bytes per result, ${MAX_PROBE_TOTAL_BYTES} in total).`);
849
- if (canDelta) parts.push(`Optionally ${delta}.`);
912
+ if (canDelta) parts.push(`After fixing, ${delta} so the fixes themselves are reviewed (${MAX_PLAIN_ROUNDS - state.plainUsed} non-probe round(s) left): a finding closed as fixed with no later round leaves that fix unreviewed, and resolve reports the files that changed since the last reviewed round.`);
850
913
  parts.push(`Then ${RESOLVE_HINT}.`);
851
914
  if (!canDelta) parts.push("After this no further non-probe review is allowed: close any remaining finding with resolve (refuted with evidence, or limit documented).");
852
915
  return parts.join(" ");
@@ -1050,7 +1113,11 @@ export async function runReview(input: ReviewInput, deps: ReviewDeps, signal: Ab
1050
1113
  const records = deps.readAll();
1051
1114
  const probeRound = (input.probeResults?.length ?? 0) > 0;
1052
1115
  if (probeRound && !input.previousReviewId) throw new Error("probeResults need previousReviewId: a probe round answers findings of an earlier round in the same chain.");
1053
- let round: 1 | 2 | 3 = 1;
1116
+ // 빈 문자열은 base를 주지 않은 것으로 읽는다. 그 밖의 값은 다듬지 않고 그대로 검사한다(공백뿐인 값·앞뒤 공백은 resolveBaseRevision이 거절한다).
1117
+ const suppliedBase = input.base || undefined;
1118
+ if (suppliedBase !== undefined && input.previousReviewId) throw new Error("base applies to the first round only: a later round compares the current content with the previous round's snapshot, so a committed fix is reviewed by simply continuing the chain with previousReviewId.");
1119
+ let resolvedBase: string | undefined;
1120
+ let round = 1;
1054
1121
  let previous: CrossReviewRecord | undefined;
1055
1122
  let chain: CrossReviewRecord[] = [];
1056
1123
  let families: Family[];
@@ -1066,7 +1133,7 @@ export async function runReview(input: ReviewInput, deps: ReviewDeps, signal: Ab
1066
1133
  if (records.some((record) => record.type === "cross-review" && record.previousReviewId === previous!.reviewId)) throw new Error(`${previous.reviewId} already has a round ${previous.round + 1}.`);
1067
1134
  if (probeRound && probesUsed >= MAX_PROBE_ROUNDS) throw new Error(`Round limit: this chain already used its one probe round (${chain.find((record) => record.probeResults?.length)!.reviewId}). Close the remaining findings with cross_review resolve, or review the fix as a delta round without probeResults.`);
1068
1135
  if (!probeRound && plainUsed >= MAX_PLAIN_ROUNDS) throw new Error(`Round limit: this chain already used its ${MAX_PLAIN_ROUNDS} non-probe rounds. ${probesUsed === 0 ? "Only one probe round is left: pass probeResults, or close the remaining findings with cross_review resolve." : "Close the remaining findings with cross_review resolve."}`);
1069
- round = (previous.round + 1) as 2 | 3;
1136
+ round = previous.round + 1;
1070
1137
  families = previous.reviewers.map((reviewer) => reviewer.family);
1071
1138
  } else {
1072
1139
  families = reviewerFamilies(input.authors, deps.mainModel);
@@ -1115,8 +1182,10 @@ export async function runReview(input: ReviewInput, deps: ReviewDeps, signal: Ab
1115
1182
  };
1116
1183
 
1117
1184
  if (!previous) {
1118
- const { changed, unchanged } = await collectChanges(deps.exec, git, root, safe);
1119
- for (const path of unchanged) skipped.push({ path, reason: "no changes against HEAD; nothing to review" });
1185
+ const range = suppliedBase === undefined ? undefined : await resolveBaseRevision(deps.exec, git, root, suppliedBase);
1186
+ const { changed, unchanged } = range ? await collectChangesSince(deps.exec, git, root, safe, range) : await collectChanges(deps.exec, git, root, safe);
1187
+ for (const path of unchanged) skipped.push({ path, reason: range ? `no changes against ${suppliedBase} (${range.baseSha.slice(0, 12)}); nothing to review` : "no changes against HEAD; nothing to review" });
1188
+ resolvedBase = range?.baseSha;
1120
1189
  for (const change of changed) {
1121
1190
  if (change.binary) { skipped.push({ path: change.path, reason: "binary file" }); continue; }
1122
1191
  if (!addPart(change.path, change.status === "added" ? "new-file" : "diff", change.text, change.changedLines)) continue;
@@ -1257,7 +1326,7 @@ export async function runReview(input: ReviewInput, deps: ReviewDeps, signal: Ab
1257
1326
  triggers: record.triggers, highRisk: record.highRisk, findings, skipped, redacted,
1258
1327
  references: references.map(({ path, bytes, blob, redacted: matches }) => ({ path, bytes, blob, ...(matches ? { redacted: matches } : {}) })),
1259
1328
  ...(inputEntries.length > 0 || skippedInputs.length > 0 ? { inputs: inputEntries.map(({ path, bytes, blob, redacted: matches }) => ({ path, bytes, blob, ...(matches ? { redacted: matches } : {}) })), skippedInputs } : {}),
1260
- skippedReferences, passable, snapshotDir, ...(probeRound ? { probeResults: probeMeta, verdicts } : {}),
1329
+ skippedReferences, passable, snapshotDir, ...(resolvedBase ? { base: resolvedBase } : {}), ...(probeRound ? { probeResults: probeMeta, verdicts } : {}),
1261
1330
  nextStep: withInputWarning(describeNext({
1262
1331
  round, passable, findings: findings.length, probeFindings: findings.filter((finding) => finding.probe).length, probeRound, verdicts,
1263
1332
  probeUsed: probesBefore + (probeRound ? 1 : 0), plainUsed: chain.length - probesBefore + (probeRound ? 0 : 1),
@@ -1284,6 +1353,9 @@ export interface ResolveResult {
1284
1353
  files: CrossReviewFile[];
1285
1354
  /** 선택. 이 pass 기록에 묶인 의존 입력(체인 마지막 라운드가 본 blob). */
1286
1355
  inputs?: CrossReviewFile[];
1356
+ /** 안내(통과 판정과 무관): resolve 시점 내용이 체인 마지막 라운드 reviewer가 본 내용과 다른 파일. 있으면 그 수정은 reviewer가 보지 못했다. */
1357
+ unreviewedChanges?: { path: string; state: "changed" | "deleted" }[];
1358
+ unreviewedNote?: string;
1287
1359
  /** 체인의 probe 라운드 판단(정보). withdrawn이어도 finding은 여전히 resolve로 닫아야 하며 pass 규칙에는 쓰이지 않는다. */
1288
1360
  verdicts?: CrossReviewVerdict[];
1289
1361
  }
@@ -1340,5 +1412,11 @@ export async function runResolve(input: ResolveInput, deps: ResolveDeps): Promis
1340
1412
  };
1341
1413
  if (!deps.append(record)) throw new Error("The resolution could not be recorded in the routing ledger; nothing was saved. Retry.");
1342
1414
  const verdicts = chain.flatMap((item) => item.verdicts ?? []);
1343
- return { reviewId: input.reviewId, pass, open, rejected, ...(unusable ? { unusable } : {}), files, ...(record.inputs ? { inputs: record.inputs } : {}), ...(verdicts.length > 0 ? { verdicts } : {}) };
1415
+ // 안내용(통과 판정에는 쓰지 않는다): 통과 지문은 resolve 시점 내용이므로, 마지막 라운드 reviewer가 본 내용과 다른 파일은 reviewer가 보지 못한 수정을 덮는다.
1416
+ const lastSeen = new Map(head.files.map((file) => [file.path, file.blob]));
1417
+ const unreviewedChanges = files.filter((file) => lastSeen.get(file.path) !== file.blob).map((file) => ({ path: file.path, state: file.blob === DELETED_BLOB ? "deleted" as const : "changed" as const }));
1418
+ return {
1419
+ reviewId: input.reviewId, pass, open, rejected, ...(unusable ? { unusable } : {}), files, ...(record.inputs ? { inputs: record.inputs } : {}), ...(verdicts.length > 0 ? { verdicts } : {}),
1420
+ ...(unreviewedChanges.length > 0 ? { unreviewedChanges, unreviewedNote: `${unreviewedChanges.length} file(s) changed after the last reviewed round (${head.reviewId}); the pass records their current content although the reviewer never saw it. If rounds are left, run a review with previousReviewId first, then resolve again.` } : {}),
1421
+ };
1344
1422
  }
@@ -163,8 +163,8 @@ export interface CrossReviewRecord {
163
163
  sessionId: string;
164
164
  /** 파일 경로의 기준이 되는 저장소 루트(호출 cwd 이름공간). */
165
165
  root: string;
166
- /** 1부터 시작. 최대 3(probe 라운드 하나 포함 가능). */
167
- round: 1 | 2 | 3;
166
+ /** 1부터 시작. 최대 MAX_ROUNDS(probe 라운드 하나 포함 가능). 옛 체인은 최대 3이었다. */
167
+ round: number;
168
168
  previousReviewId?: string;
169
169
  authors: string[];
170
170
  highRisk: boolean;
@@ -286,7 +286,8 @@
286
286
  "main": "main-checks-that-evidence-and-resolves-the-makers-chain-instead-of-starting-a-duplicate-review-of-the-same-content-and-starts-a-new-round-only-when-content-changed-after-the-makers-last-round",
287
287
  "gate": "git_finalize-stage-cross-review-is-unchanged"
288
288
  },
289
- "rounds": "at-most-three-per-chain-with-at-most-one-probe-round-and-at-most-two-non-probe-rounds-a-probe-round-is-any-round-submitted-with-non-empty-probeResults-even-when-it-also-carries-a-code-delta-a-non-probe-later-round-reviews-only-the-delta-since-the-latest-content-the-reviewer-was-shown-and-is-refused-when-nothing-changed-a-probe-round-carries-the-results-of-experiments-the-reviewer-proposed-through-finding-probe-may-have-no-code-change-and-returns-a-confirmed-withdrawn-or-unresolved-verdict-per-submitted-result-that-is-advisory-only-and-never-closes-a-finding",
289
+ "rounds": "at-most-five-per-chain-with-at-most-one-probe-round-and-at-most-four-non-probe-rounds-chosen-from-the-2026-10-23-ledger-measurement-where-64-of-69-multi-round-chains-used-both-old-non-probe-rounds-and-26-chains-ended-at-the-limit-with-findings-in-the-last-round-so-that-a-round-s-fixes-can-normally-be-reviewed-by-the-next-round-chains-recorded-under-the-old-limit-of-three-still-read-a-probe-round-is-any-round-submitted-with-non-empty-probeResults-even-when-it-also-carries-a-code-delta-a-non-probe-later-round-reviews-only-the-delta-since-the-latest-content-the-reviewer-was-shown-and-is-refused-when-nothing-changed-a-probe-round-carries-the-results-of-experiments-the-reviewer-proposed-through-finding-probe-may-have-no-code-change-and-returns-a-confirmed-withdrawn-or-unresolved-verdict-per-submitted-result-that-is-advisory-only-and-never-closes-a-finding-resolve-reports-files-whose-content-differs-from-the-last-reviewed-round-as-unreviewedChanges-which-is-advisory-only-and-never-changes-the-pass-decision-or-the-gate",
290
+ "committedChange": "the-optional-first-round-base-is-head-or-an-ancestor-commit-and-shows-the-change-from-it-to-head-only-for-files-whose-working-tree-equals-head-so-an-already-committed-change-can-be-reviewed-without-a-scratch-worktree-and-the-base-diff-can-never-hide-part-of-the-head-relative-change-it-never-reaches-the-gate-whose-coverage-still-binds-exact-blobs-and-a-later-round-continues-the-chain-with-previousReviewId-without-base",
290
291
  "gate": "git_finalize-stage-cross-review-runs-before-the-commit-and-blocks-a-required-change-without-a-passing-record-that-still-covers-it-including-the-inputs-that-record-was-bound-to",
291
292
  "waiver": "only-on-an-explicit-user-instruction-through-crossReviewWaiver-and-recorded-in-the-ledger-never-chosen-by-main-or-a-maker-on-its-own",
292
293
  "ledger": "cross-review-cross-review-resolve-and-cross-review-waiver-records",
@@ -632,8 +632,12 @@ evidence locator·이유를 남긴다. `held`는 같은 identity와 보류 이
632
632
  각각 `cross_review` `resolve`로 `fixed`·`refuted`·`limit` 중 하나와 근거를 남겨 닫는다. `resolve`는
633
633
  Main 전용이고 subagent 세션에서는 도구가 거절하며, Main은 다른 세션(Maker)이 시작한 체인도 닫을 수 있다.
634
634
  통과는 모든
635
- finding이 닫힌 상태이고 깨끗한 검토도 PASS 판정이 아니다. 한 체인은 최대 3회이며 probe 라운드는 그중 하나,
636
- probe가 아닌 라운드는 둘이다. probe가 아닌 후속 라운드는 직전에 reviewer가 본 내용 이후의 delta만 본다.
635
+ finding이 닫힌 상태이고 깨끗한 검토도 PASS 판정이 아니다. 한 체인은 최대 5회이며 probe 라운드는 그중 하나,
636
+ probe가 아닌 라운드는 넷이다(2026-10-23 실측에 맞춰 3·2에서 올렸고 옛 체인은 그대로 읽힌다). 수정은 닫기 전에
637
+ 다음 라운드로 reviewer에게 다시 보인다. resolve 결과의 `unreviewedChanges`는 마지막 라운드 뒤에 바뀐 파일을 알리는 안내일 뿐
638
+ 통과 판정을 바꾸지 않는다. 이미 커밋된 변경은 1회차에 `base`(HEAD 또는 그 조상)를 주어 그 커밋부터 HEAD까지를 심사하고
639
+ (대상 파일의 작업 트리가 HEAD와 같아야 한다), 이어지는 라운드는
640
+ `previousReviewId`만으로 이어 간다. probe가 아닌 후속 라운드는 직전에 reviewer가 본 내용 이후의 delta만 본다.
637
641
  reviewer는 코드만으로 가릴 수 없는 의심에 finding의 `probe`(재현 절차와 `expectIfReal`)를 붙일 수 있다.
638
642
  그 의심은 Main이 직접 또는 기존 Maker(새 역할 없음)로 실험해 결과를 `cross_review`의 `probeResults`
639
643
  (`findingId`·`command`·`exitCode`·`output`)로 `previousReviewId`와 함께 되돌린다. 이것이 probe 라운드이고
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cuelo",
3
- "version": "0.10.62",
3
+ "version": "0.10.63",
4
4
  "description": "CUELO — open-source AI coding agent workspace and harness for omp (oh-my-pi)",
5
5
  "homepage": "https://github.com/gim47656-ship-it/CUELO#readme",
6
6
  "repository": {