capt-hook 12.77.0__tar.gz → 12.77.2__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 (232) hide show
  1. {capt_hook-12.77.0 → capt_hook-12.77.2}/PKG-INFO +1 -1
  2. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/.claude-plugin/plugin.json +1 -1
  3. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/tooling.py +62 -20
  4. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/client.py +54 -22
  5. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/worker.py +30 -1
  6. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/vcs.py +0 -8
  7. {capt_hook-12.77.0 → capt_hook-12.77.2}/pyproject.toml +1 -1
  8. {capt_hook-12.77.0 → capt_hook-12.77.2}/.gitignore +0 -0
  9. {capt_hook-12.77.0 → capt_hook-12.77.2}/LICENSE +0 -0
  10. {capt_hook-12.77.0 → capt_hook-12.77.2}/README.md +0 -0
  11. {capt_hook-12.77.0 → capt_hook-12.77.2}/capt_hook_client/__init__.py +0 -0
  12. {capt_hook-12.77.0 → capt_hook-12.77.2}/capt_hook_client/__main__.py +0 -0
  13. {capt_hook-12.77.0 → capt_hook-12.77.2}/capt_hook_client/client.py +0 -0
  14. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/.mcp.json +0 -0
  15. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/__init__.py +0 -0
  16. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/__init__.pyi +0 -0
  17. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/__main__.py +0 -0
  18. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/annotations.py +0 -0
  19. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/app.py +0 -0
  20. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/ast_grep.py +0 -0
  21. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/bindings.py +0 -0
  22. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/__init__.py +0 -0
  23. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/fixes/__init__.py +0 -0
  24. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/fixes/hooks/__init__.py +0 -0
  25. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/fixes/hooks/_lib.py +0 -0
  26. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/fixes/hooks/scratch_writes.py +0 -0
  27. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/fixes/hooks/teammate_permissions.py +0 -0
  28. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/__init__.py +0 -0
  29. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/__init__.py +0 -0
  30. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/_lib.py +0 -0
  31. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/_sessions.py +0 -0
  32. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/commands.py +0 -0
  33. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/comments.py +0 -0
  34. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/deletions.py +0 -0
  35. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/detours.py +0 -0
  36. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/docs.py +0 -0
  37. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/hook_files.py +0 -0
  38. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/models.py +0 -0
  39. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/plain_english.py +0 -0
  40. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/plans.py +0 -0
  41. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts/fragments/deliverable_rubric.md +0 -0
  42. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts/fragments/workflow_script_header.md +0 -0
  43. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts/models/browser_delegation_nudge.md +0 -0
  44. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts/models/implementation_spawn_nudge.md +0 -0
  45. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts/models/inline_edit_nudge.md +0 -0
  46. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts/models/prose_spawn_gate.md +0 -0
  47. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts/models/prose_workflow_nudge.md +0 -0
  48. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts/models/review_routing_spawn_nudge.md +0 -0
  49. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts/models/review_routing_workflow_nudge.md +0 -0
  50. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts/models/writing_docs_spawn_nudge.md +0 -0
  51. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts/models/writing_docs_workflow_nudge.md +0 -0
  52. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts/plain_english_rules.md +0 -0
  53. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts/tools/preload_nudge.md +0 -0
  54. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/prompts.py +0 -0
  55. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/questions.py +0 -0
  56. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/review.py +0 -0
  57. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/sessions.py +0 -0
  58. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/tasks.py +0 -0
  59. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/tombstones.py +0 -0
  60. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/hooks/tools.py +0 -0
  61. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/general/pack.toml +0 -0
  62. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/go/__init__.py +0 -0
  63. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/go/hooks/__init__.py +0 -0
  64. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/go/hooks/testing.py +0 -0
  65. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/go/hooks/toolchain.py +0 -0
  66. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/graphite/__init__.py +0 -0
  67. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/graphite/gitdir/.graphite_repo_config +0 -0
  68. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/graphite/hooks/__init__.py +0 -0
  69. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/graphite/hooks/_lib.py +0 -0
  70. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/graphite/hooks/queue.py +0 -0
  71. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/graphite/hooks/vcs.py +0 -0
  72. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/performance/__init__.py +0 -0
  73. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/performance/hooks/__init__.py +0 -0
  74. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/performance/hooks/filesystem.py +0 -0
  75. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/performance/hooks/pipelining.py +0 -0
  76. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/python/__init__.py +0 -0
  77. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/python/hooks/__init__.py +0 -0
  78. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/python/hooks/style.py +0 -0
  79. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/python/hooks/testing.py +0 -0
  80. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/python/hooks/toolchain.py +0 -0
  81. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/steering/__init__.py +0 -0
  82. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/steering/hooks/__init__.py +0 -0
  83. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/steering/hooks/steering.py +0 -0
  84. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/steering/hooks/teammates.py +0 -0
  85. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/steering/hooks/workarounds.py +0 -0
  86. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/builtin_packs/steering/pack.toml +0 -0
  87. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/classifiers/__init__.py +0 -0
  88. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/classifiers/conductor.py +0 -0
  89. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/classifiers/droid.py +0 -0
  90. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/classifiers/lane.py +0 -0
  91. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/classifiers/native.py +0 -0
  92. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/cli.py +0 -0
  93. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/cmd.py +0 -0
  94. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/command_schema.py +0 -0
  95. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/command_schemas.py +0 -0
  96. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/conditions.py +0 -0
  97. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/confirm.py +0 -0
  98. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/context.py +0 -0
  99. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/contexts.py +0 -0
  100. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/daemon/__init__.py +0 -0
  101. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/daemon/context.py +0 -0
  102. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/daemon/decision_writer.py +0 -0
  103. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/daemon/logsink.py +0 -0
  104. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/daemon/registry.py +0 -0
  105. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/daemon/tree.py +0 -0
  106. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/decisions.py +0 -0
  107. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/desktop/__init__.py +0 -0
  108. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/desktop/cli.py +0 -0
  109. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/desktop/client.py +0 -0
  110. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/dispatch.py +0 -0
  111. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/doc_conventions.py +0 -0
  112. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/durable.py +0 -0
  113. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/events.py +0 -0
  114. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/faults.py +0 -0
  115. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/fields.py +0 -0
  116. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/file.py +0 -0
  117. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/guard_literal.py +0 -0
  118. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/guard_literal.sh +0 -0
  119. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/heartbeat.py +0 -0
  120. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/hook_lint.py +0 -0
  121. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/hooks/hooks.json +0 -0
  122. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/loader.py +0 -0
  123. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/log.py +0 -0
  124. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/mcp_server.py +0 -0
  125. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/packs/__init__.py +0 -0
  126. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/packs/manager.py +0 -0
  127. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/packs/plugins.py +0 -0
  128. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/primitives/__init__.py +0 -0
  129. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/primitives/commands.py +0 -0
  130. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/primitives/lint.py +0 -0
  131. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/primitives/llm.py +0 -0
  132. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/primitives/nudge.py +0 -0
  133. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/primitives/permissions.py +0 -0
  134. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/primitives/provision.py +0 -0
  135. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/primitives/rewrite.py +0 -0
  136. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/primitives/workflow.py +0 -0
  137. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/prompt.py +0 -0
  138. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/py.typed +0 -0
  139. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/__init__.py +0 -0
  140. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/announce.py +0 -0
  141. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/cli.py +0 -0
  142. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/dashboard.py +0 -0
  143. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/fix.py +0 -0
  144. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/formats.py +0 -0
  145. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/judge.py +0 -0
  146. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/notify.py +0 -0
  147. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/pipeline.py +0 -0
  148. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/prompts.py +0 -0
  149. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/repo.py +0 -0
  150. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/routing.py +0 -0
  151. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/scan.py +0 -0
  152. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/settings.py +0 -0
  153. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/snapshot.py +0 -0
  154. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/status.py +0 -0
  155. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/store.py +0 -0
  156. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/sync.py +0 -0
  157. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/review/triage.py +0 -0
  158. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/scripts/install-binary.sh +0 -0
  159. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/scripts/install-mcp.sh +0 -0
  160. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/session.py +0 -0
  161. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/settings.py +0 -0
  162. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/signals/__init__.py +0 -0
  163. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/signals/nlp.py +0 -0
  164. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/skills/authoring-hooks/SKILL.md +0 -0
  165. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/skills/authoring-hooks/references/capt-hook-api.md +0 -0
  166. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/skills/authoring-hooks/references/pattern-catalog.md +0 -0
  167. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/skills/authoring-hooks/references/pitfalls.md +0 -0
  168. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/skills/authoring-hooks/references/testing-hooks.md +0 -0
  169. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/skills/bootstrapping-hooks/SKILL.md +0 -0
  170. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/skills/scanning-sessions/SKILL.md +0 -0
  171. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/skills/scanning-sessions/references/pr-workflow.md +0 -0
  172. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/skills/scanning-sessions/references/review-cli.md +0 -0
  173. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/skills/translating-styleguides/SKILL.md +0 -0
  174. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/skills/translating-styleguides/references/llm-rule-patterns.md +0 -0
  175. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/skills/translating-styleguides/references/matcher-reference.md +0 -0
  176. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/skills/translating-styleguides/references/tier-rubric.md +0 -0
  177. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/__init__.py +0 -0
  178. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/contracts.py +0 -0
  179. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/review.py +0 -0
  180. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/schema.py +0 -0
  181. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/schemas/config.schema.json +0 -0
  182. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/schemas/context.schema.json +0 -0
  183. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/schemas/host-request.schema.json +0 -0
  184. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/schemas/host-response.schema.json +0 -0
  185. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/schemas/request.schema.json +0 -0
  186. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/schemas/response.schema.json +0 -0
  187. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/schemas/tool_registry.schema.json +0 -0
  188. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/snapshots/validation.py +0 -0
  189. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/state.py +0 -0
  190. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/style/__init__.py +0 -0
  191. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/style/ast_grep.py +0 -0
  192. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/style/matchers.py +0 -0
  193. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/style/scope.py +0 -0
  194. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/style/types.py +0 -0
  195. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/tasks.py +0 -0
  196. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/templates/example_hook.py.tmpl +0 -0
  197. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/testing/__init__.py +0 -0
  198. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/testing/fixtures.py +0 -0
  199. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/testing/helpers.py +0 -0
  200. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/testing/session_cache.py +0 -0
  201. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/testing/snapshots.py +0 -0
  202. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/testing/types.py +0 -0
  203. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/transcripts.py +0 -0
  204. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/turn.py +0 -0
  205. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/types.py +0 -0
  206. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/update/__init__.py +0 -0
  207. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/update/cli.py +0 -0
  208. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/update/settings.py +0 -0
  209. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/update/updater.py +0 -0
  210. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/__init__.py +0 -0
  211. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/automode.py +0 -0
  212. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/caching.py +0 -0
  213. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/fs.py +0 -0
  214. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/globbing.py +0 -0
  215. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/http.py +0 -0
  216. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/model_cache.py +0 -0
  217. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/paths.py +0 -0
  218. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/payload.py +0 -0
  219. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/proc.py +0 -0
  220. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/reqenv.py +0 -0
  221. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/scratch.py +0 -0
  222. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/shell.py +0 -0
  223. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/text.py +0 -0
  224. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/util/userpath.py +0 -0
  225. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/worker/__init__.py +0 -0
  226. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/worker/__main__.py +0 -0
  227. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/worker/fail_open.py +0 -0
  228. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/worker/protocol.py +0 -0
  229. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/worker/runtime.py +0 -0
  230. {capt_hook-12.77.0 → capt_hook-12.77.2}/captain_hook/worker/service.py +0 -0
  231. {capt_hook-12.77.0 → capt_hook-12.77.2}/hatch_build.py +0 -0
  232. {capt_hook-12.77.0 → capt_hook-12.77.2}/internal/wireproto/guard.json +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: capt-hook
3
- Version: 12.77.0
3
+ Version: 12.77.2
4
4
  Summary: Stop repeating yourself to Claude.
5
5
  Project-URL: Homepage, https://github.com/yasyf/captain-hook
6
6
  Project-URL: Documentation, https://yasyf.github.io/captain-hook/
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "captain-hook",
3
- "version": "12.76.1",
3
+ "version": "12.77.0",
4
4
  "displayName": "Captain Hook",
5
5
  "description": "Skills for the capt-hook declarative hook framework: bootstrap gates and nudges from a repo's conventions, and translate style guides into enforced StyleRules.",
6
6
  "author": {
@@ -12,6 +12,7 @@ from pydantic import BaseModel
12
12
  from captain_hook import (
13
13
  Allow,
14
14
  Block,
15
+ Confirm,
15
16
  Event,
16
17
  FromSubagent,
17
18
  HookResult,
@@ -29,7 +30,7 @@ from captain_hook import (
29
30
  on,
30
31
  workflow_state,
31
32
  )
32
- from captain_hook.util.vcs import ccx_raw_marked
33
+ from captain_hook.annotations import comment_pairs
33
34
 
34
35
  if TYPE_CHECKING:
35
36
  from collections.abc import Iterator
@@ -49,7 +50,6 @@ EVIDENCE_CHARS = 240
49
50
  RESET = re.compile(r"rate-limited until (?P<at>\d{4}-\d\d-\d\dT[\d:.]+(?:Z|[+-]\d\d:\d\d))")
50
51
  VERB_WORD = re.compile(r"[a-z][\w-]*")
51
52
  RAW_TOOLS = frozenset({"ccx", "gt", "gh", "orca", "cc-slack"})
52
- LANE_MARKER = re.compile(r"\btooling-lane:\s*(?P<key>[\w:.-]+)")
53
53
 
54
54
  PROMPT = """You are a senior engineer watching another engineer ("the agent") mid-task. A
55
55
  deterministic scan flagged the tool call that just ran as a possible TOOLING DEFECT or
@@ -216,13 +216,18 @@ class ToolingRefusals(WorkflowState):
216
216
 
217
217
 
218
218
  REFUSAL_MESSAGE = (
219
- "`{tool}` refused this action: spawn a tooling lane that fixes it with `tooling-lane: {key}` in its prompt, "
219
+ "`{tool}` refused this action: spawn a tooling lane that fixes it with the line `ccx: tooling-lane={key}` "
220
+ "in its prompt, "
220
221
  "or report the refusal to your orchestrator if you cannot spawn agents. "
221
222
  "Repeats of the dispatch stay blocked until the lane exists."
222
223
  )
223
224
  REPEAT_MESSAGE = (
224
225
  "This dispatch repeats an action `{tool}` already refused, and no tooling lane exists for it. "
225
- "Spawn the tooling lane with `tooling-lane: {key}` in its prompt, then retry."
226
+ "Spawn the tooling lane with the line `ccx: tooling-lane={key}` in its prompt, then retry."
227
+ )
228
+ REPEAT_RULE = (
229
+ "This dispatch asks for the same action the first-party tool refused (`{evidence}`), "
230
+ "rather than an unrelated task that mentions similar words."
226
231
  )
227
232
 
228
233
 
@@ -266,7 +271,7 @@ def refusal(evt: BaseHookEvent) -> tuple[str, Refusal] | None:
266
271
  )
267
272
  if (
268
273
  evt.command
269
- and ccx_raw_marked(raw := evt.command.raw)
274
+ and "raw" in dict(comment_pairs(raw := evt.command.raw))
270
275
  and (call := next((call for call in evt.command.calls() if argv(call)[0] in RAW_TOOLS), None))
271
276
  ):
272
277
  verb = Verb(*list(takewhile(VERB_WORD.fullmatch, argv(call)))[:3])
@@ -287,7 +292,7 @@ def dispatch_text(evt: BaseHookEvent) -> str:
287
292
 
288
293
 
289
294
  def lane_keys(evt: BaseHookEvent) -> set[str]:
290
- keys: set[str] = set(LANE_MARKER.findall(dispatch_text(evt)))
295
+ keys = {key} if (key := evt.annotations.get("tooling-lane")) else set()
291
296
  match evt.input:
292
297
  case TaskCall(agent_name=name) if name:
293
298
  keys |= {signature.key for signature in SIGNATURES if signature.lane_name.search(name)}
@@ -483,7 +488,8 @@ SLACK_REFUSED = ToolingRefusals(
483
488
  CC_SLACK_CLI_SYNC = (
484
489
  "You are cc-slack-cli-sync. Defect: every cc-slack CLI call from lanes now fails: the daemon runs a newer "
485
490
  "release than this CLI. Use a fresh worktree `ccx vcs worktree add cc-slack-cli-sync` if you need to build, "
486
- "install the CLI as the new symlink target, and verify `cc-slack --version` matches the daemon."
491
+ "install the CLI as the new symlink target, and verify `cc-slack --version` matches the daemon and "
492
+ "`cc-slack send --help` lists `--grant`."
487
493
  )
488
494
 
489
495
 
@@ -494,7 +500,7 @@ CC_SLACK_CLI_SYNC = (
494
500
  tool="mcp__plugin_cc-slack_cc-slack__slack_reply",
495
501
  tool_input={"channel_id": "C1", "thread_ts": "1.2", "text": "hi"},
496
502
  output="no cc-slack session for this Claude window; run cc-slack login",
497
- ): Warn(pattern="^`cc-slack` refused.*`tooling-lane: cc-slack-session`"),
503
+ ): Warn(pattern="^`cc-slack` refused.*`ccx: tooling-lane=cc-slack-session`"),
498
504
  Input(
499
505
  tool="Agent",
500
506
  tool_input={"prompt": "reply in the thread", "subagent_type": "lane"},
@@ -512,7 +518,7 @@ CC_SLACK_CLI_SYNC = (
512
518
  Input(
513
519
  command="gh pr view 12 --json state",
514
520
  output="GraphQL: API rate limit exceeded for user ID 1",
515
- ): Warn(pattern="`tooling-lane: github-quota`"),
521
+ ): Warn(pattern="`ccx: tooling-lane=github-quota`"),
516
522
  Input(
517
523
  command="ccx vcs pr status 12",
518
524
  output="ccx: GitHub GraphQL quota exhausted",
@@ -526,7 +532,7 @@ CC_SLACK_CLI_SYNC = (
526
532
  command="ccx code read docs/pr-status.md",
527
533
  output="`pr watch` prints `rate-limited until <next probe>` and sleeps until the GraphQL quota resets.",
528
534
  ): Allow(),
529
- Input(command="gh pr edit 123 --base dev # ccx:raw"): Warn(pattern=r"`tooling-lane: ccx-raw:gh-pr-edit`"),
535
+ Input(command="gh pr edit 123 --base dev # ccx:raw"): Warn(pattern=r"`ccx: tooling-lane=ccx-raw:gh-pr-edit`"),
530
536
  Input(
531
537
  command="gh pr edit 123 --base dev # ccx:raw",
532
538
  agent_id="a1b2c3",
@@ -535,8 +541,16 @@ CC_SLACK_CLI_SYNC = (
535
541
  Input(command="gh pr edit 123 --base dev # ccx:raw", seen={SCOPE: ["ccx-raw:gh-pr-edit:main"]}): Allow(),
536
542
  Input(command="cat > tests.py <<'PY'\nInput(command='gh pr edit 1 # ccx:raw')\nPY"): Allow(),
537
543
  Input(command="cat notes.md # ccx:raw"): Allow(),
544
+ Input(
545
+ command="cat > tail.py <<A <<B\nLIVE = 1\nA\nInput(command='gh pr edit 1') # ccx:raw\nB\ngh pr view 1"
546
+ ): Allow(),
547
+ Input(command="printf '%s\\n' done\\\n# ccx:raw\ngh pr view 12"): Allow(),
548
+ Input(command="gh pr edit 123 --base dev", env={"CAPT_HOOK_CCX_RAW": "1"}): Allow(),
549
+ Input(command="gh pr edit 123 --base dev # ccx:raw", env={"CAPT_HOOK_CCX_RAW": "1"}): Warn(
550
+ pattern=r"`ccx: tooling-lane=ccx-raw:gh-pr-edit`"
551
+ ),
538
552
  Input(command="cd wt && gt submit --no-interactive # ccx:raw"): Warn(
539
- pattern=r"`tooling-lane: ccx-raw:gt-submit`"
553
+ pattern=r"`ccx: tooling-lane=ccx-raw:gt-submit`"
540
554
  ),
541
555
  Input(
542
556
  command="gh pr edit 123 --base dev # ccx:raw",
@@ -578,7 +592,7 @@ def record_refusal(evt: BaseHookEvent) -> HookResult | None:
578
592
  tool="Agent",
579
593
  tool_input={"prompt": "Fix the GraphQL fallback.", "name": "gh-quota-once-and-for-all"},
580
594
  ): Allow(),
581
- Input(tool="Agent", tool_input={"prompt": "Fix ccx.\ntooling-lane: ccx-raw:gh-pr-edit"}): Allow(),
595
+ Input(tool="Agent", tool_input={"prompt": "Fix ccx.\nccx: tooling-lane=ccx-raw:gh-pr-edit"}): Allow(),
582
596
  },
583
597
  )
584
598
  def record_lane(evt: BaseHookEvent) -> HookResult | None:
@@ -597,7 +611,7 @@ def record_lane(evt: BaseHookEvent) -> HookResult | None:
597
611
  tool="Agent",
598
612
  tool_input={"prompt": "Post the reply with cc-slack reply in C1/1.2", "subagent_type": "lane"},
599
613
  state=[SLACK_REFUSED],
600
- ): Block(pattern=r"`tooling-lane: cc-slack-session`"),
614
+ ): Block(pattern=r"`ccx: tooling-lane=cc-slack-session`"),
601
615
  Input(
602
616
  tool="Skill",
603
617
  tool_input={"skill": "cc-slack:slack", "args": "reply in the incident thread"},
@@ -606,7 +620,7 @@ def record_lane(evt: BaseHookEvent) -> HookResult | None:
606
620
  Input(
607
621
  tool="Agent",
608
622
  tool_input={
609
- "prompt": "Fix the cc-slack session lookup and release it.\ntooling-lane: cc-slack-session",
623
+ "prompt": "Fix the cc-slack session lookup and release it.\nccx: tooling-lane=cc-slack-session",
610
624
  "subagent_type": "lane",
611
625
  },
612
626
  state=[SLACK_REFUSED],
@@ -625,7 +639,14 @@ def record_lane(evt: BaseHookEvent) -> HookResult | None:
625
639
  tool="Agent",
626
640
  tool_input={"prompt": CC_SLACK_CLI_SYNC, "name": "cc-slack-cli-sync"},
627
641
  state=[SLACK_REFUSED],
628
- ): Allow(),
642
+ llm={"block": False, "confident": True},
643
+ ): Warn(pattern="allowed, the model found the call outside the rule"),
644
+ Input(
645
+ tool="Agent",
646
+ tool_input={"prompt": CC_SLACK_CLI_SYNC, "name": "cc-slack-cli-sync"},
647
+ state=[SLACK_REFUSED],
648
+ llm={"block": True, "confident": False},
649
+ ): Warn(pattern="allowed, the model could not confirm the match with confidence"),
629
650
  Input(
630
651
  tool="Agent",
631
652
  tool_input={"prompt": "Post the reply with cc-slack reply in C1/1.2", "subagent_type": "lane"},
@@ -640,7 +661,7 @@ def record_lane(evt: BaseHookEvent) -> HookResult | None:
640
661
  tool="Agent",
641
662
  tool_input={"prompt": "Retarget with gh pr edit 9 --base dev", "subagent_type": "lane"},
642
663
  state=[RAW_REFUSED],
643
- ): Block(pattern=r"`tooling-lane: ccx-raw:gh-pr-edit`"),
664
+ ): Block(pattern=r"`ccx: tooling-lane=ccx-raw:gh-pr-edit`"),
644
665
  Input(
645
666
  tool="Agent",
646
667
  tool_input={"prompt": "Read the PR with gh pr view 9", "subagent_type": "lane"},
@@ -648,14 +669,32 @@ def record_lane(evt: BaseHookEvent) -> HookResult | None:
648
669
  ): Allow(),
649
670
  Input(
650
671
  tool="Agent",
651
- tool_input={"prompt": "Teach ccx to retarget.\ntooling-lane: ccx-raw:gh-pr-edit", "subagent_type": "lane"},
672
+ tool_input={
673
+ "prompt": "Teach ccx to retarget.\nccx: tooling-lane=ccx-raw:gh-pr-edit",
674
+ "subagent_type": "lane",
675
+ },
676
+ state=[RAW_REFUSED],
677
+ ): Allow(),
678
+ Input(
679
+ tool="Agent",
680
+ tool_input={"prompt": "Retarget with gh pr edit 9.\nccx: tooling-lane=ccx-raw:gh-pr-edit", "name": "fix"},
652
681
  state=[RAW_REFUSED],
653
682
  ): Allow(),
683
+ Input(
684
+ tool="Agent",
685
+ tool_input={"prompt": "Retarget with gh pr edit 9.\ntooling-lane: ccx-raw:gh-pr-edit", "name": "fix"},
686
+ state=[RAW_REFUSED],
687
+ ): Block(pattern="already refused"),
688
+ Input(
689
+ tool="Agent",
690
+ tool_input={"prompt": "Retarget with gh pr edit 9.\nccx: tooling-lane=github-quota", "name": "fix"},
691
+ state=[RAW_REFUSED],
692
+ ): Block(pattern=r"`ccx: tooling-lane=ccx-raw:gh-pr-edit`"),
654
693
  Input(
655
694
  tool="Agent",
656
695
  tool_input={"prompt": "Poll `ccx vcs pr status 28999` until it lands.", "name": "pr-28999-watch"},
657
696
  state=[QUOTA_REFUSED],
658
- ): Block(pattern=r"`tooling-lane: github-quota`"),
697
+ ): Block(pattern=r"`ccx: tooling-lane=github-quota`"),
659
698
  Input(
660
699
  tool="Agent",
661
700
  tool_input={"prompt": CC_SLACK_CLI_SYNC, "name": "cc-slack-cli-sync"},
@@ -678,7 +717,7 @@ def record_lane(evt: BaseHookEvent) -> HookResult | None:
678
717
  ): Allow(),
679
718
  Input(
680
719
  tool="Agent",
681
- tool_input={"prompt": "tooling-lane: github-quota\nVerify with `gh api rate_limit`.", "name": "quota"},
720
+ tool_input={"prompt": "ccx: tooling-lane=github-quota\nVerify with `gh api rate_limit`.", "name": "quota"},
682
721
  state=[QUOTA_REFUSED],
683
722
  ): Allow(),
684
723
  },
@@ -690,5 +729,8 @@ def block_repeated_dispatch(evt: BaseHookEvent) -> HookResult | None:
690
729
  now = datetime.now(UTC)
691
730
  for key, record in state.refusals.items():
692
731
  if key not in covered and record.live(now) and record.repeated_in(text):
693
- return evt.block(REPEAT_MESSAGE.format(tool=record.tool, key=key))
732
+ return evt.block(
733
+ REPEAT_MESSAGE.format(tool=record.tool, key=key),
734
+ confirm=Confirm(rule=REPEAT_RULE.format(evidence=record.evidence)),
735
+ )
694
736
  return None
@@ -57,6 +57,24 @@ def foreground_seconds(event: str) -> float:
57
57
  return GATE_WORK_SECONDS if event in GATE_EVENTS else GRAPH_WORK_SECONDS
58
58
 
59
59
 
60
+ SCALAR_QUERY_KINDS = frozenset(
61
+ {
62
+ "user_text",
63
+ "first_prompt",
64
+ "event_count",
65
+ "turn_count",
66
+ "tool_count",
67
+ "message_count",
68
+ "unresolved_tools",
69
+ "failures",
70
+ "workflow_text",
71
+ "pending_named_task",
72
+ }
73
+ )
74
+ SCALAR_MISS = object()
75
+ type ScalarKey = tuple[str, tuple[tuple[str, str], ...], SnapshotClient, PreparedGraphEvidence | None, str, str]
76
+
77
+
60
78
  def graph_limits() -> dict[str, int]:
61
79
  limits = DEFAULT_LIMITS.copy()
62
80
  limits["max_discovery_entries"] = min(limits["max_discovery_entries"], GRAPH_DISCOVERY_ENTRIES)
@@ -482,6 +500,7 @@ class Lease:
482
500
  self.guard = threading.Lock()
483
501
  self.subagent_guard = threading.Lock()
484
502
  self.subagent_views: dict[str, RemoteSubagentIndex] = {}
503
+ self.scalar_results: dict[ScalarKey, Any] = {}
485
504
 
486
505
  def renewable_by(self, client: SnapshotClient) -> bool:
487
506
  return (deadline := client.foreground_deadline_unix_ms) is None or self.expires_unix_ms < deadline
@@ -500,12 +519,15 @@ class Lease:
500
519
 
501
520
  def release(self) -> None:
502
521
  with self.subagent_guard:
503
- with ExitStack() as cleanup:
504
- cleanup.callback(self._release)
505
- for index in self.subagent_views.values():
506
- for item in index:
507
- cleanup.callback(item.session.release)
508
- self.subagent_views.clear()
522
+ try:
523
+ with ExitStack() as cleanup:
524
+ cleanup.callback(self._release)
525
+ for index in self.subagent_views.values():
526
+ for item in index:
527
+ cleanup.callback(item.session.release)
528
+ finally:
529
+ self.subagent_views.clear()
530
+ self.scalar_results.clear()
509
531
 
510
532
  def _release(self) -> None:
511
533
  with self.guard:
@@ -923,13 +945,38 @@ class RemoteSession:
923
945
  return f"transcript:{handle['owner_epoch']}:{handle['snapshot_id']}:{handle['generation']}"
924
946
 
925
947
  def query(self, query: Mapping[str, object]) -> Any:
926
- values: list[Any] = []
927
948
  deep = query.get("subagents") is True or query["kind"] in {
928
949
  "deep_predicate_inputs",
929
950
  "sidechain_membership",
930
951
  }
931
952
  if deep and query["kind"] == "sidechain_membership":
932
953
  raise EvidenceIncomplete("invalid_request", "sidechain membership has no prepared graph projection")
954
+ scalar = query["kind"] in SCALAR_QUERY_KINDS or str(query["kind"]).startswith("has_")
955
+ if not scalar:
956
+ return self._query(query, deep=deep)
957
+ key: ScalarKey = (
958
+ self.evidence_ref,
959
+ tuple(sorted(self.classifier.items())),
960
+ self.client,
961
+ self.graph if deep else None,
962
+ json.dumps(self.selectors, sort_keys=True, separators=(",", ":")),
963
+ json.dumps(query, sort_keys=True, separators=(",", ":")),
964
+ )
965
+ self.lease.require()
966
+ if (cached := self.lease.scalar_results.get(key, SCALAR_MISS)) is not SCALAR_MISS:
967
+ if deep:
968
+ self.graph.require(self)
969
+ return cached
970
+ values = self._query(query, deep=deep)
971
+ if len(values) != 1:
972
+ raise SnapshotProtocolError("scalar query returned a non-scalar result")
973
+ with self.lease.guard:
974
+ if not self.lease.closed:
975
+ self.lease.scalar_results[key] = values[0]
976
+ return values[0]
977
+
978
+ def _query(self, query: Mapping[str, object], *, deep: bool) -> list[Any]:
979
+ values: list[Any] = []
933
980
  pages = (
934
981
  self.graph.query_pages(self, query)
935
982
  if deep
@@ -954,21 +1001,6 @@ class RemoteSession:
954
1001
  raise EvidenceIncomplete(exc.status, exc.reason) from exc
955
1002
  case _:
956
1003
  raise SnapshotProtocolError("query returned an unexpected projection")
957
- if query["kind"] in {
958
- "user_text",
959
- "first_prompt",
960
- "event_count",
961
- "turn_count",
962
- "tool_count",
963
- "message_count",
964
- "unresolved_tools",
965
- "failures",
966
- "workflow_text",
967
- "pending_named_task",
968
- } or str(query["kind"]).startswith("has_"):
969
- if len(values) != 1:
970
- raise SnapshotProtocolError("scalar query returned a non-scalar result")
971
- return values[0]
972
1004
  return values
973
1005
 
974
1006
  def __len__(self) -> int:
@@ -1,6 +1,7 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import asyncio
4
+ import hashlib
4
5
  import importlib.metadata
5
6
  import json
6
7
  import os
@@ -23,6 +24,7 @@ from captain_hook.snapshots.client import (
23
24
  read_exact,
24
25
  )
25
26
  from captain_hook.snapshots.validation import checked, parse_exact, validator
27
+ from captain_hook.util.caching import LRUDict
26
28
 
27
29
  if TYPE_CHECKING:
28
30
  from cc_transcript.snapshots import CallContext
@@ -42,6 +44,9 @@ OWNER_ADMISSION = {
42
44
  "release": (4, 32),
43
45
  "warm": (1, 4),
44
46
  }
47
+ MAX_REGISTRY_GENERATIONS = 64
48
+
49
+ RegistryKey = tuple[str, str, bytes]
45
50
 
46
51
 
47
52
  def read_frame(stream: BinaryIO, record_bytes: Callable[[int], None] | None = None) -> dict[str, Any] | None:
@@ -60,6 +65,18 @@ def read_frame(stream: BinaryIO, record_bytes: Callable[[int], None] | None = No
60
65
  return result
61
66
 
62
67
 
68
+ def canonical(value: object) -> bytes:
69
+ return json.dumps(value, separators=(",", ":"), sort_keys=True).encode()
70
+
71
+
72
+ def registry_key(tool_registry: list[dict[str, Any]], context: CallContext) -> RegistryKey:
73
+ return (
74
+ hashlib.sha256(canonical(sorted(tool_registry, key=canonical))).hexdigest(),
75
+ context["admission"],
76
+ canonical(context["authority"]),
77
+ )
78
+
79
+
63
80
  def empty_usage() -> dict[str, int]:
64
81
  return dict.fromkeys(validator("response").schema["$defs"]["Usage"]["properties"], 0)
65
82
 
@@ -99,6 +116,8 @@ class Owner:
99
116
  self.incomplete_type = SnapshotIncomplete
100
117
  self.policy = ReviewPolicy()
101
118
  self.runner: asyncio.Runner | None = None
119
+ self.registry_generations: LRUDict[RegistryKey, str] = LRUDict(MAX_REGISTRY_GENERATIONS)
120
+ self.registry_guard = threading.Lock()
102
121
 
103
122
  def _run_policy(self, snapshot: Any, request: dict[str, Any]) -> dict[str, Any]:
104
123
  if self.runner is None:
@@ -165,12 +184,22 @@ class Owner:
165
184
  return {"id": "captain-conductor", "version": "1"}
166
185
  return {"id": "native", "version": "1"}
167
186
 
187
+ def registry_generation(self, tool_registry: list[dict[str, Any]], context: CallContext) -> str:
188
+ key = registry_key(tool_registry, context)
189
+ with self.registry_guard:
190
+ if key in self.registry_generations:
191
+ return self.registry_generations[key]
192
+ generation = self.store.register_tool_registry(tool_registry, context=context)
193
+ with self.registry_guard:
194
+ self.registry_generations[key] = generation
195
+ return generation
196
+
168
197
  def call(
169
198
  self, request: dict[str, Any], context: CallContext, token: Any, tool_registry: list[dict[str, Any]]
170
199
  ) -> dict[str, Any]:
171
200
  usage: dict[str, int] | None = None
172
201
  try:
173
- context["registry_generation"] = self.store.register_tool_registry(tool_registry, context=context)
202
+ context["registry_generation"] = self.registry_generation(tool_registry, context)
174
203
  if request["schema"] == CORE_SCHEMA:
175
204
  if request["operation"] == "resume":
176
205
  page = self.store.resume_projection(request["cursor"], context=context, cancellation=token)
@@ -8,12 +8,10 @@ import subprocess
8
8
  from collections.abc import Iterator
9
9
  from pathlib import Path
10
10
 
11
- from captain_hook import ast_grep
12
11
  from captain_hook.util import reqenv
13
12
  from captain_hook.util.caching import ttl_cache
14
13
 
15
14
  GRAPHITE_MARKER = ".graphite_repo_config"
16
- RAW_MARKER = "ccx:raw"
17
15
  # ccx gates its own gt lane on this key parsed by Go's strconv.ParseBool, so these are
18
16
  # the exact spellings it accepts. `git config --type=bool` would also take yes/on/off,
19
17
  # which would silence a hook here while ccx still rode the gt lane.
@@ -128,9 +126,3 @@ def contains_repo(resolved: Path) -> bool:
128
126
  return any(
129
127
  name in (".git", ".jj") or scanned >= 20_000 for scanned, name in enumerate(scanned_names(resolved), start=1)
130
128
  )
131
-
132
-
133
- def ccx_raw_marked(command: str) -> bool:
134
- return any(
135
- comment.text.lstrip("#").split(maxsplit=1)[:1] == [RAW_MARKER] for comment in ast_grep.comments(command, "bash")
136
- )
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "capt-hook"
3
3
  # Inert sentinel — the real version is stamped from the release tag (uv version --frozen).
4
- version = "12.77.0"
4
+ version = "12.77.2"
5
5
  description = "Stop repeating yourself to Claude."
6
6
  readme = "README.md"
7
7
  license = "PolyForm-Noncommercial-1.0.0"
File without changes
File without changes
File without changes