Skip to content

Call the verdict rule in the private verifier; remove the public copy - #57

Merged
widrss merged 2 commits into
mainfrom
chore/verdict-rule-to-private-verifier
Nov 18, 2026
Merged

widrss merged 2 commits into
mainfrom
chore/verdict-rule-to-private-verifier

Conversation

@widrss

@widrss widrss commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

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: new precheck_citation, decide and validity_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.
  • Deleted: backend/app/services/challenge_validity.py and backend/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.

Where Rule missing / raises / malformed answer Result
Claim submission (citation check) client reports unavailable, not invalid claim verdict inconclusive, task ends inconclusive, report job queued. The claim is not rejected: a rejected claim would let the task close as "no valid claim".
Validate job, before any run availability checked first claim and task inconclusive; no sandbox run is charged
Validate job, at the decision decide returns an inconclusive outcome claim and task inconclusive; execution ids of the completed runs are recorded

The 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_ENABLED stays 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_PATH only covers the runner subprocess. Without it every claim ends inconclusive.

Tests

  • tests/test_verifier_client_validity.py: boundary only, against a fake package injected into sys.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, /health answers, routers are mounted.
  • tests/test_challenge_orchestrator.py: patches moved to the client; four new tests for the fail-closed paths above.
  • Full backend suite: 2104 passed before, 2104 passed after (50 rule tests removed, 50 boundary tests added).

Not in this PR

The deleted files remain in this repository's git history. backend/app/schemas/challenge.py and docs/cyber/runner-protocol.schema.json are the backend's side of the protocol (data shapes) and stay.

🤖 Generated with Claude Code

widrss and others added 2 commits November 17, 2026 21:52
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>
@widrss
widrss merged commit f586e5c into main Nov 18, 2026
1 check passed
@widrss
widrss deleted the chore/verdict-rule-to-private-verifier branch November 18, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant