Skip to content

Conversation

gpeacock
Copy link
Collaborator

The 2.2 spec includes replaces the assertions array with two separate assertions arrays, one for gathered_assertions and another for created_assertions. The idea is that signer is responsible for the created assertions and others are considered gathered.
In order to keep the api as consistent as possible, we only have one assertions array, but individual assertions can be set to a created state. If the created flag is not set, the assertion is considered gathered.
The API defaults all v2 claim assertions as gathered except for hard bindings which are generated by the API.
Hard bindings are only reported in the detailed report where you will see them in a created_assertions, vs gathered_assertions array.
When passing in an assertion via JSON you can add a created: = true field to specify that an individual assertion should be considered created. The ManifestAssertion in the Reader will also show the created state.

@gpeacock gpeacock added needs-doc Any change that affects user documentation safe to test labels Sep 18, 2025
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

❌ Patch coverage is 86.32075% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.43%. Comparing base (3b42e20) to head (1b8ff32).

Files with missing lines Patch % Lines
sdk/src/assertion.rs 23.52% 13 Missing ⚠️
sdk/src/claim.rs 89.83% 6 Missing ⚠️
sdk/src/assertions/labels.rs 80.00% 5 Missing ⚠️
sdk/src/builder.rs 96.66% 2 Missing ⚠️
sdk/src/manifest_assertion.rs 83.33% 2 Missing ⚠️
sdk/src/store.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1432      +/-   ##
==========================================
+ Coverage   78.37%   78.43%   +0.06%     
==========================================
  Files         162      162              
  Lines       39567    39615      +48     
==========================================
+ Hits        31010    31073      +63     
+ Misses       8557     8542      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

codspeed-hq bot commented Sep 18, 2025

CodSpeed Performance Report

Merging #1432 will degrade performances by 11.9%

Comparing gpeacock/assertions_created (1b8ff32) with main (3b42e20)

Summary

❌ 1 regression
✅ 15 untouched
⏩ 2 skipped1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
sign 100kb tiff 4.8 ms 5.5 ms -11.9%

Footnotes

  1. 2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

add_action will now insert created and opened at the top of the actions (fixes a duplicate action bug)
Updates v2api example to add an opened action
the add_assertion method will now determine when salting and created/vs gathered are needed.
A list of created assertion names can be provided in settings, and you can still call add_created_assertion when needed.
All assertions are considered gathered by default except for hard bindings.
All redactable assertions are salted.
Adding a custom salt is now private to Claim but can be made public if needed (it was never used)
add_assertion_with_salt and add_gathered_assertion_with salt have been removed.
}

/// Returns the content type for this assertion based on its kind
fn content_type(&self) -> &str {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this used for?

/// Note, this does not check for duplicates since it does not return errors.
pub fn add_action(mut self, action: Action) -> Self {
self.actions.push(action);
if action.action() == c2pa_action::OPENED || action.action() == c2pa_action::CREATED {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to check that there is only one as well?

renamed settings.builder.created_assertions to created_assertion_labels
salt all assertions
removes unused AssertionBinary code.
changed v2api.rs to api.rs
removed unused experimental assertion static apis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-doc Any change that affects user documentation safe to test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants