xrefkit 0.7.12__tar.gz → 0.7.13__tar.gz

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 (280) hide show
  1. {xrefkit-0.7.12/xrefkit.egg-info → xrefkit-0.7.13}/PKG-INFO +1 -1
  2. {xrefkit-0.7.12 → xrefkit-0.7.13}/pyproject.toml +1 -1
  3. xrefkit-0.7.13/tests/test_decision_checklist.py +203 -0
  4. xrefkit-0.7.13/tests/test_decision_handoff.py +261 -0
  5. xrefkit-0.7.13/tests/test_engineering_decision.py +278 -0
  6. xrefkit-0.7.13/tests/test_principle_discovery.py +217 -0
  7. xrefkit-0.7.13/tests/test_project_management_offline_progress.py +112 -0
  8. xrefkit-0.7.13/tests/test_unknown_resolution.py +271 -0
  9. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/__init__.py +1 -1
  10. xrefkit-0.7.13/xrefkit/decision_checklist.py +113 -0
  11. xrefkit-0.7.13/xrefkit/decision_handoff.py +319 -0
  12. xrefkit-0.7.13/xrefkit/engineering_decision.py +588 -0
  13. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/execution_binding.py +6 -0
  14. xrefkit-0.7.13/xrefkit/host_execution.py +83 -0
  15. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/operations_cli.py +57 -1
  16. xrefkit-0.7.13/xrefkit/principle_discovery.py +128 -0
  17. xrefkit-0.7.13/xrefkit/resources/engineering-decision-checklist.json +52 -0
  18. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/skillrun.py +106 -12
  19. xrefkit-0.7.13/xrefkit/unknown_resolution.py +199 -0
  20. {xrefkit-0.7.12 → xrefkit-0.7.13/xrefkit.egg-info}/PKG-INFO +1 -1
  21. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit.egg-info/SOURCES.txt +13 -0
  22. {xrefkit-0.7.12 → xrefkit-0.7.13}/LICENSE +0 -0
  23. {xrefkit-0.7.12 → xrefkit-0.7.13}/README.md +0 -0
  24. {xrefkit-0.7.12 → xrefkit-0.7.13}/setup.cfg +0 -0
  25. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_artifact_selected_family.py +0 -0
  26. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_attention_pet.py +0 -0
  27. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_attention_pet_client_protocol.py +0 -0
  28. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_attention_pet_codex_session.py +0 -0
  29. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_attention_pet_fit.py +0 -0
  30. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_azure_connection.py +0 -0
  31. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_azure_import.py +0 -0
  32. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_azure_recovery.py +0 -0
  33. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_azure_update_candidate.py +0 -0
  34. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_azure_writer.py +0 -0
  35. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_boundary_analysis.py +0 -0
  36. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_brownfield_csharp_structure_definitions.py +0 -0
  37. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_brownfield_file_editing_protocol.py +0 -0
  38. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_business_intake_conversation_definitions.py +0 -0
  39. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_business_intake_definition.py +0 -0
  40. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_calibration_lint.py +0 -0
  41. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_catalog_preparation_definition.py +0 -0
  42. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_check_skill_knowledge_xids.py +0 -0
  43. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_ci_workflow_invariants.py +0 -0
  44. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_cli.py +0 -0
  45. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_code_constraint_definition.py +0 -0
  46. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_collect_analyzer_sarif.py +0 -0
  47. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_compact_skill_logs.py +0 -0
  48. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_constraint_derivation_family_definition.py +0 -0
  49. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_constraint_derivation_selected_family.py +0 -0
  50. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_contribution_adoption_bytes.py +0 -0
  51. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_contribution_returns.py +0 -0
  52. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_convert_to_xrefkit_skill.py +0 -0
  53. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_cs_scope_probe.py +0 -0
  54. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_csharp_commonality.py +0 -0
  55. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_csharp_naming_profile.py +0 -0
  56. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_ctx.py +0 -0
  57. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_cutover_readiness.py +0 -0
  58. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_dashboard.py +0 -0
  59. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_database_batch_definition_migration.py +0 -0
  60. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_decision_trace.py +0 -0
  61. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_design_business_intake_selected_family.py +0 -0
  62. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_design_planning_definition_migration.py +0 -0
  63. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_dotnet_definition_candidate.py +0 -0
  64. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_editorial_family_definition.py +0 -0
  65. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_editorial_intake_definition.py +0 -0
  66. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_editorial_selected_family.py +0 -0
  67. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_embedded_startup_pack.py +0 -0
  68. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_error_policy_audit.py +0 -0
  69. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_error_policy_locator.py +0 -0
  70. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_execution_binding.py +0 -0
  71. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_existing_skill_definition_batch.py +0 -0
  72. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_final_skilldefinition_batch.py +0 -0
  73. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_flow_selected_family.py +0 -0
  74. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_fm_multiroot.py +0 -0
  75. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_gate.py +0 -0
  76. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_gateway.py +0 -0
  77. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_gateway_mcp.py +0 -0
  78. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_gateway_skill_adapter.py +0 -0
  79. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_gateway_work_items.py +0 -0
  80. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_goal_desired_state.py +0 -0
  81. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_governance_entry.py +0 -0
  82. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_governance_host.py +0 -0
  83. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_host_precheck.py +0 -0
  84. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_human_evaluation.py +0 -0
  85. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_implementation_flow_definition.py +0 -0
  86. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_implementation_review_selected_family.py +0 -0
  87. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_inbound_uploads.py +0 -0
  88. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_instruction_workflow.py +0 -0
  89. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_knowledge_relations_validator.py +0 -0
  90. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_language_review_definition.py +0 -0
  91. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_legacy_guidance.py +0 -0
  92. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_legacy_migration.py +0 -0
  93. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_legacy_resources.py +0 -0
  94. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_mcp_package_routing.py +0 -0
  95. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_mcp_setup.py +0 -0
  96. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_mcp_subagent_startup.py +0 -0
  97. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_mcp_subagent_startup_integration.py +0 -0
  98. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_ontology_assessment_validator.py +0 -0
  99. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_os_family_definition.py +0 -0
  100. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_os_knowledge_family_definition.py +0 -0
  101. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_os_selected_family.py +0 -0
  102. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_ownership.py +0 -0
  103. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_package_knowledge_resolution.py +0 -0
  104. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_package_skill_run.py +0 -0
  105. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_packaged_native_governance.py +0 -0
  106. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_packmeta.py +0 -0
  107. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_plan_markdown.py +0 -0
  108. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_plan_observation.py +0 -0
  109. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_project_management_materialization.py +0 -0
  110. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_project_quality_baseline.py +0 -0
  111. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_qa_report_definition.py +0 -0
  112. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_quality_issue_dashboard.py +0 -0
  113. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_quality_issues.py +0 -0
  114. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_reporting_profiles.py +0 -0
  115. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_reporting_quality.py +0 -0
  116. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_repository_skill_adoption.py +0 -0
  117. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_repository_startup_pack.py +0 -0
  118. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_resource_provider.py +0 -0
  119. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_runtime_contracts.py +0 -0
  120. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_sarif_to_locator.py +0 -0
  121. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_security_definition_migration.py +0 -0
  122. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_site_release_metadata.py +0 -0
  123. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_skill_definition.py +0 -0
  124. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_skill_definition_governance.py +0 -0
  125. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_skill_definition_mcp.py +0 -0
  126. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_skill_definition_runtime.py +0 -0
  127. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_skill_edits.py +0 -0
  128. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_skill_maturity_return.py +0 -0
  129. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_skill_release_compatibility.py +0 -0
  130. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_skill_runtime_audit.py +0 -0
  131. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_skillmeta.py +0 -0
  132. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_skills_sync.py +0 -0
  133. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_source_analysis_fragments.py +0 -0
  134. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_structure_catalog.py +0 -0
  135. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_subagent_startup.py +0 -0
  136. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_subagent_startup_boundaries.py +0 -0
  137. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_wbs.py +0 -0
  138. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_work_management.py +0 -0
  139. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_work_packages.py +0 -0
  140. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_workflow_family_definition.py +0 -0
  141. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_xref.py +0 -0
  142. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_xrefkit_instance.py +0 -0
  143. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_xrefkit_tools.py +0 -0
  144. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_xrefkit_v2_discovery.py +0 -0
  145. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_xrefkit_v2_models.py +0 -0
  146. {xrefkit-0.7.12 → xrefkit-0.7.13}/tests/test_xrefkit_v2_pipeline.py +0 -0
  147. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/__main__.py +0 -0
  148. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/attention_pet/__init__.py +0 -0
  149. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/attention_pet/__main__.py +0 -0
  150. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/attention_pet/client.py +0 -0
  151. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/attention_pet/client_protocol.py +0 -0
  152. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/attention_pet/codex_session.py +0 -0
  153. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/attention_pet/evaluator.py +0 -0
  154. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/attention_pet/model.py +0 -0
  155. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/attention_pet/presentation.py +0 -0
  156. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/attention_pet/profiles.py +0 -0
  157. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/attention_pet/scenarios.py +0 -0
  158. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/attention_pet/server.py +0 -0
  159. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/attention_pet/store.py +0 -0
  160. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/azure_connection.py +0 -0
  161. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/azure_import.py +0 -0
  162. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/azure_recovery.py +0 -0
  163. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/azure_update_candidate.py +0 -0
  164. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/azure_writer.py +0 -0
  165. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/boundary_analysis.py +0 -0
  166. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/catalog_cli.py +0 -0
  167. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/cli.py +0 -0
  168. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/contracts.py +0 -0
  169. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/ctx.py +0 -0
  170. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/dashboard.py +0 -0
  171. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/decision_trace.py +0 -0
  172. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/discovery.py +0 -0
  173. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/execution_binding_cli.py +0 -0
  174. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/gate.py +0 -0
  175. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/gateway.py +0 -0
  176. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/goalstate.py +0 -0
  177. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/governance_entry.py +0 -0
  178. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/governance_entry_cli.py +0 -0
  179. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/governance_host.py +0 -0
  180. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/hashing.py +0 -0
  181. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/host_precheck.py +0 -0
  182. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/import_skill.py +0 -0
  183. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/instance.py +0 -0
  184. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/loaders.py +0 -0
  185. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/__init__.py +0 -0
  186. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/audit.py +0 -0
  187. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/bootstrap.py +0 -0
  188. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/catalog.py +0 -0
  189. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/cli.py +0 -0
  190. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/client_cache.py +0 -0
  191. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/client_flow.py +0 -0
  192. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/context_registry.py +0 -0
  193. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/context_token.py +0 -0
  194. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/contracts.py +0 -0
  195. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/contribution_adoption.py +0 -0
  196. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/contribution_returns.py +0 -0
  197. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/dist.py +0 -0
  198. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/gateway.py +0 -0
  199. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/governed_overlays.py +0 -0
  200. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/inbound_uploads.py +0 -0
  201. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/knowledge_edits.py +0 -0
  202. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/legacy_guidance.py +0 -0
  203. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/legacy_migration.py +0 -0
  204. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/legacy_resources.py +0 -0
  205. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/ownership.py +0 -0
  206. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/repository.py +0 -0
  207. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/schemas.py +0 -0
  208. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/server.py +0 -0
  209. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/setup.py +0 -0
  210. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/skill_edits.py +0 -0
  211. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/skill_maturity.py +0 -0
  212. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/startup_contract_pack.py +0 -0
  213. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/subagent_startup.py +0 -0
  214. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp/update_gate_intake.py +0 -0
  215. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/mcp_tools.py +0 -0
  216. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/models/__init__.py +0 -0
  217. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/models/common.py +0 -0
  218. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/models/effective_bundle.py +0 -0
  219. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/models/human_evaluation.py +0 -0
  220. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/models/local_manifest.py +0 -0
  221. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/models/package_manifest.py +0 -0
  222. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/models/run_log.py +0 -0
  223. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/models/server_config.py +0 -0
  224. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/models/skill_definition.py +0 -0
  225. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/ownership.py +0 -0
  226. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/packmeta.py +0 -0
  227. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/plan_markdown.py +0 -0
  228. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/plan_observation.py +0 -0
  229. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/quality_issues.py +0 -0
  230. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/registry.py +0 -0
  231. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/reporting.py +0 -0
  232. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/reporting_profiles.py +0 -0
  233. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/repository_skills.py +0 -0
  234. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resolver.py +0 -0
  235. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resource_provider.py +0 -0
  236. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/attention_pet/client-state.schema.json +0 -0
  237. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/attention_pet/pet.css +0 -0
  238. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/attention_pet/pet.html +0 -0
  239. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/attention_pet/pet.js +0 -0
  240. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/contracts.json +0 -0
  241. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/current.json +0 -0
  242. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/generations/7a682a5272907354/contracts.json +0 -0
  243. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/generations/7a682a5272907354/model_body.md +0 -0
  244. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/generations/9929294385ccb7b0/contracts.json +0 -0
  245. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/generations/9929294385ccb7b0/model_body.md +0 -0
  246. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/model_body.md +0 -0
  247. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/startup_sources/000_agent_entry.md +0 -0
  248. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/startup_sources/011_startup_xref_routing.md +0 -0
  249. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/startup_sources/015_shared_memory_operations.md +0 -0
  250. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/startup_sources/016_uncertainty_protocol.md +0 -0
  251. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/startup_sources/017_base_and_xref_layering.md +0 -0
  252. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/startup_sources/053_context_direction_security_guard.md +0 -0
  253. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/base/startup_sources/yomiyasu_LICENSE.txt +0 -0
  254. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/migration/docs/guides/062_legacy_flow_skill_migration_guide.md +0 -0
  255. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/migration/knowledge/operations/130_legacy_flow_skill_migration_rules.md +0 -0
  256. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/migration/knowledge/organization/160_context_direction_guard_rules.md +0 -0
  257. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/migration/skills/os/legacy_flow_skill_migration/SKILL.v1.md +0 -0
  258. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/migration/skills/os/legacy_flow_skill_migration/references/legacy_flow_skill_migration_template.md +0 -0
  259. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/migration/skills/repository_adoption.json +0 -0
  260. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/resources/migration/tools/migrate_legacy_flow_skill.py +0 -0
  261. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/runlog.py +0 -0
  262. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/skill_definition.py +0 -0
  263. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/skill_definition_catalog.py +0 -0
  264. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/skill_definition_governance.py +0 -0
  265. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/skillmeta.py +0 -0
  266. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/skills_sync.py +0 -0
  267. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/structure_catalog.py +0 -0
  268. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/subagent_startup.py +0 -0
  269. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/tools/__init__.py +0 -0
  270. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/tools/__main__.py +0 -0
  271. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/v2_cli.py +0 -0
  272. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/wbs.py +0 -0
  273. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/work_management.py +0 -0
  274. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/work_management_view.py +0 -0
  275. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/workspace.py +0 -0
  276. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit/xref.py +0 -0
  277. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit.egg-info/dependency_links.txt +0 -0
  278. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit.egg-info/entry_points.txt +0 -0
  279. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit.egg-info/requires.txt +0 -0
  280. {xrefkit-0.7.12 → xrefkit-0.7.13}/xrefkit.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xrefkit
