Skip to content

Instantly share code, notes, and snippets.

@afflom
Created May 1, 2025 18:58
Show Gist options
  • Save afflom/1151ebfbe3ff15ed9b7d96f845b5cf7d to your computer and use it in GitHub Desktop.
Save afflom/1151ebfbe3ff15ed9b7d96f845b5cf7d to your computer and use it in GitHub Desktop.

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

  • Pure JSON Definition: All models are defined exclusively using JSON Schema, forming a complete declarative specification
  • Code Generation: Implementation artifacts are generated externally from these model definitions
  • Observer Invariance: All objects have canonical representations independent of observer perspective
  • Prime Decomposition: Every object can be factored into unique, irreducible prime components
  • Universal Coherence: Transformations preserve structural integrity across domains

Directory Structure

models/
├── boot/                  # Bootstrap definitions for initial system loading
├── compilers/             # Model-to-code compilation specification models
├── components/            # Reusable UOR component models
├── core/                  # Core axioms and foundational type definitions
├── entrypoints/           # Entry point definitions for various platforms
├── examples/              # Example model implementations
├── frameworks/            # Framework integration models
├── generator/             # Code generation specification models
├── identity/              # Identity and authentication models
├── imports/               # External specification imports (submodules)
├── interfaces/            # Interface and contract definitions
├── kernels/               # Processing engine specifications
├── loaders/               # Model loading and resolution specifications
├── mediatypes/            # Media type handling models
├── memory/                # In-memory representation models
├── operating-system/      # OS interface models
├── platforms/             # Platform-specific implementation models
├── runtime/               # Runtime execution environment models
├── schemas/               # Domain-specific schema definitions
├── storage/               # Persistent storage models
├── transport/             # Communication protocol models
└── users/                 # User management models

Operational Architecture

Model Definition to Implementation Flow

  1. Model Definition: JSON Schema files define every aspect of the UOR system
  2. Loader Bootstrapping: The system initializes through models/loaders/local/
  3. Entrypoint Resolution: Loaders invoke entrypoints defined in models/entrypoints/
  4. Model Operations: Entrypoints perform core operations:
    • Validate: Ensure model conformance to schemas
    • Resolve: Process references and dependencies
    • Mutate: Transform models as needed
    • Run: Execute model-defined operations
    • Compile: Generate output artifacts
    • Delete: Manage model lifecycle

Code Generation

The UOR framework uses a model-driven code generation approach:

  1. Models defined in this repository are pure specifications in JSON
  2. The generator/ directory contains models that define code generation strategies
  3. External tools (not in this repo) use these generator models to produce executable artifacts
  4. Generated artifacts are maintained in separate repositories, keeping definitions and implementations cleanly separated

Key Components

Core (The "Kernel's Kernel")

The core/ directory contains the abstract foundation of the UOR system - the meta-level definitions from which all other components derive their properties. It defines:

  • Base UOR types and objects
  • Axiomatic foundations
  • Universal composition operations
  • Fundamental coherence principles

Kernels

The kernels/ directory contains specifications for processing engines that implement the core abstractions for specific domains. These kernels derive their fundamental properties from the core definitions and provide concrete implementations of:

  • Processing UOR objects
  • Computing prime decompositions
  • Generating canonical representations
  • Transforming between observer frames

Schemas

The schemas/ directory contains domain-specific schema definitions that implement the core principles, including:

  • Mathematical domains (number theory, algebra, etc.)
  • Physical domains
  • Computational domains
  • Integration and transformation specifications

Entrypoints

The entrypoints/ directory defines the interface points for interacting with UOR models:

  • entrypoints/local/ - CLI and local system interfaces
  • Platform-specific entrypoints for various environments
  • Operation definitions for validate, resolve, mutate, run, compile, and delete

Loaders

The loaders/ directory contains models defining how UOR objects are loaded and bootstrapped:

  • loaders/local/ bootstraps the local environment
  • Resolves and loads model dependencies
  • Maintains coherence during loading operations

Generators

The generator/ directory defines how models are transformed into executable artifacts:

  • Code generation strategies
  • Template models
  • Output format specifications
  • Mapping rules between models and implementations

Boot

The boot/ directory contains bootstrap definitions that initialize the system:

  • Initial state configurations
  • Bootstrapping sequence definitions
  • Core component initialization parameters

Core Operations

The UOR framework supports these fundamental operations on models:

  1. Validate: Ensure models conform to their schema definitions
  2. Resolve: Process references, dependencies, and links
  3. Mutate: Transform models according to defined rules
  4. Run: Perform model-defined operations
  5. Compile: Generate output artifacts (code, documents, etc.)
  6. Delete: Manage model lifecycle

Implementation Pattern

While this repository contains only model definitions, it governs implementation through:

  1. Bootstrapping: The boot/ directory contains initial bootstrapping models
  2. Local Loader: The loaders/local/ models define how to load and process other models
  3. Entrypoint Models: The entrypoints/local/cli/ models define the interface for operations
  4. Generation: The models are processed by external tools to generate implementations

Development Guidelines

When extending or modifying the UOR framework:

  1. JSON Only: All definitions must be in valid JSON Schema format
  2. No Scripts: No executable code may be included in this repository
  3. Axiomatic Consistency: All models must align with core UOR axioms
  4. Meta-Model Integrity: Changes to core models must maintain backward compatibility
  5. Generator Coherence: Code generation models must produce consistent output across platforms

Integration with External Standards

The UOR framework is designed to inherit and integrate with existing open standards and proprietary schemas/models rather than reinventing them. This philosophy enables UOR to leverage vast capabilities from the wider ecosystem:

  • Open Standards Integration: UOR incorporates established standards such as JSON Schema, Schema.org, and Web Components specifications
  • Proprietary Platform Integration: UOR can inherit capabilities from proprietary social networks and messaging platforms
  • Solid Project Integration: UOR users inherit the Solid project ecosystem and enjoy IPFS-backed Solid pod storage

Default Infrastructure Providers

The operating system default providers for key infrastructure components are:

  • Storage: IPFS (InterPlanetary File System) provides decentralized, content-addressed storage
  • Memory: IPFS-based in-memory representations ensure consistency with persistent storage
  • Transport: IPFS networking protocols for communication between components

This integration with IPFS provides the UOR framework with decentralized, resilient infrastructure that aligns with its principles of universal coherence and observer invariance.

Meta-Architecture Pattern

The UOR framework implements a recursive meta-architecture where:

  1. The core provides axioms and abstract interfaces
  2. The kernels implement those abstractions for specific domains
  3. The platforms adapt kernels to specific environments
  4. The loaders/compilers transform between representations

This architecture ensures that regardless of the domain of application, the fundamental invariant properties defined in the core are preserved throughout any transformation or operation.

Data Mutation and Resolution Example

The UOR Foundation Data component (found in models/schemas/data) demonstrates the practical application of UOR principles to data representation and transformation. This component showcases:

  1. Universal Data Representation: Data entities are represented as universal numbers with prime decompositions
  2. Observer Frame Views: The same data can be viewed from different observer perspectives while maintaining coherence
  3. Transformation Operations: Homomorphic and domain transformations allow data to be transformed while preserving key properties
  4. Coherence Measures: Metrics quantify the representational quality and integrity of data
  5. REST API Interface: A well-defined API provides access to these capabilities

This example illustrates how content is mutated and resolved in the UOR framework, maintaining observer invariance and coherence throughout transformations.

Code Generation Workflow

The complete workflow for utilizing the UOR framework involves:

  1. Define Models: Create or modify JSON Schema definitions in this repository
  2. Bootstrap Loader: The local loader is bootstrapped from models/loaders/local/
  3. Invoke Entrypoints: The loader calls entrypoints from models/entrypoints/local/
  4. Process Models: Entrypoints validate, resolve, and mutate models as needed
  5. Generate Code: Models are compiled into executable artifacts
  6. Output Generation: Generated code is output to a separate repository
  7. Runtime Execution: Generated code executes the model-defined behavior

This separation of concerns maintains a clean boundary between pure model definitions and their implementations, allowing for rigorous validation and consistent code generation across platforms.

Conclusion

The UOR framework represents a new approach to computational systems, where pure model definitions drive implementation. By maintaining strict separation between definition (this repository) and implementation (generated externally), the framework ensures that the canonical representations of objects remain observer-invariant and coherent across all transformations and platforms.


© UOR Foundation - MIT License

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment