Orchestrata Ultimate › Tests › Reference › agents › volks › pm

Tests reference — tests/agents/volks/pm

tests/agents/volks/pm — 8 test modules, 131 test functions. Source tree: tests/agents/volks/pm at commit 8a2cb42ad. Generated from the tests AST snapshot by scripts/gen-data-pages.py.

Prose pending.

Modules

Module Tests Covers
test_budget_tracking.py 19 3
test_goal_registry.py 27 2
test_goal_report.py 27 1
test_goal_wiring.py 7 6
test_pm_handoff.py 6 2
test_volk.py 13 2
test_volk_extended.py 32 4

Module details

tests/agents/volks/pm/test_budget_tracking.py

source · 19 tests · 346 lines

Tests for PM budget enforcement + iteration reporting (SPEC-012 US-003/004/005).

Covers: agents.volks.pm.budget, agents.volks.pm.volk, core.packet/ (package)

Kind Name Line Description
function test_pmconfig_spec_defaults 72
function test_warning_at_80_percent_of_llm_calls 81
function test_exceeded_at_100_percent_crosses_both_lines 91
function test_consume_is_edge_triggered 102
function test_duration_budget_in_minutes 110
function test_fix_cycles_budget_crossings 125
function test_negative_elapsed_clamps_to_zero 137
function test_zero_budget_limit_is_skipped 142
function test_is_stalled_never_started_is_not_stalled 150
function test_is_stalled_after_timeout 154
function test_is_stalled_before_timeout 159
function test_summary_is_a_structured_dict 167
function test_summary_pass_rate_zero_without_tests 193
function test_detect_has_ui_does_not_match_embedded_tokens 204 Whole-word matching: "ui" inside "build" is not a UI keyword.
function test_budget_warning_then_exceeded_emitted_observably 215
function test_iteration_stalled_emitted_once_after_idle_window 241
function test_iteration_summary_emitted_and_persisted 265
function test_scope_review_emits_progress_and_applies_threshold_warnings 309
function test_finalize_iteration_without_project_dir_is_advisory_noop 335

tests/agents/volks/pm/test_goal_registry.py

source · 27 tests · 303 lines

Tests for GoalRegistry and Goal lifecycle.

Covers: agents.volks.pm.goal_registry, session.context

