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.
- {xrefkit-0.7.14/xrefkit.egg-info → xrefkit-0.7.16}/PKG-INFO +11 -1
- {xrefkit-0.7.14 → xrefkit-0.7.16}/README.md +10 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/pyproject.toml +2 -2
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_ci_workflow_invariants.py +4 -1
- xrefkit-0.7.16/tests/test_public_skill.py +93 -0
- xrefkit-0.7.16/tests/test_skill_knowledge_audit.py +146 -0
- xrefkit-0.7.16/tests/test_verify_runtime_wheel.py +51 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/__init__.py +1 -1
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/cli.py +5 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/operations_cli.py +1 -0
- xrefkit-0.7.16/xrefkit/public_skill.py +183 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/skill_definition_governance.py +7 -1
- xrefkit-0.7.16/xrefkit/skill_knowledge_audit.html +231 -0
- xrefkit-0.7.16/xrefkit/skill_knowledge_audit.py +292 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/skillrun.py +21 -7
- {xrefkit-0.7.14 → xrefkit-0.7.16/xrefkit.egg-info}/PKG-INFO +11 -1
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit.egg-info/SOURCES.txt +6 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/LICENSE +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/setup.cfg +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_artifact_selected_family.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_attention_pet.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_attention_pet_client_protocol.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_attention_pet_codex_session.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_attention_pet_fit.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_azure_connection.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_azure_import.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_azure_recovery.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_azure_update_candidate.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_azure_writer.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_boundary_analysis.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_brownfield_csharp_structure_definitions.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_brownfield_file_editing_protocol.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_business_intake_conversation_definitions.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_business_intake_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_calibration_lint.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_catalog_preparation_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_check_skill_knowledge_xids.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_cli.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_code_constraint_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_collect_analyzer_sarif.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_compact_skill_logs.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_constraint_derivation_family_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_constraint_derivation_selected_family.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_contribution_adoption_bytes.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_contribution_returns.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_convert_to_xrefkit_skill.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_cs_scope_probe.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_csharp_commonality.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_csharp_naming_profile.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_ctx.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_cutover_readiness.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_dashboard.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_database_batch_definition_migration.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_decision_checklist.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_decision_handoff.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_decision_trace.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_design_business_intake_selected_family.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_design_planning_definition_migration.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_dotnet_definition_candidate.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_editorial_family_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_editorial_intake_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_editorial_selected_family.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_embedded_startup_pack.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_engineering_decision.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_environment_isolation.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_error_policy_audit.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_error_policy_locator.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_execution_binding.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_existing_skill_definition_batch.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_final_skilldefinition_batch.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_flow_selected_family.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_fm_multiroot.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_gate.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_gateway.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_gateway_mcp.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_gateway_skill_adapter.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_gateway_work_items.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_goal_desired_state.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_governance_entry.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_governance_host.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_host_precheck.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_human_evaluation.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_implementation_flow_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_implementation_review_selected_family.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_inbound_uploads.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_instruction_workflow.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_knowledge_relations_validator.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_language_review_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_legacy_guidance.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_legacy_migration.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_legacy_resources.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_mcp_package_routing.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_mcp_setup.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_mcp_skills_extension.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_mcp_skills_transport.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_mcp_subagent_startup.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_mcp_subagent_startup_integration.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_ontology_assessment_validator.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_os_family_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_os_knowledge_family_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_os_selected_family.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_ownership.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_package_knowledge_resolution.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_package_skill_run.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_packaged_native_governance.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_packmeta.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_plan_markdown.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_plan_observation.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_principle_discovery.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_project_management_materialization.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_project_management_offline_progress.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_project_quality_baseline.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_qa_report_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_quality_issue_dashboard.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_quality_issues.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_reporting_profiles.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_reporting_quality.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_repository_skill_adoption.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_repository_startup_pack.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_resource_provider.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_runtime_contracts.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_sarif_to_locator.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_security_definition_migration.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_site_release_metadata.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_definition_governance.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_definition_mcp.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_definition_runtime.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_edits.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_maturity_return.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_release_compatibility.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skill_runtime_audit.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skillmeta.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_skills_sync.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_source_analysis_fragments.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_structure_catalog.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_subagent_startup.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_subagent_startup_boundaries.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_unknown_resolution.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_wbs.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_work_management.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_work_packages.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_workflow_family_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_xref.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_xrefkit_instance.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_xrefkit_tools.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_xrefkit_v2_discovery.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_xrefkit_v2_models.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/tests/test_xrefkit_v2_pipeline.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/__main__.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/__init__.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/__main__.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/client.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/client_protocol.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/codex_session.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/evaluator.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/model.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/presentation.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/profiles.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/scenarios.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/server.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/attention_pet/store.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/azure_connection.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/azure_import.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/azure_recovery.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/azure_update_candidate.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/azure_writer.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/boundary_analysis.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/catalog_cli.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/contracts.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/ctx.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/dashboard.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/decision_checklist.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/decision_handoff.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/decision_trace.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/discovery.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/engineering_decision.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/execution_binding.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/execution_binding_cli.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/gate.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/gateway.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/goalstate.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/governance_entry.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/governance_entry_cli.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/governance_host.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/hashing.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/host_execution.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/host_precheck.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/import_skill.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/instance.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/loaders.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/__init__.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/audit.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/bootstrap.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/catalog.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/cli.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/client_cache.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/client_flow.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/context_registry.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/context_token.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/contracts.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/contribution_adoption.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/contribution_returns.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/dist.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/gateway.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/governed_overlays.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/inbound_uploads.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/knowledge_edits.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/legacy_guidance.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/legacy_migration.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/legacy_resources.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/ownership.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/repository.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/schemas.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/server.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/setup.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/skill_edits.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/skill_maturity.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/skills_extension.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/skills_transport.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/startup_contract_pack.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/subagent_startup.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp/update_gate_intake.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/mcp_tools.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/__init__.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/common.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/effective_bundle.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/human_evaluation.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/local_manifest.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/package_manifest.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/run_log.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/server_config.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/models/skill_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/ownership.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/packmeta.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/plan_markdown.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/plan_observation.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/principle_discovery.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/quality_issues.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/registry.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/reporting.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/reporting_profiles.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/repository_skills.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resolver.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resource_provider.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/attention_pet/client-state.schema.json +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/attention_pet/pet.css +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/attention_pet/pet.html +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/attention_pet/pet.js +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/contracts.json +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/current.json +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/generations/7a682a5272907354/contracts.json +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/generations/7a682a5272907354/model_body.md +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/generations/9929294385ccb7b0/contracts.json +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/generations/9929294385ccb7b0/model_body.md +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/model_body.md +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/000_agent_entry.md +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/011_startup_xref_routing.md +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/015_shared_memory_operations.md +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/016_uncertainty_protocol.md +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/017_base_and_xref_layering.md +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/053_context_direction_security_guard.md +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/base/startup_sources/yomiyasu_LICENSE.txt +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/engineering-decision-checklist.json +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/migration/docs/guides/062_legacy_flow_skill_migration_guide.md +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/migration/knowledge/operations/130_legacy_flow_skill_migration_rules.md +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/migration/knowledge/organization/160_context_direction_guard_rules.md +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/migration/skills/os/legacy_flow_skill_migration/SKILL.v1.md +0 -0
- {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
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/migration/skills/repository_adoption.json +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/resources/migration/tools/migrate_legacy_flow_skill.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/runlog.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/skill_definition.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/skill_definition_catalog.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/skillmeta.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/skills_sync.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/structure_catalog.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/subagent_startup.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/tools/__init__.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/tools/__main__.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/unknown_resolution.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/v2_cli.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/wbs.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/work_management.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/work_management_view.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/workspace.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit/xref.py +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit.egg-info/dependency_links.txt +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit.egg-info/entry_points.txt +0 -0
- {xrefkit-0.7.14 → xrefkit-0.7.16}/xrefkit.egg-info/requires.txt +0 -0
- {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.
|
|
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
|

|
|
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
|

|
|
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.
|
|
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=
|
|
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", "")
|
|
@@ -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"] =
|
|
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
|
]
|