Dispatch System Sol

31 files

loom-builder-solsource

Types

/** Contract types for loom-builder dispatches. */ export interface ModelRef { provider: string; id: string; } exp…

TS186 lines6,050 bytes
loom-builder-solsource

Gate Packs

import { existsSync, readFileSync, statSync } from "node:fs"; import { join, resolve } from "node:path"; import type { V…

TS126 lines4,537 bytes
loom-builder-solsource

Gate Integrity

/** * gate-integrity.ts — Layer 1 runtime enforcement (A13 / N15 / N16). * * Verifies a spec's pinned gate reference …

TS137 lines5,182 bytes
loom-builder-solsource

Gate Analyzer

/** * gate-analyzer — preflight gate complexity review. * * Runs on EVERY dispatch after spec lint, before the execut…

TS571 lines18,199 bytes
loom-builder-soltest

Purpose.Test

import { describe, expect, test } from "bun:test"; import { injectPurpose, purposeBlock } from "./purpose.js"; describe…

TS21 lines824 bytes
loom-builder-soltest

Dispatch Archive.Test

/** * Structural proof of the Dispatch Artifact Contract across paths. * Asserts: on BOTH normal completion AND a SIGT…

TS87 lines3,621 bytes
loom-builder-solsource

Pi Executable

import { existsSync } from "node:fs"; export interface PiExecutableCheck { ok: boolean; path: string; reason: str…

TS27 lines861 bytes
loom-builder-solsource

Model Router

import { existsSync, readFileSync } from "node:fs"; import { resolve } from "node:path"; import type { DispatchSpec, Mod…

TS69 lines2,315 bytes
loom-builder-solsource

Spec Lint

/** * Spec-schema lint — validates DispatchSpec at preflight before dispatch. * * Checks: * - Unknown top-level keys…

TS234 lines7,585 bytes
loom-builder-solsource

Preflight Cli

/** * Pre-flight CLI: estimate tokens for a spec and exit non-zero if too large. * Usage: bun run src/preflight-cli.ts…

TS42 lines1,436 bytes
loom-builder-solsource

Preflight

import { readFileSync } from "node:fs"; import { globSync } from "glob"; import { resolve, relative } from "node:path"; …

TS183 lines6,119 bytes
loom-builder-soltest

Pi Executable.Test

import { afterEach, describe, expect, test } from "bun:test"; import { mkdtempSync, rmSync, writeFileSync } from "node:f…

TS33 lines1,072 bytes
loom-builder-solsource

Outcome

import type { DispatchOutcome } from "./types.js"; export type DispatchStatus = DispatchOutcome["status"]; export func…

TS27 lines894 bytes
loom-builder-solsource

Run

/** * loom-builder — homeostatic dispatch harness. * Runs one DispatchSpec: agent loop (pi-coding-agent SDK) under har…

TS532 lines23,100 bytes
loom-builder-solsource

Exit Matrix

/** * Exit-code retry matrix — maps process outcomes to verdicts. * * Bug fixed: executor exit -1 previously could re…

TS71 lines2,575 bytes
loom-builder-solsource

Import Lesson

/** * import-lesson.ts — reads enforcement artifacts from pi-cybernetic's file-based * queue and applies them to loom-…

TS456 lines14,814 bytes
loom-builder-solsource

Dispatch Archive

/** * dispatch-archive — THE single source of truth for the Dispatch Artifact Contract. * * Contract (see /home/mikes…

TS172 lines6,375 bytes
loom-builder-solsource

Gate Escalation

/** * gate-escalation — consecutive-failure tracking and diagnostic interrogation. * * When the same validation gate …

TS295 lines9,472 bytes
loom-builder-solsource

Gates

import { createHash } from "node:crypto"; import { GateHaltError, type HaltReason, type ValidationCmd } from "./types.js…

TS174 lines6,717 bytes
loom-builder-soltest

Gate Escalation.Test

import { describe, expect, test } from "bun:test"; import { GateEscalationTracker, buildDiagnosticPrompt, parseDia…

TS373 lines15,237 bytes
loom-builder-soltest

Preflight.Test

/** * Tests for token-cliff gate: pre-flight estimate, runtime ceiling, chain awareness. */ import { describe, test, e…

TS173 lines5,539 bytes
loom-builder-solsource

Purpose

import type { DispatchSpec } from "./types.js"; export const PURPOSE_HEADER = "## PURPOSE (INVARIANT — restated verbati…

TS12 lines418 bytes
loom-builder-soltest

Import Lesson.Test

/** * Tests for import-lesson.ts — the bridge from pi-cybernetic enforcement * artifacts to loom-builder's gate govern…

TS343 lines11,737 bytes
loom-builder-soltest

Gate Analyzer.Test

import { describe, expect, test, mock, beforeEach } from "bun:test"; import type { DispatchSpec, ValidationCmd, GateAnal…

TS546 lines19,035 bytes
loom-builder-soltest

Model Router.Test

import { describe, expect, test } from "bun:test"; import { PreFlightError } from "./preflight.js"; import { routeModelF…

TS44 lines1,653 bytes
loom-builder-soltest

Exit Matrix.Test

import { describe, test, expect } from "bun:test"; import { exitToVerdict, isRetryable, canBeDone, retryBackoffMs } from…

TS154 lines5,568 bytes
loom-builder-soltest

Outcome.Test

import { describe, expect, test } from "bun:test"; import { normalizeMaxReformulations, settleStatusAfterValidation, val…

TS35 lines1,452 bytes
loom-builder-soltest

Artifact Contract.Test

/** * Artifact Contract Tests for run.ts dispatch paths. * * Proves that run.ts enforces the Dispatch Artifact Contra…

TS200 lines7,726 bytes
loom-builder-solsource

Trace

import { appendFileSync, mkdirSync } from "node:fs"; import { dirname } from "node:path"; import type { TraceEvent } fro…

TS20 lines806 bytes
loom-builder-soltest

Gates.Test

import { describe, expect, test } from "bun:test"; import { BudgetGovernor, LoopDetector, actionHash, canonicalJ…

TS175 lines6,688 bytes