Skip to content

PowerPoint: a slide saved here reads back with the ids it was saved with - #862

Merged
nathanohare merged 2 commits into
stagingfrom
claude/project-thread-cqwuns
Nov 29, 2026
Merged

nathanohare merged 2 commits into
stagingfrom
claude/project-thread-cqwuns

Conversation

@nathanohare

@nathanohare nathanohare commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Requested by Nate · project thread

What this changes

A deck opened and saved again, with no changes, now saves the same file. Before, a second save gave text boxes, shapes and structures new internal ids, and gave groups new numbers. The second save then wrote different sid numbers and different ids in the slide's links. The corpus check R1 flagged this on a PowerPoint deck where a text box comes before a ChemDraw object, and the office samplers listed it as known problems F-P-001, F-P-005, F-P-010 and F-P-015.

  • Reading. A slide saved here (one with our layout tag) is read with ids starting at 2^40. Those are far above any id a file has, so they can't be mixed up with ids the tags keep as saved. Once the slide is read:

    • each thing gets the id it was saved with: a text box's or shape's sid, a drawing's CDXML ids, or a kept ChemDraw object's ids;
    • anything else (added in PowerPoint, or copied there with its tags) gets a new id after all the saved ones;
    • followIds (remap-refs.ts) then updates every mention of a reading id in the slide's contents and animations: numbers, numeric keys, and short id strings in lists (step roles), never text.

    Fields the reader keeps as saved hold ids below 2^40, so they now name the right things too. A saved reference that names only things deleted in PowerPoint is taken off, so it can't name a new thing that now has the deleted one's id. Slides from PowerPoint are read as before.

  • Kept ChemDraw objects. A ChemDraw object kept as PowerPoint had it now writes its things' ids in a tag (CHEMILLUSTRATOR_OLE_IDS, next to the object's CDX print), in id order. The reader uses those ids only while the object is unchanged and the counts match, and reads at most 200,000 ids from one tag.

  • Groups. A group saved here keeps its number when its things all carry that number and nothing outside the group does. A thing dragged out of the group in PowerPoint (its tag still naming the group) no longer shares the number.

Changelog

  • Change file: changes/pptx-saved-ids.md

Checklist

  • Real-program check: done. tests/corpus.test.ts with CHEMWEAVE_CORPUS on the deck from the R1 report passes all 7 tests, the second save included. No laptop items needed.

  • Edge cases tested (tests built in code in tests/pptx-saved-ids.test.ts):

    • a PowerPoint-style slide (title, text box, ChemDraw object) saved twice and three times;
    • text, a shape, a structure, a connector, a caption tied to a structure and its animation;
    • a text box copied in PowerPoint with its tags, plus one PowerPoint added;
    • a ChemDraw object copied in PowerPoint (the copy gets new ids);
    • groups, and a member dragged out of its group;
    • a reference to a connector deleted in PowerPoint, with a new line taking its id;
    • a ChemDraw object changed since it was saved;
    • id tags that are malformed, too large in one run or too large in all;
    • followIds on step roles, keys, numbers that aren't ids, text, bytes, and a __proto__ key.

    tests/pptx-tag-stable.test.ts now compares sid numbers too. The sampler entries are off the known list (PPTX_FINDINGS is empty).

    Not covered: decks saved before this change still read their kept ChemDraw objects with new ids once, and the ids are written from then on.

  • License and IP: not needed.

  • Screens: no visible change.

  • Privacy: node scripts/privacy-check.mjs passes. No file from the R1 report is in the repository.

  • Chemistry test values: none added.

  • Replaces: nothing.

  • Kept in step: not affected.

Tests: the PowerPoint, deck, OLE and sampler tests pass (878), as do the regex and catch lints, the tests' name check and npm run typecheck:strict.

🤖 Generated with Claude Code

https://claude.ai/code/session_015xDL2RDfbKRYtRtSD1GTmQ

A deck opened and saved again gave its text boxes, shapes and structures
new ids, so the second save wrote other sid numbers and other ids in the
slide's links (corpus check R1 on a deck from PowerPoint with a text box
before a ChemDraw object; office samplers F-P-001, F-P-005, F-P-010 and
F-P-015).

- A slide saved here is read with ids from 2^40 up, then each thing takes
  the id it was saved with, the rest new ids after those; every mention of
  a reading id in its contents and animations follows.
- A ChemDraw object kept as PowerPoint had it carries its things' ids in a
  tag (CHEMILLUSTRATOR_OLE_IDS, with the object's CDX print), used while
  the object is unchanged.
- A group saved here keeps its number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015xDL2RDfbKRYtRtSD1GTmQ
@nathanohare nathanohare self-assigned this Nov 29, 2026
- A kept ChemDraw object's id tag is read only up to 200,000 ids in all.
- A thing dragged out of a group in PowerPoint no longer shares the group's number.
- A kept object's ids are written in id order, whatever order the drawing holds them in.
- A saved reference naming only things deleted in PowerPoint is taken off, so it can't
  name something new that now has the deleted thing's id.
- Ids given while reading are followed only in numbers, numeric keys and short id strings
  in lists, never in text.
- Tests for each, and for a ChemDraw object copied in PowerPoint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015xDL2RDfbKRYtRtSD1GTmQ
@nathanohare
nathanohare marked this pull request as ready for review November 29, 2026 11:49
@nathanohare
nathanohare enabled auto-merge (squash) November 29, 2026 11:49
@nathanohare
nathanohare merged commit 6134e66 into staging Nov 29, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants