Orchestrata Ultimate / Specs / 035-verification

035-verification: Verification Agent (U:Vfy)

The Verification Agent (U:Vfy) is a Prolog-guided constraint verification system. It validates whether agent solutions satisfy requirements through a multi-tier architecture involving Execution Agents, Supervisor Agents, and the Verification Agent, with Prolog serving as the immutable source of truth.

At a glance

Item Value
Spec directory specs/035-verification/
Status line in the spec Complete
Requirement IDs defined 230
With a @traces citation in src/ 188 (81.7%)
With a @traces citation in tests/ 8 (3.5%)
Tracked files 10
RTM page 035-verification

Reading this spec

The Verification Agent (U:Vfy) is a Prolog-guided constraint verification system. It validates whether agent solutions satisfy requirements through three tiers: Execution Agents implement and iterate, Supervisor Agents generate proofs and audit, and the Verification Agent validates reasoning and edge cases. Prolog is the final arbiter, returning SATISFIED or NOT_MET.

The scope is eleven user stories: requirements capture, execution agent implementation, supervisor oversight, verification agent validation, Prolog verification, the verification loop and security and safety constraints (critical), failure handling and escalation, integration with the Intent Broker and performance constraints (high), and session state management (medium). Requirement IDs use the REQ-035- prefix.

The spec states seven key principles. Prolog is the source of truth and its decisions cannot be overridden. Constraints are immutable: the agent adapts its solution to the constraints, not the reverse. Verification follows a TDD approach, beginning with failing tests and iterating until satisfied. The retry limit is immutable: after 5 failed attempts the case goes to human review. U:Vfy runs concurrently with the Execution Agent. A mathematical proof is required when a constraint is claimed unsatisfiable. The hierarchy is Execution, then Supervisor, then U:Vfy.

In the code, the largest tracers are orchestrata_ultimate/verification/types, orchestrata_ultimate/orchestrator/verification_gate, orchestrata_ultimate/verification/session/verification_session, orchestrata_ultimate/verification/requirements/requirements_parser and orchestrata_ultimate/verification/proofs/verifier. The per-requirement view is on the RTM page.

The spec's status line reads Complete. It tracks 10 files and defines 230 requirement IDs. The full text follows below.

Measured coverage is 188 of 230 requirements cited by at least one @traces in src/ (81.7%), spread over 33 modules; the module citing the most of them is orchestrata_ultimate/orchestrator/verification_gate (25 requirements). In tests/, 8 requirements are cited by a test-side @traces.

Coverage gaps: 42 requirements have no citing symbol. The largest untraced groups are REQ-035-US-011 (15), REQ-035-US-010 (14), REQ-035-US-003 (4). Untraced means no @traces names the ID; the behaviour may still exist in code that was never annotated. Test-side citations are thinner than code-side ones (8 against 188).

Requirements

Checkbox is the state recorded in the requirements checklist; Traced by is the count of src/ symbols whose @traces names the ID.

ID Done Requirement Traced by
REQ-035-US-001-001 yes Parse simple requirement statements ("create a file named test.py") 14
REQ-035-US-001-002 yes Parse compound requirements ("read config.yaml and update database") 1
REQ-035-US-001-003 yes Extract action verbs (create, read, update, delete, execute) 1
REQ-035-US-001-004 yes Extract target nouns (file, database, api, system) 1
REQ-035-US-001-005 yes Identify constraints (permissions, limits, conditions) 2
REQ-035-US-001-006 yes Handle ambiguous requirements with clarification questions 1
REQ-035-US-001-007 yes Support multi-language input (English primary) none
REQ-035-US-001-008 yes Generate valid Prolog predicates from requirements 2
REQ-035-US-001-009 yes Validate generated Prolog syntax 2
REQ-035-US-001-010 yes Store constraints for session persistence 7
REQ-035-US-001-011 yes Create RequirementsParser class 1
REQ-035-US-001-012 yes Implement NLP parsing for requirements 1
REQ-035-US-001-013 yes Create action verb dictionary (CREATE, READ, UPDATE, DELETE, EXECUTE, VALIDATE) 1
REQ-035-US-001-014 yes Create target noun dictionary (FILE, DATABASE, API, SYSTEM, SERVICE) 1
REQ-035-US-001-015 yes Implement constraint extraction using pattern matching 4
REQ-035-US-001-016 yes Create Prolog predicate generator 1
REQ-035-US-001-017 yes Implement Prolog syntax validator 2
REQ-035-US-001-018 yes Create constraint storage backend (Redis) 2
REQ-035-US-001-019 yes Add requirement session management none
REQ-035-US-001-020 yes Implement requirement versioning none
REQ-035-US-001-021 yes Unit test: Parse "create file test.py" → constraint(file_exists, ['test.py']) 1
REQ-035-US-001-022 yes Unit test: Parse "API must respond in 200ms" → constraint(response_time_max, [200]) 1
REQ-035-US-001-023 yes Integration test: Parse complex requirement generates valid Prolog 3
REQ-035-US-001-024 yes Performance test: Parse 100 requirements in <500ms average 1
REQ-035-US-002-001 yes Define functional constraints (file exists, API responds) 3
REQ-035-US-002-002 yes Define quality constraints (test coverage, documentation) 2
REQ-035-US-002-003 yes Define performance constraints (response time, throughput) 2
REQ-035-US-002-004 yes Define security constraints (no vulnerabilities, authentication) 2
REQ-035-US-002-005 yes Support constraint priorities (required vs. optional) 2
REQ-035-US-002-006 yes Support constraint dependencies (A must satisfy before B) 2
REQ-035-US-002-007 yes Support constraint groups (AND/OR logic) 1
REQ-035-US-002-008 yes Validate constraint syntax before activation 3
REQ-035-US-002-009 yes Persist constraint definitions 2
REQ-035-US-002-010 yes Create constraint definition schema 2
REQ-035-US-002-011 yes Implement constraint parser (YAML/JSON → Prolog) 2
REQ-035-US-002-012 yes Create constraint priority system 1
REQ-035-US-002-013 yes Implement constraint dependency resolution 2
REQ-035-US-002-014 yes Create constraint validation rules 3
REQ-035-US-002-015 yes Implement constraint persistence 2
REQ-035-US-002-016 yes Add constraint versioning none
REQ-035-US-002-017 yes Create constraint import/export 6
REQ-035-US-002-018 yes Unit test: Constraint with all fields validates 1
REQ-035-US-002-019 yes Unit test: Invalid constraint syntax rejected 2
REQ-035-US-002-020 yes Unit test: Priority ordering works correctly 1
REQ-035-US-002-021 yes Integration test: Constraint dependencies resolve correctly 2
REQ-035-US-002-022 yes Integration test: Constraint persistence works 2
REQ-035-US-003-001 yes Evaluate single constraint satisfaction 11
REQ-035-US-003-002 yes Evaluate all constraints (AND logic) 2
REQ-035-US-003-003 yes Evaluate constraint groups (OR logic) none
REQ-035-US-003-004 yes Handle constraint dependencies correctly 2
REQ-035-US-003-005 yes Return specific failure reasons 7
REQ-035-US-003-006 yes Cache evaluation results 1
REQ-035-US-003-007 yes Support partial satisfaction 2
REQ-035-US-003-008 yes Handle constraint timeouts none
REQ-035-US-003-009 yes Log evaluation results 2
REQ-035-US-003-010 yes Support evaluation replay 1
REQ-035-US-003-011 yes Create constraint evaluator 2
REQ-035-US-003-012 yes Implement evaluation result aggregation 1
REQ-035-US-003-013 yes Add result caching (Redis) 2
REQ-035-US-003-014 yes Create failure reason generator 3
REQ-035-US-003-015 yes Implement timeout handling none
REQ-035-US-003-016 yes Add evaluation logging 2
REQ-035-US-003-017 yes Create evaluation replay mechanism 1
REQ-035-US-003-018 yes Unit test: Satisfied constraint returns SATISFIED 1
REQ-035-US-003-019 yes Unit test: Failed constraint returns NOT_MET with reason 2
REQ-035-US-003-020 yes Unit test: Multiple constraints aggregate correctly 1
REQ-035-US-003-021 yes Integration test: Evaluation with timeouts works none
REQ-035-US-003-022 yes Integration test: Caching improves performance 1
REQ-035-US-004-001 yes Define 5 standard checkpoints (implementation, tests, integration, docs, final) 3
REQ-035-US-004-002 yes Verify at each checkpoint 6
REQ-035-US-004-003 yes Support custom checkpoint definitions 2
REQ-035-US-004-004 yes Track checkpoint progress 4
REQ-035-US-004-005 yes Allow checkpoint skipping (with approval) 1
REQ-035-US-004-006 yes Provide checkpoint-specific feedback 4
REQ-035-US-004-007 yes Support checkpoint rollback 2
REQ-035-US-004-008 yes Maintain checkpoint history 2
REQ-035-US-004-009 yes Allow concurrent verification at checkpoints 3
REQ-035-US-004-010 yes Create checkpoint definitions 2
REQ-035-US-004-011 yes Implement checkpoint verification logic 4
REQ-035-US-004-012 yes Create checkpoint progress tracker 2
REQ-035-US-004-013 yes Add checkpoint history storage none
REQ-035-US-004-014 yes Implement concurrent verification 2
REQ-035-US-004-015 yes Create custom checkpoint API 1
REQ-035-US-004-016 yes Add checkpoint rollback support 2
REQ-035-US-004-017 yes Unit test: Checkpoint criteria evaluate correctly 2
REQ-035-US-004-018 yes Unit test: Checkpoint progress tracking works 2
REQ-035-US-004-019 yes Integration test: Full checkpoint sequence passes 2
REQ-035-US-004-020 yes Integration test: Concurrent verification works 4
REQ-035-US-004-021 yes Performance test: 5 checkpoints in <5 seconds 3
REQ-035-US-005-001 yes Support Claude Opus 4 for verification 6
REQ-035-US-005-002 yes Support Deepseek R1 for verification 5
REQ-035-US-005-003 yes Support Qwen Max for verification 5
REQ-035-US-005-004 yes Support Grok4 MiniMax for verification 5
REQ-035-US-005-005 yes Select appropriate model based on task 6
REQ-035-US-005-006 yes Handle model unavailability gracefully 6
REQ-035-US-005-007 yes Maintain verification consistency across models 4
REQ-035-US-005-008 yes Track model usage for metrics 1
REQ-035-US-005-009 yes Support model fallback chain 6
REQ-035-US-005-010 yes Create model abstraction layer 2
REQ-035-US-005-011 yes Implement Opus integration 6
REQ-035-US-005-012 yes Implement Deepseek R1 integration 5
REQ-035-US-005-013 yes Implement Qwen Max integration 5
REQ-035-US-005-014 yes Implement Grok4 MiniMax integration 5
REQ-035-US-005-015 yes Create model selection logic 2
REQ-035-US-005-016 yes Add fallback handling 5
REQ-035-US-005-017 yes Implement usage tracking 1
REQ-035-US-005-018 yes Create cost optimization 1
REQ-035-US-005-019 yes Unit test: Model abstraction works 2
REQ-035-US-005-020 yes Unit test: Fallback triggers correctly 3
REQ-035-US-005-021 yes Integration test: All models respond correctly 8
REQ-035-US-005-022 yes Integration test: Verification consistent across models 3
REQ-035-US-005-023 yes Performance test: Model response times acceptable 4
REQ-035-US-006-001 yes Identify common edge cases for task type 3
REQ-035-US-006-002 yes Verify edge cases are tested 2
REQ-035-US-006-003 yes Suggest edge cases to test 1
REQ-035-US-006-004 yes Detect untested edge cases 1
REQ-035-US-006-005 yes Categorize edge cases by severity 3
REQ-035-US-006-006 yes Track edge case coverage 5
REQ-035-US-006-007 yes Provide edge case examples 3
REQ-035-US-006-008 yes Support custom edge case definitions 4
REQ-035-US-006-009 yes Create edge case database 2
REQ-035-US-006-010 yes Implement edge case detection 5
REQ-035-US-006-011 yes Create edge case suggestion engine none
REQ-035-US-006-012 yes Add edge case coverage tracking 3
REQ-035-US-006-013 yes Implement edge case severity scoring 1
REQ-035-US-006-014 yes Create edge case reporting 7
REQ-035-US-006-015 yes Unit test: Edge cases identified for task none
REQ-035-US-006-016 yes Unit test: Edge case coverage calculated 1
REQ-035-US-006-017 yes Integration test: Edge case suggestions improve coverage none
REQ-035-US-006-018 yes Integration test: Edge case tracking works 1
REQ-035-US-007-001 yes Accept exhaustive search proofs 1
REQ-035-US-007-002 yes Accept logical deduction proofs 1
REQ-035-US-007-003 yes Accept mathematical proofs 1
REQ-035-US-007-004 yes Accept practical explanations 1
REQ-035-US-007-005 yes Verify proof completeness 1
REQ-035-US-007-006 yes Verify proof soundness 1
REQ-035-US-007-007 yes Verify alternatives exhausted 1
REQ-035-US-007-008 yes Reject invalid proofs 2
REQ-035-US-007-009 yes Request additional proof if needed 10
REQ-035-US-007-010 yes Create proof type handlers 1
REQ-035-US-007-011 yes Implement exhaustive search verification 1
REQ-035-US-007-012 yes Implement logical deduction verification 2
REQ-035-US-007-013 yes Implement mathematical proof verification 2
REQ-035-US-007-014 yes Implement practical explanation verification 2
REQ-035-US-007-015 yes Create proof evaluation criteria 1
REQ-035-US-007-016 yes Add proof rejection handling 2
REQ-035-US-007-017 yes Implement proof appeal process 4
REQ-035-US-007-018 yes Unit test: Valid exhaustive proof accepted 1
REQ-035-US-007-019 yes Unit test: Invalid proof rejected 1
REQ-035-US-007-020 yes Integration test: Full proof workflow works 5
REQ-035-US-007-021 yes Integration test: Proof appeal process works 2
REQ-035-US-008-001 yes Track verification attempts 3
REQ-035-US-008-002 yes Enforce max attempts (5) 3
REQ-035-US-008-003 yes Provide feedback after each attempt 4
REQ-035-US-008-004 yes Support automatic retry 4
REQ-035-US-008-005 yes Support manual intervention 6
REQ-035-US-008-006 yes Escalate after max attempts 4
REQ-035-US-008-007 yes Track attempt history 1
REQ-035-US-008-008 yes Support attempt reset 1
REQ-035-US-008-009 yes Log all attempts 2
REQ-035-US-008-010 yes Create attempt tracking system 1
REQ-035-US-008-011 yes Implement max attempt enforcement 2
REQ-035-US-008-012 yes Create feedback generation 3
REQ-035-US-008-013 yes Add automatic retry support 2
REQ-035-US-008-014 yes Implement escalation handler 2
REQ-035-US-008-015 yes Create attempt history storage none
REQ-035-US-008-016 yes Add attempt reset functionality 1
REQ-035-US-008-017 yes Implement attempt logging 2
REQ-035-US-008-018 yes Unit test: Max attempts enforced 1
REQ-035-US-008-019 yes Unit test: Feedback generated correctly 2
REQ-035-US-008-020 yes Integration test: Full retry loop works 2
REQ-035-US-008-021 yes Integration test: Escalation triggers correctly 2
REQ-035-US-009-001 yes Receive intents from Intent Broker 5
REQ-035-US-009-002 yes Extract constraints from intents 5
REQ-035-US-009-003 yes Generate verification requirements from intents 4
REQ-035-US-009-004 yes Return verification results to Intent Broker 14
REQ-035-US-009-005 yes Support intent lifecycle integration 3
REQ-035-US-009-006 yes Track verification history per intent 2
REQ-035-US-009-007 yes Support intent replay with verification 2
REQ-035-US-009-008 yes Coordinate with Prolog validation 2
REQ-035-US-009-009 yes Create Intent Broker integration API 2
REQ-035-US-009-010 yes Implement intent constraint extraction 5
REQ-035-US-009-011 yes Create result forwarding 4
REQ-035-US-009-012 yes Add lifecycle coordination 2
REQ-035-US-009-013 yes Implement history tracking 2
REQ-035-US-009-014 yes Create replay support 2
REQ-035-US-009-015 yes Unit test: Intent parsing works 2
REQ-035-US-009-016 yes Unit test: Constraint extraction works 2
REQ-035-US-009-017 yes Integration test: Full integration with Intent Broker 1
REQ-035-US-009-018 yes Integration test: Intent replay works 2
REQ-035-US-010-001 yes Detect hardcoded secrets none
REQ-035-US-010-002 yes Detect SQL injection vulnerabilities none
REQ-035-US-010-003 yes Detect XSS vulnerabilities none
REQ-035-US-010-004 yes Verify authentication implementation 2
REQ-035-US-010-005 yes Verify authorization implementation 2
REQ-035-US-010-006 yes Check dependency vulnerabilities none
REQ-035-US-010-007 yes Verify encryption usage none
REQ-035-US-010-008 yes Check compliance requirements 1
REQ-035-US-010-009 yes Support custom security rules 2
REQ-035-US-010-010 yes Create security constraint library 2
REQ-035-US-010-011 yes Implement secret detection none
REQ-035-US-010-012 yes Implement vulnerability scanning none
REQ-035-US-010-013 yes Create authentication verifier none
REQ-035-US-010-014 yes Create authorization verifier none
REQ-035-US-010-015 yes Add dependency auditing none
REQ-035-US-010-016 yes Implement compliance checking none
REQ-035-US-010-017 yes Create custom rule support 1
REQ-035-US-010-018 yes Unit test: Secret detection works none
REQ-035-US-010-019 yes Unit test: Vulnerability detection works none
REQ-035-US-010-020 yes Integration test: Security scan completes none
REQ-035-US-010-021 yes Integration test: Custom rules work 1
REQ-035-US-011-001 yes Measure response time none
REQ-035-US-011-002 yes Measure throughput none
REQ-035-US-011-003 yes Measure memory usage none
REQ-035-US-011-004 yes Measure cold start time none
REQ-035-US-011-005 yes Support benchmark execution none
REQ-035-US-011-006 yes Support performance profiling none
REQ-035-US-011-007 yes Handle performance variability none
REQ-035-US-011-008 yes Support percentile requirements none
REQ-035-US-011-009 yes Generate performance reports 2
REQ-035-US-011-010 yes Create performance constraint library 2
REQ-035-US-011-011 yes Implement benchmarking none
REQ-035-US-011-012 yes Create profiling support none
REQ-035-US-011-013 yes Add statistical analysis none
REQ-035-US-011-014 yes Implement variability handling none
REQ-035-US-011-015 yes Create report generation 2
REQ-035-US-011-016 yes Unit test: Response time measurement works none
REQ-035-US-011-017 yes Unit test: Throughput measurement works none
REQ-035-US-011-018 yes Integration test: Performance report generated 2
REQ-035-US-011-019 yes Performance test: Measurements accurate none

Code that traces this spec

Module Symbols Requirements
orchestrata_ultimate/knowledge_graph/temporal 1 2
orchestrata_ultimate/orchestrator/pipeline_runner 1 2
orchestrata_ultimate/orchestrator/verification_gate 17 25
orchestrata_ultimate/verification/agents/execution_agent 1 1
orchestrata_ultimate/verification/agents/supervisor_agent 4 4
orchestrata_ultimate/verification/agents/verification_agent 6 6
orchestrata_ultimate/verification/checkpoints/concurrent 4 5
orchestrata_ultimate/verification/checkpoints/definitions 2 6
orchestrata_ultimate/verification/checkpoints/verifier 4 10
orchestrata_ultimate/verification/config/verification_config 2 1
orchestrata_ultimate/verification/constraints/definitions 4 7
orchestrata_ultimate/verification/constraints/evaluator 8 11
orchestrata_ultimate/verification/edge_cases/database 5 9
orchestrata_ultimate/verification/edge_cases/detector 24 12
orchestrata_ultimate/verification/escalation_handler 4 4
orchestrata_ultimate/verification/impossibility/handler 1 1
orchestrata_ultimate/verification/integrations/intent_broker 4 9
orchestrata_ultimate/verification/integrations/redis_manager 4 8
orchestrata_ultimate/verification/models/base_model 15 13
orchestrata_ultimate/verification/models/deepseek_r1 6 3
orchestrata_ultimate/verification/models/grok4_minimax 6 3
orchestrata_ultimate/verification/models/opus 6 3
orchestrata_ultimate/verification/models/qwen_max 6 3
orchestrata_ultimate/verification/orchestration/coordinator 16 14
orchestrata_ultimate/verification/proofs/verifier 6 15
orchestrata_ultimate/verification/protocols/verification_cxp 8 14
orchestrata_ultimate/verification/requirements/constraint_definitions 2 11
orchestrata_ultimate/verification/requirements/prolog_generator 4 9
orchestrata_ultimate/verification/requirements/requirements_parser 6 15
orchestrata_ultimate/verification/session/verification_session 8 18
orchestrata_ultimate/verification/types 25 25
orchestrata_ultimate/verification/verification/engine 2 4
orchestrata_ultimate/verification/verification/feedback 4 9

Checklists

checklists/implementation.md

Verification System Implementation Checklist

Spec: 035-verification
Component: U:Vfy (Verification Agent)
Status: Implementation Phase

Overview

This checklist tracks implementation tasks for the Verification System. Tasks are organized by component and include dependencies and estimated effort.


Phase 1: Core Infrastructure (Days 1-5)
Task Group 1.1: Project Setup
Task Group 1.2: Core Data Models
Task Group 1.3: Session Management
Task Group 1.4: Configuration

Phase 2: Requirements Capture (Days 6-10)
Task Group 2.1: Requirements Parser
Task Group 2.2: Prolog Generator
Task Group 2.3: Constraint Definition

Phase 3: Prolog Integration (Days 11-15)
Task Group 3.1: Prolog Rules
Task Group 3.2: Prolog Bridge Integration
Task Group 3.3: Constraint Evaluation

Phase 4: Checkpoint System (Days 16-20)
Task Group 4.1: Checkpoint Definitions
Task Group 4.2: Checkpoint Verification
Task Group 4.3: Concurrent Verification

Phase 5: Verification Agent (Days 21-25)
Task Group 5.1: Model Abstraction
Task Group 5.2: Verification Logic
Task Group 5.3: Verification API

Phase 6: Agent Protocols (Days 26-30)
Task Group 6.1: CXP Integration
Task Group 6.2: Agent Communication
Task Group 6.3: Orchestration

Phase 7: Edge Cases and Proofs (Days 31-35)
Task Group 7.1: Edge Case System
Task Group 7.2: Proof Verification
Task Group 7.3: Impossibility Handling

Phase 8: Integration (Days 36-40)
Task Group 8.1: Intent Broker Integration
Task Group 8.2: Redis Integration
Task Group 8.3: Testing Infrastructure

Phase 9: Documentation (Days 41-42)
Task Group 9.1: Code Documentation
Task Group 9.2: User Documentation

Phase 10: Testing (Days 43-45)
Task Group 10.1: Unit Tests
Task Group 10.2: Integration Tests
Task Group 10.3: Performance Tests

Implementation Files Structure
implementation/src/verification/
├── __init__.py
├── config/
│   ├── __init__.py
│   └── verification_config.py
├── models/
│   ├── __init__.py
│   └── verification_models.py
├── session/
│   ├── __init__.py
│   └── verification_session.py
├── requirements/
│   ├── __init__.py
│   ├── requirements_parser.py
│   ├── prolog_generator.py
│   └── constraint_definitions.py
├── constraints/
│   ├── __init__.py
│   ├── evaluator.py
│   ├── definitions.py
│   └── templates/
├── checkpoints/
│   ├── __init__.py
│   ├── definitions.py
│   ├── verifier.py
│   └── concurrent.py
├── models/
│   ├── __init__.py
│   ├── base_model.py
│   ├── opus.py
│   ├── deepseek_r1.py
│   ├── qwen_max.py
│   └── grok4_minimax.py
├── verification/
│   ├── __init__.py
│   ├── engine.py
│   └── feedback.py
├── edge_cases/
│   ├── __init__.py
│   ├── database.py
│   └── detector.py
├── proofs/
│   ├── __init__.py
│   └── verifier.py
├── impossibility/
│   ├── __init__.py
│   └── handler.py
├── agents/
│   ├── __init__.py
│   ├── execution_agent.py
│   ├── supervisor_agent.py
│   └── verification_agent.py
├── protocols/
│   ├── __init__.py
│   └── verification_cxp.py
├── orchestration/
│   ├── __init__.py
│   └── coordinator.py
├── integrations/
│   ├── __init__.py
│   ├── intent_broker.py
│   └── redis_manager.py
└── main.py

implementation/prolog/verification/
├── __init__.py
├── core_constraints.pl
├── quality_constraints.pl
├── performance_constraints.pl
├── security_constraints.pl
├── proof_verification.pl
└── checkpoint_rules.pl

implementation/tests/verification/
├── unit/
│   ├── test_models.py
│   ├── test_requirements.py
│   ├── test_constraints.py
│   ├── test_checkpoints.py
│   ├── test_verification.py
│   ├── test_proofs.py
│   └── test_agents.py
├── integration/
│   ├── test_prolog_integration.py
│   ├── test_redis_integration.py
│   ├── test_intent_broker_integration.py
│   └── test_full_workflow.py
└── conftest.py

Dependency Graph
Phase 1 (Core Infrastructure)
    │
    ├── Task Group 1.1: Project Setup
    ├── Task Group 1.2: Core Data Models
    │       │
    │       └── Required by: All other tasks
    │
    ├── Task Group 1.3: Session Management
    │       └── Requires: 1.2
    │
    └── Task Group 1.4: Configuration
            └── Required by: All other tasks

Phase 2 (Requirements Capture) requires Phase 1
    │
    ├── Task Group 2.1: Requirements Parser
    ├── Task Group 2.2: Prolog Generator
    │       └── Requires: 2.1
    │
    └── Task Group 2.3: Constraint Definition
            └── Requires: 2.2

Phase 3 (Prolog Integration) requires Phase 2
    │
    ├── Task Group 3.1: Prolog Rules
    ├── Task Group 3.2: Prolog Bridge Integration
    │       └── Requires: 3.1
    │
    └── Task Group 3.3: Constraint Evaluation
            └── Requires: 3.2

Phase 4 (Checkpoint System) requires Phase 3
    │
    ├── Task Group 4.1: Checkpoint Definitions
    ├── Task Group 4.2: Checkpoint Verification
    │       └── Requires: 4.1
    │
    └── Task Group 4.3: Concurrent Verification
            └── Requires: 4.2

Phase 5 (Verification Agent) can run in parallel with Phase 4
    │
    ├── Task Group 5.1: Model Abstraction
    ├── Task Group 5.2: Verification Logic
    │       └── Requires: 5.1
    │
    └── Task Group 5.3: Verification API
            └── Requires: 5.2

