/** * S1 value-verdict harness — the RawRow `s1.v1` CONTRACT ([ref] metrics layer). * * 🔴 RawRow IS core's `RunRecord` (the [ref] metric input) + the OUT-OF-BAND provenance the harness needs. * core ships the [ref] metrics layer via the SUBPATH export `@sema-agent/core/bench`(1.111.0 首发;L17:版本锚随装机 core 走,见 S1_CORE_VERSION) * The harness no longer mirrors the types — it IMPORTS the real `RunRecord` / * `OracleVerdicts` / `DeliveryDecision` / `CoreStatsSubset` / `InterceptCounterfactual` and re-expresses * `RawRow` as `RunRecord & { schemaVersion; meta? }`. A `RawRow[]` is therefore assignable to `RunRecord[]`, * the input `buildReport` consumes (wired below as `buildS1Report`). * * 🔴 OUT-OF-BAND PROVENANCE: `schemaVersion` + `meta` are NOT RunRecord scoring fields — they are * producer-side provenance (the field-contract handshake + git/run provenance). They ride ON TOP of the * RunRecord shape, never inside it; the metric tool ignores them. * * 🔴 OWNERSHIP SPLIT (anti-laundering — load-bearing): * - The HARNESS (this file + arms.ts) is the PRODUCER: it emits ONE conformant row per (task × arm × seed) with * the raw measurement inputs (oracle / stats / delivery / counterfactual) and an HONEST `runStatus`. * - The METRIC TOOL (core `buildReport`, [ref]) does the CORRECTLY/INCORRECTLY/UNVERIFIED-withheld split via * the counterfactual JOIN + the Simpson grouping. The harness NEVER credits a bare withhold as value. * - The NUMERATOR is ONLY DELIVERED-CORRECT, and the OBJECTIVE oracle (oracle.ts) is the measure — an LLM-judge * is NEVER in the numerator (it may only be a GATE inside an arm). * * 🔴 HONEST runStatus (the 关键点 against benchmark noise): an INFRA death — OOM / passthrough / nested-root crash — * is `"infra-failed"` and MUST be EXCLUDED from scoring, NOT scored as a loss. Default is `"scored"`. * * 🔴 HONEST withhold-credit: SOLO `delivery.withheld` is ALWAYS false (only a SUP/TEAM gate can intercept). A * withheld run only earns CORRECTLY-WITHHELD credit when `counterfactual.withoutInterventionTrulyCorrect===false`; * a withhold WITHOUT a counterfactual is UNVERIFIED-WITHHELD → no credit (the metric tool enforces this; the * producer's job is to ATTACH the counterfactual whenever it withholds). */ import { type RunRecord, type OracleVerdicts, type DeliveryDecision, type CoreStatsSubset, type InterceptCounterfactual, type RunStatus, type ValueJudgmentReport, type ImplementedAxes } from "@sema-agent/core/bench"; import type { Arm } from "./arms.js"; export type { RunRecord, OracleVerdicts, DeliveryDecision, CoreStatsSubset, InterceptCounterfactual, RunStatus, ValueJudgmentReport, }; /** The schema version stamped into every row — the field-contract handshake with core's metric tool. */ export declare const S1_SCHEMA_VERSION: "s1.v1"; export type S1SchemaVersion = typeof S1_SCHEMA_VERSION; /** The INSTALLED core version, read from node_modules at load(SPEC §0 provenance-honesty——接入审计 L16: * 硬钉 "1.111.0" 在 core 升到 1.258.x 后让 harness 每行 meta.coreVersion 输出错误溯源;动态读=永不再漂)。 */ export declare const S1_CORE_VERSION: string; /** The arm tag as emitted on the wire (lowercase — the s1.v1 contract value; the internal `Arm` is uppercase). The * harness emits a SUBSET of core's `RunRecord["arm"]` (which also carries "sup-vf", an S1b ablation S1 does not run). */ export type ArmTag = "solo" | "sup" | "team"; /** Map the internal uppercase `Arm` to its lowercase s1.v1 wire tag. */ export declare function armTag(arm: Arm): ArmTag; /** * delivered && hiddenTestsGreen && buildPassed && invariantsOk — the ONLY thing that counts as value. This is the * SAME function as core's exported `trulyCorrect` (shape-equal over the 4 booleans); re-exported under the harness's * historical name so callers and the producer recompute it from the same source the metric tool uses (it can never * drift from the metric's definition). */ export declare const oracleTrulyCorrect: (o: OracleVerdicts) => boolean; /** * 🔴 Narrow an oracle result down to EXACTLY the 4 s1.v1 contract booleans before it goes on the wire. The * standalone `runOracle` (oracle.ts) returns an `OracleVerdict` SUPERSET (`trulyCorrect`, `raw`) that is * structurally assignable to the `() => Promise` seam — without this defensive projection those * extra producer-internal fields would JSON.stringify straight into the emitted row's `oracle` block, drifting it * off s1.v1 and (worse) re-exporting the derived `trulyCorrect` the metric tool must RECOMPUTE and never trust. */ export declare function pickOracleVerdicts(o: OracleVerdicts): OracleVerdicts; /** * ONE s1.v1 row per (taskId × arm × seed). RawRow IS a core `RunRecord` PLUS the out-of-band provenance * (`schemaVersion` + `meta`) the metric tool ignores — so a `RawRow[]` is directly assignable to `RunRecord[]` * (the `buildReport` input). All µUSD/ms; no pre-composed scalars (the metric tool composes). The producer narrows * `arm` to {@link ArmTag} (the s1.v1 lowercase subset) and omits `infraMicroUsd` when not measured (never a faked 0). */ export interface RawRow extends RunRecord { /** lowercase arm tag (the s1.v1 wire value) — a SUBSET of `RunRecord["arm"]` (S1 never runs the "sup-vf" ablation). */ arm: ArmTag; /** The schema-version handshake (NOT a core RunRecord field — a producer-side provenance stamp the shape test pins). */ schemaVersion: S1SchemaVersion; /** Provenance the metric tool ignores but search reads (NOT a RunRecord scoring field). */ meta?: { startedAt: number; finishedAt: number; coreVersion: typeof S1_CORE_VERSION; gitSha: string; runId: string; /** 🔴 HONESTY-ON-THE-WIRE: stamped on a SUP/TEAM row whose C2 (stats.humanReview) came from the DETERMINISTIC * rubric reviewer (reviewer.ts THINK_MS), NOT a real human (real-human C2 is S2). Absent ⇒ no modeled review * touched the row (e.g. SOLO, or a SUP/TEAM run with no humanReview gate). A non-scoring provenance flag. * (core's RunRecord carries `judgeMode:"scripted-human-initjudge"` for the same honesty at the record level; * arms.ts also stamps that field. This provenance copy stays on `meta` for the search-side readers.) */ reviewerKind?: "scripted-human-rubric"; /** TEAM bigger-pie guard input (Σ the leader's ACTUAL stamped per-worker budgets); read by assertBudgetMatch. */ teamWorkerBudgetSumUsd?: number; }; } /** Serialize a RawRow to one JSONL line (no trailing newline — the writer joins with "\n"). */ export declare function rowToJsonl(row: RawRow): string; /** Serialize a batch of RawRows to a JSONL document (one row per line, trailing newline). */ export declare function rowsToJsonl(rows: RawRow[]): string; /** * 🔴 Wire the REAL [ref] metric tool. `buildReport` (core 1.111.0 `@sema-agent/core/bench`) is the * value-verdict JOIN: it SCORES only `scored` rows, GROUPS by `(suiteVersion, taskId, archetype, valueDimension, * arm)` (the Simpson guard), folds each cell, splits the withhold bucket by the counterfactual, and emits the * `ValueJudgmentReport` (groupedCells / comparisons / cells / pareto / excluded). A `RawRow[]` is assignable to its * `RunRecord[]` input (RawRow extends RunRecord), so the harness produces the verdict from its OWN rows with no * re-mapping — the metric definition lives in core, the producer only emits honest inputs. * * The live SOLO/SUP/TEAM run that GENERATES rows is clay-gated (expensive E2B+DeepSeek); this is purely the * CONSUME path (test-covered on synthetic conformant rows in test/s1-report.test.ts). */ export declare function buildS1Report(rows: RawRow[], opts?: { implementedAxes?: Partial; }): ValueJudgmentReport; //# sourceMappingURL=row.d.ts.map