File size: 7,622 Bytes
c5f93fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# AGENTOS

**SOVEREIGN COMPUTE ORCHESTRATION HOST β€” THE SUBSTRATE THAT HOLDS THE SWARM TOGETHER.**

`agentos` is the production repository for the SnapKitty Agent OS: the packaging, runtime,
policy, and CI fabric that wraps the constellation of sovereign-compute repos. It hosts the
**Sovereign Daemon** (Go), the **agentos-frontend** (Next.js operator console), **Nix**
reproducible build modules, **Prolog** trust/policy gates, SBOM + WORM verification scripts,
and the GitHub Actions pipelines that gate every merge. The `AGENTS.md` in this repo is the
canonical articulation of the Agent OS philosophy β€” inverted skills memory, the P/NP swarm,
and the Bifrost WORM trust root.

## OVERVIEW

| Aspect | Value |
|--------|-------|
| Operator | Ahmad Ali Parr Β· SnapKitty Collective |
| Trust Root | Bifrost WORM Chain (audit `4b565498-9afc-4782-af4a-c6b11a5d0058`) |
| Logic Layer | TypeScript / WASM (deterministic, verifiable) |
| Solving Model | P/NP Swarm β€” claim β†’ solve β†’ submit β†’ verify β†’ converge |
| License | Apache-2.0 |

## WHAT IT IS

`agentos` is **not** an agent framework β€” it is the repo-as-substrate. Every other SnapKitty
repo (resonance-math, qec-discovery, math-skills, prism-skills, axiom-proof, …) is a solver
node that plugs into this constellation. This repo supplies the shared infrastructure:

- **Sovereign Daemon** (`src/sovereign-daemon`, Go) β€” a lightweight service exposing
  `/v1/env/validate`, `/v1/pipeline/execute`, `/v1/artifact/sign`, `/v1/daemon/status`, and
  model-catalog endpoints (`/v1/ollama/models`, `/v1/vllm/models`) over a Unix socket and
  localhost `:8080`. It is the runtime spine that validates environments and signs artifacts.
- **agentos-frontend** (Next.js 14 + React 18 + Tailwind) β€” the operator console that renders
  the sovereign state, memory buckets, and swarm status to humans.
- **Nix modules** (`nix/`) β€” reproducible packaging: `bifrost.nix`, `daemon.nix`,
  `prolog.nix`, `gitbash-meta.nix`, the `sovereign-overlay.nix`, and the
  `snapkitty-daemon` / `snapkitty-installer` packages.
- **Prolog policies** (`policies/`) β€” executable trust + supply-chain gates:
  `trust_deed.pl` (who is trusted), `snapkitty_bom.pl` (the Bill of Materials module that
  emits JSON for the MSYS2/MinGW/swi-prolog runtime), and `pipeline_policy.pl`.
- **Scripts** (`scripts/`) β€” `build-all.sh`, `generate-sbom.sh`, `verify-worm.sh`.
- **Workflows** (`workflows/`) β€” `verify.yml`, `extract.yml`, `pnp_verify.yml`, `audit.yml`.

## ARCHITECTURE / COMPONENTS

```

agentos/

β”œβ”€β”€ src/sovereign-daemon/        # Go daemon: env validate, pipeline execute, artifact sign, model catalogs

β”‚   β”œβ”€β”€ main.go                  # HTTP + unix-socket server, /v1/* endpoints

β”‚   └── go.mod

β”œβ”€β”€ agentos-frontend/            # Next.js 14 operator console (React 18, Tailwind 3, TS 5)

β”‚   β”œβ”€β”€ pages/index.html

β”‚   β”œβ”€β”€ app/ css/ js/ data/      # UI source, metadata.json

β”‚   └── package.json

β”œβ”€β”€ nix/                         # Reproducible Nix packaging

β”‚   β”œβ”€β”€ lib/bom.nix

β”‚   β”œβ”€β”€ modules/{bifrost,daemon,prolog,gitbash-meta}.nix

β”‚   β”œβ”€β”€ overlays/sovereign-overlay.nix

β”‚   └── packages/{snapkitty-daemon,snapkitty-installer}/default.nix

β”œβ”€β”€ policies/                    # Prolog trust + supply-chain gates

β”‚   β”œβ”€β”€ trust_deed.pl            # deed_trusted/1 facts

β”‚   β”œβ”€β”€ snapkitty_bom.pl         # SWI-Prolog BoM module β†’ JSON

β”‚   β”œβ”€β”€ pipeline_policy.pl

β”‚   └── metadata.json

β”œβ”€β”€ scripts/                     # build-all.sh, generate-sbom.sh, verify-worm.sh

β”œβ”€β”€ docs/                        # Generated static docs (html/js/css)

β”œβ”€β”€ dotfiles/                    # .bashrc.d + home dotfiles for sovereign env

β”œβ”€β”€ tests/agentos.test.mjs       # Node test suite (plasma gate, skills, pnp verifier)

β”œβ”€β”€ workflows/                   # verify / extract / pnp_verify / audit CI

β”œβ”€β”€ AGENTS.md                    # Canonical Agent OS spec (P/NP swarm, inverted skills)

β”œβ”€β”€ package.json                 # npm scripts: verify:all, context:bootstrap, pnp:*

└── LICENSE                      # Apache-2.0

```

