Repository navigation
Closed
Labels
Description
Problem
Import rejects nothing by format (core/files.ts ImportRejectionReason is size/path/storage only), so a legacy report.doc or ledger.xls lands in the library — and then every layer states something untrue about it:
- Its tab reads "This file is stored locally and can be used as context in a later iteration." (
features/reader/file-preview.tsx:78–86). No tool can read that file, and the sentence points at no path that would. - The agent's own inventory misstates it:
getReadability(features/assistant/create-reader-agent.ts:33–36) marks anything under 5 MiB that isn't a converted kind astextReadable: true, solistpresents the Word binary as readable text. readthen fails throughopenTextSourcewith "This file is not UTF-8 text. If it is text in another encoding, import a UTF-8 copy." (features/assistant/text-source.ts:19–21) — for a.doc, neither half applies: it is not text, and a UTF-8 copy is not a thing its reader could make.- @-mentioning the file sends
recommendedTool: 'read'(core/reader-message.ts:22), steering the agent straight into that failure.
The reader is told the file will be useful, the assistant is told it is readable, and the error advises a repair that does not exist. The product reads .docx/.xlsx fully — the real repair (save as .docx/.xlsx) is never named.
Proposal
- Make
getReadabilityhonest about binary kinds: a file whosepreviewKindisunsupportedreportstextReadable: falsewith a reason naming the state, instead of the size-only rule. - Match the
readfailure to the file: known legacy Office extensions (.doc,.xls) get "save it as .docx/.xlsx to read it here"; other binaries get "stored, but no reader for this format" — never encoding advice. (Read plain text in the encodings readers actually have — GBK .txt meets 'Preview unavailable', and the assistant answers 'import a UTF-8 copy' #160 covers files that genuinely are text in another encoding; this is the binary branch of the same seam.) - Align the preview tab with the same truth: for
.doc/.xls, name the conversion step; drop the "can be used as context" promise for files no tool can read.
Goal
After this, list reports a stored .doc as not text-readable with a reason, read's error names the conversion repair, and the preview tab states the same fact — one file, one story at every layer.
Verification
# the legacy-Office classification must exist before the tests can see it;
# fails today, passes once .doc/.xls get an honest refusal at the seam
grep -rqiE "'doc'|'xls'|msword|legacy office" ui-packages/web/src/core/files.ts ui-packages/web/src/features/assistant/document-access.ts
# a stored .doc fixture: list reports textReadable:false with a reason,
# and read fails with the convert-to-docx advice, not the UTF-8 advice
cd ui-packages/web && pnpm vitest run --project unit src/features/assistant/create-reader-agent.test.ts src/features/assistant/local-tools.test.tsRefs
ui-packages/web/src/features/assistant/create-reader-agent.ts:33— the size-only readability ruleui-packages/web/src/features/reader/file-preview.tsx:78— the overpromising tab messageui-packages/web/src/features/assistant/text-source.ts:19— the wrong-encoding adviceui-packages/web/src/core/reader-message.ts:22—recommendedToolsendsreadui-packages/web/src/core/files.ts:101—previewKindForalready knows docx/xlsx; the extension knowledge to name.doc/.xlslives in the same file- Companion to Read plain text in the encodings readers actually have — GBK .txt meets 'Preview unavailable', and the assistant answers 'import a UTF-8 copy' #160 (text in another encoding gets a decoder; binary gets an honest refusal) and to Tell readers which Word content did not convert, instead of logging it to the browser console #45's principle (say what cannot be read)
Activity
bencode commentedon Oct 21, 2026
Independent review — posted by the scheduled issue-reviewer loop, independent of the authoring session.
Evidence audit (main @
ebb0ee0): all citations hold.previewKind === 'unsupported' && !textReader(features/reader/file-preview.tsx:78–86).textReadable: true(features/assistant/create-reader-agent.ts:33–36).features/assistant/text-source.ts:19–21);recommendedToolsendsreadfor every non-image (core/reader-message.ts:22).ImportRejectionReasonis size/path/storage only (core/files.ts:32–37);previewKindForatfiles.ts:101is where the format knowledge lives.Sensor: lint passed.
verify"passed" is vacuous — the cited test files pass on main with only today's assertions (create-reader-agent.test.ts:553assertstextReadable: truefor.docx; nothing covers.doc). Code confirms not implemented.Sharpening suggestions:
.doc/.xls⇒ unsupported-binary) incore/files.tsbesidepreviewKindFor— one source of truth — and letgetReadability, thereaderror and the preview copy all read it; a shared reason string makes "one file, one story" enforceable.report.doc→listreportstextReadable: falsewith reason;readfails with save-as-docx advice), so the verify gate distinguishes implemented from vacuous pass.Duplicates: none in open+closed titles — #160 is the companion encoding branch, not overlap.
Verdict: valid — stays open.
bencode commentedon Oct 25, 2026
Re-audit — posted by the scheduled issue-reviewer loop, independent of the authoring session. Audited against
main@90b046f.Evidence audit: one anchor drifted, behavior unchanged. Commit
7a022aa("how the assistant opens a document lives in document-access.ts, apart from the agent") moved the size-only readability rule fromcreate-reader-agent.ts:33tofeatures/assistant/document-access.ts:19-22—getReadabilitystill answerstextReadable: truefor any ≤ 5 MiB non-converted kind, so a stored.docstill overpromises exactly as the issue says. All other anchors hold verbatim:file-preview.tsx:79-86("stored locally and can be used as context"),text-source.ts:20(UTF-8 advice),reader-message.ts:22(recommendedTool),files.ts:101(previewKindFor).Duplicate check: none — #160 is the companion encoding branch (bytes that are text), correctly separate.
Verification block repaired (logged here per policy): verify was passing vacuously — both cited test files pass on unmodified main with today's assertions, so the gate reported nothing implemented as implemented. Prepended a discriminating grep over the two candidate seams:
grep -rqiE "'doc'|'xls'|msword|legacy office" ui-packages/web/src/core/files.ts ui-packages/web/src/features/assistant/document-access.tsIt fails today ✓, re-linted ✓, verify now fails today ✓ (was falsely passing). Any honest-refusal implementation must name the legacy extensions somewhere on these surfaces.
Verdict: valid, stays open. The first review's sharpenings stand, now with the moved seam: put the legacy-Office classification in
core/files.tsbesidepreviewKindForand letgetReadability(indocument-access.ts), the read error and the preview copy all read it.