diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 665b754..554642c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,9 @@ jobs: - name: Run ruff format check run: uv run ruff format --check + - name: Run ruff check + run: uv run ruff check --output-format github + - name: Run ty type checker run: uv run ty check --exclude "examples/**" --exclude "test/**" src/ diff --git a/docs/control/reference/rest_api/headers/security_config.md b/docs/control/reference/rest_api/headers/security_config.md index ea1868b..2de04fd 100644 --- a/docs/control/reference/rest_api/headers/security_config.md +++ b/docs/control/reference/rest_api/headers/security_config.md @@ -200,9 +200,9 @@ Maximum number of tool calls allowed per PLLM attempt. If `null`, no limit is en | Type | Required | Default | |------|----------|---------| -| `boolean` or `null` | No | `null` | +| `"none"`, `"bool"`, `"text"`, `boolean`, or `null` | No | `null` | -Whether to paraphrase RLLM output via reduced grammar before feeding back to planning LLM. When not set, the server default is `true`. +Whether to paraphrase RLLM output via reduced grammar before feeding back to planning LLM. `"none"` denotes passing original review to PLLM; `"bool"` denotes only keeping boolean flags (success/failure); `"text"` denotes applying reduced grammar to reviews. `true` is an alias for `"text"`, `false` is an alias for `"none"`. When not set, the server default is `"text"`. #### `fsm.retry_on_policy_violation` diff --git a/justfile b/justfile index 2b8e695..3080ff4 100644 --- a/justfile +++ b/justfile @@ -15,6 +15,7 @@ format: lint: uv run ruff format --check + uv run ruff check uv run ty check --exclude "examples/**" --exclude "test/**" src/ sync-all: diff --git a/src/sequrity/control/types/headers.py b/src/sequrity/control/types/headers.py index 8e53cc6..a631373 100644 --- a/src/sequrity/control/types/headers.py +++ b/src/sequrity/control/types/headers.py @@ -436,9 +436,9 @@ class FsmOverrides(BaseModel): default=None, description="Maximum number of tool calls allowed per PLLM attempt. If None, no limit is enforced.", ) - reduced_grammar_for_rllm_review: bool | None = Field( + reduced_grammar_for_rllm_review: Literal["none", "bool", "text"] | bool | None = Field( default=None, - description="Whether to paraphrase RLLM output via reduced grammar before feeding back to planning LLM.", + description="Whether to paraphrase RLLM output via reduced grammar before feeding back to planning LLM. 'none' denotes passing original review to PLLM; 'bool' denotes only keeping boolean flags (success/failure); 'text' denotes applying reduced grammar to reviews; True is an alias for 'text', False is an alias for 'none'.", ) retry_on_policy_violation: bool | None = Field( default=None, diff --git a/test/control/test_langgraph.py b/test/control/test_langgraph.py index 196996f..cb1dc3d 100644 --- a/test/control/test_langgraph.py +++ b/test/control/test_langgraph.py @@ -1,4 +1,4 @@ -from typing import Literal, TypedDict +from typing import TypedDict import pytest @@ -9,7 +9,7 @@ from sequrity_unittest.config import get_test_config try: - from langgraph.graph import StateGraph + from langgraph.graph import StateGraph # noqa: F401 LANGGRAPH_AVAILABLE = True except ImportError: diff --git a/test/control/test_parser.py b/test/control/test_parser.py index ccc812d..44e3f5c 100644 --- a/test/control/test_parser.py +++ b/test/control/test_parser.py @@ -11,7 +11,6 @@ ParseResult, SqrtParseError, check, - check_file, parse, validate, ) diff --git a/test/control/test_policy_gen.py b/test/control/test_policy_gen.py index d1cd98a..d544c66 100644 --- a/test/control/test_policy_gen.py +++ b/test/control/test_policy_gen.py @@ -5,8 +5,6 @@ which generates SQRT security policies from natural language descriptions. """ -import pytest - from sequrity import LlmServiceProvider, SequrityClient from sequrity.control._constants import build_policy_gen_url from sequrity.control.types.policy_gen import ( @@ -14,7 +12,6 @@ PolicyGenRequestOpenAiChatCompletion, PolicyGenRequestOpenRouterChatCompletion, PolicyGenRequestSequrityAzureChatCompletion, - PolicyGenRequestSequrityAzureResponses, PolicyGenResponse, ) from sequrity_unittest.config import get_test_config diff --git a/test/integrations/test_langgraph_integration.py b/test/integrations/test_langgraph_integration.py index 95e6fe3..9249747 100644 --- a/test/integrations/test_langgraph_integration.py +++ b/test/integrations/test_langgraph_integration.py @@ -69,8 +69,6 @@ async def test_session_tracking(self): # Verify session ID was captured assert llm.session_id is not None - first_session_id = llm.session_id - # Second request - should use the same session response2 = await llm.ainvoke([HumanMessage(content="What did I just say?")]) diff --git a/test/integrations/test_openai_agents_sdk.py b/test/integrations/test_openai_agents_sdk.py index c58140c..3056d92 100644 --- a/test/integrations/test_openai_agents_sdk.py +++ b/test/integrations/test_openai_agents_sdk.py @@ -111,8 +111,6 @@ async def test_session_tracking(self): # Verify session ID was captured assert client.session_id is not None - first_session_id = client.session_id - # Second request - should use the same session result2 = await Runner.run( agent,