Summary
W&B publication for rewrite-mode benchmark runs can fail during completion seal validation because the W&B ingress schema requires run.replace even when the measurement record is for mode="rewrite".
Observed error:
ERROR: bad_input error=invalid measurement record on line 1: schema violation at run.replace
This happens after benchmark compute and local analysis complete successfully, so it blocks W&B publication and downstream run comparison.
Context
We hit this while running a RAT Bench rewrite throughput benchmark through the Big Iron/SLURM harness against a PR 206 branch rebased on current main.
The first measurements.jsonl record was a run record with:
{
"record_type": "run",
"mode": "rewrite",
"rewrite": {
"risk_tolerance": "low",
"max_repair_iterations": 0,
"strict_entity_protection": false,
"has_privacy_goal": true,
"has_instructions": false
}
}
No replace metadata is semantically required for a rewrite run, but tools/measurement/measurement_tools/wandb_ingress.py currently defines:
class RunMeasurement(_MeasurementEnvelope):
...
replace: dict[StrictStr, JsonValue]
rewrite: dict[StrictStr, JsonValue]
So the completion seal rejects rewrite records that do not include replace.
Expected Behavior
Rewrite-mode run records should validate and publish to W&B when they contain rewrite metadata and omit replace metadata, or when replace metadata is explicitly null/empty according to the intended schema contract.
Proposed Fix
Make run metadata schema mode-aware or optional/defaulted for mutually exclusive replace/rewrite config blocks. For example:
- allow
replace: dict[...] | None = None
- allow
rewrite: dict[...] | None = None
- validate that replace-mode records have replace metadata and rewrite-mode records have rewrite metadata, if strictness is desired
- add a regression test for
record_type="run", mode="rewrite" passing write_completion_seal.py
Impact
This blocks W&B publication for rewrite benchmarks even when SLURM/Big Iron execution, scoring, aggregation, and measurement export complete successfully.
Summary
W&B publication for rewrite-mode benchmark runs can fail during completion seal validation because the W&B ingress schema requires
run.replaceeven when the measurement record is formode="rewrite".Observed error:
This happens after benchmark compute and local analysis complete successfully, so it blocks W&B publication and downstream run comparison.
Context
We hit this while running a RAT Bench rewrite throughput benchmark through the Big Iron/SLURM harness against a PR 206 branch rebased on current
main.The first
measurements.jsonlrecord was a run record with:{ "record_type": "run", "mode": "rewrite", "rewrite": { "risk_tolerance": "low", "max_repair_iterations": 0, "strict_entity_protection": false, "has_privacy_goal": true, "has_instructions": false } }No
replacemetadata is semantically required for a rewrite run, buttools/measurement/measurement_tools/wandb_ingress.pycurrently defines:So the completion seal rejects rewrite records that do not include
replace.Expected Behavior
Rewrite-mode run records should validate and publish to W&B when they contain rewrite metadata and omit replace metadata, or when replace metadata is explicitly null/empty according to the intended schema contract.
Proposed Fix
Make run metadata schema mode-aware or optional/defaulted for mutually exclusive replace/rewrite config blocks. For example:
replace: dict[...] | None = Nonerewrite: dict[...] | None = Nonerecord_type="run", mode="rewrite"passingwrite_completion_seal.pyImpact
This blocks W&B publication for rewrite benchmarks even when SLURM/Big Iron execution, scoring, aggregation, and measurement export complete successfully.