corvee 0.2.0__tar.gz → 0.3.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 (191) hide show
  1. {corvee-0.2.0 → corvee-0.3.0}/.github/codecov.yml +2 -2
  2. {corvee-0.2.0 → corvee-0.3.0}/AGENTS.md +17 -12
  3. {corvee-0.2.0 → corvee-0.3.0}/PKG-INFO +6 -4
  4. {corvee-0.2.0 → corvee-0.3.0}/README.md +4 -2
  5. {corvee-0.2.0 → corvee-0.3.0}/docs/commands.md +6 -2
  6. {corvee-0.2.0 → corvee-0.3.0}/docs/mcp.md +14 -5
  7. {corvee-0.2.0 → corvee-0.3.0}/docs/quickstart.md +9 -8
  8. {corvee-0.2.0 → corvee-0.3.0}/docs/spec.md +92 -46
  9. {corvee-0.2.0 → corvee-0.3.0}/pyproject.toml +6 -5
  10. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/explain.py +5 -2
  11. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/list_.py +2 -1
  12. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/mine.py +2 -1
  13. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/ready.py +3 -1
  14. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/completion.py +6 -3
  15. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/db/export_import.py +18 -2
  16. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/db/facts.py +0 -4
  17. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/db/links.py +8 -0
  18. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/db/tasks.py +1 -14
  19. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/mcp/dispatch.py +25 -8
  20. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/mcp/server.py +2 -1
  21. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/mcp/tools_common.py +18 -1
  22. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/mcp/tools_read.py +11 -11
  23. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/mcp/tools_write.py +34 -6
  24. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/models.py +41 -12
  25. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/output.py +41 -5
  26. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/references.py +9 -5
  27. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_add_list_show.py +31 -0
  28. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_completion.py +29 -0
  29. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_labels.py +20 -0
  30. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_ready_search_mine_comment.py +20 -0
  31. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_referenced.py +52 -0
  32. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_task_add_from_file.py +51 -0
  33. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_config.py +12 -0
  34. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_db_export_import.py +57 -1
  35. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_db_links.py +17 -0
  36. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_mcp_create_and_find_tools.py +12 -0
  37. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_mcp_read_tools.py +26 -0
  38. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_mcp_write_tools.py +26 -0
  39. {corvee-0.2.0 → corvee-0.3.0}/tests/e2e/test_e2e.py +36 -2
  40. {corvee-0.2.0 → corvee-0.3.0}/tests/e2e/test_mcp_protocol.py +1 -0
  41. {corvee-0.2.0 → corvee-0.3.0}/tests/unit/test_mcp_dispatch.py +23 -1
  42. {corvee-0.2.0 → corvee-0.3.0}/tests/unit/test_models.py +40 -0
  43. {corvee-0.2.0 → corvee-0.3.0}/tests/unit/test_output.py +83 -0
  44. {corvee-0.2.0 → corvee-0.3.0}/.claude/CLAUDE.md +0 -0
  45. {corvee-0.2.0 → corvee-0.3.0}/.github/CODEOWNERS +0 -0
  46. {corvee-0.2.0 → corvee-0.3.0}/.github/CODE_OF_CONDUCT.md +0 -0
  47. {corvee-0.2.0 → corvee-0.3.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  48. {corvee-0.2.0 → corvee-0.3.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  49. {corvee-0.2.0 → corvee-0.3.0}/.github/ISSUE_TEMPLATE/question.md +0 -0
  50. {corvee-0.2.0 → corvee-0.3.0}/.github/dependabot.yml +0 -0
  51. {corvee-0.2.0 → corvee-0.3.0}/.github/pull_request_template.md +0 -0
  52. {corvee-0.2.0 → corvee-0.3.0}/.github/release.yaml +0 -0
  53. {corvee-0.2.0 → corvee-0.3.0}/.github/self-review.md +0 -0
  54. {corvee-0.2.0 → corvee-0.3.0}/.github/workflows/cicd.yaml +0 -0
  55. {corvee-0.2.0 → corvee-0.3.0}/.github/workflows/dependabot_auto_merge.yaml +0 -0
  56. {corvee-0.2.0 → corvee-0.3.0}/.github/workflows/scorecard.yml +0 -0
  57. {corvee-0.2.0 → corvee-0.3.0}/.gitignore +0 -0
  58. {corvee-0.2.0 → corvee-0.3.0}/.pre-commit-config.yaml +0 -0
  59. {corvee-0.2.0 → corvee-0.3.0}/.readthedocs.yaml +0 -0
  60. {corvee-0.2.0 → corvee-0.3.0}/CITATION.cff +0 -0
  61. {corvee-0.2.0 → corvee-0.3.0}/CONTRIBUTING.md +0 -0
  62. {corvee-0.2.0 → corvee-0.3.0}/LICENSE +0 -0
  63. {corvee-0.2.0 → corvee-0.3.0}/SECURITY.md +0 -0
  64. {corvee-0.2.0 → corvee-0.3.0}/docs/concurrency.md +0 -0
  65. {corvee-0.2.0 → corvee-0.3.0}/docs/index.md +0 -0
  66. {corvee-0.2.0 → corvee-0.3.0}/docs/use-cases.md +0 -0
  67. {corvee-0.2.0 → corvee-0.3.0}/mkdocs.yml +0 -0
  68. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/__init__.py +0 -0
  69. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/__main__.py +0 -0
  70. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/actor.py +0 -0
  71. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/__init__.py +0 -0
  72. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/__init__.py +0 -0
  73. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/brief.py +0 -0
  74. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/completion.py +0 -0
  75. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/doctor.py +0 -0
  76. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/export.py +0 -0
  77. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/fact/__init__.py +0 -0
  78. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/fact/add.py +0 -0
  79. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/fact/delete.py +0 -0
  80. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/fact/list_.py +0 -0
  81. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/fact/retract.py +0 -0
  82. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/fact/revise.py +0 -0
  83. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/fact/search.py +0 -0
  84. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/fact/show.py +0 -0
  85. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/fact/unverify.py +0 -0
  86. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/fact/verify.py +0 -0
  87. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/import_.py +0 -0
  88. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/init.py +0 -0
  89. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/mcp/__init__.py +0 -0
  90. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/mcp/serve.py +0 -0
  91. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/__init__.py +0 -0
  92. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/add.py +0 -0
  93. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/assign.py +0 -0
  94. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/claim.py +0 -0
  95. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/claims.py +0 -0
  96. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/comment.py +0 -0
  97. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/label.py +0 -0
  98. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/labels.py +0 -0
  99. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/link.py +0 -0
  100. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/purge.py +0 -0
  101. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/search.py +0 -0
  102. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/show.py +0 -0
  103. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/start.py +0 -0
  104. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/tree.py +0 -0
  105. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/unassign.py +0 -0
  106. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/unclaim.py +0 -0
  107. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/unlink.py +0 -0
  108. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/commands/task/update.py +0 -0
  109. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/context.py +0 -0
  110. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/main.py +0 -0
  111. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/params.py +0 -0
  112. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/cli/scope.py +0 -0
  113. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/config.py +0 -0
  114. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/constants.py +0 -0
  115. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/db/__init__.py +0 -0
  116. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/db/connection.py +0 -0
  117. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/db/events.py +0 -0
  118. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/db/labels.py +0 -0
  119. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/db/like.py +0 -0
  120. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/db/schema.py +0 -0
  121. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/db/stats.py +0 -0
  122. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/errors.py +0 -0
  123. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/guards/__init__.py +0 -0
  124. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/guards/ancestry.py +0 -0
  125. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/guards/fields.py +0 -0
  126. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/guards/labels.py +0 -0
  127. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/guards/parent_child.py +0 -0
  128. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/guards/scope.py +0 -0
  129. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/guards/transitions.py +0 -0
  130. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/mcp/__init__.py +0 -0
  131. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/mcp/scope.py +0 -0
  132. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/mcp/server_config.py +0 -0
  133. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/mcp/tools_fact.py +0 -0
  134. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/mcp/worker.py +0 -0
  135. {corvee-0.2.0 → corvee-0.3.0}/src/corvee/timeutil.py +0 -0
  136. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/conftest.py +0 -0
  137. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/mcp_helpers.py +0 -0
  138. {corvee-0.2.0/tests/unit → corvee-0.3.0/tests/acceptance}/test_cicd_workflow.py +0 -0
  139. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_actor_session_flags.py +0 -0
  140. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_brief.py +0 -0
  141. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_claim_update.py +0 -0
  142. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_claims.py +0 -0
  143. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_completion_command.py +0 -0
  144. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_context_overrides.py +0 -0
  145. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_doctor.py +0 -0
  146. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_duration_validation.py +0 -0
  147. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_error_handling.py +0 -0
  148. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_explain_and_epilogs.py +0 -0
  149. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_export_import.py +0 -0
  150. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_facts.py +0 -0
  151. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_global_scope.py +0 -0
  152. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_init.py +0 -0
  153. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_limit_validation.py +0 -0
  154. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_link.py +0 -0
  155. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_mcp_serve.py +0 -0
  156. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_no_project.py +0 -0
  157. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_pagination.py +0 -0
  158. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_params.py +0 -0
  159. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_scope.py +0 -0
  160. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_task_assign.py +0 -0
  161. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_task_purge.py +0 -0
  162. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_task_start.py +0 -0
  163. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_cli_tree.py +0 -0
  164. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_db_claims_and_update.py +0 -0
  165. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_db_connection.py +0 -0
  166. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_db_facts.py +0 -0
  167. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_db_labels.py +0 -0
  168. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_db_ready_search_mine_comment.py +0 -0
  169. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_db_stats.py +0 -0
  170. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_db_tasks.py +0 -0
  171. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_mcp_concurrency.py +0 -0
  172. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_mcp_docs_tool_inventory.py +0 -0
  173. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_mcp_fact_tools.py +0 -0
  174. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_mcp_scope.py +0 -0
  175. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_mcp_server_config.py +0 -0
  176. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_mcp_server_startup.py +0 -0
  177. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_mcp_stdout_purity.py +0 -0
  178. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_mcp_tool_descriptions.py +0 -0
  179. {corvee-0.2.0 → corvee-0.3.0}/tests/acceptance/test_mcp_version_skew.py +0 -0
  180. {corvee-0.2.0 → corvee-0.3.0}/tests/conftest.py +0 -0
  181. {corvee-0.2.0 → corvee-0.3.0}/tests/e2e/test_concurrency.py +0 -0
  182. {corvee-0.2.0 → corvee-0.3.0}/tests/e2e/test_mcp_serve.py +0 -0
  183. {corvee-0.2.0 → corvee-0.3.0}/tests/unit/test_actor.py +0 -0
  184. {corvee-0.2.0 → corvee-0.3.0}/tests/unit/test_config_toml.py +0 -0
  185. {corvee-0.2.0 → corvee-0.3.0}/tests/unit/test_connection_errors.py +0 -0
  186. {corvee-0.2.0 → corvee-0.3.0}/tests/unit/test_constants.py +0 -0
  187. {corvee-0.2.0 → corvee-0.3.0}/tests/unit/test_guards.py +0 -0
  188. {corvee-0.2.0 → corvee-0.3.0}/tests/unit/test_mcp_dispatch_version_skew.py +0 -0
  189. {corvee-0.2.0 → corvee-0.3.0}/tests/unit/test_mcp_session_id_resolution.py +0 -0
  190. {corvee-0.2.0 → corvee-0.3.0}/tests/unit/test_mcp_worker.py +0 -0
  191. {corvee-0.2.0 → corvee-0.3.0}/tests/unit/test_timeutil.py +0 -0
@@ -11,12 +11,12 @@ coverage:
11
11
  status:
12
12
  project:
13
13
  default:
14
- informational: true
14
+ informational: false
15
15
  target: auto
16
16
  threshold: 2%
17
17
  patch:
18
18
  default:
19
- informational: true
19
+ informational: false
20
20
 
21
21
  comment:
22
22
  layout: "reach, diff, flags, files"
@@ -26,7 +26,8 @@ files.
26
26
 
27
27
  ```bash
28
28
  hatch run test # pytest, parallel via pytest-xdist
29
- hatch run check # every prek hook + test.
29
+ hatch run cov # pytest with coverage, fails under 90%
30
+ hatch run check # every prek hook + cov.
30
31
  # Run this before considering a change done
31
32
  hatch run lint # ruff check, via prek
32
33
  hatch run format # black, via prek
@@ -41,6 +42,15 @@ what each one actually runs. `hatch run check` (or `prek run --all-files`
41
42
  directly) is the mandatory quality gate before a change is considered
42
43
  finished.
43
44
 
45
+ `test:test` is a local convenience for checking one interpreter from the
46
+ matrix. CI's `test` job does not run it, and installs the wheel `build`
47
+ produced (the same artifact `upload-pypi`/`upload-test-pypi` later publish)
48
+ plus its own hardcoded `pytest`/`pytest-cov`/`pytest-xdist`, exercising the
49
+ actual packaged wheel on every OS/interpreter combination instead of the
50
+ editable source install a `hatch` env creates. A dependency added to
51
+ `[tool.hatch.envs.default.dependencies]` for testing must be added to
52
+ `cicd.yaml`'s install step by hand to reach CI.
53
+
44
54
  ## Principles
45
55
 
46
56
  KISS, YAGNI, DRY. A change should be minimal and focused on what was asked.
@@ -125,17 +135,12 @@ JSON-on-stderr shape and the process exit code.
125
135
  examples (enforced by a test).
126
136
  - Full type hints throughout. `ty` has zero tolerance for untyped public
127
137
  signatures or unjustified `Any`.
128
- - Never use `typing.cast()`. It tells the type checker to trust an
129
- annotation and does nothing at runtime, so an assumption that turns out
130
- wrong propagates a bad value silently instead of failing loudly. Where a
131
- value's real type is narrower than what the checker can infer on its own
132
- (a DB column value narrowed to a `Literal`, a `click.Choice(...)`-checked
133
- option), write a small function that checks the value against its known
134
- set of valid members and raises if it is not one of them, then returns it
135
- -- see `constants.py`'s `narrow_*` functions for the pattern, and
136
- `mcp/dispatch.py::run_tool`'s docstring for the one place a genuine
137
- external-library expressiveness gap (not a value narrowing) still needs a
138
- single, well-documented `# ty: ignore[...]` instead.
138
+ - Never use `typing.cast()` -- it trusts an annotation without verifying it
139
+ at runtime, so a wrong assumption propagates silently. Narrow values
140
+ instead using `constants.py`'s `narrow_*` pattern (check known members,
141
+ raise otherwise). The one exception is a genuine external-library
142
+ expressiveness gap, documented with `# ty: ignore[...]` in
143
+ `mcp/dispatch.py::run_tool`'s docstring.
139
144
  - Tests are classified by directory, not per-test decorators: `tests/unit`
140
145
  (pure functions, no filesystem/db), `tests/acceptance` (through the CLI or
141
146
  db layer against a real `tmp_path` SQLite database), `tests/e2e` (a real
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: corvee
3
- Version: 0.2.0
3
+ Version: 0.3.0
4
4
  Summary: A single-machine, non-git-tracked, persistent, multi-agent-aware CLI task tracker and fact store
5
5
  Project-URL: Homepage, https://github.com/btschwertfeger/Corvee
6
6
  Project-URL: Documentation, https://corvee.readthedocs.io/en/stable/
@@ -11,9 +11,9 @@ License-File: LICENSE
11
11
  Requires-Python: >=3.11
12
12
  Requires-Dist: click~=8.5
13
13
  Provides-Extra: docs
14
- Requires-Dist: mkdocs; extra == 'docs'
15
14
  Requires-Dist: mkdocs-click; extra == 'docs'
16
15
  Requires-Dist: mkdocs-material; extra == 'docs'
16
+ Requires-Dist: mkdocs<2; extra == 'docs'
17
17
  Provides-Extra: mcp
18
18
  Requires-Dist: mcp>=2.2; extra == 'mcp'
19
19
  Description-Content-Type: text/markdown
@@ -33,7 +33,9 @@ for you and your agents!
33
33
  [![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com/btschwertfeger/corvee)
34
34
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
35
35
  [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue.svg)](pyproject.toml)
36
+
36
37
  [![Downloads](https://static.pepy.tech/personalized-badge/corvee?period=total&units=abbreviation&left_color=grey&right_color=orange&left_text=downloads)](https://pepy.tech/project/corvee)
38
+ [![release](https://img.shields.io/pypi/v/corvee)](https://pypi.org/project/corvee/)
37
39
 
38
40
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
39
41
  [![typing-ty](https://img.shields.io/badge/typing-ty-informational)](https://github.com/astral-sh/ty)
@@ -43,8 +45,8 @@ for you and your agents!
43
45
  [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/14702/badge)](https://www.bestpractices.dev/projects/14702)
44
46
  [![OpenSSF ScoreCard](https://img.shields.io/ossf-scorecard/github.com/btschwertfeger/Corvee?label=openssf%20scorecard&style=flat)](https://securityscorecards.dev/viewer/?uri=github.com/btschwertfeger/Corvee)
45
47
 
46
- [![release](https://img.shields.io/pypi/v/corvee)](https://pypi.org/project/corvee/)
47
- [![Documentation](https://img.shields.io/badge/docs-btschwertfeger.github.io%2FCorvee-blue.svg)](https://corvee.readthedocs.io/en/latest/)
48
+ [![Documentation](https://img.shields.io/badge/docs-btschwertfeger.github.io%2FCorvee-blue.svg)](https://corvee.readthedocs.io/en/stable/)
49
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22877769.svg)](https://doi.org/10.5281/zenodo.22877769)
48
50
 
49
51
  </div>
50
52
 
@@ -13,7 +13,9 @@ for you and your agents!
13
13
  [![GitHub](https://badgen.net/badge/icon/github?icon=github&label)](https://github.com/btschwertfeger/corvee)
14
14
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
15
15
  [![Python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue.svg)](pyproject.toml)
16
+
16
17
  [![Downloads](https://static.pepy.tech/personalized-badge/corvee?period=total&units=abbreviation&left_color=grey&right_color=orange&left_text=downloads)](https://pepy.tech/project/corvee)
18
+ [![release](https://img.shields.io/pypi/v/corvee)](https://pypi.org/project/corvee/)
17
19
 
18
20
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
19
21
  [![typing-ty](https://img.shields.io/badge/typing-ty-informational)](https://github.com/astral-sh/ty)
@@ -23,8 +25,8 @@ for you and your agents!
23
25
  [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/14702/badge)](https://www.bestpractices.dev/projects/14702)
24
26
  [![OpenSSF ScoreCard](https://img.shields.io/ossf-scorecard/github.com/btschwertfeger/Corvee?label=openssf%20scorecard&style=flat)](https://securityscorecards.dev/viewer/?uri=github.com/btschwertfeger/Corvee)
25
27
 
26
- [![release](https://img.shields.io/pypi/v/corvee)](https://pypi.org/project/corvee/)
27
- [![Documentation](https://img.shields.io/badge/docs-btschwertfeger.github.io%2FCorvee-blue.svg)](https://corvee.readthedocs.io/en/latest/)
28
+ [![Documentation](https://img.shields.io/badge/docs-btschwertfeger.github.io%2FCorvee-blue.svg)](https://corvee.readthedocs.io/en/stable/)
29
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.22877769.svg)](https://doi.org/10.5281/zenodo.22877769)
28
30
 
29
31
  </div>
30
32
 
@@ -1,7 +1,11 @@
1
1
  # Commands
2
2
 
3
- Every command below accepts `--json` (except `explain`) and prints a JSON
4
- array of objects on success. `corvee <command> --help` shows runnable
3
+ Every command below accepts `--json` and prints a JSON array of objects
4
+ on success, except `explain`, `completion`, and `mcp serve`, which have
5
+ no `--json` flag, and `export`, which always writes JSON without needing
6
+ one. `brief`, `doctor`, `init`, and `task tree` accept `--json` but print
7
+ one object rather than an array, since each returns a document rather
8
+ than query results. `corvee <command> --help` shows runnable
5
9
  examples for any of them. This page covers usage and flags only. Standalone,
6
10
  checked-true (or not-yet-checked, or retracted) facts are not linked to
7
11
  tasks by the schema (see [Specification](spec.md#46-facts)).
@@ -178,7 +178,7 @@ instead:
178
178
 
179
179
  ## What it exposes
180
180
 
181
- Sixteen tools, narrow and single-purpose rather than one wide `task_update`
181
+ Seventeen tools, narrow and single-purpose rather than one wide `task_update`
182
182
  (see [Specification §10.4](spec.md#104-trust-and-error-handling) for why).
183
183
  Every tool that writes something accepts an optional `session_id`
184
184
  argument — a per-conversation token, distinct from the actor set at
@@ -200,6 +200,7 @@ keep it stable across your calls in one conversation.
200
200
  | `task_done` | yes | Move to `done` |
201
201
  | `task_cancel` | yes | Move to `cancelled` |
202
202
  | `task_review` | yes | Move to `review`, keeping the current claim |
203
+ | `task_reopen` | yes | Move a `cancelled`/`done` task back to `open` |
203
204
  | `task_block` | yes | Move to `blocked` — requires a comment explaining why |
204
205
  | `fact_show` | no | Read one fact by id |
205
206
  | `fact_search` | no | Search facts (default 20 results) |
@@ -207,8 +208,8 @@ keep it stable across your calls in one conversation.
207
208
  | `fact_verify` | yes | Mark a fact checked-true, with proof |
208
209
 
209
210
  `force` lives only on `task_claim`/`task_unclaim` — not on `task_start`/
210
- `task_done`/`task_cancel`/`task_review`/`task_block`, whose names should
211
- never quietly let a caller steal someone else's claim. Call
211
+ `task_done`/`task_cancel`/`task_review`/`task_reopen`/`task_block`, whose
212
+ names should never quietly let a caller steal someone else's claim. Call
212
213
  `task_claim(force=true)` first if you need to take one over.
213
214
 
214
215
  No `purge`, `delete`, `import`, or `export` on this surface — those stay
@@ -275,10 +276,18 @@ status normally covers:
275
276
 
276
277
  `exit_code` maps to the same [exit codes](commands.md#exit-codes) the CLI
277
278
  documents. No raw traceback is ever passed through — an unexpected error
278
- still comes back in this shape, with `exit_code: 1`.
279
+ raised inside a tool's own handler still comes back in this shape, with
280
+ `exit_code: 1`. A value of a JSON type a parameter's schema rejects
281
+ outright (a list or object where a task ref or duration is expected)
282
+ never reaches the handler at all; that argument-validation failure
283
+ surfaces as the MCP SDK's own error shape instead.
279
284
 
280
285
  A `claim_conflict` carries one more field, `hint`, phrased for this
281
- surface rather than the CLI's own `--force` flag:
286
+ surface rather than the CLI's own `--force` flag. Every tool but
287
+ `task_unclaim` points at `task_claim(force=true)`, which takes over the
288
+ claim so the call can proceed. `task_unclaim` points at
289
+ `task_unclaim(force=true)`, since stealing a claim would reassign it
290
+ instead of releasing it:
282
291
 
283
292
  ```json
284
293
  {
@@ -63,10 +63,11 @@ corvee task comment TASK-14 "found the root cause" --json
63
63
  corvee task update TASK-14 --state done --json # finish it, claim clears automatically
64
64
  ```
65
65
 
66
- Every command accepts `--json` (except `explain`) and, on success, prints a
67
- JSON array of objects to stdout. On failure, nothing is written to stdout
68
- and a JSON error object goes to stderr instead, so a caller can parse
69
- stdout unconditionally.
66
+ Most commands accept `--json` and, on success, print a JSON array of
67
+ objects to stdout. A handful of exceptions are covered in
68
+ [Commands](commands.md). On failure, nothing is written to stdout and a
69
+ JSON error object goes to stderr instead, so a caller can parse stdout
70
+ unconditionally.
70
71
 
71
72
  ## What the output looks like
72
73
 
@@ -76,7 +77,7 @@ affected row(s):
76
77
  ```
77
78
  $ corvee task add "Fix the flaky auth test" --description "Retry logic in test_auth.py::test_login_retry is racy under load"
78
79
  ID TITLE TYPE PRIORITY STATE CLAIMED_BY CLAIMED_AT ASSIGNED_TO CREATED_AT UPDATED_AT SCOPE
79
- TASK-1 Fix the flaky auth test task medium open None None None 2026-09-15T06:28:27.641Z 2026-09-15T06:28:27.641Z local
80
+ TASK-1 Fix the flaky auth test task medium open 2026-09-15T06:28:27.641Z 2026-09-15T06:28:27.641Z local
80
81
  ```
81
82
 
82
83
  `task show` prints the full record instead, including every claim, state
@@ -91,9 +92,9 @@ title: Fix the flaky auth test
91
92
  type: task
92
93
  priority: medium
93
94
  state: done
94
- claimed_by: None
95
- claimed_at: None
96
- assigned_to: None
95
+ claimed_by: (none)
96
+ claimed_at: (none)
97
+ assigned_to: (none)
97
98
  created_at: 2026-09-15T06:28:27.641Z
98
99
  updated_at: 2026-09-15T06:28:27.810Z
99
100
  scope: local
@@ -1,4 +1,4 @@
1
- # corvee — Technical Specification (v34)
1
+ # corvee — Technical Specification (v35)
2
2
 
3
3
  ## 1. Purpose
4
4
 
@@ -155,9 +155,14 @@ process solves, and it's explicitly out of scope (§2).
155
155
  Every task and fact lives in exactly one of two databases: the **local**
156
156
  project database resolved by §3.1, or one **global** database shared
157
157
  across every project on the machine, at `~/.corvee/corvee.db`. The global
158
- database has no `config.toml` and no override — one fixed path, the same
159
- "one source of truth" reasoning §3.1 gives for the project binding, just
160
- without a pointer file to find it through, since there is only ever one.
158
+ database has no `config.toml` — one fixed path, the same "one source of
159
+ truth" reasoning §3.1 gives for the project binding, just without a
160
+ pointer file to find it through, since there is only ever one.
161
+ `$CORVEE_GLOBAL_DB`, if set, redirects that fixed path to the value given,
162
+ taken as-is against cwd with no `expanduser()`/`resolve()`; it is an
163
+ internal escape hatch for tests and agent tooling to exercise `--global`
164
+ scope without touching a real user's database, never part of the
165
+ documented CLI/config surface, and ordinary use never sets it.
161
166
 
162
167
  **The global database is created lazily, on first use, not by `corvee
163
168
  init`.** `corvee init` only ever touches the local project (§3.1); nothing
@@ -285,22 +290,24 @@ CREATE INDEX idx_task_links_target ON task_links(target_id);
285
290
  CREATE UNIQUE INDEX idx_one_parent ON task_links(target_id)
286
291
  WHERE relation = 'parent_of';
287
292
 
288
- -- One timeline per task, two kinds of row: 'comment' (manual narrative —
289
- -- why) and 'field_change' (automatic audit trail — what changed, written
290
- -- by corvee itself on every mutation, including claim/unclaim and label
291
- -- and link changes; for those, 'field' is 'label' or 'link:<relation>' and
292
- -- the added or removed value sits in new_value or old_value, so an
293
- -- unlink is never silent). One table
294
- -- because corvee show reads them as a single merged, time-ordered feed
295
- -- anyway; splitting them into two tables would just require a UNION at
296
- -- read time for no benefit.
293
+ -- One timeline per task, three kinds of row: 'created' (one row, written
294
+ -- once when the task is made, new_value holds its title -- the task
295
+ -- equivalent of fact_events' own 'created' kind), 'comment' (manual
296
+ -- narrative — why), and 'field_change' (automatic audit trail — what
297
+ -- changed, written by corvee itself on every mutation, including
298
+ -- claim/unclaim and label and link changes; for those, 'field' is 'label'
299
+ -- or 'link:<relation>' and the added or removed value sits in new_value or
300
+ -- old_value, so an unlink is never silent). One table because corvee show
301
+ -- reads them as a single merged, time-ordered feed anyway; splitting them
302
+ -- into separate tables would just require a UNION at read time for no
303
+ -- benefit.
297
304
  CREATE TABLE task_events (
298
305
  id INTEGER PRIMARY KEY AUTOINCREMENT,
299
306
  task_id INTEGER NOT NULL REFERENCES tasks(id),
300
- kind TEXT NOT NULL, -- comment|field_change
307
+ kind TEXT NOT NULL, -- created|comment|field_change
301
308
  field TEXT, -- set when kind=field_change
302
309
  old_value TEXT,
303
- new_value TEXT,
310
+ new_value TEXT, -- title when kind=created
304
311
  body TEXT, -- set when kind=comment
305
312
  actor TEXT NOT NULL, -- see §4.4
306
313
  session_id TEXT,
@@ -391,6 +398,12 @@ never the string. `TASK-<n>` is unique within one database, not globally —
391
398
  a local project database holds one project's tasks; the global database
392
399
  (§3.3) holds the one shared backlog `--global` files into.
393
400
 
401
+ `<n>` is one or more ASCII digits with a value no greater than 2**63-1, the
402
+ largest value SQLite stores in an INTEGER column. A digit outside ASCII
403
+ (Arabic-Indic, superscript) or a number past that bound exits 2 as a usage
404
+ error. The same grammar applies to `FACT-<n>` (§4.6) and to both `-GLOBAL-`
405
+ forms.
406
+
394
407
  **A task in the global database (§3.3) is referenced as `TASK-GLOBAL-<n>`**,
395
408
  its own id space, distinct from every project's `TASK-<n>`. A bare integer
396
409
  is ambiguous between the two and is always resolved as local — reaching a
@@ -414,7 +427,8 @@ sorting rules — see §4.6.
414
427
  update` rejects such a transition and lists the blocking subtask IDs.
415
428
  Re-opening a child of an already-`done` parent is allowed (the parent
416
429
  isn't retroactively invalidated) but surfaces a `warnings` key (a list of
417
- strings) on the child's object in `corvee task update`'s output.
430
+ strings) on the child's object, whichever surface performs the reopen
431
+ (`corvee task update --state open`, or `task_reopen` over MCP).
418
432
  `corvee task link <parent> <child> --relation parent_of` carries the
419
433
  same warning, on the parent's object instead, when the child being
420
434
  attached is non-terminal and the parent is already `done` — neither case
@@ -880,8 +894,9 @@ corvee
880
894
  ```
881
895
 
882
896
  All commands emit human-readable table output by default. Every command
883
- except `corvee explain` accepts `--json`, mutating ones included, so an
884
- agent can set one convention and never think about it again.
897
+ accepts `--json`, mutating ones included, except `explain`, `completion`,
898
+ and `mcp serve`, which have no `--json` flag, and `export`, which always
899
+ writes JSON without needing one.
885
900
 
886
901
  **Success output is always a JSON array of objects on stdout, uniform
887
902
  within a command group**, one element per affected row, whether the command
@@ -915,9 +930,11 @@ A few commands step outside that shape because what they return is not a
915
930
  task or a fact. `corvee task labels --json` yields an array of `{"name":
916
931
  ..., "task_count": ...}`; `corvee task claims --json` yields an array of
917
932
  `{"actor": ..., "scope": ..., "count": ..., "oldest_claimed_at": ...}`,
918
- oldest first. `corvee export --json` and `corvee doctor --json` each yield
919
- a single JSON object rather than an array, since a backup and a stats
920
- report are both documents, not query results (§5.4, §5.5).
933
+ oldest first. `corvee export`, `corvee doctor --json`, `corvee brief --json`,
934
+ `corvee init --json`, and `corvee task tree --json` each yield a single
935
+ JSON object rather than an array, since a backup, a stats report, a
936
+ session snapshot, a bootstrap report, and a subtree are all documents, not
937
+ flat query results (§3.1, §5.1.2, §5.4, §5.5, §5.8).
921
938
 
922
939
  **Failure writes a JSON object to stderr and nothing to stdout**, so a
923
940
  caller can parse stdout unconditionally. The object is
@@ -934,7 +951,7 @@ Exit codes are distinct enough to branch on without parsing at all.
934
951
  |---|---|
935
952
  | 0 | Success |
936
953
  | 1 | Unexpected/internal error |
937
- | 2 | Usage or validation error (bad flag, unknown `--fields` name, invalid state, cross-namespace id, malformed `--stale`/`--since` duration, `corvee import` of malformed JSON or a dump missing `schema_version`) |
954
+ | 2 | Usage or validation error (bad flag, unknown `--fields` name, invalid state, cross-namespace id, an id outside the §4.2 grammar, malformed `--stale`/`--since` duration, `corvee import` of malformed JSON, a dump missing `schema_version` or carrying a non-integer one, or a dump row with an unknown column) |
938
955
  | 3 | Task or fact not found |
939
956
  | 4 | Claim conflict (task held by another actor) |
940
957
  | 5 | Guard violation (open children, `parent_of` cycle, rejected transition, claiming an already-terminal task, `fact delete` on a non-retracted fact, `task purge` on a non-cancelled or still-linked task, cross-scope link) |
@@ -1281,6 +1298,12 @@ instead of aligned under their headers. `--json` is unaffected, since a
1281
1298
  JSON string already escapes embedded newlines — the raw value with real
1282
1299
  newlines intact is always available there, or via `task show`.
1283
1300
 
1301
+ **Column padding counts terminal cells, not code points.** An East Asian
1302
+ wide or fullwidth character occupies two cells and a combining mark
1303
+ occupies none, so `render_table` measures every cell with a display-width
1304
+ helper before padding it. Measuring `len()` shifts each column after a CJK
1305
+ title out from under its header.
1306
+
1284
1307
  **`task update` over several IDs is one transaction.** `corvee task update
1285
1308
  4 7 9 --state done` either applies to all three or to none. If task 7 fails
1286
1309
  the transition table or the parent/child guard, nothing is written, the
@@ -1309,7 +1332,11 @@ characters at most. Anything else exits 2 with the pattern in the message.
1309
1332
  with removals applied before additions, so `--remove x --add x` ends with
1310
1333
  `x` attached. Adding a label a task already has, or removing one it doesn't,
1311
1334
  is a no-op success rather than an error, matching how re-claiming and
1312
- same-state updates behave.
1335
+ same-state updates behave. `task list --label`/`task ready --label` filter
1336
+ values go through the same normalization before the query runs, so
1337
+ `--label API` matches a task labeled `api` and a filter value that fails
1338
+ the pattern exits 2 the same way `--add` does, rather than silently
1339
+ matching nothing.
1313
1340
 
1314
1341
  **`task unclaim` on an already-unclaimed task is a no-op success.** A
1315
1342
  `--force` update that steals another actor's claim follows the same
@@ -1392,10 +1419,13 @@ database, not a merged one, since local and global ids collide (both
1392
1419
  start at 1) and a merged dump would need to disambiguate them somehow.
1393
1420
 
1394
1421
  `corvee import <file> [--scope local|global]` refuses to run against a
1395
- database that already holds tasks or facts, exiting 2. Restoring is
1396
- therefore always into a freshly initialized project (or an empty global
1397
- database), which sidesteps ID collisions, duplicate detection, and the
1398
- question of what merging two histories would even mean. It also rejects a
1422
+ database that already holds tasks, facts, or labels, exiting 2 — a label
1423
+ survives a `task purge` (§4.5.1) even after every task wearing it is
1424
+ gone, so it's the one row an otherwise-empty project can still carry.
1425
+ Restoring is therefore always into a freshly initialized project (or an
1426
+ empty global database), which sidesteps ID collisions, duplicate
1427
+ detection, and the question of what merging two histories would even
1428
+ mean. It also rejects a
1399
1429
  dump whose `schema_version` doesn't exactly match the binary's: higher for
1400
1430
  the reason given in §3.2, and lower because a dump's rows are inserted
1401
1431
  verbatim with no migration applied — a value valid under an older schema
@@ -1405,7 +1435,10 @@ surface as an unhandled error the first time something tried to act on
1405
1435
  that row. `--scope` must match what the dump came from — a
1406
1436
  dump has no self-describing scope marker, so restoring a local dump with
1407
1437
  `--scope global` (or vice versa) succeeds without error and simply lands
1408
- the same rows in the other database, verbatim ids included.
1438
+ the same rows in the other database, verbatim ids included. Each row's keys
1439
+ are validated against that table's real columns before the insert, exiting
1440
+ 2 on a foreign or crafted one, rather than a raw sqlite error surfacing
1441
+ straight from the interpolated `INSERT`.
1409
1442
 
1410
1443
  Both databases are git-ignored by design and live outside any repository
1411
1444
  (§3.3), so without these two commands — and `--scope global` reaching the
@@ -2045,14 +2078,13 @@ minted once for the process's lifetime: this last fallback exists
2045
2078
  specifically so a write tool call can leave `session_id` out entirely and
2046
2079
  still stamp something meaningful, rather than every omitted call
2047
2080
  defaulting to `None` the way the CLI's own optional `--session-id` does.
2048
- This was not the original design — an earlier draft made `session_id` a
2049
- required, undocumented per-call argument with no server-level default at
2050
- all, which meant `corvee mcp serve --session-id ...`/`$CORVEE_SESSION_ID`
2051
- had no effect whatsoever (nothing in the server read them), and a caller
2052
- left to invent a value per call would mint a different one on every
2053
- write, actively defeating `doctor`'s multi-session-claim detector by
2054
- making every one of its own calls look like a different run. The
2055
- resolved default is the record of *which run* touched a task/fact (§4.4),
2081
+ A per-call `session_id` with no server-level default would leave
2082
+ `corvee mcp serve --session-id ...`/`$CORVEE_SESSION_ID` with no effect
2083
+ whatsoever (nothing in the server would read them), and a caller left to
2084
+ invent a value per call would mint a different one on every write,
2085
+ actively defeating `doctor`'s multi-session-claim detector by making
2086
+ every one of its own calls look like a different run. The resolved
2087
+ default is instead the record of *which run* touched a task/fact (§4.4),
2056
2088
  which stays meaningful even within a single conversation's own process
2057
2089
  lifetime — a conversation can span more than one underlying agent run,
2058
2090
  and a caller that does distinguish its own runs still passes an explicit
@@ -2138,10 +2170,8 @@ cascade array**, unlike the CLI's own `task update --cascade`: neither
2138
2170
  tool exposes a `cascade` argument, `apply_update` only ever cascades when
2139
2171
  called with `cascade=True` *and* the target state is `cancelled`
2140
2172
  (`db/tasks.py`), and neither condition can occur through either tool —
2141
- `task_done`/`task_block` target `done`/`blocked`, never `cancelled`. An
2142
- earlier draft of this section described a cascade-array return for these
2143
- two that the implementation never produced and structurally cannot
2144
- produce; this is the corrected, verified behavior. Every ref-taking tool
2173
+ `task_done`/`task_block` target `done`/`blocked`, never `cancelled`.
2174
+ Every ref-taking tool
2145
2175
  argument is a single ref (a plain string), not a batch: the CLI's own
2146
2176
  multi-id, one-transaction batching (`claim 14 15 16`) has no MCP
2147
2177
  equivalent — a caller wanting that makes one tool call per
@@ -2200,18 +2230,23 @@ claim" — a CLI flag, meaningless verbatim to an MCP caller. Rather than
2200
2230
  forking that message per interface (which would change CLI output no one
2201
2231
  asked to change) or leaving it as-is (exposing CLI flag phrasing on an
2202
2232
  interface with no flags at all), `dispatch._error_result` adds `hint`
2203
- alongside it, phrased in MCP's own terms: call `task_claim(force=true)`
2204
- on the ref, then retry. Additive, not a replacement — `message` is
2205
- unchanged, so a caller matching on it (CLI or MCP) sees the same text
2206
- either way.
2233
+ alongside it, phrased in MCP's own terms, and the tool that raised the
2234
+ error picks which one. `run_tool`'s `claim_conflict_hint` parameter
2235
+ defaults to `task_claim(force=true)` on the ref, then retry. That is the
2236
+ right remedy wherever taking over the claim lets the call proceed, which
2237
+ covers every state-transition tool and `task_claim` itself.
2238
+ `task_unclaim` passes `task_unclaim(force=true)` instead, since stealing
2239
+ a claim there would reassign it to the caller instead of releasing it.
2240
+ Additive, not a replacement — `message` is unchanged, so a caller
2241
+ matching on it (CLI or MCP) sees the same text either way.
2207
2242
 
2208
2243
  ### 10.3 Tool list
2209
2244
 
2210
- Sixteen tools. Every ref-taking tool accepts the same `TASK-<n>`/
2245
+ Seventeen tools. Every ref-taking tool accepts the same `TASK-<n>`/
2211
2246
  `TASK-GLOBAL-<n>`/`FACT-<n>`/`FACT-GLOBAL-<n>` forms the CLI accepts and
2212
2247
  resolves scope the same way (§4.2, §4.6), since `--project-root` fixes
2213
2248
  which *local* database is in play but never removes the global one.
2214
- Eleven tools write an event and accept an optional `session_id`, falling
2249
+ Twelve tools write an event and accept an optional `session_id`, falling
2215
2250
  back to the server's own resolved default when omitted (§10.1); the
2216
2251
  remaining five — `brief`, `fact_search`, `task_search`, `task_show`, and
2217
2252
  `fact_show` — write nothing and do not accept it at all.
@@ -2311,6 +2346,17 @@ depending on which parameter was wrong.
2311
2346
  is not the same as `done`, and `review` is not terminal (§4.4), so
2312
2347
  unlike `task_done`/`task_cancel` it keeps whatever claim the task
2313
2348
  already had.
2349
+ - `task_reopen` — `apply_update(..., state="open", force=False)`. Before
2350
+ this tool, a `cancelled`/`done` task had no way back to `open` over MCP:
2351
+ `task_start`/`task_review`/`task_block` reject the transition they'd
2352
+ attempt (`invalid_transition`) and `task_claim` refuses outright
2353
+ (`task_terminal`), so a mis-cancel or a premature `done` was
2354
+ unrecoverable short of the CLI's `task update --state open`.
2355
+ `TRANSITIONS` (`constants.py`) already allows `cancelled`/`done` ->
2356
+ `open`, the same transition the CLI has always exposed; this tool is a
2357
+ narrow wrapper around it, `task_done`'s exact shape aimed at the
2358
+ opposite direction. Fails with `invalid_transition` from `review`, the
2359
+ one state `open` is not reachable from directly (§4.5).
2314
2360
  - `task_block` — `apply_update(..., state="blocked", force=False)`, **requiring a
2315
2361
  `comment` argument that is non-empty after stripping whitespace**,
2316
2362
  written via the same call `corvee task comment` uses, before the state
@@ -26,7 +26,7 @@ mcp = ["mcp>=2.2"]
26
26
  # itself. Kept as a project extra rather than a bare hatch dev dependency so
27
27
  # Read the Docs can install exactly this set via `pip install .[docs]`
28
28
  # instead of duplicating the package list in its own requirements file.
29
- docs = ["mkdocs", "mkdocs-material", "mkdocs-click"]
29
+ docs = ["mkdocs<2", "mkdocs-material", "mkdocs-click"]
30
30
 
31
31
  [project.urls]
32
32
  Homepage = "https://github.com/btschwertfeger/Corvee"
@@ -74,13 +74,13 @@ dependencies = [
74
74
  # CI can never drift apart on what "lint" or "format" actually runs.
75
75
  [tool.hatch.envs.default.scripts]
76
76
  test = "pytest -n auto {args}"
77
- cov = "pytest --cov=src/corvee --cov-report=term-missing {args}"
77
+ cov = "pytest -n auto --cov=src/corvee --cov-report=term-missing {args}"
78
78
  lint = "prek run ruff-check --all-files {args}"
79
79
  format = "prek run black --all-files {args}"
80
80
  typecheck = "prek run ty --all-files {args}"
81
- check = ["prek run --all-files {args}", "test"]
81
+ check = ["prek run --all-files {args}", "cov"]
82
82
  docs-serve = "mkdocs serve"
83
- docs-build = "mkdocs build"
83
+ docs-build = "mkdocs build --strict"
84
84
  # Opt-in, not part of `check`/CI: ~2300 mutants across db/ and guards/ run in
85
85
  # well under a minute locally, but a surviving mutant needs a human/agent to
86
86
  # read it and judge whether it's a real gap, so it stays a deliberate,
@@ -115,7 +115,7 @@ cache_dir = ".cache/pytest"
115
115
  markers = [
116
116
  "unit: pure functions and data structures, no filesystem/database/subprocess",
117
117
  "acceptance: behavior through the CLI or db layer, in-process against a real tmp_path database",
118
- "e2e: a real `python -m corvee` subprocess against a real database in a temp directory",
118
+ "e2e: a real `python -m corvee` or installed `corvee` subprocess against a real database in a temp directory",
119
119
  ]
120
120
 
121
121
  [tool.coverage.run]
@@ -124,6 +124,7 @@ branch = true
124
124
  data_file = ".cache/coverage/.coverage"
125
125
 
126
126
  [tool.coverage.report]
127
+ fail_under = 90
127
128
  exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:"]
128
129
  skip_empty = true
129
130
 
@@ -109,8 +109,11 @@ them. corvee doctor flags a claimed task with recent activity from more
109
109
  than one session under one actor string, which is what that collision
110
110
  looks like after the fact.
111
111
 
112
- Always pass --json. Success is a JSON array of objects on stdout; failure is
113
- an object on stderr: {"error": {"code": ..., "message": ...}}.
112
+ Always pass --json, except on explain, completion, and mcp serve (no
113
+ --json flag) and export (already emits JSON, no flag needed). Success is
114
+ a JSON array of objects on stdout, or a single object for brief, doctor,
115
+ init, and task tree. Failure is an object on stderr:
116
+ {"error": {"code": ..., "message": ...}}.
114
117
 
115
118
  Full flag reference for any command: corvee <command> --help
116
119
  """
@@ -26,6 +26,7 @@ from corvee.constants import (
26
26
  )
27
27
  from corvee.db.tasks import TaskFilter, list_tasks
28
28
  from corvee.guards.fields import validate_fields
29
+ from corvee.guards.labels import normalize_label
29
30
  from corvee.models import TaskRow, parse_task_ref
30
31
  from corvee.output import emit_tasks
31
32
  from corvee.timeutil import parse_duration, timestamp
@@ -147,7 +148,7 @@ def list_command(
147
148
  include_all=include_all,
148
149
  type=narrow_task_type(type_) if type_ else None,
149
150
  priority=narrow_priority(priority) if priority else None,
150
- labels=labels,
151
+ labels=tuple(normalize_label(name) for name in labels),
151
152
  parent_id=parent.id if parent else None,
152
153
  blocks_id=blocks.id if blocks else None,
153
154
  blocked_by_id=blocked_by.id if blocked_by else None,
@@ -42,7 +42,8 @@ def _fetch(conn: sqlite3.Connection, scope: Scope) -> list[tuple[TaskRow, dict[s
42
42
  @click.option("--fields", "-f", "fields_csv")
43
43
  @click.option("--json", "-j", "as_json", is_flag=True)
44
44
  def mine(scope_filter: str, limit: int | None, fields_csv: str | None, as_json: bool) -> None:
45
- """Open tasks claimed by $CORVEE_ACTOR, each with its last comment.
45
+ """Open tasks claimed by (or assigned and unclaimed to) $CORVEE_ACTOR,
46
+ each with its last comment.
46
47
 
47
48
  The session-resume query.
48
49
  """
@@ -11,6 +11,7 @@ from corvee.cli.scope import fetch_merged, paginate_after, resolve_cursor, sort_
11
11
  from corvee.constants import SCOPE_FILTERS, narrow_scope_filter
12
12
  from corvee.db.tasks import ready_tasks
13
13
  from corvee.guards.fields import validate_fields
14
+ from corvee.guards.labels import normalize_label
14
15
  from corvee.output import emit_tasks
15
16
 
16
17
  EPILOG = """\
@@ -52,11 +53,12 @@ def ready(
52
53
  ) -> None:
53
54
  """Unclaimed open tasks with no open blocks predecessor — what can start right now."""
54
55
  fields = validate_fields(fields_csv.split(",")) if fields_csv else None
56
+ label_filters = tuple(normalize_label(name) for name in labels)
55
57
  # --limit applies after the merge, never per scope.
56
58
  tasks = sort_tasks(
57
59
  fetch_merged(
58
60
  narrow_scope_filter(scope_filter),
59
- lambda conn, s: ready_tasks(conn, labels=labels, scope=s),
61
+ lambda conn, s: ready_tasks(conn, labels=label_filters, scope=s),
60
62
  )
61
63
  )
62
64
  if after_ref is not None:
@@ -21,9 +21,12 @@ def complete_task_ids(
21
21
  """Shell-complete a TASK-<n>/TASK-GLOBAL-<n> argument against real ids,
22
22
  merged across local and global (§3.3) the same way `--scope all` does.
23
23
 
24
- Silent on any corvee-raised failure -- outside a project, or against a
25
- database on a newer schema than this binary, tab completion just offers
26
- nothing rather than erroring into the middle of the user's shell prompt.
24
+ Outside a project (or with no global database yet), `scopes_for` drops
25
+ both scopes before either connection opens, so there's nothing here to
26
+ catch. The `except CorveeError` below only matters once a scope is
27
+ actually queried and fails -- e.g. a database migrated by a newer
28
+ binary -- and offers no completions rather than erroring into the
29
+ middle of the user's shell prompt.
27
30
  """
28
31
  del ctx, param
29
32
  try: