Skip to content

@memhtml/eval

@memhtml/eval: the fixture corpus generator, and the refusable retrieval discrimination gate. The corpus is never committed; each run regenerates it from a seed.

The gate asks one question: can the retrieval stack rank a memory above its own high-similarity WRONG twin? controls turns a true claim into a plausible impostor along three divergence families (negation, numeric, variant), validates each control against its own family’s predicate from @memhtml/domain, and discards a control that failed to diverge. corpus is a pure function of (seed, now): it yields the same memory specs and probes on any machine, with every timestamp anchored as an offset behind the run so that salience decay cannot move the ranks from one calendar day to the next. fixture is the one module that writes, rendering a spec into a real git repository under a temp directory. harness builds the stack the gate measures (that fixture, a real database with the shipped migrations, the real indexer and the real four-arm retrieval) and substitutes only the embedder: a deterministic one whose cosine relations are a pure function of the text, so the numbers reproduce without credentials. discriminate runs the probes and reports two numbers, of which the strict one is the gate: mrr against a floor of 0.85, and a per-probe inversion count where one inversion fails the run regardless of MRR. run picks the mode and shapes the outcome so that a skipped gate never looks like a passing one: fake mode runs everywhere, and live mode without credentials reports skipped: true and passed: false.

This package sits above @memhtml/contracts, @memhtml/domain, @memhtml/html, @memhtml/index, @memhtml/llm and @memhtml/store, and apps/cli depends on it: memhtml eval discriminate is runDiscrimination.

The package publishes one import path, @memhtml/eval, which re-exports the six modules below, so the reference on this page is the whole exported surface. gen-fixture.ts is the body of pnpm gen:fixture and is not exported.

Module What it holds
controls.ts DIVERGENCE_FAMILIES, the three flips (negationFlip, numericFlip, variantFlip), familyPredicate and deriveControl.
corpus.ts MemorySpec, Probe, CorpusSpec, the defaults (DEFAULT_SEED, DEFAULT_CORPUS_SIZE, DEFAULT_PROBE_COUNT), quantizeNow, articleFor, queryFor and buildCorpus.
discriminate.ts MRR_FLOOR, PROBE_LIMIT, runProbes, summarize, discriminate, runFloor, describeFailure and the report shapes.
fixture.ts FixtureCorpus, FixtureOptions, memoryFileFor, writeCorpus and makeFixtureCorpus.
harness.ts EvalStack, StackOptions, the embedders (fakeEmbedder, failingEmbedder, liveEmbedder, fakeVector, FAKE_DIM), buildStack and withStack.
run.ts EvalOptions, EvalOutcome, BEDROCK_TOKEN_VAR, hasBedrockCredentials, runDiscrimination, DiscriminationFailed and discriminationGate.

A failed gate, as a tagged error.

Tagged so it is a failure like every other in the system rather than a bare value. The CLI’s codeFor switches on _tag, and ERR_DISCRIMINATION_FAILED, the error code design §8 named for exactly this refusal, would otherwise have no producer at all and degrade to ERR_UNKNOWN.

The whole outcome rides along, because a refusal an operator cannot reproduce is a refusal they will override. seed regenerates the corpus that failed, and inversions says which probes.

new DiscriminationFailed(outcome): DiscriminationFailed;

EvalOutcome

DiscriminationFailed

readonly _tag: "DiscriminationFailed" = "DiscriminationFailed";
readonly outcome: EvalOutcome;
get reason(): string;

The one-line summary, used as the envelope’s human message.

string

The text of a memory as the flips see it, meaning the claim then each body paragraph.

readonly body: readonly string[];
readonly claim: string;

The whole fixture: the memories to write, their access history, and the probes.

readonly access: readonly AccessSpec[];

state.access rows the harness seeds before running the probes.

readonly memories: readonly MemorySpec[];
readonly now: number;

The quantized run instant every stamp is anchored behind, UTC millis. See quantizeNow.

readonly probes: readonly Probe[];
readonly seed: number;

A derived control, holding the flipped text plus the family that produced it.

readonly body: readonly string[];

ClaimText.body

readonly claim: string;

ClaimText.claim

readonly family: DivergenceFamily;
readonly note: string;

What changed, for the probe’s own record.


The whole run’s outcome. This is the eval.discrimination envelope payload.

readonly corpusMrr: number;

Mean reciprocal rank over the WHOLE hit list, unitless in [0, 1], four decimals.

Reported rather than gated, because corpus size dominates it more than ranking quality does. DEFAULT_ARM_LIMIT is 40, which is 13% of a 300-file fixture and under 1% of a real corpus, so the two query-blind arms cover a far larger share of a fixture than of production. The value is seed- and parameter-dependent — it moves with the corpus size, the probe count, and the seed — but it rises with corpus size on this generator while the inversion count stays flat, which is exactly why a gate on this number would be a gate on how big the fixture is.

readonly degradedProbes: number;

Probes ranked by a degraded (vector-arm-free) search.

readonly discriminated: number;

Probes whose target strictly outranked all of its controls.

readonly inversions: readonly ProbeResult[];

Probes with at least one inversion. The gate fails when this is non-zero.

readonly mode: EvalMode;
readonly mrr: number;

Mean reciprocal rank over {target} ∪ controls, unitless in [0, 1], four decimals.

This is the gated number, and its coordinate space is the discrimination set, not the corpus. Design §5 states the floor in the same clause as rank(target) < min(rank(control)), so the space the sentence is about is the target against its own impostors. 1.0 means every target beat every control outright. See corpusMrr for the other reading, which is reported and not gated.

readonly mrrFloor: number;

The floor mrr was measured against.

readonly passed: boolean;

True when there are zero inversions AND mrr >= mrrFloor.

readonly probes: number;
readonly results: readonly ProbeResult[];

Both embed ports plus a call counter.

  • EmbedPort
  • QueryEmbedPort
readonly calls: () => number;

number

readonly embed: (texts) => Effect<readonly Float32Array<ArrayBufferLike>[], ModelUnavailable>;

readonly string[]

Effect<readonly Float32Array<ArrayBufferLike>[], ModelUnavailable>

EmbedPort.embed

readonly embedQuery: (text) => Effect<Float32Array<ArrayBufferLike>, ModelUnavailable>;

string

Effect<Float32Array<ArrayBufferLike>, ModelUnavailable>

QueryEmbedPort.embedQuery


What runDiscrimination takes.

readonly env?: Readonly<Record<string, string | undefined>>;

Injected for tests, so the credential branch is drivable without touching the environment.

readonly mode?: EvalMode;

fake by default, the mode that works in CI and whose numbers are reproducible.

readonly mrrFloor?: number;
readonly now?: number;

The run instant to anchor the corpus’s stamps behind, UTC millis. The clock when absent.

readonly probes?: number;
readonly seed?: number;
readonly size?: number;

What memhtml eval discriminate emits, the report plus which mode was asked for.

readonly corpusMrr: number;

Mean reciprocal rank over the WHOLE hit list, unitless in [0, 1], four decimals.

Reported rather than gated, because corpus size dominates it more than ranking quality does. DEFAULT_ARM_LIMIT is 40, which is 13% of a 300-file fixture and under 1% of a real corpus, so the two query-blind arms cover a far larger share of a fixture than of production. The value is seed- and parameter-dependent — it moves with the corpus size, the probe count, and the seed — but it rises with corpus size on this generator while the inversion count stays flat, which is exactly why a gate on this number would be a gate on how big the fixture is.

DiscriminationReport.corpusMrr

readonly corpusSize: number;
readonly degradedProbes: number;

Probes ranked by a degraded (vector-arm-free) search.

DiscriminationReport.degradedProbes

readonly discriminated: number;

Probes whose target strictly outranked all of its controls.

DiscriminationReport.discriminated

readonly inversions: readonly ProbeResult[];

Probes with at least one inversion. The gate fails when this is non-zero.

DiscriminationReport.inversions

readonly mode: EvalMode;

DiscriminationReport.mode

readonly mrr: number;

Mean reciprocal rank over {target} ∪ controls, unitless in [0, 1], four decimals.

This is the gated number, and its coordinate space is the discrimination set, not the corpus. Design §5 states the floor in the same clause as rank(target) < min(rank(control)), so the space the sentence is about is the target against its own impostors. 1.0 means every target beat every control outright. See corpusMrr for the other reading, which is reported and not gated.

DiscriminationReport.mrr

readonly mrrFloor: number;

The floor mrr was measured against.

DiscriminationReport.mrrFloor

readonly now: number;

The quantized run instant the corpus’s stamps were anchored behind, UTC millis. The other half of reproducing a failing run, since the corpus is a function of (seed, now). 0 on a skipped run, where no corpus was generated.

