Skip to content

Commit 39f1a55

Browse files
feat(tui): select refine source-evidence policy; document default GitHub escalation
- TUI: picking Refine now opens a "source evidence policy" sub-menu (RefineOptions) with three presets — auto (paper-first, escalate to GitHub), GitHub-upfront (--evidence-refs), and no-web (--no-evidence) — so the evidence behaviour is selectable in the TUI, not just via CLI flags. - docs: clarify the default — GitHub IS searched, but only as autonomous escalation on a second stall; --evidence-refs pulls it to the first pass. Gate green: lint, build, 87/87 tests, smoke. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4274e75 commit 39f1a55

2 files changed

Lines changed: 36 additions & 3 deletions

File tree

docs/visioned-self-improvement-changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,11 @@ without losing coherence:
328328
source gaps) and calls `ensureEvidence`; the cache, policy, and accumulation
329329
live entirely in `lib/evidence.ts`. The evidence→amend-only invariant is
330330
unchanged.
331+
- **Control surface.** The policy is selectable both ways: CLI flags
332+
`--evidence-refs` (search GitHub from the first pass) / `--no-evidence` (offline,
333+
spec-only), and a TUI **Refine → source evidence policy** sub-menu offering the
334+
same three presets (auto / GitHub-upfront / no-web). Default in both:
335+
paper-first, auto-escalate to GitHub only if the paper doesn't close the gaps.
331336

332337
## References
333338

lib/tui/app.ts

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,18 +147,42 @@ function SceneList({ onPick, onBack }: { onPick: (id: string) => void; onBack: (
147147
</${Box}>`;
148148
}
149149

150-
function SceneAction({ id, onRun, onBack }: { id: string; onRun: (args: string[]) => void; onBack: () => void }) {
150+
function SceneAction({ id, onRun, onRefine, onBack }: { id: string; onRun: (args: string[]) => void; onRefine: () => void; onBack: () => void }) {
151151
useInput((_input: string, key: { escape: boolean }) => { if (key.escape) onBack(); });
152-
const items: { label: string; value: string[] | 'back' }[] = [
152+
type Act = string[] | 'back' | 'refine';
153+
const items: { label: string; value: Act }[] = [
153154
{ label: 'View — open in the browser', value: ['check', id] },
154-
{ label: 'Refine — 3D ⇄ implementation loop (improve + verify)', value: ['refine', id] },
155+
{ label: 'Refine — 3D ⇄ implementation loop (improve + verify)', value: 'refine' },
155156
{ label: 'Push — open a PR to the gallery', value: ['upload', id] },
156157
{ label: 'Back', value: 'back' },
157158
];
159+
const pick = (it: { value: Act }): void => {
160+
if (it.value === 'back') onBack();
161+
else if (it.value === 'refine') onRefine();
162+
else onRun(it.value);
163+
};
158164
return html`
159165
<${Box} flexDirection="column">
160166
<${Text}>Scene: <${Text} color="cyan" bold>${id}</${Text}></${Text}>
167+
<${Box} marginTop=${1}><${SelectInput} items=${items} onSelect=${pick} /></${Box}>
168+
</${Box}>`;
169+
}
170+
171+
// Refine sub-menu: pick how the closed loop should gather source evidence when it
172+
// stalls (the CLI's --evidence-refs / --no-evidence as selectable presets).
173+
function RefineOptions({ id, onRun, onBack }: { id: string; onRun: (args: string[]) => void; onBack: () => void }) {
174+
useInput((_input: string, key: { escape: boolean }) => { if (key.escape) onBack(); });
175+
const items: { label: string; value: string[] | 'back' }[] = [
176+
{ label: 'Auto evidence — paper first, escalate to GitHub if needed (default)', value: ['refine', id] },
177+
{ label: 'GitHub upfront — also search reference implementations from the start', value: ['refine', id, '--evidence-refs'] },
178+
{ label: 'No web evidence — refine from the spec alone (offline)', value: ['refine', id, '--no-evidence'] },
179+
{ label: 'Back', value: 'back' },
180+
];
181+
return html`
182+
<${Box} flexDirection="column">
183+
<${Text}>Refine <${Text} color="cyan" bold>${id}</${Text}> — source evidence policy</${Text}>
161184
<${Box} marginTop=${1}><${SelectInput} items=${items} onSelect=${(it: { value: string[] | 'back' }) => (it.value === 'back' ? onBack() : onRun(it.value))} /></${Box}>
185+
<${Box} marginTop=${1}><${Text} dimColor>Evidence is cached &amp; reused across runs; it only feeds amend, never the reproduce graders.</${Text}></${Box}>
162186
</${Box}>`;
163187
}
164188

@@ -184,6 +208,10 @@ function App() {
184208
body = html`<${SceneList} onBack=${() => setScreen('menu')} onPick=${(id: string) => { setPicked(id); setScreen('sceneAction'); }} />`;
185209
} else if (screen === 'sceneAction') {
186210
body = html`<${SceneAction} id=${picked} onBack=${() => setScreen('scenes')}
211+
onRefine=${() => setScreen('refineOpts')}
212+
onRun=${(args: string[]) => { setRunArgs(args); setScreen('running'); }} />`;
213+
} else if (screen === 'refineOpts') {
214+
body = html`<${RefineOptions} id=${picked} onBack=${() => setScreen('sceneAction')}
187215
onRun=${(args: string[]) => { setRunArgs(args); setScreen('running'); }} />`;
188216
} else if (screen === 'running') {
189217
body = html`<${Runner} args=${runArgs} onBack=${() => setScreen('menu')} />`;

0 commit comments

Comments
 (0)