MiMo-Code icon indicating copy to clipboard operation
MiMo-Code copied to clipboard

Bug: Preview/present pipeline writes AI provenance marks into user deliverables (docx page footer, HTML AI生成 comment + data-aigc-mark)

Open NMDX0721 opened this issue 2 months ago • 3 comments

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

  1. Generate a clean file (script source has no AI marks).
  2. present / preview it in MiMo Desktop (docx preview panel or HTML artifact).
  3. Re-read the file from disk.
  4. 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:

  1. First line: <!-- AI生成 -->
  2. 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.html
  • E:\NMDX\NMDX-User Workspace\AP-Physics-C\AP_Physics_C_Ch1_Kinematics_笔记完整还原.docx

Suggested fix

  1. Audit present/preview post-processing for docx/html (and PDF if similar).
  2. Stop writing marks into the source file; use render-only overlay if needed.
  3. Optionally verify: hash before open vs after close in a test.

Labels

bug, desktop, office

NMDX0721 avatar Sep 26 '26 05:09 NMDX0721

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

  1. No user-facing toggle found (searched AIGC_MARK / watermarkEnabled / similar) — marking is default-on.
  2. Writes source deliverable, not a render overlay — breaks hashes and skill delivery rules (no AI生成 / data-aigc-mark in shipped HTML/Word/PDF).
  3. Matches the repro: clean generator → present/preview → marks appear on disk.

Request (restated)

  1. Do not write marks into the user’s source file during present/preview (read-only preview).
  2. If policy requires a mark, default to in-panel/render-only, or an explicit opt-in export path; never silent mutation of the original.
  3. Add a setting to disable on-disk AIGC marking for users whose delivery specs forbid it.
  4. After a no-op preview, file hash must be unchanged (easy regression test).

NMDX0721 avatar Sep 26 '26 05:09 NMDX0721

Third reproduction — injection timing confirmed (present → immediate rewrite)

Just now (2026-09-25, session 「校外」):

  1. File on disk clean before present_files
  2. Called present_files on index.html
  3. Immediately re-read the file → both marks present again:
    • line 1: <!-- AI生成 -->
    • after <body>: <p data-aigc-mark="1" …>AI生成</p>
  4. Marks were not authored; file was clean immediately before present
  5. 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.html was 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 markDeliverable family).

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).

NMDX0721 avatar Sep 26 '26 05:09 NMDX0721

内测的时候我记得生成的文件是没有这个标记的,然后最近正式版才发现了有这个

WANzhen1 avatar Sep 26 '26 07:09 WANzhen1