Bug: Preview/present pipeline writes AI provenance marks into user deliverables (docx page footer, HTML AI生成 comment + data-aigc-mark)
Summary
MiMo Desktop preview / present pipeline appears to rewrite user deliverable files on disk, injecting AI provenance marks that were never in the author’s source. Reproduced twice (docx + html) with the same injector signatures.
This violates delivery rules (e.g. study-guide-maker skill: finished HTML/Word/PDF must not contain AI生成, data-aigc-mark, or any AI-source markers) and modifies user files without consent, breaking integrity/hashes.
Environment
- App: MiMo Desktop (Windows)
- Date: 2026-09-25
- Session: 「校外」 (AP Physics C)
Reproduction
- Generate a clean file (script source has no AI marks).
- present / preview it in MiMo Desktop (docx preview panel or HTML artifact).
- Re-read the file from disk.
- AI marks are present.
Observed injections
1. DOCX
File: AP_Physics_C_Ch1_Kinematics_笔记完整还原.docx
- In
word/document.xml, page-number marker text becomes e.g.
— 44 / 44 —(AI生成) - Generation script source does not contain this string (script clean, docx dirty).
- Suspected: docx preview/open path rewrites the package.
2. HTML
File: index.html (same directory)
Two injections:
- First line:
<!-- AI生成 --> - After
<body>:
<p data-aigc-mark="1" style="...">AI生成</p>
Neither was written by the author; both appear after present/preview.
Impact
- Breaks skill/delivery policy (no AI marks in shipped HTML/Word/PDF).
- Unauthorized mutation of user artifacts; SHA/hash of “source of truth” no longer matches what was generated.
- Confusing for downstream consumers who verify file contents.
Expected
- Preview/present must be read-only on the original file (render-layer watermark only if legally required — never write back).
- Default: no on-disk AI marks in user deliverables; if any mark is mandatory, use a separate sidecar or in-panel overlay, not file mutation.
Actual
On-disk files rewritten with AI生成 / data-aigc-mark / modified page footer after preview.
Repro files
E:\NMDX\NMDX-User Workspace\AP-Physics-C\index.htmlE:\NMDX\NMDX-User Workspace\AP-Physics-C\AP_Physics_C_Ch1_Kinematics_笔记完整还原.docx
Suggested fix
- Audit present/preview post-processing for docx/html (and PDF if similar).
- Stop writing marks into the source file; use render-only overlay if needed.
- Optionally verify: hash before open vs after close in a test.
Labels
bug, desktop, office
Code-level root cause (from Desktop app.asar)
Injection is intentional AIGC deliverable marking, not a preview glitch. It rewrites files on disk when artifacts are presented/delivered.
Constants
const Ja = "(AI生成)"; // docx / office suffix
const ME = "AI生成"; // html label text
HTML — function Rwe (matches the two injections in index.html)
Owe()→<p data-aigc-mark="1" style="...">AI生成</p>inserted after<body…>Mwe()→<!-- AI生成 -->prepended if not already present- Idempotent via
dj()checking(AI生成)/data-aigc-mark="1"/AI生成
DOCX — function _we
- Opens package with JSZip, edits
word/document.xml - Appends
(AI生成)into the last paragraph’s</w:t>(or inserts a new<w:p>before</w:body>) - Writes back into the same file path
Other kinds in the same module
| kind | method |
|---|---|
| xlsx | Python/openpyxl appends to cell A1 |
| pptx | badge on last slide only |
| wav/mp3 | tail rhythm marker (880 Hz pattern) |
| png/jpg | stamps assets/ai-watermark.png |
Trigger path
artifacts.ingestPresentFiles(...) // present_files tool
→ markDeliverable({ localPath, kind }) // role === "deliverable"
→ M7 ensure / re-mark
→ log: "[aigc-mark] marked deliverable kind=... path=..."
Also re-runs on findDelivered when an existing deliverable is opened; aigcPending retries when the file appears later.
Observations for the fix request
- No user-facing toggle found (searched
AIGC_MARK/watermarkEnabled/ similar) — marking is default-on. - Writes source deliverable, not a render overlay — breaks hashes and skill delivery rules (no
AI生成/data-aigc-markin shipped HTML/Word/PDF). - Matches the repro: clean generator → present/preview → marks appear on disk.
Request (restated)
- Do not write marks into the user’s source file during present/preview (read-only preview).
- If policy requires a mark, default to in-panel/render-only, or an explicit opt-in export path; never silent mutation of the original.
- Add a setting to disable on-disk AIGC marking for users whose delivery specs forbid it.
- After a no-op preview, file hash must be unchanged (easy regression test).
Third reproduction — injection timing confirmed (present → immediate rewrite)
Just now (2026-09-25, session 「校外」):
- File on disk clean before
present_files - Called
present_filesonindex.html - Immediately re-read the file → both marks present again:
- line 1:
<!-- AI生成 --> - after
<body>:<p data-aigc-mark="1" …>AI生成</p>
- line 1:
- Marks were not authored; file was clean immediately before present
- Cleared again; file is clean now
Timing conclusion
Injection happens synchronously at present/preview time — same tick as present_files / artifact open, not a delayed background job. This matches artifacts.ingestPresentFiles → markDeliverable in app.asar.
Note on DOCX this round
- Same batch:
index.htmlwas marked; the docx was not injected this time. - Previous round: docx was marked when opened/rendered (different path than present).
- So: HTML → present_files write path; DOCX → open/preview write path (two entry points into the same
markDeliverablefamily).
Ask (focused)
Please inspect the present_files / artifact present entry first: it must be read-only on the source path. Hash-before vs hash-after present should be a unit test (expect unchanged when marking is disabled or when source is user-owned).
内测的时候我记得生成的文件是没有这个标记的,然后最近正式版才发现了有这个