Skip to content

test: add automated test coverage for bundles and policy edge cases (closes #2) - #69

Open
ghzhost wants to merge 1 commit into
forthfate:mainfrom
ghzhost:test/beginner-friendly-coverage
Open

ghzhost wants to merge 1 commit into
forthfate:mainfrom
ghzhost:test/beginner-friendly-coverage

Conversation

@ghzhost

@ghzhost ghzhost commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #2.

Adds deterministic automated test coverage in tests/test_behaviors_extended.py covering key bundle loading, strict prompt template validation, source catalog action filtering, and improvement policy gate lifecycle edge cases.

Changes

  • test_load_bundle_unknown_raises_value_error: verifies that attempting to load a non-existent behavior bundle raises ValueError.
  • test_render_prompt_unknown_prompt_id_raises_value_error: validates that referencing an undefined prompt name in a bundle raises ValueError.
  • test_render_prompt_extra_variables_raises_value_error: ensures strict template rendering rejects extraneous parameters.
  • test_source_catalog_rejects_empty_or_unmatched_targets: verifies actions with unauthorized/unmatched targets are rejected.
  • test_improvement_policy_reverts_on_insufficient_scores_after_gate_limit: verifies failing candidate exhaustion triggers revert.
  • test_improvement_policy_continues_when_insufficient_before_limit: verifies candidate remains in isolation when gate count is below limit.

Verification

  • PYTHONPATH=backend:. uv run pytest -q passes (80 passed).
  • uv run ruff check orbit/ backend/ tests/ passes cleanly.
  • Tests are fully deterministic and require no external credentials or network access.

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.

Add beginner-friendly automated test coverage

1 participant