contextcompass 2.15.0__py3-none-any.whl
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.
- contextcompass-2.15.0.dist-info/METADATA +673 -0
- contextcompass-2.15.0.dist-info/RECORD +452 -0
- contextcompass-2.15.0.dist-info/WHEEL +4 -0
- contextcompass-2.15.0.dist-info/entry_points.txt +2 -0
- contextcompass-2.15.0.dist-info/licenses/LICENSE +21 -0
- contextcompass_cli/__init__.py +74 -0
- contextcompass_cli/__main__.py +195 -0
- contextcompass_cli/_package/AGENTS.MD +310 -0
- contextcompass_cli/_package/CONTEXT_COMPACTION.md +110 -0
- contextcompass_cli/_package/MANIFEST.md +485 -0
- contextcompass_cli/_package/PROFILE_CLASS_CREATION_GUIDE.md +426 -0
- contextcompass_cli/_package/README.md +266 -0
- contextcompass_cli/_package/SKILLS.MD +144 -0
- contextcompass_cli/_package/agent_onboarding/default/continuity_fact_checker/AGENTS.MD +54 -0
- contextcompass_cli/_package/agent_onboarding/default/continuity_fact_checker/README.md +43 -0
- contextcompass_cli/_package/agent_onboarding/default/continuity_fact_checker/SKILLS.MD +44 -0
- contextcompass_cli/_package/agent_onboarding/default/continuity_fact_checker/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/continuity_fact_checker/behavioral_guidelines/continuity_fact_checker_workflow.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/continuity_fact_checker/examples/continuity_fact_checker_task_flow.md +24 -0
- contextcompass_cli/_package/agent_onboarding/default/continuity_fact_checker/policies/continuity_fact_checker_handoff_policy.md +20 -0
- contextcompass_cli/_package/agent_onboarding/default/continuity_fact_checker/policies/continuity_fact_checker_quality_policy.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/continuity_fact_checker/skills/continuity_fact_checker.md +37 -0
- contextcompass_cli/_package/agent_onboarding/default/continuity_fact_checker/skills/continuity_fact_checker_advanced_context.md +17 -0
- contextcompass_cli/_package/agent_onboarding/default/continuity_fact_checker/skills/continuity_fact_checker_deliverables.md +26 -0
- contextcompass_cli/_package/agent_onboarding/default/continuity_fact_checker/skills/continuity_fact_checker_execution.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/continuity_fact_checker/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/AGENTS.MD +85 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/README.md +62 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/SKILLS.MD +74 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/behavioral_guidelines/design_engineer_workflow.md +25 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/behavioral_guidelines/design_validation_and_handoff.md +25 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/examples/adr_example.md +40 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/examples/design_task_flow.md +33 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/policies/decision_record_policy.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/policies/design_quality_policy.md +30 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/policies/design_review_policy.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/policies/system_document_quality_rubric.md +236 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/adr_and_decision_hygiene.md +38 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/api_and_interface_design.md +36 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/architecture_contexts.md +40 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/architecture_patch_contracts.md +43 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/architecture_tradeoffs.md +33 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/code_description_patch_contracts.md +46 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/component_patch_contracts.md +41 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/data_modeling.md +34 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/decomposition_and_boundaries.md +42 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/design_engineer_execution.md +65 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/design_review_protocol.md +34 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/nonfunctional_requirements.md +34 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/patch_framework_design.md +79 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/requirements_to_architecture.md +39 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/src_architecture_instructions.md +347 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/src_components_instructions.md +405 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/system_design_method.md +45 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/tests_architecture_instructions.md +375 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/skills/tests_components_instructions.md +406 -0
- contextcompass_cli/_package/agent_onboarding/default/design_engineer/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/default/developmental_editor/AGENTS.MD +53 -0
- contextcompass_cli/_package/agent_onboarding/default/developmental_editor/README.md +42 -0
- contextcompass_cli/_package/agent_onboarding/default/developmental_editor/SKILLS.MD +44 -0
- contextcompass_cli/_package/agent_onboarding/default/developmental_editor/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/developmental_editor/behavioral_guidelines/developmental_editor_workflow.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/developmental_editor/examples/developmental_editor_task_flow.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/developmental_editor/policies/developmental_editor_handoff_policy.md +20 -0
- contextcompass_cli/_package/agent_onboarding/default/developmental_editor/policies/developmental_editor_quality_policy.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/developmental_editor/skills/developmental_editor.md +36 -0
- contextcompass_cli/_package/agent_onboarding/default/developmental_editor/skills/developmental_editor_advanced_context.md +17 -0
- contextcompass_cli/_package/agent_onboarding/default/developmental_editor/skills/developmental_editor_deliverables.md +25 -0
- contextcompass_cli/_package/agent_onboarding/default/developmental_editor/skills/developmental_editor_execution.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/developmental_editor/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/default/draft_writer/AGENTS.MD +54 -0
- contextcompass_cli/_package/agent_onboarding/default/draft_writer/README.md +43 -0
- contextcompass_cli/_package/agent_onboarding/default/draft_writer/SKILLS.MD +44 -0
- contextcompass_cli/_package/agent_onboarding/default/draft_writer/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/draft_writer/behavioral_guidelines/draft_writer_workflow.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/draft_writer/examples/draft_writer_task_flow.md +24 -0
- contextcompass_cli/_package/agent_onboarding/default/draft_writer/policies/draft_writer_handoff_policy.md +20 -0
- contextcompass_cli/_package/agent_onboarding/default/draft_writer/policies/draft_writer_quality_policy.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/draft_writer/skills/draft_writer.md +37 -0
- contextcompass_cli/_package/agent_onboarding/default/draft_writer/skills/draft_writer_advanced_context.md +17 -0
- contextcompass_cli/_package/agent_onboarding/default/draft_writer/skills/draft_writer_deliverables.md +26 -0
- contextcompass_cli/_package/agent_onboarding/default/draft_writer/skills/draft_writer_execution.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/draft_writer/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/AGENTS.MD +493 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/README.md +53 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/SKILLS.MD +263 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/behavioral_guidelines/engineer_workflow.md +24 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/behavioral_guidelines/task_execution_and_validation.md +34 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/examples/artifact_workflow.md +104 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/examples/eng_task_flow.md +30 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/policies/ctx_autonomy_policy.md +34 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/policies/ctx_autonomy_rubric.md +161 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/policies/engineer_quality_policy.md +33 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/skills/context_protocol.md +70 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/skills/documentation_standards.md +120 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/skills/engineer_execution.md +62 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/skills/package_maintenance.md +195 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/skills/patch_artifact_consumption.md +68 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/skills/patch_framework_gating.md +72 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/skills/src_graph_generation.md +341 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/skills/src_graph_usage.md +161 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/skills/staleness_protocol.md +49 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/skills/system_document_build.md +360 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/skills/system_orientation.md +83 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/skills/technical_expertise.md +48 -0
- contextcompass_cli/_package/agent_onboarding/default/engineer/workflows/README.md +9 -0
- contextcompass_cli/_package/agent_onboarding/default/general/AGENTS.MD +283 -0
- contextcompass_cli/_package/agent_onboarding/default/general/README.md +38 -0
- contextcompass_cli/_package/agent_onboarding/default/general/SKILLS.MD +92 -0
- contextcompass_cli/_package/agent_onboarding/default/general/WORKFLOWS.MD +23 -0
- contextcompass_cli/_package/agent_onboarding/default/general/behavioral_guidelines/README.md +12 -0
- contextcompass_cli/_package/agent_onboarding/default/general/behavioral_guidelines/agent_lifecycle_and_heartbeat.md +37 -0
- contextcompass_cli/_package/agent_onboarding/default/general/behavioral_guidelines/onboarding_summary.md +41 -0
- contextcompass_cli/_package/agent_onboarding/default/general/behavioral_guidelines/work_intake_and_execution.md +44 -0
- contextcompass_cli/_package/agent_onboarding/default/general/policies/policy_skills.md +174 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/active_documentation.md +86 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/active_pointerboard.md +81 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/agent_identity.md +38 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/agent_lifecycle.md +21 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/agent_stance.md +38 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/career_selection.md +83 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/compaction_requirements.md +147 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/configuration_standards.md +72 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/context_compaction.md +104 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/context_gold.md +31 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/context_management.md +79 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/context_window_budget.md +64 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/execution_contract.md +234 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/general.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/llm_full_usage.md +111 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/mailbox_protocol.md +85 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/memory_management.md +28 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/mrp_policy.md +40 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/package_upgrade.md +135 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/reactive_documentation.md +105 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/repo_topology.md +25 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/role_local_workflows.md +41 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/security_and_secrets.md +46 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/self_certification.md +49 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/ticket_closure_attention_sync.md +57 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/ticket_microcycle.md +44 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/ticketing.md +175 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/ticketing_skill_contract.md +52 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/unknowns_gate_reference.md +66 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/user_approved_certification.md +32 -0
- contextcompass_cli/_package/agent_onboarding/default/general/skills/workflow.md +289 -0
- contextcompass_cli/_package/agent_onboarding/default/general/workflows/README.md +9 -0
- contextcompass_cli/_package/agent_onboarding/default/general/workflows/cleanup_context_compass.md +205 -0
- contextcompass_cli/_package/agent_onboarding/default/general/workflows/role_creation.md +39 -0
- contextcompass_cli/_package/agent_onboarding/default/general/workflows/start_context_compass_work.md +102 -0
- contextcompass_cli/_package/agent_onboarding/default/general/workflows/sync_attention_board.md +91 -0
- contextcompass_cli/_package/agent_onboarding/default/general/workflows/turn_in_selected_tickets.md +95 -0
- contextcompass_cli/_package/agent_onboarding/default/general/workflows/workflow_creation.md +38 -0
- contextcompass_cli/_package/agent_onboarding/default/line_copy_editor/AGENTS.MD +53 -0
- contextcompass_cli/_package/agent_onboarding/default/line_copy_editor/README.md +42 -0
- contextcompass_cli/_package/agent_onboarding/default/line_copy_editor/SKILLS.MD +44 -0
- contextcompass_cli/_package/agent_onboarding/default/line_copy_editor/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/line_copy_editor/behavioral_guidelines/line_copy_editor_workflow.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/line_copy_editor/examples/line_copy_editor_task_flow.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/line_copy_editor/policies/line_copy_editor_handoff_policy.md +20 -0
- contextcompass_cli/_package/agent_onboarding/default/line_copy_editor/policies/line_copy_editor_quality_policy.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/line_copy_editor/skills/line_copy_editor.md +36 -0
- contextcompass_cli/_package/agent_onboarding/default/line_copy_editor/skills/line_copy_editor_advanced_context.md +17 -0
- contextcompass_cli/_package/agent_onboarding/default/line_copy_editor/skills/line_copy_editor_deliverables.md +25 -0
- contextcompass_cli/_package/agent_onboarding/default/line_copy_editor/skills/line_copy_editor_execution.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/line_copy_editor/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/default/new/AGENTS.MD +79 -0
- contextcompass_cli/_package/agent_onboarding/default/new/README.md +54 -0
- contextcompass_cli/_package/agent_onboarding/default/new/SKILLS.MD +35 -0
- contextcompass_cli/_package/agent_onboarding/default/new/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/new/behavioral_guidelines/user_onboarding_flow.md +52 -0
- contextcompass_cli/_package/agent_onboarding/default/new/policies/new_onboarding_policy.md +59 -0
- contextcompass_cli/_package/agent_onboarding/default/new/skills/configuration_map_guide.md +83 -0
- contextcompass_cli/_package/agent_onboarding/default/new/skills/first_time_profile_setup.md +60 -0
- contextcompass_cli/_package/agent_onboarding/default/new/skills/new.md +54 -0
- contextcompass_cli/_package/agent_onboarding/default/new/skills/onboarding_completion_and_next_step.md +54 -0
- contextcompass_cli/_package/agent_onboarding/default/new/skills/profile_model_explained.md +120 -0
- contextcompass_cli/_package/agent_onboarding/default/new/skills/system_overview_for_user.md +51 -0
- contextcompass_cli/_package/agent_onboarding/default/new/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/AGENTS.MD +63 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/README.md +41 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/SKILLS.MD +62 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/behavioral_guidelines/incident_workflow.md +17 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/behavioral_guidelines/platform_engineer_workflow.md +18 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/examples/platform_task_flow.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/policies/operational_safety_policy.md +20 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/policies/platform_quality_policy.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/policies/production_change_management_policy.md +18 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/skills/ci_cd_and_release.md +28 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/skills/deployment_and_environments.md +25 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/skills/incident_response_and_runbooks.md +35 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/skills/infrastructure_as_code.md +24 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/skills/observability_and_monitoring.md +28 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/skills/performance_capacity_cost.md +20 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/skills/platform_engineer_execution.md +41 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/skills/platform_security_basics.md +25 -0
- contextcompass_cli/_package/agent_onboarding/default/platform_engineer/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/default/proofreader/AGENTS.MD +53 -0
- contextcompass_cli/_package/agent_onboarding/default/proofreader/README.md +42 -0
- contextcompass_cli/_package/agent_onboarding/default/proofreader/SKILLS.MD +44 -0
- contextcompass_cli/_package/agent_onboarding/default/proofreader/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/proofreader/behavioral_guidelines/proofreader_workflow.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/proofreader/examples/proofreader_task_flow.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/proofreader/policies/proofreader_handoff_policy.md +20 -0
- contextcompass_cli/_package/agent_onboarding/default/proofreader/policies/proofreader_quality_policy.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/proofreader/skills/proofreader.md +36 -0
- contextcompass_cli/_package/agent_onboarding/default/proofreader/skills/proofreader_advanced_context.md +17 -0
- contextcompass_cli/_package/agent_onboarding/default/proofreader/skills/proofreader_deliverables.md +25 -0
- contextcompass_cli/_package/agent_onboarding/default/proofreader/skills/proofreader_execution.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/proofreader/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/AGENTS.MD +58 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/README.md +41 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/SKILLS.MD +61 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/behavioral_guidelines/qa_workflow.md +18 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/behavioral_guidelines/release_signoff_workflow.md +17 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/examples/qa_task_flow.md +24 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/policies/defect_severity_policy.md +24 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/policies/quality_gate_policy.md +18 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/policies/test_evidence_policy.md +18 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/skills/bug_triage_and_repro.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/skills/qa_engineer_execution.md +29 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/skills/quality_metrics.md +24 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/skills/regression_and_release_quality.md +28 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/skills/test_automation_practices.md +30 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/skills/test_case_design.md +27 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/skills/test_data_and_environments.md +20 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/skills/test_strategy_and_planning.md +31 -0
- contextcompass_cli/_package/agent_onboarding/default/qa_engineer/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/default/researcher/AGENTS.MD +55 -0
- contextcompass_cli/_package/agent_onboarding/default/researcher/README.md +44 -0
- contextcompass_cli/_package/agent_onboarding/default/researcher/SKILLS.MD +44 -0
- contextcompass_cli/_package/agent_onboarding/default/researcher/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/researcher/behavioral_guidelines/researcher_workflow.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/researcher/examples/researcher_task_flow.md +25 -0
- contextcompass_cli/_package/agent_onboarding/default/researcher/policies/researcher_handoff_policy.md +20 -0
- contextcompass_cli/_package/agent_onboarding/default/researcher/policies/researcher_quality_policy.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/researcher/skills/researcher.md +38 -0
- contextcompass_cli/_package/agent_onboarding/default/researcher/skills/researcher_advanced_context.md +17 -0
- contextcompass_cli/_package/agent_onboarding/default/researcher/skills/researcher_deliverables.md +27 -0
- contextcompass_cli/_package/agent_onboarding/default/researcher/skills/researcher_execution.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/researcher/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/AGENTS.MD +55 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/README.md +43 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/SKILLS.MD +62 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/behavioral_guidelines/security_signoff_and_escalation.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/behavioral_guidelines/security_workflow.md +18 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/examples/security_review_flow.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/policies/risk_acceptance_policy.md +17 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/policies/secrets_and_keys_policy.md +19 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/policies/security_review_policy.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/skills/authn_authz_basics.md +24 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/skills/dependency_and_supply_chain.md +20 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/skills/incident_response_security.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/skills/logging_audit_privacy.md +16 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/skills/secure_architecture_review.md +20 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/skills/secure_coding_review.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/skills/security_engineer_execution.md +28 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/skills/threat_modeling.md +25 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/skills/vulnerability_management.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/security_engineer/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/default/story_designer/AGENTS.MD +56 -0
- contextcompass_cli/_package/agent_onboarding/default/story_designer/README.md +45 -0
- contextcompass_cli/_package/agent_onboarding/default/story_designer/SKILLS.MD +44 -0
- contextcompass_cli/_package/agent_onboarding/default/story_designer/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/story_designer/behavioral_guidelines/story_designer_workflow.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/story_designer/examples/story_designer_task_flow.md +26 -0
- contextcompass_cli/_package/agent_onboarding/default/story_designer/policies/story_designer_handoff_policy.md +20 -0
- contextcompass_cli/_package/agent_onboarding/default/story_designer/policies/story_designer_quality_policy.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/story_designer/skills/story_designer.md +39 -0
- contextcompass_cli/_package/agent_onboarding/default/story_designer/skills/story_designer_advanced_context.md +17 -0
- contextcompass_cli/_package/agent_onboarding/default/story_designer/skills/story_designer_deliverables.md +28 -0
- contextcompass_cli/_package/agent_onboarding/default/story_designer/skills/story_designer_execution.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/story_designer/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/default/story_novel_artist/AGENTS.MD +56 -0
- contextcompass_cli/_package/agent_onboarding/default/story_novel_artist/README.md +45 -0
- contextcompass_cli/_package/agent_onboarding/default/story_novel_artist/SKILLS.MD +44 -0
- contextcompass_cli/_package/agent_onboarding/default/story_novel_artist/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/default/story_novel_artist/behavioral_guidelines/story_novel_artist_workflow.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/story_novel_artist/examples/story_novel_artist_task_flow.md +26 -0
- contextcompass_cli/_package/agent_onboarding/default/story_novel_artist/policies/story_novel_artist_handoff_policy.md +20 -0
- contextcompass_cli/_package/agent_onboarding/default/story_novel_artist/policies/story_novel_artist_quality_policy.md +22 -0
- contextcompass_cli/_package/agent_onboarding/default/story_novel_artist/skills/story_novel_artist.md +39 -0
- contextcompass_cli/_package/agent_onboarding/default/story_novel_artist/skills/story_novel_artist_advanced_context.md +17 -0
- contextcompass_cli/_package/agent_onboarding/default/story_novel_artist/skills/story_novel_artist_deliverables.md +28 -0
- contextcompass_cli/_package/agent_onboarding/default/story_novel_artist/skills/story_novel_artist_execution.md +23 -0
- contextcompass_cli/_package/agent_onboarding/default/story_novel_artist/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/data_engineer/AGENTS.MD +66 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/data_engineer/SKILLS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/data_engineer/WORKFLOWS.MD +15 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/data_engineer/behavioral_guidelines/data_engineer_behavior_overrides.md +6 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/data_engineer/policies/data_engineer_policy_overrides.md +6 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/data_engineer/profile_overrides.md +9 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/data_engineer/skills/data_engineer_skill_overrides.md +6 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/data_engineer/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/AGENTS.MD +145 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/SKILLS.MD +37 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/WORKFLOWS.MD +17 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/behavioral_guidelines/synaptic_finishing_developer_behavior_overrides.md +12 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/examples/python/comment_finishing_examples.py +65 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/examples/python/docstring_finishing_examples.py +126 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/examples/python/pytest_component_finishing_examples.py +51 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/examples/python/pytest_integration_finishing_examples.py +59 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/examples/python/pytest_unit_finishing_examples.py +66 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/policies/synaptic_finishing_developer_policy_overrides.md +14 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/profile_overrides.md +17 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/skills/documentation/comment_craft.md +51 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/skills/documentation/docstring_craft.md +86 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/skills/documentation/docstring_test_alignment.md +51 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/skills/documentation/system_aware_docstrings.md +64 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/skills/synaptic_finishing_developer_skill_overrides.md +11 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/skills/testing/component_tests.md +45 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/skills/testing/evidence_reporting.md +25 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/skills/testing/mocking.md +35 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/skills/testing/pytest_integration.md +32 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/skills/testing/pytest_unit.md +49 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/skills/testing/regression_tests.md +24 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/skills/testing/testing_overview.md +71 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/workflows/optimize_pytests_for_repo.md +272 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_finishing_developer/workflows/polish_repo_documentation.md +247 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/AGENTS.MD +386 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/README.md +31 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/SKILLS.MD +44 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/WORKFLOWS.MD +16 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/behavioral_guidelines/synaptic_behavior_overrides.md +17 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/examples/python/anti_patterns.py +19 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/examples/python/cleanup_patterns.py +22 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/examples/python/docstrings.py +19 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/examples/python/logging_patterns.py +11 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/examples/python/protocols_and_abc.py +15 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/examples/python/pytest_component_examples.py +15 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/examples/python/pytest_integration_examples.py +17 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/examples/python/pytest_unit_examples.py +13 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/policies/synaptic_policy_overrides.md +22 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/profile_overrides.md +27 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/python/attribute_aliasing_skill_benchmark.py +35 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/python/banned_patterns.md +110 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/python/cleanup_and_disposal.md +79 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/python/comments.md +39 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/python/docstrings.md +90 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/python/error_model.md +28 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/python/hot_path_attribute_aliasing.md +52 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/python/init_and_ownership.md +35 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/python/interfaces.md +47 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/python/logging.md +37 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/python/module_scope.md +38 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/python/refactor_limits.md +44 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/python/typing.md +52 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/synaptic_skill_overrides.md +24 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/testing/evidence_reporting.md +35 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/testing/mocking.md +31 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/testing/pytest_integration.md +36 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/testing/pytest_unit.md +42 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/testing/regression_tests.md +26 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/skills/testing/testing_overview.md +196 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/workflows/README.md +8 -0
- contextcompass_cli/_package/agent_onboarding/user_defined/synaptic_python_developer/workflows/synaptic_python_developer_onboarding.md +226 -0
- contextcompass_cli/_package/artifact_board.md +64 -0
- contextcompass_cli/_package/artifacts/IMPORTANT_CONSIDERATION.md +43 -0
- contextcompass_cli/_package/artifacts/README.md +41 -0
- contextcompass_cli/_package/attention_board.md +79 -0
- contextcompass_cli/_package/config/context_compass_config.yaml +101 -0
- contextcompass_cli/_package/context_management/README.md +21 -0
- contextcompass_cli/_package/context_management/artifacts/.gitkeep +1 -0
- contextcompass_cli/_package/context_management/context_artifact_template.md +42 -0
- contextcompass_cli/_package/context_management/context_board.md +27 -0
- contextcompass_cli/_package/examples/adr_example.md +29 -0
- contextcompass_cli/_package/examples/artifact_workflow.md +20 -0
- contextcompass_cli/_package/examples/continuity_fact_checker_task_flow.md +23 -0
- contextcompass_cli/_package/examples/design_task_flow.md +35 -0
- contextcompass_cli/_package/examples/developmental_editor_task_flow.md +22 -0
- contextcompass_cli/_package/examples/draft_writer_task_flow.md +23 -0
- contextcompass_cli/_package/examples/eng_task_flow.md +31 -0
- contextcompass_cli/_package/examples/example_architecture/.gitkeep +0 -0
- contextcompass_cli/_package/examples/example_architecture/src_architecture.md +136 -0
- contextcompass_cli/_package/examples/example_architecture/src_architecture_index.md +46 -0
- contextcompass_cli/_package/examples/example_architecture/tests_architecture.md +148 -0
- contextcompass_cli/_package/examples/example_architecture/tests_architecture_index.md +46 -0
- contextcompass_cli/_package/examples/example_completed/.gitkeep +0 -0
- contextcompass_cli/_package/examples/example_completed/2026-02-19_context_compass_release_overview_artifact.md +33 -0
- contextcompass_cli/_package/examples/example_components/.gitkeep +0 -0
- contextcompass_cli/_package/examples/example_components/src_components.md +169 -0
- contextcompass_cli/_package/examples/example_components/src_components_index.md +44 -0
- contextcompass_cli/_package/examples/example_components/tests_components.md +96 -0
- contextcompass_cli/_package/examples/example_components/tests_components_index.md +42 -0
- contextcompass_cli/_package/examples/example_epics/.gitkeep +0 -0
- contextcompass_cli/_package/examples/example_epics/2026-02-19_context_compass_release_readiness_example_pack_epic.md +130 -0
- contextcompass_cli/_package/examples/example_graph_details/README.md +131 -0
- contextcompass_cli/_package/examples/example_graph_details/src/example/__init__.py +4 -0
- contextcompass_cli/_package/examples/example_graph_details/src/example/core/interfaces.py +10 -0
- contextcompass_cli/_package/examples/example_graph_details/src/example/core/resource.py +15 -0
- contextcompass_cli/_package/examples/example_graph_details/src/example/pipeline/pipeline.py +20 -0
- contextcompass_cli/_package/examples/example_graph_details/src/example/pipeline/stage.py +11 -0
- contextcompass_cli/_package/examples/example_graph_details/src/example/storage/store.py +20 -0
- contextcompass_cli/_package/examples/example_graph_details/src_graph.md +192 -0
- contextcompass_cli/_package/examples/example_graph_details/src_graph_index.md +32 -0
- contextcompass_cli/_package/examples/example_stories/.gitkeep +0 -0
- contextcompass_cli/_package/examples/example_stories/2026-02-19_context_compass_release_readiness_examples_story.md +120 -0
- contextcompass_cli/_package/examples/example_tasks/.gitkeep +0 -0
- contextcompass_cli/_package/examples/example_tasks/2026-02-19_context_compass_release_readiness_pack_task.md +147 -0
- contextcompass_cli/_package/examples/line_copy_editor_task_flow.md +23 -0
- contextcompass_cli/_package/examples/platform_task_flow.md +26 -0
- contextcompass_cli/_package/examples/proofreader_task_flow.md +23 -0
- contextcompass_cli/_package/examples/qa_task_flow.md +26 -0
- contextcompass_cli/_package/examples/repo_overview.md +63 -0
- contextcompass_cli/_package/examples/researcher_task_flow.md +23 -0
- contextcompass_cli/_package/examples/security_review_flow.md +24 -0
- contextcompass_cli/_package/examples/story_designer_task_flow.md +23 -0
- contextcompass_cli/_package/examples/story_novel_artist_task_flow.md +22 -0
- contextcompass_cli/_package/mailbox_board.md +79 -0
- contextcompass_cli/_package/special_instructions/README.md +16 -0
- contextcompass_cli/_package/system_docs/.gitkeep +0 -0
- contextcompass_cli/_package/system_docs/patches/active/README.md +25 -0
- contextcompass_cli/_package/system_docs/patches/active/_template_patch_id/architecture_patch.md +53 -0
- contextcompass_cli/_package/system_docs/patches/active/_template_patch_id/code_description_patch_TEMPLATE_COMPONENT.md +39 -0
- contextcompass_cli/_package/system_docs/patches/active/_template_patch_id/component_patch_TEMPLATE_COMPONENT.md +48 -0
- contextcompass_cli/_package/system_docs/system_docs_read_first.md +107 -0
- contextcompass_cli/_package/templates/epic_template.md +149 -0
- contextcompass_cli/_package/templates/story_template.md +131 -0
- contextcompass_cli/_package/templates/task_template.md +124 -0
- contextcompass_cli/_package/templates/workflow_advanced_template.md +111 -0
- contextcompass_cli/_package/templates/workflow_simple_template.md +65 -0
- contextcompass_cli/_package/tickets/README.md +24 -0
- contextcompass_cli/_package/tickets/epics/README.md +68 -0
- contextcompass_cli/_package/tickets/epics/archive/.gitkeep +0 -0
- contextcompass_cli/_package/tickets/epics/backlog/.gitkeep +0 -0
- contextcompass_cli/_package/tickets/epics/completed/.gitkeep +0 -0
- contextcompass_cli/_package/tickets/stories/README.md +68 -0
- contextcompass_cli/_package/tickets/stories/archive/.gitkeep +0 -0
- contextcompass_cli/_package/tickets/stories/backlog/.gitkeep +0 -0
- contextcompass_cli/_package/tickets/stories/completed/.gitkeep +0 -0
- contextcompass_cli/_package/tickets/tasks/README.md +67 -0
- contextcompass_cli/_package/tickets/tasks/archive/.gitkeep +0 -0
- contextcompass_cli/_package/tickets/tasks/backlog/.gitkeep +0 -0
- contextcompass_cli/_package/tickets/tasks/completed/.gitkeep +0 -0
- contextcompass_cli/_package/tools/build_llm_full.py +307 -0
- contextcompass_cli/_package/tools/cleanup_context_compass.py +488 -0
- contextcompass_cli/_package/tools/migrate_boards.py +218 -0
- contextcompass_cli/_package/tools/package_manifest.py +351 -0
- contextcompass_cli/_package/tools/system_documents/index_document.py +476 -0
- contextcompass_cli/_package/tools/system_documents/python/assemble_graph.py +387 -0
- contextcompass_cli/_package/tools/system_documents/python/extract_graph.py +626 -0
- contextcompass_cli/_package/tools/system_documents/python/graph_semantics_tickets.py +405 -0
- contextcompass_cli/_package/tools/system_documents/python/graph_walker.py +375 -0
- contextcompass_cli/_package/tools/system_documents/python/migrate_authored_graph.py +179 -0
- contextcompass_cli/_package/tools/update_context_compass.py +511 -0
- contextcompass_cli/_package/user_defined/README.md +49 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Move an existing board's content into USER-DEFINED regions.
|
|
3
|
+
|
|
4
|
+
Run this ONCE per install when a board predates the regions. After it succeeds,
|
|
5
|
+
the updater can conform the board's whole shape - headings, table headers,
|
|
6
|
+
contract prose - while leaving everything inside the regions alone.
|
|
7
|
+
|
|
8
|
+
WHY A BOARD NEEDS MIGRATING AT ALL
|
|
9
|
+
|
|
10
|
+
A board written before the regions has all of its rows in open text. The
|
|
11
|
+
updater cannot conform such a file, because "everything outside a MANAGED
|
|
12
|
+
block" is simultaneously the package's stale headings AND the install's live
|
|
13
|
+
rows, and nothing distinguishes them. So it swaps only the managed block and
|
|
14
|
+
leaves the rest frozen - which is why an install could end up with the managed
|
|
15
|
+
block sitting above its own H1, a duplicated directive below it, and no upgrade
|
|
16
|
+
able to repair either.
|
|
17
|
+
|
|
18
|
+
WHAT THIS DOES
|
|
19
|
+
|
|
20
|
+
For each `## Heading` the NEW board declares with a user region, it takes the
|
|
21
|
+
install's content under the SAME heading and puts it inside that region. Table
|
|
22
|
+
header rows and separator rows are dropped, because the new board supplies its
|
|
23
|
+
own; everything else is carried verbatim.
|
|
24
|
+
|
|
25
|
+
WHAT IT REFUSES TO DO
|
|
26
|
+
|
|
27
|
+
Content under a heading the new board does NOT have a region for is never
|
|
28
|
+
discarded and never guessed at. It is reported, and parked in the board's
|
|
29
|
+
`notes` region if one exists, so the migration cannot silently lose a section
|
|
30
|
+
somebody was using.
|
|
31
|
+
|
|
32
|
+
python migrate_boards.py --install <dir> --new <dir> --check
|
|
33
|
+
python migrate_boards.py --install <dir> --new <dir> --apply
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
from __future__ import annotations
|
|
37
|
+
|
|
38
|
+
import argparse
|
|
39
|
+
import difflib
|
|
40
|
+
import pathlib
|
|
41
|
+
import re
|
|
42
|
+
import sys
|
|
43
|
+
|
|
44
|
+
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
|
|
45
|
+
from package_manifest import MANIFEST_NAME, parse, check_manifest_compatible # noqa: E402
|
|
46
|
+
from cleanup_context_compass import user_regions, managed_blocks # noqa: E402
|
|
47
|
+
|
|
48
|
+
HEADING = re.compile(r"^##\s+(.+?)\s*$")
|
|
49
|
+
TABLE_ROW = re.compile(r"^\s*\|")
|
|
50
|
+
SEPARATOR = re.compile(r"^\s*\|[\s|:-]+\|\s*$")
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def strip_managed(text: str) -> str:
|
|
54
|
+
"""Remove managed blocks so their prose is not mistaken for install content."""
|
|
55
|
+
for _, s, e in sorted(managed_blocks(text), key=lambda b: -b[1]):
|
|
56
|
+
text = text[:s] + text[e:]
|
|
57
|
+
return text
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def sections(text: str) -> dict[str, list[str]]:
|
|
61
|
+
"""Map each `## Heading` to the lines beneath it, up to the next H2."""
|
|
62
|
+
out: dict[str, list[str]] = {}
|
|
63
|
+
current: str | None = None
|
|
64
|
+
for line in text.split("\n"):
|
|
65
|
+
m = HEADING.match(line)
|
|
66
|
+
if m:
|
|
67
|
+
current = m.group(1)
|
|
68
|
+
out.setdefault(current, [])
|
|
69
|
+
continue
|
|
70
|
+
if current is not None:
|
|
71
|
+
out[current].append(line)
|
|
72
|
+
return out
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def is_content(line: str) -> bool:
|
|
76
|
+
"""A line worth carrying: not blank, not a table header or separator."""
|
|
77
|
+
if not line.strip():
|
|
78
|
+
return False
|
|
79
|
+
if SEPARATOR.match(line):
|
|
80
|
+
return False
|
|
81
|
+
return True
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def region_for_heading(new_text: str, heading: str) -> str | None:
|
|
85
|
+
"""The region name declared under `heading` in the new board, if any."""
|
|
86
|
+
current: str | None = None
|
|
87
|
+
for line in new_text.split("\n"):
|
|
88
|
+
m = HEADING.match(line)
|
|
89
|
+
if m:
|
|
90
|
+
current = m.group(1)
|
|
91
|
+
continue
|
|
92
|
+
r = re.match(r"<!-- BEGIN USER-DEFINED(?::\s*(.+?))?\s*-->", line.strip())
|
|
93
|
+
if r and current == heading:
|
|
94
|
+
return (r.group(1) or "").strip()
|
|
95
|
+
return None
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def place(new_text: str, name: str, body_lines: list[str]) -> str:
|
|
99
|
+
"""Put `body_lines` inside the named region of `new_text`."""
|
|
100
|
+
for rname, s, e in user_regions(new_text):
|
|
101
|
+
if rname == name:
|
|
102
|
+
body = "\n" + "\n".join(body_lines) + "\n" if body_lines else "\n"
|
|
103
|
+
return new_text[:s] + body + new_text[e:]
|
|
104
|
+
return new_text
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def migrate_board(current: str, incoming: str) -> tuple[str, dict[str, int], list[str]]:
|
|
108
|
+
"""Return (migrated_text, {region: rows_carried}, unplaced_headings)."""
|
|
109
|
+
cur_sections = sections(strip_managed(current))
|
|
110
|
+
out = incoming
|
|
111
|
+
carried: dict[str, int] = {}
|
|
112
|
+
unplaced: list[str] = []
|
|
113
|
+
|
|
114
|
+
for heading, lines in cur_sections.items():
|
|
115
|
+
content = [l for l in lines if is_content(l)]
|
|
116
|
+
# A table header row is package-supplied; drop it, keep data rows.
|
|
117
|
+
content = [l for l in content
|
|
118
|
+
if not (TABLE_ROW.match(l) and l in incoming)]
|
|
119
|
+
if not content:
|
|
120
|
+
continue
|
|
121
|
+
name = region_for_heading(incoming, heading)
|
|
122
|
+
if name is None:
|
|
123
|
+
unplaced.append(heading)
|
|
124
|
+
continue
|
|
125
|
+
out = place(out, name, content)
|
|
126
|
+
carried[name or "(unnamed)"] = len(content)
|
|
127
|
+
|
|
128
|
+
if unplaced and region_for_heading(incoming, "Notes") is not None:
|
|
129
|
+
parked: list[str] = []
|
|
130
|
+
for heading in unplaced:
|
|
131
|
+
parked.append(f"### {heading} (carried from the pre-region board)")
|
|
132
|
+
parked.extend(l for l in cur_sections[heading] if is_content(l))
|
|
133
|
+
parked.append("")
|
|
134
|
+
name = region_for_heading(incoming, "Notes") or ""
|
|
135
|
+
existing = ""
|
|
136
|
+
for rname, s, e in user_regions(out):
|
|
137
|
+
if rname == name:
|
|
138
|
+
existing = out[s:e].strip("\n")
|
|
139
|
+
body = ([existing] if existing else []) + parked
|
|
140
|
+
out = place(out, name, body)
|
|
141
|
+
|
|
142
|
+
return out, carried, unplaced
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
def main() -> int:
|
|
146
|
+
ap = argparse.ArgumentParser(description=__doc__.splitlines()[0],
|
|
147
|
+
formatter_class=argparse.RawDescriptionHelpFormatter)
|
|
148
|
+
ap.add_argument("--install", required=True, type=pathlib.Path)
|
|
149
|
+
ap.add_argument("--new", required=True, type=pathlib.Path,
|
|
150
|
+
help="the new package, whose boards declare the regions")
|
|
151
|
+
ap.add_argument("--check", action="store_true", help="report only, write nothing")
|
|
152
|
+
ap.add_argument("--apply", action="store_true", help="rewrite the boards")
|
|
153
|
+
ap.add_argument("--diff", action="store_true", help="print a unified diff per board")
|
|
154
|
+
args = ap.parse_args()
|
|
155
|
+
|
|
156
|
+
if not (args.new / MANIFEST_NAME).is_file():
|
|
157
|
+
print(f"ERROR: --new {args.new} has no {MANIFEST_NAME}")
|
|
158
|
+
return 2
|
|
159
|
+
if not args.check and not args.apply:
|
|
160
|
+
print("Refusing to act without --apply. Use --check to see the plan.")
|
|
161
|
+
return 2
|
|
162
|
+
|
|
163
|
+
manifest_text = (args.new / MANIFEST_NAME).read_text(encoding="utf-8")
|
|
164
|
+
problem = check_manifest_compatible(manifest_text, f"--new {args.new}")
|
|
165
|
+
if problem:
|
|
166
|
+
print(f"ERROR: {problem}")
|
|
167
|
+
return 2
|
|
168
|
+
manifest = parse(manifest_text)
|
|
169
|
+
boards = sorted(rel for rel, (cls, _) in manifest.items() if cls == "LIVE")
|
|
170
|
+
if not boards:
|
|
171
|
+
print("no LIVE files in the new package's manifest - nothing to migrate")
|
|
172
|
+
return 0
|
|
173
|
+
|
|
174
|
+
changed = 0
|
|
175
|
+
for rel in boards:
|
|
176
|
+
cur_path, new_path = args.install / rel, args.new / rel
|
|
177
|
+
if not cur_path.is_file() or not new_path.is_file():
|
|
178
|
+
print(f" SKIP {rel} (missing on one side)")
|
|
179
|
+
continue
|
|
180
|
+
current = cur_path.read_text(encoding="utf-8")
|
|
181
|
+
incoming = new_path.read_text(encoding="utf-8")
|
|
182
|
+
|
|
183
|
+
if user_regions(current):
|
|
184
|
+
print(f" OK {rel} already has USER-DEFINED regions")
|
|
185
|
+
continue
|
|
186
|
+
if not user_regions(incoming):
|
|
187
|
+
print(f" SKIP {rel} - the new version declares no regions")
|
|
188
|
+
continue
|
|
189
|
+
|
|
190
|
+
migrated, carried, unplaced = migrate_board(current, incoming)
|
|
191
|
+
total = sum(carried.values())
|
|
192
|
+
print(f" MOVE {rel}: {total} line(s) into {len(carried)} region(s)")
|
|
193
|
+
for name, n in sorted(carried.items()):
|
|
194
|
+
print(f" {name}: {n}")
|
|
195
|
+
if unplaced:
|
|
196
|
+
print(f" parked in `notes` (no region for these headings): "
|
|
197
|
+
f"{', '.join(unplaced)}")
|
|
198
|
+
if args.diff:
|
|
199
|
+
for line in difflib.unified_diff(
|
|
200
|
+
current.split("\n"), migrated.split("\n"),
|
|
201
|
+
fromfile=f"a/{rel}", tofile=f"b/{rel}", lineterm=""):
|
|
202
|
+
print(f" {line}")
|
|
203
|
+
|
|
204
|
+
if args.apply:
|
|
205
|
+
cur_path.write_bytes(migrated.encode("utf-8"))
|
|
206
|
+
changed += 1
|
|
207
|
+
|
|
208
|
+
print()
|
|
209
|
+
if args.check:
|
|
210
|
+
print("READY - run again with --apply, then re-run the updater.")
|
|
211
|
+
return 0
|
|
212
|
+
print(f"APPLIED: {changed} board(s) migrated. Re-run update_context_compass.py;")
|
|
213
|
+
print(" they will now conform whole with your content preserved.")
|
|
214
|
+
return 0
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
if __name__ == "__main__":
|
|
218
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Emit the package manifest: what ships, who owns it, and its hash.
|
|
3
|
+
|
|
4
|
+
The manifest is the contract both `cleanup_context_compass.py` and
|
|
5
|
+
`update_context_compass.py` read. It answers three questions per path:
|
|
6
|
+
|
|
7
|
+
does this file belong to the package? -> presence in the manifest
|
|
8
|
+
who is allowed to change it? -> the ownership class
|
|
9
|
+
has it changed since it shipped? -> the sha256
|
|
10
|
+
|
|
11
|
+
WHY A GENERATED MANIFEST RATHER THAN PER-FILE VERSION STAMPS
|
|
12
|
+
|
|
13
|
+
A version header inside each document has to be bumped by hand, and nothing
|
|
14
|
+
enforces the bump. Miss one and the stamp lies while looking authoritative -
|
|
15
|
+
the same failure mode as a stale index. A manifest rebuilt from the files
|
|
16
|
+
themselves cannot drift, because it is derived rather than declared.
|
|
17
|
+
|
|
18
|
+
OWNERSHIP CLASSES
|
|
19
|
+
|
|
20
|
+
PACKAGE ships with the library and is not edited downstream.
|
|
21
|
+
Cleanup restores it. Update replaces it.
|
|
22
|
+
|
|
23
|
+
RESET a lane the package seeds and the consuming project then fills:
|
|
24
|
+
tickets, artifacts, system docs, project instructions.
|
|
25
|
+
Cleanup removes files NOT in the manifest and keeps the ones that
|
|
26
|
+
are. Update never touches the contents.
|
|
27
|
+
|
|
28
|
+
INSTANCE the project's own work, listed so both tools know to leave it
|
|
29
|
+
alone. Two directories: `agent_onboarding/user_defined/` for role
|
|
30
|
+
overlays, and top-level `user_defined/` for anything else. Neither
|
|
31
|
+
tool restores, replaces or removes anything in either, in any mode.
|
|
32
|
+
Listing them explicitly is safer than relying on absence, because a
|
|
33
|
+
file missing from the manifest is indistinguishable from one that
|
|
34
|
+
was never meant to be there.
|
|
35
|
+
|
|
36
|
+
These exist so an upgrade never has to choose between the user's
|
|
37
|
+
work and the new version. Package files are conformed; if you need
|
|
38
|
+
something different, it lives here instead.
|
|
39
|
+
|
|
40
|
+
LIVE one file holding a package-owned block plus instance-owned body.
|
|
41
|
+
The boards. Update swaps only the block between MANAGED markers.
|
|
42
|
+
|
|
43
|
+
CONFIG key-level merge, never a whole-file swap. Adding a key must not
|
|
44
|
+
silently reset a value the user set.
|
|
45
|
+
|
|
46
|
+
Classes are assigned by path prefix, longest match wins, so a PACKAGE directory
|
|
47
|
+
can still contain a RESET subtree. That distinction is not theoretical: during
|
|
48
|
+
the cleanup that motivated this tool, `tools/` was package-owned and still had
|
|
49
|
+
five foreign files sitting in it.
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
from __future__ import annotations
|
|
53
|
+
|
|
54
|
+
import argparse
|
|
55
|
+
import hashlib
|
|
56
|
+
import pathlib
|
|
57
|
+
import sys
|
|
58
|
+
|
|
59
|
+
MANIFEST_NAME = "MANIFEST.md"
|
|
60
|
+
MANIFEST_VERSION = "1.0.0"
|
|
61
|
+
|
|
62
|
+
# Manifest FORMAT majors these tools can read. Distinct from `package_version`,
|
|
63
|
+
# which is the content: the package moves 2.3 -> 2.5 without the format changing.
|
|
64
|
+
#
|
|
65
|
+
# Read on every load, because the alternative is the failure this file was
|
|
66
|
+
# written to avoid. A tool from an older release meeting a format it does not
|
|
67
|
+
# understand will parse SOMETHING - a subset of rows, or none - and then act on
|
|
68
|
+
# it: conform files it misread as package-owned, sweep paths it failed to see.
|
|
69
|
+
# Refusing on an unknown major turns a silent wrong action into a clear stop.
|
|
70
|
+
#
|
|
71
|
+
# Forward compatibility is one-directional and cannot be otherwise. A new tool
|
|
72
|
+
# reads an old manifest fine; an old tool cannot be taught a format that did not
|
|
73
|
+
# exist when it shipped. So bumping this major is a breaking change for every
|
|
74
|
+
# install still on an older package, and the error says exactly that.
|
|
75
|
+
SUPPORTED_MANIFEST_MAJORS = frozenset({"1"})
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def manifest_version_of(text: str) -> str | None:
|
|
79
|
+
"""The manifest FORMAT version recorded in a manifest, if it declares one."""
|
|
80
|
+
for line in text.splitlines():
|
|
81
|
+
if line.startswith("| manifest_version |"):
|
|
82
|
+
return line.split("|")[2].strip()
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def check_manifest_compatible(text: str, source: str) -> str | None:
|
|
87
|
+
"""None if this manifest is readable, else a message explaining why not.
|
|
88
|
+
|
|
89
|
+
A manifest with no `manifest_version` predates the field and is accepted:
|
|
90
|
+
the format was 1.x throughout, so refusing would break installs over a
|
|
91
|
+
stamp that was missing rather than wrong.
|
|
92
|
+
"""
|
|
93
|
+
version = manifest_version_of(text)
|
|
94
|
+
if version is None:
|
|
95
|
+
return None
|
|
96
|
+
major = version.split(".")[0]
|
|
97
|
+
if major in SUPPORTED_MANIFEST_MAJORS:
|
|
98
|
+
return None
|
|
99
|
+
return (f"{source} declares manifest format {version}, and these tools read "
|
|
100
|
+
f"format {'/'.join(sorted(SUPPORTED_MANIFEST_MAJORS))}.x only.\n"
|
|
101
|
+
f" This package is older than the manifest it was pointed at. Upgrade "
|
|
102
|
+
f"the tools rather than\n the install: an older tool cannot be taught a "
|
|
103
|
+
f"newer format, and guessing would mean\n acting on a partial reading of "
|
|
104
|
+
f"what the install owns.")
|
|
105
|
+
|
|
106
|
+
# Longest matching prefix wins. Order here is for reading, not for matching.
|
|
107
|
+
CLASS_RULES: tuple[tuple[str, str], ...] = (
|
|
108
|
+
("", "PACKAGE"), # default
|
|
109
|
+
("tickets/", "RESET"),
|
|
110
|
+
("artifacts/", "RESET"),
|
|
111
|
+
("system_docs/", "RESET"),
|
|
112
|
+
("context_management/", "RESET"),
|
|
113
|
+
("special_instructions/", "RESET"),
|
|
114
|
+
("agent_onboarding/user_defined/", "INSTANCE"),
|
|
115
|
+
("user_defined/", "INSTANCE"),
|
|
116
|
+
("attention_board.md", "LIVE"),
|
|
117
|
+
("artifact_board.md", "LIVE"),
|
|
118
|
+
("mailbox_board.md", "LIVE"),
|
|
119
|
+
("config/context_compass_config.yaml", "CONFIG"),
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
SKIP_DIRS = {"__pycache__", ".git"}
|
|
123
|
+
|
|
124
|
+
# Lanes where the install may hold files the package does not ship. Everything
|
|
125
|
+
# outside them is STRICT: an upgrade sweeps whatever is not in the manifest.
|
|
126
|
+
#
|
|
127
|
+
# The asymmetry is the point. A ticket the package never heard of is the whole
|
|
128
|
+
# purpose of `tickets/`; a skill the package never heard of sitting in
|
|
129
|
+
# `agent_onboarding/default/` is a document retired versions ago that agents are
|
|
130
|
+
# still reading. Reporting it is not enough - it was reported for two upgrades
|
|
131
|
+
# and stayed, because nobody hand-deletes from a list.
|
|
132
|
+
#
|
|
133
|
+
# Observed on a real install: a `scripts/` directory left over from before the
|
|
134
|
+
# rename to `tools/`, a root `router.md` from the retired dual-router era, and a
|
|
135
|
+
# lowercase `SKILLS.md` beside the real one. All silently readable, all wrong.
|
|
136
|
+
PERMISSIVE_LANES: tuple[str, ...] = (
|
|
137
|
+
"tickets/",
|
|
138
|
+
"artifacts/",
|
|
139
|
+
"system_docs/",
|
|
140
|
+
"context_management/",
|
|
141
|
+
"special_instructions/",
|
|
142
|
+
"user_defined/",
|
|
143
|
+
"agent_onboarding/user_defined/",
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def is_permissive(rel: str) -> bool:
|
|
148
|
+
"""True if the install may keep unmanifested files at this path."""
|
|
149
|
+
return rel.startswith(PERMISSIVE_LANES)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def classify(rel: str) -> str:
|
|
153
|
+
"""Ownership class for a package-relative path. Longest prefix wins."""
|
|
154
|
+
best, best_len = "PACKAGE", -1
|
|
155
|
+
for prefix, cls in CLASS_RULES:
|
|
156
|
+
if rel == prefix or (prefix.endswith("/") and rel.startswith(prefix)):
|
|
157
|
+
if len(prefix) > best_len:
|
|
158
|
+
best, best_len = cls, len(prefix)
|
|
159
|
+
return best
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def walk(root: pathlib.Path) -> list[pathlib.Path]:
|
|
163
|
+
out = []
|
|
164
|
+
for p in sorted(root.rglob("*"), key=lambda x: str(x).upper()):
|
|
165
|
+
if not p.is_file():
|
|
166
|
+
continue
|
|
167
|
+
if any(part in SKIP_DIRS for part in p.parts):
|
|
168
|
+
continue
|
|
169
|
+
if p.name == MANIFEST_NAME and p.parent == root:
|
|
170
|
+
continue # never hash the manifest into itself
|
|
171
|
+
out.append(p)
|
|
172
|
+
return out
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def sha(path: pathlib.Path) -> str:
|
|
176
|
+
return hashlib.sha256(path.read_bytes()).hexdigest()
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def build(root: pathlib.Path, version: str) -> str:
|
|
180
|
+
rows = []
|
|
181
|
+
for p in walk(root):
|
|
182
|
+
rel = p.relative_to(root).as_posix()
|
|
183
|
+
rows.append((rel, classify(rel), sha(p)))
|
|
184
|
+
|
|
185
|
+
counts: dict[str, int] = {}
|
|
186
|
+
for _, cls, _ in rows:
|
|
187
|
+
counts[cls] = counts.get(cls, 0) + 1
|
|
188
|
+
|
|
189
|
+
out = [
|
|
190
|
+
"# MANIFEST",
|
|
191
|
+
"",
|
|
192
|
+
"Generated by `tools/package_manifest.py`. Do not hand-edit: it is derived",
|
|
193
|
+
"from the files themselves, which is the only reason it can be trusted.",
|
|
194
|
+
"",
|
|
195
|
+
"| field | value |",
|
|
196
|
+
"| --- | --- |",
|
|
197
|
+
f"| manifest_version | {MANIFEST_VERSION} |",
|
|
198
|
+
f"| package_version | {version} |",
|
|
199
|
+
f"| files | {len(rows)} |",
|
|
200
|
+
"",
|
|
201
|
+
"## Lane policy",
|
|
202
|
+
"",
|
|
203
|
+
"Lanes where the install may keep files the package does not ship.",
|
|
204
|
+
"Everything outside them is STRICT: an upgrade sweeps what is not listed here.",
|
|
205
|
+
"",
|
|
206
|
+
"| lane | policy |",
|
|
207
|
+
"| --- | --- |",
|
|
208
|
+
*[f"| `{L}` | permissive |" for L in PERMISSIVE_LANES],
|
|
209
|
+
"| everything else | strict - swept on upgrade |",
|
|
210
|
+
"",
|
|
211
|
+
"## Ownership classes",
|
|
212
|
+
"",
|
|
213
|
+
"| class | files | cleanup | update |",
|
|
214
|
+
"| --- | --- | --- | --- |",
|
|
215
|
+
f"| PACKAGE | {counts.get('PACKAGE', 0)} | restore | replace |",
|
|
216
|
+
f"| RESET | {counts.get('RESET', 0)} | keep listed, remove unlisted | leave alone |",
|
|
217
|
+
f"| INSTANCE | {counts.get('INSTANCE', 0)} | never touched | never touched |",
|
|
218
|
+
f"| LIVE | {counts.get('LIVE', 0)} | reset managed block | swap managed block |",
|
|
219
|
+
f"| CONFIG | {counts.get('CONFIG', 0)} | restore missing keys | merge keys |",
|
|
220
|
+
"",
|
|
221
|
+
"## Files",
|
|
222
|
+
"",
|
|
223
|
+
"| path | class | sha256 |",
|
|
224
|
+
"| --- | --- | --- |",
|
|
225
|
+
]
|
|
226
|
+
for rel, cls, digest in rows:
|
|
227
|
+
out.append(f"| `{rel}` | {cls} | `{digest}` |")
|
|
228
|
+
out.append("")
|
|
229
|
+
return "\n".join(out)
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def parse(text: str) -> dict[str, tuple[str, str]]:
|
|
233
|
+
"""Read a manifest back. Returns {path: (class, sha256)}."""
|
|
234
|
+
entries: dict[str, tuple[str, str]] = {}
|
|
235
|
+
in_files = False
|
|
236
|
+
for line in text.splitlines():
|
|
237
|
+
if line.startswith("## Files"):
|
|
238
|
+
in_files = True
|
|
239
|
+
continue
|
|
240
|
+
if not in_files or not line.startswith("| `"):
|
|
241
|
+
continue
|
|
242
|
+
cells = [c.strip().strip("`") for c in line.strip().strip("|").split("|")]
|
|
243
|
+
if len(cells) == 3 and len(cells[2]) == 64:
|
|
244
|
+
entries[cells[0]] = (cells[1], cells[2])
|
|
245
|
+
return entries
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def main() -> int:
|
|
249
|
+
ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
|
250
|
+
ap.add_argument("--root", required=True, type=pathlib.Path,
|
|
251
|
+
help="package root, the directory holding AGENTS.MD")
|
|
252
|
+
ap.add_argument("--version", default="0.0.0", help="package version to record")
|
|
253
|
+
ap.add_argument("--check", action="store_true",
|
|
254
|
+
help="compare against the manifest on disk, write nothing")
|
|
255
|
+
args = ap.parse_args()
|
|
256
|
+
|
|
257
|
+
root: pathlib.Path = args.root
|
|
258
|
+
if not (root / "AGENTS.MD").is_file():
|
|
259
|
+
print(f"ERROR: {root} does not look like a package root (no AGENTS.MD)")
|
|
260
|
+
return 2
|
|
261
|
+
|
|
262
|
+
target = root / MANIFEST_NAME
|
|
263
|
+
version = args.version
|
|
264
|
+
if version == "0.0.0" and target.is_file():
|
|
265
|
+
for line in target.read_text(encoding="utf-8").splitlines():
|
|
266
|
+
if line.startswith("| package_version |"):
|
|
267
|
+
version = line.split("|")[2].strip()
|
|
268
|
+
break
|
|
269
|
+
|
|
270
|
+
text = build(root, version)
|
|
271
|
+
|
|
272
|
+
if args.check:
|
|
273
|
+
if not target.is_file():
|
|
274
|
+
print("MISSING: no manifest on disk")
|
|
275
|
+
return 1
|
|
276
|
+
current = target.read_text(encoding="utf-8")
|
|
277
|
+
if current == text:
|
|
278
|
+
print(f"OK: manifest is current ({len(parse(text))} files)")
|
|
279
|
+
return 0
|
|
280
|
+
old, new = parse(current), parse(text)
|
|
281
|
+
added = sorted(set(new) - set(old))
|
|
282
|
+
removed = sorted(set(old) - set(new))
|
|
283
|
+
changed = sorted(p for p in set(old) & set(new) if old[p][1] != new[p][1])
|
|
284
|
+
|
|
285
|
+
# A rename that only changes case is ONE file, not an add and a remove.
|
|
286
|
+
# Reported as two it looks like unrelated churn, and the obvious repair -
|
|
287
|
+
# "delete the removed one" - destroys the added one, because on a
|
|
288
|
+
# case-insensitive filesystem they are the same inode. Observed three
|
|
289
|
+
# times on `SKILLS.MD` in a single day, drifting to `SKILLS.md` from
|
|
290
|
+
# something outside this package. Naming it is what makes it fixable.
|
|
291
|
+
removed_ci = {p.lower(): p for p in removed}
|
|
292
|
+
drift = [(removed_ci[p.lower()], p) for p in added if p.lower() in removed_ci]
|
|
293
|
+
drifted = {a for _, a in drift} | {b for b, _ in drift}
|
|
294
|
+
added = [p for p in added if p not in drifted]
|
|
295
|
+
removed = [p for p in removed if p not in drifted]
|
|
296
|
+
|
|
297
|
+
# The other half of the same disease, and the half that actually shipped.
|
|
298
|
+
# Here the twin was never removed: both names exist at once. That cannot
|
|
299
|
+
# happen on Windows or macOS, so it is invisible to whoever created it and
|
|
300
|
+
# only ever fails on Linux - reported, before this, as a bare
|
|
301
|
+
# `added SKILLS.md`, which reads like a stray file somebody forgot to
|
|
302
|
+
# manifest. The repair for a stray file is "add it to the manifest", and
|
|
303
|
+
# that is exactly wrong: it would enshrine a tree that cannot be checked
|
|
304
|
+
# out on half the machines that use it.
|
|
305
|
+
kept_ci = {p.lower(): p for p in old if p in new}
|
|
306
|
+
collide = [(kept_ci[p.lower()], p) for p in added if p.lower() in kept_ci]
|
|
307
|
+
added = [p for p in added if p not in {b for _, b in collide}]
|
|
308
|
+
|
|
309
|
+
print(f"STALE: +{len(added)} -{len(removed)} ~{len(changed)}"
|
|
310
|
+
+ (f" CASE DRIFT {len(drift)}" if drift else "")
|
|
311
|
+
+ (f" CASE COLLISION {len(collide)}" if collide else ""))
|
|
312
|
+
for was, now in drift:
|
|
313
|
+
same = old.get(was, (None, None))[1] == new.get(now, (None, "x"))[1]
|
|
314
|
+
print(f" CASE {was} -> {now}"
|
|
315
|
+
f" (contents {'identical' if same else 'ALSO changed'})")
|
|
316
|
+
if drift:
|
|
317
|
+
print(" One file whose name changed case, not two files. Rename it")
|
|
318
|
+
print(" back rather than deleting either - on a case-insensitive")
|
|
319
|
+
print(" filesystem both names resolve to the same file.")
|
|
320
|
+
for manifested, stray in collide:
|
|
321
|
+
same = new.get(manifested, (None, None))[1] == new.get(stray, (None, "x"))[1]
|
|
322
|
+
print(f" COLLIDE {stray} collides with manifested {manifested}"
|
|
323
|
+
f" (contents {'identical' if same else 'differ'})")
|
|
324
|
+
if collide:
|
|
325
|
+
print(" Two files whose names differ only in case, present at the")
|
|
326
|
+
print(" same time. Legal on Linux, impossible on Windows and macOS.")
|
|
327
|
+
print(" Delete the unmanifested one from the tree - do NOT add it to")
|
|
328
|
+
print(" the manifest, and do not expect a rename on a case-insensitive")
|
|
329
|
+
print(" filesystem to remove it from version control on its own.")
|
|
330
|
+
for p in added[:20]:
|
|
331
|
+
print(f" added {p}")
|
|
332
|
+
for p in removed[:20]:
|
|
333
|
+
print(f" removed {p}")
|
|
334
|
+
for p in changed[:20]:
|
|
335
|
+
print(f" changed {p}")
|
|
336
|
+
return 1
|
|
337
|
+
|
|
338
|
+
target.write_bytes(text.encode("utf-8"))
|
|
339
|
+
entries = parse(text)
|
|
340
|
+
counts: dict[str, int] = {}
|
|
341
|
+
for cls, _ in entries.values():
|
|
342
|
+
counts[cls] = counts.get(cls, 0) + 1
|
|
343
|
+
print(f"WROTE: {MANIFEST_NAME}")
|
|
344
|
+
print(f" package_version {version}")
|
|
345
|
+
print(f" {len(entries)} files: " +
|
|
346
|
+
", ".join(f"{v} {k}" for k, v in sorted(counts.items())))
|
|
347
|
+
return 0
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
if __name__ == "__main__":
|
|
351
|
+
raise SystemExit(main())
|