_archive subproject

61 files

_archiveother

.Dev.Vars

# Copy to .dev.vars for local workerd (never commit .dev.vars). # Edge: wrangler secret put ANTHROPIC_API_KEY && wrangle…

·5 lines226 bytes
_archiveother

.Gitignore

node_modules/ dist/ .wrangler/ .dev.vars *.log

·6 lines47 bytes
_archivesource

0001 Init

-- LOOM 0001_init — 7 core tables + FTS5 + append-only enforcement. -- Identical on local workerd (--local) and edge D1 …

SQL101 lines4,113 bytes
_archivesource

Ack Gate

/** * H3.1 — Observation acknowledgment gate (P1 feedback closure). * After tool results are re-injected, the NEXT ass…

TS55 lines2,076 bytes
_archivesource

Adapters

import { drizzle } from "drizzle-orm/d1"; import { memoryRecords, traceEvents } from "../db/schema"; import { withRetry …

TS118 lines4,160 bytes
_archivesource

Anthropic Client

import { withRetry } from "../lib/retry"; import { LoomError } from "../types/errors"; import type { AssistantBlock, Mod…

TS92 lines3,295 bytes
_archivesource

Budget Governor

import type { StageBudget } from "../types/contracts"; import type { Clock } from "./ports"; /** * H3.6 — Budget gover…

TS57 lines1,685 bytes
_archivesource

Conf Monitor

/** * H3.5 — Confidence EWMA monitor (P5). * Each assistant turn must carry <conf>0.NN</conf>. EWMA(alpha=0.4) below …

TS40 lines1,274 bytes
_archivesource

Contracts

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

TS214 lines5,951 bytes
_archivetest

Contracts.Test

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

TS81 lines3,573 bytes
_archivetest

Dispatch Envelope

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

{}17 lines895 bytes
_archivetest

Dispatch Envelope.Bad Dispatch Id

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

{}12 lines336 bytes
_archivetest

Dispatch Envelope.Bad Reversibility

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

{}12 lines434 bytes
_archiveconfig

Dispatch Envelope.Schema

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

{}56 lines2,207 bytes
_archivesource

Do

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

TS118 lines4,599 bytes
_archivesource

Drizzle.Config

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

TS16 lines550 bytes
_archivesource

Env

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

TS15 lines447 bytes
_archivesource

Errors

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

TS68 lines2,662 bytes
_archivetest

Execution Trace

{ "event_id": "evt_a1b2c3d4e5f6", "dispatch_id": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8",…

{}23 lines689 bytes
_archivetest

Execution Trace.Bad Conf

{ "event_id": "evt_a1b2c3d4e5f6", "dispatch_id": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8",…

{}9 lines205 bytes
_archivetest

Execution Trace.Bad Kind

{ "event_id": "evt_a1b2c3d4e5f6", "dispatch_id": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8",…

{}8 lines189 bytes
_archiveconfig

Execution Trace.Schema

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

{}137 lines2,728 bytes
_archivetest

Fakes

import type { AssistantBlock, BlobStore, Clock, HarnessDeps, MemorySink, ModelClient, ModelRequest, ModelTurn, ToolD…

TS157 lines6,003 bytes
_archivetest

Gates.Test

import { describe, expect, test } from "bun:test"; import { AckGate } from "../../src/execution/ack-gate"; import { Loop…

TS103 lines4,287 bytes
_archivetest

Goal State

{ "goal_id": "goal_a1b2c3d4e5f6", "original_spec": "Rebuild oregonsmbdirectory.com category pages with JSON-LD on As…

{}20 lines869 bytes
_archivetest

Goal State.Bad Id

{ "goal_id": "goal_TOOSHORT", "original_spec": "x", "spec_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822c…

{}11 lines425 bytes
_archivetest

Goal State.Bad Status

{ "goal_id": "goal_a1b2c3d4e5f6", "original_spec": "x", "spec_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b…

{}11 lines429 bytes
_archiveconfig

Goal State.Schema

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

{}82 lines3,193 bytes
_archivesource

Harness

import { actionHash, canonicalJSON, newEventId, newMemoryId } from "../lib/ids"; import { parseContract } from "../lib/v…

TS304 lines14,667 bytes
_archivetest

Harness.Test

import { describe, expect, test } from "bun:test"; import { runDispatch } from "../../src/execution/harness"; import { m…

TS165 lines8,465 bytes