Skip to content

Instantly share code, notes, and snippets.

View afflom's full-sized avatar

Alex Flom afflom

View GitHub Profile
#!/usr/bin/env python3
"""
Pure UOR — execution + integrity + NTT spectral (lossless full-complex)
=====================================================================
This script implements:
- A dynamic prime cache
- Data and exec opcodes with per-chunk checksum (exp⁶)
- Block framing via prime⁷ headers
- Forward & inverse Number-Theoretic Transform (NTT) mod 13 as a spectral operator
- Automatic inversion ensuring lossless round-trip

Universal Object Reference (UOR) Model Framework

Overview

The models/ directory contains the complete definition of the Universal Object Reference (UOR) framework - a comprehensive model-driven architecture that implements a universal computational substrate based on mathematical principles of prime decomposition and observer invariance.

This repository is exclusively defined in JSON and serves as the canonical source of truth for all UOR models. No scripts or executable code are authorized within this repository - it is a pure definition space where models are defined declaratively and then externally processed.

Core Principles

Universal Object Reference (UOR) Model

The UOR Model provides a meta-mathematical framework for defining and manipulating ontologies using the principles of prime decomposition, observer invariance, and coherence. This document details the model's architecture, implementation, and usage patterns.

Core Principles

The UOR Model embodies the essential principles of the UOR Framework:

  1. Prime Decomposition: Objects are represented through their decomposition into irreducible elements
  2. Observer Invariance: Representations remain consistent across different perspectives
@afflom
afflom / prime-math-lib-spec.md
Created March 31, 2025 04:36
The Prime Framework JavaScript Math Library Specification

Prime Math Library Specification

Introduction

The Prime Math Library is a JavaScript library that implements the Prime Framework for numbers. It provides a comprehensive system for representing and manipulating integers in a base-independent way, ensuring unique, factorization-based representations and geometric consistency. The library introduces Universal Numbers – integers encoded by their complete digit expansions across all bases – and supports operations on these numbers while preserving their intrinsic prime factor structure. It is designed to resemble standard JavaScript math interfaces (like Math and BigInt) in usability, but with far greater precision and structural insight. The specification below details each component of the library, ensuring no ambiguity for implementors and full compliance with Prime Framework principles.

Universal Number Representation

Universal Numbers are the cornerstone of the library. Each natural number ( N ) is represented in a *universal coo

@afflom
afflom / 512-spectral-pivot.md
Last active April 1, 2025 13:49
512-Bit Universal Digest Spectral Conversion System

512 Spectral Adaptive Pivot Coordinate System Specification

Introduction and Overview

The 512 Spectral Adaptive Pivot Coordinate System is a formally defined method for encoding arbitrary-length binary data as a fixed-size 512-bit universal digest and decoding it back to the original data. It leverages the Prime Framework’s intrinsic number representation to achieve lossless compression up to a theoretical 10^10:1 ratio. The system is spectral in that it operates in the prime-factor coordinate domain (treating prime factors as basis frequencies), and adaptive pivot in that it dynamically selects prime “pivot” bases to efficiently map data into the digest. All aspects of this coordinate system are defined using only the Prime Framework’s axioms and constructs (no external number theory), ensuring mathematical rigor and consistency with the framework’s universal number notation.

Key goals and features:

  • Universal Coordinate Mapping: The encoding uses the Prime Framework’s *Un
@afflom
afflom / uhcg.md
Created March 28, 2025 04:20
Universal Hash Codec - Geometric

Universal Hash Codec (UHC) – Geometric Specification

Introduction and Overview

The Universal Hash Codec (UHC) is a formal scheme for encoding natural numbers as unique geometric objects, based on the Universal Object Reference (UOR) framework and the Prime Framework’s intrinsic number embedding. In UOR, each number is represented as a multi-vector in an algebraic fiber, embedding all its possible representations (its universal coordinate tuple) concurrently (4-operator.pdf). The UHC extends this idea by defining a geometric hash function that maps any number to a point on a high-dimensional manifold, using multiple metrics (Euclidean, hyperbolic, and elliptical) to shape the space. Crucially, this mapping is lossless – it can be inverted to recover the original number exactly, preserving referential invariance, base-independence, and intrinsic identity (core UOR

@afflom
afflom / PrimeOS-paper.md
Created March 18, 2025 15:00
PrimeOS Whitepaper

PrimeOS: A Neural Network-Based Operating System

Abstract

PrimeOS represents a new approach to operating system design. Instead of seeing computation as a sequence of instructions, it treats it as a neural process governed by mathematical principles of coherence.

Traditional operating systems are built from the hardware up, focusing on managing physical resources and executing programs. PrimeOS takes a fundamentally different approach with a novel four-tier architecture built on a neural foundation. This enables the system to continuously adapt and optimize itself while maintaining mathematical consistency.

This whitepaper introduces PrimeOS's core concepts in an accessible way. We'll explore its mathematical foundations, architectural principles, and practical implementations. You'll learn how this approach creates a system that adapts to user needs, optimizes resources intelligently, and maintains security through mathematical properties rather than explicit permissions.

@afflom
afflom / output.txt
Last active March 16, 2025 22:29
PrimeOS Library test results
PrimeOS Library Tests
Tests started. See results below:
Running tests...
Suite: Clifford Algebra
- [PASS] should create scalar elements correctly
- [PASS] should create vector elements correctly
- [PASS] should convert vector to array correctly
- [PASS] should add multivectors correctly
- [PASS] should compute the geometric product correctly
@afflom
afflom / coherence-gradient-descent.py
Last active March 13, 2025 02:11
Spectral Prime Decomposition extracts factorization information from eigenspaces rather than periodicity, enabling quantum-resistant cryptography.
#!/usr/bin/env python3
"""
Coherence-Gradient Descent Algorithms - A Prime Framework Reference Implementation
This implementation combines multiple advanced techniques from the Prime Framework:
1. Spectral analysis from the Prime Operator's eigenstructure
2. Fiber algebra for multi-perspective pattern detection
3. Multi-base representation for constraint encoding
4. UOR framework concepts for navigating solution spaces efficiently
@afflom
afflom / kernel-spec.md
Created March 8, 2025 17:18
Evolutionary Ontology API

Prime Kernel Evolutionary Ontology Specification

Version: 1.0.0
Status: Reference Implementation
Author: The UOR Foundation
Date: March 2025

1. Foundational Principles

The Prime Kernel is the foundational Evolutionary Ontology that implements the four axioms of the Prime Framework, providing core infrastructure for all other ontologies to build upon. It serves as both a runtime environment and a meta-ontology that enables the coherent evolution of knowledge structures.