Skip to content

WCXB metric binding hashes source text instead of behaviour #116

Closed

Description

@lanyue-llk

Problem

src/harness/web_fetch/wcxb_scoring.py:62 binds the WCXB metric by hashing the inspect.getsource() text of word_f1 and snippet_check. That fails in both directions:

  • Changes that do not affect scores break the binding. Running ruff format (planned in Extend lint coverage to the whole repository and enforce a formatter #89), editing a docstring or a comment, or adding a decorator changes the hash. Scoring, latency collection and certification then fail with WCXB metric implementation binding mismatch.
  • Changes that do affect scores can pass unnoticed. Edits to helpers called by those functions, but not inspected, change scores without changing the binding.

Fix

  • Move the metric and every helper it uses into a dedicated module (e.g. wcxb_metrics.py).
  • Bind the file bytes of that module, or its normalized AST, in wcxb-metric-bindings.json.
  • Add golden-case behaviour tests: fixed inputs with their expected scores, kept identical to the upstream evaluator.

Found while reviewing #81. Blocks the formatter stage of #89.

Activity

  1. added
    bug
    refactor
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugrefactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions