HOME/DOCUMENTATION/AXIOMS

Axiom Authoring & Resin DSL Specification

A Resin DSL Axiom (\`.resin\`) is a deterministic, declarative policy file that dictates how D.I.A.N.A. OS interacts with local data streams, system memory, and execution hardware.

Rather than relying on vague natural language prompt engineering, Resin DSL acts as an impenetrable neuro-symbolic fence. It forces the local Ollama LLM to parse raw data, bound its logical conclusions against our 18 Core Geometries, and enforce mathematical constraints before executing any digital or physical action.

SUPPORTED RUNTIME: CORE ARCHITECT & SOVEREIGN HACKERTARGET AUDIENCE: SYSTEMS ENGINEERS & ARCHITECTS

In the Core Architect Tier, developers have direct access to the surrounding source modules (\`actuation/\`, \`parsers/\`, and the orchestration pipeline), which allows them to point D.I.A.N.A. directly at local data streams without sending a single byte to the cloud.

1. How to Tell D.I.A.N.A. to Ingest Workstation Data

To ingest raw data on a local workstation, an engineer utilizing the Architect Tier executes a two-step integration using our open orchestration tools:

Custom Resin DSL Axioms (Structured & Tabular Data)

Because the Architect Tier supports up to 100 custom Resin DSL axioms, the engineer writes a specific data-ingestion axiom (e.g., \`ingest_clinical_trials.resin\`). This axiom directs the local Ollama LLM to read specific directories (like \`/mnt/research_data/\`), parse CSVs, SQLite databases, or raw JSON logs, and vectorize them into a local, offline vector index (such as FAISS or a local Postgres/pgvector database).

The Optic & Acoustic Loop (Unstructured & Live Data)

If the data is proprietary legacy software that lacks an API, D.I.A.N.A. uses her digital embodiment. The engineer configures the \`VisualActuator\` to monitor the desktop screen buffer via OpenCV and route the frames to the local Vision-Language Model (\`http://localhost:11434\`). D.I.A.N.A. literally "watches" the data populate on the screen and reads it via OCR and spatial parsing.

2. How the Owner Prompts D.I.A.N.A. to Analyze Raw Data

Once the ingestion pathways are defined in the framework, prompting D.I.A.N.A. is as natural as chatting with a senior research analyst, but with mathematical deterministic guardrails. The operator opens the local terminal or OpenClaw interface and issues a direct command:

"D.I.A.N.A., execute \`axiom:analyze_assay_results\`. Ingest the raw spectrometer CSVs from \`/home/lab/trials_2026/\`. Cross-reference the cellular degradation rates against our 18 Core Geometries reasoning engine, isolate any anomalous data points that deviate by more than 2 standard deviations, and generate a markdown summary report."

When that prompt hits the system:

  • OpenClaw parses the intent and routes it through the 17 Pillars and \`skill.md\` genesis logic to ensure the evaluation remains strictly logical and grounded.
  • The designated Resin DSL axiom executes, reading the raw files directly from the hard drive into system RAM.
  • The local Ollama LLM processes the math and pattern recognition locally, generating an instant, zero-hallucination analysis without ever touching an internet connection.

The 4-Step Axiom Creation Workflow

[ 1. Identification ] ➔ [ 2. Local Ingress ] ➔ [ 3. Geometry Binding ] ➔ [ 4. Egress Guardrails ]

Step 1: Define Axiom Scope & Identity

Specify the unique identifier, operational tier, and execution context. This tells the orchestration engine (\`core/mediator.py\`) which memory space to allocate.

Step 2: Configure Local Data Ingress

Define the exact local filesystem paths, allowed file extensions, anonymization filters, and vector database targets. Data is vectorized locally without touching network interfaces.

Step 3: Bind Core Geometries & Confidence Thresholds

Map query logic directly to D.I.A.N.A.'s 18 Core Geometries. Set mathematical confidence thresholds (p ≥ 0.95) so the system halts execution rather than hallucinating.

Step 4: Enforce Egress Format & Action Guardrails

Specify output format and mandate that no raw Protected Health Information (PHI) or unhashed identifiers leave the RAM boundary.

Production Blueprints by Architectural Pillar

Select an architectural pillar and a sector to view the drop-in `.resin` production scripts.

Resin DSL (.resin)
# ==============================================================================
# D.I.A.N.A. OS - Resin DSL Policy Script
# Axiom Name: Ingest Clinical Trials & Patient Cohorts
# Domain: Digital Sovereignty / Healthcare & Bio-Informatics
# ==============================================================================

Axiom.define("ingest_clinical_trials") {
  meta {
    version     = "1.0.0"
    author      = "Clinical Systems Architecture Team"
    description = "Parses raw oncology lab CSVs, anonymizes PHI, and indexes logical geometries locally."
    target_tier = "Architect"
  }

  ingress {
    source_type     = "filesystem"
    target_path     = "/mnt/clinical_vault/trials_2026/"
    file_patterns   = ["*.csv", "*.json", "*.sqlite"]
    recursive       = true
    
    privacy {
      strip_direct_identifiers = true
      mask_fields              = ["patient_name", "ssn", "dob", "address"]
      hashing_algorithm        = "SHA256"
    }

    vector_store {
      provider   = "pgvector_local"
      endpoint   = "postgresql://diana_local:5432/bio_db"
      table      = "oncology_geometries_2026"
      chunk_size = 512
    }
  }

  reasoning_engine {
    model_endpoint     = "http://localhost:11434"
    model_name         = "ollama/llama3.3:latest"
    
    core_geometries {
      enforce_17_pillars   = true
      genesis_verification = true
      strict_deduction     = true
    }

    constraints {
      min_confidence_score = 0.95
      allow_speculation    = false
    }
  }

  egress {
    primary_output = "markdown_report"
    output_path    = "/home/lab/reports/oncology_summary.md"
    
    network_guard {
      allow_outbound_http  = false
      allow_cloud_fallback = false
      airgap_strict_mode   = true
    }
  }
}

How to Test and Execute Your Axiom

1. Syntax Validation

Run the Resin DSL parser in dry-run mode to verify syntax and ensure no unhandled network calls exist:

Terminal / CLI
diana_cli axiom validate /axioms/ingest_clinical_trials.resin

[SUCCESS] Axiom syntax valid. Air-gap strict mode verified. Zero cloud endpoints detected.

2. Execution via CLI Command

To launch the axiom and process the local data directory:

Terminal / CLI
python3 -m core.mediator --execute-axiom /axioms/ingest_clinical_trials.resin

3. Execution via Conversational OpenClaw Prompt

Operators can trigger the axiom conversationally. Because the axiom establishes data paths and constraints, the prompt remains short and clear:

"D.I.A.N.A., execute \`axiom:ingest_clinical_trials\`. Analyze the raw T-cell degradation metrics in \`/mnt/clinical_vault/trials_2026/\`, flag any patients exhibiting an abnormal reaction greater than 2 standard deviations, and generate the final summary report."

Axiom Best Practices for Developers

  • Always Set \`airgap_strict_mode = true\`: In secure environments, never set outbound HTTP access to \`true\` unless explicitly integrating with a local, on-premise REST endpoint.
  • Keep Chunk Sizes Small (256 - 512 tokens): Smaller chunk sizes allow the local Ollama LLM to retrieve precise geometric snippets from \`pgvector\`, drastically increasing inference speed on NVIDIA RTX hardware.
  • Enforce \`allow_speculation = false\`: This forces D.I.A.N.A. to respond with "Insufficient Local Data" whenever a query cannot be mathematically supported by local data geometries, completely eliminating LLM hallucinations.