fix(modes): ticking "Reference files" in Technical Interview did not actually ground in them - #521
Conversation
…ep modes Follow-up to #520. T8 gave technical-interview a reference pool and put `reference_files` into its permitted switches, so the "Primary knowledge source" control offers it and an attached file became REACHABLE -- second-person reachability went 0/6 to 6/6. But `buildUserSourceContract` pinned `defaultOwner: 'profile'` for interview-prep templates REGARDLESS of what the user ticked, so the saved contract still resolved `profile_only`, `documentGroundedFromContract` still returned false, and `forceDocumentGrounding` stayed off. Measured, identical user selection, two modes: technical-interview + reference_files -> profile_only docGrounded=false general + reference_files -> reference_files_primary docGrounded=true So everything gated on that switch stayed off in the one mode whose users are most likely to upload project documents: topK 6 and a 1800-token budget instead of 12/3600, no per-file floor, no answerability scoring, no section-target or positional restore, no identity block, no query normalization. A user could ask for their reference files and be handed a materially weaker retrieval than the same files in General -- which is the mode inversion the beta report described, surviving the fix that was supposed to close it. #520's commit message claimed this clause of the decision ("restores documentCentricMode routing") was delivered. It was not, and I did not verify it. This is that verification, and the fix. UPLOAD IS STILL NOT CONSENT. This reads the user's EXPLICIT switch, never the presence of a file. A mode without the tick keeps `profile` and behaves exactly as before -- asserted for both interview-prep templates, with no switches and with profile+JD only. THE MEMORY-POLICY CONSEQUENCE IS REAL and is pinned in the suite rather than left to surface as a bug report. Reference-files ownership forbids Hindsight (invariant #3), so a mode the user grounds this way loses: allowHindsight true -> FALSE cross-meeting recall is off allowPriorAssistantFacts true -> FALSE the assistant's own prior output stops counting as evidence, which is a fabrication vector closing allowPriorAssistantReferents stays TRUE, so follow-ups still resolve That is a consequence of the user's own explicit choice, and the interview-prep seed comment says document-grounded modes must not use Hindsight. Flagged for the owner because it is a live behaviour change, not because it is unintended. Behind NATIVELY_RETRIEVAL_INTERVIEW_PREP_HONORS_REFERENCE_SWITCH, default ON via a literal, proven to reproduce the pre-fix behaviour when off. Non-interview templates are asserted byte-identical with the flag in either position. test:intelligence 2037/0; services 3402/0. Reviewed but not executed on macOS and Windows (pure TypeScript, no platform branch). The suite runs under the services glob, which is Windows-ADVISORY (`continue-on-error`), so this is `Covered by automated macOS branch tests` and `Requires physical Windows verification`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014D8QkwcTrpGVPmkWHrp4Nz
|
React Doctor found 4 issues in 1 file · 4 warnings · score 92 / 100 (Great) · vs 4 warnings
|
|
| Filename | Overview |
|---|---|
| electron/services/ModesManager.ts | Changes interview-prep ownership when reference files are selected, but the resulting owner drops simultaneously selected profile and job-description evidence. |
| electron/context-intelligence/contracts/retrieval-flags.ts | Adds a default-on, environment-overridable flag using the existing environment-independent retrieval flag pattern. |
| electron/services/tests/InterviewPrepReferenceSwitch2026_08_29.test.mjs | Thoroughly covers grounding and memory-policy behavior but asserts only the resulting authority, not that co-selected profile and job-description sources remain usable. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Interview-prep source selections] --> B{Reference files selected?}
B -->|No| C[Profile owner]
B -->|Yes and flag enabled| D[Reference-files owner]
D --> E[Document-grounded retrieval]
D --> F[Reference-file capabilities]
F --> G[Profile and JD sources forbidden]
Reviews (1): Last reviewed commit: "fix(modes): honour an explicit reference..." | Re-trigger Greptile
| const userChoseReferenceFiles = switches.includes('reference_files') | ||
| && isRetrievalFixEnabled('interviewPrepHonorsReferenceSwitch'); | ||
| const defaultOwner: ModeSourceOwner = (isInterviewPrep && !userChoseReferenceFiles) | ||
| ? 'profile' | ||
| : 'reference_files'; |
There was a problem hiding this comment.
Co-selected profile sources are forbidden
When an interview-prep mode is saved with reference_files alongside profile or job_description, this changes the owner to reference_files; the resulting capability branch forbids résumé, project, and job-description evidence, causing answers to ignore sources the user explicitly selected.
Knowledge Base Used:
Follow-up to #520. One line of behaviour, one flag, one suite.
The gap
#520 gave
technical-interviewa reference pool and putreference_filesinto its permitted switches, so the "Primary knowledge source" control offers it and an attached file became reachable — second-person reachability went 0/6 → 6/6.But
ModesManager.buildUserSourceContractpinneddefaultOwner: 'profile'for interview-prep templates regardless of what the user ticked. So the saved contract still resolvedprofile_only,documentGroundedFromContractstill returned false, andforceDocumentGroundingstayed off.Measured — identical user selection, two modes:
technical-interview+ reference_filesprofile_onlygeneral+ reference_filesreference_files_primaryEverything gated on that switch therefore stayed off in the one mode whose users are most likely to upload project documents: topK 6 and a 1800-token budget instead of 12/3600, no per-file floor, no answerability scoring, no section-target or positional restore, no identity block, no query normalization.
A user could ask for their reference files and be handed a materially weaker retrieval than the same files in General — which is the mode inversion the beta report described, surviving the fix that was supposed to close it.
#520's T8 commit message claimed this clause ("restores
documentCentricModerouting") was delivered. It wasn't, and I didn't verify it. This is that verification, and the fix.Upload is still not consent
The rule #520 was built around is unchanged. This reads the user's explicit switch, never the presence of a file. A mode without the tick keeps
profileand behaves exactly as before — asserted for both interview-prep templates, with no switches and with profile+JD only. Non-interview templates are asserted byte-identical with the flag in either position.Reference-files ownership forbids Hindsight (invariant #3), so a mode the user grounds this way loses:
allowHindsightallowPriorAssistantFactsallowPriorAssistantReferentsThis follows from the user's own explicit choice, and the interview-prep seed comment states that document-grounded modes must not use Hindsight. It's pinned in the suite rather than left to surface later as a bug report — but it is a live behaviour change and worth your call before merge, since "Technical Interview remembers the ongoing interview" was a deliberate property.
If you'd rather keep Hindsight for grounded interview-prep modes, that needs a new authority (
profile_plus_reference_files) with its ownEVIDENCE_REQUIRED/CONFLICT_POLICY/memoryPolicyentries — a larger change I did not make unilaterally.Verification
test:intelligence2037/0 · services 3402/0 · typecheck clean.Behind
NATIVELY_RETRIEVAL_INTERVIEW_PREP_HONORS_REFERENCE_SWITCH, default ON via a literal (identical in dev/test/production), proven to reproduce the pre-fix behaviour when off.Pure TypeScript, no
process.platformbranch. The suite runs under the services glob, which is Windows-advisory — soCovered by automated macOS branch testsandRequires physical Windows verification.🤖 Generated with Claude Code
https://claude.ai/code/session_014D8QkwcTrpGVPmkWHrp4Nz