Skip to main content

@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

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:
policyId
policyVersion
signalsSchema
rules
outcomes
Every runtime component interprets these structures identically.

Attestation Contracts

Execution attestations contain:
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

PackageResponsibility
@parmanasystems/contractsShared schemas and types
@parmanasystems/executionPolicy evaluation
@parmanasystems/execution-runtimeRuntime orchestration
@parmanasystems/verifierVerification
@parmanasystems/audit-dbPersistence

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

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