xrefkit 0.7.13__tar.gz → 0.7.15__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 (289) hide show
  1. {xrefkit-0.7.13/xrefkit.egg-info → xrefkit-0.7.15}/PKG-INFO +12 -2
  2. {xrefkit-0.7.13 → xrefkit-0.7.15}/README.md +10 -0
  3. {xrefkit-0.7.13 → xrefkit-0.7.15}/pyproject.toml +3 -3
  4. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_azure_connection.py +8 -7
  5. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_azure_import.py +3 -2
  6. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_azure_recovery.py +5 -4
  7. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_azure_writer.py +4 -3
  8. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_ci_workflow_invariants.py +4 -1
  9. xrefkit-0.7.15/tests/test_environment_isolation.py +61 -0
  10. xrefkit-0.7.15/tests/test_mcp_skills_extension.py +123 -0
  11. xrefkit-0.7.15/tests/test_mcp_skills_transport.py +113 -0
  12. xrefkit-0.7.15/tests/test_skill_knowledge_audit.py +146 -0
  13. xrefkit-0.7.15/tests/test_verify_runtime_wheel.py +51 -0
  14. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/__init__.py +1 -1
  15. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/cli.py +5 -0
  16. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/server.py +5 -2
  17. xrefkit-0.7.15/xrefkit/mcp/skills_extension.py +178 -0
  18. xrefkit-0.7.15/xrefkit/mcp/skills_transport.py +138 -0
  19. xrefkit-0.7.15/xrefkit/skill_knowledge_audit.html +231 -0
  20. xrefkit-0.7.15/xrefkit/skill_knowledge_audit.py +292 -0
  21. {xrefkit-0.7.13 → xrefkit-0.7.15/xrefkit.egg-info}/PKG-INFO +12 -2
  22. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit.egg-info/SOURCES.txt +9 -0
  23. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit.egg-info/requires.txt +1 -1
  24. {xrefkit-0.7.13 → xrefkit-0.7.15}/LICENSE +0 -0
  25. {xrefkit-0.7.13 → xrefkit-0.7.15}/setup.cfg +0 -0
  26. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_artifact_selected_family.py +0 -0
  27. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_attention_pet.py +0 -0
  28. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_attention_pet_client_protocol.py +0 -0
  29. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_attention_pet_codex_session.py +0 -0
  30. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_attention_pet_fit.py +0 -0
  31. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_azure_update_candidate.py +0 -0
  32. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_boundary_analysis.py +0 -0
  33. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_brownfield_csharp_structure_definitions.py +0 -0
  34. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_brownfield_file_editing_protocol.py +0 -0
  35. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_business_intake_conversation_definitions.py +0 -0
  36. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_business_intake_definition.py +0 -0
  37. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_calibration_lint.py +0 -0
  38. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_catalog_preparation_definition.py +0 -0
  39. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_check_skill_knowledge_xids.py +0 -0
  40. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_cli.py +0 -0
  41. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_code_constraint_definition.py +0 -0
  42. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_collect_analyzer_sarif.py +0 -0
  43. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_compact_skill_logs.py +0 -0
  44. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_constraint_derivation_family_definition.py +0 -0
  45. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_constraint_derivation_selected_family.py +0 -0
  46. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_contribution_adoption_bytes.py +0 -0
  47. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_contribution_returns.py +0 -0
  48. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_convert_to_xrefkit_skill.py +0 -0
  49. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_cs_scope_probe.py +0 -0
  50. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_csharp_commonality.py +0 -0
  51. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_csharp_naming_profile.py +0 -0
  52. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_ctx.py +0 -0
  53. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_cutover_readiness.py +0 -0
  54. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_dashboard.py +0 -0
  55. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_database_batch_definition_migration.py +0 -0
  56. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_decision_checklist.py +0 -0
  57. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_decision_handoff.py +0 -0
  58. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_decision_trace.py +0 -0
  59. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_design_business_intake_selected_family.py +0 -0
  60. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_design_planning_definition_migration.py +0 -0
  61. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_dotnet_definition_candidate.py +0 -0
  62. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_editorial_family_definition.py +0 -0
  63. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_editorial_intake_definition.py +0 -0
  64. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_editorial_selected_family.py +0 -0
  65. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_embedded_startup_pack.py +0 -0
  66. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_engineering_decision.py +0 -0
  67. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_error_policy_audit.py +0 -0
  68. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_error_policy_locator.py +0 -0
  69. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_execution_binding.py +0 -0
  70. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_existing_skill_definition_batch.py +0 -0
  71. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_final_skilldefinition_batch.py +0 -0
  72. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_flow_selected_family.py +0 -0
  73. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_fm_multiroot.py +0 -0
  74. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_gate.py +0 -0
  75. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_gateway.py +0 -0
  76. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_gateway_mcp.py +0 -0
  77. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_gateway_skill_adapter.py +0 -0
  78. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_gateway_work_items.py +0 -0
  79. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_goal_desired_state.py +0 -0
  80. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_governance_entry.py +0 -0
  81. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_governance_host.py +0 -0
  82. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_host_precheck.py +0 -0
  83. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_human_evaluation.py +0 -0
  84. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_implementation_flow_definition.py +0 -0
  85. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_implementation_review_selected_family.py +0 -0
  86. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_inbound_uploads.py +0 -0
  87. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_instruction_workflow.py +0 -0
  88. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_knowledge_relations_validator.py +0 -0
  89. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_language_review_definition.py +0 -0
  90. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_legacy_guidance.py +0 -0
  91. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_legacy_migration.py +0 -0
  92. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_legacy_resources.py +0 -0
  93. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_mcp_package_routing.py +0 -0
  94. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_mcp_setup.py +0 -0
  95. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_mcp_subagent_startup.py +0 -0
  96. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_mcp_subagent_startup_integration.py +0 -0
  97. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_ontology_assessment_validator.py +0 -0
  98. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_os_family_definition.py +0 -0
  99. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_os_knowledge_family_definition.py +0 -0
  100. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_os_selected_family.py +0 -0
  101. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_ownership.py +0 -0
  102. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_package_knowledge_resolution.py +0 -0
  103. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_package_skill_run.py +0 -0
  104. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_packaged_native_governance.py +0 -0
  105. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_packmeta.py +0 -0
  106. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_plan_markdown.py +0 -0
  107. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_plan_observation.py +0 -0
  108. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_principle_discovery.py +0 -0
  109. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_project_management_materialization.py +0 -0
  110. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_project_management_offline_progress.py +0 -0
  111. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_project_quality_baseline.py +0 -0
  112. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_qa_report_definition.py +0 -0
  113. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_quality_issue_dashboard.py +0 -0
  114. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_quality_issues.py +0 -0
  115. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_reporting_profiles.py +0 -0
  116. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_reporting_quality.py +0 -0
  117. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_repository_skill_adoption.py +0 -0
  118. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_repository_startup_pack.py +0 -0
  119. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_resource_provider.py +0 -0
  120. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_runtime_contracts.py +0 -0
  121. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_sarif_to_locator.py +0 -0
  122. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_security_definition_migration.py +0 -0
  123. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_site_release_metadata.py +0 -0
  124. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_skill_definition.py +0 -0
  125. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_skill_definition_governance.py +0 -0
  126. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_skill_definition_mcp.py +0 -0
  127. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_skill_definition_runtime.py +0 -0
  128. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_skill_edits.py +0 -0
  129. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_skill_maturity_return.py +0 -0
  130. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_skill_release_compatibility.py +0 -0
  131. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_skill_runtime_audit.py +0 -0
  132. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_skillmeta.py +0 -0
  133. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_skills_sync.py +0 -0
  134. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_source_analysis_fragments.py +0 -0
  135. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_structure_catalog.py +0 -0
  136. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_subagent_startup.py +0 -0
  137. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_subagent_startup_boundaries.py +0 -0
  138. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_unknown_resolution.py +0 -0
  139. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_wbs.py +0 -0
  140. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_work_management.py +0 -0
  141. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_work_packages.py +0 -0
  142. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_workflow_family_definition.py +0 -0
  143. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_xref.py +0 -0
  144. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_xrefkit_instance.py +0 -0
  145. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_xrefkit_tools.py +0 -0
  146. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_xrefkit_v2_discovery.py +0 -0
  147. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_xrefkit_v2_models.py +0 -0
  148. {xrefkit-0.7.13 → xrefkit-0.7.15}/tests/test_xrefkit_v2_pipeline.py +0 -0
  149. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/__main__.py +0 -0
  150. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/attention_pet/__init__.py +0 -0
  151. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/attention_pet/__main__.py +0 -0
  152. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/attention_pet/client.py +0 -0
  153. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/attention_pet/client_protocol.py +0 -0
  154. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/attention_pet/codex_session.py +0 -0
  155. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/attention_pet/evaluator.py +0 -0
  156. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/attention_pet/model.py +0 -0
  157. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/attention_pet/presentation.py +0 -0
  158. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/attention_pet/profiles.py +0 -0
  159. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/attention_pet/scenarios.py +0 -0
  160. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/attention_pet/server.py +0 -0
  161. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/attention_pet/store.py +0 -0
  162. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/azure_connection.py +0 -0
  163. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/azure_import.py +0 -0
  164. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/azure_recovery.py +0 -0
  165. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/azure_update_candidate.py +0 -0
  166. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/azure_writer.py +0 -0
  167. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/boundary_analysis.py +0 -0
  168. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/catalog_cli.py +0 -0
  169. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/contracts.py +0 -0
  170. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/ctx.py +0 -0
  171. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/dashboard.py +0 -0
  172. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/decision_checklist.py +0 -0
  173. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/decision_handoff.py +0 -0
  174. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/decision_trace.py +0 -0
  175. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/discovery.py +0 -0
  176. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/engineering_decision.py +0 -0
  177. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/execution_binding.py +0 -0
  178. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/execution_binding_cli.py +0 -0
  179. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/gate.py +0 -0
  180. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/gateway.py +0 -0
  181. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/goalstate.py +0 -0
  182. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/governance_entry.py +0 -0
  183. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/governance_entry_cli.py +0 -0
  184. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/governance_host.py +0 -0
  185. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/hashing.py +0 -0
  186. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/host_execution.py +0 -0
  187. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/host_precheck.py +0 -0
  188. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/import_skill.py +0 -0
  189. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/instance.py +0 -0
  190. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/loaders.py +0 -0
  191. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/__init__.py +0 -0
  192. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/audit.py +0 -0
  193. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/bootstrap.py +0 -0
  194. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/catalog.py +0 -0
  195. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/cli.py +0 -0
  196. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/client_cache.py +0 -0
  197. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/client_flow.py +0 -0
  198. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/context_registry.py +0 -0
  199. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/context_token.py +0 -0
  200. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/contracts.py +0 -0
  201. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/contribution_adoption.py +0 -0
  202. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/contribution_returns.py +0 -0
  203. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/dist.py +0 -0
  204. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/gateway.py +0 -0
  205. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/governed_overlays.py +0 -0
  206. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/inbound_uploads.py +0 -0
  207. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/knowledge_edits.py +0 -0
  208. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/legacy_guidance.py +0 -0
  209. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/legacy_migration.py +0 -0
  210. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/legacy_resources.py +0 -0
  211. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/ownership.py +0 -0
  212. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/repository.py +0 -0
  213. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/schemas.py +0 -0
  214. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/setup.py +0 -0
  215. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/skill_edits.py +0 -0
  216. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/skill_maturity.py +0 -0
  217. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/startup_contract_pack.py +0 -0
  218. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/subagent_startup.py +0 -0
  219. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp/update_gate_intake.py +0 -0
  220. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/mcp_tools.py +0 -0
  221. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/models/__init__.py +0 -0
  222. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/models/common.py +0 -0
  223. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/models/effective_bundle.py +0 -0
  224. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/models/human_evaluation.py +0 -0
  225. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/models/local_manifest.py +0 -0
  226. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/models/package_manifest.py +0 -0
  227. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/models/run_log.py +0 -0
  228. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/models/server_config.py +0 -0
  229. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/models/skill_definition.py +0 -0
  230. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/operations_cli.py +0 -0
  231. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/ownership.py +0 -0
  232. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/packmeta.py +0 -0
  233. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/plan_markdown.py +0 -0
  234. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/plan_observation.py +0 -0
  235. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/principle_discovery.py +0 -0
  236. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/quality_issues.py +0 -0
  237. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/registry.py +0 -0
  238. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/reporting.py +0 -0
  239. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/reporting_profiles.py +0 -0
  240. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/repository_skills.py +0 -0
  241. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resolver.py +0 -0
  242. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resource_provider.py +0 -0
  243. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/attention_pet/client-state.schema.json +0 -0
  244. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/attention_pet/pet.css +0 -0
  245. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/attention_pet/pet.html +0 -0
  246. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/attention_pet/pet.js +0 -0
  247. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/contracts.json +0 -0
  248. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/current.json +0 -0
  249. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/generations/7a682a5272907354/contracts.json +0 -0
  250. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/generations/7a682a5272907354/model_body.md +0 -0
  251. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/generations/9929294385ccb7b0/contracts.json +0 -0
  252. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/generations/9929294385ccb7b0/model_body.md +0 -0
  253. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/model_body.md +0 -0
  254. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/startup_sources/000_agent_entry.md +0 -0
  255. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/startup_sources/011_startup_xref_routing.md +0 -0
  256. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/startup_sources/015_shared_memory_operations.md +0 -0
  257. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/startup_sources/016_uncertainty_protocol.md +0 -0
  258. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/startup_sources/017_base_and_xref_layering.md +0 -0
  259. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/startup_sources/053_context_direction_security_guard.md +0 -0
  260. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/base/startup_sources/yomiyasu_LICENSE.txt +0 -0
  261. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/engineering-decision-checklist.json +0 -0
  262. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/migration/docs/guides/062_legacy_flow_skill_migration_guide.md +0 -0
  263. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/migration/knowledge/operations/130_legacy_flow_skill_migration_rules.md +0 -0
  264. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/migration/knowledge/organization/160_context_direction_guard_rules.md +0 -0
  265. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/migration/skills/os/legacy_flow_skill_migration/SKILL.v1.md +0 -0
  266. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/migration/skills/os/legacy_flow_skill_migration/references/legacy_flow_skill_migration_template.md +0 -0
  267. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/migration/skills/repository_adoption.json +0 -0
  268. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/resources/migration/tools/migrate_legacy_flow_skill.py +0 -0
  269. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/runlog.py +0 -0
  270. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/skill_definition.py +0 -0
  271. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/skill_definition_catalog.py +0 -0
  272. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/skill_definition_governance.py +0 -0
  273. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/skillmeta.py +0 -0
  274. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/skillrun.py +0 -0
  275. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/skills_sync.py +0 -0
  276. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/structure_catalog.py +0 -0
  277. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/subagent_startup.py +0 -0
  278. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/tools/__init__.py +0 -0
  279. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/tools/__main__.py +0 -0
  280. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/unknown_resolution.py +0 -0
  281. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/v2_cli.py +0 -0
  282. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/wbs.py +0 -0
  283. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/work_management.py +0 -0
  284. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/work_management_view.py +0 -0
  285. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/workspace.py +0 -0
  286. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit/xref.py +0 -0
  287. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit.egg-info/dependency_links.txt +0 -0
  288. {xrefkit-0.7.13 → xrefkit-0.7.15}/xrefkit.egg-info/entry_points.txt +0 -0
  289. {xrefkit-0.7.13 → xrefkit-0.7.15}/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.13
3
+ Version: 0.7.15
4
4
  Summary: Portable XID, Skill, Knowledge, workflow, and MCP runtime for XRefKit
5
5
  Author: synthaicode
6
6
  License: MIT License
@@ -31,7 +31,7 @@ License-File: LICENSE
31
31
  Requires-Dist: PyYAML<7,>=6.0.2
32
32
  Requires-Dist: pydantic<3,>=2.0
33
33
  Provides-Extra: mcp
34
- Requires-Dist: mcp<2,>=1.0.0; extra == "mcp"
34
+ Requires-Dist: mcp<2,>=1.28.0; extra == "mcp"
35
35
  Requires-Dist: uvicorn>=0.30; extra == "mcp"
36
36
  Provides-Extra: test
37
37
  Requires-Dist: pytest>=8.0.0; extra == "test"
@@ -50,6 +50,16 @@ can understand and check.
50
50
 
51
51
  ![Five sources of cognitive load and XRefKit's supporting mechanisms, with reports connecting conclusion, evidence, limits, and next action.](human-docs/en/assets/why_xrefkit_needed/whatis_xrefkit.png)
52
52
 
53
+ ## Inspect Skill and Knowledge links
54
+
55
+ From the repository you want to inspect, run:
56
+
57
+ ```shell
58
+ xrefkit skill-knowledge-audit
59
+ ```
60
+
61
+ Open `work/skill-knowledge-audit.html` to browse by Pack, Skill or Knowledge and inspect broken XIDs. Use `--root` to select another repository, `--html` to choose the report location, and `--json` to export the audit data.
62
+
53
63
  ## Why faster AI output can still mean more work for you
54
64
 
55
65
  Generating a result leaves another task: understanding enough of it to decide
@@ -11,6 +11,16 @@ can understand and check.
11
11
 
12
12
  ![Five sources of cognitive load and XRefKit's supporting mechanisms, with reports connecting conclusion, evidence, limits, and next action.](human-docs/en/assets/why_xrefkit_needed/whatis_xrefkit.png)
13
13
 
14
+ ## Inspect Skill and Knowledge links
15
+
16
+ From the repository you want to inspect, run:
17
+
18
+ ```shell
19
+ xrefkit skill-knowledge-audit
20
+ ```
21
+
22
+ Open `work/skill-knowledge-audit.html` to browse by Pack, Skill or Knowledge and inspect broken XIDs. Use `--root` to select another repository, `--html` to choose the report location, and `--json` to export the audit data.
23
+
14
24
  ## Why faster AI output can still mean more work for you
15
25
 
16
26
  Generating a result leaves another task: understanding enough of it to decide
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "xrefkit"
7
- version = "0.7.13"
7
+ version = "0.7.15"
8
8
  description = "Portable XID, Skill, Knowledge, workflow, and MCP runtime for XRefKit"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -16,7 +16,7 @@ dependencies = [
16
16
  ]
17
17
 
18
18
  [project.optional-dependencies]
19
- mcp = ["mcp>=1.0.0,<2", "uvicorn>=0.30"]
19
+ mcp = ["mcp>=1.28.0,<2", "uvicorn>=0.30"]
20
20
  test = ["pytest>=8.0.0"]
21
21
 
22
22
  [project.scripts]
@@ -27,7 +27,7 @@ where = ["."]
27
27
  include = ["xrefkit*"]
28
28
 
29
29
  [tool.setuptools.package-data]
30
- xrefkit = ["resources/**/*"]
30
+ xrefkit = ["resources/**/*", "skill_knowledge_audit.html"]
31
31
 
32
32
  [tool.pytest.ini_options]
33
33
  testpaths = ["tests"]
@@ -9,6 +9,7 @@ from contextlib import redirect_stdout, redirect_stderr
9
9
  from pathlib import Path
10
10
  from urllib.error import HTTPError, URLError
11
11
  from unittest.mock import patch
12
+ from environment_helpers import mock_environment
12
13
 
13
14
  from xrefkit.azure_connection import MAX_BYTES, _NoRedirect, load_connection, main, read_check, register_connection, validate_profile
14
15
  from xrefkit.work_management import register_workspace
@@ -117,7 +118,7 @@ class AzureConnectionTests(unittest.TestCase):
117
118
 
118
119
  def test_missing_named_credential_has_no_other_env_fallback(self):
119
120
  self.register()
120
- with patch.dict("os.environ", {"AZURE_DEVOPS_PAT": CANARY}, clear=True), patch("xrefkit.azure_connection.build_opener") as network:
121
+ with mock_environment({"AZURE_DEVOPS_PAT": CANARY}, clear=True), patch("xrefkit.azure_connection.build_opener") as network:
121
122
  result = self.check()
122
123
  self.assertEqual("credential_unavailable", result["diagnostic_code"])
123
124
  self.assertFalse(result["network_attempted"])
@@ -135,7 +136,7 @@ class AzureConnectionTests(unittest.TestCase):
135
136
  self.assertEqual("Basic " + base64.b64encode((":" + CANARY).encode()).decode(), req.get_header("Authorization"))
136
137
  response = Response(req)
137
138
  return response
138
- with patch.dict("os.environ", {"EXPLICIT_TEST_PAT": CANARY}), patch("xrefkit.azure_connection.build_opener") as builder:
139
+ with mock_environment({"EXPLICIT_TEST_PAT": CANARY}), patch("xrefkit.azure_connection.build_opener") as builder:
139
140
  builder.return_value.open.side_effect = request
140
141
  result = self.check()
141
142
  builder.return_value.open.assert_called_once()
@@ -151,7 +152,7 @@ class AzureConnectionTests(unittest.TestCase):
151
152
  def test_http_failures_and_redirects_are_sanitized_without_retry(self):
152
153
  self.register()
153
154
  for status, code in ((401, "authentication_rejected"), (403, "access_forbidden"), (404, "unavailable_or_not_visible"), (302, "redirect_rejected"), (307, "redirect_rejected"), (429, "rate_limited"), (503, "server_failure")):
154
- with self.subTest(status=status), patch.dict("os.environ", {"EXPLICIT_TEST_PAT": CANARY}), patch("xrefkit.azure_connection.build_opener") as builder:
155
+ with self.subTest(status=status), mock_environment({"EXPLICIT_TEST_PAT": CANARY}), patch("xrefkit.azure_connection.build_opener") as builder:
155
156
  builder.return_value.open.side_effect = HTTPError("https://evil.test/" + CANARY, status, CANARY, {}, io.BytesIO(CANARY.encode()))
156
157
  result = self.check()
157
158
  self.assertEqual(code, result["diagnostic_code"])
@@ -165,7 +166,7 @@ class AzureConnectionTests(unittest.TestCase):
165
166
  echo = copy.deepcopy(base)
166
167
  echo["fields"]["System.State"] = CANARY
167
168
  for body in (b"invalid " + CANARY.encode(), b"x" * (MAX_BYTES + 1), json.dumps({**base, "id": 11}).encode(), json.dumps({**base, "fields": {"System.TeamProject": "other"}}).encode(), json.dumps(echo).encode()):
168
- with self.subTest(size=len(body)), patch.dict("os.environ", {"EXPLICIT_TEST_PAT": CANARY}), patch("xrefkit.azure_connection.build_opener") as builder:
169
+ with self.subTest(size=len(body)), mock_environment({"EXPLICIT_TEST_PAT": CANARY}), patch("xrefkit.azure_connection.build_opener") as builder:
169
170
  builder.return_value.open.side_effect = lambda req, timeout: Response(req, body)
170
171
  result = self.check()
171
172
  self.assertFalse(result["read_verified"])
@@ -174,18 +175,18 @@ class AzureConnectionTests(unittest.TestCase):
174
175
  def test_network_timeout_nonjson_and_unexpected_final_url_are_controlled(self):
175
176
  self.register()
176
177
  for error in (TimeoutError(CANARY), URLError(CANARY)):
177
- with patch.dict("os.environ", {"EXPLICIT_TEST_PAT": CANARY}), patch("xrefkit.azure_connection.build_opener") as builder:
178
+ with mock_environment({"EXPLICIT_TEST_PAT": CANARY}), patch("xrefkit.azure_connection.build_opener") as builder:
178
179
  builder.return_value.open.side_effect = error
179
180
  self.assertEqual("network_request_failed", self.check()["diagnostic_code"])
180
181
  for changes, code in (({"content_type": "text/html"}, "response_not_json"), ({"url": "https://evil.test"}, "response_destination_mismatch")):
181
- with patch.dict("os.environ", {"EXPLICIT_TEST_PAT": CANARY}), patch("xrefkit.azure_connection.build_opener") as builder:
182
+ with mock_environment({"EXPLICIT_TEST_PAT": CANARY}), patch("xrefkit.azure_connection.build_opener") as builder:
182
183
  builder.return_value.open.side_effect = lambda req, timeout: Response(req, **changes)
183
184
  self.assertEqual(code, self.check()["diagnostic_code"])
184
185
 
185
186
  def test_cli_never_echoes_secret_or_server_error_text(self):
186
187
  self.register()
187
188
  output = io.StringIO()
188
- with redirect_stdout(output), patch.dict("os.environ", {"EXPLICIT_TEST_PAT": CANARY}), patch("xrefkit.azure_connection.build_opener") as builder:
189
+ with redirect_stdout(output), mock_environment({"EXPLICIT_TEST_PAT": CANARY}), patch("xrefkit.azure_connection.build_opener") as builder:
189
190
  builder.return_value.open.side_effect = HTTPError(CANARY, 401, CANARY, {}, io.BytesIO(CANARY.encode()))
190
191
  status = main(["read-check", "--root", str(self.root), "--workspace-id", "local", "--connection-id", "test", "--item-id", "10"])
191
192
  self.assertEqual(1, status)
@@ -4,6 +4,7 @@ import json
4
4
  from pathlib import Path
5
5
  from urllib.error import HTTPError
6
6
  from unittest.mock import patch
7
+ from environment_helpers import mock_environment
7
8
 
8
9
  import pytest
9
10
 
@@ -55,7 +56,7 @@ def network(values=None, headers=None):
55
56
  value = values.get(item_id, payload(item_id)) if values is not None else payload(item_id)
56
57
  if isinstance(value, BaseException): raise value
57
58
  return Response(request, value, **(headers or {}))
58
- return patch.dict("os.environ", {"IMPORT_TEST_PAT": CANARY}), patch.object(module, "build_opener", return_value=Opener()), calls
59
+ return mock_environment({"IMPORT_TEST_PAT": CANARY}), patch.object(module, "build_opener", return_value=Opener()), calls
59
60
 
60
61
 
61
62
  def acquire(setup, values=None, request=None, headers=None):
@@ -230,7 +231,7 @@ def test_unexpected_body_continuation_metadata_is_rejected(setup, key):
230
231
  @pytest.mark.parametrize("mutation", ["attempted", "diagnostic", "failed_not_attempted", "bool_id", "outcome", "unknown_field"])
231
232
  def test_resealed_contradictory_receipts_are_not_accepted(setup, mutation):
232
233
  root, _, request, _, _, _ = setup
233
- with patch.dict("os.environ", {}, clear=True):
234
+ with mock_environment({}, clear=True):
234
235
  result = module.capture(root, "local", request)
235
236
  receipt = read_json(Path(result["output"]))
236
237
  if mutation == "attempted": receipt["items"][0]["network_attempted"] = True
@@ -3,6 +3,7 @@ import json
3
3
  from pathlib import Path
4
4
  from urllib.error import HTTPError
5
5
  from unittest.mock import patch
6
+ from environment_helpers import mock_environment
6
7
 
7
8
  import pytest
8
9
 
@@ -39,7 +40,7 @@ def publish_remote(setup, request=None, lost=False, intent_only=False, before=No
39
40
  return Response(req, payload(10))
40
41
  return Response(req, current)
41
42
  root, original, _, _ = setup
42
- with patch.dict("os.environ", {"IMPORT_TEST_PAT": CANARY}), patch.object(writer, "build_opener", return_value=Opener()):
43
+ with mock_environment({"IMPORT_TEST_PAT": CANARY}), patch.object(writer, "build_opener", return_value=Opener()):
43
44
  if intent_only:
44
45
  with pytest.raises(KeyboardInterrupt): writer.publish(root, "local", request or original)
45
46
  result = None
@@ -70,7 +71,7 @@ def reads(current, historical=None, *, fail_phase=None, error=None, mutation=Non
70
71
  value["url"] += "/revisions/" + str(value["rev"])
71
72
  if mutation: value = mutation(phase, value)
72
73
  return Response(req, value)
73
- return patch.dict("os.environ", {"IMPORT_TEST_PAT": CANARY}), patch.object(writer, "build_opener", return_value=Opener()), calls
74
+ return mock_environment({"IMPORT_TEST_PAT": CANARY}), patch.object(writer, "build_opener", return_value=Opener()), calls
74
75
 
75
76
 
76
77
  def reconcile(setup, request=None, current=None, historical=None, **kwargs):
@@ -185,7 +186,7 @@ def test_expired_auth_partial_failure_and_later_explicit_read(setup, phase, code
185
186
 
186
187
  def test_missing_pat_no_network_and_original_unknown_still_blocks(setup):
187
188
  writer_setup, request, _ = setup
188
- with patch.dict("os.environ", {}, clear=True), patch.object(writer, "build_opener") as http:
189
+ with mock_environment({}, clear=True), patch.object(writer, "build_opener") as http:
189
190
  result = module.reconcile(writer_setup[0], "local", request)
190
191
  assert result["outcome"] == "unresolved" and not result["network_attempted"]
191
192
  assert result["phases"] == [{"phase": "root", "outcome": "not_attempted", "diagnostic_code": "credential_unavailable", "network_attempted": False}]
@@ -286,7 +287,7 @@ def test_intent_only_crash_before_send_never_infers_not_sent(writer_setup):
286
287
 
287
288
  def test_known_hold_retained_without_credential_or_remote_read(writer_setup):
288
289
  root = writer_setup[0]
289
- with patch.dict("os.environ", {}, clear=True):
290
+ with mock_environment({}, clear=True):
290
291
  assert writer.publish(root, "local", writer_setup[1])["outcome"] == "hold"
291
292
  req = {"schema_version": 1, "reconciliation_id": "hold", "report_id": "write-1", "connection_id": "import-test", "source_connection_id": "write-test", "binding_id": "binding-1", "expected_observation_revision": 2, "approval_refs": ["recover.md"]}
292
293
  with patch.object(writer.os.environ, "get", side_effect=AssertionError("credential read")), patch.object(writer, "build_opener") as http:
@@ -3,6 +3,7 @@ import json
3
3
  from pathlib import Path
4
4
  from urllib.error import HTTPError
5
5
  from unittest.mock import patch
6
+ from environment_helpers import mock_environment
6
7
 
7
8
  import pytest
8
9
 
@@ -70,7 +71,7 @@ def network(*, mutation=None, patch_failure=None, readback_failure=None, patch_f
70
71
  value = mutation(request, copy.deepcopy(value))
71
72
  return Response(request, value)
72
73
 
73
- return patch.dict("os.environ", {"IMPORT_TEST_PAT": CANARY}), patch.object(module, "build_opener", return_value=Opener()), calls
74
+ return mock_environment({"IMPORT_TEST_PAT": CANARY}), patch.object(module, "build_opener", return_value=Opener()), calls
74
75
 
75
76
 
76
77
  def deliver(setup, request=None, **kwargs):
@@ -252,7 +253,7 @@ def test_success_chain_requires_explicit_predecessor_and_new_observation(setup):
252
253
  after["fields"]["System.History"] = operations[-1]["value"]
253
254
  return Response(req, after)
254
255
  return Response(req, sequence.pop(0) if sequence else after)
255
- with patch.dict("os.environ", {"IMPORT_TEST_PAT": CANARY}), patch.object(module, "build_opener", return_value=Opener()):
256
+ with mock_environment({"IMPORT_TEST_PAT": CANARY}), patch.object(module, "build_opener", return_value=Opener()):
256
257
  result = module.publish(root, "local", second)
257
258
  assert result["sent_confirmed"] and result["after"] == {"revision": 4, "state": "Done"}
258
259
  with pytest.raises(ValueError): module.publish(root, "local", {**second, "report_id": "fork", "expected_observation_revision": 4})
@@ -296,7 +297,7 @@ def test_same_id_changed_request_refuses_before_credentials(setup):
296
297
 
297
298
  def test_resealed_unknown_without_intent_cannot_bypass_target_guard(setup):
298
299
  root, request, _, _ = setup
299
- with patch.dict("os.environ", {}, clear=True):
300
+ with mock_environment({}, clear=True):
300
301
  result = module.publish(root, "local", request)
301
302
  path = Path(result["output"])
302
303
  record = read_json(path)
@@ -23,13 +23,16 @@ PACKAGES = {
23
23
  @pytest.mark.parametrize("filename", [
24
24
  "python-package.yml",
25
25
  "python-skill-project-management-package.yml",
26
+ "python-skill-brownfield-package.yml",
27
+ "python-skill-csharp-package.yml",
28
+ "python-skill-batch-regression-package.yml",
26
29
  ])
27
30
  def test_release_artifact_inspection_uses_verified_fresh_clamav(filename):
28
31
  steps = workflow(filename)["jobs"]["artifact-inspection"]["steps"]
29
32
  assert any(step.get("run") == "bash tools/scan_python_artifacts.sh dist/" for step in steps)
30
33
  script = (WORKFLOWS.parents[1] / "tools/scan_python_artifacts.sh").read_text(encoding="utf-8")
31
34
  assert "sha256sum --check" in script
32
- assert "--fail-if-cvd-older-than=1" in script
35
+ assert "--fail-if-cvd-older-than=3" in script
33
36
  assert script.index("sha256sum --check") < script.index('"${clamav_bin}/freshclam"')
34
37
  assert script.index('"${clamav_bin}/freshclam"') < script.index('"${clamav_bin}/clamscan"')
35
38
 
@@ -0,0 +1,61 @@
1
+ import json
2
+ import os
3
+ from pathlib import Path
4
+ import subprocess
5
+ import sys
6
+ import unittest
7
+
8
+
9
+ class EnvironmentMockIsolationTests(unittest.TestCase):
10
+ def test_inherited_empty_native_value_survives_mock_and_exception(self):
11
+ # Pass the empty value when creating the child: assigning it through
12
+ # os.environ inside the child cannot reproduce this Windows condition.
13
+ environment = dict(os.environ)
14
+ environment["XREFKIT_TEST_EMPTY_NATIVE_VALUE"] = ""
15
+ environment.pop("XREFKIT_TEST_MOCK_ONLY_VALUE", None)
16
+ script = r'''
17
+ import json
18
+ import os
19
+ import subprocess
20
+ import sys
21
+ from environment_helpers import mock_environment
22
+
23
+ key = "XREFKIT_TEST_EMPTY_NATIVE_VALUE"
24
+ mock_key = "XREFKIT_TEST_MOCK_ONLY_VALUE"
25
+ original = os.environ
26
+ probe = "import json,os; print(json.dumps([os.environ.get('XREFKIT_TEST_EMPTY_NATIVE_VALUE') == '', 'XREFKIT_TEST_MOCK_ONLY_VALUE' in os.environ]))"
27
+ def native_state():
28
+ # Deliberately omit env: probe the actual inherited native environment,
29
+ # not a reconstruction from Python's possibly divergent os.environ.
30
+ result = subprocess.run([sys.executable, "-c", probe], check=True,
31
+ capture_output=True, text=True, timeout=20)
32
+ return json.loads(result.stdout)
33
+
34
+ states = [native_state()]
35
+ with mock_environment({mock_key: "synthetic"}):
36
+ assert os.environ[key] == "" and os.environ[mock_key] == "synthetic"
37
+ states.append(native_state())
38
+ assert os.environ is original
39
+ states.append(native_state())
40
+ try:
41
+ with mock_environment({mock_key: "synthetic"}, clear=True):
42
+ assert key not in os.environ and os.environ[mock_key] == "synthetic"
43
+ states.append(native_state())
44
+ raise RuntimeError("synthetic test exit")
45
+ except RuntimeError:
46
+ pass
47
+ assert os.environ is original
48
+ states.append(native_state())
49
+ print(json.dumps(states))
50
+ '''
51
+ result = subprocess.run(
52
+ [sys.executable, "-c", script], cwd=Path(__file__).resolve().parent,
53
+ env=environment, capture_output=True, text=True, timeout=60,
54
+ )
55
+ self.assertEqual(result.returncode, 0, result.stderr)
56
+ # Only two booleans are reported; no inherited environment values leak.
57
+ self.assertEqual(json.loads(result.stdout), [[True, False]] * 5)
58
+
59
+
60
+ if __name__ == "__main__":
61
+ unittest.main()
@@ -0,0 +1,123 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import replace
4
+ import hashlib
5
+ from pathlib import Path
6
+ import tempfile
7
+ from types import SimpleNamespace
8
+ import unittest
9
+
10
+ import yaml
11
+
12
+ from xrefkit.mcp.schemas import ClosureContract, SkillCatalogEntry
13
+ from xrefkit.mcp.skills_extension import SkillsExtension
14
+
15
+
16
+ def skill(**changes):
17
+ values = dict(
18
+ skill_id="sample_skill", title="Sample", summary="日本語の手順", maturity="trial",
19
+ intent=[], target_artifacts=[], applies_when=[], not_for=[], required_knowledge=[],
20
+ required_tools=[], inputs=[], outputs=[], closure_contract=ClosureContract([], [], "", "required"),
21
+ meta_content="metadata", meta_links=[], skill_content="native procedure", skill_links=[],
22
+ path="skills/sample/SKILL.md", meta_path="skills/sample/meta.md", context_size={},
23
+ )
24
+ values.update(changes)
25
+ return SkillCatalogEntry(**values)
26
+
27
+
28
+ class SkillProjectionTests(unittest.TestCase):
29
+ def extension(self, entries, root=Path(".")):
30
+ return SkillsExtension(SimpleNamespace(skills=entries, repo_root=root))
31
+
32
+ def test_manifest_frontmatter_and_exact_utf8_bytes(self):
33
+ extension = self.extension([skill()])
34
+ entry = extension.list_skills()["skills"][0]
35
+ self.assertEqual(extension.get_skill(entry["uri"])["skill"], entry)
36
+ text = extension.read_resource(entry["uri"])["contents"][0]["text"]
37
+ frontmatter = yaml.safe_load(text.split("---", 2)[1])
38
+ self.assertEqual(frontmatter, entry["frontmatter"])
39
+ self.assertTrue(entry["uri"].endswith(f"/{frontmatter['name']}/SKILL.md"))
40
+ self.assertRegex(frontmatter["name"], r"^[a-z0-9]+(?:-[a-z0-9]+)*$")
41
+ self.assertLessEqual(len(frontmatter["name"]), 64)
42
+ raw = text.encode("utf-8")
43
+ self.assertEqual(entry["resources"], [{"uri": entry["uri"], "digest": "sha256:" + hashlib.sha256(raw).hexdigest(), "size": len(raw)}])
44
+ self.assertNotIn("native procedure", text)
45
+ self.assertIn("get_startup_context", text)
46
+ self.assertIn("bind_skill_run", text)
47
+ self.assertNotIn("allowed-tools", frontmatter)
48
+
49
+ def test_normalized_names_remain_distinct(self):
50
+ entries = self.extension([skill(skill_id="a_b"), skill(skill_id="a-b"), skill(skill_id="A.B"), skill(skill_id="!" * 300)]).list_skills()["skills"]
51
+ self.assertEqual(len({e["uri"] for e in entries}), 4)
52
+ for entry in entries:
53
+ self.assertLessEqual(len(entry["frontmatter"]["name"]), 64)
54
+
55
+ def test_excludes_private_hidden_unpublished_and_conflicted_entries(self):
56
+ entries = [skill(skill_id="public"), skill(skill_id="duplicate"), skill(skill_id="duplicate"),
57
+ skill(skill_id="aliased"), skill(skill_id="owner", legacy_skill_ids=["aliased"]),
58
+ skill(skill_id="private", path="skills_private/example/SKILL.md"),
59
+ skill(skill_id="hidden", zone_metadata={"hidden": True}),
60
+ skill(skill_id="local", zone_metadata={"local_only": True}),
61
+ skill(skill_id="not-distributed", zone_metadata={"distribution": False}),
62
+ skill(skill_id="draft", maturity="draft")]
63
+ actual = {e["frontmatter"]["metadata"]["xrefkit-skill-id"] for e in self.extension(entries).list_skills()["skills"]}
64
+ self.assertEqual(actual, {"public", "owner"})
65
+
66
+ def test_legacy_content_change_changes_manifest(self):
67
+ entry = skill()
68
+ first = self.extension([entry]).list_skills()["skills"][0]
69
+ second = self.extension([replace(entry, skill_content="changed")]).list_skills()["skills"][0]
70
+ self.assertEqual(first["uri"], second["uri"])
71
+ self.assertNotEqual(first["resources"], second["resources"])
72
+
73
+ def test_native_content_changes_and_source_boundary(self):
74
+ with tempfile.TemporaryDirectory() as tmp:
75
+ root = Path(tmp)
76
+ source = root / "SKILL.v1.md"
77
+ source.write_bytes(b"native\r\n")
78
+ entry = skill(path="SKILL.v1.md", definition_format="skill_definition_v1")
79
+ extension = self.extension([entry], root)
80
+ first = extension.list_skills()["skills"][0]
81
+ source.write_bytes(b"changed\n")
82
+ second = extension.get_skill(first["uri"])["skill"]
83
+ self.assertNotEqual(first["resources"], second["resources"])
84
+ self.assertEqual(second["frontmatter"]["metadata"]["xrefkit-source-sha256"], hashlib.sha256(b"changed\n").hexdigest())
85
+ self.assertEqual(self.extension([replace(entry, path="../SKILL.v1.md")], root).list_skills()["skills"], [])
86
+ self.assertEqual(self.extension([replace(entry, path=str(source))], root).list_skills()["skills"], [])
87
+ source.unlink()
88
+ self.assertEqual(extension.list_skills()["skills"], [])
89
+
90
+ def test_symlink_source_is_not_published(self):
91
+ with tempfile.TemporaryDirectory() as tmp:
92
+ root = Path(tmp)
93
+ (root / "actual.md").write_text("source", encoding="utf-8")
94
+ try:
95
+ (root / "SKILL.v1.md").symlink_to(root / "actual.md")
96
+ except OSError:
97
+ self.skipTest("symlink privilege unavailable")
98
+ entry = skill(path="SKILL.v1.md", definition_format="skill_definition_v1")
99
+ self.assertEqual(self.extension([entry], root).list_skills()["skills"], [])
100
+
101
+ def test_package_native_uses_its_declared_root(self):
102
+ with tempfile.TemporaryDirectory() as tmp:
103
+ root = Path(tmp)
104
+ (root / "SKILL.v1.md").write_text("package source", encoding="utf-8")
105
+ entry = skill(path="SKILL.v1.md", definition_format="skill_definition_v1", source_root=tmp, package_id="example.package")
106
+ result = self.extension([entry], root / "other-repo").list_skills()["skills"][0]
107
+ self.assertEqual(result["frontmatter"]["metadata"]["xrefkit-package-id"], "example.package")
108
+
109
+ def test_empty_cursor_and_unknown_paths(self):
110
+ extension = self.extension([])
111
+ self.assertEqual(extension.list_skills(), {"resultType": "complete", "skills": []})
112
+ for cursor in ["", "0", "next"]:
113
+ with self.assertRaises(ValueError):
114
+ extension.list_skills(cursor)
115
+ for uri in ["skill://unknown/SKILL.md", "skill://xrefkit/../SKILL.md", "skill://xrefkit/%2e%2e/SKILL.md", "file:///secret", "skill://xrefkit/test/scripts/run.py"]:
116
+ with self.assertRaises(ValueError):
117
+ extension.get_skill(uri)
118
+ with self.assertRaises(ValueError):
119
+ extension.read_resource(uri)
120
+
121
+
122
+ if __name__ == "__main__":
123
+ unittest.main()
@@ -0,0 +1,113 @@
1
+ from __future__ import annotations
2
+
3
+ from datetime import timedelta
4
+ import hashlib
5
+ from pathlib import Path
6
+ import sys
7
+ import tempfile
8
+ import unittest
9
+
10
+ try:
11
+ import anyio
12
+ from mcp import types
13
+ from mcp.client.session import ClientSession
14
+ from mcp.client.stdio import StdioServerParameters, stdio_client
15
+ from mcp.shared.exceptions import McpError
16
+ except ImportError as exc:
17
+ raise unittest.SkipTest(f"optional MCP integration dependency unavailable: {exc}") from exc
18
+ from pydantic import RootModel
19
+
20
+ from xrefkit.mcp.skills_extension import EXTENSION_ID
21
+
22
+
23
+ async def request(session, method, params=None):
24
+ data = {"method": method}
25
+ if params is not None:
26
+ data["params"] = params
27
+ return (await session.send_request(RootModel(data), types.EmptyResult, request_read_timeout_seconds=timedelta(seconds=20))).model_dump(by_alias=True, exclude_none=True)
28
+
29
+
30
+ class SkillsStdioTests(unittest.TestCase):
31
+ def test_actual_server_wire_and_legacy_tools(self):
32
+ async def scenario():
33
+ repo = Path(__file__).resolve().parents[1]
34
+ with tempfile.TemporaryDirectory() as tmp, tempfile.TemporaryFile(mode="w+", encoding="utf-8") as stderr:
35
+ server = StdioServerParameters(command=sys.executable, args=["-m", "xrefkit.mcp.server", "--repo", str(repo), "--audit-log", str(Path(tmp) / "audit.jsonl")], cwd=str(repo))
36
+ async with stdio_client(server, errlog=stderr) as (read, write):
37
+ async with ClientSession(read, write, read_timeout_seconds=timedelta(seconds=30)) as session:
38
+ initialized = await session.initialize()
39
+ self.assertEqual(initialized.protocolVersion, "2025-11-25")
40
+ self.assertEqual(initialized.capabilities.model_extra["extensions"][EXTENSION_ID], {})
41
+ self.assertIsNotNone(initialized.capabilities.resources)
42
+ listing = await request(session, "skills/list", {})
43
+ self.assertEqual(listing["resultType"], "complete")
44
+ self.assertTrue(listing["skills"])
45
+ entry = listing["skills"][0]
46
+ self.assertEqual((await request(session, "skills/get", {"uri": entry["uri"]}))["skill"], entry)
47
+ resource = await session.read_resource(entry["uri"])
48
+ raw = resource.contents[0].text.encode("utf-8")
49
+ self.assertEqual(entry["resources"][0]["digest"], "sha256:" + hashlib.sha256(raw).hexdigest())
50
+ self.assertEqual(entry["resources"][0]["size"], len(raw))
51
+ self.assertIn(entry["uri"], {str(item.uri) for item in (await session.list_resources()).resources})
52
+ # Resource inspection must not have satisfied legacy startup.
53
+ denied = await session.call_tool("get_skill", {"skill_id": entry["frontmatter"]["metadata"]["xrefkit-skill-id"]})
54
+ self.assertTrue(denied.isError)
55
+ tools = {tool.name for tool in (await session.list_tools()).tools}
56
+ self.assertIn("get_startup_context", tools)
57
+ self.assertIn("get_skill", tools)
58
+ self.assertNotIn("skills/list", tools)
59
+ startup = await session.call_tool("get_startup_context", {})
60
+ self.assertFalse(startup.isError)
61
+ native = await session.call_tool("get_skill", {"skill_id": entry["frontmatter"]["metadata"]["xrefkit-skill-id"]})
62
+ self.assertFalse(native.isError)
63
+ for method, params in [("skills/get", {}), ("skills/get", {"uri": True}), ("skills/get", {"uri": None}), ("skills/get", {"uri": []}), ("skills/get", {"uri": "skill://xrefkit/../secret"}), ("skills/list", {"cursor": "unknown"}), ("skills/list", {"cursor": True}), ("skills/list", {"cursor": []}), ("resources/read", {"uri": "skill://xrefkit/%2e%2e/secret"})]:
64
+ with self.subTest(method=method, params=params):
65
+ with self.assertRaises(McpError) as caught:
66
+ await request(session, method, params)
67
+ self.assertEqual(caught.exception.error.code, -32602)
68
+ await session.send_ping()
69
+ anyio.run(scenario)
70
+
71
+
72
+ class SkillsHttpTests(unittest.TestCase):
73
+ def test_http_extension_and_legacy_dispatch(self):
74
+ try:
75
+ from starlette.testclient import TestClient
76
+ except ImportError as exc:
77
+ self.skipTest(f"optional HTTP test dependency unavailable: {exc}")
78
+ from xrefkit.mcp.catalog import XRefCatalog
79
+ from xrefkit.mcp.skills_extension import SkillsExtension
80
+ from xrefkit.mcp.skills_transport import SkillsFastMCP, install_skills_handlers
81
+
82
+ repo = Path(__file__).resolve().parents[1]
83
+ catalog = XRefCatalog.build(repo, discover_packages=False)
84
+ app = SkillsFastMCP("skills-http-test", stateless_http=True, json_response=True)
85
+ install_skills_handlers(app, SkillsExtension(catalog))
86
+
87
+ @app.tool()
88
+ def legacy_echo(value: str) -> str:
89
+ return value
90
+
91
+ with TestClient(app.streamable_http_app(), base_url="http://127.0.0.1:8000") as client:
92
+ def send(method, params):
93
+ response = client.post("/mcp", json={"jsonrpc": "2.0", "id": 1, "method": method, "params": params}, headers={"Accept": "application/json, text/event-stream", "MCP-Protocol-Version": "2025-11-25"})
94
+ self.assertEqual(response.status_code, 200, response.text)
95
+ return response.json()
96
+
97
+ initialized = send("initialize", {"protocolVersion": "2025-11-25", "capabilities": {}, "clientInfo": {"name": "test", "version": "1"}})["result"]
98
+ self.assertEqual(initialized["capabilities"]["extensions"][EXTENSION_ID], {})
99
+ entries = send("skills/list", {})["result"]["skills"]
100
+ self.assertTrue(entries)
101
+ entry = entries[0]
102
+ self.assertEqual(send("skills/get", {"uri": entry["uri"]})["result"]["skill"], entry)
103
+ raw = send("resources/read", {"uri": entry["uri"]})["result"]["contents"][0]["text"].encode("utf-8")
104
+ self.assertEqual(entry["resources"][0]["digest"], "sha256:" + hashlib.sha256(raw).hexdigest())
105
+ self.assertEqual(send("skills/list", {"cursor": None})["error"]["code"], -32602)
106
+ self.assertEqual(send("skills/get", {"uri": "skill://xrefkit/unknown/SKILL.md"})["error"]["code"], -32602)
107
+ result = send("tools/call", {"name": "legacy_echo", "arguments": {"value": "still works"}})["result"]
108
+ self.assertFalse(result["isError"])
109
+ self.assertEqual(result["content"][0]["text"], "still works")
110
+
111
+
112
+ if __name__ == "__main__":
113
+ unittest.main()