Skip to main content

Documentation Index

Fetch the complete documentation index at: https://parmanasystems.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

@parmanasystems/governance manages the full lifecycle of governance policies — creating, validating, versioning, and bundling them for deployment.

Install

npm install @parmanasystems/governance

Key exports

createPolicy(input): Policy

Validates and creates a new policy definition from raw JSON input.

upgradePolicy(existing, updates): Policy

Creates a new policy version from an existing policy, enforcing schema compatibility rules.

validatePolicy(policy): ValidationResult

Validates a policy against the governance schema — checks required fields, signal types, rule structure, and catch-all rule presence.
import { validatePolicy } from "@parmanasystems/governance";

const result = validatePolicy(policyJson);

if (!result.valid) {
  console.error(result.errors);
}

generateBundle(policy): Bundle

Packages a validated policy into a versioned bundle artifact ready for signing.
import { generateBundle } from "@parmanasystems/governance";

const bundle = generateBundle(policy);
// { policyId, policyVersion, schemaVersion, rules, manifest: { hash, timestamp } }

evaluatePolicy(policy, signals): DecisionResult

Evaluates policy rules against governed signals. First-match semantics — rules are evaluated in order.
import { evaluatePolicy } from "@parmanasystems/governance";

const decision = evaluatePolicy(policy, {
  insurance_active: true,
  risk_score: 42,
  vip_customer: false,
  claim_amount: 8500,
});

console.log(decision.status);  // "decided"
console.log(decision.outcome); // { action: "approve", requires_override: false, reason: "standard_approval" }

Policy immutability

Parmana Systems enforces policy immutability at the CI level. The policy:immutability script validates that existing policy files have not been modified — only new versions can be added.
npm run policy:immutability
This is a hard invariant: changing a published policy retroactively would invalidate all existing attestations that reference it.

CLI integration

Use the parmana CLI to work with policies during development:
parmana policy inspect ./policies/claims-approval/v1/policy.json
parmana policy graph   ./policies/claims-approval/v1/policy.json
parmana policy simulate ./policies/claims-approval/v1/policy.json ./records.json
parmana policy build   ./policies/claims-approval/v1
See CLI Reference for full documentation.