Add an ai_disclosure_c2pa submodule: read C2PA content credentials from uploaded files
Problem / Motivation
The recorder API is written for a caller that was present when the content was made — "AI tools call ai_disclosure". For a file the site receives, no such caller exists: the editor did not generate it. The only signal travelling with the file is its C2PA manifest, and the c2pa.created action in it carries the same IPTC URIs your grades already store in iptc_digital_source_type.
Proposed resolution
An ai_disclosure_c2pa submodule, with no change to the main module's data model:
- On save of a participating entity (opt-in per type and bundle), read the attached file's credentials and take the digitalSourceType.
- Resolve it to a grade and call suggest() with ai_disclosure_c2pa as the source, and a note saying what was read, who signed it, and whether the certificate was trusted — recorded, not used as a
filter. apply() stays behind a setting for headless and migration paths. - An unmatched URI logs and stops. Never a guessed grade.
Worth flagging early: the URI does not identify a grade. In the shipped grades trainedAlgorithmicMedia sits on both ai_generated_autonomous and ai_deepfake, and compositeWithTrainedAlgorithmicMedia on three. Nothing in the grade schema breaks the tie, and your code only ever writes that field — MachineReadableMarking emits it as JSON-LD — so the collision has never had to be resolved. I would ship a configurable URI-to-grade map with a default per URI rather than a rule: trainedAlgorithmicMedia should default to ai_generated_autonomous and not to ai_deepfake, because a manifest can say an asset is machine-made and never that it depicts a real person. "Lowest severity" is not that rule — for compositeWithTrainedAlgorithmicMedia it would land on ai_summarized.
The question before any code
As far as I can tell a submodule cannot bring a PHP library with it. Drupal.org packages submodules as metapackages whose requires are generated from .info.yml, drupal/commerce_payment requires drupal/commerce, and I found no submodule metapackage carrying a non-Drupal requirement. If that holds, the C2PA library lands in this project's root composer.json for every site rather than only those enabling the submodule, which may make a separate contrib project the better home. You will know this better than I do.
Who would write it
I maintain provemark/content-credentials (MIT) and would write the submodule and its tests. Reading needs either a sidecar service or the ext-c2pa extension today; a third route that shells out to the c2patool binary is specified but not built. If you would rather keep this out of the project, I will build it separately against the recorder API — that needs nothing from you.