tcw-cli 4.0.0__tar.gz → 4.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tcw_cli-4.0.0/tcw_cli.egg-info → tcw_cli-4.1.0}/PKG-INFO +1 -1
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/pyproject.toml +1 -1
- tcw_cli-4.1.0/tcw/__init__.py +1 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/legacy.py +54 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/plan.py +13 -1
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/references.py +16 -3
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/stores.py +40 -9
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/project.py +106 -23
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/backend.py +18 -8
- {tcw_cli-4.0.0 → tcw_cli-4.1.0/tcw_cli.egg-info}/PKG-INFO +1 -1
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_manifest_worktree.py +278 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_migration_guide_4_0.py +16 -0
- tcw_cli-4.0.0/tcw/__init__.py +0 -1
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/LICENSE +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/README.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/setup.cfg +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/capabilities/__init__.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/capabilities/cli.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/cli.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/cli_help.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/cli_suggest.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/config.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/config_cli.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/config_keys.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/errors.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/exit.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/findings.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/ids.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/locate.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/__init__.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/cli.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/config.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/editors.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/execute.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/family.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/jira.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/loose.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/model.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/overrides.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/progress.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/record.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/report.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/move.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/object_folders.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/output.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/ownership.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/project_cli.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/project_files.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/projects_cli.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/provision.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/reference_fields.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/refs.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/rewrite.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/scope.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/__init__.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/dist/client/assets/index-DkarCRfj.css +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/dist/client/assets/index-wKjMdQQ-.js +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/dist/client/index.html +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/dist/client/theme-init.js +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/files.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/records.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/server.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/services.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/work.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/stdin.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/__init__.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/base.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/checkouts.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/config_edit.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/fs.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/links.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/manifest.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/yaml_source.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/taxonomy/__init__.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/taxonomy/cli.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/tree_scope.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/validate.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/__init__.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/advance.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/backend.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/cli.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/config.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/fs_backend.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/gates.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/generate.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/hooks.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/__init__.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/client.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/config.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/jql.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/mapping.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/remote.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/tickets.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/layout.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/model.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/open.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/passages.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/audit-backlog.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/create-work.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/documentation-sync.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/pause-work.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/search.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/triage-issues.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/unattended-work.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/implement.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/inbox.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/plan.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/postmortem.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/qa.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/request.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/review.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/spec.md +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/record.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/references.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/resolve.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/scoped.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw_cli.egg-info/SOURCES.txt +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw_cli.egg-info/dependency_links.txt +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw_cli.egg-info/entry_points.txt +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw_cli.egg-info/requires.txt +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw_cli.egg-info/top_level.txt +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_capabilities.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_capabilities_cli_contract.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_capabilities_federation.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_capabilities_reset.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_capabilities_rm.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_capability_ref_wording.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_check_versions.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_cli_contract.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_cli_guide.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_cli_handler.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_cli_help_standard.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_combine.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_command_suggestions.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_committed_paths.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_config_command_state.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_config_edit.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_config_edit_writers.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_config_environment.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_config_keys.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_config_overrides.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_configuration_text_home.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_cut_version.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_doc_vocabulary.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_docs_describe_3_0.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_docs_describe_4_0.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_documentation_config.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_documentation_prompt.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_documentation_sync_wiring.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_documented_cli_surface.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_dynamic_skill_marker.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_environment_hardness.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_eval_coverage.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_eval_files_changed.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_eval_fixture.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_eval_grading.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_eval_runner.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_exit_code_tables.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_falsification_rule.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_families.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_fetch_project.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_findings_type.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_generate_hook.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_git_example.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_identifier_length.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_identifier_sweep.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_ids.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_inherited_config.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_init_configured_tree_path.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_init_provision_contract.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_item_tags_read.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_ledger_3_0.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_legacy_store_config.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_lifecycle_config_tags.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_links_full_identifiers.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_literal_store_names.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_load_order.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_locate.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_manifest.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_manifest_cli.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_manifest_cousins.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_migration_guide.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_multiproject.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_no_3x_inheritance.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_no_extends.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_no_node.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_object_folder_shape.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_object_folder_sweep.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_object_folders.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_object_walk.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_override_in_linked_worktree.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_override_letter_case.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_override_references.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_overrides_by_path.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_ownership.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_ownership_sweep.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_owning_project.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_parent_links.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_parent_links_cli.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_parent_links_parse.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_parent_links_static.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_partial_removal.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_plugin_manifests.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_procedure_config.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_procedure_verb.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_files.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_files_cli.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_graph_paths.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_group.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_info.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_lookup.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_overrides.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_path.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_placement.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_provision.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_registry.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_projectfiles_helper.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_projects_list.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_prompt_fallback.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_reference_fields.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_refs.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_remote_session_setup.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_removal_blockers.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_repo_lifecycle.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_require_artifact.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_rewrite.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_rewrite_values.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_routing_nodes.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_run_in_folder.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_scope_members.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_scope_reader.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_scope_rows.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_scope_trees.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_session_bootstrap.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_shipped_procedures.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_shipped_prompts.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_shipped_text.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_skill_flow.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_skill_path_pointers.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_smoke.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_stage_verb.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_state_files.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_statefiles_helper.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_static_guards.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_stdin.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_stdin_cli.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_store_addresses.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_store_bounds.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_store_editor.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_store_nodes.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_store_provisioning.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_stored_references.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_subprocess_stdin.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_suite_runs_its_own_tcw.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_taxonomy.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_taxonomy_cli_contract.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_taxonomy_rm_gaps.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_full_identifiers.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_inheritance.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_move.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_parent_missing.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_parents.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_store_files_only.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_store_raises.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_unattended_work_skill.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_unpushed_version_script.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_upcoming_entries.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_upstream_projects.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_validate.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_validate_command.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_validate_moved_stores.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_validate_target.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_worktree_remote_forms.py +0 -0
- {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_worktree_sibling_nodes.py +0 -0
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tcw-cli"
|
|
7
|
-
version = "4.
|
|
7
|
+
version = "4.1.0"
|
|
8
8
|
description = "Taxonomy · Capabilities · Work — a storage-abstracted framework for describing and evolving a software project."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "4.1.0"
|
|
@@ -983,6 +983,60 @@ def route_entry_3x(path: str, *, extends: set[str], children: list[str],
|
|
|
983
983
|
f"qualify the path with a child project id ({qualifiers})")
|
|
984
984
|
|
|
985
985
|
|
|
986
|
+
@dataclass(frozen=True)
|
|
987
|
+
class TermClash:
|
|
988
|
+
"""A `capabilities.yaml` term entry `route_term_entry_3x` refuses: the
|
|
989
|
+
B10's `why` and `fix`, as `Blocker` prints them."""
|
|
990
|
+
|
|
991
|
+
why: str
|
|
992
|
+
fix: str
|
|
993
|
+
|
|
994
|
+
|
|
995
|
+
def _either_or(items: list[str]) -> str:
|
|
996
|
+
return items[0] if len(items) == 1 else f"{', '.join(items[:-1])} or {items[-1]}"
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
def route_term_entry_3x(path: str, *, children: list[str], own: set[str],
|
|
1000
|
+
sources: dict[str, set[str]], project_id: str
|
|
1001
|
+
) -> tuple[str | None, str] | TermClash:
|
|
1002
|
+
"""The owner of a `capabilities.yaml` entry under `taxonomy:` (TCW-119
|
|
1003
|
+
Design 1). 3.x read every such entry in the project's own taxonomy
|
|
1004
|
+
(`_LedgerReader.term`, `tcw/work/gates.py:430-437` at v3.0.2), so where
|
|
1005
|
+
3.x's `get` (`bare_owner_3x`) names a source or finds the path, that
|
|
1006
|
+
reading stands. Otherwise an entry prefixed with a listed child's ID is
|
|
1007
|
+
that child's term, as `route_entry_3x` routes a capability entry beside
|
|
1008
|
+
it, unless the child's ID is also a first folder of the project's own
|
|
1009
|
+
taxonomy or a source's: that could mean either, as `route_entry_3x`
|
|
1010
|
+
refuses for a capability, and is a `TermClash` naming each project that
|
|
1011
|
+
has the folder. `own` and `sources` are the taxonomy id-paths
|
|
1012
|
+
`bare_owner_3x` reads; `Ambiguous3` is raised as it raises it."""
|
|
1013
|
+
head, _, rest = path.partition("/")
|
|
1014
|
+
if not rest or head not in children or head in sources:
|
|
1015
|
+
return bare_owner_3x(path, own, sources)
|
|
1016
|
+
if path in own or any(path in paths for paths in sources.values()):
|
|
1017
|
+
return bare_owner_3x(path, own, sources)
|
|
1018
|
+
|
|
1019
|
+
def has_folder(paths: set[str]) -> bool:
|
|
1020
|
+
return any(p.split("/", 1)[0] == head for p in paths)
|
|
1021
|
+
|
|
1022
|
+
own_has = has_folder(own)
|
|
1023
|
+
inherited = [alias for alias, paths in sources.items() if has_folder(paths)]
|
|
1024
|
+
if not own_has and not inherited:
|
|
1025
|
+
return head, rest
|
|
1026
|
+
places = ["this project's taxonomy"] if own_has else []
|
|
1027
|
+
if inherited:
|
|
1028
|
+
quoted = [f"'{alias}'" for alias in inherited]
|
|
1029
|
+
names = (", ".join(quoted[:-1]) + " and " + quoted[-1]) if len(quoted) > 1 else quoted[0]
|
|
1030
|
+
places.append(f"the taxonom{'ies' if len(inherited) > 1 else 'y'} it inherits "
|
|
1031
|
+
f"from {names}")
|
|
1032
|
+
owners = ([project_id] if own_has else []) + inherited
|
|
1033
|
+
ids = [f"'{head}.taxonomy/{rest}'", *(f"'{owner}.taxonomy/{path}'" for owner in owners)]
|
|
1034
|
+
return TermClash(
|
|
1035
|
+
f"{path}: ambiguous — '{head}' is both a child project of this project and a "
|
|
1036
|
+
f"namespace in {' and '.join(places)}",
|
|
1037
|
+
f"write it as {_either_or(ids)}, then run 'tcw migrate' again")
|
|
1038
|
+
|
|
1039
|
+
|
|
986
1040
|
def link_owner_3x(link: TcwRef3, own: dict[str, set[str]],
|
|
987
1041
|
sources: dict[str, dict[str, set[str]]]) -> tuple[str | None, str]:
|
|
988
1042
|
"""`resolve_tcw_ref`, `tcw/refs.py:84-125` at v3.0.2, for a taxonomy or
|
|
@@ -442,6 +442,17 @@ def plan_jira_half(root: Path, project_id: str | None, *, jira_backed: bool,
|
|
|
442
442
|
return jira.half(root, project_id)
|
|
443
443
|
|
|
444
444
|
|
|
445
|
+
def _jira_site(root: Path, work_backend: str) -> str | None:
|
|
446
|
+
"""The `work.jira.site` of the project's own layers, for a project whose
|
|
447
|
+
work is kept in Jira: a 3.x item file's link on it becomes the ticket's
|
|
448
|
+
key (TCW-177)."""
|
|
449
|
+
if work_backend != "jira":
|
|
450
|
+
return None
|
|
451
|
+
jira = own_jira_layers(root).jira
|
|
452
|
+
site = jira.get("site") if isinstance(jira, dict) else None
|
|
453
|
+
return site if isinstance(site, str) else None
|
|
454
|
+
|
|
455
|
+
|
|
445
456
|
def no_jira_line(root: Path, project_id: str | None) -> str:
|
|
446
457
|
"""The summary's line for a Jira-backed project run with `--no-jira`
|
|
447
458
|
(Design 1.1), its Jira project read from the configuration alone."""
|
|
@@ -510,7 +521,8 @@ def make_plan(root: Path, *, no_jira: bool = False) -> Plan:
|
|
|
510
521
|
found = stores.plan_stores(read.root, read.shared[1], shared.project,
|
|
511
522
|
three_x=read.three_x, work_backend=read.work_backend,
|
|
512
523
|
family=family, ancestors=links.ancestors,
|
|
513
|
-
middle=bool(links.below)
|
|
524
|
+
middle=bool(links.below),
|
|
525
|
+
jira_site=_jira_site(read.root, read.work_backend))
|
|
514
526
|
plan.owners = found.owners
|
|
515
527
|
plan.blockers += found.blockers
|
|
516
528
|
reports += found.reports
|
|
@@ -7,8 +7,12 @@ names that project's item. A taxonomy or capability path prefixed with an
|
|
|
7
7
|
3.x `get` read it (`legacy.bare_owner_3x`): the project's own when it has
|
|
8
8
|
the object, else the one inherited source that has it, ambiguous B10. A
|
|
9
9
|
`capabilities.yaml` entry under `new:`, `changed:` or `removed:` is routed
|
|
10
|
-
as 3.x's `route_capability_path` routes it (`legacy.route_entry_3x`)
|
|
11
|
-
|
|
10
|
+
as 3.x's `route_capability_path` routes it (`legacy.route_entry_3x`). One
|
|
11
|
+
under `taxonomy:` is read as a term is, except that one prefixed with a
|
|
12
|
+
listed child's ID names the child's term where 3.x's reading neither names a
|
|
13
|
+
source nor finds the path, and is B10 where the child's ID is also a folder
|
|
14
|
+
of the project's own or an inherited taxonomy (`legacy.route_term_entry_3x`,
|
|
15
|
+
TCW-119). A value already written as a full
|
|
12
16
|
identifier is left. A reference to an object an override's move put at a new
|
|
13
17
|
id-path names the new one: this run's moves for the project's own objects,
|
|
14
18
|
and a migrated source's record (`moved:`) for its own.
|
|
@@ -24,7 +28,8 @@ from dataclasses import dataclass, field
|
|
|
24
28
|
from typing import Any
|
|
25
29
|
|
|
26
30
|
from tcw.ids import FullId, id_part_problem, id_path_problem, looks_full
|
|
27
|
-
from tcw.migrate.legacy import Ambiguous3, bare_owner_3x, links_3x,
|
|
31
|
+
from tcw.migrate.legacy import (Ambiguous3, TermClash, bare_owner_3x, links_3x,
|
|
32
|
+
route_entry_3x, route_term_entry_3x)
|
|
28
33
|
from tcw.migrate.model import Blocker
|
|
29
34
|
from tcw.reference_fields import Field, fields_of
|
|
30
35
|
from tcw.rewrite import Replace
|
|
@@ -132,6 +137,14 @@ class Owners:
|
|
|
132
137
|
owner, path = routed
|
|
133
138
|
if owner is None:
|
|
134
139
|
owner, path = bare_owner_3x(path, own, sources)
|
|
140
|
+
elif row.record == "capabilities-yaml":
|
|
141
|
+
routed = route_term_entry_3x(value, children=self.view.children,
|
|
142
|
+
own=own, sources=sources,
|
|
143
|
+
project_id=self.project)
|
|
144
|
+
if isinstance(routed, TermClash):
|
|
145
|
+
self.blockers.append(Blocker("B10", where, routed.why, routed.fix))
|
|
146
|
+
return None
|
|
147
|
+
owner, path = routed
|
|
135
148
|
else:
|
|
136
149
|
owner, path = bare_owner_3x(value, own, sources)
|
|
137
150
|
except Ambiguous3:
|
|
@@ -16,6 +16,7 @@ object, and a file in it named like a state file is A2.
|
|
|
16
16
|
from __future__ import annotations
|
|
17
17
|
|
|
18
18
|
import os
|
|
19
|
+
import re
|
|
19
20
|
from dataclasses import dataclass, field
|
|
20
21
|
from pathlib import Path
|
|
21
22
|
|
|
@@ -262,11 +263,13 @@ def left_elsewhere(root: Path, mapping: dict, steps, git: Path | None) -> list[s
|
|
|
262
263
|
|
|
263
264
|
def _plan_object(store: Store, id_path: str, kept: set[str], project: str,
|
|
264
265
|
out: StorePlan, mentions: Mentions, entries: list[str],
|
|
265
|
-
owners: Owners, work_backend: str, override=None
|
|
266
|
+
owners: Owners, work_backend: str, override=None,
|
|
267
|
+
jira_site: str | None = None) -> None:
|
|
266
268
|
"""One object's state file. `override` is the object's C14 resolution:
|
|
267
269
|
its 4.0 state file is written at the original's id-path, without the
|
|
268
270
|
`overrides` key, and keeps no `name` of its own when it had none, since
|
|
269
|
-
3.x showed the original's.
|
|
271
|
+
3.x showed the original's. `jira_site` is the project's `work.jira.site`
|
|
272
|
+
in a Jira-backed project, for the ticket's key (`_ticket_key`)."""
|
|
270
273
|
ns = store.namespace
|
|
271
274
|
folder = store.folder / id_path
|
|
272
275
|
old_rel = f"{store.rel}/{id_path}/{STATE_3X[ns]}"
|
|
@@ -328,9 +331,14 @@ def _plan_object(store: Store, id_path: str, kept: set[str], project: str,
|
|
|
328
331
|
f"written, the name TCW 3 showed"))
|
|
329
332
|
if text is None:
|
|
330
333
|
out.reports.append(Report("D7", new_rel, "written where TCW 3 had no state file"))
|
|
334
|
+
as_read = {VERSION_KEY: __version__, **applied(intended(data, edits), rows, replace)}
|
|
335
|
+
if ns == "work" and (key := _ticket_key(data.get("ticket"), name, jira_site)):
|
|
336
|
+
edits.append(SetTop("ticket", key))
|
|
331
337
|
expect = {VERSION_KEY: __version__, **applied(intended(data, edits), rows, replace)}
|
|
332
338
|
if four_text is not None:
|
|
333
|
-
|
|
339
|
+
# A 4.0 file holding the link (written by TCW 4.0.0) or the key
|
|
340
|
+
# (written by this TCW, in a run that stopped) agrees with either.
|
|
341
|
+
_both(store, old_rel, new_rel, text, four_text, expect, out, also=as_read)
|
|
334
342
|
else:
|
|
335
343
|
try:
|
|
336
344
|
new = convert_text(new_rel, source, edits, fields=rows, replace=replace,
|
|
@@ -352,15 +360,36 @@ def _plan_object(store: Store, id_path: str, kept: set[str], project: str,
|
|
|
352
360
|
out.reports.append(Report("D7", rel, "written empty, where TCW 3 had none"))
|
|
353
361
|
|
|
354
362
|
|
|
363
|
+
_JIRA_KEY = re.compile(r"[A-Z][A-Z0-9_]*-[1-9][0-9]*")
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
def _ticket_key(ticket, folder: str, site: str | None) -> str | None:
|
|
367
|
+
"""The key a 3.x Jira item file's `ticket` is written as (TCW-177): the
|
|
368
|
+
folder's key, when `ticket` is exactly the link `<site>/browse/<KEY>` on
|
|
369
|
+
the project's `work.jira.site` naming that key; else None, and the value
|
|
370
|
+
is carried over as it is, for `tcw validate` to judge."""
|
|
371
|
+
if not isinstance(ticket, str) or not isinstance(site, str) or not site:
|
|
372
|
+
return None
|
|
373
|
+
prefix = f"{site.rstrip('/')}/browse/"
|
|
374
|
+
key = ticket[len(prefix):] if ticket.startswith(prefix) else ""
|
|
375
|
+
# The key as the Jira backend reads it from a folder's name (its
|
|
376
|
+
# `KEY_FOLDER`; only `tcw/migrate/jira.py` may import that backend).
|
|
377
|
+
if not _JIRA_KEY.fullmatch(key) or not folder.startswith(f"{key}-"):
|
|
378
|
+
return None
|
|
379
|
+
return key
|
|
380
|
+
|
|
381
|
+
|
|
355
382
|
def _both(store: Store, old_rel: str, new_rel: str, text: str | None, four_text: str,
|
|
356
|
-
expect: dict, out: StorePlan) -> None:
|
|
357
|
-
"""Design 2.7's both-files rule, for a state file.
|
|
383
|
+
expect: dict, out: StorePlan, also: dict | None = None) -> None:
|
|
384
|
+
"""Design 2.7's both-files rule, for a state file. `also` is a second
|
|
385
|
+
content the 4.0 file may equal (TCW-177: the ticket's link as read)."""
|
|
358
386
|
data4, problem = parse_mapping_3x(four_text, Path(new_rel))
|
|
359
387
|
if problem:
|
|
360
388
|
out.blockers.append(Blocker("B14", new_rel, problem,
|
|
361
389
|
"correct the file by hand, then run 'tcw migrate' again"))
|
|
362
390
|
return
|
|
363
|
-
if without_version(data4 or {}) != without_version(expect)
|
|
391
|
+
if without_version(data4 or {}) != without_version(expect) and not (
|
|
392
|
+
also is not None and without_version(data4 or {}) == without_version(also)):
|
|
364
393
|
where = first_difference(without_version(expect), without_version(data4 or {}))
|
|
365
394
|
out.blockers.append(Blocker(
|
|
366
395
|
"B11", old_rel, f"differs from {new_rel} at {dotted(where or ())}",
|
|
@@ -496,7 +525,7 @@ def _meta_of(store: Store, id_path: str) -> dict:
|
|
|
496
525
|
def plan_stores(root: Path, mapping: dict, project: str, *,
|
|
497
526
|
three_x: bool = True, work_backend: str = "filesystem",
|
|
498
527
|
family=None, ancestors: dict[str, list[str]] | None = None,
|
|
499
|
-
middle: bool = False) -> StorePlan:
|
|
528
|
+
middle: bool = False, jira_site: str | None = None) -> StorePlan:
|
|
500
529
|
"""Every store's state files and loose entries. `three_x`: the project's
|
|
501
530
|
configuration is still in 3.x form, so a bare taxonomy folder is a 3.x
|
|
502
531
|
term. `family` is the project's related projects, whose stores B7 also
|
|
@@ -504,7 +533,8 @@ def plan_stores(root: Path, mapping: dict, project: str, *,
|
|
|
504
533
|
among (C14); `ancestors`, the projects each axis is inherited from once
|
|
505
534
|
converted (D2); `middle`, whether a project of the family inherits
|
|
506
535
|
capabilities from it, below which
|
|
507
|
-
4.0 applies its overrides (D4)
|
|
536
|
+
4.0 applies its overrides (D4); `jira_site`, the project's
|
|
537
|
+
`work.jira.site` when its work is kept in Jira (TCW-177)."""
|
|
508
538
|
out = StorePlan()
|
|
509
539
|
stores = stores_of(root, mapping)
|
|
510
540
|
out.blockers += nesting_blockers(stores)
|
|
@@ -567,7 +597,8 @@ def plan_stores(root: Path, mapping: dict, project: str, *,
|
|
|
567
597
|
entries = [m.entry for m in moved
|
|
568
598
|
if m.store_rel == store.rel and m.from_path == id_path]
|
|
569
599
|
_plan_object(store, id_path, kept, project, out, mentions, entries, owners,
|
|
570
|
-
work_backend, found_overrides.get((store.rel, id_path))
|
|
600
|
+
work_backend, found_overrides.get((store.rel, id_path)),
|
|
601
|
+
jira_site=jira_site if work_backend == "jira" else None)
|
|
571
602
|
covered.add(f"{store.rel}/{id_path}/{STATE_3X[store.namespace]}")
|
|
572
603
|
out.reports += _resources_reports(store, kept)
|
|
573
604
|
_text_writes(root, planned, moved, mentions, covered, owners, out)
|
|
@@ -56,6 +56,7 @@ def override_variable(project_id: str) -> str:
|
|
|
56
56
|
_ANCHOR_CACHE: dict[Path, tuple[Path, Path] | None] = {}
|
|
57
57
|
_REPOSITORY_CACHE: dict[Path, tuple[Path, tuple[str, ...],
|
|
58
58
|
tuple[tuple[str, str], ...]] | None] = {}
|
|
59
|
+
_CHECKOUT_CACHE: dict[Path, tuple[Path, Path | None, Path] | None] = {}
|
|
59
60
|
|
|
60
61
|
|
|
61
62
|
#: The registry opened for each project root while a command runs; None
|
|
@@ -211,24 +212,50 @@ def _git_lines(directory: Path, *args: str) -> list[str] | None:
|
|
|
211
212
|
return None
|
|
212
213
|
|
|
213
214
|
|
|
215
|
+
def _checkout_of(folder: Path) -> tuple[Path, Path | None, Path] | None:
|
|
216
|
+
"""`(top, main, common)` for the git checkout `folder` is in: its top
|
|
217
|
+
folder, its main checkout (`top` itself for a main checkout) and its
|
|
218
|
+
git common folder; None outside one. `main` is None for a linked
|
|
219
|
+
worktree of a bare repository, which has no main checkout.
|
|
220
|
+
|
|
221
|
+
One `git rev-parse --show-toplevel --git-common-dir` per folder per
|
|
222
|
+
process, cached in `_CHECKOUT_CACHE` for the life of the process, as
|
|
223
|
+
`worktree_anchors` caches its answer: `worktree_anchors`, the walk in
|
|
224
|
+
`_left_out_of_the_climb` and `_same_place_in_two_checkouts` all read
|
|
225
|
+
it, so a folder any of them has asked about is not asked about again.
|
|
226
|
+
|
|
227
|
+
A common folder named `.git` is the main checkout's own. A repository
|
|
228
|
+
that is itself a submodule keeps its git dir at
|
|
229
|
+
`<outer>/.git/modules/<name>`, and records its checkout as
|
|
230
|
+
`core.worktree`, relative to that dir, which one more call reads: so a
|
|
231
|
+
submodule's own linked worktree has the submodule's checkout as its
|
|
232
|
+
main checkout, as any other repository's has. A *bare* repository
|
|
233
|
+
records none."""
|
|
234
|
+
key = folder.resolve()
|
|
235
|
+
if key not in _CHECKOUT_CACHE:
|
|
236
|
+
out = _git_lines(key, "rev-parse", "--path-format=absolute",
|
|
237
|
+
"--show-toplevel", "--git-common-dir")
|
|
238
|
+
found = None
|
|
239
|
+
if out and len(out) == 2:
|
|
240
|
+
top, common = Path(out[0]).resolve(), Path(out[1]).resolve()
|
|
241
|
+
if common.name == ".git":
|
|
242
|
+
main: Path | None = common.parent
|
|
243
|
+
else:
|
|
244
|
+
worktree = _git_lines(common, "--git-dir", str(common), "config",
|
|
245
|
+
"--get", "core.worktree")
|
|
246
|
+
main = (common / worktree[0]).resolve() if worktree else None
|
|
247
|
+
found = (top, main, common)
|
|
248
|
+
_CHECKOUT_CACHE[key] = found
|
|
249
|
+
return _CHECKOUT_CACHE[key]
|
|
250
|
+
|
|
251
|
+
|
|
214
252
|
def _probe_worktree(directory: Path) -> tuple[Path, Path] | None:
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
if not out or len(out) != 2:
|
|
253
|
+
found = _checkout_of(directory)
|
|
254
|
+
if found is None:
|
|
218
255
|
return None
|
|
219
|
-
top,
|
|
220
|
-
if
|
|
221
|
-
|
|
222
|
-
else:
|
|
223
|
-
# A repository that is itself a submodule keeps its git dir at
|
|
224
|
-
# `<outer>/.git/modules/<name>`, and records its checkout as
|
|
225
|
-
# `core.worktree`, relative to that dir. A *bare* repo records none and
|
|
226
|
-
# is not a worktree at all, so it gives no anchors.
|
|
227
|
-
worktree = _git_lines(common, "--git-dir", str(common), "config", "--get",
|
|
228
|
-
"core.worktree")
|
|
229
|
-
if not worktree:
|
|
230
|
-
return None
|
|
231
|
-
main = (common / worktree[0]).resolve()
|
|
256
|
+
top, main, _ = found
|
|
257
|
+
if main is None:
|
|
258
|
+
return None # a bare repository's worktree gives no anchors
|
|
232
259
|
if main != top:
|
|
233
260
|
return top, main
|
|
234
261
|
# Not a linked worktree of its own repository. A submodule checked out in a
|
|
@@ -377,10 +404,24 @@ def search_rounds(named_by: Path, anchors: tuple[Path, Path] | None
|
|
|
377
404
|
from the main checkout as above, follows when the first finds nothing:
|
|
378
405
|
a workspace repository's `.worktrees/` folder, in its main checkout or
|
|
379
406
|
in one of its linked worktrees, or a home folder kept in git, holds a
|
|
380
|
-
worktree whose sibling projects are beside the main checkout only.
|
|
381
|
-
|
|
407
|
+
worktree whose sibling projects are beside the main checkout only.
|
|
408
|
+
|
|
409
|
+
Wherever the search looks from where a folder is (every round but the
|
|
410
|
+
one from the main checkout), its climb leaves out the main checkout of
|
|
411
|
+
each linked worktree enclosing the folder that is stored inside that
|
|
412
|
+
main checkout, and the folders between the two that are in the main
|
|
413
|
+
checkout's repository: they are the original the worktree was made
|
|
414
|
+
from, on another branch, as Claude Code's `.claude/worktrees/<name>`
|
|
415
|
+
is. The folders above that main checkout are still climbed, and so is a
|
|
416
|
+
folder of a separate repository between the two (TCW-120,
|
|
417
|
+
`_left_out_of_the_climb`). That holds for a related project's search
|
|
418
|
+
made outside the active worktree, and for an active project in no
|
|
419
|
+
worktree, too; a folder with no linked worktree above it is climbed in
|
|
420
|
+
full, with no git process started."""
|
|
382
421
|
if anchors is None or _below(named_by, anchors[0]) is None:
|
|
383
|
-
|
|
422
|
+
if _under_a_linked_worktree(named_by):
|
|
423
|
+
return [(named_by.parent, named_by, _climb(named_by, named_by))]
|
|
424
|
+
return [(named_by.parent, named_by, list(named_by.parents))]
|
|
384
425
|
top, main = anchors
|
|
385
426
|
holder, own = (main.parent, main) if named_by == top else (named_by.parent, named_by)
|
|
386
427
|
enclosing = [p for p in named_by.parents if _below(p, top) is not None]
|
|
@@ -388,12 +429,55 @@ def search_rounds(named_by: Path, anchors: tuple[Path, Path] | None
|
|
|
388
429
|
from_main = (holder, own, enclosing)
|
|
389
430
|
if not read_as_written(top.parent, anchors):
|
|
390
431
|
return [from_main]
|
|
432
|
+
as_written = (named_by.parent, named_by, _climb(named_by, named_by))
|
|
391
433
|
holding = worktree_anchors(top.parent)
|
|
392
434
|
if holding is not None and _below(main, holding[1]) is not None:
|
|
393
435
|
return [as_written]
|
|
394
436
|
return [as_written, from_main]
|
|
395
437
|
|
|
396
438
|
|
|
439
|
+
def _under_a_linked_worktree(folder: Path) -> bool:
|
|
440
|
+
"""Whether `folder` or a folder above it has a `.git` that is a file, the
|
|
441
|
+
mark git leaves in a linked worktree's top folder (and a submodule's).
|
|
442
|
+
Read from the disk: no git process starts."""
|
|
443
|
+
return any(_is_file(f / ".git") for f in (folder, *folder.parents))
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
def _left_out_of_the_climb(start: Path) -> list[Path]:
|
|
447
|
+
"""The folders the search's climb from `start` leaves out (TCW-120): for
|
|
448
|
+
each linked worktree enclosing `start` that is stored inside its own
|
|
449
|
+
main checkout, found by walking the checkouts outward, nearest first,
|
|
450
|
+
main or linked, the folders enclosing that worktree up to and including
|
|
451
|
+
its main checkout that are in the main checkout's repository. A folder
|
|
452
|
+
of a separate repository between them is a checkout in its own right,
|
|
453
|
+
and is kept."""
|
|
454
|
+
left_out: list[Path] = []
|
|
455
|
+
found = _checkout_of(start)
|
|
456
|
+
while found is not None:
|
|
457
|
+
top, main, common = found
|
|
458
|
+
main = top if main is None else main # a bare repository's worktree
|
|
459
|
+
if top != main and _below(top, main) is not None:
|
|
460
|
+
for folder in top.parents:
|
|
461
|
+
if _below(folder, main) is None:
|
|
462
|
+
break
|
|
463
|
+
if (_repository_of(folder) or (None,))[0] == common:
|
|
464
|
+
left_out.append(folder)
|
|
465
|
+
if top.parent == top:
|
|
466
|
+
break
|
|
467
|
+
found = _checkout_of(top.parent)
|
|
468
|
+
if found is not None and _below(top, found[0]) in (None, Path(".")):
|
|
469
|
+
break # not strictly further out: never loop
|
|
470
|
+
return left_out
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
def _climb(named_by: Path, start: Path) -> list[Path]:
|
|
474
|
+
"""The folders enclosing `named_by`, nearest first, without those
|
|
475
|
+
`_left_out_of_the_climb(start)` names, compared by folder identity."""
|
|
476
|
+
left_out = _left_out_of_the_climb(start)
|
|
477
|
+
return [f for f in named_by.parents
|
|
478
|
+
if not any(_below(f, out) == Path(".") for out in left_out)]
|
|
479
|
+
|
|
480
|
+
|
|
397
481
|
def _same_place_in_two_checkouts(a: Path, b: Path) -> bool:
|
|
398
482
|
"""Whether folders `a` and `b` are the same place in two checkouts, main
|
|
399
483
|
or linked, of one repository: the same project on two branches, not two
|
|
@@ -403,11 +487,10 @@ def _same_place_in_two_checkouts(a: Path, b: Path) -> bool:
|
|
|
403
487
|
the copy in the worktree set (TCW-118, the evaluation of candidate 7)."""
|
|
404
488
|
places = []
|
|
405
489
|
for folder in (a, b):
|
|
406
|
-
found =
|
|
407
|
-
|
|
408
|
-
if not found or len(found) != 2:
|
|
490
|
+
found = _checkout_of(Path(folder))
|
|
491
|
+
if found is None:
|
|
409
492
|
return False
|
|
410
|
-
top, common =
|
|
493
|
+
top, _, common = found
|
|
411
494
|
inside = _below(Path(folder).resolve(), top)
|
|
412
495
|
if inside is None:
|
|
413
496
|
return False
|
|
@@ -140,7 +140,7 @@ def link_exists(work_path: Path, folder: str) -> bool:
|
|
|
140
140
|
|
|
141
141
|
#: Row h's message in Jira mode, at the state file: today's message for an
|
|
142
142
|
#: item folder whose 3.x state file was missing (TCW-111 Design 2.6).
|
|
143
|
-
UNMADE_MESSAGE = "is missing; it holds the ticket's
|
|
143
|
+
UNMADE_MESSAGE = "is missing; it holds the ticket's key"
|
|
144
144
|
|
|
145
145
|
|
|
146
146
|
def _key_named(name: str) -> bool:
|
|
@@ -196,15 +196,16 @@ OPTIONAL_STATE_KEYS = frozenset({"id", "parent", "blocked-by"})
|
|
|
196
196
|
|
|
197
197
|
|
|
198
198
|
def _item_file_problems(path: Path, key: str, site: str) -> list[Finding]:
|
|
199
|
-
"""The state file must hold exactly `tcw-version` and `ticket
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
"""The state file must hold exactly `tcw-version` and `ticket`, and may
|
|
200
|
+
hold `id` (Design 2.2; TCW-111 Design 1.2). `ticket` is the folder's
|
|
201
|
+
key, or the link `<site>/browse/<KEY>` TCW 4.0.0 wrote, checked as it
|
|
202
|
+
was then (TCW-177 Design 2). Its version is checked first: a file this
|
|
203
|
+
TCW cannot read is reported for that alone (Design 1.5)."""
|
|
203
204
|
where = str(path)
|
|
204
205
|
try:
|
|
205
206
|
data = yaml.safe_load(path.read_text(encoding="utf-8"))
|
|
206
207
|
except FileNotFoundError:
|
|
207
|
-
return [Finding("error", where,
|
|
208
|
+
return [Finding("error", where, UNMADE_MESSAGE)]
|
|
208
209
|
except (OSError, UnicodeDecodeError, yaml.YAMLError) as error:
|
|
209
210
|
return [Finding("error", where, f"cannot be read: {error}")]
|
|
210
211
|
if isinstance(data, dict) and (problem := version_problem(data, state=True)) is not None:
|
|
@@ -222,8 +223,17 @@ def _item_file_problems(path: Path, key: str, site: str) -> list[Finding]:
|
|
|
222
223
|
if (problem := _recorded_problem(data)) is not None:
|
|
223
224
|
return [Finding("error", where, problem)]
|
|
224
225
|
url = data["ticket"]
|
|
226
|
+
if not isinstance(url, str):
|
|
227
|
+
return [Finding("error", where, f"ticket {url!r} is not the folder's key, {key}")]
|
|
228
|
+
if "/" not in url:
|
|
229
|
+
# The key form, written since TCW-177. A Jira key holds no `/`.
|
|
230
|
+
if url != key:
|
|
231
|
+
return [Finding("error", where, f"ticket {url!r} is not the folder's "
|
|
232
|
+
f"key, {key}")]
|
|
233
|
+
return []
|
|
234
|
+
# The link form TCW 4.0.0 wrote, checked as it was then.
|
|
225
235
|
prefix = f"{site}/browse/"
|
|
226
|
-
if not
|
|
236
|
+
if not url.startswith(prefix):
|
|
227
237
|
return [Finding("error", where, f"ticket {url!r} is not on {site} "
|
|
228
238
|
f"(work.jira.site)")]
|
|
229
239
|
if url[len(prefix):] != key:
|
|
@@ -939,7 +949,7 @@ class JiraBackend:
|
|
|
939
949
|
document = path / STATE_FILE
|
|
940
950
|
recorded = ({"parent": str(parent)} if parent is not None else {}) | \
|
|
941
951
|
({"blocked-by": [str(s) for s in blocked_by]} if blocked_by else {})
|
|
942
|
-
text = f"{version_line()}ticket: {
|
|
952
|
+
text = f"{version_line()}ticket: {key}\n"
|
|
943
953
|
if recorded:
|
|
944
954
|
text += yaml.safe_dump(recorded, sort_keys=False, allow_unicode=True)
|
|
945
955
|
document.write_text(text, encoding="utf-8")
|