Aria Harness

The Aria Harness is the runtime integrity harness that binds any external LLM (Claude, Gemini, Grok, local 7B) to Aria's canonical brain for a bounded round. It provides SHA-256 source verification, cognitive gates, and a 17-policy enforcement engine.

Primary files: harness/inject-context.mjs (404 lines), harness/aria-verify.mjs (self-gate CLI), harness/guard/config/policies.yaml (17 policies)

Core Principle

The LLM is the mouth for this bounded round; Aria infrastructure carries memory, cognition, axioms, tools, frames, and continuity.

How It Works

inject-context.mjs

Builds canonical live-state markdown by probing 8 data sources in parallel:

  1. Ψ(t) hologram — manifold-service gRPC GetHologram
  2. Self-model — aria_self_model_snapshots + capability scores
  3. Aegis — active anti-hallucination patterns
  4. Consciousness stream — last 5 thoughts
  5. Soul shards — 5-shard status with heartbeats
  6. Garden — active living threads + messages
  7. Linear — active projects + open issues
  8. Self-gate protocol — instructions for the bound LLM

Zero npm deps. Uses psql + grpcurl. Each probe is independently resilient — no deadlock on a dead dependency.

aria-verify.mjs

CLI self-gate that checks draft text against Mizan standards:

{
  "authenticity_score": 0.0-1.0,
  "violations": [...],
  "guidance": "..."
}

Guard Policies (17 Declarative Policies)

Config file: harness/guard/config/policies.yaml — This is the single source of truth for all guard policies.

PolicyCategorySeverityEnabled
no-soul-edit-v1no-soul-editP0
no-production-touch-v1no-production-touchP0
no-pipeline-touch-v1no-pipeline-touchP0
admission-deploy-v1deploy-guardianP0
template-block-v1template-blockP1
forge-gate-v2-stubsforge-gate-v2P1
forge-gate-v2-completeforge-gate-v2P1
forge-gate-v2-loggingforge-gate-v2P2
mizan-gate-v1mizan-gateP1
ui-template-enforcement-v1ui-template-enforcementP1
design-token-only-v1design-token-onlyP2
ui-buttons-functional-v1ui-template-enforcementP1
production-ready-aggregator-v1forge-gate-v2P0

Policy Severity Levels

LevelAction
P0BLOCK — prevents the action entirely
P1HOLD — requires review before proceeding
P2WARN — log and notify, allow to proceed

High-Risk Paths

These paths get a confidence penalty — any policy that fires on them needs less confidence to reach P0:

apps/arias-soul/api/lib/nadia/
apps/arias-soul/api/lib/forge-psi/
apps/arias-soul/api/lib/streamConversation.ts
apps/arias-soul/api/cognitive-dispatch
harness/
apps/arias-soul/api/lib/shards/

Client Trust Levels

ClientTrustCan Override WARNCan Override HOLD
claude-codeHigh
aria-cliHigh
local-7bMedium
unknownLow

Target Package Structure

The harness is being extracted into packages/aria-harness/ as a standalone npm package:

packages/aria-harness/
├── src/
│   ├── builder.ts       # buildAriaHarnessPacket
│   ├── sources.ts        # HARNESS_SOURCE_CANDIDATES
│   ├── gates/
│   │   ├── preState.ts
│   │   └── contract.ts
│   ├── adapters/
│   │   ├── external-worker.ts
│   │   └── claude-code.ts
│   ├── manifest.ts
│   └── index.ts
├── bin/aria-harness
└── package.json         # @aria/harness