readonly passed: boolean;

True when there are zero inversions AND mrr >= mrrFloor.

DiscriminationReport.passed

readonly probes: number;

DiscriminationReport.probes

readonly requested: EvalMode;

The mode the caller asked for, which differs from mode only on a refused live run.

readonly results: readonly ProbeResult[];

DiscriminationReport.results

readonly seed: number;

The seed the corpus was generated at, so a failing run is reproducible.

readonly skipped: boolean;

True when live mode was requested with no credentials present. A skipped run is passed: false and carries zero probes, so it is a refusal rather than a result.

readonly skipReason?: string;

Why it was skipped, absent otherwise.


A built stack, holding the fixture, the database, and retrieval over both.

readonly db: DatabaseShape;
readonly embedCalls: () => number;

number

readonly fixture: FixtureCorpus;
readonly indexed: number;

How many files the indexer projected, so a caller can assert the corpus really landed.

readonly retrieval: RetrievalShape;

A generated fixture repo, with the root, the git service over it, and the spec behind it.

readonly cleanup: () => Promise<void>;

Promise<void>

readonly git: GitShape;
readonly root: string;
readonly spec: CorpusSpec;
readonly written: number;

How many files were written, generated artifacts excluded.


What makeFixtureCorpus takes. Every field has a default, so a caller can pass nothing.

readonly now?: number;

The run instant the corpus’s stamps are anchored behind, UTC millis. Effect’s Clock when absent, which is the one place the fixture pipeline consults time at all — buildCorpus requires it, so a test pinning this value pins every stamp in the tree.

readonly probes?: number;
readonly root?: string;

Where to generate. A fresh temp directory when absent.

readonly seed?: number;
readonly size?: number;

The lexical-floor scenario runs the same suite with no vector arm.

Design §5 requires two things of it: no error, and the lexical arm still beating the controls on the probes that carry lexical signal. Only the SECOND half is a subset claim, and it has to be. A numeric-family control differs from its target by one token, which the FTS arm cannot order, so demanding the full gate without vectors would be demanding the vector arm be unnecessary.

lexicallyDiscriminated is therefore the number reported and asserted, not passed.

readonly allDegraded: boolean;

True when every probe was ranked degraded, which asserts that the arm really is absent.

readonly lexicallyDiscriminated: number;

Probes the lexical floor still discriminated.

readonly probes: number;
readonly results: readonly ProbeResult[];

Every result, so a caller can see which families survive without vectors.


One memory to write, before it becomes HTML.

readonly archivedAt?: string;

Set on the archived members, which carry memhtml-status: archived and a memhtml-archived stamp.

readonly body: readonly string[];
readonly claim: string;

The sentence the memory turns on. It becomes the <mark> span and therefore files.gist.

readonly confidence: number;
readonly createdAt: string;
readonly entities: readonly string[];
readonly extras: readonly string[];

Extra article markup after the claim paragraph, the element kit this memory exercises.

readonly importance: number;
readonly links: readonly object[];
readonly memoryType: string;
readonly path: string;
readonly sessionId?: string;
readonly tags: readonly string[];
readonly title: string;
readonly updatedAt: string;
readonly validUntil?: string;

One discrimination probe: a query, the memory that answers it, and the near-twins that do not.

controlPaths are ordered by family so a failure names the axis. Each control is validated against its OWN family’s divergence predicate at generation time. See controls.ts.

readonly controlPaths: readonly string[];
readonly families: readonly DivergenceFamily[];
readonly query: string;
readonly targetPath: string;

One probe’s outcome.

readonly controlRanks: readonly object[];

Each control’s 1-based rank in the whole hit list, null when absent from the hits.

readonly corpusReciprocalRank: number;

1 / targetRank, or 0 when the target was absent. The term of corpusMrr.

readonly degraded: boolean;

True when the vector arm did not fire for this probe.

readonly discriminated: boolean;

True when the target strictly outranks EVERY control. A control the search never returned counts as outranked, since being absent is worse than being last.

readonly discriminationRank: number;

1-based rank of the target within {target} ∪ controls ALONE, the space the gate is stated in. 1 means the target beat every one of its own impostors. Never null, because the target is always a member of this set, so an absent target ranks last rather than nowhere.

readonly query: string;
readonly reciprocalRank: number;

1 / discriminationRank. The term of DiscriminationReport.mrr.

