Map nested Protobuf message types - #71
Merged
Merged
Conversation
The TSP registry refers to messages nested inside other messages (i.e.
TST.GroupByArchive.GroupNodeArchive) exactly as it refers to top-level
ones, but `compute_maps` only walked `DESCRIPTOR.message_types_by_name`,
which lists top-level messages only. Any nested type in the registry was
therefore missing from ID_NAME_MAP, and parsing a document containing one
failed with:
NotImplementedError: Don't know how to parse Protobuf message type 6383
6383 is TST.GroupByArchive.GroupNodeArchive, which lives in
Index/CalculationEngine.iwa in any document with a grouped table. Because
that file is parsed early, the failure aborted `ls`, `cat` and `unpack`
before reaching any slide content.
Walk nested_types recursively when building NAME_CLASS_MAP. All 631
registry entries now resolve, up from 590. Adds tests/test_mapping.py so a
gap in the mapping fails CI rather than waiting for a bug report.
Also emit a repo-relative path in the generated header, instead of baking
in the absolute path of whoever last ran the dumper.
Fixes #64. Fixes #66. Fixes #70.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0179M4xvAKPGrgKpy4AeCsM7
This was referenced Aug 7, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ls,catandunpackfail on any Keynote document containing a grouped table:Message type 6383 is
TST.GroupByArchive.GroupNodeArchive— a nested message.compute_maps()only walkedfile.DESCRIPTOR.message_types_by_name, which lists top-level messages only, so nested types referenced by the TSP registry were silently dropped fromID_NAME_MAP.Index/CalculationEngine.iwais parsed early, so the failure aborted the whole operation before reaching any slide content — making the tool unusable end-to-end on affected decks. This is not a Keynote-version problem: 6383 is already present in the v14.4 registry, it just never resolved to a class.Fix
Recurse into
DESCRIPTOR.nested_typeswhen buildingNAME_CLASS_MAP.NAME_CLASS_MAPID_NAME_MAPEvery entry in the TSP registry now resolves.
Tests
Adds
tests/test_mapping.py, which asserts the mapping is complete rather than waiting for a document to expose a hole. Verified the new tests fail onmaster(3 failures) and pass with the fix. Full suite: 24 passed.Also
The generated header embedded
__file__as an absolute path, baking in the path of whoever last ran the dumper. Now repo-relative.Fixes #46. Fixes #64. Fixes #66. Fixes #70.