Repository navigation
Call the verdict rule in the private verifier; remove the public copy - #57
Merged
Merged
Conversation
The per-claim verdict rule no longer lives in this repository. The orchestrator reaches it through verifier_client, which imports the private verifier lazily and converts between app.schemas.challenge and the private package's models at that boundary. - verifier_client: add precheck_citation, decide and validity_available. When the rule cannot be imported, raises, or returns something that does not validate against the public schema, the answer is "not decided": the citation check reports `unavailable` (never `invalid`) and decide returns an inconclusive outcome. - challenge_orchestrator: drop the load-time import. An unavailable rule at claim submission records an inconclusive claim verdict and ends the task inconclusive instead of rejecting the claim, because a rejected claim would let the task close as "no valid claim". The validate job checks availability before any sandbox run is charged. - Delete services/challenge_validity.py and its test. The new tests cover only the boundary, with a fake package in sys.modules, plus a cold import of the app with the private packages unimportable. - docs/cyber/S0_INTERFACES.md: remove the verdict-rule summary and the references to runner paths that were removed in #53. Where the two copies of the rule had drifted, the private verifier's behaviour is now the engine's behaviour. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
What
The challenge engine's per-claim verdict rule no longer lives in this repository. The orchestrator now reaches it through
backend/app/services/verifier_client.py, the same lazy client that already fronts the private verifier.verifier_client: newprecheck_citation,decideandvalidity_available. The private package is imported lazily; public models (app.schemas.challenge) are rebuilt as the private package's models going in, and the result is re-validated against the public schema coming out.challenge_orchestrator: the load-time import is gone, so the backend starts with the private verifier absent. Both call sites use the client.backend/app/services/challenge_validity.pyandbackend/tests/test_challenge_validity.py.docs/cyber/S0_INTERFACES.md: the prose summary of the rule is removed, along with references to runner paths that were removed in Remove the in-tree challenge runner; it ships with the private verifier #53.Fail-closed behaviour
"Not decided" is never turned into a rejection or into a verdict the rule did not give.
unavailable, notinvalidinconclusive, task endsinconclusive, report job queued. The claim is not rejected: a rejected claim would let the task close as "no valid claim".inconclusive; no sandbox run is chargeddecidereturns an inconclusive outcomeinconclusive; execution ids of the completed runs are recordedThe stored reason in each case is "The private verifier is unavailable, so this claim was not decided". No finding is created.
Behaviour change
Where the two copies of the rule had drifted, the private verifier's behaviour is now the engine's. The drift is limited to the wording of one inconclusive reason; no verdict changes.
Operational note
CHALLENGE_ENGINE_ENABLEDstays off by default and nothing changes while it is off. Before it is turned on, the private verifier must be importable by the backend process itself —CHALLENGE_RUNNER_PATHonly covers the runner subprocess. Without it every claim endsinconclusive.Tests
tests/test_verifier_client_validity.py: boundary only, against a fake package injected intosys.modules— conversion in both directions, missing package, missing module or entry point, exception, malformed answers. It does not restate the rule.tests/test_app_imports_without_private_verifier.py: cold import of the app in a fresh interpreter with the private packages unimportable; asserts nothing tried to import them,/healthanswers, routers are mounted.tests/test_challenge_orchestrator.py: patches moved to the client; four new tests for the fail-closed paths above.Not in this PR
The deleted files remain in this repository's git history.
backend/app/schemas/challenge.pyanddocs/cyber/runner-protocol.schema.jsonare the backend's side of the protocol (data shapes) and stay.🤖 Generated with Claude Code