# CAIN HERMES — Semantic Preservation

`cain/hermes/semantic.py`. Cross-target governance semantic preservation.

Determines whether a set of compiled controls across heterogeneous enforcement targets preserves the *meaning* of
the original requirement. Example: "an agent may spend no more than $5,000 per transaction" may compile into an MCP
restriction, an A2A restriction, a payment-API budget, a CAIN authority limit, an IRONCLAD effect contract and a
human-approval threshold. HERMES proves the composition does not weaken, omit or broaden the requirement.

## Dimensions checked

budget · time · approval · evidence · scope · consequence · environment · location · jurisdiction · delegation.

## Verdicts

`SEMANTICALLY_PRESERVED · WEAKENED_CONSTRAINT · MISSING_CONSTRAINT · BROADENED_SCOPE · AUTHORITY_ESCALATION ·
MISSING_APPROVAL · MISSING_EVIDENCE · ENVIRONMENT_MISMATCH · UNKNOWN`.

Detects weakened constraints, missing constraints, broadened scope, authority escalation, missing approvals,
missing evidence, time-window errors, delegation expansion, resource/data/effect-scope expansion, budget expansion
and environment mismatch. A weakening/escalation dominates the verdict.

## Distinction from existing work

The existing `platform-gateway/cain_governance_assurance.py` compares two IRs of the **same** fabric (translation or
change). HERMES compares a **heterogeneous set of targets against a governance intent**.

## Status

IMPLEMENTED, TESTED, LIVE (the `semantic_preservation` restriction-only hosted stage).
