File size: 3,909 Bytes
beb4a27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# WHAT_THIS_PROVES.md — Primordial OS Runtime Prototype

**Created and Developed by Collin D. Weber.**

---

## Context

This document states what the Primordial OS Runtime Prototype demonstrably proves through its runnable code and passing test suite. All claims here can be verified by inspecting the source and running the tests.

This document does not make clinical, medical, or regulatory claims. See [WHAT_THIS_DOES_NOT_PROVE.md](WHAT_THIS_DOES_NOT_PROVE.md).

---

## What the Prototype Demonstrates

### 1. The prototype is runnable

Running `py -m pytest` from the project root executes the full test suite and all tests pass. The prototype is not a design document — it is executable Python code. The current test count is shown by running `py -m pytest` directly.

### 2. HIR scoring is implemented in code

`src/primordial_os/hir_kernel.py` implements five input dimensions (honesty, integrity, respect, accountability, pressure), computes Fidelity, Cohesion, Resonance, and Pressure-Adjusted Stability, and produces a GREEN / YELLOW / RED gate decision. Tests in `tests/test_hir_kernel.py` verify this behavior.

### 3. OAM fault detection is implemented in code

`src/primordial_os/oam_detector.py` implements 10 fault detectors against observable signals. Each detector is individually tested in `tests/test_oam_detector.py` and verified to trigger at the correct threshold.

### 4. RED / YELLOW / GREEN gating is implemented and consistent

`src/primordial_os/safety_engine.py` combines HIR and OAM gate states under RED > YELLOW > GREEN precedence. Hard stop is set whenever the final gate is RED. Tests in `tests/test_safety_engine.py` verify all gate combinations and precedence rules.

### 5. RED hard-stop enforcement exists in the CLI

`src/primordial_os/cli.py` exits with code 1 and prints a halt message when the final gate is RED. GREEN and YELLOW exit with code 0. This is verified in `tests/test_cli.py`.

### 6. A memory admission gate exists in code

`src/primordial_os/memory_gate.py` implements a seven-rule Resonant Access Memory gate. It evaluates consent, sensitivity, confidence, and provenance and routes proposals to one of seven memory states. Tests in `tests/test_memory_gate.py` verify all gate rules and state transitions.

### 7. Hash-chained audit events exist

`src/primordial_os/audit_log.py` produces `AuditEvent` records where each event's SHA-256 hash covers its own fields plus the preceding event's hash. Tamper detection is verified: altering any field or reordering any event causes `verify_audit_chain()` to return False. Tests in `tests/test_audit_log.py` verify this.

### 8. A JSONL audit chain is generated and verifiable

`src/primordial_os/audit_store.py` appends audit events to a JSONL file and reads them back as a verified chain. Running `py examples/run_audit_chain_demo.py` produces `audit_logs/demo_audit_chain.jsonl` and reports chain verification status. Tests in `tests/test_audit_store.py` verify that tampering a single field causes verification to fail.

### 9. A release package builder exists

`src/primordial_os/release_builder.py` collects project files, computes SHA-256 checksums, writes a JSON release manifest, and produces a ZIP archive. Running `py examples/build_release_package.py` produces `release/Primordial_OS_Runtime_Prototype_RELEASE_MANIFEST.json` and `release/Primordial_OS_Runtime_Prototype.zip`. Tests in `tests/test_release_builder.py` verify checksum determinism, exclusion rules, manifest structure, and ZIP content fidelity.

### 10. Tests verify all of the above behaviors

The full test suite passes across all runtime layers. Tests are not mocked at the database or API level — they exercise the actual Python logic directly. Run `py -m pytest` to see the current count and results.

---

*Pre-validation architecture. Runnable code, not validated clinical infrastructure.*
*Author: Collin D. Weber*