feat(check): the checker and the contract read a folder's reply
`okf check --payload` takes the reply to one call over a folder as well as a single payload: every bundle's payload is held to all 19 rules on its own, a finding is named with its bundle, one every payload carries alike is reported once, an answer labelled with a bundle its payload does not describe is `answer_misattributed`, and a reply with no answer is `payload_invalid`. No rule is added, and a single payload's report is unchanged. Contract SS 2.5.4 names the folder run and SS 8.11 fixes the reply; the known-positive moves to 24 620 / delta 592. The skill text follows: the working method's steps 1 and 4 name the folder, and the generic skill says to use the server's tools first where they are registered, with the skill as the supplement. The folder is an instruction in both generators, never a path: the bundle's parent written absolute named this checkout, and the test holding generated commands to no repository path fell on it. v1.1 order F, part F4. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
570496470b
commit
21f9241712
10 changed files with 240 additions and 29 deletions
|
|
@ -553,6 +553,11 @@ def _rewrite(
|
|||
# `<BUNDLE_ROOT>` would be the unfilled template's hole inside the one
|
||||
# section that asks for a second run.
|
||||
("<BUNDLE_ROOT>", str(bundle_root)),
|
||||
# The folder form of step 4 (v1.1 F). An instruction, never a path:
|
||||
# the bundle's parent directory is a path the caller never gave, and
|
||||
# written absolute it names a checkout (the test holding generated
|
||||
# commands to "no path into this repository" caught exactly that).
|
||||
("<FOLDER>", GENERIC_FOLDER),
|
||||
]
|
||||
for old, new in replacements:
|
||||
if old not in text:
|
||||
|
|
@ -820,6 +825,11 @@ CARD_COMMAND = "okf card"
|
|||
|
||||
GENERIC_BUNDLE = "<the bundle you were pointed at>"
|
||||
|
||||
#: Step 4's folder, in the generic skill. Lower-case on purpose, like
|
||||
#: `GENERIC_BUNDLE`: it is an instruction to the reader, not a hole a
|
||||
#: generator left.
|
||||
GENERIC_FOLDER = "<the folder that holds the bundles>"
|
||||
|
||||
|
||||
def render_generic() -> str:
|
||||
"""One installable skill for ANY bundle, carrying no bundle's numbers.
|
||||
|
|
@ -844,11 +854,20 @@ def render_generic() -> str:
|
|||
replacements: list[tuple[str, str]] = [
|
||||
(
|
||||
TEMPLATE_HEADER,
|
||||
"**Use the server first.** When an `okf` MCP server is registered — its\n"
|
||||
"tools `okf_describe` and `okf_ask` are then among yours — ask through it: it\n"
|
||||
"is registered once, works from every project and reaches subagents, which\n"
|
||||
"inherit tools and not skills. This skill is the supplement for a session\n"
|
||||
"with no server. It runs the same code over the same bundles, so the two\n"
|
||||
"cannot disagree about an answer, and neither has to be made again when a\n"
|
||||
"bundle is added or rebuilt.\n\n"
|
||||
"**This file is generic: it carries no bundle's identity and no bundle's\n"
|
||||
"numbers,** and it is therefore never stale. It serves whichever bundle you\n"
|
||||
"are pointed at. Before answering, read that bundle's own card:\n\n"
|
||||
"are pointed at — or every bundle under a folder you are pointed at. Before\n"
|
||||
"answering, read the card:\n\n"
|
||||
"```sh\n"
|
||||
f"{CARD_COMMAND} {GENERIC_BUNDLE}\n"
|
||||
f"{CARD_COMMAND} {GENERIC_FOLDER} # every bundle under it, each with its card\n"
|
||||
"```\n\n"
|
||||
"The card is DERIVED from the bundle on every run, never stored in it, so\n"
|
||||
"there is no second artefact that can disagree with the bytes. Its\n"
|
||||
|
|
@ -867,7 +886,9 @@ def render_generic() -> str:
|
|||
" --out /tmp/payload.json\n"
|
||||
"```\n\n"
|
||||
"`--ref` is an **assertion**, never an override: the identity is computed\n"
|
||||
"from the bytes either way, and a mismatch refuses. Read the pre-pass's\n"
|
||||
"from the bytes either way, and a mismatch refuses. It belongs to one\n"
|
||||
"bundle, so leave it out over a folder: each answer there carries its own\n"
|
||||
"bundle's `ref`. Read the pre-pass's\n"
|
||||
"own exit status, which carries three values: **0** a payload was written,\n"
|
||||
"**1** the run happened and refused, **2** the run did not happen at all.",
|
||||
),
|
||||
|
|
@ -948,6 +969,7 @@ def render_generic() -> str:
|
|||
("<KNOWN_POSITIVE_CASE>", okf_consume.KNOWN_POSITIVE_CASE),
|
||||
("<KNOWN_POSITIVE_EXPECTED>", str(okf_consume.KNOWN_POSITIVE_EXPECTED)),
|
||||
("<BUNDLE_ROOT>", GENERIC_BUNDLE),
|
||||
("<FOLDER>", GENERIC_FOLDER),
|
||||
("<PAYLOAD_PATH>", "/tmp/payload.json"),
|
||||
("<SKILL_PATH>", "this file"),
|
||||
("<REF>", "the card's `ref`"),
|
||||
|
|
@ -964,9 +986,11 @@ def render_generic() -> str:
|
|||
description = block_scalar(
|
||||
"Answer one question about ANY OKF bundle from a bounded payload assembled "
|
||||
"by a deterministic pre-pass, marking every claim with its source, its title "
|
||||
"and its provenance locator. Carries no bundle's identity: read the bundle's "
|
||||
f"own card with `{CARD_COMMAND}` first. Use when the user asks a question of, "
|
||||
"or states a hypothesis about, a corpus held as an OKF bundle."
|
||||
"and its provenance locator, over one bundle or every bundle under a folder. "
|
||||
"Carries no bundle's identity: read the card with "
|
||||
f"`{CARD_COMMAND}` first. The supplement to the `okf` MCP server: use its tools "
|
||||
"when they are registered, and this skill when they are not. Use when the user "
|
||||
"asks a question of, or states a hypothesis about, a corpus held as OKF bundles."
|
||||
)
|
||||
header = f"---\nname: {block_scalar(GENERIC_NAME)}\ndescription: {description}\n---\n"
|
||||
return header + text
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue