This project is a command line tool that evaluates a JSON file containing an asset's provenance data against a YAML-based evaluation document. It supports two types of evaluation documents:
- JPEG Trust Profiles — based on the JPEG Trust standard (ISO 21617-1:2025), used to evaluate a Trust Indicator Set
- C2PA Asset Rubrics — based on C2PA conformance specifications, used to evaluate crJSON
This tool also serves to validate forthcoming work in the 2nd Edition of JPEG Trust Part 1 as well as JPEG Trust Part 2 (ISO 21617-2).
-
Clone the repository:
git clone https://github.com/adobe/profile-evaluator.git -
Navigate to the project directory:
cd profile-evaluator -
Install the dependencies:
npm install
To run the tool, use the following command:
node src/index.js [options] <jsonFile>
<jsonFile>- Path to the JSON file containing the asset data to evaluate (Trust Indicator Set or C2PA manifest report)
-p, --profile <path>/-r, --rubric <path>- Path to the evaluation document file (YAML format) — either a JPEG Trust Profile or a C2PA Asset Rubric (--rubricis an alias for--profile, and defaults output to JSON format)
OR
-e, --eval <expression>- JSON formula expression to evaluate against the data (cannot be used with --profile/--rubric)
-o, --output <directory>- Output directory for reports (if not specified, results are printed to console)-y, --yaml- Output report in YAML format (default for profiles)-j, --json- Output report in JSON format (default for rubrics)--html <path>- Path to HTML template file for generating HTML reports-h, --help- Display help information-V, --version- Display version number
-
Basic evaluation (output to console):
node src/index.js -p testfiles/trust-profiles/camera_profile.yml testfiles/trust-profiles/camera_indicators.json -
Generate YAML report in output directory:
node src/index.js -p testfiles/trust-profiles/genai_profile.yml -o output testfiles/trust-profiles/genai_indicators.json -
Generate JSON report:
node src/index.js -p testfiles/trust-profiles/no_manifests_profile.yml -o output --json testfiles/trust-profiles/no_manifests_indicators.json -
Generate HTML report using a template:
node src/index.js -p testfiles/trust-profiles/camera_profile.yml -o output --html testfiles/trust-profiles/report_template.html testfiles/trust-profiles/camera_indicators.json
- Evaluate a C2PA asset against the conformance rubric:
node src/index.js -r testfiles/asset-rubrics/asset-rubric-conformance0.2-spec2.4.yml testfiles/asset-rubrics/capture-non-ai-then-ai-edits.json
-
Evaluate a simple expression against asset data:
node src/index.js --eval "declaration.'claim.v2'.alg" testfiles/trust-profiles/camera_indicators.json -
Check if a property exists:
node src/index.js --eval "has(declaration.assertions)" testfiles/trust-profiles/camera_indicators.json
The --eval option allows you to run JSON formula expressions directly against asset data without requiring a Trust Profile or Asset Rubric. This is useful for:
- Quick data exploration: Extract specific values from asset data
- Property validation: Check if certain fields exist in the data
- Data transformation: Apply expressions to compute derived values
- Debugging: Test expressions before including them in Trust Profiles or Asset Rubrics
The tool supports JSON formula expressions with the following features:
- Property access: Use dot notation (e.g.,
data.field) - Nested properties: Use quotes for special characters (e.g.,
"claim.v2") - Array access: Use bracket notation (e.g.,
array[0]) - Functions: Built-in functions like
has(),length(), etc. - Operators: Standard comparison and logical operators
# Extract a simple property
node src/index.js --eval "declaration" testfiles/trust-profiles/camera_indicators.json
# Access nested properties with special characters
node src/index.js --eval "declaration.'claim.v2'.alg" testfiles/trust-profiles/camera_indicators.json
# Check if a property exists
node src/index.js --eval "has(declaration.assertions)" testfiles/trust-profiles/camera_indicators.json
# Get array length
node src/index.js --eval "length(declaration.assertions)" testfiles/trust-profiles/camera_indicators.jsonNote: The --eval and --profile/--rubric options are mutually exclusive - you cannot use both in the same command.
# Run the CLI
npm start
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch
# Lint code
npm run lint
# Fix linting issues
npm run lint:fixThe project includes comprehensive tests using Jest:
- Unit Tests: Test individual features and functions
- Integration Tests: Test the complete CLI workflow
- Error Handling Tests: Verify graceful error handling
# Run all tests
npm test
# Run tests with coverage report
npm run test:coverage
# Run tests in watch mode for development
npm run test:watchThe project uses ESLint for code quality and consistency:
# Check for linting issues
npm run lint
# Automatically fix linting issues
npm run lint:fixThe project uses modern ESLint configuration with the following features:
- Modern JavaScript: ES2020 support with async/await
- Node.js Environment: Configured for Node.js development
- Strict Rules: Enforces consistent code style and best practices
- Jest Support: Configured for Jest testing environment
Contributions are welcome! Please open an issue or submit a pull request for any enhancements or bug fixes.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
npm test) - Run linting (
npm run lint) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.
- Added
-r/--rubricas an alias for-p/--profile - Default output format is now JSON for rubrics and YAML for profiles, with the option to override using
-yor-j
- Expanded tool to support C2PA Asset Rubrics in addition to JPEG Trust Profiles
- Updated documentation to reflect support for both evaluation document types
- Updated examples and fixed
-joption description typo - Reorganized test files into
testfiles/trust-profiles/andtestfiles/asset-rubrics/subdirectories
- Changed default output format to YAML
- Added
--evaloption for evaluating JSON formula expressions directly (and associated tests!) - Improved error handling for missing profile or JSON file
- Started work on 21617-2 support
- Initial release
- Comprehensive test suite
- ESLint integration
- Jest testing framework
- Pretty printing support
- Error handling and validation