Skip to content

calibrate-judge build: a sample holding --- makes its case fail to load and go untested #6547

Closed

Description

@kyle-sexton

Observed

In the code-tidying pilot (#6539), calibrate-judge.py build wrote 5 calibration cases that claude plugin eval refused with invalid YAML frontmatter: Unexpected EOF. Each sample held a markdown table rule (---). prompt_md() puts the sample in one double-quoted append_system_prompt scalar via yaml_quoted(), which escapes backslash, quote, newline, tab and carriage return, but not -. The CLI's frontmatter reader ended the frontmatter at the --- inside the quoted value.

Those 5 cases were silently untested: score lists a sample with no reproduced run as untested, but a case that never loads is easy to miss in a long run. Observed at Claude Code 2.1.289 on 2026-10-07.

Workaround used

Escaping each - in the sample (a YAML double-quoted escape that parses to the same string) let the cases load and calibrate.

Fix wanted

  • yaml_quoted() escapes so that no --- run survives in the emitted line, within the subset validate-cases.py reads.
  • A fixture sample holding a table rule, with a test that build's output loads in validate-cases.py and round-trips to the original sample.

Refs: #6476


Generated by Claude Code

Activity

  1. added
    needs-triage
    on Oct 7, 2026
  2. kyle-sexton commented on Oct 11, 2026

    @kyle-sexton
    MemberAuthor

    Needs a design decision before anyone implements this, so I'm adding needs-human.

    Three independent reviewers checked this against origin/main today (2026-10-11). Two of the three said not to implement it as the issue describes, because no escape works for both readers:

    • \- is not valid YAML, and validate-cases.py rejects it.
    • The validator's YAML subset accepts only \\ \" \/ \n \t \r, so \u002D (or \u002d) is rejected too.

    Decision needed: pick one.

    1. Extend the validator's subset to accept \uXXXX and add a round-trip test. This changes the contract between the build script and the validator.
    2. Move the sample that contains --- out of the frontmatter, for example into a sidecar file the case points at.
    3. Treat this as a Claude Code frontmatter-parsing bug. First probe the CLI's rule for where frontmatter ends.

    No branch was created; nothing is in flight for this issue.

  3. added
    needs-human
    on Oct 11, 2026
  4. added theissue type on Oct 12, 2026
  5. removed
    needs-triage
    on Oct 12, 2026
  6. kyle-sexton commented on Oct 13, 2026

    @kyle-sexton
    MemberAuthor

    Decision recorded. The owner approved applying independently verified recommendations on 2026-10-12.

    calibrate-judge build puts each sample in prompt.md frontmatter, and the CLI ends frontmatter at a --- inside the quoted value, so those cases never load. Reviewers found no escape both readers accept and asked the owner to pick a design.

    Verification notes:

    • Assumption (CLI loads a mid-line --- inside a case.yaml double-quoted scalar) is unverified until one build run; the doc gives no parser detail. Build must also emit schema_version and name in case.yaml, and prompt.md must not set append_system_prompt, since prompt.md frontmatter overrides case.yaml.

    Verified by an independent fresh-context check (confirmed, risk low): gh issue view 6547 (owner comment 2026-10-11 with three options); plugins/evals/skills/validate/scripts/validate-cases.py:200-204 (ESCAPES) and :259-260 (whole-line --- only); plugins/evals/skills/plugin-eval/scripts/calibrate-judge.py:163-173 yaml_quoted, :288-299 prompt_md; validate-cases.py handles case.yaml execution fields (lines 110-120, 672-699); https://code.claude.com/docs/en/plugin-evals fetched 2026-10-12: case.yaml execution: holds append_system_prompt; prompt.md frontmatter overrides; git log origin/main on both scripts; gh pr list search 6547

    Admission to an agent lane stays with the work-class rules and owner ratification.

  7. kyle-sexton commented on Oct 13, 2026

    @kyle-sexton
    MemberAuthor

    Owner batch-ratified this admission in an attended session on 2026-10-12: work-class: scoped. Rule: class C1-C3, no trust surface, the independent check confirmed the recorded decision, and no owner step remains.

  8. added
    agent-ready
    and removed
    needs-human
    agent-ready
    on Oct 13, 2026
  9. kyle-sexton commented on Oct 18, 2026

    @kyle-sexton
    MemberAuthor

    Agent Brief

    Type: Bug
    Summary: Stop calibrate-judge build from writing samples into prompt.md frontmatter, so a sample holding --- still loads.

    Current behavior:
    calibrate-judge.py build writes each sample into prompt.md frontmatter as a double-quoted append_system_prompt scalar. The CLI ends the frontmatter at a --- inside that value, so cases whose sample holds a markdown table rule fail to load and go untested.

    Desired behavior:

    • Build writes each case's append_system_prompt under execution: in case.yaml, which also carries schema_version and name.
    • prompt.md no longer sets append_system_prompt, since its frontmatter would override case.yaml.
    • The emitted case.yaml stays inside the YAML subset the case validator reads.

    Key interfaces:

    • Build output per case: case.yaml execution block, prompt.md without the system prompt.
    • Case validator: accepts the new output unchanged.

    Acceptance criteria:

    • A fixture sample holding a --- table rule builds into a case the validator accepts, and the case.yaml value round-trips to the original sample.
    • A test shows prompt.md frontmatter carries no append_system_prompt.
    • scripts/run-test-file.sh on the calibrate-judge test file passes.
    • A changelog entry or fragment for evals passes scripts/check-changelog-fragments.sh.

    Out of scope:

    • Confirming with one live CLI load that a mid-line --- in a case.yaml scalar loads (done after merge).
    • Extending the validator's escape subset.

    This was generated by AI during backlog shaping. The owner approved this in an attended backlog-shaping session on 2026-10-17.

  10. added
    agent-ready
    on Oct 18, 2026
  11. melodic-automation-lanes commented on Oct 18, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue run that agent-ready started failed before it reported, or the token broker refused it because its workflow files differ from main's. work-unblock removed and added agent-ready back to start a fresh run on main's workflow files. It does this once per version of those files, so if this run fails the same way, a person looks at it.

  12. added
    agent-ready
    needs-human
    and removed
    agent-ready
    on Oct 18, 2026
  13. melodic-automation-lanes commented on Oct 18, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue lane stopped partway through this issue and needs a person.

    Why, in the run's own words:

    The run wrote no readable outcome file, so it stopped before it finished.

    Run: https://github.com/melodic-software/claude-code-plugins/actions/runs/39095235346

    To retry, remove needs-human and add agent-ready again.

  14. added
    agent-ready
    and removed
    needs-human
    on Oct 18, 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

    agent-ready

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions