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.
Files changed (274) hide show
  1. {tcw_cli-4.0.0/tcw_cli.egg-info → tcw_cli-4.1.0}/PKG-INFO +1 -1
  2. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/pyproject.toml +1 -1
  3. tcw_cli-4.1.0/tcw/__init__.py +1 -0
  4. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/legacy.py +54 -0
  5. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/plan.py +13 -1
  6. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/references.py +16 -3
  7. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/stores.py +40 -9
  8. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/project.py +106 -23
  9. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/backend.py +18 -8
  10. {tcw_cli-4.0.0 → tcw_cli-4.1.0/tcw_cli.egg-info}/PKG-INFO +1 -1
  11. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_manifest_worktree.py +278 -0
  12. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_migration_guide_4_0.py +16 -0
  13. tcw_cli-4.0.0/tcw/__init__.py +0 -1
  14. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/LICENSE +0 -0
  15. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/README.md +0 -0
  16. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/setup.cfg +0 -0
  17. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/capabilities/__init__.py +0 -0
  18. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/capabilities/cli.py +0 -0
  19. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/cli.py +0 -0
  20. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/cli_help.py +0 -0
  21. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/cli_suggest.py +0 -0
  22. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/config.py +0 -0
  23. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/config_cli.py +0 -0
  24. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/config_keys.py +0 -0
  25. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/errors.py +0 -0
  26. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/exit.py +0 -0
  27. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/findings.py +0 -0
  28. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/ids.py +0 -0
  29. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/locate.py +0 -0
  30. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/__init__.py +0 -0
  31. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/cli.py +0 -0
  32. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/config.py +0 -0
  33. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/editors.py +0 -0
  34. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/execute.py +0 -0
  35. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/family.py +0 -0
  36. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/jira.py +0 -0
  37. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/loose.py +0 -0
  38. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/model.py +0 -0
  39. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/overrides.py +0 -0
  40. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/progress.py +0 -0
  41. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/record.py +0 -0
  42. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/migrate/report.py +0 -0
  43. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/move.py +0 -0
  44. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/object_folders.py +0 -0
  45. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/output.py +0 -0
  46. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/ownership.py +0 -0
  47. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/project_cli.py +0 -0
  48. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/project_files.py +0 -0
  49. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/projects_cli.py +0 -0
  50. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/provision.py +0 -0
  51. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/reference_fields.py +0 -0
  52. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/refs.py +0 -0
  53. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/rewrite.py +0 -0
  54. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/scope.py +0 -0
  55. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/__init__.py +0 -0
  56. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/dist/client/assets/index-DkarCRfj.css +0 -0
  57. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/dist/client/assets/index-wKjMdQQ-.js +0 -0
  58. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/dist/client/index.html +0 -0
  59. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/dist/client/theme-init.js +0 -0
  60. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/files.py +0 -0
  61. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/records.py +0 -0
  62. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/server.py +0 -0
  63. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/services.py +0 -0
  64. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/serve/work.py +0 -0
  65. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/stdin.py +0 -0
  66. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/__init__.py +0 -0
  67. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/base.py +0 -0
  68. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/checkouts.py +0 -0
  69. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/config_edit.py +0 -0
  70. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/fs.py +0 -0
  71. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/links.py +0 -0
  72. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/manifest.py +0 -0
  73. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/store/yaml_source.py +0 -0
  74. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/taxonomy/__init__.py +0 -0
  75. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/taxonomy/cli.py +0 -0
  76. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/tree_scope.py +0 -0
  77. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/validate.py +0 -0
  78. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/__init__.py +0 -0
  79. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/advance.py +0 -0
  80. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/backend.py +0 -0
  81. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/cli.py +0 -0
  82. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/config.py +0 -0
  83. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/fs_backend.py +0 -0
  84. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/gates.py +0 -0
  85. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/generate.py +0 -0
  86. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/hooks.py +0 -0
  87. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/__init__.py +0 -0
  88. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/client.py +0 -0
  89. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/config.py +0 -0
  90. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/jql.py +0 -0
  91. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/mapping.py +0 -0
  92. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/remote.py +0 -0
  93. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/jira/tickets.py +0 -0
  94. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/layout.py +0 -0
  95. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/model.py +0 -0
  96. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/open.py +0 -0
  97. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/passages.py +0 -0
  98. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/audit-backlog.md +0 -0
  99. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/create-work.md +0 -0
  100. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/documentation-sync.md +0 -0
  101. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/pause-work.md +0 -0
  102. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/search.md +0 -0
  103. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/triage-issues.md +0 -0
  104. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/procedures/unattended-work.md +0 -0
  105. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/implement.md +0 -0
  106. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/inbox.md +0 -0
  107. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/plan.md +0 -0
  108. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/postmortem.md +0 -0
  109. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/qa.md +0 -0
  110. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/request.md +0 -0
  111. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/review.md +0 -0
  112. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/prompts/spec.md +0 -0
  113. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/record.py +0 -0
  114. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/references.py +0 -0
  115. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/resolve.py +0 -0
  116. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw/work/scoped.py +0 -0
  117. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw_cli.egg-info/SOURCES.txt +0 -0
  118. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw_cli.egg-info/dependency_links.txt +0 -0
  119. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw_cli.egg-info/entry_points.txt +0 -0
  120. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw_cli.egg-info/requires.txt +0 -0
  121. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tcw_cli.egg-info/top_level.txt +0 -0
  122. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_capabilities.py +0 -0
  123. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_capabilities_cli_contract.py +0 -0
  124. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_capabilities_federation.py +0 -0
  125. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_capabilities_reset.py +0 -0
  126. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_capabilities_rm.py +0 -0
  127. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_capability_ref_wording.py +0 -0
  128. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_check_versions.py +0 -0
  129. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_cli_contract.py +0 -0
  130. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_cli_guide.py +0 -0
  131. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_cli_handler.py +0 -0
  132. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_cli_help_standard.py +0 -0
  133. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_combine.py +0 -0
  134. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_command_suggestions.py +0 -0
  135. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_committed_paths.py +0 -0
  136. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_config_command_state.py +0 -0
  137. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_config_edit.py +0 -0
  138. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_config_edit_writers.py +0 -0
  139. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_config_environment.py +0 -0
  140. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_config_keys.py +0 -0
  141. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_config_overrides.py +0 -0
  142. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_configuration_text_home.py +0 -0
  143. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_cut_version.py +0 -0
  144. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_doc_vocabulary.py +0 -0
  145. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_docs_describe_3_0.py +0 -0
  146. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_docs_describe_4_0.py +0 -0
  147. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_documentation_config.py +0 -0
  148. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_documentation_prompt.py +0 -0
  149. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_documentation_sync_wiring.py +0 -0
  150. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_documented_cli_surface.py +0 -0
  151. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_dynamic_skill_marker.py +0 -0
  152. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_environment_hardness.py +0 -0
  153. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_eval_coverage.py +0 -0
  154. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_eval_files_changed.py +0 -0
  155. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_eval_fixture.py +0 -0
  156. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_eval_grading.py +0 -0
  157. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_eval_runner.py +0 -0
  158. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_exit_code_tables.py +0 -0
  159. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_falsification_rule.py +0 -0
  160. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_families.py +0 -0
  161. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_fetch_project.py +0 -0
  162. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_findings_type.py +0 -0
  163. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_generate_hook.py +0 -0
  164. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_git_example.py +0 -0
  165. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_identifier_length.py +0 -0
  166. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_identifier_sweep.py +0 -0
  167. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_ids.py +0 -0
  168. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_inherited_config.py +0 -0
  169. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_init_configured_tree_path.py +0 -0
  170. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_init_provision_contract.py +0 -0
  171. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_item_tags_read.py +0 -0
  172. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_ledger_3_0.py +0 -0
  173. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_legacy_store_config.py +0 -0
  174. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_lifecycle_config_tags.py +0 -0
  175. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_links_full_identifiers.py +0 -0
  176. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_literal_store_names.py +0 -0
  177. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_load_order.py +0 -0
  178. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_locate.py +0 -0
  179. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_manifest.py +0 -0
  180. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_manifest_cli.py +0 -0
  181. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_manifest_cousins.py +0 -0
  182. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_migration_guide.py +0 -0
  183. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_multiproject.py +0 -0
  184. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_no_3x_inheritance.py +0 -0
  185. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_no_extends.py +0 -0
  186. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_no_node.py +0 -0
  187. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_object_folder_shape.py +0 -0
  188. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_object_folder_sweep.py +0 -0
  189. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_object_folders.py +0 -0
  190. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_object_walk.py +0 -0
  191. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_override_in_linked_worktree.py +0 -0
  192. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_override_letter_case.py +0 -0
  193. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_override_references.py +0 -0
  194. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_overrides_by_path.py +0 -0
  195. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_ownership.py +0 -0
  196. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_ownership_sweep.py +0 -0
  197. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_owning_project.py +0 -0
  198. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_parent_links.py +0 -0
  199. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_parent_links_cli.py +0 -0
  200. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_parent_links_parse.py +0 -0
  201. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_parent_links_static.py +0 -0
  202. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_partial_removal.py +0 -0
  203. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_plugin_manifests.py +0 -0
  204. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_procedure_config.py +0 -0
  205. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_procedure_verb.py +0 -0
  206. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_files.py +0 -0
  207. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_files_cli.py +0 -0
  208. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_graph_paths.py +0 -0
  209. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_group.py +0 -0
  210. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_info.py +0 -0
  211. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_lookup.py +0 -0
  212. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_overrides.py +0 -0
  213. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_path.py +0 -0
  214. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_placement.py +0 -0
  215. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_provision.py +0 -0
  216. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_project_registry.py +0 -0
  217. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_projectfiles_helper.py +0 -0
  218. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_projects_list.py +0 -0
  219. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_prompt_fallback.py +0 -0
  220. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_reference_fields.py +0 -0
  221. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_refs.py +0 -0
  222. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_remote_session_setup.py +0 -0
  223. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_removal_blockers.py +0 -0
  224. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_repo_lifecycle.py +0 -0
  225. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_require_artifact.py +0 -0
  226. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_rewrite.py +0 -0
  227. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_rewrite_values.py +0 -0
  228. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_routing_nodes.py +0 -0
  229. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_run_in_folder.py +0 -0
  230. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_scope_members.py +0 -0
  231. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_scope_reader.py +0 -0
  232. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_scope_rows.py +0 -0
  233. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_scope_trees.py +0 -0
  234. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_session_bootstrap.py +0 -0
  235. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_shipped_procedures.py +0 -0
  236. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_shipped_prompts.py +0 -0
  237. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_shipped_text.py +0 -0
  238. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_skill_flow.py +0 -0
  239. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_skill_path_pointers.py +0 -0
  240. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_smoke.py +0 -0
  241. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_stage_verb.py +0 -0
  242. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_state_files.py +0 -0
  243. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_statefiles_helper.py +0 -0
  244. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_static_guards.py +0 -0
  245. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_stdin.py +0 -0
  246. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_stdin_cli.py +0 -0
  247. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_store_addresses.py +0 -0
  248. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_store_bounds.py +0 -0
  249. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_store_editor.py +0 -0
  250. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_store_nodes.py +0 -0
  251. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_store_provisioning.py +0 -0
  252. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_stored_references.py +0 -0
  253. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_subprocess_stdin.py +0 -0
  254. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_suite_runs_its_own_tcw.py +0 -0
  255. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_taxonomy.py +0 -0
  256. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_taxonomy_cli_contract.py +0 -0
  257. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_taxonomy_rm_gaps.py +0 -0
  258. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_full_identifiers.py +0 -0
  259. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_inheritance.py +0 -0
  260. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_move.py +0 -0
  261. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_parent_missing.py +0 -0
  262. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_parents.py +0 -0
  263. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_store_files_only.py +0 -0
  264. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_tree_store_raises.py +0 -0
  265. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_unattended_work_skill.py +0 -0
  266. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_unpushed_version_script.py +0 -0
  267. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_upcoming_entries.py +0 -0
  268. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_upstream_projects.py +0 -0
  269. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_validate.py +0 -0
  270. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_validate_command.py +0 -0
  271. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_validate_moved_stores.py +0 -0
  272. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_validate_target.py +0 -0
  273. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_worktree_remote_forms.py +0 -0
  274. {tcw_cli-4.0.0 → tcw_cli-4.1.0}/tests/test_worktree_sibling_nodes.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tcw-cli
3
- Version: 4.0.0
3
+ Version: 4.1.0
4
4
  Summary: Taxonomy · Capabilities · Work — a storage-abstracted framework for describing and evolving a software project.
5
5
  License: Apache License
6
6
  Version 2.0, January 2004
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tcw-cli"
7
- version = "4.0.0"
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`), and
11
- one under `taxonomy:` read as a term is. A value already written as a full
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, route_entry_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) -> 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
- _both(store, old_rel, new_rel, text, four_text, expect, out)
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
- out = _git_lines(directory, "rev-parse", "--path-format=absolute",
216
- "--show-toplevel", "--git-common-dir")
217
- if not out or len(out) != 2:
253
+ found = _checkout_of(directory)
254
+ if found is None:
218
255
  return None
219
- top, common = Path(out[0]).resolve(), Path(out[1]).resolve()
220
- if common.name == ".git":
221
- main = common.parent
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
- as_written = (named_by.parent, named_by, list(named_by.parents))
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
- return [as_written]
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 = _git_lines(folder, "rev-parse", "--path-format=absolute",
407
- "--show-toplevel", "--git-common-dir")
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 = Path(found[0]).resolve(), Path(found[1]).resolve()
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 link"
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
- <site>/browse/<KEY>`, and may hold `id` (Design 2.2; TCW-111 Design
201
- 1.2). Its version is checked first: a file this TCW cannot read is
202
- reported for that alone (Design 1.5)."""
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, "is missing; it holds the ticket's link")]
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 isinstance(url, str) or not url.startswith(prefix):
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: {self.jira.site}/browse/{key}\n"
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")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tcw-cli
3
- Version: 4.0.0
3
+ Version: 4.1.0
4
4
  Summary: Taxonomy · Capabilities · Work — a storage-abstracted framework for describing and evolving a software project.
5
5
  License: Apache License
6
6
  Version 2.0, January 2004