Skip to content

Plain-text document structure is still parsed with Markdown syntax #86

Closed

Description

@lanyue-llk

The document-structure scorer does not receive the declared plain_text representation. It still treats indentation and literal fences as Markdown code, causing valid plain-text sections to disappear.

Minimal public-scorer reproduction:

from lexbench_webfetch.scoring import score_attempt
from lexbench_webfetch.metrics import task_passed
case = {'url': 'https://example.test/document', 'document_structure': {
    'version': 1, 'minimum_heading_coverage': 1, 'minimum_body_chars': 5,
    'headings': [{'id': 'usage', 'text': 'Usage', 'level': 2, 'body_required': True}],
}}
answer = '    Usage\n\nA useful paragraph about application usage.'
metrics = score_attempt(case, answer.encode(), ok=True, metadata={'answer_format': 'plain_text'})
assert not task_passed(True, metrics)  # Incorrect: indentation is literal plain text.

Removing the four leading spaces passes. Declaring the same indented answer as Markdown correctly fails; that behavior should remain. Add a plain-text event path that preserves literal fences/indentation while retaining section matching, with paired representation controls.

The pinned pre-migration package already publicly accepts plain_text and reproduces the same failure. Its metrics call passes only html_document; this is not a newly exposed migration API.

Independent historical follow-up to #81, deferred under the maintainer's scope instruction.

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