Skip to content

Document policy runtime and add enforce-mode example#253

Open
gut-puncture wants to merge 5 commits into
google-deepmind:mainfrom
gut-puncture:codex/policy-runtime-v2-docs-example
Open

Document policy runtime and add enforce-mode example#253
gut-puncture wants to merge 5 commits into
google-deepmind:mainfrom
gut-puncture:codex/policy-runtime-v2-docs-example

Conversation

@gut-puncture

Copy link
Copy Markdown
Contributor

Summary

This PR finalizes the policy-runtime v2 surface with docs, a runnable example, and small API-surface hardening.

Changes:

  • expands concordia/document/README.md with:
    • policy lifecycle
    • observe vs enforce semantics
    • malformed-policy behavior
    • policy tag documentation
    • schema helper usage
  • adds deterministic example:
    • examples/tool_policy_example.py
    • demonstrates schema denial + risk-policy denial in enforce mode
  • adds constructor validation hardening in InteractiveDocumentWithTools:
    • max_tool_calls_per_question >= 1
    • max_tool_result_length >= 3
    • explicit validation error messages
  • adds tests for new constructor validation paths

This branch is independently mergeable from main, so it includes the runtime and schema helper foundations.

Why

This makes the feature reviewer-friendly and production-usable: semantics are clearly documented, example is runnable, and key input contracts are explicit.

Validation

Executed locally:

  • . .venv/bin/activate && python -m pytest -q concordia/document/tool_policy_test.py
  • . .venv/bin/activate && python -m pytest -q concordia/document/interactive_document_tools_test.py
  • . .venv/bin/activate && python -m pytest -q concordia/document
  • . .venv/bin/activate && python -m pylint --errors-only on touched files
  • . .venv/bin/activate && PYTHONPATH=. python examples/tool_policy_example.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant