@ngocsangairvds/vsaf 3.2.14 → 3.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1442) hide show
  1. package/bin/vsaf.js +18 -4
  2. package/package.json +1 -1
  3. package/src/config.js +167 -0
  4. package/src/global.js +1 -48
  5. package/src/project.js +1 -0
  6. package/src/utils.js +44 -1
  7. package/tools/vds-scripts/Makefile +9 -31
  8. package/tools/vds-scripts/docker/docker-compose.cli.yml +1 -117
  9. package/tools/vds-scripts/docker/docker-compose.services.yml +1 -40
  10. package/tools/vds-scripts/docker/infrastructure/init-schemas.sql +0 -34
  11. package/tools/vds-scripts/docker/infrastructure/pgbouncer/pgbouncer.ini +2 -6
  12. package/tools/vds-scripts/pyproject.toml +1 -33
  13. package/tools/vds-scripts/uv.lock +80 -1651
  14. package/tools/vds-scripts/vds_cli/pyproject.toml +3 -0
  15. package/tools/vds-scripts/vds_cli/src/vds_cli/cli.py +1 -127
  16. package/tools/vds-scripts/vds_cli/src/vds_cli/commands/lint_cli.py +1 -20
  17. package/tools/vds-scripts/vds_cli/src/vds_cli/router.py +0 -100
  18. package/tools/vds-scripts/vds_cli/tests/conftest.py +0 -2
  19. package/tools/vds-scripts/vds_cli/tests/unit/test_cli.py +0 -25
  20. package/tools/vds-scripts/vds_cli/tests/unit/test_lint_cli.py +2 -2
  21. package/tools/vds-scripts/vds_cli/tests/unit/test_router.py +0 -2
  22. package/tools/vds-scripts/CLOSURE.md +0 -340
  23. package/tools/vds-scripts/ECOSYSTEM-CHANGELOG.md +0 -52
  24. package/tools/vds-scripts/ECOSYSTEM-DOCS.md +0 -602
  25. package/tools/vds-scripts/ECOSYSTEM_ALIGNMENT.md +0 -133
  26. package/tools/vds-scripts/ENV-HYGIENE-OPS-NOTE.md +0 -65
  27. package/tools/vds-scripts/INVESTIGATION-cloud-401.md +0 -103
  28. package/tools/vds-scripts/MEM0_2.0_API_REFERENCE.md +0 -238
  29. package/tools/vds-scripts/PACKAGE_P125B_IMPLEMENTATION_SUMMARY.md +0 -131
  30. package/tools/vds-scripts/PHASE-MERGE-SUMMARY.md +0 -121
  31. package/tools/vds-scripts/PHASES-3-ARCHIVE.md +0 -59
  32. package/tools/vds-scripts/PROJECT_COMPLETION_SUMMARY.md +0 -45
  33. package/tools/vds-scripts/SEARCH-CRASH-REPRO.md +0 -51
  34. package/tools/vds-scripts/analyze_hexagonal.py +0 -217
  35. package/tools/vds-scripts/analyze_profiles.py +0 -60
  36. package/tools/vds-scripts/audit-checklist.xlsx +0 -0
  37. package/tools/vds-scripts/audit_orchestrator/.audit_approvals/approvals_index.json +0 -1
  38. package/tools/vds-scripts/audit_orchestrator/.env.example +0 -85
  39. package/tools/vds-scripts/audit_orchestrator/.github/workflows/audit.yml +0 -47
  40. package/tools/vds-scripts/audit_orchestrator/Dockerfile +0 -92
  41. package/tools/vds-scripts/audit_orchestrator/GOOGLE_SHEETS_IMPLEMENTATION_SUMMARY.md +0 -218
  42. package/tools/vds-scripts/audit_orchestrator/PHASE3_INTEGRATION_SUMMARY.md +0 -268
  43. package/tools/vds-scripts/audit_orchestrator/PHASE7-MERGE-SUMMARY.md +0 -174
  44. package/tools/vds-scripts/audit_orchestrator/README.md +0 -1573
  45. package/tools/vds-scripts/audit_orchestrator/TSK-168-IMPLEMENTATION-SUMMARY.md +0 -191
  46. package/tools/vds-scripts/audit_orchestrator/TSK-196-IMPLEMENTATION-SUMMARY.md +0 -201
  47. package/tools/vds-scripts/audit_orchestrator/alembic/env.py +0 -37
  48. package/tools/vds-scripts/audit_orchestrator/alembic/script.py.mako +0 -28
  49. package/tools/vds-scripts/audit_orchestrator/alembic/versions/0001_initial_audit_state_schema.py +0 -1260
  50. package/tools/vds-scripts/audit_orchestrator/alembic.ini +0 -68
  51. package/tools/vds-scripts/audit_orchestrator/config/category-mapping.json +0 -81
  52. package/tools/vds-scripts/audit_orchestrator/config/profile-timeouts.yaml +0 -17
  53. package/tools/vds-scripts/audit_orchestrator/create_sample.py +0 -55
  54. package/tools/vds-scripts/audit_orchestrator/data/corpus_accuracy_report.json +0 -17
  55. package/tools/vds-scripts/audit_orchestrator/data/exemplar_quality_report.json +0 -1606
  56. package/tools/vds-scripts/audit_orchestrator/data/instruction_plan_fixtures.json +0 -163
  57. package/tools/vds-scripts/audit_orchestrator/data/requirement_exemplars.json +0 -3443
  58. package/tools/vds-scripts/audit_orchestrator/data/requirement_scope_fixtures.json +0 -172
  59. package/tools/vds-scripts/audit_orchestrator/debug_rg.py +0 -46
  60. package/tools/vds-scripts/audit_orchestrator/demo_code_pack.py +0 -127
  61. package/tools/vds-scripts/audit_orchestrator/docs/AGENT_SDK_SELECTION_SPEC.md +0 -720
  62. package/tools/vds-scripts/audit_orchestrator/docs/API.md +0 -804
  63. package/tools/vds-scripts/audit_orchestrator/docs/CONTENT_ANALYSIS_APPROACH.md +0 -1041
  64. package/tools/vds-scripts/audit_orchestrator/docs/CONTENT_SCORING_EVOLUTION_SPEC.md +0 -868
  65. package/tools/vds-scripts/audit_orchestrator/docs/DEPLOYMENT.md +0 -778
  66. package/tools/vds-scripts/audit_orchestrator/docs/LLM_AGENT_AUDIT_SPEC.md +0 -721
  67. package/tools/vds-scripts/audit_orchestrator/docs/LLM_CONTENT_ANALYSIS_SPEC.md +0 -1143
  68. package/tools/vds-scripts/audit_orchestrator/docs/LSP_SETUP_GUIDE.md +0 -221
  69. package/tools/vds-scripts/audit_orchestrator/docs/MULTI_REPO_AUDIT_SPEC.md +0 -951
  70. package/tools/vds-scripts/audit_orchestrator/docs/OLLAMA_EMBEDDINGS_SETUP.md +0 -119
  71. package/tools/vds-scripts/audit_orchestrator/docs/PHASE32_REAL_BENCHMARK_2026-02-08.md +0 -66
  72. package/tools/vds-scripts/audit_orchestrator/docs/PHASE_64_TO_92_HISTORICAL_SPEC.md +0 -1772
  73. package/tools/vds-scripts/audit_orchestrator/docs/TSK-193-flow-trace.md +0 -201
  74. package/tools/vds-scripts/audit_orchestrator/docs/TSK-193-verification.md +0 -124
  75. package/tools/vds-scripts/audit_orchestrator/docs/phase152-hierarchical-query-surface.md +0 -46
  76. package/tools/vds-scripts/audit_orchestrator/examples/bitbucket_metadata_example.json +0 -50
  77. package/tools/vds-scripts/audit_orchestrator/legacy/migrations/README.md +0 -68
  78. package/tools/vds-scripts/audit_orchestrator/legacy/migrations/phase117_phase118_shared_state.sql +0 -64
  79. package/tools/vds-scripts/audit_orchestrator/legacy/migrations/phase154_published_pages.sql +0 -28
  80. package/tools/vds-scripts/audit_orchestrator/legacy/migrations/phase157_dispatch_tables.sql +0 -94
  81. package/tools/vds-scripts/audit_orchestrator/legacy/migrations/phase157_events.sql +0 -91
  82. package/tools/vds-scripts/audit_orchestrator/legacy/migrations/phase157_scope_snapshots.sql +0 -24
  83. package/tools/vds-scripts/audit_orchestrator/legacy/migrations/phase157_status_view.sql +0 -22
  84. package/tools/vds-scripts/audit_orchestrator/legacy/migrations/phase169_dispatch_observability.sql +0 -55
  85. package/tools/vds-scripts/audit_orchestrator/legacy/migrations/state_repair_hardening.sql +0 -24
  86. package/tools/vds-scripts/audit_orchestrator/pyproject.toml +0 -211
  87. package/tools/vds-scripts/audit_orchestrator/pyrightconfig.json +0 -51
  88. package/tools/vds-scripts/audit_orchestrator/pytest.ini +0 -37
  89. package/tools/vds-scripts/audit_orchestrator/reproduce_scanner.py +0 -40
  90. package/tools/vds-scripts/audit_orchestrator/scripts/README.md +0 -116
  91. package/tools/vds-scripts/audit_orchestrator/scripts/benchmark_crawl_modes.py +0 -455
  92. package/tools/vds-scripts/audit_orchestrator/scripts/benchmark_dspy.py +0 -513
  93. package/tools/vds-scripts/audit_orchestrator/scripts/benchmark_nlp_accuracy.py +0 -138
  94. package/tools/vds-scripts/audit_orchestrator/scripts/benchmark_retrieval_modes.py +0 -176
  95. package/tools/vds-scripts/audit_orchestrator/scripts/benchmark_upload_update_mode.py +0 -167
  96. package/tools/vds-scripts/audit_orchestrator/scripts/build_check.py +0 -76
  97. package/tools/vds-scripts/audit_orchestrator/scripts/check_live_progress.py +0 -61
  98. package/tools/vds-scripts/audit_orchestrator/scripts/cli_integration_test.py +0 -400
  99. package/tools/vds-scripts/audit_orchestrator/scripts/index_workspace.py +0 -178
  100. package/tools/vds-scripts/audit_orchestrator/scripts/inspect_route_conformance.py +0 -196
  101. package/tools/vds-scripts/audit_orchestrator/scripts/monitor_postgres.py +0 -145
  102. package/tools/vds-scripts/audit_orchestrator/scripts/optimize_audit.py +0 -462
  103. package/tools/vds-scripts/audit_orchestrator/scripts/verify.py +0 -673
  104. package/tools/vds-scripts/audit_orchestrator/scripts/verify_phase111_requirement_analysis.py +0 -375
  105. package/tools/vds-scripts/audit_orchestrator/scripts/verify_phase117_cross_repo_evidence.py +0 -77
  106. package/tools/vds-scripts/audit_orchestrator/scripts/verify_phase121_short_circuit.py +0 -680
  107. package/tools/vds-scripts/audit_orchestrator/scripts/verify_phase122_instruction_handling.py +0 -478
  108. package/tools/vds-scripts/audit_orchestrator/scripts/verify_phase125_skill_integration.py +0 -832
  109. package/tools/vds-scripts/audit_orchestrator/scripts/verify_phase_36.py +0 -394
  110. package/tools/vds-scripts/audit_orchestrator/scripts/verify_phase_37.py +0 -58
  111. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/__init__.py +0 -17
  112. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/__init__.py +0 -29
  113. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/_langchain_warnings.py +0 -17
  114. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/agentic_investigator.py +0 -4130
  115. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/approval.py +0 -490
  116. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/audit_loop_hooks.py +0 -107
  117. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/audit_state.py +0 -50
  118. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/base.py +0 -4035
  119. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/code_agent.py +0 -667
  120. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/code_analysis_helpers.py +0 -236
  121. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/code_analysis_prompts.py +0 -146
  122. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/docs_agent.py +0 -1234
  123. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/langgraph_workflow.py +0 -2002
  124. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/pydantic_base.py +0 -1227
  125. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/requirement_analysis_agent.py +0 -593
  126. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/security_agent.py +0 -1829
  127. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/security_scanner.py +0 -686
  128. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/skill_tools.py +0 -204
  129. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/synthesis_agent.py +0 -1463
  130. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/tool_efficiency_guard.py +0 -609
  131. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/tool_registry.py +0 -3822
  132. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/toolsets/__init__.py +0 -52
  133. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/toolsets/evidence_corpus.py +0 -385
  134. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/toolsets/filesystem.py +0 -1134
  135. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/toolsets/lsp.py +0 -458
  136. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/toolsets/mcp_toolset.py +0 -491
  137. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/toolsets/skills_toolset.py +0 -997
  138. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/toolsets/vector_evidence.py +0 -842
  139. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/usage_tracker.py +0 -682
  140. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/agents/visualization.py +0 -303
  141. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/analyze_cmds.py +0 -892
  142. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checklist_query/__init__.py +0 -15
  143. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checklist_query/service.py +0 -171
  144. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/__init__.py +0 -20
  145. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/base.py +0 -60
  146. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/bitbucket/__init__.py +0 -6
  147. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/bitbucket/checks.py +0 -257
  148. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/confluence/__init__.py +0 -10
  149. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/confluence/checks.py +0 -78
  150. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/git/__init__.py +0 -6
  151. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/git/file_checks.py +0 -133
  152. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/llm_checks/__init__.py +0 -17
  153. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/llm_checks/api_docs_check.py +0 -80
  154. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/llm_checks/readme_check.py +0 -76
  155. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/llm_checks/security_docs_check.py +0 -78
  156. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/registry.py +0 -402
  157. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/sonarqube/__init__.py +0 -10
  158. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/checks/sonarqube/checks.py +0 -276
  159. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/cli.py +0 -12
  160. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/cli_common.py +0 -128
  161. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/cli_impl.py +0 -9826
  162. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/clients/bitbucket_cli_client.py +0 -187
  163. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/clients/confluence_cli_client.py +0 -977
  164. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/clients/sonarqube_cli_client.py +0 -28
  165. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/__init__.py +0 -21
  166. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/base.py +0 -25
  167. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/bitbucket_downloader.py +0 -644
  168. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/bitbucket_metadata.py +0 -133
  169. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/checklist_parser.py +0 -180
  170. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/completeness/__init__.py +0 -31
  171. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/completeness/bitbucket_probe.py +0 -443
  172. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/completeness/confluence_probe.py +0 -365
  173. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/completeness/freshness_evaluator.py +0 -330
  174. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/completeness/material_completeness_service.py +0 -1079
  175. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/confluence_collector.py +0 -259
  176. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/diagram_extractor.py +0 -280
  177. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/enrichment_extractor.py +0 -200
  178. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/evidence_cache.py +0 -35
  179. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/git_collector.py +0 -148
  180. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/graphify_collector.py +0 -171
  181. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/image_extractor.py +0 -359
  182. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/linked_page_tracker.py +0 -120
  183. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/markdown_converter.py +0 -344
  184. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/material_cache.py +0 -1252
  185. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/material_downloader.py +0 -1165
  186. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/orchestrator.py +0 -168
  187. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/registry_parser.py +0 -3063
  188. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/requirements.py +0 -70
  189. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/runner.py +0 -119
  190. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/collectors/sonarqube_collector.py +0 -113
  191. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/config.py +0 -1943
  192. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/config_resolution/__init__.py +0 -23
  193. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/config_resolution/discovery.py +0 -90
  194. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/config_resolution/environment_resolver.py +0 -56
  195. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/config_resolution/evidence.py +0 -78
  196. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/config_resolution/models.py +0 -73
  197. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/config_resolution/precedence.py +0 -10
  198. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/config_resolution/redaction.py +0 -20
  199. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/confluence_connectivity.py +0 -140
  200. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/corpus_cmds.py +0 -278
  201. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/db/__init__.py +0 -7
  202. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/db/alembic_filters.py +0 -57
  203. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/docs/__init__.py +0 -29
  204. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/docs/diataxis_validator.py +0 -687
  205. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/doctor_cmds.py +0 -3295
  206. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/dspy_modules/__init__.py +0 -5
  207. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/dspy_modules/evaluation.py +0 -301
  208. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/dspy_modules/modules.py +0 -172
  209. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/dspy_modules/runtime.py +0 -836
  210. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/dspy_modules/signatures.py +0 -406
  211. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/__init__.py +0 -192
  212. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/ad_hoc_analyzer.py +0 -399
  213. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/aggregator.py +0 -220
  214. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/auditor.py +0 -504
  215. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/batch_evidence_cache.py +0 -111
  216. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/batch_processor.py +0 -4776
  217. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/calibration.py +0 -217
  218. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/checklist_generator.py +0 -1201
  219. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/checklist_projection.py +0 -192
  220. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/checklist_scoping.py +0 -221
  221. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/checkpoint.py +0 -159
  222. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/cl003_shared_lib_guard.py +0 -194
  223. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/companion_context_service.py +0 -445
  224. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/confluence_checklist_contract.py +0 -7425
  225. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/cross_check_rules.py +0 -213
  226. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/deterministic_evaluator.py +0 -237
  227. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/drift_detector.py +0 -157
  228. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/dspy_requirement_classifier.py +0 -640
  229. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/evidence_assembler.py +0 -407
  230. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/evidence_collector.py +0 -119
  231. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/evidence_diversity.py +0 -101
  232. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/gap_analyzer.py +0 -549
  233. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/graduated.py +0 -185
  234. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/grounding_validator.py +0 -287
  235. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/instruction_analyzer.py +0 -882
  236. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/instruction_compliance.py +0 -172
  237. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/llm_row_evaluator.py +0 -9270
  238. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/loader.py +0 -1070
  239. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/manual_check_config.py +0 -136
  240. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/mapping.py +0 -269
  241. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/multi_judge.py +0 -65
  242. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/phase120_checklist_update.py +0 -416
  243. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/profile_scorer.py +0 -427
  244. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/project_evidence_context.py +0 -449
  245. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/project_knowledge_query_service.py +0 -155
  246. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/project_knowledge_store.py +0 -383
  247. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/project_topology.py +0 -1920
  248. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/provider_failure_classifier.py +0 -778
  249. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/readiness_cli_helpers.py +0 -341
  250. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/readiness_extractor.py +0 -303
  251. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/readiness_synthesizer.py +0 -730
  252. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/regression_guard.py +0 -138
  253. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/repo_type_classifier.py +0 -297
  254. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/requirement_analysis.py +0 -1433
  255. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/requirement_classification.py +0 -1725
  256. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/result_merger.py +0 -814
  257. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/route_matrix.py +0 -267
  258. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/row_evaluator.py +0 -9437
  259. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/row_evaluator_runtime.py +0 -1270
  260. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/row_evaluator_types.py +0 -2102
  261. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/rubric.py +0 -592
  262. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/scorer.py +0 -1239
  263. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/section_packs.py +0 -645
  264. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/skill_recommendation.py +0 -1183
  265. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/stability_harness.py +0 -207
  266. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/target_selector.py +0 -841
  267. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/telemetry.py +0 -347
  268. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/template_analyzer.py +0 -469
  269. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/token_tracker.py +0 -111
  270. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/tool_first_planner.py +0 -7905
  271. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/topology_query_service.py +0 -80
  272. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/validator.py +0 -449
  273. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/engine/weight_policy.py +0 -464
  274. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/errors.py +0 -430
  275. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/extract_cmds.py +0 -4887
  276. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/identity.py +0 -146
  277. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/incremental/__init__.py +0 -52
  278. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/incremental/baseline.py +0 -378
  279. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/incremental/change_analyzer.py +0 -407
  280. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/incremental/delta_report.py +0 -189
  281. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/incremental/diff_detector.py +0 -301
  282. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/integrations/__init__.py +0 -3
  283. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/__init__.py +0 -50
  284. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/audit_schemas.py +0 -459
  285. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/codex_oauth.py +0 -340
  286. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/cost_tracker.py +0 -288
  287. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/engine.py +0 -751
  288. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/evaluator.py +0 -245
  289. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/prompts/__init__.py +0 -32
  290. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/prompts/api_docs_evaluation.py +0 -25
  291. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/prompts/gap_analysis.py +0 -31
  292. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/prompts/instruction_templates.py +0 -634
  293. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/prompts/readme_evaluation.py +0 -25
  294. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/prompts/row_evaluation.py +0 -247
  295. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/prompts/security_docs_evaluation.py +0 -25
  296. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/prompts/template_analysis.py +0 -25
  297. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/prompts.py +0 -0
  298. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/llm/provider.py +0 -626
  299. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/logging_config.py +0 -577
  300. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/mappings/__init__.py +0 -58
  301. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/mappings/default_checklist_mapping.json +0 -18
  302. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/mappings/vietnamese_checklist_mapping.json +0 -38
  303. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/misc_cmds.py +0 -4689
  304. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/__init__.py +0 -153
  305. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/calibration.py +0 -98
  306. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/checklist.py +0 -921
  307. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/completeness.py +0 -309
  308. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/enrichment.py +0 -58
  309. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/enums.py +0 -97
  310. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/evidence.py +0 -351
  311. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/findings.py +0 -381
  312. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/gaps.py +0 -299
  313. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/graph.py +0 -42
  314. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/multi_judge.py +0 -50
  315. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/readiness.py +0 -309
  316. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/registry.py +0 -386
  317. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/reporting.py +0 -32
  318. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/task.py +0 -549
  319. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/models/template.py +0 -477
  320. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/observability/__init__.py +0 -31
  321. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/observability/metrics.py +0 -404
  322. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/parse_cmds.py +0 -608
  323. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/pdf_cmds.py +0 -208
  324. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/performance_gates.py +0 -224
  325. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/phase151_projection.py +0 -84
  326. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/profiles/__init__.py +0 -65
  327. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/profiles/detection.py +0 -842
  328. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/profiles/models.py +0 -474
  329. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/__init__.py +0 -1
  330. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/_confluence_macros.py +0 -145
  331. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/_field_sanitizer.py +0 -25
  332. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/_table_builder.py +0 -63
  333. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/_vietnamese_templates.py +0 -103
  334. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/bitbucket_link_resolver.py +0 -34
  335. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/checklist_renderer.py +0 -483
  336. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/confluence_publisher.py +0 -3048
  337. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/hierarchy_publisher.py +0 -213
  338. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/live_data_injector.py +0 -152
  339. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/macro_builder.py +0 -101
  340. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/markdown_converter.py +0 -154
  341. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/priority_renderer.py +0 -133
  342. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/project_aggregate_renderer.py +0 -423
  343. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/readiness_renderer.py +0 -186
  344. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/system_doc_hierarchy_renderer.py +0 -382
  345. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/publishers/system_doc_renderer.py +0 -683
  346. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/report_cmds.py +0 -788
  347. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/__init__.py +0 -13
  348. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/aggregation_report.py +0 -86
  349. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/checklist_generator.py +0 -425
  350. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/excel_generator.py +0 -599
  351. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/gap_report.py +0 -131
  352. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/json_generator.py +0 -188
  353. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/markdown_generator.py +0 -595
  354. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/pdf/__init__.py +0 -154
  355. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/pdf/collector.py +0 -61
  356. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/pdf/department_builder.py +0 -77
  357. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/pdf/errors.py +0 -9
  358. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/pdf/md_renderer.py +0 -386
  359. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/pdf/pdf_models.py +0 -95
  360. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/pdf/pdf_writer.py +0 -27
  361. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/pdf/repo_project_builders.py +0 -274
  362. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/readiness_report.py +0 -447
  363. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/reporting.py +0 -94
  364. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/reports/sarif_generator.py +0 -519
  365. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/runtime_profiles.py +0 -98
  366. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/seed/__init__.py +0 -29
  367. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/seed/seed_loader.py +0 -561
  368. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/skills/__init__.py +0 -5
  369. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/skills/skill_routing.py +0 -312
  370. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/sources/__init__.py +0 -0
  371. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/sources/base.py +0 -110
  372. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/sources/bitbucket.py +0 -129
  373. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/sources/git_url.py +0 -60
  374. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/sources/github.py +0 -75
  375. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/sources/local.py +0 -58
  376. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/spec_sync_validator.py +0 -15
  377. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/state/__init__.py +0 -6285
  378. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/state/readiness_helpers.py +0 -74
  379. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/state/skill_readiness.py +0 -487
  380. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/state/store.py +0 -12927
  381. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/state_cmds.py +0 -1868
  382. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/sync/__init__.py +0 -0
  383. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/sync/repo_sync.py +0 -409
  384. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/sync_cmds.py +0 -1247
  385. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/utils/__init__.py +0 -3
  386. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/utils/debug_bundle.py +0 -214
  387. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/validators/checklist_validator.py +0 -342
  388. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/workflow_cmds.py +0 -19147
  389. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/workflows/__init__.py +0 -9
  390. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/workflows/_test_audit_daily_batch.py +0 -192
  391. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/workflows/audit_daily_batch.py +0 -308
  392. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/workflows/audit_deep_monthly.py +0 -193
  393. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/workflows/audit_drift_scan.py +0 -178
  394. package/tools/vds-scripts/audit_orchestrator/src/vds_audit_orchestrator/workflows/audit_security_daily.py +0 -183
  395. package/tools/vds-scripts/audit_orchestrator/templates/sample_audit_template.xlsx +0 -0
  396. package/tools/vds-scripts/audit_orchestrator/tests/__init__.py +0 -0
  397. package/tools/vds-scripts/audit_orchestrator/tests/_helpers.py +0 -32
  398. package/tools/vds-scripts/audit_orchestrator/tests/collectors/__init__.py +0 -0
  399. package/tools/vds-scripts/audit_orchestrator/tests/collectors/completeness/__init__.py +0 -0
  400. package/tools/vds-scripts/audit_orchestrator/tests/collectors/completeness/test_bitbucket_probe.py +0 -403
  401. package/tools/vds-scripts/audit_orchestrator/tests/collectors/completeness/test_confluence_probe.py +0 -423
  402. package/tools/vds-scripts/audit_orchestrator/tests/collectors/test_bitbucket_downloader.py +0 -289
  403. package/tools/vds-scripts/audit_orchestrator/tests/collectors/test_image_extractor.py +0 -260
  404. package/tools/vds-scripts/audit_orchestrator/tests/collectors/test_markdown_converter.py +0 -57
  405. package/tools/vds-scripts/audit_orchestrator/tests/collectors/test_material_cache.py +0 -197
  406. package/tools/vds-scripts/audit_orchestrator/tests/collectors/test_material_downloader.py +0 -550
  407. package/tools/vds-scripts/audit_orchestrator/tests/collectors/test_registry_parser.py +0 -3514
  408. package/tools/vds-scripts/audit_orchestrator/tests/collectors/test_registry_parser_department_entry.py +0 -214
  409. package/tools/vds-scripts/audit_orchestrator/tests/collectors/test_registry_parser_flow.py +0 -200
  410. package/tools/vds-scripts/audit_orchestrator/tests/conftest.py +0 -988
  411. package/tools/vds-scripts/audit_orchestrator/tests/engine/__init__.py +0 -0
  412. package/tools/vds-scripts/audit_orchestrator/tests/engine/test_calibration.py +0 -48
  413. package/tools/vds-scripts/audit_orchestrator/tests/engine/test_confluence_checklist_phase22_helpers.py +0 -6065
  414. package/tools/vds-scripts/audit_orchestrator/tests/engine/test_multi_judge.py +0 -62
  415. package/tools/vds-scripts/audit_orchestrator/tests/engine/test_stability_harness.py +0 -61
  416. package/tools/vds-scripts/audit_orchestrator/tests/engine/test_structured_metadata.py +0 -419
  417. package/tools/vds-scripts/audit_orchestrator/tests/factories/__init__.py +0 -0
  418. package/tools/vds-scripts/audit_orchestrator/tests/factories/models.py +0 -534
  419. package/tools/vds-scripts/audit_orchestrator/tests/factories/templates.py +0 -241
  420. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/__init__.py +0 -0
  421. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/diagrams/__init__.py +0 -0
  422. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/diagrams/compressed.drawio +0 -2
  423. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/diagrams/mockup.bmpr +0 -0
  424. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/diagrams/simple.drawio +0 -26
  425. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/__init__.py +0 -0
  426. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/bitbucket/__init__.py +0 -0
  427. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/bitbucket/branch_permissions_cli.json +0 -26
  428. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/bitbucket/branch_permissions_direct.json +0 -24
  429. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/bitbucket/repo_conditions_cli.json +0 -14
  430. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/bitbucket/repo_conditions_direct.json +0 -12
  431. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/confluence/__init__.py +0 -0
  432. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/confluence/page_cli.json +0 -7
  433. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/confluence/page_direct.json +0 -7
  434. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/confluence/search_cli.json +0 -11
  435. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/confluence/search_direct.json +0 -7
  436. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/sonarqube/__init__.py +0 -0
  437. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/sonarqube/quality_gate_cli.json +0 -12
  438. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/golden/sonarqube/quality_gate_direct.json +0 -12
  439. package/tools/vds-scripts/audit_orchestrator/tests/fixtures/requirement_strategy_phase115.json +0 -118
  440. package/tools/vds-scripts/audit_orchestrator/tests/integration/__init__.py +0 -0
  441. package/tools/vds-scripts/audit_orchestrator/tests/integration/conftest.py +0 -107
  442. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/__init__.py +0 -0
  443. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/expected_outcomes.md +0 -50
  444. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_audit_repo/__init__.py +0 -0
  445. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_audit_repo/auth.py +0 -27
  446. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_audit_repo/config.py +0 -16
  447. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_audit_repo/db.py +0 -24
  448. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_audit_repo/main.py +0 -18
  449. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_audit_repo/src/__init__.py +0 -1
  450. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_audit_repo/src/utils.py +0 -22
  451. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_checklist_template.json +0 -110
  452. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_evidence/__init__.py +0 -0
  453. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_evidence/code_evidence_pack.json +0 -40
  454. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_evidence/manifest.json +0 -49
  455. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_evidence/projects/__init__.py +0 -0
  456. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_evidence/projects/mock-audit-project/__init__.py +0 -0
  457. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_evidence/projects/mock-audit-project/brd.md +0 -19
  458. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_evidence/projects/mock-audit-project/design.md +0 -32
  459. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_evidence/projects/mock-audit-project/security.md +0 -23
  460. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_evidence/projects/mock-audit-project/srs.md +0 -25
  461. package/tools/vds-scripts/audit_orchestrator/tests/integration/fixtures/mock_evidence/projects/mock-audit-project/test.md +0 -30
  462. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_checkpoint_merge.py +0 -1371
  463. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_decoupling_route_p149.py +0 -176
  464. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_gap_analyzer_batch_p149.py +0 -151
  465. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_hybrid_search.py +0 -799
  466. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_mcp_integration.py +0 -741
  467. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_merge_ranking_p149.py +0 -98
  468. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_modality_mismatch_p149.py +0 -171
  469. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_phase117_118_storage.py +0 -350
  470. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_phase121_short_circuit.py +0 -732
  471. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_phase18_workflow.py +0 -223
  472. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_phase48_e2e_verification.py +0 -763
  473. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_phase81_doc_anchor_regression.py +0 -252
  474. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_provider_failure_finding_p149.py +0 -339
  475. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_readiness_e2e.py +0 -430
  476. package/tools/vds-scripts/audit_orchestrator/tests/integration/test_refined_workflow.py +0 -1180
  477. package/tools/vds-scripts/audit_orchestrator/tests/pdf/__init__.py +0 -0
  478. package/tools/vds-scripts/audit_orchestrator/tests/pdf/snapshots/__init__.py +0 -0
  479. package/tools/vds-scripts/audit_orchestrator/tests/pdf/snapshots/department_renderer.md +0 -24
  480. package/tools/vds-scripts/audit_orchestrator/tests/pdf/snapshots/project_renderer.md +0 -8
  481. package/tools/vds-scripts/audit_orchestrator/tests/pdf/snapshots/repo_renderer.md +0 -10
  482. package/tools/vds-scripts/audit_orchestrator/tests/pdf/test_department_pdf.py +0 -112
  483. package/tools/vds-scripts/audit_orchestrator/tests/pdf/test_e2e_pdf.py +0 -135
  484. package/tools/vds-scripts/audit_orchestrator/tests/pdf/test_idempotency.py +0 -45
  485. package/tools/vds-scripts/audit_orchestrator/tests/pdf/test_md_renderer.py +0 -46
  486. package/tools/vds-scripts/audit_orchestrator/tests/pdf/test_pdf_cmds.py +0 -97
  487. package/tools/vds-scripts/audit_orchestrator/tests/pdf/test_pdf_snapshot.py +0 -77
  488. package/tools/vds-scripts/audit_orchestrator/tests/pdf/test_pdf_writer.py +0 -65
  489. package/tools/vds-scripts/audit_orchestrator/tests/pdf/test_project_builder.py +0 -199
  490. package/tools/vds-scripts/audit_orchestrator/tests/pdf/test_public_api.py +0 -135
  491. package/tools/vds-scripts/audit_orchestrator/tests/pdf/test_repo_builder.py +0 -246
  492. package/tools/vds-scripts/audit_orchestrator/tests/pdf/test_workflow_pdf_flags.py +0 -36
  493. package/tools/vds-scripts/audit_orchestrator/tests/property/__init__.py +0 -0
  494. package/tools/vds-scripts/audit_orchestrator/tests/property/test_properties.py +0 -807
  495. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/__init__.py +0 -0
  496. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_agent_error_compat.py +0 -38
  497. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_agentic_skill_policy_skip.py +0 -234
  498. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_base_event_stream_logging.py +0 -785
  499. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_base_timeout_policy.py +0 -277
  500. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_base_trace_payload_sanitization.py +0 -92
  501. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_code_agent.py +0 -2311
  502. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_code_agent_re_exports.py +0 -25
  503. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_code_analysis_helpers.py +0 -94
  504. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_create_audit_agent_reasoning_effort.py +0 -69
  505. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_docs_agent.py +0 -2044
  506. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_langgraph_workflow_efficiency_metrics.py +0 -71
  507. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_output_validators.py +0 -317
  508. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_phase41_toolsets.py +0 -6427
  509. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_pydantic_ai_models.py +0 -1219
  510. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_pydantic_base_url_resolution.py +0 -84
  511. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_security_agent.py +0 -2069
  512. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_skill_manager_focus.py +0 -439
  513. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_synthesis_agent.py +0 -1195
  514. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_tool_efficiency_guard_fr120.py +0 -683
  515. package/tools/vds-scripts/audit_orchestrator/tests/test_agents/test_toolsets.py +0 -716
  516. package/tools/vds-scripts/audit_orchestrator/tests/test_aggregator_p149.py +0 -171
  517. package/tools/vds-scripts/audit_orchestrator/tests/test_alembic_migrations.py +0 -287
  518. package/tools/vds-scripts/audit_orchestrator/tests/test_anchor_allowlist_p149.py +0 -273
  519. package/tools/vds-scripts/audit_orchestrator/tests/test_audit_otel.py +0 -283
  520. package/tools/vds-scripts/audit_orchestrator/tests/test_checklist_models.py +0 -583
  521. package/tools/vds-scripts/audit_orchestrator/tests/test_checks/__init__.py +0 -0
  522. package/tools/vds-scripts/audit_orchestrator/tests/test_checks/test_base_check.py +0 -211
  523. package/tools/vds-scripts/audit_orchestrator/tests/test_checks/test_llm_checks.py +0 -126
  524. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/__init__.py +0 -0
  525. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_analyze_command.py +0 -400
  526. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_archive_stale_page_cli.py +0 -217
  527. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_bitbucket_metadata_cli.py +0 -354
  528. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_cli_impl_profile_availability.py +0 -114
  529. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_codex_profile.py +0 -174
  530. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_compare_backends_cli.py +0 -449
  531. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_confluence_parent_auto_resolve.py +0 -451
  532. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_corpus_purge_cli.py +0 -290
  533. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_credentials_preflight.py +0 -106
  534. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_debug_bundle.py +0 -37
  535. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_deprecation_phase157.py +0 -484
  536. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_dispatch_concurrency_diagnostics.py +0 -758
  537. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_check_confluence_cli.py +0 -320
  538. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_codex.py +0 -187
  539. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_corpus_status_cli.py +0 -236
  540. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_correlation_cli.py +0 -128
  541. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_crawl_status_cli.py +0 -192
  542. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_credentials_cli.py +0 -86
  543. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_dispatch_status_cli.py +0 -421
  544. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_heartbeat_phase169.py +0 -173
  545. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_hierarchy_status_cli.py +0 -199
  546. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_locks_cli.py +0 -134
  547. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_logs_follow_cli.py +0 -305
  548. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_migration.py +0 -333
  549. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_profile_availability_cli.py +0 -151
  550. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_doctor_skills_policy_cli.py +0 -153
  551. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_evidence_quality_cli.py +0 -307
  552. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_export_debug_bundle_phase36.py +0 -60
  553. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_export_git_manifest_cli.py +0 -172
  554. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_file_removal_phase157e.py +0 -770
  555. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_grounding_classifier.py +0 -226
  556. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_logging.py +0 -49
  557. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_materials_cli.py +0 -9127
  558. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_metadata_completeness_phase92.py +0 -364
  559. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_parent_dispatch_finalization_phase168f.py +0 -111
  560. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_parse_cli.py +0 -590
  561. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_phase117_118_feature_flags.py +0 -219
  562. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_phase164_control_plane.py +0 -718
  563. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_phase165_runner_scripts.py +0 -230
  564. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_preparation_classifications.py +0 -146
  565. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_prepare_cli.py +0 -398
  566. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_publication_quality_gate.py +0 -126
  567. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_publish_system_doc_cli.py +0 -158
  568. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_query_checklist_cli.py +0 -219
  569. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_readiness_cli.py +0 -673
  570. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_readiness_cli_integration.py +0 -689
  571. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_removed_flags_phase92.py +0 -36
  572. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_report_cmds.py +0 -1317
  573. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_run_history_index.py +0 -57
  574. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_run_management.py +0 -1194
  575. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_runtime_profiles_cli.py +0 -1658
  576. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_smart_run_selection.py +0 -1562
  577. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_state_cli.py +0 -2467
  578. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_state_migration.py +0 -339
  579. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_sync_repos_debug_artifacts.py +0 -1109
  580. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_upload_results_cli.py +0 -809
  581. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_validate_checklist.py +0 -178
  582. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_validate_checklist_cli.py +0 -110
  583. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_validate_spec_sync_cli.py +0 -519
  584. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_workflow_default_parameters_baseline.py +0 -101
  585. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_workflow_options.py +0 -7896
  586. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_workflow_project_db_modes.py +0 -6516
  587. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_workflow_project_project_scope.py +0 -831
  588. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_workflow_project_target.py +0 -611
  589. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_workflow_projects_phase131_lifecycle.py +0 -2488
  590. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_workflow_projects_phase131_scaffolding.py +0 -96
  591. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_workflow_row_key_guard.py +0 -78
  592. package/tools/vds-scripts/audit_orchestrator/tests/test_cli/test_workflow_summary_artifacts.py +0 -1872
  593. package/tools/vds-scripts/audit_orchestrator/tests/test_cli_paths_phase2.py +0 -45
  594. package/tools/vds-scripts/audit_orchestrator/tests/test_clients/__init__.py +0 -0
  595. package/tools/vds-scripts/audit_orchestrator/tests/test_clients/test_bitbucket_cli_client.py +0 -124
  596. package/tools/vds-scripts/audit_orchestrator/tests/test_clients/test_cli_parity.py +0 -110
  597. package/tools/vds-scripts/audit_orchestrator/tests/test_clients/test_confluence_cli_client.py +0 -1149
  598. package/tools/vds-scripts/audit_orchestrator/tests/test_clients/test_sonarqube_cli_client.py +0 -19
  599. package/tools/vds-scripts/audit_orchestrator/tests/test_collectors/__init__.py +0 -0
  600. package/tools/vds-scripts/audit_orchestrator/tests/test_collectors/test_linked_page_tracker.py +0 -118
  601. package/tools/vds-scripts/audit_orchestrator/tests/test_companion_context_service.py +0 -230
  602. package/tools/vds-scripts/audit_orchestrator/tests/test_dspy_modules/__init__.py +0 -0
  603. package/tools/vds-scripts/audit_orchestrator/tests/test_dspy_modules/conftest.py +0 -11
  604. package/tools/vds-scripts/audit_orchestrator/tests/test_dspy_modules/test_compile_artifact.py +0 -465
  605. package/tools/vds-scripts/audit_orchestrator/tests/test_dspy_modules/test_cross_provider_critique.py +0 -120
  606. package/tools/vds-scripts/audit_orchestrator/tests/test_dspy_modules/test_cross_provider_critique_e2e.py +0 -75
  607. package/tools/vds-scripts/audit_orchestrator/tests/test_dspy_modules/test_evaluation.py +0 -515
  608. package/tools/vds-scripts/audit_orchestrator/tests/test_dspy_modules/test_runtime_loader.py +0 -537
  609. package/tools/vds-scripts/audit_orchestrator/tests/test_dspy_modules/test_signatures_normalization.py +0 -172
  610. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/__init__.py +0 -0
  611. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_auditor_applicability.py +0 -68
  612. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_checklist_generator.py +0 -1252
  613. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_checklist_projection.py +0 -54
  614. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_confluence_checklist_projection_consistency.py +0 -1696
  615. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_critique_merger_matrix.py +0 -120
  616. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_cross_check_rules.py +0 -459
  617. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_cross_provider_critique.py +0 -55
  618. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_doc_loader.py +0 -73
  619. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_drift_detector.py +0 -34
  620. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_evidence_collectors.py +0 -93
  621. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_lease_timeout.py +0 -114
  622. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_loader.py +0 -350
  623. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_loader_parity.py +0 -179
  624. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_low_confidence_reeval.py +0 -691
  625. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_phase145a_completion.py +0 -209
  626. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_phase31_row_consistency_retry_benchmark.py +0 -150
  627. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_profile_detector.py +0 -286
  628. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_regression_guard.py +0 -53
  629. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_result_merger.py +0 -619
  630. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_row_evaluator.py +0 -15783
  631. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_row_failover.py +0 -215
  632. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_scorer.py +0 -597
  633. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_skill_breakdown_telemetry_fr137.py +0 -421
  634. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_targeted_auto_merge.py +0 -229
  635. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_timeout_failover.py +0 -488
  636. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_timeout_telemetry.py +0 -73
  637. package/tools/vds-scripts/audit_orchestrator/tests/test_engine/test_validator.py +0 -419
  638. package/tools/vds-scripts/audit_orchestrator/tests/test_incremental/__init__.py +0 -0
  639. package/tools/vds-scripts/audit_orchestrator/tests/test_incremental/test_diff_detector.py +0 -111
  640. package/tools/vds-scripts/audit_orchestrator/tests/test_infra_persistence.py +0 -291
  641. package/tools/vds-scripts/audit_orchestrator/tests/test_integration/__init__.py +0 -0
  642. package/tools/vds-scripts/audit_orchestrator/tests/test_integration/test_phase3_integration.py +0 -516
  643. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/__init__.py +0 -0
  644. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_cache.py +0 -670
  645. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_codex_model_builder.py +0 -281
  646. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_codex_oauth.py +0 -330
  647. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_codex_streaming.py +0 -433
  648. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_cost_tracker.py +0 -27
  649. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_engine.py +0 -876
  650. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_evaluator.py +0 -212
  651. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_instruction_templates.py +0 -639
  652. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_prompt_metadata.py +0 -97
  653. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_prompts.py +0 -660
  654. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_provider.py +0 -330
  655. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_provider_contract_sync.py +0 -18
  656. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_reasoning_effort_validation.py +0 -565
  657. package/tools/vds-scripts/audit_orchestrator/tests/test_llm/test_schemas.py +0 -827
  658. package/tools/vds-scripts/audit_orchestrator/tests/test_logging_config.py +0 -297
  659. package/tools/vds-scripts/audit_orchestrator/tests/test_models/__init__.py +0 -0
  660. package/tools/vds-scripts/audit_orchestrator/tests/test_models/test_enums.py +0 -185
  661. package/tools/vds-scripts/audit_orchestrator/tests/test_models/test_findings.py +0 -1159
  662. package/tools/vds-scripts/audit_orchestrator/tests/test_models/test_project_profile.py +0 -307
  663. package/tools/vds-scripts/audit_orchestrator/tests/test_models/test_registry.py +0 -532
  664. package/tools/vds-scripts/audit_orchestrator/tests/test_models/test_template.py +0 -708
  665. package/tools/vds-scripts/audit_orchestrator/tests/test_observability/__init__.py +0 -0
  666. package/tools/vds-scripts/audit_orchestrator/tests/test_observability/test_metrics.py +0 -60
  667. package/tools/vds-scripts/audit_orchestrator/tests/test_paths_config_phase2.py +0 -21
  668. package/tools/vds-scripts/audit_orchestrator/tests/test_performance/__init__.py +0 -0
  669. package/tools/vds-scripts/audit_orchestrator/tests/test_performance/test_fr79_performance_guardrails.py +0 -199
  670. package/tools/vds-scripts/audit_orchestrator/tests/test_phase156_hardening.py +0 -498
  671. package/tools/vds-scripts/audit_orchestrator/tests/test_phase93_regression_guards.py +0 -123
  672. package/tools/vds-scripts/audit_orchestrator/tests/test_pipeline_integration.py +0 -517
  673. package/tools/vds-scripts/audit_orchestrator/tests/test_profiles/__init__.py +0 -0
  674. package/tools/vds-scripts/audit_orchestrator/tests/test_profiles/test_detection.py +0 -146
  675. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/__init__.py +0 -0
  676. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_bitbucket_link_resolver.py +0 -55
  677. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_checklist_renderer.py +0 -84
  678. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_checklist_renderer_projection.py +0 -97
  679. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_confluence_macros.py +0 -58
  680. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_confluence_publisher.py +0 -2171
  681. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_evidence_links.py +0 -129
  682. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_field_sanitizer.py +0 -108
  683. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_hierarchy_publisher.py +0 -134
  684. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_incremental_plan_parser.py +0 -62
  685. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_live_data_injector.py +0 -48
  686. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_macro_builder.py +0 -22
  687. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_p161_confluence_optimization.py +0 -168
  688. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_priority_renderer.py +0 -96
  689. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_project_aggregate_renderer.py +0 -364
  690. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_storage_validation.py +0 -273
  691. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_summary_refactor.py +0 -118
  692. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_system_doc_hierarchy.py +0 -50
  693. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_table_builder.py +0 -23
  694. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_vietnamese_templates.py +0 -37
  695. package/tools/vds-scripts/audit_orchestrator/tests/test_publishers/test_wiring_integration.py +0 -290
  696. package/tools/vds-scripts/audit_orchestrator/tests/test_reports/__init__.py +0 -0
  697. package/tools/vds-scripts/audit_orchestrator/tests/test_reports/test_aggregation_report.py +0 -181
  698. package/tools/vds-scripts/audit_orchestrator/tests/test_reports/test_checklist_generator.py +0 -258
  699. package/tools/vds-scripts/audit_orchestrator/tests/test_reports/test_gap_report.py +0 -73
  700. package/tools/vds-scripts/audit_orchestrator/tests/test_reports/test_json_generator.py +0 -317
  701. package/tools/vds-scripts/audit_orchestrator/tests/test_result_merger_p149.py +0 -347
  702. package/tools/vds-scripts/audit_orchestrator/tests/test_route_mode_p149.py +0 -178
  703. package/tools/vds-scripts/audit_orchestrator/tests/test_rubric_parser.py +0 -179
  704. package/tools/vds-scripts/audit_orchestrator/tests/test_scorer.py +0 -110
  705. package/tools/vds-scripts/audit_orchestrator/tests/test_state/__init__.py +0 -0
  706. package/tools/vds-scripts/audit_orchestrator/tests/test_state/test_sparse_coverage.py +0 -117
  707. package/tools/vds-scripts/audit_orchestrator/tests/test_workflow/__init__.py +0 -0
  708. package/tools/vds-scripts/audit_orchestrator/tests/test_workflow/test_langgraph_workflow.py +0 -2072
  709. package/tools/vds-scripts/audit_orchestrator/tests/test_workflow/test_p161_runtime_hardening.py +0 -341
  710. package/tools/vds-scripts/audit_orchestrator/tests/test_workflow_cmds_p149.py +0 -112
  711. package/tools/vds-scripts/audit_orchestrator/tests/test_workflow_cmds_p172.py +0 -126
  712. package/tools/vds-scripts/audit_orchestrator/tests/test_workflow_guidance_p150.py +0 -95
  713. package/tools/vds-scripts/audit_orchestrator/tests/unit/__init__.py +0 -0
  714. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/__init__.py +0 -0
  715. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_agentic_investigator_phase115.py +0 -42
  716. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_requirement_analysis_agent.py +0 -412
  717. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_security_agent_updates.py +0 -131
  718. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_security_scanner.py +0 -397
  719. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_skill_executor.py +0 -316
  720. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_skill_fallback.py +0 -299
  721. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_skill_policy.py +0 -520
  722. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_skill_telemetry.py +0 -306
  723. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_synthesis_fixes.py +0 -761
  724. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_tool_argument_robustness.py +0 -272
  725. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_tool_registry.py +0 -2548
  726. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_tool_registry_ast_grep.py +0 -87
  727. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_tool_registry_phase123_scoping.py +0 -353
  728. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_tool_registry_phase94_ff.py +0 -445
  729. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_tool_registry_vector_search_phase115.py +0 -35
  730. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_utils.py +0 -1007
  731. package/tools/vds-scripts/audit_orchestrator/tests/unit/agents/test_vector_evidence_toolset.py +0 -622
  732. package/tools/vds-scripts/audit_orchestrator/tests/unit/cli/__init__.py +0 -0
  733. package/tools/vds-scripts/audit_orchestrator/tests/unit/cli/test_workflow_cli.py +0 -123
  734. package/tools/vds-scripts/audit_orchestrator/tests/unit/collectors/__init__.py +0 -0
  735. package/tools/vds-scripts/audit_orchestrator/tests/unit/collectors/test_cache_guard.py +0 -479
  736. package/tools/vds-scripts/audit_orchestrator/tests/unit/collectors/test_checklist_parser_phase120.py +0 -55
  737. package/tools/vds-scripts/audit_orchestrator/tests/unit/collectors/test_diagram_extractor.py +0 -467
  738. package/tools/vds-scripts/audit_orchestrator/tests/unit/collectors/test_enrichment_extractor.py +0 -59
  739. package/tools/vds-scripts/audit_orchestrator/tests/unit/collectors/test_graphify_collector.py +0 -158
  740. package/tools/vds-scripts/audit_orchestrator/tests/unit/completeness/__init__.py +0 -0
  741. package/tools/vds-scripts/audit_orchestrator/tests/unit/completeness/test_completeness.py +0 -563
  742. package/tools/vds-scripts/audit_orchestrator/tests/unit/completeness/test_freshness_evaluator.py +0 -493
  743. package/tools/vds-scripts/audit_orchestrator/tests/unit/completeness/test_material_cache_metrics.py +0 -365
  744. package/tools/vds-scripts/audit_orchestrator/tests/unit/completeness/test_material_completeness_service.py +0 -2736
  745. package/tools/vds-scripts/audit_orchestrator/tests/unit/config_resolution/__init__.py +0 -0
  746. package/tools/vds-scripts/audit_orchestrator/tests/unit/config_resolution/test_discovery.py +0 -47
  747. package/tools/vds-scripts/audit_orchestrator/tests/unit/config_resolution/test_redaction.py +0 -15
  748. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/__init__.py +0 -0
  749. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_ad_hoc_analyzer.py +0 -576
  750. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_agent_loop.py +0 -1896
  751. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_anchor_filter_cl003.py +0 -181
  752. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_batch_evidence_cache.py +0 -155
  753. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_batch_processor.py +0 -3608
  754. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_checklist_contract.py +0 -55
  755. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_checklist_scoping.py +0 -371
  756. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_config_companion_phase123.py +0 -142
  757. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_config_evidence_phase123.py +0 -249
  758. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_confluence_checklist_contract_export_parity.py +0 -813
  759. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_cross_repo_config_phase122.py +0 -613
  760. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_dspy_requirement_classifier.py +0 -517
  761. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_evidence_diversity.py +0 -144
  762. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_evidence_truncation.py +0 -108
  763. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_grounding_validator.py +0 -127
  764. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_guidance_injection_phase120.py +0 -105
  765. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_instruction_analysis_phase122.py +0 -761
  766. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_instruction_pre_filter_phase167.py +0 -334
  767. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_llm_row_evaluator_retries.py +0 -3684
  768. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_loader_phase123.py +0 -345
  769. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_manual_check_gating_phase122.py +0 -474
  770. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_parallel_eval.py +0 -263
  771. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_phase122_verifier_phase122.py +0 -169
  772. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_phase166_route_failover.py +0 -437
  773. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_post_eval_cl003_shared_lib.py +0 -267
  774. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_postproc_streaming.py +0 -194
  775. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_pre_eval_gating_phase122.py +0 -362
  776. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_prepare_topology_coverage.py +0 -247
  777. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_private_dns_sanitization_phase104.py +0 -397
  778. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_project_evidence_context.py +0 -450
  779. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_project_knowledge_store.py +0 -487
  780. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_project_topology.py +0 -1142
  781. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_provider_failure_classifier.py +0 -195
  782. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_readiness_extractor.py +0 -496
  783. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_readiness_synthesizer.py +0 -653
  784. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_repo_type_classifier.py +0 -303
  785. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_requirement_analysis.py +0 -508
  786. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_requirement_analysis_execution_scope.py +0 -239
  787. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_requirement_analysis_phase114.py +0 -919
  788. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_requirement_analysis_phase115.py +0 -97
  789. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_requirement_analysis_shared_lib.py +0 -340
  790. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_requirement_classification_drift.py +0 -729
  791. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_requirement_classification_nlp.py +0 -670
  792. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_requirement_scope_phase122.py +0 -615
  793. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_route_matrix.py +0 -258
  794. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_route_override.py +0 -141
  795. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_routing_precision.py +0 -650
  796. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_row_evaluator_dual_evidence.py +0 -2987
  797. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_row_evaluator_instruction_runtime_phase122.py +0 -365
  798. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_row_evaluator_runtime.py +0 -830
  799. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_runtime_hardening_phase122.py +0 -225
  800. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_scoped_na_skip.py +0 -107
  801. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_scoring_enhancements.py +0 -404
  802. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_shared_library_retrieval_phase123.py +0 -441
  803. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_shared_library_routing_phase123.py +0 -279
  804. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_shared_resource_indexing_phase122.py +0 -188
  805. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_skill_recommendation.py +0 -225
  806. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_skill_routing_cl003_shared_lib.py +0 -338
  807. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_skills_toolset.py +0 -319
  808. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_stability_metric.py +0 -60
  809. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_target_selector.py +0 -958
  810. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_token_tracker.py +0 -121
  811. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_token_wiring.py +0 -119
  812. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_tool_first_planner.py +0 -7103
  813. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_topology_knowledge_persistence.py +0 -332
  814. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_topology_query_service.py +0 -55
  815. package/tools/vds-scripts/audit_orchestrator/tests/unit/engine/test_unverified_ref_retry.py +0 -909
  816. package/tools/vds-scripts/audit_orchestrator/tests/unit/models/__init__.py +0 -0
  817. package/tools/vds-scripts/audit_orchestrator/tests/unit/models/test_evidence.py +0 -515
  818. package/tools/vds-scripts/audit_orchestrator/tests/unit/models/test_gaps.py +0 -422
  819. package/tools/vds-scripts/audit_orchestrator/tests/unit/models/test_readiness.py +0 -428
  820. package/tools/vds-scripts/audit_orchestrator/tests/unit/publishers/__init__.py +0 -0
  821. package/tools/vds-scripts/audit_orchestrator/tests/unit/publishers/test_confluence_hierarchy.py +0 -227
  822. package/tools/vds-scripts/audit_orchestrator/tests/unit/publishers/test_project_title_generation.py +0 -335
  823. package/tools/vds-scripts/audit_orchestrator/tests/unit/publishers/test_publisher_registry_helpers.py +0 -290
  824. package/tools/vds-scripts/audit_orchestrator/tests/unit/publishers/test_publisher_registry_integration.py +0 -557
  825. package/tools/vds-scripts/audit_orchestrator/tests/unit/publishers/test_readiness_renderer.py +0 -381
  826. package/tools/vds-scripts/audit_orchestrator/tests/unit/publishers/test_repo_title_consistency.py +0 -266
  827. package/tools/vds-scripts/audit_orchestrator/tests/unit/publishers/test_upload_hierarchy_integration.py +0 -470
  828. package/tools/vds-scripts/audit_orchestrator/tests/unit/scripts/__init__.py +0 -0
  829. package/tools/vds-scripts/audit_orchestrator/tests/unit/scripts/test_benchmark_dspy.py +0 -177
  830. package/tools/vds-scripts/audit_orchestrator/tests/unit/scripts/test_benchmark_nlp_accuracy.py +0 -72
  831. package/tools/vds-scripts/audit_orchestrator/tests/unit/scripts/test_benchmark_retrieval_modes.py +0 -123
  832. package/tools/vds-scripts/audit_orchestrator/tests/unit/scripts/test_verify_phase111_requirement_analysis.py +0 -409
  833. package/tools/vds-scripts/audit_orchestrator/tests/unit/seed/__init__.py +0 -0
  834. package/tools/vds-scripts/audit_orchestrator/tests/unit/seed/test_seed_chain_cli.py +0 -277
  835. package/tools/vds-scripts/audit_orchestrator/tests/unit/seed/test_seed_loader.py +0 -502
  836. package/tools/vds-scripts/audit_orchestrator/tests/unit/skills/__init__.py +0 -0
  837. package/tools/vds-scripts/audit_orchestrator/tests/unit/skills/test_skill_routing.py +0 -209
  838. package/tools/vds-scripts/audit_orchestrator/tests/unit/sources/__init__.py +0 -0
  839. package/tools/vds-scripts/audit_orchestrator/tests/unit/sources/test_bitbucket_source.py +0 -66
  840. package/tools/vds-scripts/audit_orchestrator/tests/unit/sources/test_non_retryable_markers.py +0 -88
  841. package/tools/vds-scripts/audit_orchestrator/tests/unit/sources/test_repo_info.py +0 -212
  842. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/__init__.py +0 -0
  843. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_completeness.py +0 -598
  844. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_dispatch_events_contract_phase169.py +0 -100
  845. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_dispatch_hardening_phase158.py +0 -392
  846. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_dispatch_persistence_phase157.py +0 -914
  847. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_embedding_client.py +0 -64
  848. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_get_latest_completed_run.py +0 -313
  849. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_heartbeat_phase169.py +0 -109
  850. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_hybrid_search.py +0 -398
  851. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_normalize_url.py +0 -262
  852. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_phase152_query_surface.py +0 -59
  853. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_phase98_confluence_document_model.py +0 -202
  854. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_published_pages.py +0 -754
  855. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_readiness_helpers.py +0 -193
  856. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_run_ledger.py +0 -522
  857. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_run_management.py +0 -378
  858. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_schema_contract_phase170.py +0 -755
  859. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_state_cmds.py +0 -231
  860. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_state_loaders.py +0 -2151
  861. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_state_run_api.py +0 -2226
  862. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_store.py +0 -1435
  863. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_store_dispatch.py +0 -646
  864. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_store_dispatch_status_view.py +0 -181
  865. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_store_scope.py +0 -213
  866. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_utilization_persist_phase169.py +0 -77
  867. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_vds_search.py +0 -263
  868. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_vector_index_api.py +0 -319
  869. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_vector_index_runtime.py +0 -175
  870. package/tools/vds-scripts/audit_orchestrator/tests/unit/state/test_vector_index_store.py +0 -1756
  871. package/tools/vds-scripts/audit_orchestrator/tests/unit/sync/__init__.py +0 -0
  872. package/tools/vds-scripts/audit_orchestrator/tests/unit/sync/test_repo_sync.py +0 -257
  873. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_artifact_exclusion.py +0 -119
  874. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_auto_promote_phase158.py +0 -337
  875. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_carry_forward_artifact_filtering.py +0 -317
  876. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_checklist_precache_p160a.py +0 -416
  877. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_cli_decomposition_fr219.py +0 -269
  878. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_code_chunk_carry_forward.py +0 -203
  879. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_config_coherence.py +0 -180
  880. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_config_secret_policy.py +0 -522
  881. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_corpus_project_id_migration.py +0 -318
  882. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_corpus_status_diagnostics.py +0 -239
  883. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_department_priority_ordering.py +0 -131
  884. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_dispatch_coordinator_phase158.py +0 -402
  885. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_dispatch_job_identity_p167a.py +0 -238
  886. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_dispatch_ramp_up_phase171.py +0 -434
  887. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_dispatcher.py +0 -911
  888. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_doc_type_en_inference.py +0 -246
  889. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_early_exit_unchunked_repos.py +0 -111
  890. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_errors.py +0 -237
  891. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_errors_taxonomy.py +0 -83
  892. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_extract_chunking_config_phase98.py +0 -73
  893. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_extract_cmds_state_helpers.py +0 -33
  894. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_extract_docs_code_chunking.py +0 -260
  895. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_finalize_dispatch_run_phase168.py +0 -341
  896. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_identity.py +0 -221
  897. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_infrastructure_detection.py +0 -441
  898. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_junction_table_phase95.py +0 -259
  899. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_late_binding_assignment_p167c.py +0 -286
  900. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_misc_cmds_fr224_225_hardening.py +0 -194
  901. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_p172_integration.py +0 -306
  902. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_parent_provider_preflight.py +0 -118
  903. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_performance_gates_phase92.py +0 -141
  904. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_performance_gates_phase93.py +0 -50
  905. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_phase115_search_strategy.py +0 -106
  906. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_phase154_title_consistency.py +0 -117
  907. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_phase155_param_forwarding.py +0 -304
  908. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_phase158_concurrency_defaults.py +0 -207
  909. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_phase170_doctor_schema.py +0 -319
  910. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_phase170_regression.py +0 -334
  911. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_phase94_corpus_lifecycle.py +0 -307
  912. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_phase96_repo_key_migration.py +0 -305
  913. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_pipelined_scheduling.py +0 -130
  914. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_profile_availability_probe.py +0 -616
  915. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_profile_aware_row_timeout.py +0 -102
  916. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_profile_timeout_stagger_p160cd.py +0 -205
  917. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_progress_summary_phase169.py +0 -96
  918. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_registry_checklist_diagnostics.py +0 -124
  919. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_resume_manifest_p167b.py +0 -268
  920. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_risk_mitigations_p160e1.py +0 -348
  921. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_single_row_shards_p160b.py +0 -357
  922. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_state_repo_discovery.py +0 -504
  923. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_sync_metadata_entries.py +0 -57
  924. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_task_models.py +0 -1796
  925. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_utilization_telemetry_p167e.py +0 -259
  926. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_vietnamese_fts_hardening.py +0 -160
  927. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_workflow_phase98_enrichment.py +0 -92
  928. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_workflow_project_merge_materialization.py +0 -322
  929. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_workflow_row_key_migration_guard.py +0 -88
  930. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_workflow_short_circuit_phase121.py +0 -564
  931. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_workflow_single_target_row_context.py +0 -49
  932. package/tools/vds-scripts/audit_orchestrator/tests/unit/test_zero_result_messaging.py +0 -76
  933. package/tools/vds-scripts/bandit-report.json +0 -2974
  934. package/tools/vds-scripts/brd_orchestrator/README.md +0 -29
  935. package/tools/vds-scripts/brd_orchestrator/pyproject.toml +0 -63
  936. package/tools/vds-scripts/brd_orchestrator/src/vds_brd_orchestrator/__init__.py +0 -17
  937. package/tools/vds-scripts/brd_orchestrator/src/vds_brd_orchestrator/cli.py +0 -187
  938. package/tools/vds-scripts/brd_orchestrator/src/vds_brd_orchestrator/validator.py +0 -121
  939. package/tools/vds-scripts/brd_orchestrator/tests/__init__.py +0 -0
  940. package/tools/vds-scripts/brd_orchestrator/tests/test_cli.py +0 -62
  941. package/tools/vds-scripts/brd_orchestrator/tests/test_validator.py +0 -33
  942. package/tools/vds-scripts/circular_dependency_orchestrator/README.md +0 -30
  943. package/tools/vds-scripts/circular_dependency_orchestrator/pyproject.toml +0 -43
  944. package/tools/vds-scripts/circular_dependency_orchestrator/src/vds_circular_dependency_orchestrator/__init__.py +0 -16
  945. package/tools/vds-scripts/circular_dependency_orchestrator/src/vds_circular_dependency_orchestrator/cli.py +0 -904
  946. package/tools/vds-scripts/circular_dependency_orchestrator/tests/__init__.py +0 -0
  947. package/tools/vds-scripts/circular_dependency_orchestrator/tests/unit/__init__.py +0 -0
  948. package/tools/vds-scripts/circular_dependency_orchestrator/tests/unit/test_cli.py +0 -354
  949. package/tools/vds-scripts/coverage.json +0 -1
  950. package/tools/vds-scripts/create_pr.py +0 -57
  951. package/tools/vds-scripts/diagram_generator/README.md +0 -663
  952. package/tools/vds-scripts/diagram_generator/ci_validate.sh +0 -16
  953. package/tools/vds-scripts/diagram_generator/docs-nttc/projects/INSURANCE/analysis/current-state/insurance-claim-business/insurance-claim-business-component.png +0 -0
  954. package/tools/vds-scripts/diagram_generator/docs-nttc/projects/INSURANCE/analysis/current-state/insurance-claim-business/insurance-claim-business-component.puml +0 -23
  955. package/tools/vds-scripts/diagram_generator/docs-nttc/projects/INSURANCE/analysis/current-state/insurance-claim-business/insurance-claim-business-sequence.png +0 -0
  956. package/tools/vds-scripts/diagram_generator/docs-nttc/projects/INSURANCE/analysis/current-state/insurance-claim-business/insurance-claim-business-sequence.puml +0 -21
  957. package/tools/vds-scripts/diagram_generator/docs-nttc/projects/INSURANCE/analysis/current-state/insurance-claim-business/insurance-claim-business-usecase.png +0 -0
  958. package/tools/vds-scripts/diagram_generator/docs-nttc/projects/INSURANCE/analysis/current-state/insurance-claim-business/insurance-claim-business-usecase.puml +0 -14
  959. package/tools/vds-scripts/diagram_generator/examples/github-actions-validate.yml +0 -39
  960. package/tools/vds-scripts/diagram_generator/generate_all_diagrams.py +0 -827
  961. package/tools/vds-scripts/diagram_generator/generate_insurance_c4_diagrams.py +0 -261
  962. package/tools/vds-scripts/diagram_generator/generate_insurance_c4_quick.py +0 -486
  963. package/tools/vds-scripts/diagram_generator/pyproject.toml +0 -28
  964. package/tools/vds-scripts/diagram_generator/render_png.py +0 -59
  965. package/tools/vds-scripts/diagram_generator/src/vds_diagram_generator/__init__.py +0 -3
  966. package/tools/vds-scripts/diagram_generator/src/vds_diagram_generator/cli.py +0 -50
  967. package/tools/vds-scripts/diagram_generator/test_c4_hierarchical.py +0 -142
  968. package/tools/vds-scripts/diagram_generator/test_c4_quick.py +0 -131
  969. package/tools/vds-scripts/diagram_generator/tests/__init__.py +0 -0
  970. package/tools/vds-scripts/diagram_generator/tests/test_analyzer_completeness.py +0 -260
  971. package/tools/vds-scripts/diagram_generator/tests/test_c4_syntax_correctness.py +0 -138
  972. package/tools/vds-scripts/diagram_generator/tests/test_component_coverage.py +0 -182
  973. package/tools/vds-scripts/diagram_generator/tests/test_mermaid_output.py +0 -80
  974. package/tools/vds-scripts/diagram_generator/tests/test_png_generation.py +0 -112
  975. package/tools/vds-scripts/diagram_generator/tests/test_scenario_templates.py +0 -15
  976. package/tools/vds-scripts/diagram_generator/tests/test_sequence_accuracy.py +0 -93
  977. package/tools/vds-scripts/diagram_generator/tests/test_structurizr_export.py +0 -177
  978. package/tools/vds-scripts/diagram_generator/tests/test_style_consistency.py +0 -174
  979. package/tools/vds-scripts/diagram_generator/tests/test_usecase_generator.py +0 -201
  980. package/tools/vds-scripts/diagram_generator/tests/test_usecase_integration.py +0 -124
  981. package/tools/vds-scripts/docker/compose.phase2-verification.yml +0 -31
  982. package/tools/vds-scripts/docker-compose.openapi-validator.yml +0 -14
  983. package/tools/vds-scripts/excel_orchestrator/README.md +0 -288
  984. package/tools/vds-scripts/excel_orchestrator/RESEARCH_BASED_UPDATES_REPORT.md +0 -261
  985. package/tools/vds-scripts/excel_orchestrator/add_essential_missing_effort.py +0 -255
  986. package/tools/vds-scripts/excel_orchestrator/adjust_effort_complexity.py +0 -184
  987. package/tools/vds-scripts/excel_orchestrator/brd_analysis_and_task_breakdown.py +0 -632
  988. package/tools/vds-scripts/excel_orchestrator/brd_analysis_comprehensive.py +0 -1029
  989. package/tools/vds-scripts/excel_orchestrator/check_overlaps_and_brd_coverage.py +0 -570
  990. package/tools/vds-scripts/excel_orchestrator/clean_remarks_column.py +0 -127
  991. package/tools/vds-scripts/excel_orchestrator/comprehensive_brd_check.py +0 -322
  992. package/tools/vds-scripts/excel_orchestrator/create_buffered_summary.py +0 -119
  993. package/tools/vds-scripts/excel_orchestrator/create_service_totals_sheet.py +0 -118
  994. package/tools/vds-scripts/excel_orchestrator/examples/basic_operations.py +0 -85
  995. package/tools/vds-scripts/excel_orchestrator/expand_all_tasks.py +0 -341
  996. package/tools/vds-scripts/excel_orchestrator/expand_tasks.py +0 -304
  997. package/tools/vds-scripts/excel_orchestrator/fill_brd_references.py +0 -347
  998. package/tools/vds-scripts/excel_orchestrator/fill_remarks_and_colors.py +0 -132
  999. package/tools/vds-scripts/excel_orchestrator/finalize_brd_and_cleanup.py +0 -295
  1000. package/tools/vds-scripts/excel_orchestrator/finalize_brd_coverage.py +0 -327
  1001. package/tools/vds-scripts/excel_orchestrator/fix_all_formulas.py +0 -99
  1002. package/tools/vds-scripts/excel_orchestrator/fix_detail_presentation.py +0 -113
  1003. package/tools/vds-scripts/excel_orchestrator/fix_presentation_and_effort.py +0 -116
  1004. package/tools/vds-scripts/excel_orchestrator/fix_presentation_consistency.py +0 -231
  1005. package/tools/vds-scripts/excel_orchestrator/fix_remarks_matching.py +0 -179
  1006. package/tools/vds-scripts/excel_orchestrator/group_tasks_by_service_id.py +0 -210
  1007. package/tools/vds-scripts/excel_orchestrator/increase_brd_coverage.py +0 -497
  1008. package/tools/vds-scripts/excel_orchestrator/increase_effort_complexity.py +0 -155
  1009. package/tools/vds-scripts/excel_orchestrator/organize_and_deduplicate.py +0 -273
  1010. package/tools/vds-scripts/excel_orchestrator/pyproject.toml +0 -64
  1011. package/tools/vds-scripts/excel_orchestrator/rebuild_all_formulas.py +0 -146
  1012. package/tools/vds-scripts/excel_orchestrator/remove_base_multiplier_and_check_duplicates.py +0 -310
  1013. package/tools/vds-scripts/excel_orchestrator/remove_duplicate_brd_tasks.py +0 -137
  1014. package/tools/vds-scripts/excel_orchestrator/research_based_updates.py +0 -457
  1015. package/tools/vds-scripts/excel_orchestrator/restore_e_values.py +0 -172
  1016. package/tools/vds-scripts/excel_orchestrator/src/vds_excel_orchestrator/__init__.py +0 -5
  1017. package/tools/vds-scripts/excel_orchestrator/src/vds_excel_orchestrator/cli.py +0 -746
  1018. package/tools/vds-scripts/excel_orchestrator/src/vds_excel_orchestrator/config.py +0 -74
  1019. package/tools/vds-scripts/excel_orchestrator/src/vds_excel_orchestrator/converters.py +0 -226
  1020. package/tools/vds-scripts/excel_orchestrator/src/vds_excel_orchestrator/errors.py +0 -88
  1021. package/tools/vds-scripts/excel_orchestrator/src/vds_excel_orchestrator/excel_client.py +0 -443
  1022. package/tools/vds-scripts/excel_orchestrator/src/vds_excel_orchestrator/formatters.py +0 -211
  1023. package/tools/vds-scripts/excel_orchestrator/src/vds_excel_orchestrator/logging.py +0 -57
  1024. package/tools/vds-scripts/excel_orchestrator/src/vds_excel_orchestrator/source_contract.py +0 -29
  1025. package/tools/vds-scripts/excel_orchestrator/src/vds_excel_orchestrator/target_state_status.py +0 -837
  1026. package/tools/vds-scripts/excel_orchestrator/src/vds_excel_orchestrator/ulnc_alignment.py +0 -1291
  1027. package/tools/vds-scripts/excel_orchestrator/src/vds_excel_orchestrator/validators.py +0 -164
  1028. package/tools/vds-scripts/excel_orchestrator/sync_detail_and_total_sheets.py +0 -211
  1029. package/tools/vds-scripts/excel_orchestrator/tests/__init__.py +0 -1
  1030. package/tools/vds-scripts/excel_orchestrator/tests/conftest.py +0 -36
  1031. package/tools/vds-scripts/excel_orchestrator/tests/test_cli.py +0 -383
  1032. package/tools/vds-scripts/excel_orchestrator/tests/test_excel_client.py +0 -129
  1033. package/tools/vds-scripts/excel_orchestrator/tests/test_ulnc_alignment.py +0 -373
  1034. package/tools/vds-scripts/excel_orchestrator/tests/test_validators.py +0 -64
  1035. package/tools/vds-scripts/excel_orchestrator/update_api_database_effort.py +0 -261
  1036. package/tools/vds-scripts/excel_orchestrator/update_buffers_inline.py +0 -115
  1037. package/tools/vds-scripts/excel_orchestrator/update_complex_services_and_add_new.py +0 -336
  1038. package/tools/vds-scripts/excel_orchestrator/update_responsibility_and_fix_rows.py +0 -208
  1039. package/tools/vds-scripts/excel_orchestrator/update_task_breakdown_vietnamese.py +0 -309
  1040. package/tools/vds-scripts/excel_orchestrator/update_vietnamese_and_responsibility.py +0 -415
  1041. package/tools/vds-scripts/excel_orchestrator/verify_brd_coverage_comprehensive.py +0 -401
  1042. package/tools/vds-scripts/hexagonal_orchestrator/README.md +0 -530
  1043. package/tools/vds-scripts/hexagonal_orchestrator/pyproject.toml +0 -48
  1044. package/tools/vds-scripts/hexagonal_orchestrator/src/vds_hexagonal_orchestrator/__init__.py +0 -39
  1045. package/tools/vds-scripts/hexagonal_orchestrator/src/vds_hexagonal_orchestrator/analyzers/__init__.py +0 -19
  1046. package/tools/vds-scripts/hexagonal_orchestrator/src/vds_hexagonal_orchestrator/analyzers/base.py +0 -95
  1047. package/tools/vds-scripts/hexagonal_orchestrator/src/vds_hexagonal_orchestrator/analyzers/fallback.py +0 -614
  1048. package/tools/vds-scripts/hexagonal_orchestrator/src/vds_hexagonal_orchestrator/analyzers/java.py +0 -372
  1049. package/tools/vds-scripts/hexagonal_orchestrator/src/vds_hexagonal_orchestrator/analyzers/python.py +0 -437
  1050. package/tools/vds-scripts/hexagonal_orchestrator/src/vds_hexagonal_orchestrator/cache.py +0 -331
  1051. package/tools/vds-scripts/hexagonal_orchestrator/src/vds_hexagonal_orchestrator/classifier.py +0 -263
  1052. package/tools/vds-scripts/hexagonal_orchestrator/src/vds_hexagonal_orchestrator/cli.py +0 -554
  1053. package/tools/vds-scripts/hexagonal_orchestrator/src/vds_hexagonal_orchestrator/config.py +0 -577
  1054. package/tools/vds-scripts/hexagonal_orchestrator/src/vds_hexagonal_orchestrator/models.py +0 -159
  1055. package/tools/vds-scripts/hexagonal_orchestrator/src/vds_hexagonal_orchestrator/profiler.py +0 -451
  1056. package/tools/vds-scripts/hexagonal_orchestrator/test-config.yaml +0 -38
  1057. package/tools/vds-scripts/hexagonal_orchestrator/tests/__init__.py +0 -1
  1058. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/__init__.py +0 -1
  1059. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/java-compliant/adapter/driven/persistence/InMemoryUserRepository.java +0 -62
  1060. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/java-compliant/adapter/driving/api/UserController.java +0 -101
  1061. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/java-compliant/application/port/EmailService.java +0 -33
  1062. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/java-compliant/application/port/UserRepository.java +0 -45
  1063. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/java-compliant/application/usecase/CreateUser.java +0 -58
  1064. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/java-compliant/domain/entity/Email.java +0 -80
  1065. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/java-compliant/domain/entity/User.java +0 -98
  1066. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/java-noncompliant/domain/User.java +0 -64
  1067. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/java-with-frameworks/domain/Menu.java +0 -13
  1068. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/java-with-frameworks/domain/Product.java +0 -16
  1069. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/python-compliant/__init__.py +0 -1
  1070. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/python-compliant/application/__init__.py +0 -1
  1071. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/python-compliant/application/ports/__init__.py +0 -1
  1072. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/python-compliant/application/ports/email_service.py +0 -60
  1073. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/python-compliant/application/ports/user_repository.py +0 -78
  1074. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/python-compliant/domain/__init__.py +0 -1
  1075. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/python-compliant/domain/entities/__init__.py +0 -1
  1076. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/python-compliant/domain/entities/user.py +0 -56
  1077. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/python-compliant/domain/value_objects/__init__.py +0 -1
  1078. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/python-compliant/domain/value_objects/email.py +0 -63
  1079. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/python-noncompliant/application/user_service.py +0 -1837
  1080. package/tools/vds-scripts/hexagonal_orchestrator/tests/fixtures/python-noncompliant/domain/user.py +0 -43
  1081. package/tools/vds-scripts/hexagonal_orchestrator/tests/test_cache.py +0 -458
  1082. package/tools/vds-scripts/hexagonal_orchestrator/tests/test_cli_integration.py +0 -942
  1083. package/tools/vds-scripts/hexagonal_orchestrator/tests/test_cli_unit.py +0 -557
  1084. package/tools/vds-scripts/hexagonal_orchestrator/tests/test_cross_repo_pollution.py +0 -275
  1085. package/tools/vds-scripts/hexagonal_orchestrator/tests/test_foundation.py +0 -129
  1086. package/tools/vds-scripts/hexagonal_orchestrator/tests/test_integration.py +0 -1524
  1087. package/tools/vds-scripts/hexagonal_orchestrator/tests/test_java_analyzer.py +0 -642
  1088. package/tools/vds-scripts/hexagonal_orchestrator/tests/test_timing_unit.py +0 -60
  1089. package/tools/vds-scripts/intellij_orchestrator/README.md +0 -55
  1090. package/tools/vds-scripts/intellij_orchestrator/pyproject.toml +0 -64
  1091. package/tools/vds-scripts/intellij_orchestrator/src/vds_intellij_orchestrator/__init__.py +0 -17
  1092. package/tools/vds-scripts/intellij_orchestrator/src/vds_intellij_orchestrator/cli.py +0 -210
  1093. package/tools/vds-scripts/intellij_orchestrator/src/vds_intellij_orchestrator/core.py +0 -260
  1094. package/tools/vds-scripts/intellij_orchestrator/tests/__init__.py +0 -1
  1095. package/tools/vds-scripts/intellij_orchestrator/tests/test_cli.py +0 -112
  1096. package/tools/vds-scripts/intellij_orchestrator/tests/test_core.py +0 -83
  1097. package/tools/vds-scripts/links_orchestrator/README.md +0 -63
  1098. package/tools/vds-scripts/links_orchestrator/pyproject.toml +0 -64
  1099. package/tools/vds-scripts/links_orchestrator/src/vds_links_orchestrator/__init__.py +0 -10
  1100. package/tools/vds-scripts/links_orchestrator/src/vds_links_orchestrator/cli.py +0 -254
  1101. package/tools/vds-scripts/links_orchestrator/src/vds_links_orchestrator/validator.py +0 -244
  1102. package/tools/vds-scripts/links_orchestrator/tests/__init__.py +0 -0
  1103. package/tools/vds-scripts/links_orchestrator/tests/test_cli.py +0 -128
  1104. package/tools/vds-scripts/links_orchestrator/tests/test_validator.py +0 -76
  1105. package/tools/vds-scripts/lsp_orchestrator/.dockerignore +0 -69
  1106. package/tools/vds-scripts/lsp_orchestrator/ARCHITECTURE.md +0 -383
  1107. package/tools/vds-scripts/lsp_orchestrator/CODE_QUALITY_IMPROVEMENTS.md +0 -196
  1108. package/tools/vds-scripts/lsp_orchestrator/COMMANDS.md +0 -870
  1109. package/tools/vds-scripts/lsp_orchestrator/Dockerfile +0 -59
  1110. package/tools/vds-scripts/lsp_orchestrator/IMPLEMENTATION_SUMMARY.md +0 -490
  1111. package/tools/vds-scripts/lsp_orchestrator/LSP_ISSUES_AND_FINDINGS.md +0 -380
  1112. package/tools/vds-scripts/lsp_orchestrator/README.md +0 -616
  1113. package/tools/vds-scripts/lsp_orchestrator/SETUP.md +0 -143
  1114. package/tools/vds-scripts/lsp_orchestrator/TEST_COVERAGE_SUMMARY.md +0 -255
  1115. package/tools/vds-scripts/lsp_orchestrator/VERIFICATION_CHECKLIST.md +0 -814
  1116. package/tools/vds-scripts/lsp_orchestrator/docker-compose.yml +0 -102
  1117. package/tools/vds-scripts/lsp_orchestrator/docs/FOR_LLMS.md +0 -401
  1118. package/tools/vds-scripts/lsp_orchestrator/docs/explanation/lsp-response-matching.md +0 -79
  1119. package/tools/vds-scripts/lsp_orchestrator/docs/how-to-guides/automate-with-json.md +0 -159
  1120. package/tools/vds-scripts/lsp_orchestrator/docs/how-to-guides/docker-mode.md +0 -256
  1121. package/tools/vds-scripts/lsp_orchestrator/docs/how-to-guides/navigate-code.md +0 -116
  1122. package/tools/vds-scripts/lsp_orchestrator/docs/how-to-guides/parallel-processing.md +0 -179
  1123. package/tools/vds-scripts/lsp_orchestrator/docs/how-to-guides/project-tool-detection.md +0 -320
  1124. package/tools/vds-scripts/lsp_orchestrator/docs/how-to-guides/type-check-code.md +0 -46
  1125. package/tools/vds-scripts/lsp_orchestrator/docs/how-to-guides/use-daemon-mode.md +0 -78
  1126. package/tools/vds-scripts/lsp_orchestrator/docs/how-to-guides/wsl2-optimization.md +0 -227
  1127. package/tools/vds-scripts/lsp_orchestrator/docs/index.md +0 -88
  1128. package/tools/vds-scripts/lsp_orchestrator/docs/operator-hover-definition.md +0 -143
  1129. package/tools/vds-scripts/lsp_orchestrator/docs/reference/commands.md +0 -581
  1130. package/tools/vds-scripts/lsp_orchestrator/docs/reference/configuration.md +0 -422
  1131. package/tools/vds-scripts/lsp_orchestrator/docs/tutorials/00-quick-start.md +0 -169
  1132. package/tools/vds-scripts/lsp_orchestrator/pyproject.toml +0 -63
  1133. package/tools/vds-scripts/lsp_orchestrator/src/test_file.py +0 -5
  1134. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/__init__.py +0 -3
  1135. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/aggregator.py +0 -340
  1136. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/basedpyright_runner.py +0 -167
  1137. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/cli.py +0 -3370
  1138. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/code_actions.py +0 -79
  1139. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/core.py +0 -3295
  1140. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/daemon_client.py +0 -672
  1141. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/daemon_manager.py +0 -577
  1142. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/daemon_server.py +0 -1040
  1143. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/detectors/__init__.py +0 -9
  1144. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/detectors/project_detector.py +0 -537
  1145. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/formatters.py +0 -141
  1146. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/ipc_protocol.py +0 -225
  1147. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/lsp_client.py +0 -957
  1148. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/lsp_router.py +0 -335
  1149. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/mcp_server.py +0 -181
  1150. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/models/__init__.py +0 -201
  1151. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/models/project_detector.py +0 -646
  1152. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/models/project_tools.py +0 -114
  1153. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/models.py +0 -399
  1154. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/mypy_runner.py +0 -209
  1155. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/protocols.py +0 -52
  1156. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/ruff_lsp_client.py +0 -109
  1157. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/ruff_runner.py +0 -44
  1158. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/utils.py +0 -959
  1159. package/tools/vds-scripts/lsp_orchestrator/src/vds_lsp_orchestrator/workspace_indexer.py +0 -1037
  1160. package/tools/vds-scripts/lsp_orchestrator/test_workspace_lsp.py +0 -6
  1161. package/tools/vds-scripts/lsp_orchestrator/tests/__init__.py +0 -1
  1162. package/tools/vds-scripts/lsp_orchestrator/tests/conftest.py +0 -6
  1163. package/tools/vds-scripts/lsp_orchestrator/tests/test_aggregator.py +0 -59
  1164. package/tools/vds-scripts/lsp_orchestrator/tests/test_cli.py +0 -111
  1165. package/tools/vds-scripts/lsp_orchestrator/tests/test_detect_tools_command.py +0 -186
  1166. package/tools/vds-scripts/lsp_orchestrator/tests/test_formatter_linter_detection.py +0 -519
  1167. package/tools/vds-scripts/lsp_orchestrator/tests/test_integration_phase9_10_11.py +0 -367
  1168. package/tools/vds-scripts/lsp_orchestrator/tests/test_mypy_runner.py +0 -482
  1169. package/tools/vds-scripts/lsp_orchestrator/tests/test_package_manager_detection.py +0 -399
  1170. package/tools/vds-scripts/lsp_orchestrator/tests/test_phase10.py +0 -389
  1171. package/tools/vds-scripts/lsp_orchestrator/tests/test_phase11.py +0 -327
  1172. package/tools/vds-scripts/lsp_orchestrator/tests/test_phase12_integration.py +0 -634
  1173. package/tools/vds-scripts/lsp_orchestrator/tests/test_phase9.py +0 -196
  1174. package/tools/vds-scripts/lsp_orchestrator/tests/test_project_detector.py +0 -377
  1175. package/tools/vds-scripts/lsp_orchestrator/tests/test_test_runner_detection.py +0 -549
  1176. package/tools/vds-scripts/lsp_orchestrator/tests/test_type_checker_routing.py +0 -362
  1177. package/tools/vds-scripts/lsp_orchestrator/tests/test_workspace_indexer.py +0 -144
  1178. package/tools/vds-scripts/markdown_orchestrator/README.md +0 -72
  1179. package/tools/vds-scripts/markdown_orchestrator/pyproject.toml +0 -39
  1180. package/tools/vds-scripts/markdown_orchestrator/src/vds_markdown_orchestrator/__init__.py +0 -5
  1181. package/tools/vds-scripts/markdown_orchestrator/src/vds_markdown_orchestrator/cli.py +0 -102
  1182. package/tools/vds-scripts/multi_agent_orchestrator/Dockerfile +0 -65
  1183. package/tools/vds-scripts/multi_agent_orchestrator/README.md +0 -306
  1184. package/tools/vds-scripts/multi_agent_orchestrator/postman/README.md +0 -264
  1185. package/tools/vds-scripts/multi_agent_orchestrator/postman/TEST_RESULTS_SUMMARY.md +0 -197
  1186. package/tools/vds-scripts/multi_agent_orchestrator/postman/VDS-Multi-Agent-Orchestrator-API.postman_collection.json +0 -1010
  1187. package/tools/vds-scripts/multi_agent_orchestrator/postman/environments/local-development.postman_environment.json +0 -55
  1188. package/tools/vds-scripts/multi_agent_orchestrator/postman/test-results.json +0 -24146
  1189. package/tools/vds-scripts/multi_agent_orchestrator/pyproject.toml +0 -63
  1190. package/tools/vds-scripts/multi_agent_orchestrator/run_api.py +0 -9
  1191. package/tools/vds-scripts/multi_agent_orchestrator/run_mock_api.py +0 -9
  1192. package/tools/vds-scripts/multi_agent_orchestrator/simple_test.py +0 -53
  1193. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/__init__.py +0 -25
  1194. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/agent_pool.py +0 -433
  1195. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/api/__init__.py +0 -5
  1196. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/api/main.py +0 -722
  1197. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/api/mock_main.py +0 -812
  1198. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/change_log.py +0 -515
  1199. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/cli.py +0 -424
  1200. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/config.py +0 -220
  1201. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/conflict_resolver.py +0 -462
  1202. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/coordinator.py +0 -627
  1203. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/models.py +0 -389
  1204. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/progress_dashboard.py +0 -380
  1205. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/redis_client.py +0 -245
  1206. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/scheduler_subscriber.py +0 -272
  1207. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/task_manager.py +0 -536
  1208. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/task_tracking.py +0 -550
  1209. package/tools/vds-scripts/multi_agent_orchestrator/src/vds_multi_agent_orchestrator/vds_ai_memory_client.py +0 -352
  1210. package/tools/vds-scripts/multi_agent_orchestrator/test_complete_system.py +0 -149
  1211. package/tools/vds-scripts/multi_agent_orchestrator/test_infrastructure_only.py +0 -194
  1212. package/tools/vds-scripts/multi_agent_orchestrator/test_integration.py +0 -108
  1213. package/tools/vds-scripts/multi_agent_orchestrator/tests/__init__.py +0 -1
  1214. package/tools/vds-scripts/multi_agent_orchestrator/tests/test_agent_registration_credential_validator.py +0 -223
  1215. package/tools/vds-scripts/multi_agent_orchestrator/tests/test_config.py +0 -210
  1216. package/tools/vds-scripts/multi_agent_orchestrator/tests/test_models.py +0 -195
  1217. package/tools/vds-scripts/multi_agent_orchestrator/tests/test_w9_agent_routes.py +0 -321
  1218. package/tools/vds-scripts/openapi_orchestrator/README.md +0 -197
  1219. package/tools/vds-scripts/openapi_orchestrator/pyproject.toml +0 -106
  1220. package/tools/vds-scripts/openapi_orchestrator/src/vds_openapi_orchestrator/__init__.py +0 -29
  1221. package/tools/vds-scripts/openapi_orchestrator/src/vds_openapi_orchestrator/cli.py +0 -345
  1222. package/tools/vds-scripts/openapi_orchestrator/src/vds_openapi_orchestrator/full_validator.py +0 -183
  1223. package/tools/vds-scripts/openapi_orchestrator/src/vds_openapi_orchestrator/spec_validator.py +0 -197
  1224. package/tools/vds-scripts/openapi_orchestrator/tests/__init__.py +0 -1
  1225. package/tools/vds-scripts/openapi_orchestrator/tests/test_cli.py +0 -234
  1226. package/tools/vds-scripts/openapi_orchestrator/tests/test_full_validator.py +0 -203
  1227. package/tools/vds-scripts/openapi_orchestrator/tests/test_spec_validator.py +0 -295
  1228. package/tools/vds-scripts/pdf_orchestrator/.dockerignore +0 -93
  1229. package/tools/vds-scripts/pdf_orchestrator/.env.example +0 -40
  1230. package/tools/vds-scripts/pdf_orchestrator/.ruff_rules.py +0 -350
  1231. package/tools/vds-scripts/pdf_orchestrator/.yamllint.yml +0 -43
  1232. package/tools/vds-scripts/pdf_orchestrator/DEVELOPMENT_PLAN.md +0 -80
  1233. package/tools/vds-scripts/pdf_orchestrator/Dockerfile +0 -87
  1234. package/tools/vds-scripts/pdf_orchestrator/README.md +0 -608
  1235. package/tools/vds-scripts/pdf_orchestrator/cli_verification_test/test.md +0 -6
  1236. package/tools/vds-scripts/pdf_orchestrator/cli_verification_test/test.pdf +0 -0
  1237. package/tools/vds-scripts/pdf_orchestrator/config/alertmanager.yml +0 -83
  1238. package/tools/vds-scripts/pdf_orchestrator/config/prometheus.prod.yml +0 -98
  1239. package/tools/vds-scripts/pdf_orchestrator/config/prometheus.yml +0 -40
  1240. package/tools/vds-scripts/pdf_orchestrator/config/redis.conf +0 -78
  1241. package/tools/vds-scripts/pdf_orchestrator/docs/COMPETITIVE_ANALYSIS_REPORT.md +0 -309
  1242. package/tools/vds-scripts/pdf_orchestrator/docs/FEATURES_GUIDE.md +0 -518
  1243. package/tools/vds-scripts/pdf_orchestrator/docs/MULTI_USER_DEPLOYMENT_GUIDE.md +0 -615
  1244. package/tools/vds-scripts/pdf_orchestrator/docs/USER_GUIDE.md +0 -829
  1245. package/tools/vds-scripts/pdf_orchestrator/pyproject.toml +0 -87
  1246. package/tools/vds-scripts/pdf_orchestrator/pytest.ini +0 -71
  1247. package/tools/vds-scripts/pdf_orchestrator/ruff.toml +0 -6
  1248. package/tools/vds-scripts/pdf_orchestrator/scripts/debug_security_report.py +0 -59
  1249. package/tools/vds-scripts/pdf_orchestrator/scripts/demo_library_selector.py +0 -109
  1250. package/tools/vds-scripts/pdf_orchestrator/scripts/generate_project_stats.py +0 -52
  1251. package/tools/vds-scripts/pdf_orchestrator/scripts/generate_styled_pdf.py +0 -95
  1252. package/tools/vds-scripts/pdf_orchestrator/scripts/migrate_render_pdfs.py +0 -285
  1253. package/tools/vds-scripts/pdf_orchestrator/scripts/setup_team.bat +0 -283
  1254. package/tools/vds-scripts/pdf_orchestrator/scripts/setup_team.sh +0 -324
  1255. package/tools/vds-scripts/pdf_orchestrator/src/vds_pdf_orchestrator/__init__.py +0 -5
  1256. package/tools/vds-scripts/pdf_orchestrator/src/vds_pdf_orchestrator/cli.py +0 -542
  1257. package/tools/vds-scripts/pdf_orchestrator/src/vds_pdf_orchestrator/config.py +0 -33
  1258. package/tools/vds-scripts/pdf_orchestrator/tests/README.md +0 -650
  1259. package/tools/vds-scripts/pdf_orchestrator/tests/__init__.py +0 -0
  1260. package/tools/vds-scripts/pdf_orchestrator/tests/conftest.py +0 -520
  1261. package/tools/vds-scripts/pdf_orchestrator/tests/requirements.txt +0 -51
  1262. package/tools/vds-scripts/pdf_orchestrator/tests/run_tests.py +0 -659
  1263. package/tools/vds-scripts/pdf_orchestrator/tests/test_config.py +0 -36
  1264. package/tools/vds-scripts/progress_report_orchestrator/Dockerfile +0 -77
  1265. package/tools/vds-scripts/progress_report_orchestrator/README.md +0 -39
  1266. package/tools/vds-scripts/progress_report_orchestrator/alembic/env.py +0 -42
  1267. package/tools/vds-scripts/progress_report_orchestrator/alembic/script.py.mako +0 -28
  1268. package/tools/vds-scripts/progress_report_orchestrator/alembic/versions/0001_initial_progress_schema.py +0 -180
  1269. package/tools/vds-scripts/progress_report_orchestrator/alembic.ini +0 -67
  1270. package/tools/vds-scripts/progress_report_orchestrator/pyproject.toml +0 -67
  1271. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/__init__.py +0 -3
  1272. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/analyzers/__init__.py +0 -1
  1273. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/analyzers/endpoint_scanner.py +0 -238
  1274. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/analyzers/git_activity.py +0 -159
  1275. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/analyzers/hexagonal.py +0 -100
  1276. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/analyzers/test_scanner.py +0 -136
  1277. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/cli.py +0 -743
  1278. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/config.py +0 -50
  1279. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/db/__init__.py +0 -12
  1280. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/db/alembic_filters.py +0 -64
  1281. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/memory.py +0 -82
  1282. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/models/__init__.py +0 -1
  1283. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/models/analysis.py +0 -84
  1284. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/models/report.py +0 -117
  1285. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/models/topology.py +0 -101
  1286. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/parsers/__init__.py +0 -1
  1287. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/parsers/kg_parser.py +0 -252
  1288. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/parsers/uc_reader.py +0 -159
  1289. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/pipeline/__init__.py +0 -1
  1290. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/pipeline/concurrency.py +0 -39
  1291. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/pipeline/llm_eval.py +0 -570
  1292. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/pipeline/report.py +0 -1256
  1293. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/pipeline/structural.py +0 -384
  1294. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/pipeline/sync.py +0 -143
  1295. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/recommendations/__init__.py +0 -5
  1296. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/recommendations/engine.py +0 -105
  1297. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/recommendations/templates.py +0 -236
  1298. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/scheduler_subscriber.py +0 -238
  1299. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/skills/README.md +0 -56
  1300. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/skills/__init__.py +0 -1
  1301. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/skills/srs-architecture-reviewer/SKILL.md +0 -67
  1302. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/skills/srs-endpoint-matcher/SKILL.md +0 -67
  1303. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/state/__init__.py +0 -1
  1304. package/tools/vds-scripts/progress_report_orchestrator/src/progress_report_orchestrator/state/schema.py +0 -625
  1305. package/tools/vds-scripts/progress_report_orchestrator/tests/__init__.py +0 -0
  1306. package/tools/vds-scripts/progress_report_orchestrator/tests/fixtures/__init__.py +0 -0
  1307. package/tools/vds-scripts/progress_report_orchestrator/tests/fixtures/kg/.gitkeep +0 -0
  1308. package/tools/vds-scripts/progress_report_orchestrator/tests/fixtures/kg/__init__.py +0 -0
  1309. package/tools/vds-scripts/progress_report_orchestrator/tests/fixtures/kg/doc-dependencies.yaml +0 -79
  1310. package/tools/vds-scripts/progress_report_orchestrator/tests/fixtures/kg/fr-to-docs.yaml +0 -478
  1311. package/tools/vds-scripts/progress_report_orchestrator/tests/fixtures/kg/fr-to-services.yaml +0 -18
  1312. package/tools/vds-scripts/progress_report_orchestrator/tests/fixtures/kg/registry.yaml +0 -346
  1313. package/tools/vds-scripts/progress_report_orchestrator/tests/fixtures/phase3_baseline_standard.md +0 -564
  1314. package/tools/vds-scripts/progress_report_orchestrator/tests/integration/__init__.py +0 -0
  1315. package/tools/vds-scripts/progress_report_orchestrator/tests/integration/test_checkpoint.py +0 -276
  1316. package/tools/vds-scripts/progress_report_orchestrator/tests/test_alembic_migrations.py +0 -265
  1317. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/__init__.py +0 -0
  1318. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_analyzers.py +0 -267
  1319. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_bounded_gather.py +0 -176
  1320. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_cli_phase_report.py +0 -119
  1321. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_delta.py +0 -169
  1322. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_error_handling.py +0 -150
  1323. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_gate_exit_codes.py +0 -230
  1324. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_git_activity.py +0 -215
  1325. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_kg_parser.py +0 -267
  1326. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_llm_autodetect.py +0 -183
  1327. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_llm_eval.py +0 -529
  1328. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_memory_integration.py +0 -151
  1329. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_migration_contract.py +0 -254
  1330. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_mode_rendering.py +0 -576
  1331. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_models.py +0 -251
  1332. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_progress_llm_config.py +0 -67
  1333. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_recommendations.py +0 -480
  1334. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_report_enhancements.py +0 -415
  1335. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_resume_reload.py +0 -343
  1336. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_trend_regression.py +0 -294
  1337. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_uc_reader.py +0 -169
  1338. package/tools/vds-scripts/progress_report_orchestrator/tests/unit/test_valence_gap.py +0 -293
  1339. package/tools/vds-scripts/project-cycle-report.json +0 -14
  1340. package/tools/vds-scripts/project-dependency-graph.json +0 -11361
  1341. package/tools/vds-scripts/project-topology.json +0 -99
  1342. package/tools/vds-scripts/public_interface_boundary_orchestrator/pyproject.toml +0 -18
  1343. package/tools/vds-scripts/public_interface_boundary_orchestrator/src/vds_public_interface_boundary_orchestrator/__init__.py +0 -0
  1344. package/tools/vds-scripts/public_interface_boundary_orchestrator/src/vds_public_interface_boundary_orchestrator/cli.py +0 -232
  1345. package/tools/vds-scripts/public_interface_boundary_orchestrator/tests/__init__.py +0 -0
  1346. package/tools/vds-scripts/public_interface_boundary_orchestrator/tests/test_cli.py +0 -108
  1347. package/tools/vds-scripts/research_orchestrator/README.md +0 -68
  1348. package/tools/vds-scripts/research_orchestrator/py.typed +0 -0
  1349. package/tools/vds-scripts/research_orchestrator/pyproject.toml +0 -95
  1350. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/__init__.py +0 -3
  1351. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/_env.py +0 -11
  1352. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/cli.py +0 -335
  1353. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/config.py +0 -43
  1354. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/evidence/__init__.py +0 -0
  1355. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/evidence/models.py +0 -89
  1356. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/evidence/scoring.py +0 -102
  1357. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/exceptions.py +0 -78
  1358. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/http_client.py +0 -160
  1359. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/logging.py +0 -49
  1360. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/output/__init__.py +0 -0
  1361. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/output/formatters.py +0 -93
  1362. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/py.typed +0 -1
  1363. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/report/__init__.py +0 -0
  1364. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/report/build.py +0 -156
  1365. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/report/format.py +0 -147
  1366. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/tools/__init__.py +0 -0
  1367. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/tools/health.py +0 -66
  1368. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/tools/health_graph.py +0 -52
  1369. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/tools/registry.py +0 -127
  1370. package/tools/vds-scripts/research_orchestrator/src/vds_research_orchestrator/tools/search.py +0 -230
  1371. package/tools/vds-scripts/research_orchestrator/tests/__init__.py +0 -0
  1372. package/tools/vds-scripts/research_orchestrator/tests/conftest.py +0 -53
  1373. package/tools/vds-scripts/research_orchestrator/tests/test_cli.py +0 -222
  1374. package/tools/vds-scripts/research_orchestrator/tests/test_config.py +0 -23
  1375. package/tools/vds-scripts/research_orchestrator/tests/test_exceptions.py +0 -62
  1376. package/tools/vds-scripts/research_orchestrator/tests/test_formatters.py +0 -89
  1377. package/tools/vds-scripts/research_orchestrator/tests/test_graph_integration.py +0 -149
  1378. package/tools/vds-scripts/research_orchestrator/tests/test_http_client.py +0 -134
  1379. package/tools/vds-scripts/research_orchestrator/tests/test_report_build.py +0 -128
  1380. package/tools/vds-scripts/research_orchestrator/tests/test_report_format.py +0 -91
  1381. package/tools/vds-scripts/research_orchestrator/tests/test_scoring.py +0 -95
  1382. package/tools/vds-scripts/research_orchestrator/tests/vds_research_orchestrator/test_tools/__init__.py +0 -1
  1383. package/tools/vds-scripts/research_orchestrator/tests/vds_research_orchestrator/test_tools/test_health.py +0 -139
  1384. package/tools/vds-scripts/research_orchestrator/tests/vds_research_orchestrator/test_tools/test_registry.py +0 -135
  1385. package/tools/vds-scripts/research_orchestrator/tests/vds_research_orchestrator/test_tools/test_search.py +0 -238
  1386. package/tools/vds-scripts/run-history.json +0 -26
  1387. package/tools/vds-scripts/schema_converter/README.md +0 -109
  1388. package/tools/vds-scripts/schema_converter/pyproject.toml +0 -37
  1389. package/tools/vds-scripts/schema_converter/src/vds_schema_converter/__init__.py +0 -3
  1390. package/tools/vds-scripts/schema_converter/src/vds_schema_converter/cli.py +0 -50
  1391. package/tools/vds-scripts/schema_converter/tests/__init__.py +0 -0
  1392. package/tools/vds-scripts/schema_converter/tests/test_json_schema_generator.py +0 -115
  1393. package/tools/vds-scripts/schema_converter/tests/test_mermaid_generator.py +0 -112
  1394. package/tools/vds-scripts/schema_converter/tests/test_parser.py +0 -111
  1395. package/tools/vds-scripts/schema_converter/tests/test_plantuml_generator.py +0 -112
  1396. package/tools/vds-scripts/schema_converter/tests/test_plantuml_validator.py +0 -69
  1397. package/tools/vds-scripts/schema_converter/tests/test_prisma_generator.py +0 -113
  1398. package/tools/vds-scripts/schema_converter/tests/test_sql_generator.py +0 -138
  1399. package/tools/vds-scripts/schema_converter/tests/test_typeorm_generator.py +0 -110
  1400. package/tools/vds-scripts/schema_converter/tests/test_validators.py +0 -96
  1401. package/tools/vds-scripts/spec_orchestrator/README.md +0 -13
  1402. package/tools/vds-scripts/spec_orchestrator/pyproject.toml +0 -40
  1403. package/tools/vds-scripts/spec_orchestrator/src/vds_spec_orchestrator/__init__.py +0 -5
  1404. package/tools/vds-scripts/spec_orchestrator/src/vds_spec_orchestrator/cli.py +0 -162
  1405. package/tools/vds-scripts/spec_orchestrator/src/vds_spec_orchestrator/core.py +0 -575
  1406. package/tools/vds-scripts/spec_orchestrator/src/vds_spec_orchestrator/sync.py +0 -306
  1407. package/tools/vds-scripts/spec_orchestrator/tests/__init__.py +0 -0
  1408. package/tools/vds-scripts/spec_orchestrator/tests/test_frontmatter_drift.py +0 -243
  1409. package/tools/vds-scripts/spec_orchestrator/tests/test_sync.py +0 -342
  1410. package/tools/vds-scripts/structure_orchestrator/README.md +0 -60
  1411. package/tools/vds-scripts/structure_orchestrator/pyproject.toml +0 -103
  1412. package/tools/vds-scripts/structure_orchestrator/src/vds_structure_orchestrator/__init__.py +0 -13
  1413. package/tools/vds-scripts/structure_orchestrator/src/vds_structure_orchestrator/cli.py +0 -308
  1414. package/tools/vds-scripts/structure_orchestrator/src/vds_structure_orchestrator/validator.py +0 -257
  1415. package/tools/vds-scripts/structure_orchestrator/tests/__init__.py +0 -0
  1416. package/tools/vds-scripts/structure_orchestrator/tests/test_cli.py +0 -161
  1417. package/tools/vds-scripts/structure_orchestrator/tests/test_helpers.py +0 -115
  1418. package/tools/vds-scripts/structure_orchestrator/tests/test_validator.py +0 -104
  1419. package/tools/vds-scripts/task_orchestrator/README.md +0 -50
  1420. package/tools/vds-scripts/task_orchestrator/__init__.py +0 -18
  1421. package/tools/vds-scripts/task_orchestrator/pyproject.toml +0 -43
  1422. package/tools/vds-scripts/task_orchestrator/scripts/run_excel_sync.py +0 -36
  1423. package/tools/vds-scripts/task_orchestrator/src/vds_task_orchestrator/__init__.py +0 -13
  1424. package/tools/vds-scripts/task_orchestrator/src/vds_task_orchestrator/audit.py +0 -134
  1425. package/tools/vds-scripts/task_orchestrator/src/vds_task_orchestrator/cli.py +0 -127
  1426. package/tools/vds-scripts/task_orchestrator/src/vds_task_orchestrator/debug.py +0 -133
  1427. package/tools/vds-scripts/task_orchestrator/src/vds_task_orchestrator/normalize.py +0 -113
  1428. package/tools/vds-scripts/task_orchestrator/src/vds_task_orchestrator/refine.py +0 -201
  1429. package/tools/vds-scripts/task_orchestrator/tests/__init__.py +0 -0
  1430. package/tools/vds-scripts/task_orchestrator/tests/test_task_orchestrator.py +0 -84
  1431. package/tools/vds-scripts/temp_query_projects.py +0 -2
  1432. package/tools/vds-scripts/test_small.md +0 -1
  1433. package/tools/vds-scripts/text_utils_orchestrator/pyproject.toml +0 -20
  1434. package/tools/vds-scripts/text_utils_orchestrator/src/vds_text_utils/__init__.py +0 -7
  1435. package/tools/vds-scripts/text_utils_orchestrator/src/vds_text_utils/i18n.py +0 -143
  1436. package/tools/vds-scripts/text_utils_orchestrator/tests/__init__.py +0 -0
  1437. package/tools/vds-scripts/text_utils_orchestrator/tests/test_i18n.py +0 -53
  1438. package/tools/vds-scripts/upgrade_major.py +0 -61
  1439. package/tools/vds-scripts/upgrade_major_v2.py +0 -64
  1440. package/tools/vds-scripts/verify_violations.py +0 -57
  1441. package/tools/vds-scripts/workflow-summary.json +0 -325
  1442. package/tools/vds-scripts/workflow-summary.md +0 -8
