Repository navigation
Decision model questions to Nova rules - #37
Conversation
Commit 8a4881d deleted examples/decision/ while README.md and three guides still link to eight of its files. Restore Marco's 825bee6 versions, converted from the removed decision: section to llm: (decision.$x -> llm.$x; LayeredPromptRisk merges its typed and quoted checks into one llm: block). Harness scripts treat an incomplete scan as undecided. Restore the examples test, packaging entries and artifact checks, and add guards that every example rule parses and every documented examples/decision path exists. The config-loading test now clears OPENROUTER_API_KEY so a developer's real key can never be read or echoed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Decision is disabled by default, so before this change one typed rule in a rules directory made Nova.scan() and NovaScanner.scan() raise whenever its answer was needed, breaking scans for unrelated rules. - A required check that was not run (Decision disabled, skip_decision, skip_llm, no LLM/semantic evaluator) now leaves the rule incomplete instead of raising: ScanResult.incomplete_rules and scan_with_details()["incomplete_rules"] list "llm.$name: reason", and evaluation_complete/allowed/clean stay False. Runtime failures of checks that ran still raise NovaEvaluationError with partial results. This matches the SDK's existing rule that a missing LLM key must not block keyword-only use. - The SDK logs one nova.decision warning when typed rules load while Decision is disabled; the CLI adds a --decision hint and incomplete_rules to JSON, and still exits 1. - Policy and global callbacks run only after the result is final, never for a scan that raises. - protect(): a param_name the function lacks raises NovaConfigError at decoration time; **kwargs functions are scanned (and redacted) through that keyword; incomplete scans raise with the specific unresolved checks as causes. - SDK loader: if strict boundary detection fails, split at rule declarations so a malformed rule no longer hides its valid siblings under ignore_invalid_rules; stray non-comment text is still reported. - Docs and CHANGELOG describe the contract and list breaking changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wheel smoke script still asserted the previous contract, where a disabled required check raised NovaEvaluationError. Assert the scoped behaviour instead: the scan returns with the rule in incomplete_rules and allowed/clean/evaluation_complete False. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @marcopedrinazzi, this is a great contribution. Before merging, I tested the new parser on 281 real 1. Parser: no changes needed 2. Narrower fail-closed (the one design change)
This follows the existing SDK rule that a missing LLM key must not block keyword-only use. If you see a case where it's too lenient, let's discuss. 3. Smaller fixes
4. Restored 5. Docs
Tests: 351 passed (was 318). The build, artifact verification and wheel smoke test all pass locally and in CI. Commits: |
|
Below my latest fixes: Correct the CLI exit status with When the first rule is keyword-only and a later rule uses typed
Handle incomplete scans in SDK examples and debug output When a required Decision check is disabled or skipped, The example now checks Respect the A low-severity keyword match with a The SDK now checks the decorator’s severity threshold before stopping early. A |
Summary
Adds
noul,choice, andscoredeclarations underllm:, alongside existing quoted LLM checks. Quoted checks use the configured LLM provider; typed questions use a decision model through OpenRouter Decisions or Ollama.Changes
noulfor yes/no judgments,choicefor categories, andscorefor ordered levels. Declaration settings turn answers into predicates referenced asllm.$namein conditions.NovaEvaluationError; SDK results cannot report them as clean or allowed.BLOCKskips remaining model calls.@nova.protect()to scan default argument values and bound-method arguments, apply rules added after decoration, and respectskip_decision.Existing quoted LLM syntax remains supported, including its parenthesized model temperature.
Updated setup.py and requirements.txt to require sentence-transformers~=5.6.0, the fixed version listed in the advisory (https://osv.dev/vulnerability/PYSEC-2026-4164)