Skip to content

W&B completion seal rejects rewrite run measurements without replace metadata #220

Description

@lipikaramaswamy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions