feat(p20): the requirement that is RIGHT, and a clause number that is not a price
Three seams, one commit: A, B and C touch the same four modules (run.py carries
the debate task, the grounding composition and the announcement; okf.py carries
one reference-number vocabulary read by both A and B), so splitting them into
three commits would have meant hunk-level staging of entangled files. Stated
rather than silently restructured.
A — the declaration answers with the DOCUMENT's own words. Measured: 13
declarations over round 3 and P17b, not one naming a fasit concept, while the
tool answered {"declared": true, ...} by echoing the caller's own arguments. It
now returns the document's title and req_number, read off Bundle.context_files
(so the type: verdict layer can never be named back), plus the sentence saying
what the declaration binds. A path the base carries as no concept answers with
empty strings rather than refusing. The commission's success_criteria now reach
the DEBATE task through mandate.criteria_block, the one renderer, empty when
there are none — which is what keeps every un-commissioned prompt, and the
golden, byte-identical.
B — a clause number is not a price. THE ORDER'S OWN RULE WAS FELLED BY
MEASUREMENT: it asks to refuse a code that IS declared req_number/prosessnr,
and neither of its two known positives is. n500 declares seksjon 10.4.1..10.4.4
but never the bare 10.4; r761 declares 2727 prosessnr and 2753 seksjon, none of
them 1.10.4, which occurs once, as prose ("iht. vegnormal N200 kap. 1.10.4").
The COMPLEMENT fires on both and closes the hole _ground_against_input already
admits in writing -- "it fails OPEN on a coincidental match". Unanchored run +
requirement-shaped code + the base declares a vocabulary + the code is not in
it -> refused, naming the denominator. All five of kontrakt-sorasen's real
process codes ARE declared and pass, which is what keeps the one context set
built on real codes measurable. Replayed over all 24 codes of round 3 + P17b:
exactly the two known positives flip validated -> rejected, 22 unchanged.
C — a parse failure no longer burns the round ledger blind. _fetch_parsed takes
a BUILDER instead of a finished message list, so the retry carries the parse
reason; measured, kontrakt-sorasen-04 spent 11 of 12 rounds re-asking the same
question. And announced_subject names the routed bases instead of saying "the
portfolio" for a two-base commission.
Suite 1807/5 (from 1781, +26, 0 removed), golden demo-transcript.stdout
BYTE-UNCHANGED (shasum -a 1 of the CONTENT = ea8c534773acdbe41ae68f2c55724d69aaf8be4f),
ruff and mypy clean.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
64723c5d89
commit
c8f0c8f7c4
12 changed files with 1098 additions and 37 deletions
|
|
@ -211,9 +211,13 @@ _INSTRUCTIONS: Final = {
|
|||
HYPOTHESISER_ROLE: (
|
||||
"You shape ONE candidate cost-saving direction at a time from what the navigator found. "
|
||||
"BEFORE you commit to a direction, name the ONE requirement in the knowledge base that "
|
||||
"BINDS it: have the navigator find it with read_dir(filter=...) and read it with "
|
||||
"read_file, then call declare_requirement with the base id, that path and the "
|
||||
"requirement's own number. A direction with no requirement behind it is a guess. "
|
||||
"BINDS it: pass read_dir a 'filter' word taken from the approach's own label — "
|
||||
"filter='rundkjoring' finds the level's requirements about roundabouts, and one of them is "
|
||||
"the 'Krav 4.1.2-1' you are looking for — read it with read_file, then call "
|
||||
"declare_requirement with the base id, that path and the requirement's own number. The "
|
||||
"reply gives back the document's own title and number: if they are not about your measure, "
|
||||
"you declared the wrong requirement and should filter again. A direction with no "
|
||||
"requirement behind it is a guess. "
|
||||
"You may call quick_validate to sanity-check a candidate's numbers; its verdict is "
|
||||
"ADVISORY and is not the project's decision. When you commit to a direction, end your "
|
||||
f'turn with a line of the form: {HYPOTHESIS_MARKER} {{"label": "<short name>", '
|
||||
|
|
@ -1001,6 +1005,26 @@ def _resolve_bundle(index: Mapping[str, str], bundle_id: str) -> str:
|
|||
return index[bundle_id]
|
||||
|
||||
|
||||
def _declared_document(index: Mapping[str, str], bundle_id: str, path: str) -> tuple[str, str]:
|
||||
"""``(title, reference_number)`` of the document at ``path``, or ``("", "")`` when the base has
|
||||
no navigated concept under that name.
|
||||
|
||||
Read off the SAME ``Bundle.context_files`` every listing rung is built from (MAJOR-3/S7a-3), so
|
||||
a declaration can never be answered with the title of a ``type: verdict`` document — the one
|
||||
layer no listing names and ``read_file`` refuses outright.
|
||||
|
||||
A path the base does not carry as a concept — ``index.md`` is the reachable case — answers with
|
||||
two empty strings rather than raising: the declaration itself has already been accepted by the
|
||||
read-trace check above, and turning "I cannot restate your title" into a refusal would fail a
|
||||
declaration the run's own trace proves was read.
|
||||
"""
|
||||
bundle = okf.navigate_bundle(_resolve_bundle(index, bundle_id))
|
||||
for file in bundle.context_files:
|
||||
if file.name == path:
|
||||
return okf.unquote_scalar(file.frontmatter.get("title", "")), okf.reference_number(file)
|
||||
return "", ""
|
||||
|
||||
|
||||
#: Characters of the root index body one catalogue entry may carry. The catalogue's job is to let a
|
||||
#: manager pick a base, not to read one, so the excerpt is a fixed-size window rather than a share
|
||||
#: of the base: cost then scales with how many bases are configured, which the operator chose, and
|
||||
|
|
@ -1364,7 +1388,11 @@ def navigator_tools(
|
|||
"requirement's own number as its frontmatter states it. You must have READ the "
|
||||
"document with read_file first: a declaration naming a path this run never opened is "
|
||||
"refused, and reading it is the correction. Use read_dir with a 'filter' word to find "
|
||||
"it, read_file to read it, then declare it."
|
||||
"it (a word from the approach's own label works: filter='rundkjoring' -> "
|
||||
"'Krav 4.1.2-1'), read_file to read it, then declare it. The reply gives back the "
|
||||
"document's own "
|
||||
"title and number, so you can see whether you declared the requirement you meant: a "
|
||||
"declaration of a requirement that is not about the measure is worth nothing."
|
||||
),
|
||||
)
|
||||
def declare_requirement(bundle_id: str, path: str, ref: str) -> dict[str, Any]:
|
||||
|
|
@ -1386,7 +1414,26 @@ def navigator_tools(
|
|||
"direction"
|
||||
)
|
||||
requirements.append(DeclaredRequirement(bundle_id=bundle_id, path=path, ref=ref))
|
||||
return {"declared": True, "bundle_id": bundle_id, "path": path, "ref": ref}
|
||||
# P20/A1: give back the DOCUMENT's own title and number, read off the base rather than
|
||||
# echoed from the arguments. MEASURED (P19 round 3, P17b): 13 declarations over 5 runs and
|
||||
# NOT ONE named a fasit concept — the tool answered ``{"declared": true, ...}`` to every
|
||||
# declaration, so a model that had declared the wrong requirement was told it had succeeded.
|
||||
# ``okf.reference_number`` is the ONE reader of "which requirement is this" (kø-(p)), and
|
||||
# ``binds`` says out loud what the declaration is for: without it the reply is data with no
|
||||
# instruction, and the instruction is the whole correction.
|
||||
declared = _declared_document(index, bundle_id, path)
|
||||
return {
|
||||
"declared": True,
|
||||
"bundle_id": bundle_id,
|
||||
"path": path,
|
||||
"ref": ref,
|
||||
"title": declared[0],
|
||||
"req_number": declared[1],
|
||||
"binds": (
|
||||
f"This declaration says {ref} is the requirement the proposal rests on; a "
|
||||
"declaration of a requirement that is not about the measure is worth nothing."
|
||||
),
|
||||
}
|
||||
|
||||
tools = [list_bundles, read_bundle, read_dir, read_file]
|
||||
if requirements is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue