Repository navigation
v0.5.0
Every change in this release is in orbitals.scope_guard_v2. ScopeGuard V1 (orbitals.scope_guard) is untouched and keeps its own prompt and backends.
⚠️ Breaking
- ScopeGuard V2 only. The
vllm,vllm-apiandhfbackends ofScopeGuardV2now require a checkpoint trained on the 2608 promptfix prompt. A 2606-era model served through the new prompt degrades quietly, with no parse error to catch it. The V2apibackend is unaffected, since the server owns the prompt. (#45) ScopeGuardV2Output.reasoningis nowstr | None,Noneonly when the caller asked for a selection that excludes it. (#45)
🚀 What's New
- Pin the library system prompt to the 2608 promptfix generation the shipped models were trained on, verified byte for byte by a sha256 test (7,665 chars, trailing newline included). The
Potentially Supportedclass description it interpolates was updated to match. (#45) - Accept
output_fieldson every guard constructor,validate,batch_validate, the serving request body andorbitals scope-guard-v2 serve --output-fields, so a caller asks for exactly the keys they need.scope_classalone is both the cheapest and the most accurate mode on our benchmarks. A bare string works as well as an iterable, and the CLI takes the comma-separated form.skip_evidencesstill works as "everything except evidences"; when both are given and disagree,output_fieldswins and raises aDeprecationWarning. One resolver onBaseScopeGuardV2keeps the five backends in agreement. (#45) - Render the requested fields as a
**REQUESTED OUTPUT FIELDS**selector block at the end of the user turn, replacing the**SKIP EVIDENCES**marker. (#45) - Constrain structured decoding to a per-selection response model (
response_model_for) that requires the requested keys and forbids the rest, so an unrequested key cannot be emitted. The offlinevllmbackend gains structured outputs it never had. On the serving endpoints every response still carries all four keys, with unrequested ones as explicit JSONnull. (#45) - Send
output_fieldson the API wire only when the caller asks for it explicitly, with a derivedskip_evidencesalongside it so a server that predatesoutput_fieldsstill narrows the output as far as it can. A caller who expresses neither now sends neither key. (#45) - Warn at construction when a checkpoint ships a
system_prompt.txtfrom a different prompt generation, naming both sha256 prefixes. The check runs in thevllm,hfandvllm-apibackends before any weights load, and resolves a model reference from disk, thehuggingface_hubcache, or the Hub, in that order. It is advisory: every failure in the Hub path is swallowed and logged at debug, so it can never break guard construction. Trailing newline differences are ignored, and theapibackend has no check because the remote service builds the prompt. (#45) - Check
--output-fieldsbeforeservestarts vLLM. A misspelled field name now fails straight away with exit code 2 and the same error message the Python API gives, instead of after the model has finished loading.servepasses the selection it has already resolved through to the server and unsetsSCOPE_GUARD_V2_SKIP_EVIDENCES, so the server does not work out a second, conflicting selection of its own. When--skip-evidencesand--output-fieldscontradict each other,serveprints the warning to stderr, where Python's default filters would otherwise hide it. (#45) - Add six runnable examples under
examples/scope-guard-v2/, organised by topic rather than by backend and each self-contained, so one file can be copied out on its own. (#47)
🐛 Bug Fixes
- Stop the
apibackend sendingskip_evidences: falseon every request. A caller who expressed no preference now omits the key, so the request falls through to whatever the server was configured with. Since v0.4.0 the always-sentfalseshadowed the server's ownSCOPE_GUARD_V2_SKIP_EVIDENCESsetting. (#45) - Report token usage on the in-process
vllmbackend, which hard-codedusage=None. Counts now come fromRequestOutputwith the system prompt subtracted, the wayvllm-apialready did it. (#47) - Report token usage on the
hfbackend. The pipeline insrc/hf_pipeline/scope_guard_v2.pyexcludes left padding viaattention_maskand counts each completion to its first eos rather than to the longest row in the batch.guards/hf.pyreads those keys defensively, so a checkpoint shipping an older pipeline getsusage=Noneand still validates. (#47) - Add
count_system_prompt_in_usageto thevllmandhfbackends, matchingvllm-api. (#47)
🔧 Internal
- Document output fields and the 2608 model requirement in
README.scope-guard-v2.md, with guidance on writing escalation criteria that do not over-trigger. (#45) - Turn off Typer's forced terminal under
CliRunnerwith an autouse fixture intests/conftest.py. Rich was styling the help panel and splitting option names into separately escaped runs, so three CLI--helpassertions failed whenever the shell exportedFORCE_COLOR. (#47) - Remove
.github/workflows/backport.yaml, which was added earlier in this cycle. It can never resolve a target branch on a repo with norelease/*branches and nobackport *labels, and itsBACKPORT_APP_ID/BACKPORT_APP_PRIVATE_KEYcredentials are unset. Net effect on CI across this release is nil. (#48) - Skip the Claude review workflow on draft and Dependabot pull requests, and reformat
claude-code-review.yaml. - Bump starlette 1.2.1 to 1.3.1 (#34), cryptography 47.0.0 to 48.0.1 (#35), and pydantic-settings 2.14.0 to 2.14.2 (#36).