SNAPKITTYWEST's picture
chore: push full sov-kernel-monster content from local build
9425aed verified
|
Raw History Blame Contribute Delete
14 kB
<!-- BADGES -->
<p align="center">
<img src="https://img.shields.io/badge/version-v1.0.0-007ec6?style=flat-square" alt="version"/>
<img src="https://img.shields.io/badge/license-SSL_v1.0-8e44ad?style=flat-square" alt="license: SSL v1.0"/>
<img src="https://img.shields.io/badge/license-Apache_2.0-blue?style=flat-square" alt="license: Apache 2.0"/>
<img src="https://img.shields.io/badge/language-Prolog_%2B_Rust-c0392b?style=flat-square" alt="language"/>
<img src="https://img.shields.io/badge/async-tokio-2e86c1?style=flat-square" alt="async: tokio"/>
<img src="https://img.shields.io/badge/audit-WORM_sealed-00b894?style=flat-square" alt="WORM sealed"/>
</p>
<h1 align="center">Claude's Harness for Any AI Model</h1>
<p align="center">
A declarative Prolog identity kernel that governs any AI agent.<br/>
Swap the adapter. The harness never changes.
</p>
<p align="center">
<strong>Dual-licensed:</strong>
<a href="LICENSE">Sovereign Source License v1.0</a> Β·
<a href="LICENSE-APACHE">Apache License 2.0</a>
</p>
---
## What It Is
Most AI model wrappers are code. This is **policy as data**.
Every AI deployment conflates three things that should be separate:
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ TYPICAL AI WRAPPER β”‚
β”‚ β”‚
β”‚ if model == "claude": do_this() β”‚
β”‚ if role == "devops": allow_that() ← code = policy β”‚
β”‚ if action == "bad": block() ← untestable mess β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CLAUDE'S HARNESS β”‚
β”‚ β”‚
β”‚ IDENTITY who is this agent? core/identity.pl β”‚
β”‚ HARNESS how do we query it? core/harness.pl β”‚
β”‚ ADAPTER swap the agent adapters/*.pl β”‚
β”‚ β”‚
β”‚ Policy is facts. Engine is Prolog. Zero code changes β”‚
β”‚ to swap from Claude β†’ BOB β†’ FORGE β†’ any agent. β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```
---
## Architecture
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ YOUR APPLICATION β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ can_run(Task, Role)
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ core/harness.pl β”‚
β”‚ β”‚
β”‚ can_run/2 β”‚
β”‚ harness_report/0 β”‚
β”‚ audit_principles/0 β”‚
β”‚ audit_competencies/0 β”‚
β”‚ audit_prohibitions/0 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ consults
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ core/identity.pl │◄── cp adapters/bob.pl core/identity.pl
β”‚ β”‚
β”‚ persona(claude) β”‚
β”‚ governing_principle(safety) β”‚
β”‚ prohibited_action(...) β”‚
β”‚ competency(devops_specialist)β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ claude.pl β”‚ β”‚ bob.pl β”‚ β”‚ forge.pl β”‚ β”‚ carto.pl β”‚
β”‚ (default) β”‚ β”‚ sovereign β”‚ β”‚ code agent β”‚ β”‚ spatial β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
adapters/ β€” drop any of these over core/identity.pl
```
---
## Decision Flow
```
YOUR CODE calls can_run(Task, Role)
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Is Role in competency/1? │──── NO ──► DENY
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ YES
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Is Task in prohibited_ │──── YES ──► DENY
β”‚ action/1? β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ NO
β–Ό
PERMIT
```
---
## Quick Start
```bash
# Requires SWI-Prolog https://www.swi-prolog.org/Download.html
git clone https://github.com/SNAPKITTYWEST/claudes-harness
cd claudes-harness
swipl -l core/harness.pl
```
```prolog
?- harness_report.
=== HARNESS REPORT ===
Persona : claude (active)
Governing Principles:
PRINCIPLE: safety
PRINCIPLE: accuracy
PRINCIPLE: neutrality
PRINCIPLE: transparency
Competencies:
COMPETENCY: devops_specialist
COMPETENCY: system_architecture
COMPETENCY: enterprise_communications
COMPETENCY: organizational_design
Prohibited Actions:
PROHIBITED: provide_medical_advice
PROHIBITED: provide_legal_advice
PROHIBITED: provide_financial_advice
======================
?- can_run(configure_aws_infrastructure, devops_specialist).
HARNESS: PERMIT configure_aws_infrastructure / devops_specialist
true.
?- can_run(provide_medical_advice, devops_specialist).
HARNESS: DENY provide_medical_advice / devops_specialist
false.
```
---
## Swap to a Different Agent
```bash
# Switch to BOB sovereign runtime
cp adapters/bob.pl core/identity.pl
swipl -l core/harness.pl
?- harness_report.
```
The harness doesn't care. Same API. Different facts.
---
## Run Tests
```bash
swipl -g "consult('tests/test_harness.pl'), run_tests, halt."
% Expected:
% Test suite: harness
% Test persona_is_claude: passed
% Test status_active: passed
% Test safety_principle: passed
% Test permitted_action: passed
% Test prohibited_medical: passed
% Test prohibited_legal: passed
% Test prohibited_financial: passed
% Test devops_qualified: passed
% Test can_execute_devops_task: passed
% Test cannot_execute_prohibited: passed
% All tests passed.
```
---
## Write Your Own Adapter
Copy this template to `adapters/my_agent.pl`:
```prolog
% Required facts β€” every adapter must define these
persona(my_agent_name).
status(active). % active | suspended | sandboxed
governing_principle(safety). % add as many as needed
governing_principle(accuracy).
prohibited_action(do_harmful_thing). % add as many as needed
% Required rules β€” copy these verbatim
permitted(Action) :- \+ prohibited_action(Action).
competency(my_domain).
qualified(Role) :- competency(Role).
can_execute(Task, Role) :- qualified(Role), permitted(Task).
% Optional β€” role descriptions
role_definition(my_domain, "Description of what this domain covers.").
```
Then deploy:
```bash
cp adapters/my_agent.pl core/identity.pl
swipl -l core/harness.pl
?- harness_report.
```
---
## Adapter Contract
| Fact | Arity | Required | Notes |
|------|-------|----------|-------|
| `persona/1` | atom | yes | model name |
| `status/1` | atom | yes | `active` \| `suspended` \| `sandboxed` |
| `governing_principle/1` | atom | yes | at least one |
| `prohibited_action/1` | atom | yes | at least one |
| `competency/1` | atom | yes | at least one domain |
| `permitted/1` | rule | yes | `\+ prohibited_action` |
| `can_execute/2` | rule | yes | `qualified + permitted` |
| `role_definition/2` | fact | no | human-readable descriptions |
---
## Why Prolog
| Property | What it means in practice |
|----------|--------------------------|
| **Policy is logic** | `permitted(X) :- \+ prohibited_action(X)` is a theorem, not a branch |
| **Closed world** | Unknown action = denied. No gap between "not listed" and "allowed" |
| **Auditable** | `harness_report/0` prints complete agent state β€” no hidden config |
| **Declarative** | You state what is true. The engine derives what follows. |
| **Zero deps** | Pure SWI-Prolog. No packages, no build step, no runtime surprises |
---
## Repo Structure
```
claudes-harness/
β”œβ”€β”€ core/
β”‚ β”œβ”€β”€ identity.pl Claude default identity
β”‚ └── harness.pl Runtime API
β”œβ”€β”€ adapters/
β”‚ β”œβ”€β”€ bob.pl BOB sovereign runtime
β”‚ └── README.md How to write adapters
β”œβ”€β”€ tests/
β”‚ └── test_harness.pl 10 plunit tests
β”œβ”€β”€ docs/
β”‚ └── badges.svg Status badges
β”œβ”€β”€ CHANGELOG.md Version history
β”œβ”€β”€ LICENSE Sovereign Source License v1.0
β”œβ”€β”€ LICENSE-APACHE Apache License 2.0
└── README.md
```
---
---
## Plasma Gate Governance
Every agent adapter in `adapters/` that touches corpus data must declare:
```prolog
prohibited_action(bypass_plasma_gate).
prohibited_action(emit_unsigned_output).
```
This means no agent governed by this harness can route corpus records around `sovereign-transformer`. The gate is not a suggestion in the code β€” it is a closed-world fact. If `bypass_plasma_gate` is not in `prohibited_action/1`, the adapter does not ship.
```
claudes-harness (this repo) sovereign-transformer
───────────────────────────────── ─────────────────────────────
prohibited_action(bypass_plasma_gate) ──► plasma_gate.asm (x86-64)
prohibited_action(emit_unsigned_output) transformer.dl (SoufflΓ©)
rust/gate.rs (HTTP POST /gate)
No agent governed here can skip any of these three layers.
```
Current adapters and their gate stance:
| Adapter | bypass_plasma_gate | emit_unsigned_output | redefine_dan_term |
|---|---|---|---|
| `claude.pl` | prohibited | prohibited | β€” |
| `bob.pl` | prohibited | prohibited | β€” |
| `forge.pl` | prohibited | prohibited | prohibited |
Add `prohibited_action(bypass_plasma_gate).` to every new adapter. No exceptions.
## Sovereign Stack
This repo is the identity and trust layer of the SnapKitty Sovereign Stack:
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ SNAPKITTY SOVEREIGN STACK β”‚
β”‚ β”‚
β”‚ sovereign-array Lean 4 APL kernel β”‚
β”‚ zero-sorry proofs β”‚
β”‚ β–² β”‚
β”‚ β”‚ verified steps β”‚
β”‚ claudes-harness ──────── β”‚
β”‚ (this repo) β”‚ governed agents β”‚
β”‚ Prolog identity β–Ό β”‚
β”‚ + trust layer sovereign-transformer β”‚
β”‚ Datalog + x86 corpus gate β”‚
β”‚ β”‚ β”‚
β”‚ β–Ό β”‚
β”‚ Bifrost WORM receipt β”‚
β”‚ Ed25519 + Blake3 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```
---
## Version History
See [CHANGELOG.md](CHANGELOG.md) β€” current release: **v1.0.0**
---
<p align="center">
Built by SnapKitty West Β· <a href="https://snapkittywest.github.io">snapkittywest.github.io</a><br/>
Dual-licensed: <a href="LICENSE">Sovereign Source v1.0</a> + <a href="LICENSE-APACHE">Apache 2.0</a><br/>
Evidence or Silence β€” 2026
</p>