3
- Version: 0.7.12
3
+ Version: 0.7.13
4
4
  Summary: Portable XID, Skill, Knowledge, workflow, and MCP runtime for XRefKit
5
5
  Author: synthaicode
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "xrefkit"
7
- version = "0.7.12"
7
+ version = "0.7.13"
8
8
  description = "Portable XID, Skill, Knowledge, workflow, and MCP runtime for XRefKit"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -0,0 +1,203 @@
1
+ import json
2
+
3
+ import pytest
4
+
5
+ from test_engineering_decision import finalize, pinned, project
6
+ from test_principle_discovery import GLOBAL, discovery_context, discovery_project, evaluate, metadata, proposal_with
7
+ from test_subagent_startup import command
8
+ from xrefkit import decision_checklist
9
+ from xrefkit.engineering_decision import record_decision, require_decision
10
+
11
+
12
+ OMITTED_DESIGNS = {
13
+ "API-01": "On timeout, retry the payment creation API using the existing request body.",
14
+ "API-04": "After a timeout, POST the order again with a new request identifier until one call returns success.",
15
+ "GDC-03": "Let each worker write final status directly; the status table remains the shared output.",
16
+ "GDC-07": "On HTTP 200, mark the operation complete and publish the result.",
17
+ }
18
+
19
+
20
+ def checklist_proposal(proposal, found, resolved, *, evaluator="designer"):
21
+ draft = proposal_with(proposal, resolved)
22
+ proof = proposal["verification"]["replay"]
23
+ refs = {xid: source["revision"] for xid, source in found["references"].items()}
24
+ items = {}
25
+ for check_id, check in resolved["reference_set"]["checklist"]["checks"].items():
26
+ applies = check["applicability"]["applies"]
27
+ items[check_id] = {
28
+ "revision": check["revision"], "applicability": "applies" if applies else "not_applicable",
29
+ "result": "PASS" if applies else "NOT_APPLICABLE",
30
+ "reason": "The synthetic evidence covers the design question" if applies else "Single serialized writer",
31
+ "references": refs, "evidence": [{key: proof[key] for key in ("path", "sha256")}] if applies else [],
32
+ "unresolved": [], "evaluator": evaluator,
33
+ }
34
+ return {**draft, "checklist": {"decision_id": found["decision_id"], "candidate": draft["candidate"],
35
+ "reference_set_sha256": draft["reference_set_sha256"], "results": items}}
36
+
37
+
38
+ @pytest.fixture
39
+ def checklist_project(discovery_project):
40
+ policy, proposal, prepare, update, authorize = discovery_project
41
+ policy["checklist"] = True
42
+ update()
43
+ return policy, proposal, prepare, update, authorize
44
+
45
+
46
+ def test_valid_checklist_binds_candidate_and_review(tmp_path, checklist_project):
47
+ _, proposal, prepare, _, authorize = checklist_project
48
+ found = record_decision(tmp_path, prepare)
49
+ resolved = evaluate(tmp_path, found)
50
+ definition = resolved["reference_set"]["checklist"]
51
+ assert set(definition["categories"]) == {"api", "global"}
52
+ assert len(definition["checks"]) == 15
53
+ assert definition["checks"]["API-04"]["related_xids"] == [GLOBAL]
54
+ assert definition["checks"]["GDC-10"]["knowledge_gaps"]
55
+ draft = checklist_proposal(proposal, found, resolved)
56
+ authorize(found, draft)
57
+ assert finalize(tmp_path, draft)["state"] == "DETERMINED"
58
+ receipt = require_decision(tmp_path, "WI-1", "retry", "ED-1")
59
+ assert len(receipt["checklist_sha256"]) == 64
60
+ assert receipt["candidate"] == draft["checklist"]["candidate"]
61
+
62
+
63
+ @pytest.mark.parametrize("omitted", ["API-01", "API-04", "GDC-03", "GDC-07"])
64
+ def test_review_rejects_missing_checks_on_original_draft(tmp_path, checklist_project, omitted):
65
+ _, proposal, prepare, _, _ = checklist_project
66
+ proposal["candidate"] = pinned(tmp_path, "design.md", OMITTED_DESIGNS[omitted])
67
+ found = record_decision(tmp_path, prepare)
68
+ draft = checklist_proposal(proposal, found, evaluate(tmp_path, found))
69
+ del draft["checklist"]["results"][omitted]
70
+ with pytest.raises(ValueError, match=f"{omitted}=MISSING"):
71
+ record_decision(tmp_path, {"action": "review", "decision_id": "ED-1", "proposal": draft})
72
+ with pytest.raises(ValueError, match=f"{omitted}=MISSING"):
73
+ finalize(tmp_path, draft)
74
+
75
+
76
+ @pytest.mark.parametrize("concurrency", ["no", "unknown", "yes"])
77
+ def test_state_attributes_add_checks_and_detect_concurrency_omission(tmp_path, checklist_project, concurrency):
78
+ policy, proposal, prepare, update, _ = checklist_project
79
+ policy["catalog"][GLOBAL]["discovery"] = metadata(
80
+ "responsibility dependencies change_impact consistency invariants transactions contention exclusion visibility")
81
+ update()
82
+ context = discovery_context(category="architecture_change", state_management="yes", concurrency=concurrency)
83
+ proposal["candidate"] = pinned(tmp_path, "design.md",
84
+ "Workers read status, calculate a new status, then overwrite it.")
85
+ found = record_decision(tmp_path, {**prepare, "decision_context": context})
86
+ resolved = evaluate(tmp_path, found)
87
+ selection = resolved["reference_set"]["checklist"]
88
+ assert set(selection["categories"]) == {"architecture", "state", "concurrency", "global"}
89
+ assert selection["checks"]["CON-02"]["applicability"]["applies"] == (concurrency != "no")
90
+ draft = checklist_proposal(proposal, found, resolved)
91
+ del draft["checklist"]["results"]["CON-01"]
92
+ with pytest.raises(ValueError, match="CON-01=MISSING"):
93
+ finalize(tmp_path, draft)
94
+
95
+
96
+ @pytest.mark.parametrize("status", ["UNKNOWN", "FAIL"])
97
+ def test_pending_findings_reject_use_but_survive_blocked(tmp_path, checklist_project, status):
98
+ _, proposal, prepare, _, _ = checklist_project
99
+ found = record_decision(tmp_path, prepare)
100
+ draft = checklist_proposal(proposal, found, evaluate(tmp_path, found))
101
+ draft["checklist"]["results"]["API-01"].update(result=status, unresolved=["Provider result not established"])
102
+ with pytest.raises(ValueError, match=f"API-01={status}"):
103
+ finalize(tmp_path, draft)
104
+ assert finalize(tmp_path, {**draft, "classification": "BLOCKED", "actions": []})["state"] == "BLOCKED"
105
+ code, output = command("workflow", "engineering-decision", "--root", str(tmp_path), "--inspect", "ED-1")
106
+ assert code == 0 and json.loads(output)["checklist_pending"] == {"API-01": status}
107
+ with pytest.raises(ValueError, match="DETERMINED"):
108
+ require_decision(tmp_path, "WI-1", "retry", "ED-1")
109
+
110
+
111
+ def test_required_api_check_refuses_nonapplicability_even_with_reason(tmp_path, checklist_project):
112
+ _, proposal, prepare, _, _ = checklist_project
113
+ found = record_decision(tmp_path, prepare)
114
+ draft = checklist_proposal(proposal, found, evaluate(tmp_path, found))
115
+ draft["checklist"]["results"]["API-04"].update(result="NOT_APPLICABLE", applicability="not_applicable",
116
+ reason="The producer says it is unnecessary")
117
+ with pytest.raises(ValueError, match="API-04.*applicability"):
118
+ finalize(tmp_path, draft)
119
+ draft["checklist"]["results"]["API-04"]["reason"] = ""
120
+ with pytest.raises(ValueError, match="API-04.*reason"):
121
+ finalize(tmp_path, draft)
122
+
123
+
124
+ def test_checklist_evaluator_cannot_act_as_independent_reviewer(tmp_path, checklist_project):
125
+ _, proposal, prepare, _, authorize = checklist_project
126
+ found = record_decision(tmp_path, prepare)
127
+ draft = checklist_proposal(proposal, found, evaluate(tmp_path, found), evaluator="reviewer")
128
+ authorize(found, draft)
129
+ with pytest.raises(ValueError, match="independent review"):
130
+ finalize(tmp_path, draft)
131
+
132
+
133
+ def test_serial_state_can_record_reasoned_nonapplicability(tmp_path, checklist_project):
134
+ policy, proposal, prepare, update, authorize = checklist_project
135
+ policy["catalog"][GLOBAL]["discovery"] = metadata("consistency invariants transactions")
136
+ update()
137
+ found = record_decision(tmp_path, {**prepare, "decision_context": discovery_context(
138
+ category="state_management", state_management="yes", concurrency="no")})
139
+ draft = checklist_proposal(proposal, found, evaluate(tmp_path, found))
140
+ na = draft["checklist"]["results"]["CON-02"]
141
+ assert na["result"] == "NOT_APPLICABLE"
142
+ na["reason"] = ""
143
+ with pytest.raises(ValueError, match="CON-02.*reason"):
144
+ finalize(tmp_path, draft)
145
+ na["reason"] = "An exclusive single writer is verified by the integration test"
146
+ authorize(found, draft)
147
+ assert finalize(tmp_path, draft)["state"] == "DETERMINED"
148
+
149
+
150
+ def test_definition_change_requires_new_selection(tmp_path, checklist_project, monkeypatch):
151
+ _, proposal, prepare, _, authorize = checklist_project
152
+ found = record_decision(tmp_path, prepare)
153
+ draft = checklist_proposal(proposal, found, evaluate(tmp_path, found))
154
+ authorize(found, draft)
155
+ finalize(tmp_path, draft)
156
+ definitions = json.loads(decision_checklist.DEFINITIONS.read_bytes())
157
+ definitions["revision"] = "future"
158
+ replacement = tmp_path / "checklist-definition.json"
159
+ replacement.write_text(json.dumps(definitions), encoding="utf-8")
160
+ monkeypatch.setattr(decision_checklist, "DEFINITIONS", replacement)
161
+ with pytest.raises(ValueError, match="checklist definition changed"):
162
+ require_decision(tmp_path, "WI-1", "retry", "ED-1")
163
+
164
+
165
+ @pytest.mark.parametrize("change", ["candidate", "decision", "xid", "evidence"])
166
+ def test_stale_checklist_rejected_after_changes(tmp_path, checklist_project, change):
167
+ policy, proposal, prepare, update, authorize = checklist_project
168
+ found = record_decision(tmp_path, prepare)
169
+ draft = checklist_proposal(proposal, found, evaluate(tmp_path, found))
170
+ if change == "evidence":
171
+ proof = pinned(tmp_path, "idempotency.md", "Synthetic checklist evidence")
172
+ draft["checklist"]["results"]["API-04"]["evidence"] = [proof]
173
+ authorize(found, draft)
174
+ finalize(tmp_path, draft)
175
+ if change == "decision":
176
+ found = record_decision(tmp_path, {**prepare, "decision_id": "ED-2", "supersedes": "ED-1",
177
+ "decision_context": discovery_context(target="Changed target")})
178
+ resolved = evaluate(tmp_path, found)
179
+ altered = {**draft, "reference_set_sha256": resolved["reference_set_sha256"]}
180
+ with pytest.raises(ValueError, match="checklist must bind"):
181
+ record_decision(tmp_path, {"action": "review", "decision_id": "ED-2", "proposal": altered})
182
+ elif change == "xid":
183
+ policy["catalog"][GLOBAL]["revision"] = "r2"
184
+ update()
185
+ elif change == "candidate":
186
+ (tmp_path / "design.md").write_text("New candidate", encoding="utf-8")
187
+ else:
188
+ (tmp_path / "idempotency.md").write_text("New evidence", encoding="utf-8")
189
+ with pytest.raises(ValueError, match="superseded|context changed|digest mismatch"):
190
+ require_decision(tmp_path, "WI-1", "retry", "ED-1")
191
+
192
+
193
+ def test_non_enrolled_gate_retains_proposal_shape(tmp_path, discovery_project):
194
+ policy, proposal, prepare, update, authorize = discovery_project
195
+ found = record_decision(tmp_path, prepare)
196
+ draft = proposal_with(proposal, evaluate(tmp_path, found))
197
+ authorize(found, draft)
198
+ finalize(tmp_path, draft)
199
+ assert "checklist_sha256" not in require_decision(tmp_path, "WI-1", "retry", "ED-1")
200
+ policy["checklist"] = True
201
+ update()
202
+ with pytest.raises(ValueError, match="checklist policy changed"):
203
+ require_decision(tmp_path, "WI-1", "retry", "ED-1")
@@ -0,0 +1,261 @@
1
+ from concurrent.futures import ThreadPoolExecutor
2
+ import copy
3
+ import hashlib
4
+ import json
5
+ from pathlib import Path
6
+
7
+ import pytest
8
+
9
+ from test_skill_definition_runtime import _definition
10
+ from test_subagent_startup import command
11
+ from xrefkit.decision_handoff import RESUME_CHECKS, _digest, apply_transition
12
+ from xrefkit.discovery import DiscoveredSkillPackage
13
+ from xrefkit.loaders import load_package_manifest
14
+ from xrefkit.skillrun import _observation_events
15
+
16
+
17
+ def cli(*args, expected=0):
18
+ code, output = command(*map(str, args), "--json")
19
+ assert code == expected, output
20
+ return json.loads(output)
21
+
22
+
23
+ def item(log, item_id, role, status="pending"):
24
+ cli("skill", "workitem", "--log", log, "--item", item_id, "--text", "Review work",
25
+ "--completion-criterion", "evidence checked", "--status", status, "--role", role)
26
+
27
+
28
+ @pytest.fixture
29
+ def pair(tmp_path, monkeypatch):
30
+ brownfield = (Path(__file__).resolve().parents[1] / "packages/xrefkit-skills-brownfield"
31
+ / "src/xrefkit_skills_brownfield")
32
+ manifest = brownfield / "package_manifest.yaml"
33
+ discovered = DiscoveredSkillPackage("brownfield", brownfield, manifest, load_package_manifest(manifest))
34
+ monkeypatch.setattr("xrefkit.discovery.discover_skill_packages", lambda: [discovered])
35
+ parent, source, pm = [tmp_path / name for name in ("parent.md", "brownfield.md", "pm.md")]
36
+ parent_run = cli("workflow", "run", "--root", tmp_path, "--task", "Review the fixture",
37
+ "--out", parent, "--use-default-completion-conditions")
38
+ definition = tmp_path / "SKILL.v1.md"
39
+ definition.write_text(_definition().replace("definition_sample", "work_progress_coordination"), encoding="utf-8")
40
+ options = ("--capability", "bounded review", "--tuning", "fixture", "--responsibility", "report evidence",
41
+ "--execution-mode", "subagent_required")
42
+ item(parent, "DESIGN", "instruction:executor")
43
+ item(parent, "PM", "instruction:executor")
44
+ source_run = cli("workflow", "delegate", "--root", tmp_path, "--parent-log", parent,
45
+ "--work-item-id", "DESIGN", "--out", source, "--task", "Find the decision",
46
+ "--package-skill", "xrefkit.skills.brownfield::brownfield.workflow", *options)
47
+ pm_run = cli("workflow", "delegate", "--root", tmp_path, "--parent-log", parent,
48
+ "--work-item-id", "PM", "--out", pm, "--task", "Route the decision",
49
+ "--definition", definition, *options)
50
+ item(source, "WORK", "brownfield.workflow:executor")
51
+ (tmp_path / "finding.json").write_text('{"reference":"f1"}', encoding="utf-8")
52
+ cli("skill", "artifact", "--log", source, "--artifact", "FINDING",
53
+ "--kind", "output", "--target", "finding.json", "--item", "WORK",
54
+ "--status", "done", "--role", "brownfield.workflow:executor")
55
+ return parent, source, pm, parent_run["run_id"], source_run["run_id"], pm_run["run_id"]
56
+
57
+
58
+ @pytest.fixture
59
+ def request_protocol(tmp_path, pair):
60
+ parent, source, pm, _, source_id, _ = pair
61
+ journal = tmp_path / "decisions.sqlite"
62
+ current = {
63
+ "work_item_id": "WORK", "work_revision": "work-2", "policy_revision": "policy-2",
64
+ "policy_sha256": "a" * 64, "decision_owner": "design-owner",
65
+ }
66
+ request = {
67
+ **{key: current[key] for key in ("work_item_id", "work_revision", "policy_revision", "policy_sha256")},
68
+ "source_run_id": source_id, "pm_work_item_id": "PM", "pm_skill_id": "work_progress_coordination",
69
+ "subject": "Is replay allowed after a missing receipt?", "evidence": ["finding.json#f1"],
70
+ "source_artifact_id": "FINDING",
71
+ "source_artifact_sha256": hashlib.sha256((tmp_path / "finding.json").read_bytes()).hexdigest(),
72
+ "unknowns": ["U-provider", "U-budget"],
73
+ }
74
+
75
+ def transition(action, data=None, *, revision=None, actor=None):
76
+ return apply_transition(tmp_path, journal, {
77
+ "schema_version": 1, "request_id": "DR-1", "action": action,
78
+ "parent_log": str(parent), "run_log": str(actor or (pm if action in {"receive", "route", "return"} else source)),
79
+ "current": current if revision is None else revision, "data": {} if data is None else data,
80
+ })
81
+
82
+ return transition, request, current
83
+
84
+
85
+ def start(transition, request):
86
+ assert transition("create", request)["state"] == "prepared"
87
+ assert transition("send")["state"] == "sent"
88
+
89
+
90
+ def route(transition, owner="design-owner"):
91
+ assert transition("route", {"owner": owner, "reason": "Reserved judgment", "evidence": ["routing"]})["state"] == "waiting"
92
+
93
+
94
+ def test_pending_source_sends_once_and_concurrent_receive_is_idempotent(pair, request_protocol):
95
+ transition, request, _ = request_protocol
96
+ _, source, _, *_ = pair
97
+ before = source.read_bytes()
98
+ start(transition, request)
99
+ with ThreadPoolExecutor(max_workers=2) as workers:
100
+ receipts = list(workers.map(lambda _: transition("receive"), range(2)))
101
+ assert {result["reused"] for result in receipts} == {False, True}
102
+ assert receipts[0]["receipt"] == receipts[1]["receipt"]
103
+ assert transition("send")["state"] == "received"
104
+ assert transition("create", request)["reused"]
105
+ assert source.read_bytes() == before
106
+ assert "## Closure Gate\n\n- status: `pending`" in source.read_text(encoding="utf-8")
107
+
108
+
109
+ @pytest.mark.parametrize("field,value", [("work_revision", "work-1"), ("policy_revision", "policy-1"),
110
+ ("policy_sha256", "b" * 64)])
111
+ def test_stale_and_conflicting_requests_are_refused(request_protocol, field, value):
112
+ transition, request, current = request_protocol
113
+ with pytest.raises(ValueError, match="current Work Item and design policy"):
114
+ transition("create", {**request, field: value})
115
+ start(transition, request)
116
+ with pytest.raises(ValueError, match="conflicting"):
117
+ transition("create", {**request, "subject": "Conflicting subject"})
118
+ with pytest.raises(ValueError, match="current Work Item and design policy"):
119
+ transition("receive", revision={**current, field: value})
120
+ assert transition("receive")["state"] == "received"
121
+
122
+
123
+ def test_unresolved_authority_can_return_hold_without_resuming(request_protocol, pair):
124
+ transition, request, current = request_protocol
125
+ start(transition, request)
126
+ with pytest.raises(ValueError, match="designated PM"):
127
+ transition("receive", actor=pair[1])
128
+ transition("receive")
129
+ current["decision_owner"] = None
130
+ route(transition, None)
131
+ held = {"disposition": "held", "reason": "Human authority still unknown", "evidence": ["missing owner"]}
132
+ assert transition("return", held)["state"] == "returned"
133
+ with pytest.raises(ValueError, match="original source"):
134
+ transition("acknowledge", actor=pair[2])
135
+ assert transition("acknowledge")["state"] == "acknowledged"
136
+ assessment = {"outcome": "resume", "evidence": ["impact review"], "resolved_unknowns": {}}
137
+ with pytest.raises(ValueError, match="resume prerequisites"):
138
+ transition("assess", assessment)
139
+ assert transition("assess", {**assessment, "outcome": "hold"})["state"] == "assessed"
140
+
141
+
142
+ def test_decision_and_resume_require_exact_current_authority_and_evidence(request_protocol):
143
+ transition, request, current = request_protocol
144
+ start(transition, request)
145
+ transition("receive")
146
+ route(transition)
147
+ decision = {"disposition": "decided", "decision": "Proceed within approved limits",
148
+ "approval_ref": "approval-42", "evidence": ["scope evidence"]}
149
+ with pytest.raises(ValueError, match="scoped approval"):
150
+ transition("return", decision)
151
+ current["approval"] = {
152
+ **{key: current[key] for key in ("work_item_id", "work_revision", "policy_revision", "policy_sha256")},
153
+ "request_id": "DR-1", "authority": "design-owner", "status": "approved",
154
+ "reference": "approval-42", "decision_sha256": _digest(decision),
155
+ }
156
+ with pytest.raises(ValueError, match="scoped approval"):
157
+ transition("return", {**decision, "decision": "Outside limits"})
158
+ transition("return", decision)
159
+ wrong_owner = copy.deepcopy(current)
160
+ wrong_owner["approval"]["authority"] = "pm"
161
+ with pytest.raises(ValueError, match="scoped approval"):
162
+ transition("acknowledge", revision=wrong_owner)
163
+ transition("acknowledge")
164
+ assessment = {"outcome": "resume", "evidence": ["impact review"],
165
+ "resolved_unknowns": {"U-provider": "provider evidence", "U-budget": "budget evidence"}}
166
+ with pytest.raises(ValueError, match="resume prerequisites"):
167
+ transition("assess", assessment)
168
+ current["resume_checks"] = dict.fromkeys(RESUME_CHECKS, True)
169
+ with pytest.raises(ValueError, match="resume prerequisites"):
170
+ transition("assess", {**assessment, "resolved_unknowns": {}})
171
+ assert transition("assess", assessment)["receipt"]["data"]["outcome"] == "resume"
172
+
173
+
174
+ def test_cancel_preserves_journal_and_blocks_new_receipt(request_protocol, tmp_path):
175
+ transition, request, _ = request_protocol
176
+ start(transition, request)
177
+ assert transition("cancel", {"reason": "Superseded plan"})["state"] == "cancelled"
178
+ with pytest.raises(ValueError, match="cannot receive"):
179
+ transition("receive")
180
+ code, output = command("workflow", "decision-handoff", "--root", str(tmp_path),
181
+ "--journal", "decisions.sqlite", "--inspect", "DR-1")
182
+ assert code == 0, output
183
+ assert [receipt["sequence"] for receipt in json.loads(output)["receipts"]] == [1, 2, 3]
184
+
185
+
186
+ def test_cli_creates_receipt_and_reads_history(request_protocol, pair, tmp_path):
187
+ _, data, current = request_protocol
188
+ input_file = tmp_path / "create.json"
189
+ input_file.write_text(json.dumps({
190
+ "schema_version": 1, "action": "create", "request_id": "DR-CLI",
191
+ "parent_log": pair[0].name, "run_log": pair[1].name, "data": data, "current": current,
192
+ }), encoding="utf-8")
193
+ args = ("workflow", "decision-handoff", "--root", str(tmp_path), "--journal", "decisions.sqlite")
194
+ code, output = command(*args, "--input", input_file.name)
195
+ assert code == 0, output
196
+ created = json.loads(output)["receipt"]
197
+ code, output = command(*args, "--inspect", "DR-CLI")
198
+ assert code == 0, output
199
+ assert json.loads(output)["receipts"] == [created]
200
+
201
+
202
+ def test_send_refuses_changed_source_artifact_and_can_retry(request_protocol, tmp_path):
203
+ transition, request, _ = request_protocol
204
+ finding = tmp_path / "finding.json"
205
+ original = finding.read_bytes()
206
+ transition("create", request)
207
+ finding.write_text("changed", encoding="utf-8")
208
+ with pytest.raises(ValueError, match="finding artifact"):
209
+ transition("send")
210
+ finding.write_bytes(original)
211
+ assert transition("send")["state"] == "sent"
212
+
213
+
214
+ def test_reconcile_counts_typed_runs_but_requires_host_completion(pair):
215
+ parent, source, pm, parent_id, _, pm_id = pair
216
+ cli("workflow", "reconcile", "--log", parent, "--apply-child-status", expected=1)
217
+ trace = _observation_events(parent.read_text(encoding="utf-8"))
218
+ assert [event["skill_id"] for event in trace if event["event"] == "child_run.started"] == [
219
+ "brownfield.workflow", "work_progress_coordination",
220
+ ]
221
+ assert trace[-1]["child_run_count"] == 2
222
+ assert not trace[-1]["child_status_updates"]
223
+ assert any("lacks verified host completion evidence" in finding for finding in trace[-1]["findings"])
224
+ assert source.exists()
225
+
226
+ role = "work_progress_coordination"
227
+ item(pm, "HANDLE", role + ":executor", "done")
228
+ for kind in ("output", "evidence"):
229
+ cli("skill", "artifact", "--log", pm, "--artifact", kind.upper(), "--kind", kind,
230
+ "--target", kind + ".json", "--item", "HANDLE", "--status", "done",
231
+ "--role", role + (":executor" if kind == "output" else ":checker"))
232
+ for phase, user in (("execution", "executor"), ("handoff", "handoff_owner")):
233
+ cli("skill", "phase", "--log", pm, "--phase", phase, "--status", "done", "--role", role + ":" + user)
234
+ assert any("host completion" in error for error in
235
+ cli("skill", "verify", "--log", pm, expected=1)["errors"])
236
+ assert any("host completion" in error for error in
237
+ cli("skill", "close", "--log", pm, expected=1)["errors"])
238
+ blocked = cli("workflow", "reconcile", "--log", parent, "--apply-child-status", expected=1)
239
+ assert {item["item_id"]: item["status"] for item in blocked["work_items"]}["PM"] == "pending"
240
+
241
+ receipt_path = pm.with_suffix(".json")
242
+ receipt = {"schema_version": 1, "run_id": pm_id, "parent_run_id": parent_id,
243
+ "flow_id": parent_id, "root_run_id": parent_id, "work_item_id": "PM",
244
+ "invocation_id": "synthetic-host-execution", "outcome": "succeeded",
245
+ "started_at": "2026-11-22T06:00:00Z", "completed_at": "2026-11-22T06:00:03Z"}
246
+ receipt_path.write_text(json.dumps({**receipt, "work_item_id": "DESIGN"}), encoding="utf-8")
247
+ cli("workflow", "record-child-execution", "--root", pm.parent,
248
+ "--log", pm, "--receipt", receipt_path, expected=1)
249
+ receipt_path.write_text(json.dumps(receipt), encoding="utf-8")
250
+ assert not cli("workflow", "record-child-execution", "--root", pm.parent,
251
+ "--log", pm, "--receipt", receipt_path)["reused"]
252
+ assert cli("workflow", "record-child-execution", "--root", pm.parent,
253
+ "--log", pm, "--receipt", receipt_path)["reused"]
254
+ receipt_path.write_text(json.dumps({**receipt, "invocation_id": "other"}), encoding="utf-8")
255
+ blocked = cli("workflow", "reconcile", "--log", parent, "--apply-child-status", expected=1)
256
+ assert {item["item_id"]: item["status"] for item in blocked["work_items"]}["PM"] == "pending"
257
+ receipt_path.write_text(json.dumps(receipt), encoding="utf-8")
258
+ cli("skill", "verify", "--log", pm)
259
+ cli("skill", "close", "--log", pm)
260
+ reconciled = cli("workflow", "reconcile", "--log", parent, "--apply-child-status", expected=1)
261
+ assert {item["item_id"]: item["status"] for item in reconciled["work_items"]} == {"DESIGN": "pending", "PM": "done"}