Skip to content

v0.5.0

Choose a tag to compare

@Riccorl Riccorl released this 16 Sep 14:36
· 4 commits to main since this release
v0.5.0
48135fb

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-api and hf backends of ScopeGuardV2 now 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 V2 api backend is unaffected, since the server owns the prompt. (#45)
  • ScopeGuardV2Output.reasoning is now str | None, None only 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 Supported class description it interpolates was updated to match. (#45)
  • Accept output_fields on every guard constructor, validate, batch_validate, the serving request body and orbitals scope-guard-v2 serve --output-fields, so a caller asks for exactly the keys they need. scope_class alone 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_evidences still works as "everything except evidences"; when both are given and disagree, output_fields wins and raises a DeprecationWarning. One resolver on BaseScopeGuardV2 keeps 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 offline vllm backend gains structured outputs it never had. On the serving endpoints every response still carries all four keys, with unrequested ones as explicit JSON null. (#45)
  • Send output_fields on the API wire only when the caller asks for it explicitly, with a derived skip_evidences alongside it so a server that predates output_fields still 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.txt from a different prompt generation, naming both sha256 prefixes. The check runs in the vllm, hf and vllm-api backends before any weights load, and resolves a model reference from disk, the huggingface_hub cache, 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 the api backend has no check because the remote service builds the prompt. (#45)
  • Check --output-fields before serve starts 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. serve passes the selection it has already resolved through to the server and unsets SCOPE_GUARD_V2_SKIP_EVIDENCES, so the server does not work out a second, conflicting selection of its own. When --skip-evidences and --output-fields contradict each other, serve prints 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 api backend sending skip_evidences: false on 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-sent false shadowed the server's own SCOPE_GUARD_V2_SKIP_EVIDENCES setting. (#45)
  • Report token usage on the in-process vllm backend, which hard-coded usage=None. Counts now come from RequestOutput with the system prompt subtracted, the way vllm-api already did it. (#47)
  • Report token usage on the hf backend. The pipeline in src/hf_pipeline/scope_guard_v2.py excludes left padding via attention_mask and counts each completion to its first eos rather than to the longest row in the batch. guards/hf.py reads those keys defensively, so a checkpoint shipping an older pipeline gets usage=None and still validates. (#47)
  • Add count_system_prompt_in_usage to the vllm and hf backends, matching vllm-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 CliRunner with an autouse fixture in tests/conftest.py. Rich was styling the help panel and splitting option names into separately escaped runs, so three CLI --help assertions failed whenever the shell exported FORCE_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 no release/* branches and no backport * labels, and its BACKPORT_APP_ID / BACKPORT_APP_PRIVATE_KEY credentials 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).