← Lab L11 — Capability Gate & Security Kernel All modules Lab L13 — Equal-Compute Benchmark →

Lab L12 — Trajectory Tracing & Decision Lineage Engine (Pure Go)

Phase 9 · OBSERVABILITY & EVIDENCE — Lab L12
Status: Authored & Empirically Verified.
Student Lab Package: Authenticated Direct Download from VTAlgo Platform (hefesto-lab12-trajectory-lineage.zip)
Branches: main (starter template) · solution (reference architecture).
Canonical Path: Student repo only (hefesto-lab12-trajectory-lineage) — not E:\bridle, not the live product.

1. Laboratory Objective

Construct from scratch in pure Go standard library an enterprise-grade Trajectory Tracing & Decision Lineage Engine, proving empirically that autonomous multi-agent workflows can be made fully observable, mathematically auditable, and deterministically reproducible with zero runtime performance penalty.

The student implements:


2. System Architecture

┌──────────────────────────────────────────────────────────────────────────┐
│        HEFESTO TRAJECTORY & DECISION LINEAGE ENGINE (PURE GO)            │
│                                                                          │
│  ┌─────────────────────────┐           ┌──────────────────────────────┐  │
│  │ 1. Causal Trajectory    │           │ 2. Decision Lineage          │  │
│  │    RunID · Turns (0..N) ├──────────►│    Cardinal Equation:        │  │
│  │    Hierarchical Spans   │           │    S + E + C + M ──> DECISION│  │
│  └───────────┬─────────────┘           └──────────────┬───────────────┘  │
│              │                                        │                  │
│              ▼                                        ▼                  │
│  ┌─────────────────────────┐           ┌──────────────────────────────┐  │
│  │ 3. Memory Observability │           │ 4. Artifact Provenance Graph │  │
│  │    6 Lifecycle Events   ├──────────►│    SHA-256 Content Addressing│  │
│  │    Rejected Audit Logs  │           │    Oracle Verification Sealed│  │
│  └───────────┬─────────────┘           └──────────────┬───────────────┘  │
│              │                                        │                  │
│              ▼                                        ▼                  │
│  ┌────────────────────────────────────────────────────────────────────┐  │
│  │ 5. Telemetry & CLI: Tokens · USD Spend · Forensic Replay in <250ms │  │
│  └────────────────────────────────────────────────────────────────────┘  │
└──────────────────────────────────────────────────────────────────────────┘

3. The Five Core Engine Subsystems

1. Causal Trajectory Engine (pkg/trajectory)

2. Decision Lineage Engine (pkg/lineage)

3. Memory Observability & Rejection Auditor (pkg/memoryobs)

4. Content-Addressed Artifact Provenance (pkg/artifact)

5. Telemetry & Financial Attribution (pkg/telemetry)


4. CLI Multi-Mode Operations

The student CLI (cmd/lineage-cli) exposes three deterministic operational modes:

Mode 1: Nominal Trajectory Execution

go run ./cmd/lineage-cli -mode nominal

Executes a multi-turn workflow, creates artifacts, records decisions under the cardinal equation, verifies authority genealogy, and displays token and USD spend.

Mode 2: Memory Rejection & Scope Audit

go run ./cmd/lineage-cli -mode audit-rejections

Evaluates memory candidates, trapping cross-tenant violations, stale TTL records, and state contradictions, emitting a structured JSON rejection audit trail.

Mode 3: Deterministic Forensic Post-Mortem Replay

go run ./cmd/lineage-cli -mode forensic-replay

Replays a recorded incident trajectory step-by-step in an isolated sandbox with zero LLM API calls, verifying root-cause analysis (RCA) security assertions.


5. Verification & Test Suite

Run the full automated test suite:

go test -v ./...

Test Suite Inventory (24/24 PASS in <250ms)