feat(evaluation): shared acceptance corpus + candidate-agnostic cross-review harness - #6
Merged
Merged
Conversation
Corpus as data (6 JSON fixtures, expectations independent of candidate code): multi-event narrative (count/order), relative-time across America/New_York, Pacific/Auckland (NZST + NZDT) and UTC with documented conventions and machine-computed IANA instants, malformed extraction (failure never blocks capture, raw preserved), retry/double-submit on the same captureId (exactly one event, IdempotentReplay), raw fidelity (SHA-256 byte equality across validation failure and retry), and reload persistence (timeline identical across simulated cold start). Harness: narrow CandidateAdapter interface stated in types (createEntry/readTimeline/reload), fixed per-fixture runner protocols, worked example adapter over the Effect v4 schema contract wire shapes, and a deliberately broken negative control proving the checks bite. README documents the adapter contract, conventions, and exact commands. Co-authored-by: Gilbert Polanco <gilbertpolanco42@gmail.com>
This was referenced Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human author: Gilbert Polanco (gilbertpolanco42@gmail.com)
Why
The arena cross-review needs to judge all four candidates (
arena/candidate-a|b|c|d) against the same acceptance corpus, run through the same harness, or results are not comparable. Today there is no shared corpus: each review would improvise its own tests, and candidate quality would be judged on unequal ground. This PR lands that shared ground truth as data, plus a narrow adapter contract so any candidate's entry-creation and timeline-read entry points can execute it unchanged.What
evaluation/fixtures/, expectations independent of any candidate code:01-multi-event-narrative— one narrative → 3 events, exact count/categories/quantities and transcript order pinned.02-relative-time-timezones— 8 cases pinning exact absolute instants ("this morning", "yesterday 6pm", "an hour ago", "just now") acrossAmerica/New_York,Pacific/Auckland(NZST and NZDT) andUTC; conventions documented in the fixture and README; expected instants machine-computed against the IANA tzdb (DST-safe).03-malformed-extraction— hostile raw input (control chars, DEL): entry still created with 0 events (contract: extraction failure never blocks capture), raw preserved.04-retry-double-submit— samecaptureIdtwice →CreatedthenIdempotentReplay, exactly one entry/event on the timeline.05-raw-fidelity— SHA-256 byte equality of the raw transcript across a validation failure and a retry (created entry, replay, timeline read); hostile fixtures include NUL/DEL/CRLF/tabs/emoji/combining marks/trailing whitespace.06-reload-persistence— timeline identical (canonical-JSON deep-equal) across a simulated cold start.evaluation/src/adapter.ts:CandidateAdapter=createEntry(full pipeline, settles before resolve) /readTimeline/reload, results as a discriminated union (Created | IdempotentReplay | Rejected). Narrow on purpose; wire shapes mirror the Effect v4 schema contract (unix-ms numbers,_tagliterals, absent-not-null optionals). One deliberate addition:WireEntry.captureId, the duplicate-protection key.src/runner.tsexecutes each fixture identically for every candidate; adapter exceptions surface as fixture failures, never crashes.src/example/example-adapter.ts(in-memory, contract-shaped, DST-aware relative-time resolution) proves the corpus is executable.src/example/broken-adapter.tsplants duplicate-on-retry + transcript-trim faults; the harness flags 5/6 fixtures, proving the checks bite.Scope guard: touches
evaluation/**only; no candidate branches read; zero runtime dependencies (bun primary runner,tsxalternative documented).How to Review
evaluation/README.md(contract + commands), thensrc/adapter.ts(the interface cross-review adapters will implement) andsrc/runner.ts(the fixed protocols).02(verify against a tzdb if you like — each was machine-computed, notably NZDT1790571600000and US-EST1793574000000).IdempotentReplayas the defined double-submit outcome; rejection on extraction failure would violate the schema contract's "events may be empty — extraction failure never blocks capture", so fixture 3 pins creation + 0 events instead.Test Evidence
Run on this branch (bun 1.3.14, tsc 5.9.3 strict):
bun src/run.ts→ 6/6 fixtures PASS, exit 0 (worked example adapter; all six fixtures execute: 1 + 8 + 1 + 1 + 2 + 2 = 15 adapter workloads).bun src/run.ts --adapter=./src/example/broken-adapter.ts --expect-failure→ faults caught, exit 0: duplicate-on-retry (expected IdempotentReplay, got Created), SHA-256 byte-fidelity violations on created/replayed/timeline surfaces, missing events.bun install && bun run typecheck→ exit 0 (strict,noUncheckedIndexedAccess,verbatimModuleSyntax).🔗 Obvious Project · 🧵 Obvious Thread