← Lab L7 — Correlated Failure Test All modules Lab L9 — Minimal Control Plane →

Lab L8 — Harness Adapter Interface & Cross-Harness Execution Engine

Phase 6 · MULTI-HARNESS — Lab L8
Status: Authored & Empirically Verified.
Student Lab Package: Authenticated Direct Download from VTAlgo Platform
Branches: main (starter template) · solution (reference architecture).
Video Master: 04:45 min @ 1080p FHD 60fps NVENC · Audio Elmer Oficial (-16 LUFS, Zero BGM) · Curated Synchronized Subtitles (ASS).
Canonical Path: Student repo only — not E:\bridle, not the Kratos live product.

1. Laboratory Objective

Construct from scratch in pure Go an industrial-grade Multi-Harness Adapter Interface & Cross-Harness Execution Engine, proving empirically that enterprise multi-agent systems require capability negotiation via bitmasks, non-blocking ring-buffered stdio isolation, clean OS process group teardown, and transactional cascade failover with atomic workspace rollback.

The student implements:


2. The Four Cardinal Subsystems

┌──────────────────────────────────────────────────────────────────────────┐
│        MULTI-HARNESS ADAPTER INTERFACE & DISPATCH ENGINE (PURE GO)       │
│                                                                          │
│  ┌─────────────────────────┐           ┌──────────────────────────────┐  │
│  │  1. Adapter & Bitmasks  │           │  2. In-Memory Mock Adapter   │  │
│  │     TaskEnvelope        ├──────────►│     Fault Injection Engine   │  │
│  │  (O(1) Capability Probe)│           │  (Timeouts/Crashes/Tokens)   │  │
│  └───────────┬─────────────┘           └──────────────┬───────────────┘  │
│              │                                        │                  │
│              ▼                                        ▼                  │
│  ┌─────────────────────────┐           ┌──────────────────────────────┐  │
│  │  3. Subprocess Adapter  │           │  4. Resilient Dispatcher     │  │
│  │     Bounded Ring Buffer ├──────────►│     Cascade Fallback Engine  │  │
│  │  (Process Tree Teardown)│           │  (Atomic Rollback / Auditing)│  │
│  └───────────┬─────────────┘           └──────────────┬───────────────┘  │
│              │                                        │                  │
│              ▼                                        ▼                  │
│  ┌────────────────────────────────────────────────────────────────────┐  │
│  │  5. 10/10 Deterministic Test Suite in <300ms (ThreadSanitizer)     │  │
│  └────────────────────────────────────────────────────────────────────┘  │
└──────────────────────────────────────────────────────────────────────────┘

1. Canonical Adapter Interface (pkg/adapter)

2. Mock Adapter & Fault Injection (pkg/mock)

3. Subprocess CLI Adapter & Ring Buffers (pkg/subprocess)

4. Resilient Dispatcher & Cascade Fallback (pkg/dispatcher)


3. Verification & Testing Invariants

cd hefesto-lab8-harness-adapter
go test -v ./...

Expected output:


4. Interactive CLI Tool

The lab includes an interactive demonstration binary in cmd/adapter-cli:

# Standard end-to-end multi-stage pipeline run:
go run ./cmd/adapter-cli

# Demonstrate cascade fallback with atomic rollback:
go run ./cmd/adapter-cli -mode fallback-demo

# Demonstrate redundant cross-harness divergence verification:
go run ./cmd/adapter-cli -mode redundant-demo