> ## Documentation Index
> Fetch the complete documentation index at: https://docs.manthan.systems/llms.txt
> Use this file to discover all available pages before exploring further.

# Contracts

> Shared schemas, types, and compatibility contracts used across Parmana packages.

# @parmanasystems/contracts

The Contracts package defines the shared schemas, interfaces, and type definitions used throughout Parmana.

It ensures every package speaks the same language when representing policies, signals, attestations, authority verification outcomes, and audit records.

## Installation

```bash theme={null}
npm install @parmanasystems/contracts
```

## Responsibilities

The contracts layer provides:

* Shared type definitions
* Attestation schemas
* Policy schemas
* Audit schemas
* Runtime contracts
* Cross-package compatibility guarantees

## Why it exists

Without shared contracts, each package would define its own representation of governance artifacts.

This creates:

* incompatibilities
* version drift
* serialization issues
* verification failures

The contracts package establishes a single source of truth.

## Core concepts

### Policy Contracts

Policies define:

```text theme={null}
policyId
policyVersion
signalsSchema
rules
outcomes
```

Every runtime component interprets these structures identically.

### Attestation Contracts

Execution attestations contain:

```text theme={null}
executionId
policyId
policyVersion
executionFingerprint
decision
runtimeHash
signature
```

The schema is shared across:

* execution
* runtime
* verifier
* audit database
* SDKs

### Audit Contracts

Audit records provide a consistent representation of:

* authority verification outcomes
* override actions
* execution lineage
* runtime provenance

## Compatibility

Contracts provide compatibility boundaries between versions.

This allows:

* runtime upgrades
* verifier upgrades
* SDK upgrades

without breaking previously issued attestations.

## Relationship to other packages

| Package                             | Responsibility           |
| ----------------------------------- | ------------------------ |
| `@parmanasystems/contracts`         | Shared schemas and types |
| `@parmanasystems/execution`         | Policy evaluation        |
| `@parmanasystems/execution-runtime` | Runtime orchestration    |
| `@parmanasystems/verifier`          | Verification             |
| `@parmanasystems/audit-db`          | Persistence              |

## Design principles

### Single source of truth

Every package uses the same contracts.

### Compatibility

Schemas evolve predictably.

### Determinism

The same structure means the same thing everywhere.

### Verification-first

Contracts are designed for long-term reproducibility and verification.

## Typical usage

```typescript theme={null}
import type {
  ExecutionAttestation,
  PolicyBundle
} from "@parmanasystems/contracts";
```

Applications normally consume contracts indirectly through higher-level packages, but advanced integrations may import them directly.

## See also

* `/reference/attestation-schema`
* `/reference/audit-schema`
* `/packages/core`
* `/packages/execution-runtime`
* `/packages/verifier`