readonly targetPath: string;
readonly targetRank: number | null;

1-based rank of the target within the WHOLE returned hit list, or null when it was not returned. The scope is every active memory in the corpus. Compare against discriminationRank, which measures the same position in a different space.


What buildStack takes beyond the fixture options.

readonly embedder?: EvalEmbedder;

The embedder to measure through. fakeEmbedder() when absent.

readonly now?: number;

The run instant the corpus’s stamps are anchored behind, UTC millis. Effect’s Clock when absent, which is the one place the fixture pipeline consults time at all — buildCorpus requires it, so a test pinning this value pins every stamp in the tree.

FixtureOptions.now

readonly probes?: number;

FixtureOptions.probes

readonly root?: string;

Where to generate. A fresh temp directory when absent.

FixtureOptions.root

readonly seed?: number;

FixtureOptions.seed

readonly size?: number;

FixtureOptions.size


What a variant-family derivation needs beyond the target’s own text.

readonly anchor: string;

The token the qualifier is inserted after, a product or host name in the claim.

readonly qualifier: string;

A VARIANT_QUALIFIERS member, such as pro, beta, or legacy.

type DivergenceFamily = "negation" | "numeric" | "variant";

Which divergence a control embodies. Named on the probe, so a failure says which axis broke.


type EvalMode = "live" | "fake";

Which embedder produced the numbers. Recorded on the report so a pass is never ambiguous.

const BEDROCK_TOKEN_VAR: "AWS_BEARER_TOKEN_BEDROCK" = "AWS_BEARER_TOKEN_BEDROCK";

The variable whose presence decides whether live mode can run.


const DEFAULT_CORPUS_SIZE: 200 = 200;

How many base memories a default corpus carries, before controls and the archive tier.


const DEFAULT_PROBE_COUNT: 36 = 36;

How many probes a default corpus carries. Design §5 requires at least 30.


const DEFAULT_SEED: 20260802 = 20_260_802;

The default seed. Named so a caller changing it is making a visible choice.


const DIVERGENCE_FAMILIES: ReadonlyArray<DivergenceFamily>;

const FAKE_DIM: 1024 = EMBED_DIM;

The vector width the fake produces. It is the real one, so a width check cannot pass by luck.


const MRR_FLOOR: 0.85 = 0.85;

The MRR floor, from design §5. A gate below this admits a target that loses to one of its own negation-flipped twins on one probe in seven. An agent cannot trust that retrieval layer to answer with the right fact.


const PROBE_LIMIT: 40 = 40;

How many hits each probe requests.

Wide enough that a control’s rank is observable rather than truncated into null. A window of 10 would report an inversion and a merely-narrow miss identically, and the two need different fixes. The gate itself compares ranks, so widening the window can only make it stricter.

function articleFor(spec): string;

The article markup for a spec: the claim paragraph, the first body paragraph joined onto it, then the remaining paragraphs and the element kit.

Written here rather than left to renderTemplate’s claim/body path because the kits carry real markup, and renderTemplate escapes its body strings as text. That is correct for a tool parameter and wrong for a <dl>.

MemorySpec

string


function buildCorpus(options): CorpusSpec;

The whole fixture specification.

The order is fixed as people, base, archive tier, then controls, so the generated tree is written in a stable order and two runs at one (seed, now) produce byte-identical files. now is REQUIRED rather than defaulted from a clock, because this module’s contract is purity: every caller threads its own run instant (the harness reads Effect’s Clock once), it is quantized to the UTC day, and it is recorded on the spec, so a failing run is reproducible by passing the reported now back in.

number

The run instant to anchor stamps behind, UTC millis.

number

number

number

CorpusSpec


function buildStack(options?): Effect<EvalStack, never, Scope>;

Build the whole stack inside a scope: generate the corpus, index it, and return retrieval over it.

Effect.acquireRelease owns the database, so the caller’s Effect.scoped closes the connection, and the fixture’s own cleanup removes the temp tree. Both matter in a CLI, because a command that leaked a database handle would keep a WAL file alive under /tmp for the life of the process.

StackOptions = {}

Effect<EvalStack, never, Scope>


function deriveControl(
target,
family,
options?
): DerivedControl | undefined;

Derive one control from a target, or refuse.

Refusal, returned as undefined, is the behavior callers depend on. It has two causes, and each one would otherwise produce a control that LOOKS adversarial and is not:

  1. The family does not apply (no number to flip).
  2. The pair fails the family’s own predicate. For negation that means the target body already carried a marker, so the flip is invisible to the guard that defines the family.

