Skip to content

resolvers: populate PRONOM PUID, LoC FDD, and subformat metadata (#1618) - #1624

Merged
corkamig merged 1 commit into
google:mainfrom
corkamig:issue-1618-metadata
Nov 13, 2026
Merged

corkamig merged 1 commit into
google:mainfrom
corkamig:issue-1618-metadata

Conversation

@corkamig

Copy link
Copy Markdown
Collaborator

Follow-up to #1618: populate RegularFileType::metadata for files identified by native resolvers using the new key-value store:

  • pronom_puid: UK National Archives PRONOM PUID (271 unique PUIDs)
  • loc_fdd: US Library of Congress FDD identifier (132 unique FDDs)
  • subformat: finer-grained variant already distinguished by existing verifiers (437 subformats across 129 content types, 183 with subformat-level PUID/FDD overrides)

No new parsing or matching logic is added; resolver ContentType decisions remain identical.

Note on future optimization: subformats are currently stored as static string descriptors for simplicity. If needed later, they can be represented internally as a typed enum tree with optional/lazy string materialization so subformat identification avoids any string handling when metadata is not requested.

Testing

  • rustup run nightly cargo fmt --check (rust/lib, rust/cli)
  • cargo clippy --all-targets -- --deny=warnings (rust/lib default + pipeline,serde, rust/cli)
  • cargo test (rust/lib default + pipeline including new metadata/subformat tests, rust/cli)
  • RUSTDOCFLAGS=--deny=warnings rustup run nightly cargo doc --no-deps --features=_doc
  • uv run scripts/sync_kb.py --self-test --check, check_copyright.py, check_documentation.py

…gle#1618)

Populate RegularFileType::metadata for files identified by native resolvers
using the key-value store introduced in google#1618:

- pronom_puid: UK National Archives PRONOM PUID (271 unique PUIDs)
- loc_fdd: US Library of Congress FDD identifier (132 unique FDDs)
- subformat: finer-grained variant already distinguished by existing verifiers
  (437 subformats across 129 content types, 183 with subformat-level PUID/FDD
  overrides)

No new parsing or matching logic is added; resolver ContentType decisions
remain identical.

Note on future optimization: subformats are currently stored as static string
descriptors for simplicity. If needed later, they can be represented internally
as a typed enum tree with optional/lazy string materialization so subformat
identification avoids any string handling when metadata is not requested.
@corkamig
corkamig requested a review from ia0 as a code owner November 12, 2026 18:46
@reyammer

Copy link
Copy Markdown
Collaborator

So, this is populating the metadata k/v store with "info you find along the way", and then we'll figure out in another PR how/when to show them to CLI clients, right? And: this info would be already part of the what clients of the underlying magika-lib would have access to, right?

@reyammer
reyammer self-requested a review November 13, 2026 14:11
@corkamig
corkamig merged commit 0778889 into google:main Nov 13, 2026
30 checks passed
@corkamig
corkamig deleted the issue-1618-metadata branch November 13, 2026 22:58
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.

3 participants