Skip to content

Fixed source-membership rejections are missing from source-match diagnostics #83

Closed

Description

@lanyue-llk

Fixed source membership rejects the correct records, but the public source-match diagnostics do not describe those rejections.

With two source-bound quotes, swapping their authors returns a failing verdict while stable_source_mismatched_record_count remains 0 and stable_source_mismatched_records remains []. The corresponding observed and matched counts are None, including for a matching answer.

Reproduction through the public scorer:

from lexbench_webfetch.stable_tasks import source_record_hash
from lexbench_webfetch.scoring import score_attempt
from lexbench_webfetch.metrics import task_passed

fields = ['author', 'quote', 'tags']
references = [
    {'quote': 'A quiet path.', 'author': 'Alice', 'tags': 'nature'},
    {'quote': 'Another path.', 'author': 'Bob', 'tags': 'life'},
]
case = {'url': 'https://example.test/quotes', 'acceptance_contract': {
    'version': 1, 'schema': 'quote', 'minimum_records': 2,
    'stable_text_anchors': [],
    'source_membership': {
        'kind': 'fixed', 'fields': fields,
        'record_hashes': sorted(source_record_hash(row, fields, 'quote') for row in references),
    },
}}
answer = '“A quiet path.” by Bob Tags: nature\n“Another path.” by Alice Tags: life'
metrics = score_attempt(case, answer.encode(), ok=True, metadata={'answer_format': 'markdown'})
assert not task_passed(True, metrics)
assert metrics['stable_source_mismatched_record_count'] == 0
assert metrics['stable_source_mismatched_records'] == []

Expected: expose the two rejected records and their computed hashes, with consistent observed/matched/mismatched counts, or use explicitly separate diagnostics for fixed membership and linked-record source pairs. Matching answers need passing controls as well.

This affects diagnosis and report drilldown; the failing acceptance verdict already works.

Scope: inherited follow-up, separate from #81. The same fixed-membership branch and diagnostic counters exist in the pinned pre-migration source: https://github.com/lexmount/lexbench-webfetch/blob/5a5b9367118dcc25f126ee16ef4de2d7c666f190/src/lexbench_webfetch/stable_tasks.py#L1462 . Confirmed on the rebased PR candidate. The maintainer requested independent historical defects be tracked as issues rather than extending the migration.

Activity

  1. self-assigned this
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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