Track 2 of the fake-docx remediation (siblings: feature/docx-generation handles the generation-side root cause).
Why
Agent-generated ".docx" artifacts were historically plain-text bytes; the docx preview fed them straight to mammoth/JSZip which threw Can't find end of central directory (reproduced verbatim with JSZip.loadAsync on text bytes).
Changes
@ui previewKindOf: .docx stays docx; legacy .doc (binary Word, not OOXML) routes to binary + download fallback instead of a guaranteed JSZip explosion.
@ui OfficePreview: user-facing error converges to one actionable line (corrupted / not a valid DOCX / pseudo-Office file); raw error goes to console.
frontend docxLoader: sniff ZIP magic (PK\x03\x04 / PK\x05\x06) before mammoth; non-ZIP bytes render as markdown with a readable note — stock fake docx artifacts become readable immediately.
parent: .gitignore gains .mimosa/ (Mimosa plugin per-session state kept dirtying the tree and blocking precheck).
Preview-layer only, no contract change. Until the generation-side track merges, newly written .docx remains text but previews readably.
Refs: .task/feature-preview-sniff-fallback.md; merge order: Agent-System-UI / Agent-System-Frontend PRs first, then this parent PR (pins those heads).
Track 2 of the fake-docx remediation (siblings: feature/docx-generation handles the generation-side root cause).
## Why
Agent-generated ".docx" artifacts were historically plain-text bytes; the docx preview fed them straight to mammoth/JSZip which threw `Can't find end of central directory` (reproduced verbatim with JSZip.loadAsync on text bytes).
## Changes
- @ui `previewKindOf`: `.docx` stays docx; legacy `.doc` (binary Word, not OOXML) routes to binary + download fallback instead of a guaranteed JSZip explosion.
- @ui `OfficePreview`: user-facing error converges to one actionable line (corrupted / not a valid DOCX / pseudo-Office file); raw error goes to console.
- frontend `docxLoader`: sniff ZIP magic (PK\x03\x04 / PK\x05\x06) before mammoth; non-ZIP bytes render as markdown with a readable note — stock fake docx artifacts become readable immediately.
- parent: `.gitignore` gains `.mimosa/` (Mimosa plugin per-session state kept dirtying the tree and blocking precheck).
## Verification
- make test-ui: tsc --noEmit clean + vitest 49/49 (new: `旧文档.doc → binary`, error-note assertion)
- make test-frontend: vitest 33/33; frontend tsc --noEmit clean
- task-sync checkpoint: sync_base=d64742c71c tested_head=af13fba (2026-09-30T17:51:59Z)
## Impact
Preview-layer only, no contract change. Until the generation-side track merges, newly written .docx remains text but previews readably.
Refs: .task/feature-preview-sniff-fallback.md; merge order: Agent-System-UI / Agent-System-Frontend PRs first, then this parent PR (pins those heads).
Why: track 2 of the fake-docx remediation — read-only preview fallback for
stock text-masquerading docx artifacts; also ignore the Mimosa plugin's
per-session .mimosa state dir that kept dirtying the tree and blocking precheck.
Evidence: modules/ui 83367f7 (doc->binary dispatch + readable Office error),
modules/frontend cd77340 (PK magic sniff + markdown fallback); make test-ui
49/49, make test-frontend 33/33, frontend tsc --noEmit clean.
Impact: parent pins move to the two submodule branches; .gitignore gains
.mimosa/; no code outside those modules.
Refs: .task/feature-preview-sniff-fallback.md
Why: the open preview-sniff PRs were cut before the shell redesign, so
they could not merge. UI and Frontend now contain origin/main plus the
ZIP sniff, including xlsx and pptx text fallback.
Evidence: UI vitest 68 and tsc clean; Frontend vitest 40 and tsc clean.
UI pulls/21 and Frontend pulls/22 updated.
Impact: gitlinks only. Dev still needs to merge origin/main before the
parent PR can land.
Refs: task feature/preview-sniff-fallback
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: the preview sniff branch predated the shell redesign and could not
merge. Module gitlinks now include current main plus ZIP fallback for
docx, xlsx, and pptx.
Evidence: conflict was only the shared sync-log card; both sides' rows
kept. UI and Frontend tests passed on the updated module SHAs.
Impact: parent branch contains origin/main. .mimosa/ ignore stays.
Refs: task feature/preview-sniff-fallback, Dev PR #96
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: the task card still described xlsx/pptx sniff as out of scope, and
the combo test had not been written down after the merge.
Evidence: make test passed on a11fed4 (frontend 40, ui 68).
Impact: task card only.
Refs: Dev PR #96
Co-authored-by: Cursor <cursoragent@cursor.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Track 2 of the fake-docx remediation (siblings: feature/docx-generation handles the generation-side root cause).
Why
Agent-generated ".docx" artifacts were historically plain-text bytes; the docx preview fed them straight to mammoth/JSZip which threw
Can't find end of central directory(reproduced verbatim with JSZip.loadAsync on text bytes).Changes
previewKindOf:.docxstays docx; legacy.doc(binary Word, not OOXML) routes to binary + download fallback instead of a guaranteed JSZip explosion.OfficePreview: user-facing error converges to one actionable line (corrupted / not a valid DOCX / pseudo-Office file); raw error goes to console.docxLoader: sniff ZIP magic (PK\x03\x04 / PK\x05\x06) before mammoth; non-ZIP bytes render as markdown with a readable note — stock fake docx artifacts become readable immediately..gitignoregains.mimosa/(Mimosa plugin per-session state kept dirtying the tree and blocking precheck).Verification
旧文档.doc → binary, error-note assertion)Impact
Preview-layer only, no contract change. Until the generation-side track merges, newly written .docx remains text but previews readably.
Refs: .task/feature-preview-sniff-fallback.md; merge order: Agent-System-UI / Agent-System-Frontend PRs first, then this parent PR (pins those heads).