Datasets:
Mirror from SNAPKITTYWEST: README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
tags:
|
| 6 |
+
- sovereign
|
| 7 |
+
- snapkitty
|
| 8 |
+
- programming-language
|
| 9 |
+
- deterministic
|
| 10 |
+
- ledger
|
| 11 |
+
- cryptography
|
| 12 |
+
- sha256
|
| 13 |
+
- mumps
|
| 14 |
+
- ibm-i
|
| 15 |
+
- worm-sealed
|
| 16 |
+
- zero-dependencies
|
| 17 |
+
- pure-python
|
| 18 |
+
- formal-verification
|
| 19 |
+
task_categories:
|
| 20 |
+
- text-generation
|
| 21 |
+
size_categories:
|
| 22 |
+
- n<1K
|
| 23 |
+
pretty_name: MANTRA — Deterministic Auditable Language
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
# MANTRA
|
| 27 |
+
|
| 28 |
+
**A deterministic, auditable programming language for ledger operations, cryptographic sealing, and verified integer computation.**
|
| 29 |
+
|
| 30 |
+
Zero external dependencies. Pure Python. Auditable SHA-256. MUMPS gateway.
|
| 31 |
+
|
| 32 |
+
SnapKitty West / SNAPKITTYWEST — *Evidence or Silence — 2026*
|
| 33 |
+
|
| 34 |
+
---
|
| 35 |
+
|
| 36 |
+
## What It Is
|
| 37 |
+
|
| 38 |
+
MANTRA is a purpose-built language for sovereign ledger operations. Every computation is deterministic and traceable. Every output can be cryptographically sealed. No external dependencies — the SHA-256 implementation is pure Python and auditable line by line.
|
| 39 |
+
|
| 40 |
+
```
|
| 41 |
+
# Constants and variables
|
| 42 |
+
const GENESIS = "0000000000000000000000000000000000000000000000000000000000000000"
|
| 43 |
+
let amount = 450000
|
| 44 |
+
|
| 45 |
+
# Annotated deterministic function
|
| 46 |
+
@deterministic
|
| 47 |
+
define seal(tx)
|
| 48 |
+
let h = sha256(tx)
|
| 49 |
+
Result::ok(h)
|
| 50 |
+
end
|
| 51 |
+
|
| 52 |
+
# Run
|
| 53 |
+
python mantra.py run examples/ledger.m
|
| 54 |
+
python mantra.py hash "hello world"
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
---
|
| 58 |
+
|
| 59 |
+
## Test Status
|
| 60 |
+
|
| 61 |
+
| Suite | Tests |
|
| 62 |
+
|---|---|
|
| 63 |
+
| test_sha256 | passing |
|
| 64 |
+
| test_integer | passing |
|
| 65 |
+
| test_bytes | passing |
|
| 66 |
+
| test_evaluator | passing |
|
| 67 |
+
| **Total** | **23/23** |
|
| 68 |
+
|
| 69 |
+
---
|
| 70 |
+
|
| 71 |
+
## Architecture
|
| 72 |
+
|
| 73 |
+
```
|
| 74 |
+
mantra/
|
| 75 |
+
├── mantra.py CLI (run / eval / hash / test)
|
| 76 |
+
├── lexer/lexer.py Tokenizer (HEX, BYTES, annotations, keywords)
|
| 77 |
+
├── mantra_ast/nodes.py AST dataclasses
|
| 78 |
+
├── parser/parser.py Pratt parser + field access + dict literals
|
| 79 |
+
├── runtime/
|
| 80 |
+
│ ├── types.py Integer, Boolean, Bytes, String, DictValue, Option, Result
|
| 81 |
+
│ ├── evaluator.py Tree-walking evaluator with closures + builtins
|
| 82 |
+
│ ├── runtime.py run_source / run_file
|
| 83 |
+
│ └── stdlib/
|
| 84 |
+
│ ├── integer.py add/sub/mul/div/mod/pow with overflow checking
|
| 85 |
+
│ ├── bit.py band/bor/bxor/bnot/shl/shr/rotl/rotr
|
| 86 |
+
│ ├── bytes.py concat/slice/len/get_byte
|
| 87 |
+
│ ├── string.py to_bytes/from_bytes/concat
|
| 88 |
+
│ ├── hex.py bytes_to_hex/hex_to_bytes
|
| 89 |
+
│ ├── sha256.py sha256/sha256_hex (wraps auditable impl)
|
| 90 |
+
│ ├── collections.py list_len/list_get/dict_get
|
| 91 |
+
│ ├── result.py ok/err/some/none
|
| 92 |
+
│ └── testing.py assert_eq/assert_true/assert_false
|
| 93 |
+
├── sha256/
|
| 94 |
+
│ ├── sha256_impl.py Pure-Python SHA-256 (no hashlib, fully auditable)
|
| 95 |
+
│ └── vectors.py NIST canonical test vectors
|
| 96 |
+
├── gateway/
|
| 97 |
+
│ └── mumps_gateway.py 300-byte binary record pack/unpack/dispatch (IBM i bridge)
|
| 98 |
+
└── examples/
|
| 99 |
+
├── ledger.m Transaction seal (end-to-end working)
|
| 100 |
+
└── treasury.m Multi-step ledger chain
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
---
|
| 104 |
+
|
| 105 |
+
## Key Properties
|
| 106 |
+
|
| 107 |
+
| Property | Detail |
|
| 108 |
+
|---|---|
|
| 109 |
+
| Deterministic | Same inputs always produce same outputs |
|
| 110 |
+
| Auditable SHA-256 | Pure Python, no hashlib, every round visible |
|
| 111 |
+
| Zero dependencies | Nothing to install beyond Python 3.10+ |
|
| 112 |
+
| MUMPS gateway | 300-byte binary record bridge to IBM i |
|
| 113 |
+
| Fail-closed types | Option and Result — no silent nulls |
|
| 114 |
+
| Overflow checking | Integer arithmetic bounds-checked |
|
| 115 |
+
|
| 116 |
+
---
|
| 117 |
+
|
| 118 |
+
## License
|
| 119 |
+
|
| 120 |
+
Trilicensed: Apache-2.0 / MIT / Sovereign-Source-1.0 (see `LICENSES/`)
|
| 121 |
+
|
| 122 |
+
---
|
| 123 |
+
|
| 124 |
+
## Related Repos
|
| 125 |
+
|
| 126 |
+
| Repo | Description |
|
| 127 |
+
|---|---|
|
| 128 |
+
| [SNAPKITTYWEST/sov](https://huggingface.co/datasets/SNAPKITTYWEST/sov) | Sovereign Package Switchboard |
|
| 129 |
+
| [SNAPKITTYWEST/devflow-finance-twin](https://huggingface.co/datasets/SNAPKITTYWEST/devflow-finance-twin) | IBM i BaaS ledger stack |
|
| 130 |
+
| [SNAPKITTYWEST/sovereign-training-corpus](https://huggingface.co/datasets/SNAPKITTYWEST/sovereign-training-corpus) | Training corpus |
|
| 131 |
+
| [GitHub](https://github.com/SNAPKITTYWEST/mantra) | Source repository |
|