Versions 200 to 201
Lines 7–17 at 201 (were 7–13 at 200)
88
1011
12+// The questions are the open server's own (server/src/autosettle.ts), so Jev and Clef are asked alike.
14+
1216
Lines 71–80 at 201 (were 67–145 at 200)
6973
70−const text = (lines: readonly string[]): string => (lines.length === 0 ? "(no lines)" : lines.join("\n"));
71−
72−function stateOf(h: Hold): Record<string, unknown> {
73− return {
74− file: h.file,
75− lines_above: text(h.before),
76− before_either_change: text(h.base),
77− yours: text(h.yours),
78− theirs: text(h.theirs),
79− lines_below: text(h.after),
80− your_push: { agent: h.yourAgent ?? "you", message: h.yourMessage ?? "(no message)" },
81− their_push: { agent: h.theirAgent ?? "the other agent", message: h.theirMessage ?? "(no message)" },
82− ...(h.issue ? { issue: h.issue } : {}),
83− };
84−}
85−
86−const INSTRUCTIONS =
87− "Two agents changed the same lines of `file`. Both started from `before_either_change`. " +
88− "`yours` is what the held agent wrote, for the reason in `your_push`; `theirs` was pushed first, for the reason in `their_push`. " +
89− "The region sits between `lines_above` and `lines_below`. " +
90− "Which result is correct code that does what both pushes meant?";
91−
92−const CRITERIA: Record<Pick, string> = {
93− yours: "Keep `yours` only: `yours` already does what `theirs` meant, or `theirs` is wrong or out of date.",
94− theirs: "Keep `theirs` only: `theirs` already does what `yours` meant, or `yours` is wrong or out of date.",
95− both: "Keep both unchanged, `yours` then `theirs`: they add separate things that work side by side, and nothing is duplicated or contradicts.",
96− agent:
97− "Neither side alone and not both unchanged: the sides change the same thing in different ways (such as two different values for one setting), or keeping both would duplicate or contradict, so a correct result needs a hand edit.",
98−};
99−
100−function choice(order: readonly Pick[]) {
101− return {
102− type: "choice",
103− instructions: INSTRUCTIONS,
104− criteria: Object.fromEntries(order.map((p) => [p, CRITERIA[p]])),
105− };
106−}
107−
108−const SIGNS: Record<string, string> = {
109− same_setting_different_values:
110− "Do `yours` and `theirs` set the same setting, constant or value to two different values?",
111− theirs_covers_yours: "Does `theirs` already do everything `yours` was changed to do?",
112− yours_covers_theirs: "Does `yours` already do everything `theirs` was changed to do?",
113− both_unchanged_compiles:
114− "If `yours` were placed directly above `theirs`, unchanged, would the file still be correct code with nothing defined twice?",
115−};
116−
117−function confidenceOf(p: Record<Pick, number>): number {
118− const max = Math.max(...PICKS.map((k) => p[k]));
119− const even = 1 / PICKS.length;
120− return Math.max(0, (max - even) / (1 - even));
121−}
122−
12677
127−/**
128− * One System One request (TypeSafe's API, which Cloudflare's Clef also takes): the choice in two option orders
129− * (Jev's docs warn order can sway a Choice) and the side questions.
130− */
131−export function systemOneBody(h: Hold, model: string) {
132− return {
133− model,
134− state: stateOf(h),
135− questions: {
136− settle: choice(PICKS),
137− settle_reversed: choice([...PICKS].reverse()),
138− ...Object.fromEntries(Object.entries(SIGNS).map(([id, q]) => [id, { type: "noul", instructions: q }])),
139− },
140− };
141−}
142−
14580 answers: Record<string, { type: string; probabilities?: Record<string, number>; noul?: number; choice?: string }>;
- MCP
- compare on this site's /mcp
- CLI
- abso diff 200 201 scripts/autosettle/jev.ts --json
- JSON
- /christopher/abso-core/compare/200..201?file=scripts%2Fautosettle%2Fjev.ts&format=json