server/links/review.ts asks the configured model to judge the scanner's candidates as a careful Wikipedia editor would: up to 60 a call, grouped by document and section, each with its sentence, its section's path, the target's title and description (and first sentence when cached) and, for a library target, how it stands to the section. No tools; structured verdicts with a one-line reason. The prompt names the scanner's known blind spots. The pending store keeps verdicts, a person's decisions and when an approved link was handed out, keyed by phrase and target, so a candidate found again is never judged twice and a rejected phrase is not looked for again. Its file keeps the old shape; old entries read as pending. The scan route reviews what it found when asked (at most 2 calls) and hands the approved links back to be made; jobs review as they go within IE_REVIEW_CALLS (default 50) calls, with the count in their state. No model, a failed call or the cap leaves the rest pending, with the reason. The mock reviewer links names and terms, not single lower-case words, and fails on 'mockfail'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
21 lines
908 B
TypeScript
21 lines
908 B
TypeScript
/** The shapes of the structured results, shared by every server-side provider. */
|
|
import { z } from "zod";
|
|
import type { SchemaName } from "../src/llm/types";
|
|
|
|
export const schemas: Record<SchemaName, z.ZodType> = {
|
|
cascade: z.object({ levels: z.number().int(), reason: z.string() }),
|
|
resolve: z.object({ resolutions: z.array(z.object({ id: z.string(), text: z.string(), rationale: z.string() })) }),
|
|
contradictions: z.object({
|
|
contradictions: z.array(z.object({ node: z.string(), other: z.string(), explanation: z.string(), text: z.string() })),
|
|
}),
|
|
review: z.object({
|
|
verdicts: z.array(
|
|
z.object({
|
|
id: z.string().describe("The proposal's id, as given."),
|
|
link: z.boolean().describe("true: make the link; false: leave the words unlinked."),
|
|
reason: z.string().describe("Why, in at most twelve words, for a person reading a list."),
|
|
}),
|
|
),
|
|
}),
|
|
};
|