Skip to content

feat: v1.2 answer overhaul — single format + natural answers, coding solver, pronunciation#20

Merged
tpikachu merged 3 commits into
masterfrom
feat/prompt-overhaul
Jul 1, 2026
Merged

feat: v1.2 answer overhaul — single format + natural answers, coding solver, pronunciation#20
tpikachu merged 3 commits into
masterfrom
feat/prompt-overhaul

Conversation

@tpikachu

@tpikachu tpikachu commented Jul 1, 2026

Copy link
Copy Markdown
Owner

No description provided.

tpikachu and others added 3 commits July 1, 2026 09:23
Collapse the two overlapping answer-control axes into one. Delete AnswerStyle
(default/star/technical/conversational — muddy + underused) and promote length
into a single AnswerFormat = key_points | explanation | detailed:

- key_points: terse glanceable bullets (cap 220 tok).
- explanation (NEW): a natural, flowing first-person explanation (cap 340 tok).
- detailed: thorough, with one concrete example (cap 800 tok).

answer.ts merges STYLE_INSTRUCTION + LENGTH_INSTRUCTION into FORMAT_INSTRUCTION,
adds a naturalness / anti-AI directive (contractions, varied sentence length,
banned corporate/AI tells + hedging, first-person — no fake "um"/"uh"), and keeps
the citation + fabrication-guard rules. The single `format` field is threaded
through AnswerPrefs, sessionManager, session.ipc, preload, mockManager, the store,
and the pages; the Cue Card's two controls collapse into one 3-way Format toggle.
Removed Profile.answerStyle — the answer_style DB column is kept (default 'concise')
but unused, so NO migration.

Fixes an e2e regression (session.start old positional args) caught by the
adversarial review; typecheck couldn't see it (inside page.evaluate).

Verified: typecheck · 104 unit · build green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…v1.2 #2)

Upgrade the coding solver (screenshot/clipboard mode). CODING_RULES becomes
codingRules(language):
- Writes the solution in a chosen language (default javascript), with REQUIRED
  clear inline comments.
- Explanation-first delivery: a natural Approach paragraph, then the code.
- Keeps the OPTIMALITY mandate + explicit time/space complexity.
- Stays résumé/JD-free (a coding problem is unrelated to the profile).

solveFromOcr(text, language) / solveFromImages(dataUrls, language) build the
system prompt per-call; codingMode threads a persisted `codingLanguage` setting
(default javascript) into every solve. New AppSettings.codingLanguage +
SETTINGS_KEYS.codingLanguage (in APP_SETTING_KEYS), persisted via settings.set;
a 12-language dropdown in the Cue Card coding controls (mirrors the model/effort
pickers). Adversarial review: no findings.

Verified: typecheck · 104 unit · build green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pronunciation is ON by default (still toggleable). The answer stays clean — no
inline respellings; instead, for genuinely hard words the model appends a
[[PRONUNCIATION]] section (one pipe line per word: word | pos | singular |
respelling), which the Cue Card renders as a structured "🗣 How to say it" panel
below the answer. +160 max_output_tokens headroom when on so the guide can't eat
the answer. goLive defaults pronunciation=true (live-state + broadcast).

Parsing extracted to overlay/pronunciation.ts (splitPronunciation) and hardened
per adversarial review (5 confirmed parser-robustness findings, all model-output
variance):
- respelling taken as the LAST field → 2/3/4-field lines all parse (a dropped
  optional singular no longer drops the word);
- marker match case/space-insensitive + strips trailing partial prefixes
  ([[, [[P, [[PR, [[PRO) so nothing flickers into the body while streaming;
- —/–/-/n/a/none singular placeholders normalize to empty.
Locked with pronunciation.test.ts (+8).

Verified: typecheck · 113 unit · build green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tpikachu tpikachu merged commit 0c470f2 into master Jul 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant