#tests
64 files tagged tests.
Retry.Test
import { describe, expect, test } from "bun:test"; import { withRetry } from "../src/lib/retry"; import { RetryExhausted…
Tsconfig
{ "extends": "../tsconfig.json", "compilerOptions": { "types": ["bun-types", "@cloudflare/workers-types"], "…
Ids.Test
import { describe, expect, test } from "bun:test"; import { actionHash, canonicalJSON, dispatchId, newEventId, newGoalId…
Contracts.Test
import { describe, expect, test } from "bun:test"; import { parseContract, checkContract, isContractName } from "../src/…
Budget Governor.Test
/** * Tests for budget-governor (H3.6). * * Proves: * - all 3 hard cap types (calls, tokens, wallclock) are enforced…
Reinjector.Test
/** * Tests for reinjector (H3.4). * * Proves: * - normalizeObservation truncates content exceeding obs_cap_tokens …
Model Client.Test
/** * Tests for model-client (H3.0). * * Proves: * - createAnthropicModelCaller returns a callable ModelCaller * - …
Reversibility Gate.Test
/** * Tests for reversibility-gate (H3.3). * * Proves: * - allowlist lookup accepts allowed tools and denies unknown…
Conf Monitor.Test
/** * Tests for conf-monitor (H3.5). * * Proves: * - extractConf finds trailing JSON line `{"conf": 0.8}` in assista…
Harness.Test
/** * Integration tests for harness (runStage). * * Proves every StageTermination kind is reachable: * DONE | GATE_R…
Preflight.Test
/** * Tests for preflight (H3.7). * * Proves: * - clean files (no markers) pass * - every marker (TODO, FIXME, <<<<…
Ack Gate.Test
/** * Tests for ack-gate (H3.1). * * Proves: * - wrapResult produces deterministic hex hash from tool result * - ch…
Loop Detector.Test
/** * Tests for loop-detector (H3.2). * * Proves: * - the identical action halts at exactly the 3rd occurrence (not …
Dataset Emitter.Test
/** * Tests for H5.6 — Dataset Emitter. * * Proves: * - extractDatasetTuples extracts (failure_pattern, root_cause…
Fixtures
/** * Synthetic trace corpus for Loop 5 synthesis tests. * ~50 enriched trace events covering failures, successes, rep…
Failure Clusterer.Test
/** * Tests for H5.1 — Failure Clusterer. * * Proves: * - normalizeErrorSignature strips ids, paths, numbers deter…
Skill Proposer.Test
/** * Tests for H5.2 — Skill Proposer. * * Proves: * - extractSuccessfulSequences groups tool calls by dispatch *…
Registry Updater.Test
/** * Tests for H5.3 — Registry Updater. * * Proves: * - computeModeStats groups correctly by (model, harnessProfi…
Report.Test
/** * Integration test for the full synthesis report pipeline. * * Proves: * - Synthetic trace corpus → determinis…
Entropy Monitors.Test
/** * Tests for H5.4 — Entropy Monitors. * * Proves: * - Shannon entropy computed correctly with natural log (hand…
Isolation.Test
/** * Isolation test for src/synthesis/. * * Enforces at the grep level: * 1. No import from src/orchestrator/, sr…
Revision Governor.Test
/** * Tests for H5.5 — Revision Governor. * * Proves: * - Caps proposals at maxSkillProposals (default 5) * - N…
Mode Registry.Test
/** * Tests for ModeRegistry (H2.1). * * Proves: * - unknown variety_class → highest-capability mode + variety_defic…
Envelope Compiler.Test
/** * Tests for EnvelopeCompiler (H2.2 + H2.3). * * Proves: * - compiled envelope validates against dispatch-envelop…
Probe Planner.Test
/** * Tests for ProbePlanner (H2.5). * * Proves: * - api_integration + no behavior model → probe prepended (recovera…
Dlq Escalator.Test
/** * Tests for DlqEscalator (H2.4). * * Proves: * - DLQ letter → escalation POST with correct payload (goal_id, sta…
Context Assembler.Test
/** * ContextAssembler tests (H4.1). * * Proves: * - Budget NEVER exceeded: table-driven over budgets {0, tiny, ex…
Compactor.Test
/** * Compactor tests (H4.5). * * Proves: * - Compactor output records all validate against memory-record.schema.j…
Scope Wall.Test
/** * ScopeWall tests (H4.3). * * Proves: * - Same-scope read works (constructor requires scope) * - Cross-scop…
Helpers
/** * Test helpers for memory module tests. * * Provides: * - FakeD1: in-memory SQLite (bun:sqlite) implementing D…
Pointer Hierarchy.Test
/** * PointerHierarchy tests (H4.4). * * Proves: * - memory_expand round-trips: put full text in fake BlobStore → …
Promotion Engine.Test
/** * PromotionEngine tests (H4.2). * * Proves: * - Promotion fires at EXACTLY m_promote distinct traces (not m-1;…
Semantic Index.Test
/** * SemanticIndex contract test suite. * * Shared tests run against BOTH Fts5Index (with fake D1/SQLite) and * Vec…
No Silent Failure.Test
/** * No-Silent-Failure Invariant Walk. * * For EVERY terminated (non-DONE) stage across all golden runs + chaos runs…
Chaos.Test
/** * Chaos Tests — fault injection, one scenario per test. * * Five scenarios: * 1. dropped-tool-result — ack gat…
Golden.Test
/** * E2E Golden Goal Tests. * * Runs all three golden goals end-to-end through all LOOM loops. * Each asserts: * …
Chaos Scenarios
/** * Shared chaos scenario runners used by both chaos.test.ts and * no-silent-failure.test.ts. Lives outside *.test.t…
Golden Runner
/** * E2E Golden Runner — in-process composition root for LOOM integration tests. * * Wires Loop 1 (CheckpointEngine,…
Index
/** Barrel for golden goal scripts. */ export { script as codegenScript, assert as assertCodegen } from "./codegen"; ex…
Research
/** * Golden goal: research — mid-goal failing stage drives fail_streak to m=3 → REFORMULATE → recovers → completes. *…
Codegen
/** * Golden goal: codegen — multi-stage code-generation goal. * * All stages pass done-criteria; the goal completes …
Data Pipeline
/** * Golden goal: data_pipeline — destructive step requires approval token (mint → verify path). * * Stages: * 1.…
Fakes
/** * Shared fake implementations for LOOM E2E tests. * * Consolidates patterns from: * tests/orchestrator/checkpo…
Dispatch Envelope
{ "dispatch_id": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", "stage_id": "stg_a1b2c3d4e5f6",…
Goal State
{ "goal_id": "goal_a1b2c3d4e5f6", "original_spec": "Rebuild oregonsmbdirectory.com category pages with JSON-LD on As…
Execution Trace
{ "event_id": "evt_a1b2c3d4e5f6", "dispatch_id": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8",…
Memory Record
{ "record_id": "mem_a1b2c3d4e5f6", "scope": "execution", "level": "semantic", "topic": "astro-jsonld-phantom-bug…
Stage Spec
{ "stage_id": "stg_a1b2c3d4e5f6", "goal_id": "goal_a1b2c3d4e5f6", "objective": "Generate JSON-LD LocalBusiness sch…
Dispatch Envelope.Bad Reversibility
{ "dispatch_id": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8", "stage_id": "stg_a1b2c3d4e5f6",…
Memory Record.Bad Scope
{ "record_id": "mem_a1b2c3d4e5f6", "scope": "global", "level": "semantic", "topic": "t", "summary": "s", "cr…
Goal State.Bad Status
{ "goal_id": "goal_a1b2c3d4e5f6", "original_spec": "x", "spec_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b…
Stage Spec.Bad Predicate Kind
{ "stage_id": "stg_a1b2c3d4e5f6", "goal_id": "goal_a1b2c3d4e5f6", "objective": "Done criterion uses a non-machine-…
Goal State.Bad Id
{ "goal_id": "goal_TOOSHORT", "original_spec": "x", "spec_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822c…
Dispatch Envelope.Bad Dispatch Id
{ "dispatch_id": "not-a-sha256", "stage_id": "stg_a1b2c3d4e5f6", "goal_id": "goal_a1b2c3d4e5f6", "attempt": 1, …
Memory Record.Extra Prop
{ "record_id": "mem_a1b2c3d4e5f6", "scope": "execution", "level": "semantic", "topic": "t", "summary": "s", …
Stage Spec.Empty Done
{ "stage_id": "stg_a1b2c3d4e5f6", "goal_id": "goal_a1b2c3d4e5f6", "objective": "Stage with no verifiable completio…
Execution Trace.Bad Kind
{ "event_id": "evt_a1b2c3d4e5f6", "dispatch_id": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8",…
Execution Trace.Bad Conf
{ "event_id": "evt_a1b2c3d4e5f6", "dispatch_id": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8",…
Escalation Ledger.Test
/** * Tests for EscalationLedger (H1.4). * * Proves: * - fail_streak increment/reset * - escalation records append-…
Drift Sentinel.Test
/** * Tests for DriftSentinel (H1.6). * * Proves: * - single spike does NOT raise sustained drift * - sustained div…
Predicates.Test
/** * Tests for predicate evaluators (H1.1). * All six kinds: pass + fail cases each. * Injects a scripted PredicateR…
Checkpoint.Test
/** * Tests for CheckpointEngine (H1.1 + H1.4). * * Proves: * - scripted fake stage results drive fail_streak to EXA…
Decomposer.Test
/** * Tests for decomposer (H1.3). * * Proves: * - rejects non-machine-evaluable done_criteria with the specific vio…
Token Mint.Test
/** * Tests for TokenMint (H1.5). * * Proves: * - mint → Loop 3 verify passes (round-trip) * - expired tokens fail …