Skip to content

fix(benchmark): bind CALF/LegNav paired slots to the observed observation contract #7454

Description

@ll7

Goal / Problem

The CALF/LegNav comparator added in #7357 assigns each paired trace to a fixed slot
(perfect_perception / sensor_limited) but never checks that the trace's own observed
observation contract matches the slot it was filed under.

robot_sf/benchmark/calf_legnav_comparator.py:

  • _observation_contract() derives condition from the trace's observed_observation.evidence_class
    (ideal_state -> perfect_perception, perception_limited -> sensor_limited) and returns
    status: "available" for either.
  • build_calf_legnav_comparator_report() then files perfect_trace under CONDITION_IDEAL and
    sensor_trace under CONDITION_SENSOR without comparing the derived condition to the slot.
  • The paired identity guard covers candidate, scenario_id, seed — but not horizon.
  • robot_sf/benchmark/schemas/calf_legnav_comparator_config.v1.json allows noise/occlusion keys in
    either condition, so a config edit can make both rows perception-limited.

Effect: a mislabelled or degenerate pair (for example both rows perception_limited) still reports
status: "available" at the top level. The mismatch is visible in the per-condition
observation_contract.condition field, but nothing fails closed. PR #7357's own body asserts "both
rows use the same candidate, scenario, seed, horizon, and config digest; only the observation
contract differs" — that invariant is currently asserted rather than enforced.

This is a fail-open in the exact property the PR is being domain-reviewed for. The committed smoke
config is correct today (verified: perfect_perception -> ideal_state / noise_profile: none;
sensor_limited -> perception_limited / bounded_gaussian); the gap is that an edit could break
the contrast silently.

Scope

Prepared implementation

A validated implementation is already pushed to branch
review/pr-7357-observation-binding-20260818, cherry-picked onto PR #7357's head
c680b6811b6b8d1b8f750ec9c1892c7d433d9901 (single commit 5949b7024).

It threads an expected_condition through _observation_contract() / _condition_report(), records
expected_condition and condition_binding (matched / unavailable / not_checked) plus a
reason in the report, sets the condition status to unavailable (and therefore the condition and
report status to blocked) on a mismatch, and adds horizon to identity_fields. The report schema
needs no change: condition.observation_contract is additionalProperties: true.

Validation on that branch:

  • pytest tests/benchmark/test_calf_legnav_comparator.py tests/dev/test_issue_7331_benchmark_namespace_inventory.py — 12 passed
    (including three new tests: swapped contract fails closed, matched binding recorded, horizon mismatch rejected).
  • ruff check / ruff format --check on the changed files — passed.
  • Live paired smoke on configs/benchmarks/issue_7318_calf_legnav_comparator_smoke.yaml — still
    status: available, both slots condition_binding: matched.

The work was parked rather than pushed to research/issue-7318-calf because the autonomous factory
pushed a base refresh to that branch minutes earlier and was mid-review; racing its exact-head verdict
was avoided deliberately.

Definition of Done

Validation / Testing

  • uv run pytest tests/benchmark/test_calf_legnav_comparator.py
  • uv run python scripts/benchmark/run_calf_legnav_comparator_issue_7318.py --config configs/benchmarks/issue_7318_calf_legnav_comparator_smoke.yaml --output-dir <tmp>

Project Metadata

  • Priority: P4 — small, bounded, and it closes a fail-open in a diagnostic contract.
  • Effort (h): 0.5 (implementation exists and is validated; needs review + landing).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions