Skip to content

[Feature]: Migrate SchemaVerifier to DiagnosticResult (Phase 4) #255

Description

Purpose

Migrate SchemaVerifier (schema_verifier.py) to return DiagnosticResult. JSON schema validation is already deterministic — this is a straightforward mechanical migration.

Related

Scope

1. Remove orphan code (audit finding from #216)

schema_verifier.py:100-109,607-660 instantiates a SymbolicVerifier as math_verifier but never calls it. It performs inline float comparison instead. This dead delegation should be cleaned up during migration.

2. Migrate return type to DiagnosticResult

  • verify_schema() → DiagnosticResult
  • validate_schema() → DiagnosticResult
  • All statuses map to VERIFIED / UNVERIFIABLE / BLOCKED
  • agent_message sanitized (no raw jsonschema output)

3. proof_ref for schema validation

proof_ref = compute_proof_ref(schema_evidence) when verification succeeds — the validated schema + instance are the proof artifact.

Status Mapping

Current state DiagnosticResult
Schema valid VERIFIED with proof_ref
Schema invalid VERIFIED with developer_fields identifying violation
Parse error (schema) BLOCKED, constraint_id: schema_verifier.parse_error
Validation error BLOCKED, constraint_id: schema_verifier.validation_error

Success Criteria

  • All public methods return DiagnosticResult
  • Orphan math_verifier code removed
  • proof_ref present on VERIFIED, null on UNVERIFIABLE/BLOCKED
  • agent_message sanitized
  • Regression tests assert on DiagnosticResult fields

Metadata

Metadata

Assignees

No one assigned

    Labels

    diagnosticsdiagnosticsenhancementNew feature or requestpythonPull requests that update python code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions