Skip to content

Implementation Introduction (v0.2)

This document defines the architectural foundations, design principles, and processing pipeline of a compliant RIGOR implementation. It serves as the definitive roadmap for translating formal specifications into deterministic executable systems.

1. Purpose & Scope

The Implementation section establishes:

  • The executable architecture of the RIGOR engine.
  • The multi-stage processing pipeline (from YAML to CLI/JSON).
  • Internal engine responsibilities and isolation boundaries.
  • Strict requirements for determinism, immutability, and ACID persistence.

Any implementation claiming compliance with the RIGOR protocol MUST conform to the principles defined herein.

2. Architectural Philosophy

RIGOR is designed to be:

  • Deterministic: Identical inputs MUST yield identical graphs and outputs.
  • Immutable: Core structures (Canonical Graph) cannot be modified after construction.
  • Modular: Independent engines handle parsing, validation, and evolution.
  • Auditable: Every transition and mutation must be traceable and reproducible.

3. High-Level Processing Pipeline

A compliant implementation MUST process specifications through the following logical flow:

Source YAML

Parser & Loader (Input Layer)

Canonical Graph Builder (Structural Layer)

Canonicalization Engine (Normalization)

Validation Engine (Semantic Layer)

(Evolution Layer - Optional)
  → Diff Engine
  → Versioning Engine
  → Migration Engine

Interface Layer (CLI / JSON Output)

4. Core Architectural Layers

4.1 Input Layer

Handles raw file reading, syntax validation (YAML/JSON), and initial normalization. No semantic or domain-level validation occurs at this stage.

4.2 Structural Layer (The Canonical Graph)

The single source of truth. Transforms the abstract syntax tree into a directed, typed graph. It resolves internal references and guarantees that all subsequent operations are performed on a stable, immutable model.

4.3 Semantic Layer (Validation)

Enforces the Validation Matrix. It performs structural, process, event, and constraint checks to produce a formal Compliance Report.

4.4 Evolution Layer

Activated during version comparisons or updates. It classifies changes (Breaking/Non-breaking) and executes atomic migration operations.

4.5 Persistence Layer (Execution)

While the protocol is runtime-agnostic, any persistent execution MUST utilize an ACID-compliant strategy. Every transition is an atomic unit of work:

  1. Load State/Context.
  2. Apply Mutation.
  3. Commit Transition.
  4. Log for Audit.

5. Determinism & Error Model

Implementations MUST guarantee stable ordering of nodes, changes, and errors. All errors MUST include a stable code (e.g., ERR_...) and reference a canonical path when applicable.

6. Implementation Documentation Roadmap

This section is composed of detailed specifications for each module:

  1. Introduction (This document)
  2. System Architecture
  3. Parser & Loader
  4. Canonical Graph Builder
  5. Canonicalization Engine
  6. Validation Engine
  7. Constraint Engine
  8. Diff Engine
  9. Versioning Engine
  10. Migration Engine
  11. Event Engine
  12. Error Model
  13. CLI
  14. Performance & Testing

7. Getting Started for Implementers

To build a RIGOR-compliant engine:

  1. Bootstrap the Parser: Implement strict YAML ingestion.
  2. Implement the Graph Model: Create the internal representation of nodes and edges.
  3. Build the Validator: Follow the 22-rule Validation Matrix.
  4. Define the CLI: Implement the normative grammar for validate, diff, and migrate.

Note: In case of ambiguity between Implementation and Specification sections, the Specification prevails.

AI Constraint Protocol