Skip to content

Conversation

@scouten-adobe
Copy link
Collaborator

@scouten-adobe scouten-adobe commented Nov 14, 2025

No description provided.

@scouten-adobe scouten-adobe self-assigned this Nov 14, 2025
@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.47%. Comparing base (b527235) to head (8e1b487).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1599   +/-   ##
=======================================
  Coverage   75.47%   75.47%           
=======================================
  Files         165      165           
  Lines       37019    37019           
=======================================
  Hits        27941    27941           
  Misses       9078     9078           

☔ 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 14, 2025

CodSpeed Performance Report

Merging #1599 will not alter performance

Comparing scouten/doc-top-level-architecture (8e1b487) with main (b527235)

Summary

✅ 16 untouched
⏩ 2 skipped1

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.


## Architectural overview

The SDK follows a layered architecture that separates concerns between user-facing APIs, data models, storage, asset I/O, cryptography, and validation.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would call user-facing APIs -> public APIs. It's what they are,e ventually.

The SDK follows a layered architecture that separates concerns between user-facing APIs, data models, storage, asset I/O, cryptography, and validation.

```mermaid
graph TB
Copy link
Contributor

Choose a reason for hiding this comment

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

I sometimes consider the signer public, because users can technically define theirs (callback signers).

##### Key responsibilities

- Assemble manifest definitions from ingredients, assertions, and resources
- Coordinate with signers to create cryptographic signatures
Copy link
Contributor

Choose a reason for hiding this comment

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

Here, that is why I see Signers as public. They are not totally hidden.


- Assemble manifest definitions from ingredients, assertions, and resources
- Coordinate with signers to create cryptographic signatures
- Embed signed manifests into assets via asset handlers
Copy link
Contributor

Choose a reason for hiding this comment

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

asset handlers = format handlers?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes internally we reference them as asset handlers. I usually like to refer to them as parsers although I'm not sure what language is most clear.

Copy link
Contributor

Choose a reason for hiding this comment

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

So we have multiple vocabulary options here ;). Maybe we need a glossary at the top..


##### Key responsibilities

- Extract JUMBF manifest stores from assets
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rather say read? Since the JUMBF is left in place in the asset, reading is not destructive

- Load JUMBF from asset streams (via appropriate handler)
- Save JUMBF to asset streams (via appropriate handler)
- Support multiple asset formats through handler registry
- Provide format detection
Copy link
Contributor

Choose a reason for hiding this comment

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

Already? I thought that was WIP for some?


##### Key responsibilities

- Define `ValidationState` enum (Invalid, Valid, Trusted)
Copy link
Contributor

Choose a reason for hiding this comment

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

Link to the spec maybe?

- Define `ValidationState` enum (Invalid, Valid, Trusted)
- Track validation status codes (success, informational, failure)
- Support ingredient delta validation (changes from previous validation)
- Provide structured reporting for validation outcomes
Copy link
Contributor

Choose a reason for hiding this comment

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

I would put that bullet point second, because the others then clarify this

- Provide event iteration and reporting
- Convert to user-facing validation results

### Identity layer
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that one may need to be higher up?


Builder->>Claim: Build claim structure
Claim->>Claim: Add assertions
Claim->>Claim: Add ingredients
Copy link
Contributor

Choose a reason for hiding this comment

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

Add ingredients technically is optional (especially if you "create" an asset, which does not have a parent).

Comment on lines +72 to +75
style Builder fill:#fff4e1
style Reader fill:#e1f5ff
style Store fill:#e8f5e9
style Crypto fill:#f3e5f5
Copy link
Contributor

Choose a reason for hiding this comment

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

The colors here can be difficult to see in dark mode.

Copy link
Contributor

Choose a reason for hiding this comment

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

Image


The SDK follows a layered architecture that separates concerns between user-facing APIs, data models, storage, asset I/O, cryptography, and validation.

```mermaid
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure how accurate this diagram is. There's a few places where the arrows are incorrect, e.g. asset_io doesn't reference jumbf_io, the claim doesn't reference the resource store, etc. I think there's also quite a few missing arrows too, such as in the validation layer.


The outermost layer provides high-level APIs for common workflows.

#### `Builder` ([builder.rs](builder.rs))
Copy link
Contributor

