All Files

Page 95 of 102 · 3,056 total files

loom-sprint-scaffoldsource

Compactor

/** * H4.5 — Compactor: summarize raw working context into semantic MemoryRecords. * * compactStage(goal_id, stage_id…

TS208 lines6,662 bytes
loom-sprint-scaffoldtest

Compactor.Test

/** * Compactor tests (H4.5). * * Proves: * - Compactor output records all validate against memory-record.schema.j…

TS178 lines6,156 bytes
loom-sprint-scaffoldsource

Conf Monitor

/** * H3.5 — Confidence Monitor: every assistant turn must include conf ∈ [0,1] * (schema-enforced; extract from a tra…

TS108 lines3,011 bytes
loom-sprint-scaffoldtest

Conf Monitor.Test

/** * Tests for conf-monitor (H3.5). * * Proves: * - extractConf finds trailing JSON line `{"conf": 0.8}` in assista…

TS159 lines5,452 bytes
loom-sprint-scaffoldsource

Context Assembler

/** * H4.1 — Context Assembler. * * assembleContext({scope, goal_id, query, token_budget}): * 1. Query SemanticIndex…

TS229 lines8,047 bytes
loom-sprint-scaffoldtest

Context Assembler.Test

/** * ContextAssembler tests (H4.1). * * Proves: * - Budget NEVER exceeded: table-driven over budgets {0, tiny, ex…

TS245 lines8,542 bytes
loom-sprint-scaffoldsource

Contracts

/** * TypeScript mirrors of the 5 LOOM contracts (src/contracts/*.schema.json). * The JSON Schemas are the source of t…

TS241 lines6,845 bytes
loom-sprint-scaffoldtest

Contracts.Test

import { describe, expect, test } from "bun:test"; import { parseContract, checkContract, isContractName } from "../src/…

TS81 lines3,573 bytes
loom-sprint-scaffoldtest

Data Pipeline

/** * Golden goal: data_pipeline — destructive step requires approval token (mint → verify path). * * Stages: * 1.…

TS138 lines4,961 bytes
loom-sprint-scaffoldsource

Dataset Emitter

/** * H5.6 — Dataset Emitter. * * Exports (failure_pattern, root_cause_signature, successful_intervention) * tuples …

TS185 lines6,010 bytes
loom-sprint-scaffoldtest

Dataset Emitter.Test

/** * Tests for H5.6 — Dataset Emitter. * * Proves: * - extractDatasetTuples extracts (failure_pattern, root_cause…

TS245 lines8,772 bytes
loom-sprint-scaffoldsource

Decomposer

/** * H1.3 — Decompose a goal spec into a sequence of StageSpec[] via a single * model call. Each StageSpec is validat…

TS230 lines8,248 bytes
loom-sprint-scaffoldtest

Decomposer.Test

/** * Tests for decomposer (H1.3). * * Proves: * - rejects non-machine-evaluable done_criteria with the specific vio…

TS182 lines6,299 bytes
loom-sprint-scaffoldtest

Dispatch Envelope

{ "dispatch_id": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", "stage_id": "stg_a1b2c3d4e5f6",…

{}17 lines895 bytes
loom-sprint-scaffoldtest

Dispatch Envelope.Bad Dispatch Id

{ "dispatch_id": "not-a-sha256", "stage_id": "stg_a1b2c3d4e5f6", "goal_id": "goal_a1b2c3d4e5f6", "attempt": 1, …

{}12 lines336 bytes
loom-sprint-scaffoldtest

Dispatch Envelope.Bad Reversibility

{ "dispatch_id": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", "stage_id": "stg_a1b2c3d4e5f6",…

{}12 lines434 bytes
loom-sprint-scaffoldconfig

Dispatch Envelope.Schema

{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://leverageai.network/schemas/loom/dispatch-env…

{}56 lines2,207 bytes
loom-sprint-scaffoldsource

Dlq Escalator

/** * H2.4 — DLQ Escalator. * * Converts a dead letter into a Loop 1 escalation: * - builds typed escalation payload…

TS94 lines3,061 bytes
loom-sprint-scaffoldtest

Dlq Escalator.Test

/** * Tests for DlqEscalator (H2.4). * * Proves: * - DLQ letter → escalation POST with correct payload (goal_id, sta…

TS151 lines5,483 bytes
loom-sprint-scaffoldsource

Do

import { drizzle } from "drizzle-orm/d1"; import { goals } from "../db/schema"; import { parseContract } from "../lib/va…

TS435 lines16,278 bytes
loom-sprint-scaffoldsource

Drift Sentinel

/** * H1.6 — Drift Sentinel: embed last N stage summaries, compare cosine distance * against the original_spec embeddi…

TS137 lines4,012 bytes
loom-sprint-scaffoldtest

Drift Sentinel.Test

/** * Tests for DriftSentinel (H1.6). * * Proves: * - single spike does NOT raise sustained drift * - sustained div…

TS146 lines4,522 bytes
loom-sprint-scaffoldsource

Drizzle.Config

import type { Config } from "drizzle-kit"; /** * Drizzle is the typed query layer over D1 (src/db/schema.ts). * Migra…

TS16 lines550 bytes
loom-sprint-scaffoldsource

Entropy Monitors

/** * H5.4 — Entropy Monitors. * * Queries entropy H(q) (dispatch outcome entropy) and H(s) (source/variety_class * …

TS177 lines5,757 bytes
loom-sprint-scaffoldtest

Entropy Monitors.Test

/** * Tests for H5.4 — Entropy Monitors. * * Proves: * - Shannon entropy computed correctly with natural log (hand…

TS191 lines6,905 bytes
loom-sprint-scaffoldsource

Env

import type { DispatchEnvelope } from "./contracts"; /** Worker bindings — must match wrangler.jsonc exactly. */ export…

TS13 lines339 bytes
loom-sprint-scaffoldsource

Envelope Compiler

/** * H2.2 + H2.3 — Envelope Compiler. * * compile(stage, mode, opts): DispatchEnvelope * - Tool allowlist: only the…

TS130 lines4,998 bytes
loom-sprint-scaffoldtest

Envelope Compiler.Test

/** * Tests for EnvelopeCompiler (H2.2 + H2.3). * * Proves: * - compiled envelope validates against dispatch-envelop…

TS262 lines10,508 bytes
loom-sprint-scaffoldsource

Errors

/** Typed error hierarchy — never throw bare Error, never swallow. */ export abstract class LoomError extends Error { …

TS67 lines2,492 bytes
loom-sprint-scaffoldsource

Escalation Ledger

/** * H1.4 — Escalation ledger for per-stage fail_streak persistence and * escalation records. Append-only records are…

TS115 lines3,562 bytes