Skip to content

feat(api): expose AgentTrustScore as stable JSON schema#2

Merged
HainingYin merged 1 commit into
mainfrom
fix/trust-score-json-schema
Jul 3, 2026
Merged

feat(api): expose AgentTrustScore as stable JSON schema#2
HainingYin merged 1 commit into
mainfrom
fix/trust-score-json-schema

Conversation

@HainingYin

Copy link
Copy Markdown
Contributor

Summary

  • Add to_json() method to AgentTrustScore dataclass that returns a versioned dict with schema_version: 'trust-score/v1', overall, grade, breakdown, known_dimensions, and notes
  • Create schemas/trust-score.schema.json (JSON Schema draft-07) defining the stable output contract with flexible additionalProperties for breakdown dimensions

Details

The existing to_dict() method is preserved unchanged. The new to_json() adds:

  • schema_version field for downstream consumers to detect format changes
  • known_dimensions count (derived from the _known_dim_count property)

The JSON Schema uses additionalProperties for the breakdown object to accommodate both the 12 built-in dimensions and any arbitrary dimensions added via add_dimension().

Closes #1

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Add to_json() method to AgentTrustScore dataclass that returns a
versioned payload (schema_version: 'trust-score/v1') with overall score,
grade, per-dimension breakdown, known_dimensions count, and notes.

Create schemas/trust-score.schema.json defining the output contract with
flexible additionalProperties for breakdown dimensions and nullable
number values.

Closes #1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@HainingYin HainingYin merged commit 46a6e54 into main Jul 3, 2026
5 checks passed
@HainingYin HainingYin deleted the fix/trust-score-json-schema branch July 3, 2026 07:59
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.

[api] Expose AgentTrustScore as a stable JSON schema for downstream consumption

1 participant