Kind Name Line Description
function test_success_criteria_defaults 41
function test_parse_criteria_non_dict_returns_defaults 50
function test_parse_criteria_dict_overrides 56
function test_goal_round_trip_dict 72
function test_goal_from_dict_minimal_defaults 88
function test_create_goal_persists 95
function test_create_goal_on_fresh_context 104
function test_migration_noop_when_no_context_json_yet 114 Constructing a GoalRegistry before context.json even exists must not
function test_migration_noop_on_corrupt_legacy_json 123 A corrupt context.json (simulating interleaved-write corruption) must
function test_legacy_top_level_goals_blob_migrates_into_portfolio_goals 133 A pre-unification raw top-level context.json["goals"] blob (written
function test_goal_status_and_priority_serialise_to_plain_strings_in_json 167 The on-disk context.json stores plain string values for enum fields
function test_list_goals_filters_by_status 181
function test_get_goal_not_found 193
function test_get_active_goal_returns_running_or_active 198
function test_activate_goal_from_blocked 205
function test_activate_goal_illegal_from_completed 212
function test_complete_goal_sets_timestamp_and_progress 219
function test_block_goal_appends_gap 228
function test_defer_and_cancel_record_in_notes 235
function test_update_goal_nonexistent 245
function test_record_iteration_accumulates_and_sets_running 250
function test_score_tests_all_pass 275
function test_score_tests_partial 279
function test_score_tests_no_results 285
function test_estimate_progress_no_criteria 289
function test_estimate_progress_full 295
function test_goal_id_uniqueness 300

tests/agents/volks/pm/test_goal_report.py

source · 27 tests · 303 lines

Tests for GoalReportGenerator and report helpers.

Covers: agents.volks.pm.goal_report

Kind Name Line Description
function test_report_section_defaults 23
function test_goal_report_defaults 30
function test_calculate_progress_empty 40
function test_calculate_progress_partial 44
function test_calculate_progress_full 48
function test_evaluate_tests_pass_and_fail 52
function test_evaluate_coverage_met_and_missed 62
function test_evaluate_spec_coverage_met_and_missed 71
function test_check_coverage_gap 80
function test_check_oscillation_not_enough_history 94
function test_check_oscillation_detected 100
function test_check_oscillation_improving 107
function test_check_iteration_limit_warns 115
function test_check_iteration_limit_ok 122
function test_add_summary_section_pass 128
function test_add_summary_section_fail 137
function test_add_test_results_section 145
function test_add_trend_section_limits_last_5 156
function test_generator_full_flow_all_met 166
function test_generator_with_gaps_and_history 188
function test_generator_none_history_default 223
function test_to_markdown_renders_all_sections 236
function test_render_criteria_sections_both_empty 260
function test_render_gaps_and_recs_both_empty 266
function test_render_detail_sections_partial_status 272
function test_render_detail_sections_unknown_status 280
function test_iteration_not_complete_adds_gap 289

tests/agents/volks/pm/test_goal_wiring.py

source · 7 tests · 196 lines

Wiring tests for A5: GoalRegistry + GoalReportGenerator wired into PMVolk.

Covers: agents.volks.pm.goal_registry, agents.volks.pm.goal_report, agents.volks.pm.volk, session.context, session.models, core.packet/ (package)

Kind Name Line Description
function test_pmvolk_defaults_to_inert_goal_tracking 67 Without an injected context store, GoalRegistry is never constructed
function test_pmvolk_constructs_real_goal_registry_when_context_manager_injected 77
function test_progress_update_records_iteration_and_generates_report 90 A progress_update against an ACTIVE goal records + reports through
function test_progress_update_noop_when_no_active_goal 135 No active goal -> goal tracking is a silent no-op; metrics still update.
function test_portfolio_goal_written_via_registry_reads_back_through_context_manager 147 A PM goal written through GoalRegistry is readable back through the
function test_portfolio_goal_coexists_with_session_goal 164 SPEC-012 portfolio goals and the SPEC-023 singular session goal are
function test_portfolio_goals_survive_unrelated_update_state_write 182 An unrelated SPEC-023 write (e.g. session bookkeeping) must not wipe

tests/agents/volks/pm/test_pm_handoff.py

source · 6 tests · 72 lines

VP-A3: PM_SYSTEM_PROMPT must state the UI/no-UI routing handoff.

Covers: agents.volks.pm.volk, core.packet/ (package)

Kind Name Line Description
function test_prompt_states_ux_routing_for_ui_projects 11 Validated scope must route to U:Ux (ux_design) when a UI is present.
function test_prompt_states_architect_routing_for_non_ui_projects 17 Otherwise the scope routes to U:Ar (implement).
function test_handoff_line_is_a_single_crisp_line 23 The routing guidance is one line and mentions both destinations.
function test_output_format_markers_untouched 33 The additive line must not disturb the downstream parser's markers.
function test_forward_packet_matches_prompt_routing_ui 52 Real routing: has_ui True -> U:Ux / ux_design, mirroring the prompt.
function test_forward_packet_matches_prompt_routing_no_ui 64 Real routing: has_ui False -> U:Ar / implement, mirroring the prompt.

tests/agents/volks/pm/test_volk.py

source · 13 tests · 237 lines

Tests for PMVolk (U:PM).

Covers: agents.volks.pm.volk, core.packet/ (package)

Kind Name Line Description
function test_pm_prompt_has_keywords 46
function test_detect_has_ui 57
function test_parse_scope_result_full 67
function test_parse_scope_result_invalid_json_estimate_falls_back 83
function test_parse_scope_result_no_markers_returns_defaults 97
function test_parse_scope_result_non_json_warnings 105
function test_pm_defaults 111
function test_project_manager_agent_alias_class 123
function test_process_unknown_subject_returns_none 130
function test_progress_update_mutates_metrics 136
function test_scope_review_routes_to_ux_when_has_ui 152
function test_scope_review_routes_to_architect_when_no_ui 198
function test_scope_review_has_ui_auto_detected_when_absent 222

tests/agents/volks/pm/test_volk_extended.py

source · 32 tests · 710 lines

Covers: agents.volks.persona, agents.volks.pm.volk, llm.client, core.packet/ (package)

Kind Name Line Description
function test_parse_scope_result_double_json_decode_fallback 76 When ESTIMATE block and first-line fallback both fail JSON parsing,
function test_parse_scope_result_multiline_json_with_marker_split 92 Multi-line JSON that contains a nested brace is extracted until the
function test_parse_scope_result_task_summary_with_subsequent_marker 105 TASK_SUMMARY followed by another marker (e.g. ESTIMATE:) is truncated
function test_parse_scope_result_warnings_valid_json_list 119 WARNINGS with a proper JSON list is parsed correctly.
function test_parse_scope_result_warnings_empty_brackets 126 WARNINGS: [] should produce an empty list, not a string.
function test_parse_scope_result_warnings_empty_line 133 WARNINGS: with an empty value should produce an empty list.
function test_parse_scope_result_estimate_with_esclate_to_marker 140 ESTIMATE block terminated by ESCALATE_TO: marker.
function test_detect_has_ui_all_keywords 158 Every keyword in _UI_KEYWORDS should trigger True.
function test_detect_has_ui_mixed_text 178 UI keyword embedded in larger text is detected.
function test_pmvolk_metrics_defaults 189 All metric keys are present with sensible defaults.
function test_pmvolk_output_artifacts_empty 200 output_artifacts starts empty.
function test_pmvolk_status_and_summary_defaults 206 Fresh volk has PENDING status and Idle summary from BaseAgent.
function test_project_manager_agent_inheritance 213 ProjectManagerAgent is a PMVolk with identical fields.
function test_call_scope_llm_formats_prompt_and_increments_metrics 227 _call_scope_llm builds the correct prompt and updates metrics.
function test_log_scope_result_with_warnings_and_estimate 266 _log_scope_result does not raise with warnings and estimate present.
function test_log_scope_result_no_warnings_no_estimate 274 _log_scope_result does not raise when both are empty.
function test_build_forward_packet_forwards_all_ba_enrichments 286 Every BA enrichment key present in the payload is forwarded.
function test_build_forward_packet_omits_missing_enrichments 324 BA enrichment keys absent from the payload are not added.
function test_build_forward_packet_none_project_name 354 When project_name is missing, payload contains None for that key.
function test_handle_scope_review_routes_to_ux 376 scope_review with UI keywords routes to U:Ux via swapped call_llm.
function test_handle_scope_review_routes_to_architect 414 implement subject with no UI routes to U:Ar.
function test_handle_scope_review_auto_detect_has_ui_from_requirements 444 When has_ui is absent from payload, it is auto-detected from requirements.
function test_handle_scope_review_default_task_summary 471 Missing task_summary falls back to the default string.
function test_handle_scope_review_with_warnings 495 Scope data with warnings is propagated to the forward packet.
function test_handle_scope_review_extracts_graph_context 527 _handle_scope_review extracts graph context from payload.
function test_process_implement_routes_to_scope_review 560 process() with subject 'implement' delegates to _handle_scope_review.
function test_process_scope_review_routes_to_scope_review 588 process() with subject 'scope_review' delegates to _handle_scope_review.
function test_process_progress_update_returns_none 616 process() with subject 'progress_update' returns None.
function test_process_unknown_subject_returns_none 631 process() with an unrecognised subject returns None.
function test_handle_progress_partial_metrics_update 651 Only keys present in the payload are updated; missing keys keep old values.
function test_handle_progress_no_matching_keys 670 Payload with no matching metric keys leaves metrics unchanged.
function test_handle_progress_all_metrics_updated 686 Payload with every metric key updates all values.

Support files

Fixtures, package markers and helpers without test functions.