@@ -1,3684 +0,0 @@
1
- # FR-118: Bounded Retry and Degraded Finalize Policy (Phase 72)
2
- from __future__ import annotations
3
-
4
- import asyncio
5
- import sys
6
- from pathlib import Path
7
- from types import SimpleNamespace
8
-
9
- import pytest
10
- from vds_audit_orchestrator.engine import llm_row_evaluator as module
11
- from vds_audit_orchestrator.llm.audit_schemas import RowEvaluationRequest, RowEvaluationResponse
12
- from vds_audit_orchestrator.models.checklist import RowStatus
13
-
14
-
15
- class _FakeAgent:
16
- created_retries: list[int] = []
17
- created_kwargs: list[dict[str, object]] = []
18
-
19
- def __init__(self, **kwargs):
20
- self.kwargs = kwargs
21
- _FakeAgent.created_retries.append(int(kwargs.get("retries", -1)))
22
- _FakeAgent.created_kwargs.append(dict(kwargs))
23
-
24
- def run_sync(self, *_args, **_kwargs):
25
- return SimpleNamespace(
26
- output={
27
- "reasoning": "reasoning",
28
- "reason": "reason",
29
- "score": 50.0,
30
- "confidence": 0.8,
31
- "finding": "finding",
32
- }
33
- )
34
-
35
- def run_stream(self, *_args, **_kwargs):
36
- return _FakeStreamContext(_FakeStream())
37
-
38
-
39
- class _SlowAsyncAgent:
40
- created_retries: list[int] = []
41
- created_kwargs: list[dict[str, object]] = []
42
-
43
- def __init__(self, **kwargs):
44
- self.kwargs = kwargs
45
- _SlowAsyncAgent.created_retries.append(int(kwargs.get("retries", -1)))
46
- _SlowAsyncAgent.created_kwargs.append(dict(kwargs))
47
-
48
- async def run(self, *_args, **_kwargs):
49
- await asyncio.sleep(3600)
50
-
51
- def run_stream(self, *_args, **_kwargs):
52
- return _SlowStreamContext()
53
-
54
-
55
- class _AsyncRunResult:
56
- def __init__(self) -> None:
57
- self.output = {
58
- "reasoning": "reasoning",
59
- "reason": "reason",
60
- "score": 50.0,
61
- "confidence": 0.8,
62
- "finding": "finding",
63
- }
64
-
65
- def all_messages(self):
66
- return []
67
-
68
- def usage(self):
69
- return None
70
-
71
-
72
- class FunctionToolCallEvent:
73
- def __init__(self, tool_name: str, tool_call_id: str = "call-1", args: dict | None = None) -> None:
74
- self.part = SimpleNamespace(tool_name=tool_name, tool_call_id=tool_call_id, args=args or {})
75
-
76
-
77
- class FunctionToolResultEvent:
78
- def __init__(
79
- self,
80
- tool_name: str,
81
- *,
82
- tool_call_id: str = "call-1",
83
- output: dict | None = None,
84
- ) -> None:
85
- self.result = SimpleNamespace(tool_name=tool_name, tool_call_id=tool_call_id, output=output or {"hits": [1]})
86
-
87
-
88
- class _ProgressAsyncAgent:
89
- created_kwargs: list[dict[str, object]] = []
90
-
91
- def __init__(self, **kwargs):
92
- self.kwargs = kwargs
93
- _ProgressAsyncAgent.created_kwargs.append(dict(kwargs))
94
-
95
- async def run(self, *_args, **kwargs):
96
- handler = kwargs.get("event_stream_handler")
97
- if callable(handler):
98
- events = [
99
- FunctionToolCallEvent("read_file", tool_call_id="call-1"),
100
- FunctionToolResultEvent("read_file", tool_call_id="call-1"),
101
- FunctionToolCallEvent("grep_search", tool_call_id="call-2"),
102
- FunctionToolResultEvent("grep_search", tool_call_id="call-2"),
103
- ]
104
-
105
- async def _event_stream():
106
- for event in events:
107
- await asyncio.sleep(0.015)
108
- yield event
109
-
110
- await handler(None, _event_stream())
111
- return _AsyncRunResult()
112
-
113
- def run_stream(self, *_args, **kwargs):
114
- return _ProgressStreamContext(self, *(_args), **(kwargs))
115
-
116
-
117
- class _EventStreamFallbackAgent:
118
- call_kwargs: list[dict[str, object]] = []
119
-
120
- def __init__(self, **_kwargs):
121
- pass
122
-
123
- async def run(self, *_args, **kwargs):
124
- _EventStreamFallbackAgent.call_kwargs.append(dict(kwargs))
125
- if "event_stream_handler" in kwargs:
126
- raise RuntimeError("event_stream_handler unsupported")
127
- return _AsyncRunResult()
128
-
129
- def run_stream(self, *_args, **kwargs):
130
- _EventStreamFallbackAgent.call_kwargs.append(dict(kwargs))
131
- if "event_stream_handler" in kwargs:
132
- raise RuntimeError("event_stream_handler unsupported")
133
- return _FakeStreamContext(_FakeStream())
134
-
135
-
136
- class _EventStreamFallbackThenTimeoutAgent:
137
- call_kwargs: list[dict[str, object]] = []
138
-
139
- def __init__(self, **_kwargs):
140
- pass
141
-
142
- async def run(self, *_args, **kwargs):
143
- _EventStreamFallbackThenTimeoutAgent.call_kwargs.append(dict(kwargs))
144
- if "event_stream_handler" in kwargs:
145
- raise RuntimeError("event_stream_handler unsupported by provider")
146
- raise RuntimeError("prompt_agent_timeout_after_1.000s")
147
-
148
- def run_stream(self, *_args, **kwargs):
149
- _EventStreamFallbackThenTimeoutAgent.call_kwargs.append(dict(kwargs))
150
- if "event_stream_handler" in kwargs:
151
- raise RuntimeError("event_stream_handler unsupported by provider")
152
- raise RuntimeError("prompt_agent_timeout_after_1.000s")
153
-
154
-
155
- class _IdleStallAgent:
156
- def __init__(self, **_kwargs):
157
- pass
158
-
159
- async def run(self, *_args, **kwargs):
160
- handler = kwargs.get("event_stream_handler")
161
- if callable(handler):
162
-
163
- async def _event_stream():
164
- yield FunctionToolCallEvent("read_file", tool_call_id="stall-1")
165
- yield FunctionToolResultEvent("read_file", tool_call_id="stall-1")
166
-
167
- await handler(None, _event_stream())
168
- await asyncio.sleep(0.2)
169
- return _AsyncRunResult()
170
-
171
- def run_stream(self, *_args, **kwargs):
172
- return _IdleStallStreamContext()
173
-
174
-
175
- class _ChurnAgent:
176
- def __init__(self, **_kwargs):
177
- pass
178
-
179
- async def run(self, *_args, **kwargs):
180
- handler = kwargs.get("event_stream_handler")
181
- if callable(handler):
182
-
183
- async def _event_stream():
184
- for idx in range(20):
185
- tool_name = "list_directory" if idx < 18 else ("read_file" if idx == 18 else "grep_search")
186
- tool_call_id = f"churn-{idx}"
187
- yield FunctionToolCallEvent(tool_name, tool_call_id=tool_call_id)
188
- yield FunctionToolResultEvent(tool_name, tool_call_id=tool_call_id)
189
-
190
- await handler(None, _event_stream())
191
- await asyncio.sleep(0.2)
192
- return _AsyncRunResult()
193
-
194
- def run_stream(self, *_args, **kwargs):
195
- return _ChurnStreamContext()
196
-
197
-
198
- class _ProviderErrorAgent:
199
- def __init__(self, **_kwargs):
200
- pass
201
-
202
- async def run(self, *_args, **_kwargs):
203
- raise RuntimeError("status_code: 503 service unavailable")
204
-
205
- def run_stream(self, *_args, **_kwargs):
206
- raise RuntimeError("status_code: 503 service unavailable")
207
-
208
-
209
- class _FakeLogger:
210
- def __init__(self) -> None:
211
- self.records: list[tuple[str, dict[str, object]]] = []
212
-
213
- def bind(self, **_kwargs):
214
- return self
215
-
216
- def info(self, event: str, **kwargs):
217
- self.records.append((event, dict(kwargs)))
218
-
219
- def warning(self, event: str, **kwargs):
220
- self.records.append((event, dict(kwargs)))
221
-
222
-
223
- class _FakeStream:
224
- def __init__(self) -> None:
225
- self._output = {
226
- "reasoning": "reasoning",
227
- "reason": "reason",
228
- "score": 50.0,
229
- "confidence": 0.8,
230
- "finding": "finding",
231
- }
232
-
233
- async def get_output(self):
234
- return self._output
235
-
236
- def all_messages(self):
237
- return []
238
-
239
- def usage(self):
240
- return None
241
-
242
-
243
- class _FakeStreamContext:
244
- def __init__(self, stream: _FakeStream):
245
- self._stream = stream
246
-
247
- async def __aenter__(self):
248
- return self._stream
249
-
250
- async def __aexit__(self, exc_type, exc, tb):
251
- return False
252
-
253
-
254
- class _SlowStreamContext:
255
- async def __aenter__(self):
256
- return self
257
-
258
- async def __aexit__(self, exc_type, exc, tb):
259
- return False
260
-
261
- async def get_output(self):
262
- await asyncio.sleep(3600)
263
-
264
-
265
- class _ProgressStreamContext:
266
- def __init__(self, agent, *args, **kwargs):
267
- self._agent = agent
268
- self._args = args
269
- self._kwargs = kwargs
270
-
271
- async def __aenter__(self):
272
- return _ProgressStream(self._agent, *self._args, **self._kwargs)
273
-
274
- async def __aexit__(self, exc_type, exc, tb):
275
- return False
276
-
277
-
278
- class _ProgressStream:
279
- def __init__(self, agent, *args, **kwargs):
280
- self._agent = agent
281
- self._kwargs = kwargs
282
- self._output = {
283
- "reasoning": "reasoning",
284
- "reason": "reason",
285
- "score": 50.0,
286
- "confidence": 0.8,
287
- "finding": "finding",
288
- }
289
-
290
- async def get_output(self):
291
- handler = self._kwargs.get("event_stream_handler")
292
- if callable(handler):
293
- events = [
294
- FunctionToolCallEvent("read_file", tool_call_id="call-1"),
295
- FunctionToolResultEvent("read_file", tool_call_id="call-1"),
296
- FunctionToolCallEvent("grep_search", tool_call_id="call-2"),
297
- FunctionToolResultEvent("grep_search", tool_call_id="call-2"),
298
- ]
299
-
300
- async def _event_stream():
301
- for event in events:
302
- await asyncio.sleep(0.015)
303
- yield event
304
-
305
- await handler(None, _event_stream())
306
- return self._output
307
-
308
- def all_messages(self):
309
- return []
310
-
311
- def usage(self):
312
- return None
313
-
314
-
315
- class _IdleStallStream:
316
- def __init__(self) -> None:
317
- self._output = {
318
- "reasoning": "reasoning",
319
- "reason": "stalled_after_tool_activity",
320
- "score": 50.0,
321
- "confidence": 0.8,
322
- "finding": "finding",
323
- }
324
-
325
- async def get_output(self):
326
- # Sleep longer than the 1.0s timeout so the heartbeat loop fires timeout.
327
- # Note: streaming path does not populate run_telemetry with tool events,
328
- # so idle/churn detection cannot trigger — timeout falls through to agent_timeout.
329
- await asyncio.sleep(5.0)
330
- return self._output
331
-
332
- def all_messages(self):
333
- return []
334
-
335
- def usage(self):
336
- return None
337
-
338
-
339
- class _IdleStallStreamContext:
340
- async def __aenter__(self):
341
- return _IdleStallStream()
342
-
343
- async def __aexit__(self, exc_type, exc, tb):
344
- return False
345
-
346
-
347
- class _ChurnStream:
348
- def __init__(self) -> None:
349
- self._output = {
350
- "reasoning": "reasoning",
351
- "reason": "list_directory_churn detected",
352
- "score": 50.0,
353
- "confidence": 0.8,
354
- "finding": "finding",
355
- }
356
-
357
- async def get_output(self):
358
- # Sleep longer than the 1.0s timeout so the heartbeat loop fires timeout.
359
- # Note: streaming path does not populate run_telemetry with tool events,
360
- # so churn detection cannot trigger — timeout falls through to agent_timeout.
361
- await asyncio.sleep(5.0)
362
- return self._output
363
-
364
- def all_messages(self):
365
- return []
366
-
367
- def usage(self):
368
- return None
369
-
370
-
371
- class _ChurnStreamContext:
372
- async def __aenter__(self):
373
- return _ChurnStream()
374
-
375
- async def __aexit__(self, exc_type, exc, tb):
376
- return False
377
-
378
-
379
- class _CodexStream:
380
- def __init__(self) -> None:
381
- self._output = {
382
- "reasoning": "reasoning",
383
- "reason": "reason",
384
- "score": 50.0,
385
- "confidence": 0.8,
386
- "finding": "finding",
387
- }
388
-
389
- async def get_output(self):
390
- return self._output
391
-
392
- def all_messages(self):
393
- return []
394
-
395
- def usage(self):
396
- return None
397
-
398
-
399
- class _CodexStreamContext:
400
- def __init__(self, stream: _CodexStream):
401
- self._stream = stream
402
-
403
- async def __aenter__(self):
404
- return self._stream
405
-
406
- async def __aexit__(self, exc_type, exc, tb):
407
- return False
408
-
409
-
410
- class _CodexAgent:
411
- run_sync_calls = 0
412
- run_calls = 0
413
- run_stream_calls = 0
414
- created_kwargs: list[dict] = []
415
-
416
- def __init__(self, **kwargs):
417
- self.kwargs = kwargs
418
- _CodexAgent.created_kwargs.append(dict(kwargs))
419
-
420
- def run_sync(self, *_args, **_kwargs):
421
- _CodexAgent.run_sync_calls += 1
422
- raise AssertionError("run_sync should not be used for openai-codex prompt backend")
423
-
424
- async def run(self, *_args, **_kwargs):
425
- _CodexAgent.run_calls += 1
426
- raise AssertionError("run should not be used for openai-codex prompt backend")
427
-
428
- def run_stream(self, *_args, **_kwargs):
429
- _CodexAgent.run_stream_calls += 1
430
- return _CodexStreamContext(_CodexStream())
431
-
432
-
433
- class _NonCodexStream:
434
- def __init__(self, status: str = "streamed") -> None:
435
- self._output = {
436
- "reasoning": "reasoning",
437
- "reason": "reason",
438
- "score": 50.0,
439
- "confidence": 0.8,
440
- "finding": status,
441
- }
442
-
443
- async def get_output(self):
444
- return self._output
445
-
446
- def all_messages(self):
447
- return []
448
-
449
- def usage(self):
450
- return None
451
-
452
-
453
- class _NonCodexStreamContext:
454
- def __init__(self, stream: _NonCodexStream):
455
- self._stream = stream
456
-
457
- async def __aenter__(self):
458
- return self._stream
459
-
460
- async def __aexit__(self, exc_type, exc, tb):
461
- return False
462
-
463
-
464
- class _NonCodexAgent:
465
- run_sync_calls = 0
466
- run_stream_calls = 0
467
- created_kwargs: list[dict] = []
468
-
469
- def __init__(self, **kwargs):
470
- self.kwargs = kwargs
471
- _NonCodexAgent.created_kwargs.append(dict(kwargs))
472
-
473
- def run_sync(self, *_args, **_kwargs):
474
- _NonCodexAgent.run_sync_calls += 1
475
- return SimpleNamespace(
476
- output={
477
- "reasoning": "reasoning",
478
- "reason": "reason",
479
- "score": 50.0,
480
- "confidence": 0.8,
481
- "finding": "non-stream",
482
- }
483
- )
484
-
485
- def run_stream(self, *_args, **_kwargs):
486
- _NonCodexAgent.run_stream_calls += 1
487
- return _NonCodexStreamContext(_NonCodexStream())
488
-
489
-
490
- def _fake_model_settings(**kwargs):
491
- return SimpleNamespace(**kwargs)
492
-
493
-
494
- def test_row_evaluator_uses_max_of_agent_and_output_retries(monkeypatch):
495
- fake_pydantic_ai = SimpleNamespace(Agent=_FakeAgent, RunContext=object)
496
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
497
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
498
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
499
-
500
- import vds_audit_orchestrator.engine.row_evaluator as row_module
501
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
502
-
503
- llm_cfg = SimpleNamespace(
504
- agent_retries=1,
505
- output_retries=4,
506
- max_tokens=1024,
507
- model_standard="claude-haiku-4-5-20251001",
508
- protocol=SimpleNamespace(value="anthropic"),
509
- reasoning_effort="high",
510
- agent_stream=False,
511
- )
512
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
513
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
514
-
515
- _FakeAgent.created_retries.clear()
516
- _FakeAgent.created_kwargs = []
517
- module._ROW_EVAL_AGENTS.clear()
518
-
519
- evaluator = module.LLMRowEvaluator(
520
- config=SimpleNamespace(
521
- protocol=SimpleNamespace(value="anthropic"),
522
- model="claude-haiku-4-5-20251001",
523
- use_dspy=False,
524
- ),
525
- template_hash="tpl",
526
- evidence_hash="evidence",
527
- )
528
-
529
- response = evaluator._invoke_sync_agent(
530
- key="test-agent",
531
- name="RowEvaluator",
532
- system_prompt="system",
533
- user_prompt="user",
534
- toolsets=[],
535
- profile={},
536
- )
537
-
538
- assert _FakeAgent.created_retries == [4]
539
- assert _FakeAgent.created_kwargs[0]["output_retries"] == 4
540
- model_settings = _FakeAgent.created_kwargs[0].get("model_settings")
541
- assert getattr(model_settings, "anthropic_effort", None) == "high"
542
- assert response.reason == "reason"
543
-
544
-
545
- def test_row_evaluator_sync_agent_suppresses_tool_choice_for_dashscope_openai(monkeypatch):
546
- fake_pydantic_ai = SimpleNamespace(Agent=_FakeAgent, RunContext=object)
547
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
548
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
549
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
550
-
551
- import vds_audit_orchestrator.engine.row_evaluator as row_module
552
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
553
-
554
- llm_cfg = SimpleNamespace(
555
- agent_retries=0,
556
- output_retries=0,
557
- max_tokens=256,
558
- model_standard="qwen3.5-plus",
559
- protocol=SimpleNamespace(value="openai"),
560
- base_url="https://coding-intl.dashscope.aliyuncs.com/v1",
561
- reasoning_effort=None,
562
- )
563
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
564
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
565
-
566
- _FakeAgent.created_retries.clear()
567
- _FakeAgent.created_kwargs = []
568
- module._ROW_EVAL_AGENTS.clear()
569
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
570
-
571
- evaluator = module.LLMRowEvaluator(
572
- config=SimpleNamespace(
573
- protocol=SimpleNamespace(value="openai"),
574
- model="qwen3.5-plus",
575
- use_dspy=False,
576
- ),
577
- template_hash="tpl",
578
- evidence_hash="evidence",
579
- )
580
-
581
- evaluator._invoke_sync_agent(
582
- key="test-agent-dashscope-openai",
583
- name="RowEvaluator",
584
- system_prompt="system",
585
- user_prompt="user",
586
- toolsets=[],
587
- profile={},
588
- )
589
-
590
- model_settings = _FakeAgent.created_kwargs[0].get("model_settings")
591
- assert getattr(model_settings, "extra_body", None) == {"tool_choice": None}
592
-
593
-
594
- def test_row_evaluator_sync_agent_suppresses_tool_choice_for_anthropic_proxy(monkeypatch):
595
- fake_pydantic_ai = SimpleNamespace(Agent=_FakeAgent, RunContext=object)
596
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
597
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
598
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
599
-
600
- import vds_audit_orchestrator.engine.row_evaluator as row_module
601
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
602
-
603
- llm_cfg = SimpleNamespace(
604
- agent_retries=0,
605
- output_retries=0,
606
- max_tokens=256,
607
- model_standard="qwen3.5-plus",
608
- protocol=SimpleNamespace(value="anthropic"),
609
- base_url="https://coding-intl.dashscope.aliyuncs.com/apps/anthropic",
610
- reasoning_effort=None,
611
- )
612
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
613
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
614
-
615
- _FakeAgent.created_retries.clear()
616
- _FakeAgent.created_kwargs = []
617
- module._ROW_EVAL_AGENTS.clear()
618
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
619
-
620
- evaluator = module.LLMRowEvaluator(
621
- config=SimpleNamespace(
622
- protocol=SimpleNamespace(value="anthropic"),
623
- model="qwen3.5-plus",
624
- use_dspy=False,
625
- ),
626
- template_hash="tpl",
627
- evidence_hash="evidence",
628
- )
629
-
630
- evaluator._invoke_sync_agent(
631
- key="test-agent-dashscope-anthropic",
632
- name="RowEvaluator",
633
- system_prompt="system",
634
- user_prompt="user",
635
- toolsets=[],
636
- profile={},
637
- )
638
-
639
- model_settings = _FakeAgent.created_kwargs[0].get("model_settings")
640
- assert getattr(model_settings, "extra_body", None) == {"tool_choice": None}
641
-
642
-
643
- @pytest.mark.asyncio
644
- async def test_row_evaluator_async_agent_passes_output_retries(monkeypatch):
645
- fake_pydantic_ai = SimpleNamespace(Agent=_ProgressAsyncAgent, RunContext=object)
646
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
647
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
648
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
649
-
650
- import vds_audit_orchestrator.engine.row_evaluator as row_module
651
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
652
-
653
- llm_cfg = SimpleNamespace(
654
- agent_retries=1,
655
- output_retries=4,
656
- max_tokens=1024,
657
- model_standard="z-ai/glm5",
658
- protocol=SimpleNamespace(value="anthropic"),
659
- reasoning_effort=None,
660
- agent_stream=False,
661
- agent_event_stream_enabled=False,
662
- agent_timeout_seconds=5.0,
663
- agent_timeout_max_seconds=5.0,
664
- agent_timeout_extension_seconds=0.0,
665
- agent_timeout_extension_attempts=0,
666
- agent_timeout_heartbeat_seconds=0.1,
667
- agent_idle_timeout_seconds=5.0,
668
- )
669
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
670
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
671
-
672
- _ProgressAsyncAgent.created_kwargs.clear()
673
- module._ROW_EVAL_AGENTS.clear()
674
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
675
-
676
- evaluator = module.LLMRowEvaluator(
677
- config=SimpleNamespace(
678
- protocol=SimpleNamespace(value="anthropic"),
679
- model="z-ai/glm5",
680
- use_dspy=False,
681
- runtime_context={},
682
- ),
683
- template_hash="tpl",
684
- evidence_hash="evidence",
685
- )
686
-
687
- response = await evaluator._invoke_async_agent(
688
- key="test-async-agent",
689
- name="RowEvaluator",
690
- system_prompt="system",
691
- user_prompt="user",
692
- toolsets=[],
693
- profile={},
694
- )
695
-
696
- assert _ProgressAsyncAgent.created_kwargs[0]["output_retries"] == 4
697
- assert response.reason == "reason"
698
-
699
-
700
- def test_row_evaluator_sync_agent_uses_max_tokens_per_request(monkeypatch):
701
- fake_pydantic_ai = SimpleNamespace(Agent=_FakeAgent, RunContext=object)
702
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
703
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
704
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
705
-
706
- import vds_audit_orchestrator.engine.row_evaluator as row_module
707
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
708
-
709
- llm_cfg = SimpleNamespace(
710
- agent_retries=0,
711
- output_retries=0,
712
- max_tokens_per_request=1024,
713
- model_standard="z-ai/glm5",
714
- protocol=SimpleNamespace(value="anthropic"),
715
- reasoning_effort=None,
716
- agent_stream=False,
717
- )
718
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
719
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
720
-
721
- _FakeAgent.created_kwargs = []
722
- module._ROW_EVAL_AGENTS.clear()
723
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
724
-
725
- evaluator = module.LLMRowEvaluator(
726
- config=SimpleNamespace(
727
- protocol=SimpleNamespace(value="anthropic"),
728
- model="z-ai/glm5",
729
- use_dspy=False,
730
- ),
731
- template_hash="tpl",
732
- evidence_hash="evidence",
733
- )
734
-
735
- evaluator._invoke_sync_agent(
736
- key="test-max-tokens",
737
- name="RowEvaluator",
738
- system_prompt="system",
739
- user_prompt="user",
740
- toolsets=[],
741
- profile={},
742
- )
743
-
744
- model_settings = _FakeAgent.created_kwargs[0]["model_settings"]
745
- assert getattr(model_settings, "max_tokens", None) == 1024
746
-
747
-
748
- @pytest.mark.asyncio
749
- async def test_invoke_async_agent_applies_hard_timeout(monkeypatch):
750
- fake_pydantic_ai = SimpleNamespace(Agent=_SlowAsyncAgent, RunContext=object)
751
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
752
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
753
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
754
-
755
- import vds_audit_orchestrator.engine.row_evaluator as row_module
756
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
757
-
758
- llm_cfg = SimpleNamespace(
759
- agent_retries=0,
760
- output_retries=0,
761
- max_tokens=256,
762
- model_standard="gemini-3-flash",
763
- protocol=SimpleNamespace(value="gemini"),
764
- agent_timeout_seconds=0.05,
765
- )
766
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
767
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
768
-
769
- _SlowAsyncAgent.created_retries.clear()
770
- _SlowAsyncAgent.created_kwargs = []
771
- module._ROW_EVAL_AGENTS.clear()
772
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
773
-
774
- evaluator = module.LLMRowEvaluator(
775
- config=SimpleNamespace(
776
- protocol=SimpleNamespace(value="gemini"),
777
- model="gemini-3-flash",
778
- use_dspy=False,
779
- runtime_context={},
780
- ),
781
- template_hash="tpl",
782
- evidence_hash="evidence",
783
- )
784
-
785
- with pytest.raises(module.RowEvaluationBackendError) as exc_info:
786
- await evaluator._invoke_async_agent(
787
- key="test-agent-timeout",
788
- name="RowEvaluator",
789
- system_prompt="system",
790
- user_prompt="user",
791
- toolsets=[],
792
- profile={},
793
- )
794
-
795
- assert _SlowAsyncAgent.created_retries == [0]
796
- model_settings = _SlowAsyncAgent.created_kwargs[0].get("model_settings")
797
- assert not hasattr(model_settings, "openai_reasoning_effort")
798
- assert exc_info.value.retry_metadata.get("reason_code") == "agent_timeout"
799
- assert exc_info.value.retry_metadata.get("timeout_policy", {}).get("initial_timeout_seconds") == pytest.approx(0.05)
800
-
801
-
802
- def test_resolve_async_agent_timeout_policy_clamps_to_row_timeout_budget(monkeypatch):
803
- import vds_audit_orchestrator.engine.row_evaluator as row_module
804
-
805
- llm_cfg = SimpleNamespace(
806
- agent_timeout_seconds=300.0,
807
- agent_timeout_max_seconds=900.0,
808
- agent_timeout_extension_seconds=180.0,
809
- agent_timeout_extension_attempts=4,
810
- agent_timeout_heartbeat_seconds=30.0,
811
- agent_idle_timeout_seconds=600.0,
812
- )
813
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
814
-
815
- evaluator = module.LLMRowEvaluator(
816
- config=SimpleNamespace(
817
- protocol=SimpleNamespace(value="gemini"),
818
- model="gemini-3-flash",
819
- use_dspy=False,
820
- runtime_context={"row_timeout_ms": 20000},
821
- ),
822
- template_hash="tpl",
823
- evidence_hash="evidence",
824
- )
825
-
826
- policy = evaluator._resolve_async_agent_timeout_policy()
827
-
828
- assert policy.initial_timeout_seconds == pytest.approx(25.0)
829
- assert policy.max_timeout_seconds == pytest.approx(25.0)
830
-
831
-
832
- def test_resolve_async_agent_timeout_policy_uses_lease_budget_when_enabled(monkeypatch):
833
- import vds_audit_orchestrator.engine.row_evaluator as row_module
834
-
835
- llm_cfg = SimpleNamespace(
836
- agent_timeout_seconds=300.0,
837
- agent_timeout_max_seconds=900.0,
838
- agent_timeout_extension_seconds=180.0,
839
- agent_timeout_extension_attempts=4,
840
- agent_timeout_heartbeat_seconds=30.0,
841
- agent_idle_timeout_seconds=600.0,
842
- )
843
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
844
-
845
- evaluator = module.LLMRowEvaluator(
846
- config=SimpleNamespace(
847
- protocol=SimpleNamespace(value="gemini"),
848
- model="gemini-3-flash",
849
- use_dspy=False,
850
- runtime_context={
851
- "row_timeout_ms": 120000,
852
- "row_progress_lease_seconds": 45,
853
- "row_absolute_timeout_ms": 180000,
854
- },
855
- ),
856
- template_hash="tpl",
857
- evidence_hash="evidence",
858
- )
859
-
860
- policy = evaluator._resolve_async_agent_timeout_policy()
861
-
862
- assert policy.initial_timeout_seconds == pytest.approx(45.0)
863
- assert policy.max_timeout_seconds == pytest.approx(180.0)
864
-
865
-
866
- @pytest.mark.asyncio
867
- async def test_invoke_async_agent_extends_timeout_when_event_stream_progress_continues(monkeypatch):
868
- fake_pydantic_ai = SimpleNamespace(Agent=_ProgressAsyncAgent, RunContext=object)
869
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
870
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
871
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
872
-
873
- import vds_audit_orchestrator.engine.row_evaluator as row_module
874
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
875
-
876
- llm_cfg = SimpleNamespace(
877
- agent_retries=0,
878
- output_retries=0,
879
- max_tokens=256,
880
- model_standard="gemini-3-flash",
881
- protocol=SimpleNamespace(value="gemini"),
882
- agent_timeout_seconds=0.02,
883
- agent_timeout_max_seconds=0.08,
884
- agent_timeout_extension_seconds=0.03,
885
- agent_timeout_extension_attempts=1,
886
- agent_timeout_heartbeat_seconds=0.005,
887
- agent_idle_timeout_seconds=1.0,
888
- )
889
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
890
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
891
-
892
- module._ROW_EVAL_AGENTS.clear()
893
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
894
- _ProgressAsyncAgent.created_kwargs = []
895
-
896
- evaluator = module.LLMRowEvaluator(
897
- config=SimpleNamespace(
898
- protocol=SimpleNamespace(value="gemini"),
899
- model="gemini-3-flash",
900
- use_dspy=False,
901
- runtime_context={"row_timeout_ms": 1000},
902
- ),
903
- template_hash="tpl",
904
- evidence_hash="evidence",
905
- )
906
-
907
- response = await evaluator._invoke_async_agent(
908
- key="test-agent-progress",
909
- name="RowEvaluator",
910
- system_prompt="system",
911
- user_prompt="user",
912
- toolsets=[],
913
- profile={},
914
- )
915
-
916
- assert response.reason == "reason"
917
- telemetry = evaluator.get_last_prompt_tool_telemetry_snapshot()
918
- assert telemetry is not None
919
- assert telemetry["prompt_tool_telemetry"]["event_tool_calls_completed"] == 2
920
- assert "read_file" in telemetry["prompt_tool_telemetry"]["event_tool_names"]
921
-
922
-
923
- @pytest.mark.asyncio
924
- async def test_invoke_async_agent_heartbeat_includes_runtime_context(monkeypatch):
925
- fake_pydantic_ai = SimpleNamespace(Agent=_ProgressAsyncAgent, RunContext=object)
926
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
927
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
928
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
929
-
930
- import vds_audit_orchestrator.engine.row_evaluator as row_module
931
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
932
-
933
- llm_cfg = SimpleNamespace(
934
- agent_retries=0,
935
- output_retries=0,
936
- max_tokens=256,
937
- model_standard="gemini-3-flash",
938
- protocol=SimpleNamespace(value="gemini"),
939
- agent_timeout_seconds=0.02,
940
- agent_timeout_max_seconds=0.08,
941
- agent_timeout_extension_seconds=0.03,
942
- agent_timeout_extension_attempts=1,
943
- agent_timeout_heartbeat_seconds=0.005,
944
- agent_idle_timeout_seconds=1.0,
945
- )
946
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
947
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
948
-
949
- fake_logger = _FakeLogger()
950
- monkeypatch.setattr(module, "logger", fake_logger)
951
-
952
- module._ROW_EVAL_AGENTS.clear()
953
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
954
- _ProgressAsyncAgent.created_kwargs = []
955
-
956
- evaluator = module.LLMRowEvaluator(
957
- config=SimpleNamespace(
958
- protocol=SimpleNamespace(value="gemini"),
959
- model="gemini-3-flash",
960
- use_dspy=False,
961
- runtime_context={
962
- "thread_id": "thread-1",
963
- "run_id": "run-1",
964
- "audit_id": "run-1",
965
- "project_key": "project-1",
966
- "repo_key": "repo-1",
967
- },
968
- ),
969
- template_hash="tpl",
970
- evidence_hash="evidence",
971
- )
972
-
973
- response = await evaluator._invoke_async_agent(
974
- key="test-agent-progress-runtime-fields",
975
- name="RowEvaluator",
976
- system_prompt="system",
977
- user_prompt="user",
978
- toolsets=[],
979
- profile={},
980
- )
981
-
982
- assert response.reason == "reason"
983
- heartbeat_payloads = [payload for event, payload in fake_logger.records if event == "prompt_agent_call_heartbeat"]
984
- assert heartbeat_payloads
985
- assert any(payload.get("thread_id") == "thread-1" for payload in heartbeat_payloads)
986
- assert any(payload.get("repo_key") == "repo-1" for payload in heartbeat_payloads)
987
-
988
-
989
- @pytest.mark.asyncio
990
- async def test_invoke_async_agent_retries_without_event_stream(monkeypatch):
991
- fake_pydantic_ai = SimpleNamespace(Agent=_EventStreamFallbackAgent, RunContext=object)
992
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
993
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
994
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
995
-
996
- import vds_audit_orchestrator.engine.row_evaluator as row_module
997
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
998
-
999
- llm_cfg = SimpleNamespace(
1000
- agent_retries=0,
1001
- output_retries=0,
1002
- max_tokens=256,
1003
- model_standard="gemini-3-flash",
1004
- protocol=SimpleNamespace(value="gemini"),
1005
- agent_timeout_seconds=0.2,
1006
- agent_timeout_max_seconds=0.2,
1007
- agent_timeout_extension_seconds=0.0,
1008
- agent_timeout_extension_attempts=0,
1009
- agent_timeout_heartbeat_seconds=0.01,
1010
- agent_idle_timeout_seconds=1.0,
1011
- )
1012
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
1013
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
1014
-
1015
- module._ROW_EVAL_AGENTS.clear()
1016
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
1017
- _EventStreamFallbackAgent.call_kwargs = []
1018
-
1019
- evaluator = module.LLMRowEvaluator(
1020
- config=SimpleNamespace(
1021
- protocol=SimpleNamespace(value="gemini"),
1022
- model="gemini-3-flash",
1023
- use_dspy=False,
1024
- runtime_context={},
1025
- ),
1026
- template_hash="tpl",
1027
- evidence_hash="evidence",
1028
- )
1029
-
1030
- response = await evaluator._invoke_async_agent(
1031
- key="test-agent-event-stream-fallback",
1032
- name="RowEvaluator",
1033
- system_prompt="system",
1034
- user_prompt="user",
1035
- toolsets=[],
1036
- profile={},
1037
- )
1038
-
1039
- assert response.reason == "reason"
1040
- assert len(_EventStreamFallbackAgent.call_kwargs) == 2
1041
- assert "event_stream_handler" in _EventStreamFallbackAgent.call_kwargs[0]
1042
- assert "event_stream_handler" not in _EventStreamFallbackAgent.call_kwargs[1]
1043
-
1044
-
1045
- @pytest.mark.asyncio
1046
- async def test_invoke_async_agent_normalizes_fallback_failure(monkeypatch):
1047
- fake_pydantic_ai = SimpleNamespace(Agent=_EventStreamFallbackThenTimeoutAgent, RunContext=object)
1048
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
1049
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
1050
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
1051
-
1052
- import vds_audit_orchestrator.engine.row_evaluator as row_module
1053
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
1054
-
1055
- llm_cfg = SimpleNamespace(
1056
- agent_retries=0,
1057
- output_retries=0,
1058
- max_tokens=256,
1059
- model_standard="gemini-3-flash",
1060
- protocol=SimpleNamespace(value="gemini"),
1061
- agent_timeout_seconds=0.2,
1062
- agent_timeout_max_seconds=0.2,
1063
- agent_timeout_extension_seconds=0.0,
1064
- agent_timeout_extension_attempts=0,
1065
- agent_timeout_heartbeat_seconds=0.01,
1066
- agent_idle_timeout_seconds=1.0,
1067
- )
1068
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
1069
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
1070
-
1071
- module._ROW_EVAL_AGENTS.clear()
1072
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
1073
- _EventStreamFallbackThenTimeoutAgent.call_kwargs = []
1074
-
1075
- evaluator = module.LLMRowEvaluator(
1076
- config=SimpleNamespace(
1077
- protocol=SimpleNamespace(value="gemini"),
1078
- model="gemini-3-flash",
1079
- use_dspy=False,
1080
- runtime_context={},
1081
- ),
1082
- template_hash="tpl",
1083
- evidence_hash="evidence",
1084
- )
1085
-
1086
- with pytest.raises(module.RowEvaluationBackendError) as exc_info:
1087
- await evaluator._invoke_async_agent(
1088
- key="test-agent-event-stream-fallback-timeout",
1089
- name="RowEvaluator",
1090
- system_prompt="system",
1091
- user_prompt="user",
1092
- toolsets=[],
1093
- profile={},
1094
- )
1095
-
1096
- assert len(_EventStreamFallbackThenTimeoutAgent.call_kwargs) == 2
1097
- assert exc_info.value.retry_metadata.get("reason_code") == "agent_timeout"
1098
-
1099
-
1100
- @pytest.mark.asyncio
1101
- async def test_invoke_async_agent_reports_idle_timeout_reason_code(monkeypatch):
1102
- fake_pydantic_ai = SimpleNamespace(Agent=_IdleStallAgent, RunContext=object)
1103
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
1104
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
1105
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
1106
-
1107
- import vds_audit_orchestrator.engine.row_evaluator as row_module
1108
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
1109
-
1110
- llm_cfg = SimpleNamespace(
1111
- agent_retries=0,
1112
- output_retries=0,
1113
- max_tokens=256,
1114
- model_standard="gemini-3-flash",
1115
- protocol=SimpleNamespace(value="gemini"),
1116
- agent_timeout_seconds=1.0,
1117
- agent_timeout_max_seconds=1.0,
1118
- agent_timeout_extension_seconds=0.0,
1119
- agent_timeout_extension_attempts=0,
1120
- agent_timeout_heartbeat_seconds=0.005,
1121
- agent_idle_timeout_seconds=0.02,
1122
- agent_stream=False,
1123
- )
1124
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
1125
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
1126
-
1127
- module._ROW_EVAL_AGENTS.clear()
1128
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
1129
-
1130
- evaluator = module.LLMRowEvaluator(
1131
- config=SimpleNamespace(
1132
- protocol=SimpleNamespace(value="gemini"),
1133
- model="gemini-3-flash",
1134
- use_dspy=False,
1135
- runtime_context={},
1136
- ),
1137
- template_hash="tpl",
1138
- evidence_hash="evidence",
1139
- )
1140
-
1141
- with pytest.raises(module.RowEvaluationBackendError) as exc_info:
1142
- await evaluator._invoke_async_agent(
1143
- key="test-agent-idle-timeout",
1144
- name="RowEvaluator",
1145
- system_prompt="system",
1146
- user_prompt="user",
1147
- toolsets=[],
1148
- profile={},
1149
- )
1150
-
1151
- assert exc_info.value.retry_metadata.get("reason_code") == "agent_idle_timeout"
1152
-
1153
-
1154
- @pytest.mark.asyncio
1155
- async def test_invoke_async_agent_reports_tool_churn_reason_code(monkeypatch):
1156
- fake_pydantic_ai = SimpleNamespace(Agent=_ChurnAgent, RunContext=object)
1157
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
1158
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
1159
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
1160
-
1161
- import vds_audit_orchestrator.engine.row_evaluator as row_module
1162
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
1163
-
1164
- llm_cfg = SimpleNamespace(
1165
- agent_retries=0,
1166
- output_retries=0,
1167
- max_tokens=256,
1168
- model_standard="gemini-3-flash",
1169
- protocol=SimpleNamespace(value="gemini"),
1170
- agent_timeout_seconds=1.0,
1171
- agent_timeout_max_seconds=1.0,
1172
- agent_timeout_extension_seconds=0.0,
1173
- agent_timeout_extension_attempts=0,
1174
- agent_timeout_heartbeat_seconds=0.005,
1175
- agent_idle_timeout_seconds=1.0,
1176
- agent_stream=False,
1177
- )
1178
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
1179
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
1180
-
1181
- module._ROW_EVAL_AGENTS.clear()
1182
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
1183
-
1184
- evaluator = module.LLMRowEvaluator(
1185
- config=SimpleNamespace(
1186
- protocol=SimpleNamespace(value="gemini"),
1187
- model="gemini-3-flash",
1188
- use_dspy=False,
1189
- runtime_context={},
1190
- ),
1191
- template_hash="tpl",
1192
- evidence_hash="evidence",
1193
- )
1194
-
1195
- with pytest.raises(module.RowEvaluationBackendError) as exc_info:
1196
- await evaluator._invoke_async_agent(
1197
- key="test-agent-tool-churn",
1198
- name="RowEvaluator",
1199
- system_prompt="system",
1200
- user_prompt="user",
1201
- toolsets=[],
1202
- profile={},
1203
- )
1204
-
1205
- assert exc_info.value.retry_metadata.get("reason_code") == "agent_tool_churn"
1206
-
1207
-
1208
- @pytest.mark.asyncio
1209
- async def test_invoke_async_agent_preserves_provider_server_error_reason_code(monkeypatch):
1210
- fake_pydantic_ai = SimpleNamespace(Agent=_ProviderErrorAgent, RunContext=object)
1211
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
1212
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
1213
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
1214
-
1215
- import vds_audit_orchestrator.engine.row_evaluator as row_module
1216
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
1217
-
1218
- llm_cfg = SimpleNamespace(
1219
- agent_retries=0,
1220
- output_retries=0,
1221
- max_tokens=256,
1222
- model_standard="gemini-3-flash",
1223
- protocol=SimpleNamespace(value="gemini"),
1224
- agent_timeout_seconds=1.0,
1225
- agent_timeout_max_seconds=1.0,
1226
- agent_timeout_extension_seconds=0.0,
1227
- agent_timeout_extension_attempts=0,
1228
- agent_timeout_heartbeat_seconds=0.01,
1229
- agent_idle_timeout_seconds=1.0,
1230
- )
1231
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
1232
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
1233
-
1234
- module._ROW_EVAL_AGENTS.clear()
1235
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
1236
-
1237
- evaluator = module.LLMRowEvaluator(
1238
- config=SimpleNamespace(
1239
- protocol=SimpleNamespace(value="gemini"),
1240
- model="gemini-3-flash",
1241
- use_dspy=False,
1242
- runtime_context={},
1243
- ),
1244
- template_hash="tpl",
1245
- evidence_hash="evidence",
1246
- )
1247
-
1248
- with pytest.raises(module.RowEvaluationBackendError) as exc_info:
1249
- await evaluator._invoke_async_agent(
1250
- key="test-agent-provider-server-error",
1251
- name="RowEvaluator",
1252
- system_prompt="system",
1253
- user_prompt="user",
1254
- toolsets=[],
1255
- profile={},
1256
- )
1257
-
1258
- assert exc_info.value.retry_metadata.get("reason_code") == "provider_server_error"
1259
-
1260
-
1261
- @pytest.mark.asyncio
1262
- async def test_invoke_async_agent_with_provider_retry_recovers_from_provider_server_error(monkeypatch):
1263
- evaluator = module.LLMRowEvaluator(
1264
- config=SimpleNamespace(
1265
- protocol=SimpleNamespace(value="gemini"),
1266
- model="gemini-3-flash",
1267
- use_dspy=False,
1268
- runtime_context={},
1269
- ),
1270
- template_hash="tpl",
1271
- evidence_hash="evidence",
1272
- )
1273
-
1274
- calls = {"count": 0}
1275
-
1276
- async def _fake_invoke_async_agent(**_kwargs):
1277
- calls["count"] += 1
1278
- if calls["count"] == 1:
1279
- raise module.RowEvaluationBackendError(
1280
- "provider failed",
1281
- retry_metadata={"reason_code": "provider_server_error"},
1282
- )
1283
- return RowEvaluationResponse(
1284
- reasoning="reasoning",
1285
- reason="reason",
1286
- score=50.0,
1287
- confidence=0.8,
1288
- finding="finding",
1289
- )
1290
-
1291
- monkeypatch.setattr(module, "_prompt_provider_retry_attempts", lambda: 2)
1292
- monkeypatch.setattr(module, "_prompt_provider_retry_backoff_seconds", lambda: 0.0)
1293
- monkeypatch.setattr(evaluator, "_invoke_async_agent", _fake_invoke_async_agent)
1294
-
1295
- response = await evaluator._invoke_async_agent_with_provider_retry(
1296
- key="retry-test",
1297
- name="RowEvaluator",
1298
- system_prompt="system",
1299
- user_prompt="user",
1300
- toolsets=[],
1301
- profile={},
1302
- row_id="CL-001",
1303
- runtime_fields={},
1304
- )
1305
-
1306
- assert response.reason == "reason"
1307
- assert calls["count"] == 2
1308
- telemetry = evaluator.get_last_prompt_tool_telemetry_snapshot() or {}
1309
- provider_retry = telemetry.get("prompt_provider_retry") or evaluator._last_prompt_tool_telemetry.get(
1310
- "prompt_provider_retry"
1311
- )
1312
- assert provider_retry["reason_code"] == "provider_server_error"
1313
- assert provider_retry["recovered"] is True
1314
-
1315
-
1316
- @pytest.mark.asyncio
1317
- async def test_invoke_async_agent_with_provider_retry_recovers_from_wrapped_internal_network_failure(monkeypatch):
1318
- evaluator = module.LLMRowEvaluator(
1319
- config=SimpleNamespace(
1320
- protocol=SimpleNamespace(value="anthropic"),
1321
- model="glm-5",
1322
- use_dspy=False,
1323
- runtime_context={},
1324
- ),
1325
- template_hash="tpl",
1326
- evidence_hash="evidence",
1327
- )
1328
-
1329
- calls = {"count": 0}
1330
-
1331
- async def _fake_invoke_async_agent(**_kwargs):
1332
- calls["count"] += 1
1333
- if calls["count"] == 1:
1334
- raise module.RowEvaluationBackendError(
1335
- "{'type': 'error', 'error': {'type': 'api_error', 'message': 'Internal Network Failure'}}",
1336
- retry_metadata={"reason_code": "agent_timeout"},
1337
- )
1338
- return RowEvaluationResponse(
1339
- reasoning="reasoning",
1340
- reason="reason",
1341
- score=50.0,
1342
- confidence=0.8,
1343
- finding="finding",
1344
- )
1345
-
1346
- monkeypatch.setattr(module, "_prompt_provider_retry_attempts", lambda: 2)
1347
- monkeypatch.setattr(module, "_prompt_provider_retry_backoff_seconds", lambda: 0.0)
1348
- monkeypatch.setattr(evaluator, "_invoke_async_agent", _fake_invoke_async_agent)
1349
-
1350
- response = await evaluator._invoke_async_agent_with_provider_retry(
1351
- key="retry-test-wrapped-network-failure",
1352
- name="RowEvaluator",
1353
- system_prompt="system",
1354
- user_prompt="user",
1355
- toolsets=[],
1356
- profile={},
1357
- row_id="CL-011",
1358
- runtime_fields={},
1359
- )
1360
-
1361
- assert response.reason == "reason"
1362
- assert calls["count"] == 2
1363
- telemetry = evaluator.get_last_prompt_tool_telemetry_snapshot() or {}
1364
- provider_retry = telemetry.get("prompt_provider_retry") or evaluator._last_prompt_tool_telemetry.get(
1365
- "prompt_provider_retry"
1366
- )
1367
- assert provider_retry["reason_code"] == "provider_transient_error"
1368
- assert provider_retry["recovered"] is True
1369
-
1370
-
1371
- @pytest.mark.asyncio
1372
- async def test_invoke_async_agent_with_provider_retry_fails_over_to_fallback_profile(monkeypatch):
1373
- evaluator = module.LLMRowEvaluator(
1374
- config=SimpleNamespace(
1375
- protocol=SimpleNamespace(value="openai"),
1376
- model="primary-model",
1377
- use_dspy=False,
1378
- runtime_context={},
1379
- row_failover_profiles=["fallback-openai"],
1380
- ),
1381
- template_hash="tpl",
1382
- evidence_hash="evidence",
1383
- )
1384
-
1385
- primary_cfg = SimpleNamespace(
1386
- agent_retries=0,
1387
- output_retries=0,
1388
- max_tokens=256,
1389
- model_standard="primary-model",
1390
- protocol=SimpleNamespace(value="openai"),
1391
- base_url="https://primary.example/v1",
1392
- agent_stream=False,
1393
- stream=False,
1394
- row_failover_profiles=["fallback-openai"],
1395
- row_failover_max_provider_hops=1,
1396
- )
1397
- fallback_cfg = SimpleNamespace(
1398
- agent_retries=0,
1399
- output_retries=0,
1400
- max_tokens=256,
1401
- model_standard="fallback-model",
1402
- protocol=SimpleNamespace(value="openai"),
1403
- base_url="https://fallback.example/v1",
1404
- agent_stream=False,
1405
- stream=False,
1406
- row_failover_profiles=[],
1407
- row_failover_max_provider_hops=1,
1408
- )
1409
-
1410
- async def _fake_invoke_async_agent(**kwargs):
1411
- llm_cfg = kwargs.get("llm_cfg")
1412
- if getattr(llm_cfg, "model_standard", "") == "primary-model":
1413
- raise module.RowEvaluationBackendError(
1414
- "status_code: 503 service unavailable",
1415
- retry_metadata={"reason_code": "provider_server_error"},
1416
- )
1417
- return RowEvaluationResponse(
1418
- reasoning="reasoning",
1419
- reason="reason",
1420
- score=50.0,
1421
- confidence=0.8,
1422
- finding="finding",
1423
- )
1424
-
1425
- monkeypatch.setenv("VDS_AUDIT_ACTIVE_PROFILE", "primary-openai")
1426
- monkeypatch.setenv("VDS_AUDIT_LLM__ROW_FAILOVER_PROFILES", "configured")
1427
- monkeypatch.setattr(module, "_prompt_provider_retry_attempts", lambda: 1)
1428
- monkeypatch.setattr(module, "_prompt_provider_retry_backoff_seconds", lambda: 0.0)
1429
- monkeypatch.setattr(module, "inherit_runtime_llm_policy", lambda profile_name, *, source_llm=None: fallback_cfg)
1430
- monkeypatch.setattr(evaluator, "_invoke_async_agent", _fake_invoke_async_agent)
1431
-
1432
- response = await evaluator._invoke_async_agent_with_provider_retry(
1433
- key="retry-test-provider-failover",
1434
- name="RowEvaluator",
1435
- system_prompt="system",
1436
- user_prompt="user",
1437
- toolsets=[],
1438
- profile={},
1439
- row_id="CL-001",
1440
- runtime_fields={"check_id": "CL-001"},
1441
- llm_cfg=primary_cfg,
1442
- effective_model="primary-model",
1443
- runtime_profile_name="primary-openai",
1444
- )
1445
-
1446
- assert response.reason == "reason"
1447
- retry_telemetry = evaluator.get_last_retry_telemetry_snapshot() or {}
1448
- assert retry_telemetry["provider_failover_attempted"] is True
1449
- assert retry_telemetry["provider_failover_final_provider"] == "fallback-openai"
1450
- assert retry_telemetry["provider_failover_chain"] == ["primary-openai", "fallback-openai"]
1451
- assert retry_telemetry["provider_failover_hops"] == 1
1452
-
1453
-
1454
- @pytest.mark.asyncio
1455
- async def test_invoke_async_agent_with_provider_retry_marks_failover_exhausted_when_no_fallback_remains(monkeypatch):
1456
- evaluator = module.LLMRowEvaluator(
1457
- config=SimpleNamespace(
1458
- protocol=SimpleNamespace(value="openai"),
1459
- model="primary-model",
1460
- use_dspy=False,
1461
- runtime_context={},
1462
- row_failover_profiles=["fallback-openai", "dead-openai"],
1463
- ),
1464
- template_hash="tpl",
1465
- evidence_hash="evidence",
1466
- )
1467
-
1468
- primary_cfg = SimpleNamespace(
1469
- agent_retries=0,
1470
- output_retries=0,
1471
- max_tokens=256,
1472
- model_standard="primary-model",
1473
- protocol=SimpleNamespace(value="openai"),
1474
- base_url="https://primary.example/v1",
1475
- agent_stream=False,
1476
- stream=False,
1477
- row_failover_profiles=["fallback-openai", "dead-openai"],
1478
- row_failover_max_provider_hops=1,
1479
- )
1480
-
1481
- async def _fake_invoke_async_agent(**_kwargs):
1482
- raise module.RowEvaluationBackendError(
1483
- "status_code: 503 service unavailable",
1484
- retry_metadata={"reason_code": "provider_server_error"},
1485
- )
1486
-
1487
- monkeypatch.setenv("VDS_AUDIT_ACTIVE_PROFILE", "primary-openai")
1488
- monkeypatch.setenv("VDS_AUDIT_ROW_FAILOVER_AVAILABLE_PROFILES", "fallback-openai")
1489
- monkeypatch.setenv("VDS_AUDIT_LLM__ROW_FAILOVER_PROFILES", "configured")
1490
- monkeypatch.setattr(module, "_prompt_provider_retry_attempts", lambda: 1)
1491
- monkeypatch.setattr(module, "_prompt_provider_retry_backoff_seconds", lambda: 0.0)
1492
- monkeypatch.setattr(evaluator, "_invoke_async_agent", _fake_invoke_async_agent)
1493
-
1494
- with pytest.raises(module.RowEvaluationBackendError) as exc_info:
1495
- await evaluator._invoke_async_agent_with_provider_retry(
1496
- key="retry-test-failover-exhausted",
1497
- name="RowEvaluator",
1498
- system_prompt="system",
1499
- user_prompt="user",
1500
- toolsets=[],
1501
- profile={},
1502
- row_id="CL-011",
1503
- runtime_fields={"check_id": "CL-011"},
1504
- llm_cfg=primary_cfg,
1505
- effective_model="primary-model",
1506
- runtime_profile_name="primary-openai",
1507
- row_failover_context=module.RowFailoverContext(
1508
- row_id="CL-011",
1509
- check_id="CL-011",
1510
- original_provider="primary-openai",
1511
- failover_count=1,
1512
- failover_chain=["primary-openai", "fallback-openai"],
1513
- ),
1514
- provider_health_memory=module.ProviderHealthMemory(),
1515
- )
1516
-
1517
- retry_metadata = exc_info.value.retry_metadata or {}
1518
- assert retry_metadata["timeout_kind"] == "timeout_failover_exhausted"
1519
- retry_telemetry = evaluator.get_last_retry_telemetry_snapshot() or {}
1520
- assert retry_telemetry["provider_failover_final_provider"] == "primary-openai"
1521
- assert retry_telemetry["provider_failover_profiles_considered"] == ["fallback-openai"]
1522
-
1523
-
1524
- def test_classify_prompt_provider_retry_reason_treats_429_as_retryable():
1525
- exc = RuntimeError("status_code: 429, body: {'error': {'type': 'rate_limit_error'}}")
1526
- assert module._classify_prompt_provider_retry_reason(exc) == "provider_transient_error"
1527
-
1528
-
1529
- @pytest.mark.asyncio
1530
- async def test_invoke_async_agent_uses_run_stream_for_openai_codex(monkeypatch):
1531
- fake_pydantic_ai = SimpleNamespace(Agent=_CodexAgent, RunContext=object)
1532
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
1533
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
1534
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
1535
-
1536
- import vds_audit_orchestrator.engine.row_evaluator as row_module
1537
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
1538
-
1539
- llm_cfg = SimpleNamespace(
1540
- agent_retries=0,
1541
- output_retries=0,
1542
- max_tokens=256,
1543
- model_standard="gpt-5.3-codex",
1544
- protocol=SimpleNamespace(value="openai-codex"),
1545
- agent_timeout_seconds=5.0,
1546
- reasoning_effort="medium",
1547
- )
1548
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
1549
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
1550
-
1551
- module._ROW_EVAL_AGENTS.clear()
1552
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
1553
- _CodexAgent.run_sync_calls = 0
1554
- _CodexAgent.run_calls = 0
1555
- _CodexAgent.run_stream_calls = 0
1556
- _CodexAgent.created_kwargs = []
1557
-
1558
- evaluator = module.LLMRowEvaluator(
1559
- config=SimpleNamespace(
1560
- protocol=SimpleNamespace(value="openai-codex"),
1561
- model="gpt-5.3-codex",
1562
- use_dspy=False,
1563
- runtime_context={},
1564
- ),
1565
- template_hash="tpl",
1566
- evidence_hash="evidence",
1567
- )
1568
-
1569
- response = await evaluator._invoke_async_agent(
1570
- key="test-agent-codex-async",
1571
- name="RowEvaluator",
1572
- system_prompt="system",
1573
- user_prompt="user",
1574
- toolsets=[],
1575
- profile={},
1576
- )
1577
-
1578
- assert response.reason == "reason"
1579
- assert _CodexAgent.run_stream_calls == 1
1580
- assert _CodexAgent.run_calls == 0
1581
- model_settings = _CodexAgent.created_kwargs[0].get("model_settings")
1582
- assert getattr(model_settings, "max_tokens", None) is None
1583
- assert getattr(model_settings, "openai_reasoning_effort", None) == "medium"
1584
-
1585
-
1586
- def test_invoke_sync_agent_uses_run_stream_for_openai_codex(monkeypatch):
1587
- fake_pydantic_ai = SimpleNamespace(Agent=_CodexAgent, RunContext=object)
1588
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
1589
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
1590
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
1591
-
1592
- import vds_audit_orchestrator.engine.row_evaluator as row_module
1593
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
1594
-
1595
- llm_cfg = SimpleNamespace(
1596
- agent_retries=1,
1597
- output_retries=1,
1598
- max_tokens=256,
1599
- model_standard="gpt-5.3-codex",
1600
- protocol=SimpleNamespace(value="openai-codex"),
1601
- reasoning_effort="xhigh",
1602
- )
1603
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
1604
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
1605
-
1606
- module._ROW_EVAL_AGENTS.clear()
1607
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
1608
- _CodexAgent.run_sync_calls = 0
1609
- _CodexAgent.run_calls = 0
1610
- _CodexAgent.run_stream_calls = 0
1611
- _CodexAgent.created_kwargs = []
1612
-
1613
- evaluator = module.LLMRowEvaluator(
1614
- config=SimpleNamespace(
1615
- protocol=SimpleNamespace(value="openai-codex"),
1616
- model="gpt-5.3-codex",
1617
- use_dspy=False,
1618
- ),
1619
- template_hash="tpl",
1620
- evidence_hash="evidence",
1621
- )
1622
-
1623
- response = evaluator._invoke_sync_agent(
1624
- key="test-agent-codex-sync",
1625
- name="RowEvaluator",
1626
- system_prompt="system",
1627
- user_prompt="user",
1628
- toolsets=[],
1629
- profile={},
1630
- )
1631
-
1632
- assert response.reason == "reason"
1633
- assert _CodexAgent.run_stream_calls == 1
1634
- assert _CodexAgent.run_sync_calls == 0
1635
- model_settings = _CodexAgent.created_kwargs[0].get("model_settings")
1636
- assert getattr(model_settings, "max_tokens", None) is None
1637
- assert getattr(model_settings, "openai_reasoning_effort", None) == "xhigh"
1638
-
1639
-
1640
- @pytest.mark.parametrize(
1641
- ("agent_stream", "stream", "expected_run_sync", "expected_run_stream"),
1642
- [
1643
- (False, False, 1, 0),
1644
- (True, False, 0, 1),
1645
- (False, True, 0, 1),
1646
- ],
1647
- )
1648
- def test_invoke_sync_agent_honors_non_codex_stream_mode_matrix(
1649
- monkeypatch, agent_stream, stream, expected_run_sync, expected_run_stream
1650
- ):
1651
- fake_pydantic_ai = SimpleNamespace(Agent=_NonCodexAgent, RunContext=object)
1652
- fake_settings_module = SimpleNamespace(ModelSettings=_fake_model_settings)
1653
- monkeypatch.setitem(sys.modules, "pydantic_ai", fake_pydantic_ai)
1654
- monkeypatch.setitem(sys.modules, "pydantic_ai.settings", fake_settings_module)
1655
-
1656
- import vds_audit_orchestrator.engine.row_evaluator as row_module
1657
- from vds_audit_orchestrator.agents import pydantic_base as _pydantic_base
1658
-
1659
- llm_cfg = SimpleNamespace(
1660
- agent_retries=1,
1661
- output_retries=1,
1662
- max_tokens=256,
1663
- model_standard="gpt-4o-mini",
1664
- protocol=SimpleNamespace(value="openai"),
1665
- agent_stream=agent_stream,
1666
- stream=stream,
1667
- reasoning_effort=None,
1668
- )
1669
- monkeypatch.setattr(row_module, "get_config", lambda: SimpleNamespace(llm=llm_cfg))
1670
- monkeypatch.setattr(_pydantic_base, "_build_model", lambda *_args, **_kwargs: "fake-model")
1671
-
1672
- module._ROW_EVAL_AGENTS.clear()
1673
- module._ROW_EVAL_AGENT_TOOLSET_SIGNATURES.clear()
1674
- _NonCodexAgent.run_sync_calls = 0
1675
- _NonCodexAgent.run_stream_calls = 0
1676
- _NonCodexAgent.created_kwargs = []
1677
-
1678
- evaluator = module.LLMRowEvaluator(
1679
- config=SimpleNamespace(
1680
- protocol=SimpleNamespace(value="openai"),
1681
- model="gpt-4o-mini",
1682
- use_dspy=False,
1683
- ),
1684
- template_hash="tpl",
1685
- evidence_hash="evidence",
1686
- )
1687
-
1688
- response = evaluator._invoke_sync_agent(
1689
- key=f"test-agent-openai-sync-{agent_stream}-{stream}",
1690
- name="RowEvaluator",
1691
- system_prompt="system",
1692
- user_prompt="user",
1693
- toolsets=[],
1694
- profile={},
1695
- )
1696
-
1697
- assert response.reason == "reason"
1698
- assert _NonCodexAgent.run_sync_calls == expected_run_sync
1699
- assert _NonCodexAgent.run_stream_calls == expected_run_stream
1700
-
1701
-
1702
- def test_sanitize_status_score_contradiction_caps_strong_non_compliance_to_fail():
1703
- response = RowEvaluationResponse(
1704
- reasoning="reasoning",
1705
- reason="Yêu cầu chưa được đáp ứng do thiếu bằng chứng triển khai.",
1706
- score=96.0,
1707
- confidence=0.94,
1708
- finding="Thiếu cấu hình và minh chứng vận hành.",
1709
- evidence_anchors=[],
1710
- )
1711
-
1712
- sanitized = module.LLMRowEvaluator._sanitize_status_score_contradiction(response)
1713
-
1714
- assert sanitized.score == 39.0
1715
- assert sanitized.confidence == 0.8
1716
-
1717
-
1718
- def test_sanitize_status_score_contradiction_caps_partial_non_compliance_to_partial():
1719
- response = RowEvaluationResponse(
1720
- reasoning="reasoning",
1721
- reason="Yêu cầu chưa được đáp ứng đầy đủ ở một số tiêu chí phụ.",
1722
- score=95.0,
1723
- confidence=0.9,
1724
- finding="Đáp ứng một phần, cần bổ sung runbook.",
1725
- evidence_anchors=[],
1726
- )
1727
-
1728
- sanitized = module.LLMRowEvaluator._sanitize_status_score_contradiction(response)
1729
-
1730
- assert sanitized.score == 89.0
1731
- assert sanitized.confidence == 0.85
1732
-
1733
-
1734
- def test_sanitize_status_score_contradiction_keeps_positive_pass_intact():
1735
- response = RowEvaluationResponse(
1736
- reasoning="reasoning",
1737
- reason="Yêu cầu đã được đáp ứng đầy đủ và có bằng chứng rõ ràng.",
1738
- score=95.0,
1739
- confidence=0.92,
1740
- finding="Không phát hiện khoảng trống cần khắc phục.",
1741
- evidence_anchors=[],
1742
- )
1743
-
1744
- sanitized = module.LLMRowEvaluator._sanitize_status_score_contradiction(response)
1745
-
1746
- assert sanitized.score == 95.0
1747
- assert sanitized.confidence == 0.92
1748
-
1749
-
1750
- def test_normalize_failure_retry_metadata_defaults_to_synthesis_when_evidence_retrieved():
1751
- metadata = module.LLMRowEvaluator._normalize_failure_retry_metadata(
1752
- retry_metadata={},
1753
- evidence_retrieved=True,
1754
- fallback_reason_code="fallback_reason",
1755
- )
1756
-
1757
- assert metadata["reason_code"] == "fallback_reason"
1758
- assert metadata["failure_stage"] == "synthesis"
1759
- assert metadata["stage"] == "synthesis_failed"
1760
- assert metadata["evidence_retrieved"] is True
1761
-
1762
-
1763
- def test_normalize_failure_retry_metadata_defaults_to_retrieval_when_no_evidence():
1764
- metadata = module.LLMRowEvaluator._normalize_failure_retry_metadata(
1765
- retry_metadata={},
1766
- evidence_retrieved=False,
1767
- fallback_reason_code="fallback_reason",
1768
- )
1769
-
1770
- assert metadata["reason_code"] == "fallback_reason"
1771
- assert metadata["failure_stage"] == "evidence_retrieval"
1772
- assert metadata["stage"] == "evidence_retrieval_failed"
1773
- assert metadata["evidence_retrieved"] is False
1774
-
1775
-
1776
- def test_normalize_failure_retry_metadata_maps_tool_first_stage_to_retrieval():
1777
- metadata = module.LLMRowEvaluator._normalize_failure_retry_metadata(
1778
- retry_metadata={"stage": "tool_first_timeout"},
1779
- evidence_retrieved=True,
1780
- fallback_reason_code="fallback_reason",
1781
- )
1782
-
1783
- assert metadata["failure_stage"] == "evidence_retrieval"
1784
- assert metadata["stage"] == "tool_first_timeout"
1785
-
1786
-
1787
- def test_convert_response_derives_status_from_final_score():
1788
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
1789
- evaluator.config = SimpleNamespace(mode=SimpleNamespace(value="selective"))
1790
- evaluator.template_hash = "tpl"
1791
- evaluator.evidence_hash = "evidence"
1792
- evaluator._effective_protocol = "gemini"
1793
- evaluator._effective_model = "gemini-3-flash"
1794
- evaluator._last_retry_telemetry = {}
1795
- evaluator._instruction_trace_metadata = {
1796
- "instruction_profile": "none|inline|vi|pydanticai",
1797
- "instruction_inputs": {},
1798
- "instruction_hash": "abc123",
1799
- }
1800
-
1801
- response = RowEvaluationResponse(
1802
- reasoning="reasoning",
1803
- reason="Đáp ứng đầy đủ.",
1804
- score=80.0,
1805
- confidence=0.4,
1806
- finding="Cần bổ sung.",
1807
- evidence_anchors=[],
1808
- )
1809
-
1810
- result = evaluator._convert_response(
1811
- response=response,
1812
- check=SimpleNamespace(id="CL-TEST"),
1813
- row_id="CL-TEST:row_0",
1814
- fallback_evidence_refs=[],
1815
- )
1816
-
1817
- assert result.score == 32.0
1818
- assert result.score_breakdown.final_score == 32.0
1819
- assert result.status == RowStatus.FAIL
1820
- assert result.score_1_5 == 2
1821
-
1822
-
1823
- def test_convert_response_records_duration_and_anchor_allowlist_violation():
1824
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
1825
- evaluator.config = SimpleNamespace(mode=SimpleNamespace(value="selective"))
1826
- evaluator.template_hash = "tpl"
1827
- evaluator.evidence_hash = "evidence"
1828
- evaluator._effective_protocol = "openai-codex"
1829
- evaluator._effective_model = "gpt-5.3-codex"
1830
- evaluator._last_retry_telemetry = {}
1831
- evaluator._instruction_trace_metadata = {
1832
- "instruction_profile": "none|inline|vi|pydanticai",
1833
- "instruction_inputs": {},
1834
- "instruction_hash": "abc123",
1835
- }
1836
-
1837
- response = RowEvaluationResponse(
1838
- reasoning="reasoning",
1839
- reason="Đáp ứng một phần.",
1840
- score=70.0,
1841
- confidence=0.8,
1842
- finding="test",
1843
- evidence_anchors=[{"ref_type": "code_path", "ref_value": "src/not-allowed.py", "excerpt": ""}],
1844
- cited_anchor_ids=["src/not-allowed.py"],
1845
- )
1846
-
1847
- result = evaluator._convert_response(
1848
- response=response,
1849
- check=SimpleNamespace(id="CL-TEST"),
1850
- row_id="CL-TEST:row_0",
1851
- fallback_evidence_refs=["src/allowed.py"],
1852
- evaluation_duration_ms=123,
1853
- )
1854
-
1855
- assert result.provenance.evaluation_duration_ms == 123
1856
- assert result.status == RowStatus.ERROR
1857
- assert result.error_message == "anchor_allowlist_violation"
1858
- assert isinstance(result.retrieval_trace, dict)
1859
- assert result.retrieval_trace.get("anchor_identity_contract", {}).get("invalid_anchor_count") == 1
1860
- assert (
1861
- result.retrieval_trace.get("anchor_identity_contract", {}).get("invalid_reason_code") == "anchor_id_not_allowed"
1862
- )
1863
- assert result.retrieval_trace.get("anchor_id_not_allowed", {}).get("count") == 1
1864
-
1865
-
1866
- def test_convert_response_recovers_allowlisted_cited_anchor_when_model_anchor_objects_are_invalid():
1867
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
1868
- evaluator.config = SimpleNamespace(mode=SimpleNamespace(value="selective"))
1869
- evaluator.template_hash = "tpl"
1870
- evaluator.evidence_hash = "evidence"
1871
- evaluator._effective_protocol = "openai-codex"
1872
- evaluator._effective_model = "gpt-5.3-codex"
1873
- evaluator._last_retry_telemetry = {}
1874
- evaluator._instruction_trace_metadata = {
1875
- "instruction_profile": "none|inline|vi|pydanticai",
1876
- "instruction_inputs": {},
1877
- "instruction_hash": "abc123",
1878
- }
1879
-
1880
- response = RowEvaluationResponse(
1881
- reasoning="reasoning",
1882
- reason="Đã có một phần bằng chứng hợp lệ.",
1883
- score=70.0,
1884
- confidence=0.8,
1885
- finding="test",
1886
- evidence_anchors=[{"ref_type": "code_path", "ref_value": "src/not-allowed.py", "excerpt": ""}],
1887
- cited_anchor_ids=["src/not-allowed.py", "chunk:allowed-doc"],
1888
- )
1889
-
1890
- result = evaluator._convert_response(
1891
- response=response,
1892
- check=SimpleNamespace(id="CL-TEST"),
1893
- row_id="CL-TEST:row_0",
1894
- fallback_evidence_refs=["chunk:allowed-doc"],
1895
- evaluation_duration_ms=123,
1896
- )
1897
-
1898
- assert result.provenance.evaluation_duration_ms == 123
1899
- assert result.status != RowStatus.ERROR
1900
- assert result.error_message is None
1901
- assert [anchor.ref_value for anchor in result.evidence_anchors] == ["chunk:allowed-doc"]
1902
- assert result.evidence_anchors[0].verification_reason == "fallback_ref_inherited"
1903
- assert result.retrieval_trace.get("anchor_identity_contract", {}).get("invalid_anchor_count") == 1
1904
- assert result.retrieval_trace.get("anchor_id_not_allowed", {}).get("count") == 1
1905
-
1906
-
1907
- def test_convert_response_docs_primary_uses_requirement_interpretation_without_name_error():
1908
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
1909
- evaluator.config = SimpleNamespace(mode=SimpleNamespace(value="selective"))
1910
- evaluator.template_hash = "tpl"
1911
- evaluator.evidence_hash = "evidence"
1912
- evaluator._effective_protocol = "openai-codex"
1913
- evaluator._effective_model = "gpt-5.3-codex"
1914
- evaluator._last_retry_telemetry = {}
1915
- evaluator._instruction_trace_metadata = {
1916
- "instruction_profile": "none|inline|vi|pydanticai",
1917
- "instruction_inputs": {},
1918
- "instruction_hash": "abc123",
1919
- }
1920
-
1921
- response = RowEvaluationResponse(
1922
- reasoning="reasoning",
1923
- reason="Đã có một phần bằng chứng hợp lệ.",
1924
- score=70.0,
1925
- confidence=0.8,
1926
- finding="test",
1927
- evidence_anchors=[{"ref_type": "code_path", "ref_value": "src/not-allowed.py", "excerpt": ""}],
1928
- cited_anchor_ids=["src/not-allowed.py", "chunk:allowed-doc"],
1929
- )
1930
-
1931
- result = evaluator._convert_response(
1932
- response=response,
1933
- check=SimpleNamespace(id="CL-052"),
1934
- row_id="CL-052:row_51",
1935
- fallback_evidence_refs=["chunk:allowed-doc", "src/not-allowed.py"],
1936
- requirement_interpretation={
1937
- "required_anchor_modalities": ["docs"],
1938
- "finalization_policy": "docs_primary",
1939
- },
1940
- evaluation_duration_ms=123,
1941
- )
1942
-
1943
- assert result.provenance.evaluation_duration_ms == 123
1944
- assert result.status != RowStatus.ERROR
1945
- assert result.error_message is None
1946
- assert [anchor.ref_value for anchor in result.evidence_anchors] == ["chunk:allowed-doc"]
1947
-
1948
-
1949
- def test_convert_response_accepts_canonical_equivalent_anchor_ids():
1950
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
1951
- evaluator.config = SimpleNamespace(mode=SimpleNamespace(value="selective"))
1952
- evaluator.template_hash = "tpl"
1953
- evaluator.evidence_hash = "evidence"
1954
- evaluator._effective_protocol = "openai-codex"
1955
- evaluator._effective_model = "gpt-5.3-codex"
1956
- evaluator._last_retry_telemetry = {}
1957
- evaluator._instruction_trace_metadata = {
1958
- "instruction_profile": "none|inline|vi|pydanticai",
1959
- "instruction_inputs": {},
1960
- "instruction_hash": "abc123",
1961
- }
1962
-
1963
- response = RowEvaluationResponse(
1964
- reasoning="reasoning",
1965
- reason="Đã có bằng chứng hợp lệ.",
1966
- score=72.0,
1967
- confidence=0.8,
1968
- finding="Bằng chứng đã được neo đúng.",
1969
- evidence_anchors=[
1970
- {
1971
- "ref_type": "code_path",
1972
- "ref_value": "code:src/main/java/com/example/DatabaseConfig.java:18",
1973
- "excerpt": "@Bean",
1974
- }
1975
- ],
1976
- cited_anchor_ids=["code:src/main/java/com/example/DatabaseConfig.java:18"],
1977
- )
1978
-
1979
- result = evaluator._convert_response(
1980
- response=response,
1981
- check=SimpleNamespace(id="CL-TEST"),
1982
- row_id="CL-TEST:row_0",
1983
- fallback_evidence_refs=["src/main/java/com/example/DatabaseConfig.java"],
1984
- evaluation_duration_ms=123,
1985
- )
1986
-
1987
- assert result.status != RowStatus.ERROR
1988
- assert [anchor.ref_value for anchor in result.evidence_anchors] == [
1989
- "code:src/main/java/com/example/DatabaseConfig.java:18"
1990
- ]
1991
- assert result.retrieval_trace.get("anchor_identity_contract", {}).get("invalid_anchor_count") == 0
1992
- assert result.retrieval_trace.get("anchor_identity_contract", {}).get("invalid_cited_anchor_ids") == []
1993
-
1994
-
1995
- def test_convert_response_ignores_internal_analysis_refs_for_allowlist_enforcement():
1996
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
1997
- evaluator.config = SimpleNamespace(mode=SimpleNamespace(value="selective"))
1998
- evaluator.template_hash = "tpl"
1999
- evaluator.evidence_hash = "evidence"
2000
- evaluator._effective_protocol = "openai-codex"
2001
- evaluator._effective_model = "gpt-5.3-codex"
2002
- evaluator._last_retry_telemetry = {}
2003
- evaluator._instruction_trace_metadata = {
2004
- "instruction_profile": "none|inline|vi|pydanticai",
2005
- "instruction_inputs": {},
2006
- "instruction_hash": "abc123",
2007
- }
2008
-
2009
- response = RowEvaluationResponse(
2010
- reasoning="reasoning",
2011
- reason="Có bằng chứng docs hợp lệ và một số ref nội bộ để giải thích phân tích.",
2012
- score=70.0,
2013
- confidence=0.8,
2014
- finding="test",
2015
- evidence_anchors=[
2016
- {"ref_type": "doc", "ref_value": "chunk:6eb413f3e9764797", "excerpt": "Version 1.2.3"},
2017
- {"ref_type": "doc", "ref_value": "references/row-analysis.md", "excerpt": "analysis"},
2018
- ],
2019
- cited_anchor_ids=[
2020
- "chunk:6eb413f3e9764797",
2021
- "http://confluence.digital.vn/display/TTCN24/PAR+Project+Audit",
2022
- "references/row-analysis.md",
2023
- ],
2024
- )
2025
-
2026
- result = evaluator._convert_response(
2027
- response=response,
2028
- check=SimpleNamespace(id="CL-TEST"),
2029
- row_id="CL-TEST:row_0",
2030
- fallback_evidence_refs=["chunk:6eb413f3e9764797"],
2031
- evaluation_duration_ms=123,
2032
- )
2033
-
2034
- assert result.status != RowStatus.ERROR
2035
- assert result.error_message != "anchor_allowlist_violation"
2036
- assert result.retrieval_trace.get("anchor_identity_contract", {}).get("invalid_anchor_count") == 0
2037
- assert result.retrieval_trace.get("anchor_identity_contract", {}).get("invalid_cited_anchor_ids") == []
2038
-
2039
-
2040
- def test_create_error_result_records_evaluation_duration():
2041
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2042
- evaluator.config = SimpleNamespace(mode=SimpleNamespace(value="selective"))
2043
- evaluator.template_hash = "tpl"
2044
- evaluator.evidence_hash = "evidence"
2045
- evaluator._effective_protocol = "gemini"
2046
- evaluator._effective_model = "gemini-3-flash"
2047
- evaluator._last_retry_telemetry = {}
2048
- evaluator._instruction_trace_metadata = {
2049
- "instruction_profile": "none|inline|vi|pydanticai",
2050
- "instruction_inputs": {},
2051
- "instruction_hash": "abc123",
2052
- }
2053
-
2054
- result = evaluator._create_error_result(
2055
- check=SimpleNamespace(id="CL-ERR"),
2056
- row_id="CL-ERR:row_1",
2057
- error_message="synthetic error",
2058
- evaluation_duration_ms=77,
2059
- )
2060
-
2061
- assert result.status == RowStatus.ERROR
2062
- assert result.provenance.evaluation_duration_ms == 77
2063
-
2064
-
2065
- def test_create_error_result_applies_failover_provenance_from_retry_telemetry():
2066
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2067
- evaluator.config = SimpleNamespace(mode=SimpleNamespace(value="selective"))
2068
- evaluator.template_hash = "tpl"
2069
- evaluator.evidence_hash = "evidence"
2070
- evaluator._effective_protocol = "openai"
2071
- evaluator._effective_model = "fallback-model"
2072
- evaluator._instruction_trace_metadata = {
2073
- "instruction_profile": "none|inline|vi|pydanticai",
2074
- "instruction_inputs": {},
2075
- "instruction_hash": "abc123",
2076
- }
2077
- evaluator._last_retry_telemetry = {
2078
- "provider_failover_attempted": True,
2079
- "provider_failover_reason": "quota_or_capacity_signal",
2080
- "provider_failover_final_provider": "fallback-openai",
2081
- "provider_failover_chain": ["primary-openai", "fallback-openai"],
2082
- "provider_failover_hops": 1,
2083
- "provider_failover_original_provider": "primary-openai",
2084
- }
2085
-
2086
- result = evaluator._create_error_result(
2087
- check=SimpleNamespace(id="CL-ERR"),
2088
- row_id="CL-ERR:row_1",
2089
- error_message="synthetic error",
2090
- evaluation_duration_ms=77,
2091
- )
2092
-
2093
- assert result.provenance.original_provider == "primary-openai"
2094
- assert result.provenance.final_provider == "fallback-openai"
2095
- assert result.provenance.failover_count == 1
2096
- assert result.provenance.failover_chain == ["primary-openai", "fallback-openai"]
2097
- assert result.provenance.failover_reason == "quota_or_capacity_signal"
2098
-
2099
-
2100
- def test_filter_prompt_toolsets_keeps_skill_tools_optional_when_skills_not_needed():
2101
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2102
- toolset = SimpleNamespace(
2103
- tools={
2104
- "list_skills": object(),
2105
- "load_skill": object(),
2106
- "read_skill_resource": object(),
2107
- "run_skill_script": object(),
2108
- "search_docs": object(),
2109
- }
2110
- )
2111
- request = RowEvaluationRequest(
2112
- row_id="CL-055:row_54",
2113
- requirement_text="MTTR policy",
2114
- requirement_category="SLA",
2115
- requirement_guidance="",
2116
- evidence_context="grounded",
2117
- evidence_refs=["docs/sla.md", "src/service.py"],
2118
- project_profile={},
2119
- requirement_interpretation={"skills_needed": False},
2120
- )
2121
-
2122
- filtered, policy = evaluator._filter_prompt_toolsets_for_request(toolsets=[toolset], request=request)
2123
-
2124
- assert policy["applied"] is True
2125
- assert policy["mode"] == "skills_unavailable_disable"
2126
- assert policy["removed_tool_bindings"] == 4
2127
- assert len(filtered) == 1
2128
- assert set(filtered[0].tools.keys()) == {"search_docs"}
2129
-
2130
-
2131
- def test_effective_user_prompt_places_excerpt_discipline_in_output_schema_section(monkeypatch):
2132
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2133
- evaluator.config = SimpleNamespace(
2134
- row_unified_mode="off",
2135
- instruction_mode="none",
2136
- evidence_strategy="inline",
2137
- instruction_language="vi",
2138
- agent_runtime_mode="pydanticai",
2139
- )
2140
- monkeypatch.setattr(evaluator, "_resolve_global_llm_config", lambda: None)
2141
-
2142
- request = RowEvaluationRequest(
2143
- row_id="CL-386:row_1",
2144
- requirement_text="Ground every cited anchor with excerpt discipline",
2145
- requirement_category="Security",
2146
- requirement_guidance="",
2147
- evidence_context="context",
2148
- evidence_refs=["docs/security.md", "src/service.py"],
2149
- project_profile={},
2150
- requirement_interpretation={},
2151
- )
2152
-
2153
- prompt = evaluator._effective_user_prompt(request)
2154
-
2155
- assert "[Anchor identity contract]" in prompt
2156
- assert "You MUST cite only from the allowed anchor ids below." in prompt
2157
- assert "Return cited_anchor_ids as a subset of allowed_anchor_ids." in prompt
2158
- assert "YÊU CẦU OUTPUT SCHEMA (ưu tiên cao, bắt buộc):" in prompt
2159
- assert "tool-read content" in prompt
2160
- assert 'Ví dụ hợp lệ: excerpt: "spring.datasource.url=jdbc:postgresql://..."' in prompt
2161
- assert 'Ví dụ không hợp lệ: excerpt: "" (thiếu excerpt_unavailable_reason).' in prompt
2162
- anchor_contract = prompt.split("[Anchor identity contract]", 1)[1]
2163
- assert "verbatim 1-2 line excerpt from retrieved content" not in anchor_contract
2164
- assert 'allowed_anchor_ids=["docs/security.md", "src/service.py"]' in prompt
2165
-
2166
-
2167
- def test_build_instruction_config_disables_skills_when_none_are_resolved(monkeypatch):
2168
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2169
- evaluator.config = SimpleNamespace(
2170
- row_unified_mode="off",
2171
- instruction_mode="minimal",
2172
- evidence_strategy="tool_first",
2173
- instruction_language="vi",
2174
- agent_runtime_mode="pydanticai",
2175
- )
2176
- monkeypatch.setattr(
2177
- evaluator,
2178
- "_resolve_global_llm_config",
2179
- lambda: SimpleNamespace(skills_toolset_enabled=True, mcp_toolsets_enabled=False),
2180
- )
2181
- monkeypatch.setattr(evaluator, "_resolve_available_skills", lambda _cfg: [])
2182
-
2183
- cfg = evaluator._build_instruction_config()
2184
-
2185
- assert cfg.skills_toolset_enabled is False
2186
- assert cfg.available_skills == []
2187
-
2188
-
2189
- def test_build_instruction_trace_metadata_can_focus_available_skills(monkeypatch):
2190
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2191
- evaluator.config = SimpleNamespace(
2192
- row_unified_mode="off",
2193
- instruction_mode="minimal",
2194
- evidence_strategy="tool_first",
2195
- instruction_language="vi",
2196
- agent_runtime_mode="pydanticai",
2197
- )
2198
- monkeypatch.setattr(
2199
- evaluator,
2200
- "_resolve_global_llm_config",
2201
- lambda: SimpleNamespace(skills_toolset_enabled=True, mcp_toolsets_enabled=True),
2202
- )
2203
- monkeypatch.setattr(
2204
- evaluator,
2205
- "_resolve_available_skills",
2206
- lambda _cfg: [
2207
- module.SkillDescriptor(name="audit-orchestrator-skill", description="audit"),
2208
- module.SkillDescriptor(name="hexagonal-compliance-skill", description="hex"),
2209
- module.SkillDescriptor(name="research-skill", description="research"),
2210
- ],
2211
- )
2212
-
2213
- trace = evaluator._build_instruction_trace_metadata(
2214
- available_skill_names_override=["hexagonal-compliance-skill", "research-skill"]
2215
- )
2216
-
2217
- assert trace["instruction_inputs"]["available_skills"] == [
2218
- "hexagonal-compliance-skill",
2219
- "research-skill",
2220
- ]
2221
- assert trace["instruction_inputs"]["available_skill_count"] == 2
2222
-
2223
-
2224
- def test_skill_operation_directives_forbid_skill_calls_when_available_skills_empty():
2225
- from vds_audit_orchestrator.llm.prompts.instruction_templates import AgentRuntimeMode, _runtime_directives
2226
-
2227
- directives = _runtime_directives(AgentRuntimeMode.PYDANTICAI, "vi", skills_toolset_enabled=True)
2228
-
2229
- assert "Nếu `Available Skills` đang rỗng" in directives
2230
- assert "không gọi `list_skills`, `load_skill`, `read_skill_resource`, hoặc `run_skill_script`" in directives
2231
-
2232
-
2233
- def test_resolve_skill_directories_falls_back_when_configured_directory_is_missing(monkeypatch, tmp_path: Path):
2234
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2235
- missing_dir = tmp_path / "missing-skills"
2236
- fallback_dir = tmp_path / "default-skills"
2237
- fallback_dir.mkdir()
2238
-
2239
- import sys
2240
-
2241
- fake_module = SimpleNamespace(DEFAULT_AUDIT_SKILLS=[str(fallback_dir)])
2242
- monkeypatch.setitem(sys.modules, "vds_audit_orchestrator.agents.toolsets.skills_toolset", fake_module)
2243
-
2244
- resolved = evaluator._resolve_skill_directories(SimpleNamespace(skills_directories=[str(missing_dir)]))
2245
-
2246
- assert resolved == [str(fallback_dir)]
2247
-
2248
-
2249
- def test_filter_prompt_toolsets_disables_skill_tools_when_tool_first_skill_already_effective():
2250
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2251
- evaluator._tool_first_skill_usage_hint = {
2252
- "skill_calls": 1,
2253
- "skill_execution_calls": 1,
2254
- "skill_effective_calls": 1,
2255
- }
2256
- toolset = SimpleNamespace(
2257
- tools={
2258
- "list_skills": object(),
2259
- "load_skill": object(),
2260
- "read_skill_resource": object(),
2261
- "run_skill_script": object(),
2262
- "search_docs": object(),
2263
- }
2264
- )
2265
- request = RowEvaluationRequest(
2266
- row_id="CL-050:row_49",
2267
- requirement_text="SAST/DAST policy",
2268
- requirement_category="Security",
2269
- requirement_guidance="",
2270
- evidence_context="grounded",
2271
- evidence_refs=["docs/security.md", "src/security.py"],
2272
- project_profile={},
2273
- requirement_interpretation={"skills_needed": True},
2274
- )
2275
-
2276
- filtered, policy = evaluator._filter_prompt_toolsets_for_request(toolsets=[toolset], request=request)
2277
-
2278
- assert policy["applied"] is True
2279
- assert policy["mode"] == "tool_first_skill_already_effective"
2280
- assert policy["removed_tool_bindings"] == 4
2281
- assert policy["tool_first_skill_effective_calls"] == 1
2282
- assert len(filtered) == 1
2283
- assert set(filtered[0].tools.keys()) == {"search_docs"}
2284
-
2285
-
2286
- def test_filter_prompt_toolsets_disables_skill_tools_when_no_skills_are_available():
2287
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2288
- toolset = SimpleNamespace(
2289
- tools={
2290
- "list_skills": object(),
2291
- "load_skill": object(),
2292
- "read_skill_resource": object(),
2293
- "run_skill_script": object(),
2294
- "search_docs": object(),
2295
- },
2296
- skills={},
2297
- _vds_skill_metadata=[],
2298
- )
2299
- request = RowEvaluationRequest(
2300
- row_id="CL-051:row_50",
2301
- requirement_text="Need grounded evidence without skill drift",
2302
- requirement_category="Delivery workflow",
2303
- requirement_guidance="",
2304
- evidence_context="thin context",
2305
- evidence_refs=["chunk:abc"],
2306
- project_profile={},
2307
- requirement_interpretation={"skills_needed": False},
2308
- )
2309
-
2310
- filtered, policy = evaluator._filter_prompt_toolsets_for_request(toolsets=[toolset], request=request)
2311
-
2312
- assert policy["applied"] is True
2313
- assert policy["mode"] == "skills_unavailable_disable"
2314
- assert policy["removed_tool_bindings"] == 4
2315
- assert len(filtered) == 1
2316
- assert set(filtered[0].tools.keys()) == {"search_docs"}
2317
-
2318
-
2319
- def test_call_llm_appends_override_prompt_when_skills_are_unavailable(monkeypatch):
2320
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2321
- evaluator.config = SimpleNamespace(tool_first_enabled=True, runtime_context=None)
2322
- captured: dict[str, object] = {}
2323
-
2324
- monkeypatch.setattr(evaluator, "_effective_system_prompt", lambda **_kwargs: "SYSTEM")
2325
- monkeypatch.setattr(evaluator, "_effective_user_prompt", lambda _request: "USER")
2326
- monkeypatch.setattr(evaluator, "_build_prompt_evaluator_toolsets", lambda: ["toolset"])
2327
- evaluator._effective_protocol = "openai"
2328
- evaluator._effective_model = "glm-5"
2329
- monkeypatch.setattr(
2330
- evaluator,
2331
- "_filter_prompt_toolsets_for_request",
2332
- lambda *, toolsets, request: (
2333
- ["toolset-no-skills"],
2334
- {"mode": "skills_unavailable_disable", "applied": True, "removed_tool_bindings": 4},
2335
- ),
2336
- )
2337
- monkeypatch.setattr(module, "_resolved_protocol_model", lambda *_args: ("openai", "glm-5"))
2338
- monkeypatch.setattr(module.LLMRowEvaluator, "_runtime_log_fields", staticmethod(lambda _ctx: {}))
2339
-
2340
- def _fake_call_prompt_backend(*, user_prompt, **kwargs):
2341
- captured["user_prompt"] = user_prompt
2342
- return module.RowEvaluationResponse(
2343
- row_id="CL-052:row_51",
2344
- status="PASS",
2345
- summary="ok",
2346
- findings=[],
2347
- evidence_refs=[],
2348
- ), {}
2349
-
2350
- monkeypatch.setattr(evaluator, "_build_agent_key", lambda **_kwargs: "agent-key")
2351
- monkeypatch.setattr(evaluator, "_invoke_sync_agent_with_provider_retry", _fake_call_prompt_backend)
2352
-
2353
- request = RowEvaluationRequest(
2354
- row_id="CL-052:row_51",
2355
- requirement_text="Need grounded output",
2356
- requirement_category="Security",
2357
- requirement_guidance="",
2358
- evidence_context="grounded",
2359
- evidence_refs=["docs/security.md"],
2360
- project_profile={},
2361
- requirement_interpretation={"skills_needed": False},
2362
- )
2363
-
2364
- evaluator._call_llm(request, row_id=request.row_id)
2365
-
2366
- user_prompt = str(captured["user_prompt"])
2367
- assert "runtime không resolve được skill khả dụng nào" in user_prompt
2368
- assert "Không gọi list_skills/load_skill/read_skill_resource/run_skill_script" in user_prompt
2369
-
2370
-
2371
- def test_call_llm_retries_with_reinforced_prompt_for_unavailable_focused_skill(monkeypatch):
2372
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2373
- evaluator.config = SimpleNamespace(tool_first_enabled=True, runtime_context=None)
2374
- evaluator._prompt_telemetry_merged_exception_ids = set()
2375
- evaluator._pending_prompt_telemetry = {}
2376
- evaluator._last_prompt_tool_telemetry = {}
2377
- monkeypatch.setattr(evaluator, "_merge_prompt_telemetry_from_exception", lambda _exc: None)
2378
- captured_prompts: list[str] = []
2379
-
2380
- monkeypatch.setattr(evaluator, "_effective_system_prompt", lambda **_kwargs: "SYSTEM")
2381
- monkeypatch.setattr(evaluator, "_effective_user_prompt", lambda _request: "USER")
2382
- monkeypatch.setattr(
2383
- evaluator,
2384
- "_build_prompt_evaluator_toolsets",
2385
- lambda: [SimpleNamespace(tools={"load_skill": object(), "read_skill_resource": object()}, skills={})],
2386
- )
2387
- monkeypatch.setattr(
2388
- evaluator,
2389
- "_filter_prompt_toolsets_for_request",
2390
- lambda *, toolsets, request: (
2391
- [SimpleNamespace(tools={"load_skill": object(), "read_skill_resource": object()}, skills={})],
2392
- {
2393
- "mode": "skills_needed_focus",
2394
- "applied": True,
2395
- "focused_skills": ["hexagonal-compliance-skill"],
2396
- "removed_tool_bindings": 0,
2397
- "removed_skill_entries": 24,
2398
- },
2399
- ),
2400
- )
2401
- evaluator._effective_protocol = "openai"
2402
- evaluator._effective_model = "qwen3.5-plus"
2403
- monkeypatch.setattr(module, "_resolved_protocol_model", lambda *_args: ("openai", "qwen3.5-plus"))
2404
- monkeypatch.setattr(module.LLMRowEvaluator, "_runtime_log_fields", staticmethod(lambda _ctx: {}))
2405
- monkeypatch.setattr(evaluator, "_build_agent_key", lambda **_kwargs: "agent-key")
2406
-
2407
- call_counter = {"count": 0}
2408
-
2409
- def _fake_call_prompt_backend(*, user_prompt, **kwargs):
2410
- captured_prompts.append(str(user_prompt))
2411
- call_counter["count"] += 1
2412
- if call_counter["count"] == 1:
2413
- raise RuntimeError("Skill 'audit-orchestrator-skill' not found. Available: hexagonal-compliance-skill")
2414
- return module.RowEvaluationResponse(summary="ok", findings=[], evidence_refs=[])
2415
-
2416
- monkeypatch.setattr(evaluator, "_invoke_sync_agent_with_provider_retry", _fake_call_prompt_backend)
2417
-
2418
- request = RowEvaluationRequest(
2419
- row_id="CL-001:row_0",
2420
- requirement_text="Hexagonal / Clean Architecture",
2421
- requirement_category="1. Decoupling",
2422
- requirement_guidance="",
2423
- evidence_context="grounded",
2424
- evidence_refs=["src/main/java/com/example/domain/OrderAggregate.java"],
2425
- project_profile={},
2426
- requirement_interpretation={"skills_needed": True, "skill_objectives": ["analyze_architecture_compliance"]},
2427
- )
2428
-
2429
- response = evaluator._call_llm(request, row_id=request.row_id)
2430
-
2431
- assert isinstance(response, module.RowEvaluationResponse)
2432
- assert call_counter["count"] == 2
2433
- assert len(captured_prompts) == 2
2434
- assert "OVERRIDE SKILL DISCIPLINE CHO ROW NÀY" in captured_prompts[1]
2435
- assert "allowlist" in captured_prompts[1]
2436
- assert "audit-orchestrator-skill" not in captured_prompts[1]
2437
- assert "hexagonal-compliance-skill" in captured_prompts[1]
2438
- assert "research-skill" not in captured_prompts[1]
2439
- assert "code-review-graph-skill" not in captured_prompts[1]
2440
-
2441
-
2442
- def test_prompt_tool_telemetry_marks_missing_skill_resource_as_unsuccessful():
2443
- result = SimpleNamespace(
2444
- all_messages=[
2445
- {
2446
- "parts": [
2447
- {
2448
- "part_kind": "tool-call",
2449
- "tool_name": "read_skill_resource",
2450
- "tool_call_id": "call-1",
2451
- "args": {
2452
- "skill_name": "audit-orchestrator-skill",
2453
- "resource_path": "sonarqube_orchestrator/src/vds_sonarqube_orchestrator/external_sca.py",
2454
- },
2455
- },
2456
- {
2457
- "part_kind": "tool-return",
2458
- "tool_name": "read_skill_resource",
2459
- "tool_call_id": "call-1",
2460
- "content": "[skill-resource-missing] Requested resource is unavailable for the selected skill.",
2461
- },
2462
- ]
2463
- }
2464
- ]
2465
- )
2466
-
2467
- telemetry = module.LLMRowEvaluator._extract_prompt_tool_telemetry(result)["prompt_tool_telemetry"]
2468
- usage = telemetry["event_skill_tool_usage"]
2469
- assert len(usage) == 1
2470
- assert usage[0]["tool"] == "read_skill_resource"
2471
- assert usage[0]["success"] is False
2472
- assert usage[0]["effective"] is False
2473
- assert usage[0]["error"] == "resource_not_found"
2474
-
2475
-
2476
- def test_filter_prompt_toolsets_disables_skill_tools_for_advisory_skip(monkeypatch):
2477
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2478
- monkeypatch.setenv("VDS_AUDIT_AGENTIC_STRICT_REQUIRE_EFFECTIVE_SKILL", "false")
2479
- toolset = SimpleNamespace(
2480
- tools={
2481
- "list_skills": object(),
2482
- "load_skill": object(),
2483
- "read_skill_resource": object(),
2484
- "run_skill_script": object(),
2485
- "search_docs": object(),
2486
- }
2487
- )
2488
- request = RowEvaluationRequest(
2489
- row_id="CL-055:row_54",
2490
- requirement_text="MTTR policy",
2491
- requirement_category="SLA",
2492
- requirement_guidance="",
2493
- evidence_context="A" * 900,
2494
- evidence_refs=[
2495
- "docs/sla.md",
2496
- "chunk:abc",
2497
- "src/service.py",
2498
- "src/controller.ts",
2499
- "src/config.yaml",
2500
- ],
2501
- project_profile={},
2502
- requirement_interpretation={
2503
- "skills_needed": True,
2504
- "evidence_targets": ["docs", "code"],
2505
- "skill_objectives": ["analyze_documentation_artifacts"],
2506
- },
2507
- )
2508
-
2509
- filtered, policy = evaluator._filter_prompt_toolsets_for_request(toolsets=[toolset], request=request)
2510
-
2511
- assert policy["applied"] is True
2512
- assert policy["mode"] == "advisory_skip_grounded"
2513
- assert policy["removed_tool_bindings"] == 4
2514
- assert len(filtered) == 1
2515
- assert set(filtered[0].tools.keys()) == {"search_docs"}
2516
-
2517
-
2518
- def test_toolset_cache_signature_changes_when_tool_names_change():
2519
- toolset_with_skills = SimpleNamespace(
2520
- tools={
2521
- "list_skills": object(),
2522
- "search_docs": object(),
2523
- }
2524
- )
2525
- toolset_without_skills = SimpleNamespace(
2526
- tools={
2527
- "search_docs": object(),
2528
- }
2529
- )
2530
-
2531
- sig_with_skills = module.LLMRowEvaluator._toolset_cache_signature([toolset_with_skills])
2532
- sig_without_skills = module.LLMRowEvaluator._toolset_cache_signature([toolset_without_skills])
2533
-
2534
- assert sig_with_skills != sig_without_skills
2535
-
2536
-
2537
- def test_filter_prompt_toolsets_focuses_skill_allowlist_for_skills_needed_rows():
2538
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2539
- toolset = SimpleNamespace(
2540
- tools={
2541
- "list_skills": object(),
2542
- "load_skill": object(),
2543
- "read_skill_resource": object(),
2544
- "run_skill_script": object(),
2545
- "search_docs": object(),
2546
- },
2547
- skills={
2548
- "audit-orchestrator-skill": object(),
2549
- "research-skill": object(),
2550
- "vds-scripts-skill": object(),
2551
- "grepai-skill": object(),
2552
- },
2553
- _vds_skill_metadata=[
2554
- SimpleNamespace(name="audit-orchestrator-skill"),
2555
- SimpleNamespace(name="research-skill"),
2556
- SimpleNamespace(name="vds-scripts-skill"),
2557
- SimpleNamespace(name="grepai-skill"),
2558
- ],
2559
- )
2560
- request = RowEvaluationRequest(
2561
- row_id="CL-037:row_36",
2562
- requirement_text="Need workflow automation commands and runbook validation",
2563
- requirement_category="Delivery workflow",
2564
- requirement_guidance="",
2565
- evidence_context="limited",
2566
- evidence_refs=["chunk:abc"],
2567
- project_profile={},
2568
- requirement_interpretation={
2569
- "skills_needed": True,
2570
- "skill_objectives": ["analyze_tooling_automation_guidance"],
2571
- "evidence_targets": ["docs"],
2572
- },
2573
- )
2574
-
2575
- filtered, policy = evaluator._filter_prompt_toolsets_for_request(toolsets=[toolset], request=request)
2576
-
2577
- assert policy["applied"] is True
2578
- assert policy["mode"] == "skills_needed_focus"
2579
- assert "vds-scripts-skill" in policy["focused_skills"]
2580
- assert len(filtered) == 1
2581
- assert set(filtered[0].skills.keys()) == {
2582
- "vds-scripts-skill",
2583
- "audit-orchestrator-skill",
2584
- "research-skill",
2585
- }
2586
-
2587
-
2588
- def test_filter_prompt_toolsets_removes_doc_tools_for_code_only_decoupling_rows():
2589
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2590
- toolset = SimpleNamespace(
2591
- tools={
2592
- "search_docs": object(),
2593
- "read_doc_chunk": object(),
2594
- "search_code": object(),
2595
- "read_code_file": object(),
2596
- "load_skill": object(),
2597
- "read_skill_resource": object(),
2598
- },
2599
- skills={
2600
- "hexagonal-compliance-skill": object(),
2601
- "research-skill": object(),
2602
- },
2603
- _vds_skill_metadata=[
2604
- SimpleNamespace(name="hexagonal-compliance-skill"),
2605
- SimpleNamespace(name="research-skill"),
2606
- ],
2607
- )
2608
- request = RowEvaluationRequest(
2609
- row_id="CL-001:row_0",
2610
- requirement_text=(
2611
- "1. Hexagonal / Clean Architecture: Domain Logic không phụ thuộc vào Framework, UI, hay Database."
2612
- ),
2613
- requirement_category="1. Decoupling||SourceCode Organization",
2614
- requirement_guidance="",
2615
- evidence_context="limited",
2616
- evidence_refs=[
2617
- "src/main/java/com/example/config/AppConfig.java",
2618
- "src/main/java/com/example/domain/OrderAggregate.java",
2619
- ],
2620
- project_profile={},
2621
- requirement_interpretation={
2622
- "skills_needed": True,
2623
- "skill_objectives": ["analyze_architecture_compliance"],
2624
- "evidence_targets": ["docs", "code"],
2625
- "docs_markers": ["architecture"],
2626
- "code_markers": ["decoupling"],
2627
- },
2628
- )
2629
-
2630
- filtered, policy = evaluator._filter_prompt_toolsets_for_request(toolsets=[toolset], request=request)
2631
-
2632
- assert len(filtered) == 1
2633
- assert "search_docs" not in filtered[0].tools
2634
- assert "read_doc_chunk" not in filtered[0].tools
2635
- assert "search_code" in filtered[0].tools
2636
- assert "read_code_file" in filtered[0].tools
2637
- assert policy["removed_tool_bindings"] >= 2
2638
-
2639
-
2640
- def test_filter_prompt_toolsets_disables_skill_tools_for_explicit_interface_rows() -> None:
2641
- evaluator = module.LLMRowEvaluator.__new__(module.LLMRowEvaluator)
2642
- toolset = SimpleNamespace(
2643
- tools={
2644
- "search_docs": object(),
2645
- "read_doc_chunk": object(),
2646
- "search_code": object(),
2647
- "read_code_file": object(),
2648
- "load_skill": object(),
2649
- "read_skill_resource": object(),
2650
- "run_skill_script": object(),
2651
- },
2652
- skills={
2653
- "audit-orchestrator-skill": object(),
2654
- "research-skill": object(),
2655
- },
2656
- _vds_skill_metadata=[
2657
- SimpleNamespace(name="audit-orchestrator-skill"),
2658
- SimpleNamespace(name="research-skill"),
2659
- ],
2660
- )
2661
- request = RowEvaluationRequest(
2662
- row_id="CL-002:row_1",
2663
- requirement_text=(
2664
- "2. Explicit Public Interface: Cross-module call phải thông qua interface, API client, "
2665
- "message contract. Không import concrete implementation từ module khác."
2666
- ),
2667
- requirement_category="1. Decoupling||SourceCode Organization",
2668
- requirement_guidance="",
2669
- evidence_context="limited",
2670
- evidence_refs=["src/main/java/com/example/client/PaymentApiClient.java"],
2671
- project_profile={},
2672
- requirement_interpretation={
2673
- "skills_needed": False,
2674
- "skill_objectives": [],
2675
- "evidence_targets": ["code"],
2676
- },
2677
- )
2678
-
2679
- filtered, policy = evaluator._filter_prompt_toolsets_for_request(toolsets=[toolset], request=request)
2680
-
2681
- assert len(filtered) == 1
2682
- assert "search_docs" not in filtered[0].tools
2683
- assert "read_doc_chunk" not in filtered[0].tools
2684
- assert "load_skill" not in filtered[0].tools
2685
- assert "read_skill_resource" not in filtered[0].tools
2686
- assert "run_skill_script" not in filtered[0].tools
2687
- assert "search_code" in filtered[0].tools
2688
- assert "read_code_file" in filtered[0].tools
2689
- assert policy["mode"] == "explicit_interface_disable_optional_skills"
2690
-
2691
-
2692
- def test_apply_skill_guided_code_focus_replaces_generic_refs_with_substantive_code_targets():
2693
- request = RowEvaluationRequest(
2694
- row_id="CL-001:row_0",
2695
- requirement_text=(
2696
- "1. Hexagonal / Clean Architecture: Domain Logic không phụ thuộc vào Framework, UI, hay Database."
2697
- ),
2698
- requirement_category="1. Decoupling||SourceCode Organization",
2699
- requirement_guidance="",
2700
- evidence_context="limited",
2701
- evidence_refs=[
2702
- "Dockerfile",
2703
- "pom.xml",
2704
- "src/main/java/com/example/domain/OrderAggregate.java",
2705
- ],
2706
- project_profile={},
2707
- requirement_interpretation={
2708
- "skills_needed": True,
2709
- "skill_objectives": ["analyze_architecture_compliance"],
2710
- "code_targets": [
2711
- "pom.xml",
2712
- "src/main/java/com/example/domain/OrderAggregate.java",
2713
- "src/main/java/com/example/repository/OrderRepositoryImpl.java",
2714
- ],
2715
- },
2716
- )
2717
-
2718
- focused = module.LLMRowEvaluator._apply_skill_guided_code_focus(request)
2719
-
2720
- assert focused is not request
2721
- assert focused.evidence_refs == [
2722
- "src/main/java/com/example/domain/OrderAggregate.java",
2723
- "src/main/java/com/example/repository/OrderRepositoryImpl.java",
2724
- ]
2725
- assert "SKILL-GUIDED CODE FOCUS" in focused.evidence_context
2726
-
2727
-
2728
- def test_apply_skill_guided_code_focus_keeps_original_refs_when_substantive_targets_missing():
2729
- request = RowEvaluationRequest(
2730
- row_id="CL-001:row_0",
2731
- requirement_text=(
2732
- "1. Hexagonal / Clean Architecture: Domain Logic không phụ thuộc vào Framework, UI, hay Database."
2733
- ),
2734
- requirement_category="1. Decoupling||SourceCode Organization",
2735
- requirement_guidance="",
2736
- evidence_context="limited",
2737
- evidence_refs=["Dockerfile", "pom.xml"],
2738
- project_profile={},
2739
- requirement_interpretation={
2740
- "skills_needed": True,
2741
- "skill_objectives": ["analyze_architecture_compliance"],
2742
- "code_targets": ["pom.xml"],
2743
- },
2744
- )
2745
-
2746
- focused = module.LLMRowEvaluator._apply_skill_guided_code_focus(request)
2747
-
2748
- assert focused is request
2749
-
2750
-
2751
- def test_apply_skill_guided_code_focus_prefers_domain_repository_over_config_aop():
2752
- request = RowEvaluationRequest(
2753
- row_id="CL-001:row_0",
2754
- requirement_text=(
2755
- "1. Hexagonal / Clean Architecture: Domain Logic không phụ thuộc vào Framework, UI, hay Database."
2756
- ),
2757
- requirement_category="1. Decoupling||SourceCode Organization",
2758
- requirement_guidance="",
2759
- evidence_context="limited",
2760
- evidence_refs=[
2761
- "src/main/java/com/example/config/LogBookConfig.java",
2762
- "src/main/java/com/example/aop/RepositoryAspect.java",
2763
- ],
2764
- project_profile={},
2765
- requirement_interpretation={
2766
- "skills_needed": True,
2767
- "skill_objectives": ["analyze_architecture_compliance"],
2768
- "code_targets": [
2769
- "src/main/java/com/example/config/LogBookConfig.java",
2770
- "src/main/java/com/example/aop/RepositoryAspect.java",
2771
- "src/main/java/com/example/domain/OrderAggregate.java",
2772
- "src/main/java/com/example/repository/OrderRepositoryImpl.java",
2773
- ],
2774
- },
2775
- )
2776
-
2777
- focused = module.LLMRowEvaluator._apply_skill_guided_code_focus(request)
2778
-
2779
- assert focused is not request
2780
- assert focused.evidence_refs == [
2781
- "src/main/java/com/example/domain/OrderAggregate.java",
2782
- "src/main/java/com/example/repository/OrderRepositoryImpl.java",
2783
- ]
2784
-
2785
-
2786
- def test_preload_prompt_skill_context_strips_live_skill_tools_for_exact_match():
2787
- evaluator = object.__new__(module.LLMRowEvaluator)
2788
- request = RowEvaluationRequest(
2789
- row_id="CL-001:row_0",
2790
- requirement_text=(
2791
- "1. Hexagonal / Clean Architecture: Domain Logic không phụ thuộc vào Framework, UI, hay Database."
2792
- ),
2793
- requirement_category="1. Decoupling||SourceCode Organization",
2794
- requirement_guidance="",
2795
- evidence_context="limited",
2796
- evidence_refs=["src/main/java/com/example/domain/OrderAggregate.java"],
2797
- project_profile={},
2798
- requirement_interpretation={
2799
- "skills_needed": True,
2800
- "skill_objectives": ["analyze_architecture_compliance"],
2801
- "code_targets": [
2802
- "src/main/java/com/example/domain/OrderAggregate.java",
2803
- "src/main/java/com/example/repository/OrderRepositoryImpl.java",
2804
- ],
2805
- },
2806
- )
2807
- fake_skill = SimpleNamespace(
2808
- description="Hexagonal architecture guidance",
2809
- content="Prefer domain/model/entity and repository adapter evidence before config classes.",
2810
- resources=[SimpleNamespace(name="references/row-analysis.md")],
2811
- scripts=[],
2812
- )
2813
- toolset = SimpleNamespace(
2814
- tools={
2815
- "list_skills": object(),
2816
- "load_skill": object(),
2817
- "read_skill_resource": object(),
2818
- "run_skill_script": object(),
2819
- "search_code": object(),
2820
- },
2821
- skills={"hexagonal-compliance-skill": object()},
2822
- get_skill=lambda name: fake_skill if name == "hexagonal-compliance-skill" else None,
2823
- _vds_skill_metadata=[SimpleNamespace(name="hexagonal-compliance-skill")],
2824
- )
2825
- filtered_toolsets, policy, preloaded = evaluator._preload_prompt_skill_context_if_exact_match(
2826
- toolsets=[toolset],
2827
- request=request,
2828
- toolset_policy={
2829
- "mode": "skills_needed_focus",
2830
- "focused_skills": ["hexagonal-compliance-skill"],
2831
- "removed_tool_bindings": 0,
2832
- },
2833
- )
2834
-
2835
- assert policy["mode"] == "skills_needed_preloaded_exact_match"
2836
- assert policy["preloaded_skills"] == ["hexagonal-compliance-skill"]
2837
- assert "Hexagonal architecture guidance" in preloaded
2838
- assert "hexagonal-compliance-skill" in preloaded
2839
- assert "list_skills" not in filtered_toolsets[0].tools
2840
- assert "load_skill" not in filtered_toolsets[0].tools
2841
- assert "read_skill_resource" not in filtered_toolsets[0].tools
2842
- assert "run_skill_script" not in filtered_toolsets[0].tools
2843
- assert "search_code" in filtered_toolsets[0].tools
2844
-
2845
-
2846
- def test_instruction_skill_override_for_policy_prefers_preloaded_then_focused():
2847
- assert module.LLMRowEvaluator._instruction_skill_override_for_policy(
2848
- {
2849
- "mode": "skills_needed_preloaded_exact_match",
2850
- "preloaded_skills": ["hexagonal-compliance-skill"],
2851
- "focused_skills": ["research-skill"],
2852
- }
2853
- ) == ["hexagonal-compliance-skill"]
2854
- assert module.LLMRowEvaluator._instruction_skill_override_for_policy(
2855
- {
2856
- "mode": "skills_needed_focus",
2857
- "focused_skills": ["hexagonal-compliance-skill"],
2858
- }
2859
- ) == ["hexagonal-compliance-skill"]
2860
- assert module.LLMRowEvaluator._instruction_skill_override_for_policy({"mode": "none"}) is None
2861
-
2862
-
2863
- def test_preloaded_exact_match_counts_as_effective_for_single_required_skill():
2864
- evaluator = object.__new__(module.LLMRowEvaluator)
2865
- request = RowEvaluationRequest(
2866
- row_id="CL-001:row_0",
2867
- requirement_text="Hexagonal architecture",
2868
- requirement_category="1. Decoupling||SourceCode Organization",
2869
- requirement_guidance="",
2870
- evidence_context="grounded",
2871
- evidence_refs=["src/main/java/com/example/domain/OrderAggregate.java"],
2872
- project_profile={},
2873
- requirement_interpretation={
2874
- "skills_needed": True,
2875
- "skill_objectives": ["analyze_architecture_compliance"],
2876
- },
2877
- )
2878
- evaluator._instruction_skills_enabled = lambda: True
2879
- evaluator._instruction_available_skills = lambda: ["hexagonal-compliance-skill"]
2880
- evaluator._recommend_skills_for_request = lambda _request, limit=3: ["hexagonal-compliance-skill"]
2881
-
2882
- assert evaluator._preloaded_exact_match_counts_as_effective(request=request, execution_calls=1) is True
2883
-
2884
-
2885
- def test_needs_skill_policy_retry_skips_false_retry_for_preloaded_exact_match():
2886
- evaluator = object.__new__(module.LLMRowEvaluator)
2887
- request = RowEvaluationRequest(
2888
- row_id="CL-001:row_0",
2889
- requirement_text="Hexagonal architecture",
2890
- requirement_category="1. Decoupling||SourceCode Organization",
2891
- requirement_guidance="",
2892
- evidence_context="grounded",
2893
- evidence_refs=["src/main/java/com/example/domain/OrderAggregate.java"],
2894
- project_profile={},
2895
- requirement_interpretation={
2896
- "skills_needed": True,
2897
- "skill_objectives": ["analyze_architecture_compliance"],
2898
- },
2899
- )
2900
- evaluator._request_skills_needed = lambda _request: True
2901
- evaluator._strict_require_effective_skill = lambda: True
2902
- evaluator._instruction_skills_enabled = lambda: True
2903
- evaluator._instruction_available_skills = lambda: ["hexagonal-compliance-skill"]
2904
- evaluator._recommend_skills_for_request = lambda _request, limit=3: ["hexagonal-compliance-skill"]
2905
- evaluator._extract_skill_usage_counts = lambda _trace: (1, 1, 0)
2906
-
2907
- assert evaluator._needs_skill_policy_retry(request=request, backend_trace={}) is False
2908
-
2909
-
2910
- def test_maybe_unverified_ref_retry_skips_for_authoritative_single_skill_result():
2911
- evaluator = object.__new__(module.LLMRowEvaluator)
2912
- evaluator._last_retry_telemetry = {}
2913
- request = RowEvaluationRequest(
2914
- row_id="CL-007:row_6",
2915
- requirement_text="Migration script detection",
2916
- requirement_category="1. Decoupling||Database migration",
2917
- requirement_guidance="",
2918
- evidence_context="grounded",
2919
- evidence_refs=["src/main/resources/application.properties"],
2920
- project_profile={},
2921
- requirement_interpretation={
2922
- "skills_needed": True,
2923
- "skill_objectives": ["detect_migration_scripts"],
2924
- },
2925
- )
2926
- response = RowEvaluationResponse(
2927
- reasoning="Skill result is already authoritative for this row.",
2928
- reason="Không tìm thấy migration script độc lập.",
2929
- score=35.0,
2930
- confidence=0.9,
2931
- finding="Repo thiếu migration asset chuẩn.",
2932
- evidence_anchors=[
2933
- {
2934
- "ref_type": "config",
2935
- "ref_value": "src/main/resources/application.properties",
2936
- "excerpt": "",
2937
- }
2938
- ],
2939
- allowed_anchor_ids=[],
2940
- cited_anchor_ids=[],
2941
- fix_suggestions=[],
2942
- )
2943
- evaluator._request_skills_needed = lambda _request: True
2944
- evaluator._strict_require_effective_skill = lambda: True
2945
- evaluator._instruction_skills_enabled = lambda: True
2946
- evaluator._instruction_available_skills = lambda: ["migration-script-detection-skill"]
2947
- evaluator._recommend_skills_for_request = lambda _request, limit=3: ["migration-script-detection-skill"]
2948
- evaluator._extract_skill_usage_counts = lambda _trace: (1, 1, 1)
2949
-
2950
- call_count = {"n": 0}
2951
-
2952
- def _unexpected_call_llm(*_args, **_kwargs):
2953
- call_count["n"] += 1
2954
- return response
2955
-
2956
- evaluator._call_llm = _unexpected_call_llm
2957
-
2958
- updated, trace = evaluator._maybe_unverified_ref_retry(
2959
- response=response,
2960
- request=request,
2961
- row_id="CL-007:row_6",
2962
- arbitration_metadata={
2963
- "tool_first_loop": {
2964
- "trace_steps": [
2965
- {"tool": "read_skill_resource", "output": {"success": True}},
2966
- {
2967
- "tool": "record_evidence_refs",
2968
- "output": {"refs": [{"ref_value": "src/main/resources/application.properties"}]},
2969
- },
2970
- ]
2971
- }
2972
- },
2973
- )
2974
-
2975
- assert updated is response
2976
- assert call_count["n"] == 0
2977
- assert (trace.get("retry_outcome") or "") == "retry_skipped_authoritative_skill_result"
2978
- assert trace.get("retry_attempted") is False
2979
- assert trace.get("strict_skill_short_circuit_reason") == "authoritative_skill_result"
2980
- assert trace.get("authoritative_skill_result") == {
2981
- "recommended_skills": ["migration-script-detection-skill"],
2982
- "observed_skill_calls": 1,
2983
- "observed_skill_execution_calls": 1,
2984
- "observed_skill_effective_calls": 1,
2985
- }
2986
-
2987
-
2988
- def test_authoritative_skill_trace_payload_includes_recommended_skills_and_usage_counts() -> None:
2989
- evaluator = object.__new__(module.LLMRowEvaluator)
2990
- request = RowEvaluationRequest(
2991
- row_id="CL-004:row_trace",
2992
- requirement_text="No shared datasource across service boundaries",
2993
- requirement_category="1. Decoupling||Database",
2994
- requirement_guidance="",
2995
- evidence_context="grounded",
2996
- evidence_refs=["alpha/application.properties"],
2997
- project_profile={},
2998
- requirement_interpretation={
2999
- "skills_needed": True,
3000
- "skill_objectives": ["analyze_datasource_isolation"],
3001
- },
3002
- )
3003
- evaluator._recommend_skills_for_request = lambda _request, limit=3: ["app-config-discovery-skill"]
3004
- evaluator._resolve_skill_usage_counts_for_policy = lambda request, backend_trace: (1, 1, 1)
3005
-
3006
- payload = evaluator._build_authoritative_skill_result_trace_payload(
3007
- request=request,
3008
- retrieval_trace={"skill_policy_retry": {"observed_skill_effective_calls": 1}},
3009
- )
3010
-
3011
- assert payload == {
3012
- "strict_skill_short_circuit_reason": "authoritative_skill_result",
3013
- "authoritative_skill_result": {
3014
- "recommended_skills": ["app-config-discovery-skill"],
3015
- "observed_skill_calls": 1,
3016
- "observed_skill_execution_calls": 1,
3017
- "observed_skill_effective_calls": 1,
3018
- },
3019
- }
3020
-
3021
-
3022
- def test_authoritative_skill_result_still_short_circuits_retry_for_decisive_low_confidence_fail() -> None:
3023
- evaluator = object.__new__(module.LLMRowEvaluator)
3024
- request = RowEvaluationRequest(
3025
- row_id="CL-004:row_3",
3026
- requirement_text="No shared datasource across service boundaries",
3027
- requirement_category="1. Decoupling||Database",
3028
- requirement_guidance="",
3029
- evidence_context="grounded",
3030
- evidence_refs=["alpha/application.properties"],
3031
- project_profile={},
3032
- requirement_interpretation={
3033
- "skills_needed": True,
3034
- "skill_objectives": ["analyze_datasource_isolation"],
3035
- },
3036
- )
3037
- response = RowEvaluationResponse(
3038
- reasoning="Strict app-config skill found a shared datasource violation.",
3039
- reason="Service đang dùng chung datasource nghiệp vụ với boundary participant_management.",
3040
- score=13.8,
3041
- confidence=0.2,
3042
- finding="Datasource isolation violated.",
3043
- evidence_anchors=[
3044
- {
3045
- "ref_type": "config",
3046
- "ref_value": "alpha/application.properties",
3047
- "excerpt": "",
3048
- }
3049
- ],
3050
- allowed_anchor_ids=[],
3051
- cited_anchor_ids=[],
3052
- fix_suggestions=[],
3053
- )
3054
- evaluator._request_skills_needed = lambda _request: True
3055
- evaluator._strict_require_effective_skill = lambda: True
3056
- evaluator._instruction_skills_enabled = lambda: True
3057
- evaluator._instruction_available_skills = lambda: ["app-config-discovery-skill"]
3058
- evaluator._recommend_skills_for_request = lambda _request, limit=3: ["app-config-discovery-skill"]
3059
- evaluator._extract_skill_usage_counts = lambda _trace: (1, 1, 1)
3060
-
3061
- assert (
3062
- evaluator._should_short_circuit_unverified_ref_retry_for_authoritative_skill_result(
3063
- request=request,
3064
- retrieval_trace={"tool_first_loop": {"skill_effective_call_count": 1}},
3065
- response=response,
3066
- )
3067
- is True
3068
- )
3069
-
3070
-
3071
- def test_authoritative_skill_result_short_circuits_retry_even_with_grounding_language() -> None:
3072
- evaluator = object.__new__(module.LLMRowEvaluator)
3073
- request = RowEvaluationRequest(
3074
- row_id="CL-004:row_grounding",
3075
- requirement_text="No shared datasource across service boundaries",
3076
- requirement_category="1. Decoupling||Database",
3077
- requirement_guidance="",
3078
- evidence_context="grounded",
3079
- evidence_refs=["alpha/application.properties"],
3080
- project_profile={},
3081
- requirement_interpretation={
3082
- "skills_needed": True,
3083
- "skill_objectives": ["analyze_datasource_isolation"],
3084
- },
3085
- )
3086
- response = RowEvaluationResponse(
3087
- reasoning="Strict app-config skill found the decisive datasource reference.",
3088
- reason="Chưa đủ grounding tổng quát, nhưng app-config đã xác nhận shared datasource.",
3089
- score=20.0,
3090
- confidence=0.3,
3091
- finding="Datasource isolation violated.",
3092
- evidence_anchors=[
3093
- {
3094
- "ref_type": "config",
3095
- "ref_value": "alpha/application.properties",
3096
- "excerpt": "",
3097
- }
3098
- ],
3099
- allowed_anchor_ids=[],
3100
- cited_anchor_ids=[],
3101
- fix_suggestions=[],
3102
- )
3103
- evaluator._request_skills_needed = lambda _request: True
3104
- evaluator._strict_require_effective_skill = lambda: True
3105
- evaluator._instruction_skills_enabled = lambda: True
3106
- evaluator._instruction_available_skills = lambda: ["app-config-discovery-skill"]
3107
- evaluator._recommend_skills_for_request = lambda _request, limit=3: ["app-config-discovery-skill"]
3108
- evaluator._extract_skill_usage_counts = lambda _trace: (1, 1, 1)
3109
-
3110
- assert (
3111
- evaluator._should_short_circuit_unverified_ref_retry_for_authoritative_skill_result(
3112
- request=request,
3113
- retrieval_trace={"tool_first_loop": {"skill_effective_call_count": 1}},
3114
- response=response,
3115
- )
3116
- is True
3117
- )
3118
-
3119
-
3120
- def test_authoritative_skill_lane_short_circuits_retry_before_usage_counts_are_recorded() -> None:
3121
- evaluator = object.__new__(module.LLMRowEvaluator)
3122
- request = RowEvaluationRequest(
3123
- row_id="CL-004:row_pre_policy",
3124
- requirement_text="No shared datasource across service boundaries",
3125
- requirement_category="1. Decoupling||Database",
3126
- requirement_guidance="",
3127
- evidence_context="grounded",
3128
- evidence_refs=["alpha/application.properties"],
3129
- project_profile={},
3130
- requirement_interpretation={
3131
- "skills_needed": True,
3132
- "skill_objectives": ["analyze_datasource_isolation"],
3133
- },
3134
- )
3135
- evaluator._request_skills_needed = lambda _request: True
3136
- evaluator._strict_require_effective_skill = lambda: True
3137
- evaluator._instruction_skills_enabled = lambda: True
3138
- evaluator._instruction_available_skills = lambda: ["app-config-discovery-skill"]
3139
- evaluator._recommend_skills_for_request = lambda _request, limit=3: ["app-config-discovery-skill"]
3140
- evaluator._extract_skill_usage_counts = lambda _trace: (0, 0, 0)
3141
-
3142
- assert (
3143
- evaluator._should_short_circuit_unverified_ref_retry_for_authoritative_skill_result(
3144
- request=request,
3145
- retrieval_trace={"prompt_tool_telemetry": {"event_tool_calls_completed": 0}},
3146
- )
3147
- is True
3148
- )
3149
-
3150
-
3151
- def test_toolset_cache_signature_changes_when_skill_names_change_even_with_same_tool_names():
3152
- toolset_skills_a = SimpleNamespace(
3153
- tools={"search_docs": object(), "load_skill": object()},
3154
- skills={"research-skill": object()},
3155
- )
3156
- toolset_skills_b = SimpleNamespace(
3157
- tools={"search_docs": object(), "load_skill": object()},
3158
- skills={"audit-orchestrator-skill": object()},
3159
- )
3160
-
3161
- sig_a = module.LLMRowEvaluator._toolset_cache_signature([toolset_skills_a])
3162
- sig_b = module.LLMRowEvaluator._toolset_cache_signature([toolset_skills_b])
3163
-
3164
- assert sig_a != sig_b
3165
-
3166
-
3167
- def test_authoritative_single_skill_result_skips_dspy_judge():
3168
- evaluator = object.__new__(module.LLMRowEvaluator)
3169
- request = RowEvaluationRequest(
3170
- row_id="CL-004:row_3",
3171
- requirement_text="No circular dependency across project",
3172
- requirement_category="1. Decoupling",
3173
- requirement_guidance="Use project dependency artifacts",
3174
- evidence_context="context",
3175
- evidence_refs=["project-dependency-graph.json", "project-cycle-report.json"],
3176
- project_profile={},
3177
- requirement_interpretation={},
3178
- code_evidence=None,
3179
- traceability=[],
3180
- )
3181
- evaluator._request_skills_needed = lambda _request: True
3182
- evaluator._strict_require_effective_skill = lambda: True
3183
- evaluator._instruction_skills_enabled = lambda: True
3184
- evaluator._instruction_available_skills = lambda: ["circular-dependency-skill"]
3185
- evaluator._recommend_skills_for_request = lambda _request, limit=3: ["circular-dependency-skill"]
3186
- evaluator._extract_skill_usage_counts = lambda _trace: (1, 1, 1)
3187
-
3188
- assert (
3189
- evaluator._should_skip_judge_for_authoritative_skill_result(
3190
- request=request,
3191
- retrieval_trace={
3192
- "tool_first_loop": {
3193
- "trace_steps": [
3194
- {"tool": "read_skill_resource", "output": {"success": True}},
3195
- {
3196
- "tool": "record_evidence_refs",
3197
- "output": {"refs": [{"ref_value": "project-cycle-report.json"}]},
3198
- },
3199
- ]
3200
- }
3201
- },
3202
- )
3203
- is True
3204
- )
3205
-
3206
-
3207
- @pytest.mark.parametrize(
3208
- ("raw", "expected"),
3209
- [
3210
- (True, True),
3211
- (False, False),
3212
- ("true", True),
3213
- ("false", False),
3214
- ("1", True),
3215
- ("0", False),
3216
- ("yes", True),
3217
- ("no", False),
3218
- ("", False),
3219
- ],
3220
- )
3221
- def test_coerce_bool_flag_handles_string_flags(raw, expected):
3222
- assert module._coerce_bool_flag(raw) is expected
3223
-
3224
-
3225
- def test_infer_ref_type_classifies_chunk_as_confluence_chunk():
3226
- assert module.LLMRowEvaluator._infer_ref_type("chunk:abc123") == "confluence_chunk"
3227
-
3228
-
3229
- def test_filter_allowed_anchor_ids_for_docs_primary_excludes_code_refs():
3230
- filtered = module.LLMRowEvaluator._filter_allowed_anchor_ids_for_requirement(
3231
- [
3232
- "src/main/java/com/example/Dto.java",
3233
- "https://confluence.local/pages/viewpage.action?pageId=123",
3234
- "docs/security.md",
3235
- ],
3236
- requirement_interpretation={
3237
- "required_anchor_modalities": ["docs"],
3238
- "finalization_policy": "docs_primary",
3239
- },
3240
- )
3241
-
3242
- assert "src/main/java/com/example/dto.java" not in filtered
3243
- assert "https://confluence.local/pages/viewpage.action?pageid=123" in filtered
3244
-
3245
-
3246
- def test_sanitize_unverified_retry_rejection_omits_raw_preview_for_project_scope_rows():
3247
- response = RowEvaluationResponse(
3248
- reasoning="reasoning",
3249
- reason="Base reason.",
3250
- score=62.0,
3251
- confidence=0.8,
3252
- finding="Base finding.",
3253
- evidence_anchors=[],
3254
- allowed_anchor_ids=[],
3255
- cited_anchor_ids=[],
3256
- )
3257
-
3258
- updated = module.LLMRowEvaluator._sanitize_unverified_retry_rejection(
3259
- response,
3260
- evidence_refs=[
3261
- "https://confluence.local/pages/viewpage.action?pageId=25123049",
3262
- "pom.xml",
3263
- "https://confluence.local/pages/viewpage.action?pageId=33916401",
3264
- ],
3265
- ratio=1.0,
3266
- project_scope_required=True,
3267
- )
3268
-
3269
- assert "refs ưu tiên" not in updated.reason
3270
- assert "pom.xml" not in updated.reason
3271
- assert "unverified_ratio=1.00" in updated.reason
3272
- assert "refs ưu tiên" not in updated.finding
3273
- assert "artifact dependency graph/cycle ở phạm vi project" in updated.finding
3274
-
3275
-
3276
- def test_sanitize_unverified_retry_rejection_keeps_preview_for_non_project_scope_rows():
3277
- response = RowEvaluationResponse(
3278
- reasoning="reasoning",
3279
- reason="Base reason.",
3280
- score=62.0,
3281
- confidence=0.8,
3282
- finding="Base finding.",
3283
- evidence_anchors=[],
3284
- allowed_anchor_ids=[],
3285
- cited_anchor_ids=[],
3286
- )
3287
-
3288
- updated = module.LLMRowEvaluator._sanitize_unverified_retry_rejection(
3289
- response,
3290
- evidence_refs=["src/main/java/AppConfig.java", "docs/adr-001.md"],
3291
- ratio=0.75,
3292
- project_scope_required=False,
3293
- )
3294
-
3295
- assert "refs ưu tiên" in updated.reason
3296
- assert "src/main/java/AppConfig.java" in updated.reason
3297
-
3298
-
3299
- def test_sanitize_no_evidence_contradiction_omits_raw_preview_for_project_scope_rows():
3300
- response = RowEvaluationResponse(
3301
- reasoning="reasoning",
3302
- reason="Base reason.",
3303
- score=62.0,
3304
- confidence=0.8,
3305
- finding="Base finding.",
3306
- evidence_anchors=[],
3307
- allowed_anchor_ids=[],
3308
- cited_anchor_ids=[],
3309
- )
3310
-
3311
- updated = module.LLMRowEvaluator._sanitize_no_evidence_contradiction(
3312
- response,
3313
- evidence_refs=[
3314
- "attachment://57037192/143098445",
3315
- "https://confluence.local/pages/viewpage.action?pageId=25123049",
3316
- "pom.xml",
3317
- ],
3318
- project_scope_required=True,
3319
- )
3320
-
3321
- assert "attachment://" not in updated.reason
3322
- assert "pageId=" not in updated.reason
3323
- assert "pom.xml" not in updated.reason
3324
- assert "Evidence references are present in the input context." in updated.reason
3325
-
3326
-
3327
- def test_resolve_terminal_repair_llm_context_preserves_active_runtime_policy(monkeypatch):
3328
- active_llm_cfg = SimpleNamespace(
3329
- output_retries=4,
3330
- agent_retries=2,
3331
- agent_stream=False,
3332
- stream=False,
3333
- model_standard="z-ai/glm5",
3334
- base_url="http://localhost:8082",
3335
- protocol=SimpleNamespace(value="anthropic"),
3336
- )
3337
- evaluator = module.LLMRowEvaluator(
3338
- config=SimpleNamespace(
3339
- protocol=SimpleNamespace(value="anthropic"),
3340
- model="z-ai/glm5",
3341
- use_dspy=False,
3342
- runtime_context={},
3343
- llm=active_llm_cfg,
3344
- ),
3345
- template_hash="tpl",
3346
- evidence_hash="evidence",
3347
- )
3348
-
3349
- monkeypatch.setattr(
3350
- evaluator,
3351
- "get_last_retry_telemetry_snapshot",
3352
- lambda: {"provider_failover_final_provider": "nvidia-glm-anthropic"},
3353
- )
3354
- monkeypatch.setattr(evaluator, "_resolve_active_runtime_profile_name", lambda: "nvidia-glm-anthropic")
3355
- monkeypatch.setattr(
3356
- module,
3357
- "inherit_runtime_llm_policy",
3358
- lambda *_args, **_kwargs: (_ for _ in ()).throw(AssertionError("should not rebuild active provider config")),
3359
- )
3360
-
3361
- llm_cfg, protocol, model = evaluator._resolve_terminal_repair_llm_context()
3362
-
3363
- assert llm_cfg is active_llm_cfg
3364
- assert protocol == "anthropic"
3365
- assert model == "z-ai/glm5"
3366
-
3367
-
3368
- @pytest.mark.asyncio
3369
- async def test_invoke_async_agent_with_provider_retry_preserves_runtime_policy_on_failover(monkeypatch):
3370
- evaluator = module.LLMRowEvaluator(
3371
- config=SimpleNamespace(
3372
- protocol=SimpleNamespace(value="openai"),
3373
- model="primary-model",
3374
- use_dspy=False,
3375
- runtime_context={},
3376
- row_failover_profiles=["fallback-openai"],
3377
- ),
3378
- template_hash="tpl",
3379
- evidence_hash="evidence",
3380
- )
3381
-
3382
- primary_cfg = SimpleNamespace(
3383
- agent_retries=2,
3384
- output_retries=4,
3385
- max_tokens_per_request=1024,
3386
- model_standard="primary-model",
3387
- protocol=SimpleNamespace(value="openai"),
3388
- base_url="https://primary.example/v1",
3389
- agent_stream=False,
3390
- stream=False,
3391
- row_failover_profiles=["fallback-openai"],
3392
- row_failover_max_provider_hops=1,
3393
- row_progress_lease_seconds=180,
3394
- row_stall_detection_seconds=45,
3395
- row_absolute_timeout_ms=900000,
3396
- agent_event_stream_enabled=False,
3397
- )
3398
- fallback_cfg = SimpleNamespace(
3399
- agent_retries=2,
3400
- output_retries=4,
3401
- max_tokens_per_request=1024,
3402
- model_standard="fallback-model",
3403
- protocol=SimpleNamespace(value="openai"),
3404
- base_url="https://fallback.example/v1",
3405
- agent_stream=False,
3406
- stream=False,
3407
- row_failover_profiles=["fallback-openai"],
3408
- row_failover_max_provider_hops=1,
3409
- row_progress_lease_seconds=180,
3410
- row_stall_detection_seconds=45,
3411
- row_absolute_timeout_ms=900000,
3412
- agent_event_stream_enabled=False,
3413
- )
3414
- inherited_calls: list[tuple[str, object]] = []
3415
-
3416
- async def _fake_invoke_async_agent(**kwargs):
3417
- llm_cfg = kwargs.get("llm_cfg")
3418
- if getattr(llm_cfg, "model_standard", "") == "primary-model":
3419
- raise module.RowEvaluationBackendError(
3420
- "status_code: 503 service unavailable",
3421
- retry_metadata={"reason_code": "provider_server_error"},
3422
- )
3423
- return RowEvaluationResponse(
3424
- reasoning="reasoning",
3425
- reason="reason",
3426
- score=50.0,
3427
- confidence=0.8,
3428
- finding="finding",
3429
- )
3430
-
3431
- def _fake_inherit_runtime_llm_policy(profile_name, *, source_llm=None):
3432
- inherited_calls.append((profile_name, source_llm))
3433
- return fallback_cfg
3434
-
3435
- monkeypatch.setenv("VDS_AUDIT_ACTIVE_PROFILE", "primary-openai")
3436
- monkeypatch.setenv("VDS_AUDIT_LLM__ROW_FAILOVER_PROFILES", "configured")
3437
- monkeypatch.setattr(module, "_prompt_provider_retry_attempts", lambda: 1)
3438
- monkeypatch.setattr(module, "_prompt_provider_retry_backoff_seconds", lambda: 0.0)
3439
- monkeypatch.setattr(module, "inherit_runtime_llm_policy", _fake_inherit_runtime_llm_policy)
3440
- monkeypatch.setattr(evaluator, "_invoke_async_agent", _fake_invoke_async_agent)
3441
-
3442
- response = await evaluator._invoke_async_agent_with_provider_retry(
3443
- key="retry-test-provider-failover-policy",
3444
- name="RowEvaluator",
3445
- system_prompt="system",
3446
- user_prompt="user",
3447
- toolsets=[],
3448
- profile={},
3449
- row_id="CL-004",
3450
- runtime_fields={"check_id": "CL-004"},
3451
- llm_cfg=primary_cfg,
3452
- effective_model="primary-model",
3453
- runtime_profile_name="primary-openai",
3454
- )
3455
-
3456
- assert response.reason == "reason"
3457
- assert inherited_calls == [("fallback-openai", primary_cfg)]
3458
-
3459
-
3460
- def test_build_agent_key_varies_with_runtime_policy() -> None:
3461
- evaluator = module.LLMRowEvaluator(
3462
- config=SimpleNamespace(
3463
- protocol=SimpleNamespace(value="anthropic"),
3464
- model="z-ai/glm5",
3465
- use_dspy=False,
3466
- runtime_context={},
3467
- ),
3468
- template_hash="tpl",
3469
- evidence_hash="evidence",
3470
- )
3471
- llm_low_retry = SimpleNamespace(
3472
- base_url="http://localhost:8082",
3473
- stream=False,
3474
- agent_stream=False,
3475
- max_tokens_per_request=1024,
3476
- max_tokens=1024,
3477
- agent_retries=1,
3478
- output_retries=1,
3479
- )
3480
- llm_high_retry = SimpleNamespace(
3481
- base_url="http://localhost:8082",
3482
- stream=False,
3483
- agent_stream=False,
3484
- max_tokens_per_request=1024,
3485
- max_tokens=1024,
3486
- agent_retries=1,
3487
- output_retries=4,
3488
- )
3489
-
3490
- low_key = evaluator._build_agent_key(
3491
- async_mode=False,
3492
- protocol="anthropic",
3493
- model="z-ai/glm5",
3494
- instruction_suffix="tf",
3495
- system_prompt="system",
3496
- fallback_suffix=":terminal_repair",
3497
- llm_cfg=llm_low_retry,
3498
- )
3499
- high_key = evaluator._build_agent_key(
3500
- async_mode=False,
3501
- protocol="anthropic",
3502
- model="z-ai/glm5",
3503
- instruction_suffix="tf",
3504
- system_prompt="system",
3505
- fallback_suffix=":terminal_repair",
3506
- llm_cfg=llm_high_retry,
3507
- )
3508
-
3509
- assert low_key != high_key
3510
-
3511
-
3512
- # ---------------------------------------------------------------------------
3513
- # TSK-166.6: Route-aware failover tests for LLMRowEvaluator prompt paths
3514
- # ---------------------------------------------------------------------------
3515
-
3516
-
3517
- def _make_p166_llm_cfg(
3518
- *,
3519
- model: str = "primary-model",
3520
- failover_profiles: list[str] | None = None,
3521
- max_hops: int = 1,
3522
- ) -> SimpleNamespace:
3523
- return SimpleNamespace(
3524
- agent_retries=0,
3525
- output_retries=0,
3526
- max_tokens=256,
3527
- model_standard=model,
3528
- protocol=SimpleNamespace(value="openai"),
3529
- base_url=f"https://{model}.example/v1",
3530
- agent_stream=False,
3531
- stream=False,
3532
- row_failover_profiles=failover_profiles or [],
3533
- row_failover_max_provider_hops=max_hops,
3534
- )
3535
-
3536
-
3537
- def _make_p166_evaluator(*, failover_profiles: list[str] | None = None) -> module.LLMRowEvaluator:
3538
- return module.LLMRowEvaluator(
3539
- config=SimpleNamespace(
3540
- protocol=SimpleNamespace(value="openai"),
3541
- model="primary-model",
3542
- use_dspy=False,
3543
- runtime_context={},
3544
- row_failover_profiles=failover_profiles or [],
3545
- ),
3546
- template_hash="tpl",
3547
- evidence_hash="evidence",
3548
- )
3549
-
3550
-
3551
- @pytest.mark.asyncio
3552
- async def test_route_credential_gap_triggers_immediate_failover_to_fallback_profile(monkeypatch):
3553
- """HTTP 400 + 'No credentials for provider:' must skip same-provider retry and
3554
- failover directly to the fallback profile (TSK-166.6 — route gap + failover)."""
3555
- evaluator = _make_p166_evaluator(failover_profiles=["fallback-openai"])
3556
- primary_cfg = _make_p166_llm_cfg(model="primary-model", failover_profiles=["fallback-openai"])
3557
- fallback_cfg = _make_p166_llm_cfg(model="fallback-model", failover_profiles=[])
3558
-
3559
- calls: list[str] = []
3560
-
3561
- async def _fake_invoke_async_agent(**kwargs):
3562
- llm_cfg = kwargs.get("llm_cfg")
3563
- model = getattr(llm_cfg, "model_standard", "")
3564
- calls.append(model)
3565
- if model == "primary-model":
3566
- # Production error shape: proxy returns 400 when route has no credential for provider
3567
- raise module.RowEvaluationBackendError(
3568
- "no credentials for provider: anthropic",
3569
- retry_metadata={"reason_code": "provider_route_unavailable"},
3570
- )
3571
- return RowEvaluationResponse(
3572
- reasoning="ok",
3573
- reason="pass",
3574
- score=80.0,
3575
- confidence=0.9,
3576
- finding="finding",
3577
- )
3578
-
3579
- monkeypatch.setenv("VDS_AUDIT_ACTIVE_PROFILE", "primary-openai")
3580
- monkeypatch.setenv("VDS_AUDIT_LLM__ROW_FAILOVER_PROFILES", "configured")
3581
- monkeypatch.setattr(module, "_prompt_provider_retry_attempts", lambda: 3)
3582
- monkeypatch.setattr(module, "_prompt_provider_retry_backoff_seconds", lambda: 0.0)
3583
- monkeypatch.setattr(module, "inherit_runtime_llm_policy", lambda profile_name, *, source_llm=None: fallback_cfg)
3584
- monkeypatch.setattr(evaluator, "_invoke_async_agent", _fake_invoke_async_agent)
3585
-
3586
- response = await evaluator._invoke_async_agent_with_provider_retry(
3587
- key="route-gap-failover-test",
3588
- name="RowEvaluator",
3589
- system_prompt="system",
3590
- user_prompt="user",
3591
- toolsets=[],
3592
- profile={},
3593
- row_id="CL-001",
3594
- runtime_fields={"check_id": "CL-001"},
3595
- llm_cfg=primary_cfg,
3596
- effective_model="primary-model",
3597
- runtime_profile_name="primary-openai",
3598
- )
3599
-
3600
- # Must succeed via fallback — NOT retry same provider (only 2 calls total)
3601
- assert response.reason == "pass"
3602
- assert calls == ["primary-model", "fallback-model"], "must not retry same provider before failover"
3603
- retry_telemetry = evaluator.get_last_retry_telemetry_snapshot() or {}
3604
- assert retry_telemetry["provider_failover_attempted"] is True
3605
- assert retry_telemetry["provider_failover_final_provider"] == "fallback-openai"
3606
- assert retry_telemetry["provider_failover_reason"] == "route_provider_credential_gap"
3607
-
3608
-
3609
- @pytest.mark.asyncio
3610
- async def test_route_credential_gap_raises_when_no_fallback_configured(monkeypatch):
3611
- """Route-credential gap with no fallback profiles must raise RowEvaluationBackendError
3612
- immediately — no retry, no silent swallow (TSK-166.6 — route gap exhaustion)."""
3613
- evaluator = _make_p166_evaluator(failover_profiles=[])
3614
- primary_cfg = _make_p166_llm_cfg(model="primary-model", failover_profiles=[])
3615
-
3616
- async def _fake_invoke_async_agent(**_kwargs):
3617
- raise module.RowEvaluationBackendError(
3618
- "no credentials for provider: openai",
3619
- retry_metadata={"reason_code": "provider_route_unavailable"},
3620
- )
3621
-
3622
- monkeypatch.setenv("VDS_AUDIT_ACTIVE_PROFILE", "primary-openai")
3623
- monkeypatch.setenv("VDS_AUDIT_LLM__ROW_FAILOVER_PROFILES", "configured")
3624
- monkeypatch.setattr(module, "_prompt_provider_retry_attempts", lambda: 3)
3625
- monkeypatch.setattr(module, "_prompt_provider_retry_backoff_seconds", lambda: 0.0)
3626
- monkeypatch.setattr(evaluator, "_invoke_async_agent", _fake_invoke_async_agent)
3627
-
3628
- with pytest.raises(module.RowEvaluationBackendError) as exc_info:
3629
- await evaluator._invoke_async_agent_with_provider_retry(
3630
- key="route-gap-no-fallback-test",
3631
- name="RowEvaluator",
3632
- system_prompt="system",
3633
- user_prompt="user",
3634
- toolsets=[],
3635
- profile={},
3636
- row_id="CL-002",
3637
- runtime_fields={"check_id": "CL-002"},
3638
- llm_cfg=primary_cfg,
3639
- effective_model="primary-model",
3640
- runtime_profile_name="primary-openai",
3641
- )
3642
-
3643
- retry_metadata = exc_info.value.retry_metadata or {}
3644
- assert retry_metadata["reason_code"] == "provider_route_unavailable"
3645
-
3646
-
3647
- @pytest.mark.asyncio
3648
- async def test_terminal_auth_401_does_not_enter_failover_path(monkeypatch):
3649
- """HTTP 401 is TERMINAL_AUTH (is_failoverable=False) — must raise immediately,
3650
- never touching the failover branch (TSK-166.6 — auth remains non-failoverable)."""
3651
- import httpx
3652
-
3653
- evaluator = _make_p166_evaluator(failover_profiles=["fallback-openai"])
3654
- primary_cfg = _make_p166_llm_cfg(model="primary-model", failover_profiles=["fallback-openai"])
3655
-
3656
- failover_calls: list[str] = []
3657
-
3658
- async def _fake_invoke_async_agent(**_kwargs):
3659
- request = httpx.Request("POST", "https://api.openai.com/v1/chat/completions")
3660
- response = httpx.Response(401, request=request)
3661
- raise httpx.HTTPStatusError("401 Unauthorized", request=request, response=response)
3662
-
3663
- monkeypatch.setenv("VDS_AUDIT_ACTIVE_PROFILE", "primary-openai")
3664
- monkeypatch.setenv("VDS_AUDIT_LLM__ROW_FAILOVER_PROFILES", "configured")
3665
- monkeypatch.setattr(module, "_prompt_provider_retry_attempts", lambda: 1)
3666
- monkeypatch.setattr(module, "_prompt_provider_retry_backoff_seconds", lambda: 0.0)
3667
- monkeypatch.setattr(evaluator, "_invoke_async_agent", _fake_invoke_async_agent)
3668
-
3669
- with pytest.raises(httpx.HTTPStatusError):
3670
- await evaluator._invoke_async_agent_with_provider_retry(
3671
- key="terminal-auth-test",
3672
- name="RowEvaluator",
3673
- system_prompt="system",
3674
- user_prompt="user",
3675
- toolsets=[],
3676
- profile={},
3677
- row_id="CL-003",
3678
- runtime_fields={"check_id": "CL-003"},
3679
- llm_cfg=primary_cfg,
3680
- effective_model="primary-model",
3681
- runtime_profile_name="primary-openai",
3682
- )
3683
-
3684
- assert failover_calls == [], "401 must not reach failover path"