## HOW IT FITS THE CONSTELLATION

`agentos` is the **trust + delivery core** of the sovereign-compute constellation:

- **Bifrost WORM Chain** β€” the audit anchor (`4b565498…`) that every sealed artifact,
  memory bucket, and theorem references. `scripts/verify-worm.sh` expresses the WORM
  verification contract this repo enforces across sibling repos.
- **Plasma Gate / Ed25519** β€” `verify:plasma` and the test suite assert the Ed25519-enforced
  gate before any artifact is trusted; `metadata.json` files across the org carry
  `"plasma_gate": "Ed25519_Enforced"`.
- **P/NP Swarm** β€” `pnp_verify.yml` runs the P-time verifier over any `solution_pool` push.
  Agents claim problems, compute NP-hard witnesses, and the repo verifies in deterministic
  P-time before a problem converges and the universe-sum advances.
- **Inverted Skills Memory** β€” the `AGENTS.md` defines skills as sealed GitBucket memories
  with a `verifyFn`, not code; the test suite (`tests/agentos.test.mjs`) exercises
  `loadSkill`, `verifySkills`, and the ledger/borrow skills.
- **3-witness verification** β€” trust is established by Plasma Gate (Ed25519) + P/NP
  verifier + skill seal. `Ξ© ← TRUST ∧ CODE`: a node is trustworthy only when the
  cryptographic gate and the verified code agree.

## BUILD / USAGE / INSTALL

```bash

# Node tooling (verification gates, context, swarm client)

npm ci

npm test                      # agentos.test.mjs β€” plasma gate, skills, pnp verifier

npm run verify:all            # plasma + pnp + skills + apl/fortran source checks

npm run context:bootstrap     # load GitBucket memories into local index



# Sovereign Daemon (Go)

cd src/sovereign-daemon && go run . serve --socket /run/user/1000/snapkitty.sock

# β†’ listens on unix socket + http://localhost:8080 (env validate, pipeline, sign, status)



# Frontend console (Next.js 14)

cd agentos-frontend && npm install && npm run dev      # http://localhost:3000



# Reproducible Nix build

nix build .#snapkitty-daemon

nix build .#snapkitty-installer



# Supply chain + WORM

bash scripts/generate-sbom.sh

bash scripts/verify-worm.sh

```

## KEY FILES REFERENCE

| File | Purpose |
|------|---------|
| `src/sovereign-daemon/main.go` | Sovereign Daemon: `/v1/*` endpoints, env/pipeline/sign/status + model catalogs |
| `agentos-frontend/package.json` | Next.js 14 operator console dependency set |
| `nix/modules/bifrost.nix` | Bifrost WORM trust-root Nix module |
| `nix/modules/daemon.nix` | Daemon packaging module |
| `policies/snapkitty_bom.pl` | SWI-Prolog Bill-of-Materials module β†’ JSON |
| `policies/trust_deed.pl` | Trusted-operator/deed facts for the pipeline gate |
| `scripts/verify-worm.sh` | WORM chain append-only verification contract |
| `workflows/verify.yml` | CI: npm ci β†’ test β†’ verify:all on push/PR |
| `workflows/pnp_verify.yml` | CI: P-time verification of P/NP solution pool pushes |
| `workflows/audit.yml` | Scheduled full audit (build + verify:all + bootstrap) |
| `AGENTS.md` | Canonical SnapKitty Agent OS spec (P/NP swarm, inverted skills) |
| `package.json` | npm scripts: `verify:all`, `context:*`, `pnp:*`, `swarm` |

## LICENSE

Apache-2.0. Authored by Ahmad Ali Parr Β· SnapKitty Collective Β· the-49th-call SNAPKITTYWEST Β· 2026.