Repository navigation
Conversation
fact_check:
- A declared value written as Norwegian text ("8 300", "8,5") went
ungraded, and "8.300" was read as 8.3, so a correct "8 300 kroner"
was graded high. A string value is now read the way the answer reader
reads a figure: a space or a full stop between groups of three digits,
a comma before the decimals. A first group of zero is never a thousands
group ("0.125" is 0.125). A value that is not a number (or is a bool,
NaN or infinity) gives the per-fact outcome UNGRADED with its reason,
also when classify_fact is called directly, where it used to raise.
The scenario reason now quotes that reason instead of always blaming
the fact head. The facts contract in stale_facts documents the
convention.
- When the judge reply could not be parsed, "Could not parse judge
response" stood in issues_found and the raw reply in summary beside the
grade read from the transcript. The parse error now goes to judge_error
and the code-derived grade stands alone.
choice_match: parse_choice did not read past a numbered-list marker
("1. yes", "**1.** yes", "1. Answer: no"). The marker is now skipped
when the line does not start with an option key itself, so keys such as
"1", "1b" or "10" are still read as keys.
get_judge returned a shallow copy, so changing a nested value such as
response_schema in the returned config changed the registry entry (or
the caller's dict). It now copies plain dicts, lists, tuples and sets at
every depth and shares every other object, so hooks and anything they
hold (a client, a lock) stay the originals.
load_head's torch import is an availability probe; mark it noqa: F401
like the numpy import beside it.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
valuewithfloat():classify_factcall crashed on them.issues_foundand the raw reply stayed insummary.parse_choicedid not read past a numbered-list marker, so "1. yes" and "1. yes" gave no choice.get_judge()returned a shallow copy. Changing a nested value such asresponse_schemachanged the registry entry for every later call.Fix
A declared string value is read the way the answer reader reads figures:
The convention is documented in the facts contract.
If the reply did not parse,
parse_error,issues_foundandsummarymove intojudgment["judge_error"].parse_choiceskips "1." or "1)" only when the line doesn't start with an option key, so keys like "1", "1b" and "10" still read as keys.get_judge()copies plain dicts, lists, tuples and sets at every depth, and shares every other object (hooks and anything they hold).Notes:
Trueas 1.parse_choicenow applies its existing first-word guess to list items. For example, "1. A-vitamin er lav" reads as A with keys A–E, as unnumbered lines already did.parse_choice, which predates this change.Testing
tests/test_judge_parsing.pyhas 3 tests: declared values, an unparsed reply and numbered lists.tests/test_judge_registry.pyalso checks a nested schema and a hook that holds a lock.test_audit_regressions_judges.py: "8 300" now grades, so the test uses a value that is not a number.test_checklist_reframing.py: compares with==instead ofis.Written by Opus 5.5