diff --git a/src/prompt.ts b/src/prompt.ts index e5078a1..46cea3c 100644 --- a/src/prompt.ts +++ b/src/prompt.ts @@ -4,7 +4,7 @@ import { ClawpatchConfig, FeatureRecord, FindingRecord, ProjectRecord } from "./ export type ReviewMode = "default" | "deslopify"; -export const REVIEW_PROMPT_FILE_CHAR_LIMIT = 24_000; +export const REVIEW_PROMPT_FILE_CHAR_LIMIT = 250_000; export type ReviewPromptFileRole = "owned" | "context"; diff --git a/src/review-validation.test.ts b/src/review-validation.test.ts index 27db552..d61f5e0 100644 --- a/src/review-validation.test.ts +++ b/src/review-validation.test.ts @@ -106,7 +106,7 @@ describe("validateReviewOutput", () => { it("rejects evidence that only exists beyond the truncated prompt text", async () => { const root = await fixtureRoot("clawpatch-review-validation-truncated-"); - await writeFixture(root, "src/index.ts", `${"a".repeat(24_000)}\nconst value = 'TODO_TAIL';\n`); + await writeFixture(root, "src/index.ts", `${"a".repeat(250_000)}\nconst value = 'TODO_TAIL';\n`); await expect( validateReviewOutput( diff --git a/src/review-validation.ts b/src/review-validation.ts index 7566a70..81ef30c 100644 --- a/src/review-validation.ts +++ b/src/review-validation.ts @@ -27,9 +27,12 @@ export async function validateReviewOutput( if (promptFile === undefined || !promptFile.readable) { throwMalformed(`evidence file was not readable in review context: ${evidence.path}`); } - const contents = await fileContents(root, evidence.path, promptFile.truncated, cache); - assertLineRange(contents, evidence); - assertQuote(contents, evidence); + const fullContents = await fileContents(root, evidence.path, false, cache); + const promptContents = promptFile.truncated + ? await fileContents(root, evidence.path, true, cache) + : fullContents; + assertLineRange(fullContents, evidence); + assertQuote(promptContents, evidence); } } return { ...output, findings };