A caller that ignores the refusal and ships the pair anyway gets a probe whose control is a paraphrase, and a gate built on paraphrases passes no matter how badly retrieval discriminates.

ClaimText

DivergenceFamily

VariantOptions

DerivedControl | undefined


function describeFailure(report): string;

A one-line summary of a failure, for stderr and for a merge’s refusal log.

Names the first inversion rather than every one, because an operator needs a probe to reproduce and a thirty-line dump of a failing gate is a thirty-line dump nobody reads. The full list is on the report.

DiscriminationReport

string


function discriminate(
retrieval,
probes,
options
): Effect<DiscriminationReport, StorageFailure>;

Run the suite and summarize it in one call.

RetrievalShape

readonly Probe[]

number

EvalMode

number

Effect<DiscriminationReport, StorageFailure>


function discriminationGate(options?): Effect<EvalOutcome, DiscriminationFailed, never>;

The gate, for a merge that must refuse on a regression.

A failing gate FAILS this effect, which is what a merge reads to refuse. It wraps the gate in Effect.result and turns a failure into refusal: "gate-failed" with main never moving. The shape matters, because a version returning a boolean would let a caller forget to check it, and a refusable gate must not be optional at its call site.

EvalOptions = {}

Effect<EvalOutcome, DiscriminationFailed, never>


function failingEmbedder(): EvalEmbedder;

An embedder that always fails, for the lexical-floor scenario.

The failure travels through the ERROR channel as a typed ModelUnavailable rather than a throw. The floor only holds if retrieval can catch it, and a defect would kill the fiber instead of narrowing the search.

EvalEmbedder


function fakeEmbedder(): EvalEmbedder;

EvalEmbedder


function fakeVector(text): Float32Array;

The deterministic embedder, built as a hash-seeded bag of words, L2-normalized.

The same construction @memhtml/index and tests-integration use in their own harnesses. Two texts sharing vocabulary have a genuinely high cosine and two disjoint texts a low one, which makes a negation-flipped control a real adversary here instead of a random vector the arm trivially separates. A random fake would make the gate meaningless in the easy direction and a constant fake in the hard one.

string

Float32Array


function familyPredicate(family): (textA, textB) => boolean;

The predicate a family’s control must satisfy against its target.

DivergenceFamily

(textA, textB) => boolean


function hasBedrockCredentials(env?): boolean;

True when a Bedrock bearer token is present in the environment.

Readonly<Record<string, string | undefined>> = process.env

boolean


function liveEmbedder(): Effect<EvalEmbedder>;

The real Bedrock embedder, for live mode. Built only when a caller asks for it.

Effect<EvalEmbedder>


function makeFixtureCorpus(options?): Effect<FixtureCorpus>;

A scaffolded memory repo carrying a generated corpus.

initRepo is the real one, so the fixture carries the real .gitignore, the real .gitattributes, and the real merge.ours.driver config. That config is per-clone, and the merge=ours attribute does nothing without it.

FixtureOptions = {}

Effect<FixtureCorpus>


function memoryFileFor(spec): string;

One spec as a memory file’s bytes.

Hand-assembled rather than routed through @memhtml/html’s renderTemplate, because of the element kits. renderTemplate escapes each body string as TEXT, which is right for an agent’s tool parameter and wrong for a <dl> the fixture means as markup. The head is written in META_ORDER so a generated file is byte-identical to what the serializer would emit for the same metadata. The rest of the system then treats the fixture as an ordinary document.

MemorySpec

string


function negationFlip(claim): string;

The affirmative claim as its negation.

Total. When no verb anchor is present the whole sentence is wrapped rather than left unchanged. A transform that returned its input would produce a “control” identical to its target, and an identical control is a duplicate the content-hash index refuses at index time, one layer too late to explain itself.

string

string


function numericFlip(claim): string | undefined;

The claim with its first numeric token replaced by a different one.

undefined when the claim carries no number, because the family does not apply. Inventing a number to flip would produce a control that differs from its target by an ADDED fact rather than by a contradicted one. The probe builder reads the undefined and skips the family instead of emitting a weaker control under the same name.

The replacement is value + 10 for a small integer and value * 2 otherwise, so the wrong number stays in the plausible range for whatever the sentence counts. A retry budget of 13 is a believable misremembering of 3, and 3000 is not.

string

string | undefined


function quantizeNow(nowMillis): number;

Quantize a run instant to its UTC day.

The anchor is the day rather than the millisecond so that every run on one calendar date builds a byte-identical corpus at a given seed. The gate’s determinism checks compare two full runs, and a millisecond-precision anchor would make “same seed, same numbers” true only for runs started in the same millisecond.

Math.floor rather than a % remainder, because JS % keeps the DIVIDEND’s sign: at nowMillis = -1, nowMillis % DAY_MILLIS is -1 and subtracting it lands on 0 — an anchor AHEAD of the instant asked for, which is the one thing the anchoring exists to rule out.

A non-finite instant is refused here rather than carried: NaN passes every arithmetic step and surfaces hundreds of lines later as RangeError: Invalid time value out of a stamp formatter, which names neither the input nor the caller that supplied it.

number

number


function queryFor(spec, limit?): string;

A probe query holds the target’s own content words, in order, capped.

Content words rather than the claim verbatim, and the query design decides what the probe can measure. A NUMERIC-family control differs from its target in exactly one numeric token, so a query that dropped the number would have identical overlap with both and the vector arm could not order them at all. The probe would measure a tie-break instead. Keeping the digits is what makes the numeric family a probe rather than a coin toss. The same reasoning keeps a variant qualifier’s ANCHOR in the query while the qualifier itself, which only the control carries, stays out.

Stopwords go so that not cannot hide behind them. A query carrying the target’s function words would raise the negation control’s lexical overlap for a reason unrelated to the fact either states.

MemorySpec

number = 12

string


function runDiscrimination(options?): Effect<EvalOutcome, never, never>;

Run the gate.

Never fails, because the report IS the answer and a caller maps passed to an exit code. An eval whose error channel could fire would hand a caller a run that both happened and errored, with no way to say whether the corpus, the index, or the ranking was at fault.

EvalOptions = {}

Effect<EvalOutcome, never, never>


function runFloor(
retrieval,
probes,
options?
): Effect<FloorReport, StorageFailure>;

RetrievalShape

readonly Probe[]

number

Effect<FloorReport, StorageFailure>


function runProbes(
retrieval,
probes,
options?
): Effect<readonly ProbeResult[], StorageFailure>;

Run every probe through the real retrieval service.

includeArchived stays false. The corpus carries an archived tier and an archived memory must not be a candidate, so a probe that ranked one would be reporting a scope leak rather than a ranking failure. The controls are ACTIVE files, which is what makes them adversaries.

RetrievalShape

readonly Probe[]

number

Effect<readonly ProbeResult[], StorageFailure>


function summarize(
mode,
results,
mrrFloor?
): DiscriminationReport;

Aggregate probe results into the report the gate reads.

An empty suite is a FAILURE, not a vacuous pass. Zero probes yields mrr: 0, which is below any floor, so a corpus whose probe generation produced nothing refuses instead of reporting a green gate over no measurement. A skipped quality gate must not look like a passing one, and “no probes ran” is the purest form of skipped.

EvalMode

readonly ProbeResult[]

number = MRR_FLOOR

DiscriminationReport


function variantFlip(
claim,
anchor,
qualifier
): string;

The claim with a variant qualifier inserted after anchor.

qualifier must be a token @memhtml/domain’s VARIANT_QUALIFIERS knows, or the pair is not variant-divergent and deriveControl refuses it. Total, so an absent anchor appends a scope sentence naming the qualifier. That states a different fact about a different variant instead of a paraphrase.

string

string

string

string


function wholeText(text): string;

The whole text one memory contributes, claim first. What the veto predicates compare.

ClaimText

string


function withStack<A, E, R>(body, options?): Effect<A, E, R>;

Build the stack, run body, then tear both down.

A scoped helper rather than a fixture the caller assembles, so the temp tree is removed on the failure path too. An eval that exits 1 on an inversion must not leave a 200-file corpus under /tmp every time the gate refuses.

A

E

R

(stack) => Effect<A, E, R>

StackOptions = {}

Effect<A, E, R>


function writeCorpus(
root,
git,
spec
): Effect<number>;

Generate the corpus into root, committing it.

ONE commit for the whole corpus. A commit per memory would make the fixture’s git history the dominant cost of every eval run. The gate is about ranking, and git log over a generated corpus tells a reader nothing.

string

GitShape

CorpusSpec

Effect<number>