Semantic DAG

The Directed Acyclic Graph (DAG) is Mayros's immutable audit trail. Every meaningful action — memory writes, mission transitions, knowledge graph mutations, fuel events — is recorded as a cryptographically signed DAG node. Once committed, actions cannot be altered or deleted without detection.

Why it Matters

  • Auditability — every action has a permanent, tamper-evident record
  • Accountability — each node is signed with the author's Ed25519 key
  • Time-travel — reconstruct the exact state of the knowledge graph at any past point
  • Verification — prove that a specific action happened, when, and by whom
  • Diffing — compare state between any two points in history

How it Works

Each DAG action contains:

FieldDescription
hashContent-addressable hash of the action
authorNode ID that created the action
seqSequence number within the author's chain
timestampWhen the action was committed
payload_typeType of action (e.g. triple:add, mission:transition)
payload_summaryHuman-readable description
parentsHash(es) of parent action(s) — forms the DAG structure
signatureEd25519 signature over the action content

Actions form a DAG by referencing their parent hashes. Tips are the frontier — the latest actions with no children yet.

CLI Reference

10 subcommands under mayros dag. See the full CLI reference for detailed usage.

CommandDescription
dag tipsShow current DAG tip hashes (frontier)
dag action <hash>Inspect a specific action by hash
dag history <subject>Action history for a subject
dag chain <author>Action chain for an author/node
dag statsDAG statistics (action count, tip count)
dag prunePrune old actions with configurable retention policies
dag at <hash>Time-travel: reconstruct state at a specific action
dag diff <from> <to>Diff between two action hashes
dag exportExport DAG as DOT, Mermaid, or JSON
dag verify <hash>Verify Ed25519 signature of an action

MCP Tools

10 DAG tools are exposed via the MCP Server:

ToolDescription
mayros_dag_tipsGet current DAG tip hashes
mayros_dag_actionInspect a specific action
mayros_dag_historyAction history for a subject
mayros_dag_chainAction chain for an author
mayros_dag_statsDAG statistics
mayros_dag_prunePrune old actions
mayros_dag_time_travelReconstruct state at a point in time
mayros_dag_diffDiff between two actions
mayros_dag_exportExport DAG as DOT, Mermaid, or JSON
mayros_dag_verifyVerify Ed25519 signature

Configuration

The DAG is enabled by default. To disable it, set in mayros.json:

json5
{
  cortex: {
    dag: {
      enabled: false
    }
  }
}

Quick Examples

bash
# See the latest actions at the frontier
mayros dag tips

# Inspect what happened in a specific action
mayros dag action abc123def456

# View the full history for a subject
mayros dag history "venture:security-audit" --limit 50

# Time-travel to see state at a past point
mayros dag at abc123def456

# Compare two points in history
mayros dag diff abc123 def456

# Verify an action's signature
mayros dag verify abc123def456 --public-key <hex-or-base64>

# Export the full DAG as a Mermaid diagram
mayros dag export --format mermaid

# Prune old actions, keeping the last 1000
mayros dag prune --policy keep_last --value 1000 --checkpoint