xrefkit 0.7.14__tar.gz → 0.7.16__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 (291) hide show
  1. {xrefkit-0.7.14/xrefkit.egg-info → xrefkit-0.7.16}/PKG-INFO +11 -1
  2. {xrefkit-0.7.14 → xrefkit-0.7.16}/README.md +10 -0
  3. {xrefkit-0.7.14 → xrefkit-0.7.16}/pyproject.toml +2 -2
  4. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_ci_workflow_invariants.py +4 -1
  5. xrefkit-0.7.16/tests/test_public_skill.py +93 -0
  6. xrefkit-0.7.16/tests/test_skill_knowledge_audit.py +146 -0
  7. xrefkit-0.7.16/tests/test_verify_runtime_wheel.py +51 -0
  8. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/__init__.py +1 -1
  9. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/cli.py +5 -0
  10. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/operations_cli.py +1 -0
  11. xrefkit-0.7.16/xrefkit/public_skill.py +183 -0
  12. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/skill_definition_governance.py +7 -1
  13. xrefkit-0.7.16/xrefkit/skill_knowledge_audit.html +231 -0
  14. xrefkit-0.7.16/xrefkit/skill_knowledge_audit.py +292 -0
  15. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/skillrun.py +21 -7
  16. {xrefkit-0.7.14 → xrefkit-0.7.16/xrefkit.egg-info}/PKG-INFO +11 -1
  17. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit.egg-info/SOURCES.txt +6 -0
  18. {xrefkit-0.7.14 → xrefkit-0.7.16}/LICENSE +0 -0
  19. {xrefkit-0.7.14 → xrefkit-0.7.16}/setup.cfg +0 -0
  20. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_artifact_selected_family.py +0 -0
  21. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_attention_pet.py +0 -0
  22. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_attention_pet_client_protocol.py +0 -0
  23. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_attention_pet_codex_session.py +0 -0
  24. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_attention_pet_fit.py +0 -0
  25. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_azure_connection.py +0 -0
  26. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_azure_import.py +0 -0
  27. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_azure_recovery.py +0 -0
  28. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_azure_update_candidate.py +0 -0
  29. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_azure_writer.py +0 -0
  30. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_boundary_analysis.py +0 -0
  31. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_brownfield_csharp_structure_definitions.py +0 -0
  32. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_brownfield_file_editing_protocol.py +0 -0
  33. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_business_intake_conversation_definitions.py +0 -0
  34. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_business_intake_definition.py +0 -0
  35. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_calibration_lint.py +0 -0
  36. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_catalog_preparation_definition.py +0 -0
  37. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_check_skill_knowledge_xids.py +0 -0
  38. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_cli.py +0 -0
  39. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_code_constraint_definition.py +0 -0
  40. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_collect_analyzer_sarif.py +0 -0
  41. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_compact_skill_logs.py +0 -0
  42. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_constraint_derivation_family_definition.py +0 -0
  43. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_constraint_derivation_selected_family.py +0 -0
  44. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_contribution_adoption_bytes.py +0 -0
  45. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_contribution_returns.py +0 -0
  46. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_convert_to_xrefkit_skill.py +0 -0
  47. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_cs_scope_probe.py +0 -0
  48. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_csharp_commonality.py +0 -0
  49. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_csharp_naming_profile.py +0 -0
  50. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_ctx.py +0 -0
  51. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_cutover_readiness.py +0 -0
  52. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_dashboard.py +0 -0
  53. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_database_batch_definition_migration.py +0 -0
  54. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_decision_checklist.py +0 -0
  55. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_decision_handoff.py +0 -0
  56. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_decision_trace.py +0 -0
  57. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_design_business_intake_selected_family.py +0 -0
  58. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_design_planning_definition_migration.py +0 -0
  59. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_dotnet_definition_candidate.py +0 -0
  60. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_editorial_family_definition.py +0 -0
  61. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_editorial_intake_definition.py +0 -0
  62. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_editorial_selected_family.py +0 -0
  63. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_embedded_startup_pack.py +0 -0
  64. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_engineering_decision.py +0 -0
  65. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_environment_isolation.py +0 -0
  66. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_error_policy_audit.py +0 -0
  67. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_error_policy_locator.py +0 -0
  68. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_execution_binding.py +0 -0
  69. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_existing_skill_definition_batch.py +0 -0
  70. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_final_skilldefinition_batch.py +0 -0
  71. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_flow_selected_family.py +0 -0
  72. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_fm_multiroot.py +0 -0
  73. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_gate.py +0 -0
  74. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_gateway.py +0 -0
  75. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_gateway_mcp.py +0 -0
  76. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_gateway_skill_adapter.py +0 -0
  77. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_gateway_work_items.py +0 -0
  78. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_goal_desired_state.py +0 -0
  79. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_governance_entry.py +0 -0
  80. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_governance_host.py +0 -0
  81. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_host_precheck.py +0 -0
  82. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_human_evaluation.py +0 -0
  83. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_implementation_flow_definition.py +0 -0
  84. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_implementation_review_selected_family.py +0 -0
  85. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_inbound_uploads.py +0 -0
  86. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_instruction_workflow.py +0 -0
  87. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_knowledge_relations_validator.py +0 -0
  88. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_language_review_definition.py +0 -0
  89. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_legacy_guidance.py +0 -0
  90. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_legacy_migration.py +0 -0
  91. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_legacy_resources.py +0 -0
  92. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_mcp_package_routing.py +0 -0
  93. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_mcp_setup.py +0 -0
  94. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_mcp_skills_extension.py +0 -0
  95. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_mcp_skills_transport.py +0 -0
  96. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_mcp_subagent_startup.py +0 -0
  97. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_mcp_subagent_startup_integration.py +0 -0
  98. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_ontology_assessment_validator.py +0 -0
  99. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_os_family_definition.py +0 -0
  100. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_os_knowledge_family_definition.py +0 -0
  101. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_os_selected_family.py +0 -0
  102. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_ownership.py +0 -0
  103. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_package_knowledge_resolution.py +0 -0
  104. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_package_skill_run.py +0 -0
  105. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_packaged_native_governance.py +0 -0
  106. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_packmeta.py +0 -0
  107. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_plan_markdown.py +0 -0
  108. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_plan_observation.py +0 -0
  109. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_principle_discovery.py +0 -0
  110. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_project_management_materialization.py +0 -0
  111. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_project_management_offline_progress.py +0 -0
  112. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_project_quality_baseline.py +0 -0
  113. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_qa_report_definition.py +0 -0
  114. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_quality_issue_dashboard.py +0 -0
  115. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_quality_issues.py +0 -0
  116. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_reporting_profiles.py +0 -0
  117. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_reporting_quality.py +0 -0
  118. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_repository_skill_adoption.py +0 -0
  119. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_repository_startup_pack.py +0 -0
  120. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_resource_provider.py +0 -0
  121. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_runtime_contracts.py +0 -0
  122. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_sarif_to_locator.py +0 -0
  123. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_security_definition_migration.py +0 -0
  124. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_site_release_metadata.py +0 -0
  125. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_definition.py +0 -0
  126. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_definition_governance.py +0 -0
  127. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_definition_mcp.py +0 -0
  128. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_definition_runtime.py +0 -0
  129. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_edits.py +0 -0
  130. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_maturity_return.py +0 -0
  131. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_release_compatibility.py +0 -0
  132. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_runtime_audit.py +0 -0
  133. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skillmeta.py +0 -0
  134. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skills_sync.py +0 -0
  135. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_source_analysis_fragments.py +0 -0
  136. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_structure_catalog.py +0 -0
  137. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_subagent_startup.py +0 -0
  138. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_subagent_startup_boundaries.py +0 -0
  139. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_unknown_resolution.py +0 -0
  140. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_wbs.py +0 -0
  141. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_work_management.py +0 -0
  142. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_work_packages.py +0 -0
  143. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_workflow_family_definition.py +0 -0
  144. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_xref.py +0 -0
  145. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_xrefkit_instance.py +0 -0
  146. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_xrefkit_tools.py +0 -0
  147. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_xrefkit_v2_discovery.py +0 -0
  148. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_xrefkit_v2_models.py +0 -0
  149. {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_xrefkit_v2_pipeline.py +0 -0
  150. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/__main__.py +0 -0
  151. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/__init__.py +0 -0
  152. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/__main__.py +0 -0
  153. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/client.py +0 -0
  154. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/client_protocol.py +0 -0
  155. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/codex_session.py +0 -0
  156. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/evaluator.py +0 -0
  157. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/model.py +0 -0
  158. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/presentation.py +0 -0
  159. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/profiles.py +0 -0
  160. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/scenarios.py +0 -0
  161. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/server.py +0 -0
  162. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/store.py +0 -0
  163. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/azure_connection.py +0 -0
  164. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/azure_import.py +0 -0
  165. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/azure_recovery.py +0 -0
  166. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/azure_update_candidate.py +0 -0
  167. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/azure_writer.py +0 -0
  168. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/boundary_analysis.py +0 -0
  169. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/catalog_cli.py +0 -0
  170. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/contracts.py +0 -0
  171. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/ctx.py +0 -0
  172. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/dashboard.py +0 -0
  173. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/decision_checklist.py +0 -0
  174. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/decision_handoff.py +0 -0
  175. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/decision_trace.py +0 -0
  176. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/discovery.py +0 -0
  177. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/engineering_decision.py +0 -0
  178. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/execution_binding.py +0 -0
  179. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/execution_binding_cli.py +0 -0
  180. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/gate.py +0 -0
  181. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/gateway.py +0 -0
  182. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/goalstate.py +0 -0
  183. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/governance_entry.py +0 -0
  184. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/governance_entry_cli.py +0 -0
  185. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/governance_host.py +0 -0
  186. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/hashing.py +0 -0
  187. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/host_execution.py +0 -0
  188. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/host_precheck.py +0 -0
  189. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/import_skill.py +0 -0
  190. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/instance.py +0 -0
  191. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/loaders.py +0 -0
  192. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/__init__.py +0 -0
  193. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/audit.py +0 -0
  194. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/bootstrap.py +0 -0
  195. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/catalog.py +0 -0
  196. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/cli.py +0 -0
  197. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/client_cache.py +0 -0
  198. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/client_flow.py +0 -0
  199. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/context_registry.py +0 -0
  200. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/context_token.py +0 -0
  201. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/contracts.py +0 -0
  202. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/contribution_adoption.py +0 -0
  203. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/contribution_returns.py +0 -0
  204. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/dist.py +0 -0
  205. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/gateway.py +0 -0
  206. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/governed_overlays.py +0 -0
  207. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/inbound_uploads.py +0 -0
  208. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/knowledge_edits.py +0 -0
  209. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/legacy_guidance.py +0 -0
  210. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/legacy_migration.py +0 -0
  211. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/legacy_resources.py +0 -0
  212. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/ownership.py +0 -0
  213. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/repository.py +0 -0
  214. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/schemas.py +0 -0
  215. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/server.py +0 -0
  216. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/setup.py +0 -0
  217. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/skill_edits.py +0 -0
  218. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/skill_maturity.py +0 -0
  219. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/skills_extension.py +0 -0
  220. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/skills_transport.py +0 -0
  221. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/startup_contract_pack.py +0 -0
  222. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/subagent_startup.py +0 -0
  223. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/update_gate_intake.py +0 -0
  224. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp_tools.py +0 -0
  225. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/__init__.py +0 -0
  226. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/common.py +0 -0
  227. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/effective_bundle.py +0 -0
  228. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/human_evaluation.py +0 -0
  229. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/local_manifest.py +0 -0
  230. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/package_manifest.py +0 -0
  231. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/run_log.py +0 -0
  232. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/server_config.py +0 -0
  233. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/skill_definition.py +0 -0
  234. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/ownership.py +0 -0
  235. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/packmeta.py +0 -0
  236. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/plan_markdown.py +0 -0
  237. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/plan_observation.py +0 -0
  238. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/principle_discovery.py +0 -0
  239. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/quality_issues.py +0 -0
  240. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/registry.py +0 -0
  241. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/reporting.py +0 -0
  242. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/reporting_profiles.py +0 -0
  243. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/repository_skills.py +0 -0
  244. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resolver.py +0 -0
  245. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resource_provider.py +0 -0
  246. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/attention_pet/client-state.schema.json +0 -0
  247. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/attention_pet/pet.css +0 -0
  248. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/attention_pet/pet.html +0 -0
  249. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/attention_pet/pet.js +0 -0
  250. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/contracts.json +0 -0
  251. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/current.json +0 -0
  252. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/generations/7a682a5272907354/contracts.json +0 -0
  253. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/generations/7a682a5272907354/model_body.md +0 -0
  254. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/generations/9929294385ccb7b0/contracts.json +0 -0
  255. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/generations/9929294385ccb7b0/model_body.md +0 -0
  256. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/model_body.md +0 -0
  257. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/000_agent_entry.md +0 -0
  258. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/011_startup_xref_routing.md +0 -0
  259. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/015_shared_memory_operations.md +0 -0
  260. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/016_uncertainty_protocol.md +0 -0
  261. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/017_base_and_xref_layering.md +0 -0
  262. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/053_context_direction_security_guard.md +0 -0
  263. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/yomiyasu_LICENSE.txt +0 -0
  264. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/engineering-decision-checklist.json +0 -0
  265. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/migration/docs/guides/062_legacy_flow_skill_migration_guide.md +0 -0
  266. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/migration/knowledge/operations/130_legacy_flow_skill_migration_rules.md +0 -0
  267. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/migration/knowledge/organization/160_context_direction_guard_rules.md +0 -0
  268. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/migration/skills/os/legacy_flow_skill_migration/SKILL.v1.md +0 -0
  269. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/migration/skills/os/legacy_flow_skill_migration/references/legacy_flow_skill_migration_template.md +0 -0
  270. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/migration/skills/repository_adoption.json +0 -0
  271. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/migration/tools/migrate_legacy_flow_skill.py +0 -0
  272. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/runlog.py +0 -0
  273. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/skill_definition.py +0 -0
  274. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/skill_definition_catalog.py +0 -0
  275. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/skillmeta.py +0 -0
  276. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/skills_sync.py +0 -0
  277. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/structure_catalog.py +0 -0
  278. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/subagent_startup.py +0 -0
  279. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/tools/__init__.py +0 -0
  280. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/tools/__main__.py +0 -0
  281. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/unknown_resolution.py +0 -0
  282. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/v2_cli.py +0 -0
  283. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/wbs.py +0 -0
  284. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/work_management.py +0 -0
  285. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/work_management_view.py +0 -0
  286. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/workspace.py +0 -0
  287. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/xref.py +0 -0
  288. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit.egg-info/dependency_links.txt +0 -0
  289. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit.egg-info/entry_points.txt +0 -0
  290. {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit.egg-info/requires.txt +0 -0
  291. {xrefkit-0.7.14 → xrefkit-0.7.16}/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.14
3
+ Version: 0.7.16
4
4
  Summary: Portable XID, Skill, Knowledge, workflow, and MCP runtime for XRefKit
5
5
  Author: synthaicode
6
6
  License: MIT License
@@ -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.14"
7
+ version = "0.7.16"
8
8
  description = "Portable XID, Skill, Knowledge, workflow, and MCP runtime for XRefKit"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -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"]
@@ -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,93 @@
1
+ """Public binding checks exercise registry bytes, installed bytes, and the run receipt separately."""
2
+ from hashlib import sha256
3
+ from io import BytesIO
4
+ import json
5
+ from pathlib import Path
6
+ from types import SimpleNamespace
7
+ from zipfile import ZipFile
8
+
9
+ import pytest
10
+
11
+ from test_skill_definition import metadata, text_for
12
+ from test_skill_definition_governance import _record
13
+ from xrefkit import public_skill
14
+ from xrefkit.cli import main
15
+
16
+
17
+ @pytest.fixture
18
+ def release(tmp_path, monkeypatch, metadata):
19
+ skill = "design_flow"
20
+ prefix = "xrefkit_skills_brownfield"
21
+ installed = tmp_path / "site"
22
+ metadata["skill_id"] = skill
23
+ source = tmp_path / "definition.md"
24
+ source.write_bytes(text_for(metadata).encode())
25
+ provided = dict(id=skill, xid=metadata["xid"], path=f"skills/{skill}/SKILL.v1.md",
26
+ governance_path=f"governance/skills/{skill}.json")
27
+ manifest = dict(package_id="xrefkit.skills.brownfield", package_type="skill_package", version="0.4.0",
28
+ contract={}, requires=dict(xrefkit_core=">=2.0.0 <3.0.0"), provides=dict(skills=[provided]))
29
+ contents = {
30
+ f"{prefix}/package_manifest.yaml": json.dumps(manifest).encode(),
31
+ f"{prefix}/{provided['path']}": source.read_bytes(),
32
+ f"{prefix}/{provided['governance_path']}": json.dumps(_record(source, metadata)).encode(),
33
+ }
34
+ contents["test.dist-info/entry_points.txt"] = b"[xrefkit.skill_packages]\nbrownfield = test:package_root\n"
35
+ wheel = BytesIO()
36
+ with ZipFile(wheel, "w") as archive:
37
+ for name, data in contents.items():
38
+ archive.writestr(name, data)
39
+ file = installed / name
40
+ file.parent.mkdir(parents=True, exist_ok=True)
41
+ file.write_bytes(data)
42
+ payload = wheel.getvalue()
43
+ filename = "xrefkit_skills_brownfield-0.4.0-py3-none-any.whl"
44
+ url = "https://files.pythonhosted.org/" + filename
45
+ index = dict(info=dict(name="xrefkit-skills-brownfield", version="0.4.0"),
46
+ urls=[dict(packagetype="bdist_wheel", filename=filename, url=url,
47
+ digests=dict(sha256=sha256(payload).hexdigest()))])
48
+ monkeypatch.setattr(public_skill, "_download", lambda addr, host, limit:
49
+ payload if addr == url else json.dumps(index).encode())
50
+ dist = SimpleNamespace(files=[Path(name) for name in contents], version="0.4.0",
51
+ entry_points=[SimpleNamespace(group="xrefkit.skill_packages")],
52
+ locate_file=lambda member: installed / member)
53
+ monkeypatch.setattr(public_skill.metadata, "distribution", lambda distribution: dist)
54
+ lock = public_skill.resolve_public_skill("xrefkit-skills-brownfield", "0.4.0", skill)
55
+ return lock, installed / prefix, dist
56
+
57
+
58
+ def test_run_uses_pinned_distribution_even_with_same_named_local_skill(release, tmp_path, capsys):
59
+ lock, package, _ = release
60
+ root = tmp_path / "project"
61
+ overlay = root / "skills/design_flow/SKILL.v1.md"
62
+ overlay.parent.mkdir(parents=True)
63
+ overlay.write_text("unrelated local Skill", encoding="utf-8")
64
+ (root / "approved.json").write_text(json.dumps(lock), encoding="utf-8")
65
+ result = main(["skill", "run", "--root", str(root), "--public-skill-lock", "approved.json",
66
+ "--task", "review design", "--capability", "design", "--tuning", "review",
67
+ "--responsibility", "design", "--execution-mode", "subagent_required", "--json"])
68
+ assert result == 0
69
+ receipt = json.loads(capsys.readouterr().out)
70
+ assert Path(receipt["skill_doc"]) == package / "skills/design_flow/SKILL.v1.md"
71
+ log = Path(receipt["run_log"]).read_text(encoding="utf-8")
72
+ for key, value in lock.items():
73
+ assert f"- public_skill_{key}: `{value}`" in log
74
+ assert f"- definition_sha256: `{lock['definition_sha256']}`" in log
75
+ assert f"- definition_governance_sha256: `{lock['governance_sha256']}`" in log
76
+
77
+
78
+ @pytest.mark.parametrize("member", ["governance/skills/design_flow.json", "skills/design_flow/SKILL.v1.md"])
79
+ def test_modified_installed_content_blocks_run(release, member):
80
+ lock, package, _ = release
81
+ with (package / member).open("ab") as f:
82
+ f.write(b" ")
83
+ with pytest.raises(ValueError, match="expected .*actual"):
84
+ public_skill.verify_public_skill(lock)
85
+
86
+
87
+ def test_installed_version_and_approved_wheel_are_enforced(release):
88
+ lock, _, dist = release
89
+ with pytest.raises(ValueError, match="wheel_sha256: expected .*actual"):
90
+ public_skill.verify_public_skill(dict(lock, wheel_sha256="0" * 64))
91
+ dist.version = "0.4.1"
92
+ with pytest.raises(ValueError, match="expected '0.4.0', actual '0.4.1'"):
93
+ public_skill.verify_public_skill(lock)
@@ -0,0 +1,146 @@
1
+ import json
2
+ import subprocess
3
+ import sys
4
+ from pathlib import Path
5
+ from urllib.parse import quote, unquote
6
+
7
+ from xrefkit.skill_knowledge_audit import audit
8
+
9
+
10
+ def skill(root, folder, identifier, extra="", header=None):
11
+ template = Path(__file__).resolve().parents[1] / "skills/implementation_flow/SKILL.v1.md"
12
+ body = template.read_text(encoding="utf-8").replace("skill_id: implementation_flow",
13
+ "skill_id: " + identifier)
14
+ if header is not None:
15
+ start = body.index("knowledge_needs:\n")
16
+ end = body.index("control_refs:", start)
17
+ body = body[:start] + "knowledge_needs: " + header + "\n" + body[end:]
18
+ # Keep the validated header and identity but remove unrelated template links.
19
+ opening = body.split("\n---\n", 1)[0]
20
+ own = "D7B4E9A2C610"
21
+ source = root / "skills" / folder / "SKILL.v1.md"
22
+ source.parent.mkdir(parents=True)
23
+ source.write_text(opening + '\n---\n<!-- xid: '+own+' -->\n<a id="xid-'+own+'"></a>\n# Test\n'+extra,
24
+ encoding="utf-8")
25
+ return source
26
+
27
+
28
+ def write_doc(root, name="example.md", body="# Title\n\n## First\n\nA.\n"):
29
+ path = root / "knowledge" / name
30
+ path.parent.mkdir(parents=True, exist_ok=True)
31
+ path.write_text('<!-- xid: AB12CD34EF56 -->\n<a id="xid-AB12CD34EF56"></a>\n\n'+body,
32
+ encoding="utf-8")
33
+ return path
34
+
35
+
36
+ def test_anchor_sensitive_events_and_deduplicated_counts(tmp_path):
37
+ write_doc(tmp_path)
38
+ skill(tmp_path, "one", "one",
39
+ "[a](../../knowledge/example.md#section-a) [b](../../knowledge/example.md#section-b)\n", "[]")
40
+ result = audit(tmp_path)
41
+ assert result["defects"]["counts"] == dict(xids=1, events=2, occurrences=2, skills=1)
42
+ group, = result["defects"]["groups"]
43
+ assert group["xid"] == "AB12CD34EF56"
44
+ assert [e["anchor"] for e in group["events"]] == ["section-a", "section-b"]
45
+ path = tmp_path / "skills/one/SKILL.v1.md"
46
+ path.write_text(path.read_text(encoding="utf-8").replace("#section-b", "#section-a"), encoding="utf-8")
47
+ assert audit(tmp_path)["defects"]["counts"] == dict(xids=1, events=1, occurrences=2, skills=1)
48
+ skill(tmp_path, "two", "two", "[a](../../knowledge/example.md#section-a)", "[]")
49
+ assert audit(tmp_path)["defects"]["counts"] == dict(xids=1, events=1, occurrences=3, skills=2)
50
+
51
+
52
+ def test_pack_membership_direct_refs_dynamic_external_and_missing(tmp_path):
53
+ write_doc(tmp_path)
54
+ skill(tmp_path, "one", "one", "[missing](../../knowledge/missing.md)", """
55
+ - id: runtime
56
+ query: find by purpose
57
+ required_when: needed
58
+ seed_xids: []
59
+ - id: outside
60
+ query: external
61
+ required_when: always
62
+ seed_xids: [AB123456789A]""")
63
+ source = tmp_path / "docs/note.md"
64
+ source.parent.mkdir()
65
+ source.write_text("<!-- xid: AB123456789A -->", encoding="utf-8")
66
+ manifest = tmp_path / "skills/packs/demo/pack.md"
67
+ manifest.parent.mkdir(parents=True)
68
+ tick = chr(96)
69
+ manifest.write_text(f"- pack_id: {tick}demo{tick}\n- uses_skills:\n - {tick}skills/one{tick}\n"
70
+ f"- owns_knowledge:\n - {tick}knowledge/example.md{tick}\n"
71
+ f"- uses_knowledge:\n - {tick}knowledge/missing.md#xid-AB123456789B{tick}\n", encoding="utf-8")
72
+ result = audit(tmp_path)
73
+ assert result["packs"][0]["uses_skills"] == ["skills/one/SKILL.v1.md"]
74
+ assert result["defects"]["counts"] == dict(xids=1, events=1, occurrences=1, skills=0)
75
+ assert len(result["defects"]["no_xid"]) == 1
76
+ assert {(r["status"], r["target"]) for r in result["rows"] if r["skill"]} == {
77
+ ("dynamic", ""), ("external", "docs/note.md"), ("broken", "knowledge/missing.md")}
78
+ pack_row, = (r for r in result["rows"] if r["status"] == "resolved")
79
+ assert pack_row["skill"] == "" and pack_row["pack"] == "demo"
80
+
81
+
82
+ def test_scan_sections_and_generated_relative_links(tmp_path):
83
+ name = "日本語 #100%.md"
84
+ write_doc(tmp_path, name, "# Title\n\n## Same\n\none\n\n~~~\n## false\n~~~\n\n## Same\n\ntwo\n")
85
+ skill(tmp_path, "skill 日本語#%", "one", "", "[]")
86
+ bad = tmp_path / "skills/bad/SKILL.v1.md"
87
+ bad.parent.mkdir()
88
+ bad.write_text("broken", encoding="utf-8")
89
+ output = tmp_path / "generated/report.html"
90
+ json_path = tmp_path / "generated/report.json"
91
+ subprocess.run([sys.executable, "-m", "xrefkit", "skill-knowledge-audit", "--root", str(tmp_path),
92
+ "--html", str(output), "--json", str(json_path)], check=True)
93
+ data = json.loads(json_path.read_bytes())
94
+ assert data["scope"] == dict(root=str(tmp_path), found=2, parsed=1, unreadable=1)
95
+ assert data["errors"][0]["source"] == "skills/bad/SKILL.v1.md"
96
+ sections = data["docs"]["knowledge/"+name]["sections"]
97
+ assert [s["title"] for s in sections] == ["Same", "Same"]
98
+ assert sections[0]["line"] != sections[1]["line"]
99
+ html = output.read_text(encoding="utf-8")
100
+ payload = html.split('id="audit-data">', 1)[1].split("</script>", 1)[0]
101
+ urls = json.loads(payload)["links"]
102
+ for path, url in urls.items():
103
+ assert "#" not in url
104
+ assert (output.parent / unquote(url)).resolve() == (tmp_path / path).resolve()
105
+
106
+
107
+
108
+ def test_distinct_broken_paths_and_missing_or_ambiguous_seeds(tmp_path):
109
+ write_doc(tmp_path)
110
+ skill(tmp_path, "one", "one", "[a](../../knowledge/example.md#xid-AB12CD34EF55)", "[]")
111
+ skill(tmp_path, "two", "two", "[b](../../knowledge/absent.md#xid-AB12CD34EF55)", "[]")
112
+ result = audit(tmp_path)["defects"]
113
+ assert result["counts"] == dict(xids=1, events=2, occurrences=2, skills=2)
114
+ assert {event["code"] for event in result["groups"][0]["events"]} == {"missing_anchor", "missing_file"}
115
+ write_doc(tmp_path, "second.md")
116
+ skill(tmp_path, "three", "three", "", """
117
+ - id: resources
118
+ query: supporting resources
119
+ required_when: preparing
120
+ seed_xids: [AB12CD34EF56, B123456789AB]""")
121
+ result = audit(tmp_path)
122
+ assert {r["reason_code"] for r in result["rows"] if r["skill"] == "three"} == {
123
+ "duplicate_xid", "missing_xid"}
124
+
125
+
126
+ def test_pack_membership_literal_encoded_and_anchored_paths(tmp_path):
127
+ write_doc(tmp_path)
128
+
129
+ literal = "skills/日本語 #100%"
130
+ encoded = quote(literal, safe="/")
131
+ escaped = "skills/literal%23"
132
+ for directory, identifier in [(literal, "special"), (escaped, "escaped"), ("skills/literal#", "hash")]:
133
+ skill(tmp_path, directory.removeprefix("skills/"), identifier, header="[]")
134
+ pack = tmp_path / "skills/packs/test/pack.md"
135
+ pack.parent.mkdir(parents=True)
136
+ tick = chr(96)
137
+ fields = {"owns_skills": [literal, escaped, "../skills/outside"],
138
+ "uses_skills": [encoded + "/SKILL.v1.md#section", literal + "#section",
139
+ encoded, "skills/literal%2523#section", "skills/%2e%2e/outside"]}
140
+ pack.write_text("- pack_id: test\n" + "".join(
141
+ f"- {field}:\n" + "".join(f" - {tick}{entry}{tick}\n" for entry in entries)
142
+ for field, entries in fields.items()), encoding="utf-8")
143
+ actual, = audit(tmp_path)["packs"]
144
+ special, percent = literal + "/SKILL.v1.md", escaped + "/SKILL.v1.md"
145
+ assert actual["owns_skills"] == [special, percent]
146
+ assert actual["uses_skills"] == [special, special, special, percent]
@@ -0,0 +1,51 @@
1
+ import hashlib
2
+ from zipfile import ZipFile
3
+
4
+ import pytest
5
+
6
+ from tools.verify_runtime_wheel import verify_wheel
7
+
8
+
9
+ def make_wheel(directory, metadata_version="0.0.1"):
10
+ wheel = directory / "xrefkit_openai_runtime-0.0.1-py3-none-any.whl"
11
+ with ZipFile(wheel, "w") as archive:
12
+ archive.writestr(
13
+ "xrefkit_openai_runtime-0.0.1.dist-info/METADATA",
14
+ f"Metadata-Version: 2.1\nName: xrefkit-openai-runtime\nVersion: {metadata_version}\n",
15
+ )
16
+ return wheel, hashlib.sha256(wheel.read_bytes()).hexdigest()
17
+
18
+
19
+ def test_verifies_exact_candidate_without_changing_bytes(tmp_path):
20
+ wheel, digest = make_wheel(tmp_path)
21
+ assert verify_wheel(tmp_path, "0.0.1", digest.upper()) == wheel
22
+ assert hashlib.sha256(wheel.read_bytes()).hexdigest() == digest
23
+
24
+
25
+ @pytest.mark.parametrize("extra", ["runtime.tar.gz", ".hidden", "another.whl"])
26
+ def test_rejects_extra_upload_entries(tmp_path, extra):
27
+ _, digest = make_wheel(tmp_path)
28
+ (tmp_path / extra).touch()
29
+ with pytest.raises(ValueError, match="exactly one"):
30
+ verify_wheel(tmp_path, "0.0.1", digest)
31
+
32
+
33
+ def test_rejects_missing_or_modified_candidate(tmp_path):
34
+ wheel, digest = make_wheel(tmp_path)
35
+ with wheel.open("ab") as stream:
36
+ stream.write(b"changed after acceptance")
37
+ with pytest.raises(ValueError, match="SHA-256"):
38
+ verify_wheel(tmp_path, "0.0.1", digest)
39
+ wheel.unlink()
40
+ with pytest.raises(ValueError, match="exactly one"):
41
+ verify_wheel(tmp_path, "0.0.1", digest)
42
+
43
+
44
+ def test_rejects_identity_and_approval_mismatch(tmp_path):
45
+ _, digest = make_wheel(tmp_path, metadata_version="0.0.2")
46
+ with pytest.raises(ValueError, match="distribution identity"):
47
+ verify_wheel(tmp_path, "0.0.1", digest)
48
+ with pytest.raises(ValueError, match="wheel name or version"):
49
+ verify_wheel(tmp_path, "0.0.2", digest)
50
+ with pytest.raises(ValueError, match="SHA-256"):
51
+ verify_wheel(tmp_path, "0.0.1", "")
@@ -2,4 +2,4 @@
2
2
 
3
3
  __all__ = ["__version__"]
4
4
 
5
- __version__ = "0.7.14"
5
+ __version__ = "0.7.16"
@@ -21,6 +21,7 @@ def _print_help() -> None:
21
21
  " gateway prepare inputs, route model work, and evaluate retry feedback\n"
22
22
  " governance prepare bounded governance entries and validate host results\n"
23
23
  " skill discover, validate, run, verify, and close Skills\n"
24
+ " skill-knowledge-audit generate a local HTML report of Skill and Knowledge links\n"
24
25
  " workflow run the generic protocol for instructions without a Skill\n"
25
26
  " host run host-compatibility evidence checks\n"
26
27
  " tools list and run XID-backed client tools\n"
@@ -46,6 +47,10 @@ def main(argv: Sequence[str] | None = None) -> int:
46
47
  return 0
47
48
 
48
49
  command = args[0]
50
+ if command == "skill-knowledge-audit":
51
+ from .skill_knowledge_audit import main as audit_main
52
+
53
+ return audit_main(args[1:])
49
54
  if command == "governance":
50
55
  from .governance_entry_cli import main as governance_main
51
56
 
@@ -419,6 +419,7 @@ def _build_parser() -> argparse.ArgumentParser:
419
419
  p_skill_run_source = p_skill_run.add_mutually_exclusive_group(required=True)
420
420
  p_skill_run_source.add_argument("--meta", help="Relative path to the legacy Skill meta.md to run")
421
421
  p_skill_run_source.add_argument("--definition", help="Explicit SkillDefinition document to run without a legacy meta source")
422
+ p_skill_run_source.add_argument("--public-skill-lock", help="Approved JSON lock for an installed public stable Skill")
422
423
  p_skill_run_source.add_argument("--package-skill", help="Explicit installed Skill Package reference (package_id::skill_id)")
423
424
  p_skill_run.add_argument(
424
425
  "--governance",
@@ -0,0 +1,183 @@
1
+ """Bind a native Skill to an immutable public PyPI wheel and its approved governance."""
2
+ from __future__ import annotations
3
+
4
+ from configparser import ConfigParser
5
+ from hashlib import sha256
6
+ from importlib import metadata
7
+ from io import BytesIO
8
+ import json
9
+ from pathlib import Path, PurePosixPath
10
+ import re
11
+ from urllib.parse import urlsplit
12
+ from urllib.request import urlopen
13
+ from zipfile import BadZipFile, ZipFile
14
+
15
+ import yaml
16
+
17
+ from .models import PackageManifest
18
+ from .models.common import validate_package_id
19
+ from .skill_definition import parse_skill_definition
20
+ from .skill_definition_governance import match_definition, parse_governance_record
21
+
22
+ _FIELDS = {"distribution", "version", "skill_id", "package_id", "maturity", "definition_sha256",
23
+ "governance_sha256", "wheel_sha256", "wheel_filename"}
24
+ _NAME = r"[a-z0-9]+(?:-[a-z0-9]+)*"
25
+ _VERSION = r"[A-Za-z0-9]+(?:[.!+_-][A-Za-z0-9]+)*"
26
+ _SKILL = r"[a-z][a-z0-9_]*"
27
+
28
+
29
+ def _field(value, pattern, label):
30
+ if not isinstance(value, str) or not re.fullmatch(pattern, value):
31
+ raise ValueError(f"invalid public Skill {label}: {value!r}")
32
+
33
+
34
+ def validate_public_skill_lock(lock):
35
+ if not isinstance(lock, dict) or set(lock) != _FIELDS:
36
+ raise ValueError("public Skill lock has missing or unknown fields")
37
+ _field(lock["distribution"], _NAME, "distribution")
38
+ _field(lock["version"], _VERSION, "version")
39
+ _field(lock["skill_id"], _SKILL, "skill ID")
40
+ if not isinstance(lock["package_id"], str):
41
+ raise ValueError("public Skill package_id must be a string")
42
+ validate_package_id(lock["package_id"])
43
+ _field(lock["wheel_filename"], r"[A-Za-z0-9_.!+-]+\.whl", "wheel filename")
44
+ for key in ("definition_sha256", "governance_sha256", "wheel_sha256"):
45
+ _field(lock[key], r"[0-9a-f]{64}", key)
46
+ if lock["maturity"] != "stable":
47
+ raise ValueError("public Skill lock requires stable maturity")
48
+ return lock
49
+
50
+
51
+ def _same(field, expected, actual):
52
+ if expected != actual:
53
+ raise ValueError(f"public Skill {field}: expected {expected!r}, actual {actual!r}")
54
+
55
+
56
+ def _download(url, host, limit):
57
+ if urlsplit(url).netloc != host or urlsplit(url).scheme != "https":
58
+ raise ValueError(f"unexpected public Skill download host (expected {host})")
59
+ with urlopen(url, timeout=30) as response: # nosec B310 - restricted HTTPS PyPI hosts
60
+ final = urlsplit(response.geturl())
61
+ if final.netloc != host or final.scheme != "https":
62
+ raise ValueError("public Skill download changed origin")
63
+ data = response.read(limit + 1)
64
+ if len(data) > limit:
65
+ raise ValueError("public Skill download exceeds size limit")
66
+ return data
67
+
68
+
69
+ def _published_wheel(distribution, version, pinned=None):
70
+ _field(distribution, _NAME, "distribution")
71
+ _field(version, _VERSION, "version")
72
+ index = json.loads(_download(f"https://pypi.org/pypi/{distribution}/{version}/json",
73
+ "pypi.org", 4_000_000))
74
+ _same("distribution", distribution, re.sub(r"[-_.]+", "-", index["info"]["name"]).lower())
75
+ _same("version", version, index["info"]["version"])
76
+ choices = [row for row in index["urls"] if row["packagetype"] == "bdist_wheel"
77
+ and not row.get("yanked") and (not pinned or row["filename"] == pinned["wheel_filename"])]
78
+ if len(choices) != 1:
79
+ raise ValueError(f"expected one unambiguous public wheel for {distribution} {version}, found {len(choices)}")
80
+ release = choices[0]
81
+ digest = release["digests"]["sha256"]
82
+ if pinned:
83
+ _same("wheel_sha256", pinned["wheel_sha256"], digest)
84
+ body = _download(release["url"], "files.pythonhosted.org", 64_000_000)
85
+ _same("wheel_sha256", digest, sha256(body).hexdigest())
86
+ return release["filename"], digest, body
87
+
88
+
89
+ def _member(archive, name, limit):
90
+ if archive.namelist().count(name) != 1:
91
+ raise ValueError(f"expected one {name} in public wheel")
92
+ with archive.open(name) as handle:
93
+ body = handle.read(limit + 1)
94
+ if len(body) > limit:
95
+ raise ValueError(f"public Skill member exceeds size limit: {name}")
96
+ return body
97
+
98
+
99
+ def _relative_path(text):
100
+ path = PurePosixPath(text)
101
+ if not path.parts or path.is_absolute() or path.as_posix() != text or ".." in path.parts or "\\" in text or ":" in text:
102
+ raise ValueError("invalid package-relative public Skill path")
103
+ return path
104
+
105
+
106
+ def _binding(distribution, version, skill_id, pinned=None):
107
+ _field(skill_id, _SKILL, "skill ID")
108
+ filename, wheel_hash, wheel = _published_wheel(distribution, version, pinned)
109
+ try:
110
+ with ZipFile(BytesIO(wheel)) as archive:
111
+ registrations = [n for n in archive.namelist() if n.endswith(".dist-info/entry_points.txt")]
112
+ if len(registrations) != 1:
113
+ raise ValueError("public Skill wheel must declare its XRefKit entry point")
114
+ entry_points = ConfigParser(interpolation=None)
115
+ entry_points.read_string(_member(archive, registrations[0], 128_000).decode("utf-8"))
116
+ if not entry_points.has_section("xrefkit.skill_packages") or not entry_points.items("xrefkit.skill_packages"):
117
+ raise ValueError("public wheel is not an XRefKit Skill Package")
118
+ manifests = [n for n in archive.namelist() if n.endswith("/package_manifest.yaml")]
119
+ if len(manifests) != 1:
120
+ raise ValueError("public Skill wheel requires one package manifest")
121
+ manifest_path = _relative_path(manifests[0])
122
+ manifest_bytes = _member(archive, str(manifest_path), 1_000_000)
123
+ manifest = PackageManifest.model_validate(yaml.safe_load(manifest_bytes))
124
+ _same("manifest version", version, manifest.version)
125
+ items = [item for item in manifest.provides.skills if item.id == skill_id and item.governance_path]
126
+ if len(items) != 1:
127
+ raise ValueError(f"expected one native governed Skill {skill_id}, found {len(items)}")
128
+ item = items[0]
129
+ definition_path = manifest_path.parent / _relative_path(item.path)
130
+ governance_path = manifest_path.parent / _relative_path(item.governance_path)
131
+ definition_bytes = _member(archive, str(definition_path), 512_000)
132
+ governance_bytes = _member(archive, str(governance_path), 128 * 1024)
133
+ except BadZipFile as exc:
134
+ raise ValueError("invalid public Skill wheel") from exc
135
+ definition = parse_skill_definition(definition_bytes.decode("utf-8-sig"))
136
+ definition["content_hash"] = sha256(definition_bytes).hexdigest()
137
+ _same("definition skill ID", skill_id, definition["metadata"]["skill_id"])
138
+ _same("definition XID", item.xid, definition["metadata"]["xid"])
139
+ gov = parse_governance_record(governance_bytes, source=str(governance_path))
140
+ match_definition(gov, definition)
141
+ _same("maturity", "stable", gov["maturity"])
142
+ _same("promotion decision", "approved", gov["promotion"]["decision"])
143
+ lock = dict(distribution=distribution, version=version, skill_id=skill_id, package_id=manifest.package_id,
144
+ maturity=gov["maturity"], definition_sha256=definition["content_hash"],
145
+ governance_sha256=sha256(governance_bytes).hexdigest(), wheel_sha256=wheel_hash,
146
+ wheel_filename=filename)
147
+ return validate_public_skill_lock(lock), (
148
+ (manifest_path, sha256(manifest_bytes).hexdigest()), (definition_path, lock["definition_sha256"]),
149
+ (governance_path, lock["governance_sha256"]))
150
+
151
+
152
+ def resolve_public_skill(distribution, version, skill_id):
153
+ """Resolve a proposed Skill using public wheel bytes, independently of local overlays."""
154
+ lock, _ = _binding(distribution, version, skill_id)
155
+ return lock
156
+
157
+
158
+ def verify_public_skill(lock) -> tuple[Path, Path]:
159
+ """Return exact installed definition and governance paths matching the approved public wheel."""
160
+ validate_public_skill_lock(lock)
161
+ name = lock["distribution"]
162
+ try:
163
+ dist = metadata.distribution(name)
164
+ except metadata.PackageNotFoundError as exc:
165
+ raise ValueError(f"public Skill distribution: expected {name} {lock['version']}, actual not installed") from exc
166
+ _same("installed version", lock["version"], dist.version)
167
+ if not any(ep.group == "xrefkit.skill_packages" for ep in dist.entry_points):
168
+ raise ValueError(f"{name} is not an installed XRefKit Skill Package")
169
+ actual, members = _binding(name, lock["version"], lock["skill_id"], pinned=lock)
170
+ for key in sorted(lock):
171
+ _same(key, lock[key], actual[key])
172
+ owned = {p.as_posix() for p in dist.files or ()}
173
+ site = Path(dist.locate_file("")).resolve()
174
+ verified = []
175
+ for member, expected in members:
176
+ if str(member) not in owned:
177
+ raise ValueError(f"expected {name} to own {member}, actual absent from installed distribution")
178
+ path = Path(dist.locate_file(member)).resolve()
179
+ if not path.is_relative_to(site):
180
+ raise ValueError(f"installed public Skill member is outside the distribution: {member}")
181
+ _same(str(member), expected, sha256(path.read_bytes()).hexdigest())
182
+ verified.append(path)
183
+ return verified[1], verified[2]
@@ -93,6 +93,11 @@ def load_governance_record(path: str | Path) -> dict[str, Any]:
93
93
  path = Path(path)
94
94
  with path.open("rb") as source:
95
95
  raw = source.read(MAX_RECORD_BYTES + 1)
96
+ return parse_governance_record(raw, source=path.as_posix())
97
+
98
+
99
+ def parse_governance_record(raw: bytes, *, source: str) -> dict[str, Any]:
100
+ """Parse a bounded governance record and retain its original byte hash."""
96
101
  if len(raw) > MAX_RECORD_BYTES:
97
102
  raise ValueError("governance record exceeds 128KB")
98
103
  try:
@@ -100,7 +105,7 @@ def load_governance_record(path: str | Path) -> dict[str, Any]:
100
105
  except (UnicodeDecodeError, json.JSONDecodeError) as exc:
101
106
  raise ValueError(f"invalid governance JSON: {exc}") from exc
102
107
  result = dict(validate_governance_record(value))
103
- result["_path"] = path.as_posix()
108
+ result["_path"] = source
104
109
  result["_content_hash"] = hashlib.sha256(raw).hexdigest()
105
110
  return result
106
111
 
@@ -130,5 +135,6 @@ __all__ = [
130
135
  "governance_projection",
131
136
  "load_governance_record",
132
137
  "match_definition",
138
+ "parse_governance_record",
133
139
  "validate_governance_record",
134
140
  ]