create_guarantee
Create a code guarantee to enforce structural invariants using Datalog rules or contract schemas.
Instructions
Create a new code guarantee.
Two types supported:
Datalog-based: Uses rule field with Datalog query (violation/1)
Contract-based: Uses type + schema for JSON validation
Examples:
Datalog: name="no-eval" rule="violation(X) :- node(X, "CALL"), attr(X, "name", "eval")."
Contract: name="orders" type="guarantee:queue" priority="critical" schema={...}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Unique name for the guarantee | |
| rule | No | Datalog rule defining violation/1 (for Datalog-based guarantees) | |
| severity | No | Severity for Datalog guarantees: error, warning, or info | |
| type | No | Guarantee type for contract-based: guarantee:queue, guarantee:api, guarantee:permission | |
| priority | No | Priority level: critical, important, observed, tracked | |
| status | No | Lifecycle status: discovered, reviewed, active, changing, deprecated | |
| owner | No | Owner of the guarantee (team or person) | |
| schema | No | JSON Schema for contract-based validation | |
| condition | No | Condition expression for the guarantee | |
| description | No | Human-readable description | |
| governs | No | Node IDs that this guarantee governs |