recall_guard.harness.smoke
recall_guard.harness.smoke
Smoke-test gate that produces a candidate shortlist for the harness.
Implements the harness.smoke component from the honest-model-ranking design
(Requirements 1.1, 1.2, 1.3, 1.4). For each candidate model the gate runs N
fixed smoke prompts via core.nvidia_lm.NvidiaLM and excludes any model that
times out, returns no logprobs, fails to emit a parseable Direction: value,
or otherwise errors. The returned Shortlist carries one SmokeOutcome per
candidate so the runner can persist the full pass/fail-reason record (1.4);
this module deliberately does no I/O.
SmokeOutcome
dataclass
Per-candidate smoke-test outcome.
fail_reason is None on pass and one of "timeout", "no_logprobs",
"parse_failure", or "error" on fail.
Source code in recall_guard/harness/smoke.py
34 35 36 37 38 39 40 41 42 43 44 | |
Shortlist
dataclass
Result of the smoke-test gate.
selected contains the passing models in candidate order, capped at
max_size. outcomes contains one entry per candidate (regardless of
pass/fail) so the runner can persist a reproducible artifact (Req 1.4).
Source code in recall_guard/harness/smoke.py
47 48 49 50 51 52 53 54 55 56 57 | |
smoke_test
smoke_test(
candidates,
api_key,
smoke_prompts,
max_size=10,
timeout_s=DEFAULT_TIMEOUT_S,
lm_factory=None,
)
Run the smoke-test gate over candidates and return a Shortlist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
candidates
|
list[str]
|
Ordered candidate model IDs to evaluate. |
required |
api_key
|
str
|
NVIDIA API key forwarded to the LM factory. |
required |
smoke_prompts
|
list[str]
|
The fixed smoke prompts. Every candidate runs every prompt unless an exclusion fires earlier (Req 1.2). |
required |
max_size
|
int
|
Hard cap on |
10
|
timeout_s
|
float
|
Per-call timeout forwarded to the LM client (Req 1.2). |
DEFAULT_TIMEOUT_S
|
lm_factory
|
LMFactory | None
|
Optional |
None
|
Returns:
| Type | Description |
|---|---|
Shortlist
|
|
Source code in recall_guard/harness/smoke.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |