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,488 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Return a Context Compass install to the state its manifest describes.
|
|
3
|
+
|
|
4
|
+
Use this when an instance has accumulated content that does not belong to it, or
|
|
5
|
+
when you are preparing the package for distribution and need the working lanes
|
|
6
|
+
emptied of one project's work.
|
|
7
|
+
|
|
8
|
+
TWO MODES, BECAUSE "CLEAN" MEANS TWO DIFFERENT THINGS
|
|
9
|
+
|
|
10
|
+
--mode reset (default) return to shipping state. The instance's work in
|
|
11
|
+
the RESET lanes is removed and the seeded documents go back
|
|
12
|
+
to what the package ships. Use when preparing a release or
|
|
13
|
+
clearing one project's content out of the package.
|
|
14
|
+
|
|
15
|
+
--mode repair fix a broken install without touching the project's work.
|
|
16
|
+
RESET lanes are left completely alone. Use on a live repo.
|
|
17
|
+
|
|
18
|
+
WHAT EACH MODE DOES, BY OWNERSHIP CLASS
|
|
19
|
+
|
|
20
|
+
PACKAGE both modes: restore if missing, restore if the hash differs.
|
|
21
|
+
RESET reset: unlisted files removed; listed files restored to shipped.
|
|
22
|
+
repair: untouched entirely.
|
|
23
|
+
INSTANCE never touched, in either mode. Two lanes, and they are NOT
|
|
24
|
+
interchangeable:
|
|
25
|
+
|
|
26
|
+
`agent_onboarding/user_defined/` role overlays.
|
|
27
|
+
`--purge-user-defined` is the single exception to "never
|
|
28
|
+
touched", and it exists only because a release should not
|
|
29
|
+
ship another project's roles. Never implied by `--mode
|
|
30
|
+
reset`: deleting someone's role because they asked to tidy
|
|
31
|
+
a lane would be a betrayal of the invariant, so it has to
|
|
32
|
+
be asked for by name.
|
|
33
|
+
|
|
34
|
+
`user_defined/` the top-level free space.
|
|
35
|
+
Kept in EVERY mode, including `--purge-user-defined`. Its
|
|
36
|
+
README promises the package never writes there, and that
|
|
37
|
+
promise is the reason the lane is usable at all.
|
|
38
|
+
|
|
39
|
+
An earlier version treated both as one bucket, so a purge deleted
|
|
40
|
+
top-level files while reporting only the role names it found -
|
|
41
|
+
removing files it never named. The two roots are now separate.
|
|
42
|
+
LIVE reset: the whole file is restored. A release must not ship one
|
|
43
|
+
project's routing rows.
|
|
44
|
+
repair: only the managed block is swapped. Rows are never touched.
|
|
45
|
+
CONFIG never rewritten in either mode - the updater owns key merges. But
|
|
46
|
+
the manifest hash is used: when it does not match, the tool reports
|
|
47
|
+
WHICH top-level keys you added, removed or retuned relative to the
|
|
48
|
+
shipped defaults. A hash nothing checks is the same dead weight as
|
|
49
|
+
a version stamp nothing bumps, so this one earns its place.
|
|
50
|
+
|
|
51
|
+
A file in a PACKAGE lane that is not in the manifest is reported as UNKNOWN in
|
|
52
|
+
both modes, and removed only in reset mode. It is usually foreign content, but
|
|
53
|
+
it can be a script someone added on purpose, so it is never deleted silently.
|
|
54
|
+
|
|
55
|
+
WHY RESET DOES NOT RUN BY ACCIDENT ON A LIVE REPO
|
|
56
|
+
|
|
57
|
+
Reset empties the working lanes. `system_docs/`, `tickets/` and `artifacts/` hold
|
|
58
|
+
whatever the project wrote there - architecture maps, live tickets, findings -
|
|
59
|
+
and reset deletes all of it. That is correct when preparing a release and
|
|
60
|
+
catastrophic on a working repository. Two explicit modes beat one clever
|
|
61
|
+
heuristic, because a heuristic that guesses wrong here destroys work.
|
|
62
|
+
|
|
63
|
+
The package ships `system_docs/` EMPTY: no architecture, component, test or
|
|
64
|
+
graph document is seeded. A placeholder in a live lane gets read as repository
|
|
65
|
+
truth no matter what banner sits on it, so there is nothing there to restore -
|
|
66
|
+
reset only removes.
|
|
67
|
+
|
|
68
|
+
Then: prune directories left empty, and re-materialise every manifest path so
|
|
69
|
+
`.gitkeep` markers come back. Order matters. Prune before restore and you delete
|
|
70
|
+
lanes that should exist; restore before prune and stale empty directories
|
|
71
|
+
survive.
|
|
72
|
+
|
|
73
|
+
WHY IT COMPARES CONTENT, NOT JUST PATHS
|
|
74
|
+
|
|
75
|
+
The cleanup this tool was written for found 1,217 foreign files by path. It also
|
|
76
|
+
found 11 files sitting at package paths carrying another project's content - the
|
|
77
|
+
three boards, four system documents, four patch templates. A path-only diff
|
|
78
|
+
reports those as present and correct, because the path exists in both trees.
|
|
79
|
+
Only the hash finds them. A cleanup that skips the hash comparison will report
|
|
80
|
+
success over a tree that is still wrong in the places that matter most.
|
|
81
|
+
|
|
82
|
+
BLAST RADIUS
|
|
83
|
+
|
|
84
|
+
This deletes files. It refuses to run without `--apply`, and `--check` prints
|
|
85
|
+
exactly what it would do. Removal is limited to RESET lanes: it will never
|
|
86
|
+
delete something outside a lane the manifest marks as the instance's to fill.
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
from __future__ import annotations
|
|
90
|
+
|
|
91
|
+
import argparse
|
|
92
|
+
import pathlib
|
|
93
|
+
import re
|
|
94
|
+
import sys
|
|
95
|
+
|
|
96
|
+
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
|
|
97
|
+
from package_manifest import ( # noqa: E402
|
|
98
|
+
MANIFEST_NAME, SKIP_DIRS, parse, check_manifest_compatible,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
MANAGED_BEGIN = "<!-- BEGIN MANAGED: {name} -->"
|
|
102
|
+
MANAGED_END = "<!-- END MANAGED: {name} -->"
|
|
103
|
+
|
|
104
|
+
# The two INSTANCE lanes. They are NOT interchangeable: only the first is
|
|
105
|
+
# purgeable, and only by explicit request. See the purge handling in main().
|
|
106
|
+
ROLE_OVERLAY_ROOT = "agent_onboarding/user_defined/"
|
|
107
|
+
FREE_SPACE_ROOT = "user_defined/"
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def sha_of(path: pathlib.Path) -> str:
|
|
111
|
+
import hashlib
|
|
112
|
+
return hashlib.sha256(path.read_bytes()).hexdigest()
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def managed_blocks(text: str) -> list[tuple[str, int, int]]:
|
|
116
|
+
"""Every managed region as (name, start_index, end_index_exclusive)."""
|
|
117
|
+
import re
|
|
118
|
+
out = []
|
|
119
|
+
for m in re.finditer(r"<!-- BEGIN MANAGED: (.+?) -->", text):
|
|
120
|
+
name = m.group(1)
|
|
121
|
+
end_marker = MANAGED_END.format(name=name)
|
|
122
|
+
e = text.find(end_marker, m.end())
|
|
123
|
+
if e == -1:
|
|
124
|
+
raise ValueError(f"unterminated managed block {name!r}")
|
|
125
|
+
out.append((name, m.start(), e + len(end_marker)))
|
|
126
|
+
return out
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def swap_managed(current: str, reference: str) -> tuple[str, list[str]]:
|
|
130
|
+
"""Replace each managed block in `current` with the one from `reference`.
|
|
131
|
+
|
|
132
|
+
A block present in the reference but absent from the file is inserted at the
|
|
133
|
+
top, after the H1 if there is one. A block in the file but not the reference
|
|
134
|
+
is left alone - the package no longer manages it, and deleting text the
|
|
135
|
+
package does not own is not this tool's business.
|
|
136
|
+
"""
|
|
137
|
+
ref = {name: reference[s:e] for name, s, e in managed_blocks(reference)}
|
|
138
|
+
changed: list[str] = []
|
|
139
|
+
for name, s, e in sorted(managed_blocks(current), key=lambda b: -b[1]):
|
|
140
|
+
if name in ref and current[s:e] != ref[name]:
|
|
141
|
+
current = current[:s] + ref[name] + current[e:]
|
|
142
|
+
changed.append(name)
|
|
143
|
+
have = {n for n, _, _ in managed_blocks(current)}
|
|
144
|
+
for name, block in ref.items():
|
|
145
|
+
if name not in have:
|
|
146
|
+
lines = current.split("\n")
|
|
147
|
+
at = 1 if lines and lines[0].startswith("# ") else 0
|
|
148
|
+
lines.insert(at, "\n" + block if at else block)
|
|
149
|
+
current = "\n".join(lines)
|
|
150
|
+
changed.append(f"{name} (inserted)")
|
|
151
|
+
return current, changed
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
USER_BEGIN = "<!-- BEGIN USER-DEFINED{suffix} -->"
|
|
155
|
+
USER_END = "<!-- END USER-DEFINED{suffix} -->"
|
|
156
|
+
_USER_OPEN = re.compile(r"<!-- BEGIN USER-DEFINED(?::\s*(.+?))?\s*-->")
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def user_regions(text: str) -> list[tuple[str, int, int]]:
|
|
160
|
+
"""Every user-defined region as (name, body_start, body_end).
|
|
161
|
+
|
|
162
|
+
The offsets bracket the BODY, not the markers, because the markers belong to
|
|
163
|
+
the package and the body belongs to the install. Carrying the markers across
|
|
164
|
+
would mean an upgrade could never reposition or rename them.
|
|
165
|
+
"""
|
|
166
|
+
out = []
|
|
167
|
+
for m in _USER_OPEN.finditer(text):
|
|
168
|
+
name = (m.group(1) or "").strip()
|
|
169
|
+
suffix = f": {name}" if name else ""
|
|
170
|
+
end_marker = USER_END.format(suffix=suffix)
|
|
171
|
+
e = text.find(end_marker, m.end())
|
|
172
|
+
if e == -1:
|
|
173
|
+
raise ValueError(f"unterminated user-defined region {name or '(unnamed)'!r}")
|
|
174
|
+
out.append((name, m.end(), e))
|
|
175
|
+
return out
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def carry_user_regions(incoming: str, current: str) -> tuple[str, list[str]]:
|
|
179
|
+
"""Return `incoming` with each user region's body taken from `current`.
|
|
180
|
+
|
|
181
|
+
This is what lets a package file be conformed without eating the install's
|
|
182
|
+
work. The package owns the prose, the headings, the field list - all of it
|
|
183
|
+
updates. What the install wrote inside its user region rides across
|
|
184
|
+
unchanged.
|
|
185
|
+
|
|
186
|
+
A region the incoming file does not declare is NOT carried: the package
|
|
187
|
+
stopped offering that space, and silently reattaching a body to a region
|
|
188
|
+
that no longer exists would put text somewhere nobody expects it. Such a
|
|
189
|
+
region is reported by the caller instead.
|
|
190
|
+
"""
|
|
191
|
+
mine = {name: current[s:e] for name, s, e in user_regions(current)}
|
|
192
|
+
if not mine:
|
|
193
|
+
return incoming, []
|
|
194
|
+
|
|
195
|
+
carried: list[str] = []
|
|
196
|
+
# Back to front: replacing a body changes every offset after it.
|
|
197
|
+
for name, s, e in sorted(user_regions(incoming), key=lambda r: -r[1]):
|
|
198
|
+
if name in mine and incoming[s:e] != mine[name]:
|
|
199
|
+
incoming = incoming[:s] + mine[name] + incoming[e:]
|
|
200
|
+
carried.append(name or "(unnamed)")
|
|
201
|
+
return incoming, carried
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def orphaned_user_regions(incoming: str, current: str) -> list[str]:
|
|
205
|
+
"""User regions the install has and the incoming version no longer offers."""
|
|
206
|
+
theirs = {n for n, _, _ in user_regions(incoming)}
|
|
207
|
+
return sorted({(n or "(unnamed)") for n, _, _ in user_regions(current)
|
|
208
|
+
if n not in theirs})
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def diff_config_keys(current: str, shipped: str) -> tuple[list[str], list[str], list[str]]:
|
|
212
|
+
"""Which top-level config keys were added, removed, or given a new value.
|
|
213
|
+
|
|
214
|
+
Reports only. Config is the install's to set, so this exists to answer "how
|
|
215
|
+
does mine differ from stock" rather than to drive any change.
|
|
216
|
+
"""
|
|
217
|
+
import re
|
|
218
|
+
|
|
219
|
+
def blocks(text: str) -> dict[str, str]:
|
|
220
|
+
lines = text.split("\n")
|
|
221
|
+
starts = [(i, m.group(1)) for i, ln in enumerate(lines)
|
|
222
|
+
if (m := re.match(r"^([A-Za-z_][A-Za-z0-9_]*):", ln))]
|
|
223
|
+
out = {}
|
|
224
|
+
for idx, (i, key) in enumerate(starts):
|
|
225
|
+
end = starts[idx + 1][0] if idx + 1 < len(starts) else len(lines)
|
|
226
|
+
body = [l for l in lines[i:end]
|
|
227
|
+
if l.strip() and not l.lstrip().startswith("#")]
|
|
228
|
+
out[key] = "\n".join(body)
|
|
229
|
+
return out
|
|
230
|
+
|
|
231
|
+
cur, ship = blocks(current), blocks(shipped)
|
|
232
|
+
added = sorted(set(cur) - set(ship))
|
|
233
|
+
removed = sorted(set(ship) - set(cur))
|
|
234
|
+
retuned = sorted(k for k in set(cur) & set(ship) if cur[k] != ship[k])
|
|
235
|
+
return added, removed, retuned
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
def main() -> int:
|
|
239
|
+
ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
|
240
|
+
ap.add_argument("--target", required=True, type=pathlib.Path,
|
|
241
|
+
help="the install to clean, the directory holding AGENTS.MD")
|
|
242
|
+
ap.add_argument("--reference", type=pathlib.Path,
|
|
243
|
+
help="clean package to restore from; defaults to --target itself, "
|
|
244
|
+
"which repairs structure but cannot repair overwritten content")
|
|
245
|
+
ap.add_argument("--mode", choices=("reset", "repair"), default="reset",
|
|
246
|
+
help="reset: return RESET lanes to shipping state (default). "
|
|
247
|
+
"repair: fix PACKAGE files only, leave the project's work alone")
|
|
248
|
+
ap.add_argument("--purge-user-defined", action="store_true",
|
|
249
|
+
help="ALSO delete role overlays under agent_onboarding/user_defined/ "
|
|
250
|
+
"that the manifest does not list. For cutting a release: a "
|
|
251
|
+
"release should not ship another project's roles. Never implied "
|
|
252
|
+
"by --mode reset, because those overlays are someone's work. "
|
|
253
|
+
"Does NOT touch top-level user_defined/ - that lane is kept in "
|
|
254
|
+
"every mode")
|
|
255
|
+
ap.add_argument("--check", action="store_true", help="report only, change nothing")
|
|
256
|
+
ap.add_argument("--apply", action="store_true", help="perform the cleanup")
|
|
257
|
+
args = ap.parse_args()
|
|
258
|
+
|
|
259
|
+
target: pathlib.Path = args.target
|
|
260
|
+
reference: pathlib.Path = args.reference or target
|
|
261
|
+
|
|
262
|
+
if not (target / "AGENTS.MD").is_file():
|
|
263
|
+
print(f"ERROR: {target} is not a package root (no AGENTS.MD)")
|
|
264
|
+
return 2
|
|
265
|
+
man_path = reference / MANIFEST_NAME
|
|
266
|
+
if not man_path.is_file():
|
|
267
|
+
print(f"ERROR: no {MANIFEST_NAME} in {reference} - run package_manifest.py first")
|
|
268
|
+
return 2
|
|
269
|
+
if not args.check and not args.apply:
|
|
270
|
+
print("Refusing to act without --apply. Use --check to see the plan.")
|
|
271
|
+
return 2
|
|
272
|
+
|
|
273
|
+
manifest_text = man_path.read_text(encoding="utf-8")
|
|
274
|
+
problem = check_manifest_compatible(manifest_text, str(man_path))
|
|
275
|
+
if problem:
|
|
276
|
+
print(f"ERROR: {problem}")
|
|
277
|
+
return 2
|
|
278
|
+
manifest = parse(manifest_text)
|
|
279
|
+
reset_roots = sorted({p.split("/")[0] + "/" for p, (c, _) in manifest.items()
|
|
280
|
+
if c == "RESET" and "/" in p})
|
|
281
|
+
|
|
282
|
+
on_disk = {p.relative_to(target).as_posix()
|
|
283
|
+
for p in target.rglob("*")
|
|
284
|
+
if p.is_file() and not any(part in SKIP_DIRS for part in p.parts)}
|
|
285
|
+
on_disk.discard(MANIFEST_NAME)
|
|
286
|
+
|
|
287
|
+
reset_mode = args.mode == "reset"
|
|
288
|
+
remove, restore, repair, blocks, unknown, kept = [], [], [], [], [], []
|
|
289
|
+
config_drift = None
|
|
290
|
+
|
|
291
|
+
instance_roots = sorted({p.rsplit('/', 1)[0] + '/' if '/' in p else p
|
|
292
|
+
for p, (c, _) in manifest.items() if c == 'INSTANCE'} |
|
|
293
|
+
{ROLE_OVERLAY_ROOT, FREE_SPACE_ROOT})
|
|
294
|
+
|
|
295
|
+
# Two INSTANCE lanes, and only one of them is purgeable.
|
|
296
|
+
#
|
|
297
|
+
# `--purge-user-defined` exists so a release does not ship another project's
|
|
298
|
+
# ROLE OVERLAYS. The top-level free space is a different lane with a
|
|
299
|
+
# different promise - `user_defined/README.md` states the package never
|
|
300
|
+
# writes there in any mode - and an earlier version swept both, while
|
|
301
|
+
# reporting only the role names. It deleted files it never named.
|
|
302
|
+
foreign_roles: list[str] = [] # agent_onboarding/user_defined/ - purgeable
|
|
303
|
+
foreign_free: list[str] = [] # user_defined/ - never purged
|
|
304
|
+
for rel in sorted(on_disk - set(manifest)):
|
|
305
|
+
if rel.startswith(ROLE_OVERLAY_ROOT):
|
|
306
|
+
foreign_roles.append(rel)
|
|
307
|
+
continue # never removed unless --purge-user-defined says so
|
|
308
|
+
if any(rel.startswith(r) for r in instance_roots):
|
|
309
|
+
foreign_free.append(rel)
|
|
310
|
+
continue # never removed, full stop
|
|
311
|
+
in_reset_lane = any(rel.startswith(r) for r in reset_roots)
|
|
312
|
+
if in_reset_lane:
|
|
313
|
+
(remove if reset_mode else kept).append(rel)
|
|
314
|
+
else:
|
|
315
|
+
unknown.append(rel) # foreign file in a PACKAGE lane
|
|
316
|
+
|
|
317
|
+
for rel, (cls, digest) in sorted(manifest.items()):
|
|
318
|
+
p = target / rel
|
|
319
|
+
if cls == "INSTANCE":
|
|
320
|
+
continue # the project's own work, in every mode
|
|
321
|
+
if cls == "RESET" and not reset_mode:
|
|
322
|
+
if not p.exists():
|
|
323
|
+
restore.append(rel) # reseed a lane file that went missing
|
|
324
|
+
continue
|
|
325
|
+
if not p.exists():
|
|
326
|
+
restore.append(rel)
|
|
327
|
+
elif cls in ("PACKAGE", "RESET") and sha_of(p) != digest:
|
|
328
|
+
repair.append(rel)
|
|
329
|
+
elif cls == "LIVE" and reset_mode and sha_of(p) != digest:
|
|
330
|
+
# Preparing a release: ship the board as the package ships it. Keeping
|
|
331
|
+
# someone's routing rows would publish one project's work state.
|
|
332
|
+
repair.append(rel)
|
|
333
|
+
elif cls == "LIVE" and (reference / rel).is_file():
|
|
334
|
+
_, ch = swap_managed(p.read_text(encoding="utf-8"),
|
|
335
|
+
(reference / rel).read_text(encoding="utf-8"))
|
|
336
|
+
if ch:
|
|
337
|
+
blocks.append((rel, ch))
|
|
338
|
+
elif cls == "CONFIG" and sha_of(p) != digest and (reference / rel).is_file():
|
|
339
|
+
# Never changed - the updater owns config merges. But the manifest
|
|
340
|
+
# hash would otherwise be dead weight, and a hash nothing checks is
|
|
341
|
+
# the same pattern as a version stamp nothing bumps. Use it to say
|
|
342
|
+
# HOW the install diverged from the shipped defaults.
|
|
343
|
+
config_drift = diff_config_keys(
|
|
344
|
+
p.read_text(encoding="utf-8"),
|
|
345
|
+
(reference / rel).read_text(encoding="utf-8"))
|
|
346
|
+
|
|
347
|
+
print(f"target {target}")
|
|
348
|
+
print(f"reference {reference}")
|
|
349
|
+
print(f"mode {args.mode}")
|
|
350
|
+
print(f"manifest {len(manifest)} files, RESET lanes: {', '.join(reset_roots) or 'none'}")
|
|
351
|
+
print()
|
|
352
|
+
print(f" remove {len(remove):>5} instance files in RESET lanes")
|
|
353
|
+
print(f" restore {len(restore):>5} manifest files missing from the target")
|
|
354
|
+
print(f" repair {len(repair):>5} manifest files whose content differs")
|
|
355
|
+
print(f" blocks {len(blocks):>5} live files whose managed block is stale")
|
|
356
|
+
print(f" unknown {len(unknown):>5} files in PACKAGE lanes not in the manifest"
|
|
357
|
+
f"{' (will be removed)' if reset_mode else ' (reported only)'}")
|
|
358
|
+
if kept:
|
|
359
|
+
print(f" kept {len(kept):>5} instance files left alone by repair mode")
|
|
360
|
+
for rel in remove[:10]:
|
|
361
|
+
print(f" remove {rel}")
|
|
362
|
+
if len(remove) > 10:
|
|
363
|
+
print(f" ... +{len(remove) - 10} more")
|
|
364
|
+
for rel in restore[:10]:
|
|
365
|
+
print(f" restore {rel}")
|
|
366
|
+
for rel in repair[:10]:
|
|
367
|
+
print(f" repair {rel}")
|
|
368
|
+
for rel, ch in blocks[:10]:
|
|
369
|
+
print(f" block {rel}: {', '.join(ch)}")
|
|
370
|
+
for rel in unknown[:10]:
|
|
371
|
+
print(f" unknown {rel}")
|
|
372
|
+
|
|
373
|
+
if config_drift and any(config_drift):
|
|
374
|
+
a, r, v = config_drift
|
|
375
|
+
print(f" config your `config/context_compass_config.yaml` differs from stock:")
|
|
376
|
+
if a: print(f" keys you added: {', '.join(a)}")
|
|
377
|
+
if r: print(f" keys you removed: {', '.join(r)}")
|
|
378
|
+
if v: print(f" values you changed: {', '.join(v)}")
|
|
379
|
+
print(" reported only - config is yours and is never rewritten here.")
|
|
380
|
+
|
|
381
|
+
if foreign_roles:
|
|
382
|
+
roles = sorted({r.split("/")[2] for r in foreign_roles if r.count("/") >= 2})
|
|
383
|
+
verb = "WILL BE DELETED" if args.purge_user_defined else "kept"
|
|
384
|
+
print(f" overlays{len(foreign_roles):>5} files under {ROLE_OVERLAY_ROOT} not in "
|
|
385
|
+
f"the manifest, in {len(roles)} role(s): {', '.join(roles) or '-'} - {verb}")
|
|
386
|
+
if not args.purge_user_defined:
|
|
387
|
+
print(" these belong to whoever wrote them. Cutting a release?"
|
|
388
|
+
" Pass --purge-user-defined.")
|
|
389
|
+
if foreign_free:
|
|
390
|
+
print(f" free {len(foreign_free):>5} files under {FREE_SPACE_ROOT} - kept in "
|
|
391
|
+
f"every mode, including --purge-user-defined")
|
|
392
|
+
|
|
393
|
+
if reset_mode:
|
|
394
|
+
remove = remove + unknown
|
|
395
|
+
if args.purge_user_defined:
|
|
396
|
+
remove = remove + foreign_roles
|
|
397
|
+
|
|
398
|
+
if args.check:
|
|
399
|
+
clean = not (remove or restore or repair or blocks)
|
|
400
|
+
print()
|
|
401
|
+
if clean and unknown and not reset_mode:
|
|
402
|
+
print("OK: at manifest state, but see the unknown files above")
|
|
403
|
+
else:
|
|
404
|
+
print("OK: already at manifest state" if clean else "DIRTY: run with --apply")
|
|
405
|
+
return 0 if clean else 1
|
|
406
|
+
|
|
407
|
+
if reference == target and (restore or repair):
|
|
408
|
+
print()
|
|
409
|
+
print("REFUSED: files are missing or altered and --reference is the target itself.")
|
|
410
|
+
print(" There is nothing to restore them from. Pass a clean package.")
|
|
411
|
+
return 2
|
|
412
|
+
|
|
413
|
+
for rel in remove:
|
|
414
|
+
(target / rel).unlink()
|
|
415
|
+
|
|
416
|
+
for rel in sorted(set(restore) | set(repair)):
|
|
417
|
+
src, dst = reference / rel, target / rel
|
|
418
|
+
if not src.is_file():
|
|
419
|
+
print(f" SKIP (not in reference): {rel}")
|
|
420
|
+
continue
|
|
421
|
+
dst.parent.mkdir(parents=True, exist_ok=True)
|
|
422
|
+
dst.write_bytes(src.read_bytes())
|
|
423
|
+
|
|
424
|
+
for rel, _ in blocks:
|
|
425
|
+
p = target / rel
|
|
426
|
+
new, _ = swap_managed(p.read_text(encoding="utf-8"),
|
|
427
|
+
(reference / rel).read_text(encoding="utf-8"))
|
|
428
|
+
p.write_bytes(new.encode("utf-8"))
|
|
429
|
+
|
|
430
|
+
# Prune only where this run actually removed something, and never fail the
|
|
431
|
+
# whole operation on one undeletable directory.
|
|
432
|
+
#
|
|
433
|
+
# Two faults found by running it on a real install. The walk covered the
|
|
434
|
+
# entire tree including lanes the tool has no business touching, and a single
|
|
435
|
+
# PermissionError killed the process mid-repair - three of six files restored,
|
|
436
|
+
# no summary, no indication of what had happened. A tool that deletes must
|
|
437
|
+
# not partially complete on an exception.
|
|
438
|
+
prune_roots = set()
|
|
439
|
+
if reset_mode:
|
|
440
|
+
prune_roots |= {r.rstrip("/") for r in reset_roots}
|
|
441
|
+
for rel in remove:
|
|
442
|
+
prune_roots.add(rel.split("/")[0])
|
|
443
|
+
|
|
444
|
+
pruned, unpruned = 0, []
|
|
445
|
+
candidates = [p for root in sorted(prune_roots) if (target / root).is_dir()
|
|
446
|
+
for p in (target / root).rglob("*") if p.is_dir()]
|
|
447
|
+
for d in sorted(candidates, key=lambda x: len(x.parts), reverse=True):
|
|
448
|
+
try:
|
|
449
|
+
if not any(d.iterdir()):
|
|
450
|
+
d.rmdir()
|
|
451
|
+
pruned += 1
|
|
452
|
+
except OSError as exc:
|
|
453
|
+
unpruned.append(f"{d.relative_to(target)}: {exc.strerror or exc}")
|
|
454
|
+
|
|
455
|
+
# Re-materialise lane structure the prune above may have taken with it -
|
|
456
|
+
# `.gitkeep` markers and seeded lane files.
|
|
457
|
+
#
|
|
458
|
+
# INSTANCE is excluded, and that exclusion is the whole reason this loop
|
|
459
|
+
# needs a class check at all. It iterates the manifest, so without one a
|
|
460
|
+
# LISTED instance file the user deliberately deleted gets written back from
|
|
461
|
+
# the reference. Restoring a file someone removed on purpose is the same
|
|
462
|
+
# betrayal as overwriting one they edited: the package has no claim on this
|
|
463
|
+
# lane, in either mode. Found by mutation testing - every test until then
|
|
464
|
+
# used UNLISTED instance files, so this branch was never reached.
|
|
465
|
+
recreated = 0
|
|
466
|
+
for rel, (cls, _) in manifest.items():
|
|
467
|
+
if cls == "INSTANCE":
|
|
468
|
+
continue
|
|
469
|
+
p = target / rel
|
|
470
|
+
if not p.exists() and (reference / rel).is_file():
|
|
471
|
+
p.parent.mkdir(parents=True, exist_ok=True)
|
|
472
|
+
p.write_bytes((reference / rel).read_bytes())
|
|
473
|
+
recreated += 1
|
|
474
|
+
|
|
475
|
+
print()
|
|
476
|
+
print(f"APPLIED: removed {len(remove)}, restored {len(restore)}, repaired {len(repair)},"
|
|
477
|
+
f" blocks reset {len(blocks)}, pruned {pruned} empty dirs, recreated {recreated}")
|
|
478
|
+
if unpruned:
|
|
479
|
+
print(f" {len(unpruned)} empty directories could not be removed and were"
|
|
480
|
+
f" left in place:")
|
|
481
|
+
for u in unpruned[:5]:
|
|
482
|
+
print(f" {u}")
|
|
483
|
+
print(" Nothing else was affected - the file work above completed.")
|
|
484
|
+
return 0
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
if __name__ == "__main__":
|
|
488
|
+
raise SystemExit(main())
|