feat(guardrails): implement Plan Generation Pre-flight Guardrails (7 checks before execution) #644

Merged
freemo merged 1 commits from feature/m5-plan-preflight-guardrails into master 2026-03-08 22:37:05 +00:00

1 Commits

Author SHA1 Message Date
freemo a44082ab70 feat(guardrails): implement Plan Generation Pre-flight Guardrails (7 checks before execution)
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 20s
CI / security (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 36s
CI / unit_tests (pull_request) Successful in 2m8s
CI / docker (pull_request) Successful in 38s
CI / integration_tests (pull_request) Successful in 3m8s
CI / coverage (pull_request) Successful in 4m43s
CI / quality (push) Successful in 17s
CI / lint (push) Successful in 21s
CI / build (push) Successful in 24s
CI / security (push) Successful in 54s
CI / typecheck (push) Successful in 1m13s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m25s
CI / docker (push) Successful in 39s
CI / integration_tests (push) Successful in 3m38s
CI / coverage (push) Successful in 4m32s
CI / benchmark-publish (push) Successful in 16m58s
CI / benchmark-regression (pull_request) Successful in 29m51s
Implement spec-mandated pre-flight guardrail checks that validate plan
readiness before entering the Strategize phase:

1. Action schema validation — verifies action exists and is well-formed.
2. Actor availability — confirms all 4 actor roles registered.
3. Skill/tool existence — transitively resolves all tools/skills.
4. Automation policy — verifies profile permits execution.
5. Rollback feasibility — ensures all tools checkpointable if required.
6. Resource accessibility — shallow connectivity check on linked resources.
7. Validation attachment resolution — pre-resolves all applicable validations.

PlanPreflightGuardrail service runs all 7 checks via run_all_checks().
On first failure, raises PreflightRejection with check name and message.
Wired into plan_lifecycle_service before Strategize phase.

Behave BDD: 18 scenarios covering all 7 checks (positive + negative).
Robot Framework: 3 integration smoke tests.
ASV benchmarks: pre-flight check execution time.

ISSUES CLOSED: #582
2026-03-08 22:31:40 +00:00