Skip to content

Commit 7124c54

Browse files
authored
fix(klaud): freeze AgentX datasets and evals so baseline deltas render (#4390)
AgentX baselines never recorded their replay dataset, so every AgentX delta rendered N/A. The planner now reads each producer run's dataset slug from benchmark-siblings and builds baseline evals from the public evaluations of verified producer runs, keyed like final artifacts. Points normalize loader names and HF IDs to the dashboard slug; agent reports must name it. Also: infrastructure retries numbered 1-2, report schema errors name the failing field, eval samples no longer show N/A/old, and the prompt stops asking agents to hand-build baseline evals.
1 parent 961317c commit 7124c54

6 files changed

Lines changed: 360 additions & 44 deletions

File tree

‎.github/klaud-candidate-prompt.md‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,18 @@ concurrency/dataset identities. Use `infx.klaud`'s typed reporting commands:
8181
The goal record has `en` and `zh` sentences naming the exact old/new images.
8282
Read `report-schema --kind attempt` once and publish/update each typed record with
8383
`report --kind attempt --file "$KLAUD_EVIDENCE/attempt.json"`.
84+
In attempts, copy each AgentX point's `dataset` from its result row's `dataset.hf_dataset_name`
85+
and key evals by `identity(eval_key(row))` of the aggregate eval row, never by a point key.
8486
Schemas, arithmetic and rendering live in inferencex-e2e/infx/klaud/reporting.py;
8587
candidate.json provides the planner-verified exact `baseline-model`; use that value unchanged.
8688
The planner supplies `baseline-preflight.json` beside candidate.json. It contains the verified
8789
benchmark roster bound to the selected candidate, base SHA, source observation and model.
8890
After resolving the exact old/new image goal, prepare-baseline checks this binding and uses
8991
that roster without refetching it. If the preflight is absent or invalid, stop with
9092
`baseline-preflight-mismatch`.
91-
The preflight is not a published or final baseline. Supplement verified public
92-
eval/dataset evidence before freezing; never replace a failed lookup with a partial roster.
93+
The preflight is not a published or final baseline. It already holds the verified public evals
94+
and AgentX replay datasets of its producer runs: publish them unchanged, never hand-build or
95+
rekey baseline points or evals, and never replace a failed lookup with a partial roster.
9396
Never reduce the baseline to overlapping points, displayed rows or a smaller current family. Never dispatch the old
9497
image. Unproven deltas are N/A with a reason; N/A never excuses missing updated-image results.
9598
The baseline remains fixed across attempts. Keep the preflight's `retirements` exactly as given:
@@ -111,7 +114,7 @@ Empty aggregates or green collectors do not prove success.
111114

112115
One initial update plus $MAX_REPAIRS repairs TOTAL, including final-sweep repairs.
113116
A confirmed transient client-download/runner/network retry does not consume a recipe
114-
repair: keep the same head and classify it as infrastructure-retry, at most two per attempt.
117+
repair: keep the same head and classify it as infrastructure-retry, numbered 1 then 2 per attempt.
115118
Do not repeat deterministic failures as infrastructure retries. Stop after validation,
116119
exhausted repairs, or the same failure twice without progress.
117120
Benchmarks may take three hours. Do not cancel healthy or queued work to fit the agent job
@@ -126,6 +129,8 @@ one essential compatibility adjustment. Do not include evidence, benchmark resul
126129
release summaries, rationale or limitations there; those belong in attempt comments.
127130
Commit/push, generate the final matrix with
128131
infx.matrix.plan and run `check-final --matrix-file FILE` before dispatch.
132+
If main later appends another perf-changelog entry, merge main, keep your entry at the physical
133+
tail and dispatch the final sweep again as a `final` attempt; that merge is not a repair.
129134
Keep DRAFT and apply full-sweep-fail-fast as the SOLE sweep-related label; never apply another
130135
sweep label. Never switch labels while owned jobs are active.
131136
Fail-fast cancels siblings within a matrix, not every matrix; wait for all owned jobs.

‎inferencex-e2e/infx/klaud/__main__.py‎

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
from types import SimpleNamespace
1919
from typing import TYPE_CHECKING
2020

21+
from pydantic import ValidationError
22+
2123
from .api import PUBLIC, ReadError, fetch_capacity, fetch_catalog
2224
from .github import (
2325
VerificationError,
@@ -1151,7 +1153,15 @@ def main() -> int:
11511153
try:
11521154
if args.command in ("report", "report-schema", "prepare-baseline"):
11531155
from .lifecycle import current_session
1154-
from .reporting import Attempt, Baseline, Prose, baseline_for, prepare_baseline, publish
1156+
from .reporting import (
1157+
Attempt,
1158+
Baseline,
1159+
Prose,
1160+
baseline_for,
1161+
check_reported_datasets,
1162+
prepare_baseline,
1163+
publish,
1164+
)
11551165

11561166
if args.command == "prepare-baseline":
11571167
if args.output.exists():
@@ -1174,7 +1184,10 @@ def main() -> int:
11741184
if args.command == "report-schema":
11751185
print(json.dumps(model.model_json_schema(by_alias=True)))
11761186
else:
1177-
publish(current_session(), model.model_validate_json(args.file.read_text()))
1187+
record = model.model_validate_json(args.file.read_text())
1188+
if isinstance(record, Attempt):
1189+
check_reported_datasets(record)
1190+
publish(current_session(), record)
11781191
return 0
11791192
if args.command == "check-final":
11801193
from .lifecycle import current_session
@@ -1299,11 +1312,18 @@ def main() -> int:
12991312
TypeError,
13001313
subprocess.SubprocessError,
13011314
) as error:
1302-
reason = (
1303-
str(error)
1304-
if isinstance(error, VerificationError)
1305-
else "State unavailable or invalid; inspect GitHub before retrying"
1306-
)
1315+
if isinstance(error, VerificationError):
1316+
reason = str(error)
1317+
elif isinstance(error, ValidationError) and args.command == "report":
1318+
# Name the failing fields of the agent's own record without echoing its values.
1319+
reason = "Invalid record: " + "; ".join(
1320+
".".join(str(part) for part in item["loc"]) + ": " + item["msg"]
1321+
if item["loc"]
1322+
else item["msg"]
1323+
for item in error.errors(include_url=False)
1324+
)
1325+
else:
1326+
reason = "State unavailable or invalid; inspect GitHub before retrying"
13071327
print(f"::error::Klaud: {reason}.")
13081328
return 1
13091329

‎inferencex-e2e/infx/klaud/api.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"benchmarks": PUBLIC + "/api/v1/benchmarks",
3232
"workflow-info": PUBLIC + "/api/v1/workflow-info",
3333
"evaluations": PUBLIC + "/api/v1/evaluations",
34+
"benchmark-siblings": PUBLIC + "/api/v1/benchmark-siblings",
3435
}
3536
USER_AGENT = "InferenceX-Klaud-Cold/1.0"
3637
MAX_BYTES = 16 * 1024 * 1024
@@ -72,11 +73,16 @@ def fetch(
7273
token: str | None = None,
7374
model: str | None = None,
7475
date: str | None = None,
76+
benchmark: int | None = None,
7577
clock: Callable[[], datetime] = lambda: datetime.now(UTC),
7678
opener: Callable[..., Any] | None = None,
7779
sleeper: Callable[[float], None] = time.sleep,
7880
) -> Feed:
7981
query = {}
82+
if resource == "benchmark-siblings":
83+
if benchmark is None:
84+
raise ReadError("benchmark-id-required")
85+
query["id"] = str(benchmark)
8086
if resource == "benchmarks" and model:
8187
query["model"] = model
8288
if resource in ("benchmarks", "workflow-info") and date:

0 commit comments

Comments
 (0)