Choose a reason for hiding this comment

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

This is really cool how it knows where to reference the file.


#### `Builder` ([builder.rs](builder.rs))

Creates and signs C2PA manifests. The `Builder` provides both declarative (JSON-based) and imperative (method-based) interfaces for constructing manifests.
Copy link
Contributor

Choose a reason for hiding this comment

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

I like to think of the JSON API as a separate API that's above the Builder. The definitions are a bit intertwined but there's ongoing work to fix that.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a little bit like the Signer, they work together eventually.


- Assemble manifest definitions from ingredients, assertions, and resources
- Coordinate with signers to create cryptographic signatures
- Embed signed manifests into assets via asset handlers
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes internally we reference them as asset handlers. I usually like to refer to them as parsers although I'm not sure what language is most clear.

- [`Assertion`](#assertion-assertionrs)
- [`assertions/`](#assertions)
- [`hashed_uri.rs`](hashed_uri.rs)
- [`ResourceStore`](#resourcestore-resource_storers)
Copy link
Contributor

Choose a reason for hiding this comment

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

Claim doesn't use the ResourceStore.

- [`assertions/`](#assertions)
- [`ResourceStore`](#resourcestore-resource_storers)

#### `Ingredient` ([ingredient.rs](ingredient.rs))
Copy link
Contributor

Choose a reason for hiding this comment

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

We should make it clear here that an "ingredient" is really just an assertion that wraps a C2PA manifest. I believe there is ongoing work to clarify this in the APIs.


Defines traits for asset I/O operations. These traits abstract over different asset formats, allowing the SDK to handle JPEG, PNG, MP4, and other formats uniformly.

##### Key traits
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a few more traits we may want to describe here. There's also the CAIRead trait.

- Load JUMBF from asset streams (via appropriate handler)
- Save JUMBF to asset streams (via appropriate handler)
- Support multiple asset formats through handler registry
- Provide format detection
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't necessarily detect formats.


Defines the `Signer` and `AsyncSigner` traits that abstract over different signing implementations. This allows the SDK to work with various signing mechanisms (local keys, HSMs, remote services, etc.).

##### Key responsibilities
Copy link
Contributor

Choose a reason for hiding this comment

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

Also good to mention time authorities here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't that Coordinate with timestamp authorities? Or do you mean more details?


#### `Builder` ([builder.rs](builder.rs))

Creates and signs C2PA manifests. The `Builder` provides both declarative (JSON-based) and imperative (method-based) interfaces for constructing manifests.
Copy link
Contributor

Choose a reason for hiding this comment

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

It's a little bit like the Signer, they work together eventually.


- Assemble manifest definitions from ingredients, assertions, and resources
- Coordinate with signers to create cryptographic signatures
- Embed signed manifests into assets via asset handlers
Copy link
Contributor

Choose a reason for hiding this comment

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

So we have multiple vocabulary options here ;). Maybe we need a glossary at the top..

- [`status_tracker/`](#status_tracker)
- [`asset_io.rs`](#asset_iors)

#### Public type exports
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should just keep the ones that are stable, and exposed in the other SDKs?
Reader, Builder, Signer for instance are good candidates.


Defines the `Signer` and `AsyncSigner` traits that abstract over different signing implementations. This allows the SDK to work with various signing mechanisms (local keys, HSMs, remote services, etc.).

##### Key responsibilities
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't that Coordinate with timestamp authorities? Or do you mean more details?


- Wrap callback functions as `Signer` trait
- Support custom signing logic
- Enable HSM and remote signing workflows
Copy link
Contributor

Choose a reason for hiding this comment

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

HSM?

- Validate certificate chains against trust anchors
- Verify timestamp tokens
- Check OCSP responses
- Apply trust policies and EKU requirements
Copy link
Contributor

Choose a reason for hiding this comment

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

EKU?


### Specialized modules

#### [dynamic_assertion.rs](dynamic_assertion.rs)
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't that a key module? Eg. to add CAWG data on signing?


#### [settings/](settings/)

SDK-wide configuration system using thread-local settings.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
SDK-wide configuration system using thread-local settings.
SDK-wide configuration system using *thread-local* settings.

It needs the emphasis, currently.

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.

4 participants