Phase 6 (Agent Protocols) requires Phase 5
    │
    ├── Task Group 6.1: CXP Integration
    ├── Task Group 6.2: Agent Communication
    │       └── Requires: 6.1
    │
    └── Task Group 6.3: Orchestration
            └── Requires: 6.2

Phase 7 (Edge Cases and Proofs) requires Phase 6
    │
    ├── Task Group 7.1: Edge Case System
    ├── Task Group 7.2: Proof Verification
    │       └── Requires: 5.1
    │
    └── Task Group 7.3: Impossibility Handling
            └── Requires: 7.2

Phase 8 (Integration) requires Phase 7
    │
    ├── Task Group 8.1: Intent Broker Integration
    ├── Task Group 8.2: Redis Integration
    │       └── Requires: 1.3
    │
    └── Task Group 8.3: Testing Infrastructure

Phase 9 (Documentation) can run in parallel

Phase 10 (Testing) requires Phase 8

Effort Estimation
Phase Tasks Estimated Days
Phase 1: Core Infrastructure 4 groups 5 days
Phase 2: Requirements Capture 3 groups 5 days
Phase 3: Prolog Integration 3 groups 5 days
Phase 4: Checkpoint System 3 groups 5 days
Phase 5: Verification Agent 3 groups 5 days
Phase 6: Agent Protocols 3 groups 5 days
Phase 7: Edge Cases and Proofs 3 groups 5 days
Phase 8: Integration 3 groups 5 days
Phase 9: Documentation 2 groups 2 days
Phase 10: Testing 3 groups 3 days
Total 30 groups 45 days

Success Criteria

checklists/requirements.md

The requirement list above comes from this file; 230 of 230 checkbox items are ticked.

checklists/testing.md

Verification System Testing Checklist

Spec: 035-verification
Component: U:Vfy (Verification Agent)
Status: Testing Phase

Overview

This checklist defines comprehensive testing requirements for the Verification System. All tests follow the no-mocking policy and use real implementations where possible.

Total Test Cases: 200+


Unit Tests (100+ tests)
Requirements Parser Tests (20 tests)

File: tests/unit/test_requirements_parser.py

Basic Parsing Tests
Constraint Extraction Tests
Prolog Generation Tests
Ambiguity Handling Tests

Constraint Evaluation Tests (20 tests)

File: tests/unit/test_constraint_evaluation.py

Single Constraint Tests
Multiple Constraint Tests
Result Generation Tests

Checkpoint Tests (20 tests)

File: tests/unit/test_checkpoints.py

Checkpoint Definition Tests
Checkpoint Progression Tests
Partial Success Tests

Verification Agent Tests (20 tests)

File: tests/unit/test_verification_agent.py

Model Integration Tests
Edge Case Detection Tests
Reasoning Verification Tests

Proof Verification Tests (20 tests)

File: tests/unit/test_proof_verification.py

Proof Type Tests
Proof Quality Tests
Proof Rejection Tests

Integration Tests (60+ tests)
Prolog Integration Tests (20 tests)

File: tests/integration/test_prolog_verification.py

Constraint Evaluation Integration
Proof Verification Integration

Redis Integration Tests (15 tests)

File: tests/integration/test_redis_verification.py

Session Management Integration
Caching Integration

Intent Broker Integration Tests (15 tests)

File: tests/integration/test_intent_broker_verification.py

Intent Processing Integration
Replay Integration

Full Workflow Tests (10 tests)

File: tests/integration/test_full_workflow.py

Complete Verification Workflow

Contract Tests (20 tests)
Message Format Tests (10 tests)

File: tests/contract/test_message_formats.py

CXP Message Tests
Response Format Tests
Schema Validation Tests (10 tests)

File: tests/contract/test_schemas.py

Constraint Schema Tests
Result Schema Tests

Performance Tests (20 tests)
Latency Tests (10 tests)

File: tests/performance/test_verification_latency.py

Constraint Evaluation Latency
Checkpoint Verification Latency
Throughput Tests (10 tests)

File: tests/performance/test_verification_throughput.py

Processing Throughput
Model Throughput

Security Tests (10 tests)

File: tests/security/test_verification_security.py

Input Validation Tests
Proof Security Tests

Edge Case Tests (20 tests)

File: tests/edge_cases/test_verification_edge_cases.py

Constraint Edge Cases
Verification Edge Cases
Agent Edge Cases

Test Infrastructure
Required Test Dependencies
Test Fixtures
CI/CD Integration

Test Summary
Test Category Test Count Priority
Unit Tests 100 P0
Integration Tests 60 P0
Contract Tests 20 P1
Performance Tests 20 P1
Security Tests 10 P0
Edge Case Tests 20 P1

Test Coverage Target: 95% line coverage, 90% branch coverage

Test Execution Time Target: <10 minutes for full suite

Test Stability Target: <1% flakiness rate


Running Tests
# Run all tests
uv run pytest tests/

# Run unit tests only
uv run pytest tests/unit/

# Run integration tests only
uv run pytest tests/integration/

# Run performance tests
uv run pytest tests/performance/ -v

# Run security tests
uv run pytest tests/security/ -v

# Run with coverage
uv run pytest tests/ --cov=src/verification --cov-report=html

# Run specific test file
uv run pytest tests/unit/test_requirements_parser.py -v

# Run specific test
uv run pytest tests/unit/test_requirements_parser.py::TestRequirementsParser::test_parse_simple_requirement -v

Test Data Examples
Example Constraint Set
sample_constraints = [
    constraint(
        id="func-001",
        type="functional",
        predicate="file_exists",
        args=["${WORKSPACE}/main.py"],
        priority=1,
        required=True
    ),
    constraint(
        id="qual-001",
        type="quality",
        predicate="test_coverage_percentage",
        args=[80],
        priority=2,
        required=True
    ),
    constraint(
        id="perf-001",
        type="performance",
        predicate="response_time_max_ms",
        args=["/api/users", 200],
        priority=3,
        required=False
    ),
]
Example Workflow
sample_workflow = {
    "workflow_id": "wf-001",
    "checkpoints": [
        {"name": "core_implementation", "order": 1},
        {"name": "unit_tests", "order": 2},
        {"name": "integration_tests", "order": 3},
        {"name": "documentation", "order": 4},
        {"name": "final_verification", "order": 5},
    ],
    "max_attempts": 5,
    "verification_model": "opus",
}

Summary

Total Test Cases: 200+

Test Category Test Count Coverage Target
Unit Tests 100 95%
Integration Tests 60 90%
Contract Tests 20 95%
Performance Tests 20 N/A
Security Tests 10 95%
Edge Case Tests 20 90%

Completion Progress: 0/200+ (0%)


Last Updated: 2026-01-15
Author: System Design
Status: Initial Specification

Other tracked files

Full spec text

Verbatim from specs/035-verification/spec.md; headings are pushed down two levels.

SPEC-035: Verification Agent (U:Vfy)

Metadata


Overview

What

The Verification Agent (U:Vfy) is a Prolog-guided constraint verification system. It validates whether agent solutions satisfy requirements through a multi-tier architecture involving Execution Agents, Supervisor Agents, and the Verification Agent, with Prolog serving as the immutable source of truth.

Why
How

Key Principles

  1. Prolog as Source of Truth: Prolog decisions are final and cannot be overridden
  2. Constraints are Immutable: Agent adapts solution to constraints, not vice versa
  3. TDD Approach: Verification begins with failing tests, iterates until satisfied
  4. Immutable Retry Limit: 5 failed attempts → human review
  5. Concurrent Verification: U:Vfy runs concurrently with Execution Agent
  6. Mathematical Proof Required: Proof needed when claiming constraint unsatisfiable
  7. Verification Hierarchy: Execution → Supervisor → U:Vfy

User Scenarios & Stories

US-001: Requirements Capture (Critical)

As a user I want to express requirements that become Prolog constraints So that the system can verify compliance

Acceptance Criteria:


US-002: Execution Agent Implementation (Critical)

As an Execution Agent I want to implement solutions satisfying constraints So that requirements are met

Acceptance Criteria:


US-003: Supervisor Agent Oversight (Critical)

As a Supervisor Agent I want to audit execution and generate proofs So that quality is ensured

Acceptance Criteria:


US-004: Verification Agent Validation (Critical)

As U:Vfy I want to validate reasoning and check edge cases So that solutions are correct

Acceptance Criteria:


US-005: Prolog Verification (Critical)

As the system I want to use Prolog as source of truth So that decisions are immutable

Acceptance Criteria:


US-006: Failure Handling and Escalation (High)

As the system I want to handle constraint failures So that issues are resolved or escalated

Acceptance Criteria:


US-007: Session State Management (Medium)

As the system I want to track verification session state So that progress is monitored

Acceptance Criteria:


US-008: Verification Loop Management (Critical)

As a system I want to manage the verification loop So that agents iterate until constraints are satisfied or max attempts reached

Acceptance Criteria:

(21 requirements: REQ-035-US-008-001 … REQ-035-US-008-021 — see checklists/requirements.md.)


US-009: Integration with Intent Broker (High)

As a system I want the verification system to integrate with the Intent Broker So that intents can be verified against requirements

Acceptance Criteria:

(18 requirements: REQ-035-US-009-001 … REQ-035-US-009-018 — see checklists/requirements.md.)


US-010: Security and Safety Constraints (Critical)

As a system I want to enforce security constraints So that verified solutions meet security requirements

Acceptance Criteria:

(21 requirements: REQ-035-US-010-001 … REQ-035-US-010-021 — see checklists/requirements.md.)


US-011: Performance Constraints (High)

As a system I want to enforce performance constraints So that verified solutions meet performance requirements

Acceptance Criteria:

(19 requirements: REQ-035-US-011-001 … REQ-035-US-011-019 — see checklists/requirements.md.)

Provenance (2026-08-19): US-008 … US-011 were fully defined in this spec's own checklists/requirements.md (79 requirements, all ticked) and implemented across 14 src/ and 3 tests/ files, but the four headings were missing here — so every one of those 79 ids cited a story that, per spec.md, did not exist. The titles, story statements and priorities above are taken verbatim from the checklist; the acceptance criteria summarise its requirement text. Nothing here was invented: the checklist is the authority, and this section was brought into agreement with it.


Functional Requirements

Verification Flow
User Intent → Requirements Capture → Generate Constraints → Execution Agent
                                                           ↓
                                     COMPLETE ← Prolog ← Verification
                                     ↑                      ↓
                                     Supervisor ← U:Vfy ← Execution
Checkpoint Milestones
  1. Core implementation complete
  2. Unit tests written
  3. Integration tests complete
  4. Documentation written
  5. Final comprehensive check
Constraint Types
% Functional constraints
api_exists('/users').
api_exists('/auth/login').
authentication_implemented('jwt').

