modified: activity_yaml_validator.py

modified:   app.py
	modified:   research/activity29-battleship.yaml
	modified:   research/activity29-testship.yaml
	modified:   research/guarded_ai.py
	modified:   tests/functional/test_activity_flows.py
	modified:   tests/functional/test_battleship_pre_script.py
	modified:   tests/functional/test_guarded_ai.py
	modified:   tests/unit/test_activity_yaml_validator.py
	modified:   tests/unit/test_app_feedback.py
	modified:   tests/unit/test_guarded_ai.py
This commit is contained in:
Russell Ballestrini 2025-08-11 12:39:42 -04:00
parent d4d697db59
commit f90df2ae57
11 changed files with 573 additions and 286 deletions

View file

@ -244,7 +244,9 @@ class ActivityYAMLValidator:
# Validate feedback_prompts (new multi-prompt system)
if "feedback_prompts" in step:
self._validate_feedback_prompts(step["feedback_prompts"], section_id, step_id)
self._validate_feedback_prompts(
step["feedback_prompts"], section_id, step_id
)
# Validate buckets and transitions
if "buckets" in step:
@ -255,7 +257,9 @@ class ActivityYAMLValidator:
step["transitions"], step.get("buckets", []), section_id, step_id
)
def _validate_feedback_prompts(self, feedback_prompts: List[Dict[str, Any]], section_id: str, step_id: str):
def _validate_feedback_prompts(
self, feedback_prompts: List[Dict[str, Any]], section_id: str, step_id: str
):
"""Validate feedback_prompts structure"""
if not isinstance(feedback_prompts, list):
self.errors.append(
@ -308,7 +312,7 @@ class ActivityYAMLValidator:
elif "STFU" in prompt["tokens_for_ai"]:
# This is valid - STFU token is used to suppress empty feedback messages
pass
# Validate metadata_filter (optional)
if "metadata_filter" in prompt:
if not isinstance(prompt["metadata_filter"], list):