Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/review-validation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
9 changes: 6 additions & 3 deletions src/review-validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down