% Quality constraints
tests_exist().
test_coverage_percentage(80).
documentation_exists().

% Performance constraints
response_time_max_ms(200).
Verification Agent Models
Model Strengths
Claude Opus 4 Complex reasoning, nuanced edge case detection
Deepseek R1 Mathematical rigor, formal verification
Qwen Max Multilingual verification, large context
Grok4 MiniMax Fast iterative verification, resource-efficient

Technical Design

Architecture
┌─────────────────────────────────────────────────────────────────┐
│  LAYER 1: INPUT & REQUIREMENTS                                   │
│  ┌─────────┐  ┌────────────────┐  ┌─────────────────────┐      │
│  │  USER   │  │ LLM INTERVIEW  │  │  PROLOG CONSTRAINT  │      │
│  │ INPUT   │──►   MODULE      │──►   GENERATOR        │      │
│  └─────────┘  └────────────────┘  └──────────┬──────────┘      │
└──────────────────────────────────────────────┼──────────────────┘
                                               │
                                               ▼
┌─────────────────────────────────────────────────────────────────┐
│  LAYER 2: AGENT COORDINATION                                     │
│  ┌─────────────────┐    ┌───────────────────┐    ┌────────────┐│
│  │ EXECUTION AGENT │◄──►│  SUPERVISOR AGENT │◄──►│ U:Vfy      ││
│  │ • Implements    │    │ • Proofs          │    │ • Edge cases│
│  │ • Iterates      │    │ • Audits          │    │ • Reasoning │
│  └────────┬────────┘    └─────────┬─────────┘    └──────┬─────┘│
│           │                       │                      │       │
└───────────┼───────────────────────┼──────────────────────┼───────┘
            │                       │                      │
            ▼                       ▼                      ▼
┌─────────────────────────────────────────────────────────────────┐
│  LAYER 3: VERIFICATION ENGINE                                    │
│  ┌───────────┐  ┌───────────┐  ┌───────────┐  ┌───────────┐    │
│  │ CONSTRAINT│  │   STATE   │  │   LOGIC   │  │   FINAL   │    │
│  │ PARSER    │──► VERIFIER │──►  CHECKER  │──► DECISION │    │
│  └───────────┘  └───────────┘  └───────────┘  └───────────┘    │
└─────────────────────────────────────────────────────────────────┘
CXP Constraint Definition Message
{
  "header": {
    "packet_id": "uuid",
    "type": "COMMAND",
    "sender": "U:Ox",
    "recipient": "ExecutionAgent",
    "subject": "constraint_verification_task",
    "thread_id": "session-uuid"
  },
  "payload": {
    "intent_id": "intent-uuid",
    "constraints": {
      "functional": [
        {"predicate": "api_exists", "args": ["/users"]},
        {"predicate": "authentication_implemented", "args": ["jwt"]}
      ],
      "quality": [
        {"predicate": "test_coverage", "args": [80]}
      ],
      "performance": [
        {"predicate": "response_time_max_ms", "args": [200]}
      ]
    },
    "checkpoint_milestones": ["core", "unit_tests", "integration", "docs", "final"],
    "max_attempts": 5,
    "verification_model": "opus"
  }
}
CXP Verification Result Message
{
  "header": {
    "type": "RESPONSE",
    "sender": "U:Vfy",
    "recipient": "Orchestrator",
    "subject": "verification_result"
  },
  "payload": {
    "intent_id": "intent-uuid",
    "checkpoint": "final_verification",
    "prolog_result": {
      "decision": "SATISFIED | NOT_MET",
      "satisfied_constraints": ["api_exists"],
      "failed_constraints": ["test_coverage"],
      "failure_reasons": {"test_coverage": "Expected 80%, actual 65%"}
    },
    "verification_agent_result": {
      "edge_cases_covered": true,
      "reasoning_sound": true,
      "proof_complete": true,
      "alternatives_exhausted": true
    },
    "attempt_count": 2,
    "recommendation": "CONTINUE_ITERATING | COMPLETE | ESCALATE"
  }
}
Prolog Session State
:- module(verification_session, [
    create_session/3,
    update_session/2,
    get_session/2,
    increment_attempt/1,
    is_max_attempts_exceeded/1,
    reset_session/1
]).

% Session: session_id, intent_id, attempt_count, constraints, status
create_session(SessionId, IntentId, Constraints) :-
    assertz(session(SessionId, IntentId, 0, Constraints, 'active')),
    assertz(session_attempts(SessionId, [])).

increment_attempt(SessionId) :-
    session(SessionId, IntentId, Attempts, Constraints, Status),
    NewAttempts is Attempts + 1,
    retract(session(SessionId, IntentId, Attempts, Constraints, Status)),
    assertz(session(SessionId, IntentId, NewAttempts, Constraints, Status)).

is_max_attempts_exceeded(SessionId) :-
    session(SessionId, _, Attempts, _, _),
    Attempts >= 5.

Integration Points

Component Integration
orchestrata-intent Intent-to-constraints mapping
orchestrata-cxp Verification message protocol
orchestrata-governance Prolog constraint checking
orchestrata-knowledge Verification results storage

Success Criteria

  1. Accuracy: 100% of constraints checked against Prolog
  2. Completeness: All checkpoints validated
  3. Timeliness: Verification < 1 minute per checkpoint
  4. Escalation: Human review triggered at 5 failed attempts
  5. Traceability: All verification decisions logged

Dependencies


Revision History

Date Version Author Changes
2026-03-07 1.0 Mohamed Initial specification