capt-hook 12.78.2__tar.gz → 12.79.1__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.
- {capt_hook-12.78.2 → capt_hook-12.79.1}/PKG-INFO +2 -2
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/.claude-plugin/plugin.json +1 -1
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/commands.py +2 -1
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/comments.py +33 -5
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/models.py +2 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/cli.py +3 -1
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/context.py +22 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/hook_lint.py +102 -1
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/primitives/llm.py +4 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/skills/authoring-hooks/SKILL.md +27 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/testing/helpers.py +11 -3
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/transcripts.py +37 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/pyproject.toml +2 -2
- {capt_hook-12.78.2 → capt_hook-12.79.1}/.gitignore +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/LICENSE +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/README.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/capt_hook_client/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/capt_hook_client/__main__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/capt_hook_client/client.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/.mcp.json +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/__init__.pyi +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/__main__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/annotations.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/app.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/ast_grep.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/bindings.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/fixes/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/fixes/hooks/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/fixes/hooks/_lib.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/fixes/hooks/scratch_writes.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/fixes/hooks/teammate_permissions.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/_lib.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/_sessions.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/deletions.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/detours.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/docs.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/hook_files.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/plain_english.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/plans.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts/fragments/deliverable_rubric.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts/fragments/workflow_script_header.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts/models/browser_delegation_nudge.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts/models/implementation_spawn_nudge.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts/models/inline_edit_nudge.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts/models/prose_spawn_gate.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts/models/prose_workflow_nudge.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts/models/review_routing_spawn_nudge.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts/models/review_routing_workflow_nudge.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts/models/writing_docs_spawn_nudge.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts/models/writing_docs_workflow_nudge.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts/plain_english_rules.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts/tools/preload_nudge.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/prompts.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/questions.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/review.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/sessions.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/tasks.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/tombstones.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/tooling.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/tools.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/pack.toml +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/go/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/go/hooks/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/go/hooks/testing.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/go/hooks/toolchain.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/graphite/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/graphite/gitdir/.graphite_repo_config +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/graphite/hooks/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/graphite/hooks/_lib.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/graphite/hooks/queue.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/graphite/hooks/vcs.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/performance/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/performance/hooks/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/performance/hooks/filesystem.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/performance/hooks/pipelining.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/python/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/python/hooks/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/python/hooks/style.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/python/hooks/testing.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/python/hooks/toolchain.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/steering/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/steering/hooks/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/steering/hooks/steering.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/steering/hooks/teammates.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/steering/hooks/workarounds.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/steering/pack.toml +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/classifiers/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/classifiers/conductor.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/classifiers/droid.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/classifiers/lane.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/classifiers/native.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/cmd.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/command_schema.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/command_schemas.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/conditions.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/confirm.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/contexts.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/daemon/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/daemon/context.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/daemon/decision_writer.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/daemon/logsink.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/daemon/registry.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/daemon/tree.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/decisions.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/desktop/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/desktop/cli.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/desktop/client.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/dispatch.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/doc_conventions.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/durable.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/events.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/faults.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/fields.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/file.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/guard_literal.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/guard_literal.sh +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/heartbeat.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/hooks/hooks.json +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/loader.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/log.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/mcp_server.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/packs/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/packs/manager.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/packs/plugins.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/pause.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/primitives/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/primitives/commands.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/primitives/lint.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/primitives/nudge.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/primitives/permissions.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/primitives/provision.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/primitives/rewrite.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/primitives/workflow.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/prompt.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/py.typed +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/announce.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/cli.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/dashboard.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/fix.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/formats.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/judge.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/notify.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/pipeline.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/prompts.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/repo.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/routing.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/scan.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/settings.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/snapshot.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/status.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/store.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/sync.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/review/triage.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/scripts/install-binary.sh +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/scripts/install-mcp.sh +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/session.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/settings.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/signals/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/signals/nlp.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/skills/authoring-hooks/references/capt-hook-api.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/skills/authoring-hooks/references/pattern-catalog.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/skills/authoring-hooks/references/pitfalls.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/skills/authoring-hooks/references/testing-hooks.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/skills/bootstrapping-hooks/SKILL.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/skills/scanning-sessions/SKILL.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/skills/scanning-sessions/references/pr-workflow.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/skills/scanning-sessions/references/review-cli.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/skills/translating-styleguides/SKILL.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/skills/translating-styleguides/references/llm-rule-patterns.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/skills/translating-styleguides/references/matcher-reference.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/skills/translating-styleguides/references/tier-rubric.md +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/client.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/contracts.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/review.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/schema.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/schemas/config.schema.json +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/schemas/context.schema.json +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/schemas/host-request.schema.json +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/schemas/host-response.schema.json +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/schemas/request.schema.json +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/schemas/response.schema.json +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/schemas/tool_registry.schema.json +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/validation.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/snapshots/worker.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/state.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/style/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/style/ast_grep.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/style/matchers.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/style/scope.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/style/types.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/tasks.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/templates/example_hook.py.tmpl +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/testing/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/testing/fixtures.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/testing/session_cache.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/testing/snapshots.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/testing/types.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/turn.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/types.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/update/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/update/cli.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/update/launchers.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/update/settings.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/update/updater.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/automode.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/caching.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/fs.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/globbing.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/http.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/model_cache.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/paths.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/payload.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/proc.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/reqenv.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/scratch.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/shell.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/text.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/userpath.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/util/vcs.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/worker/__init__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/worker/__main__.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/worker/fail_open.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/worker/protocol.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/worker/runtime.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/worker/service.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/hatch_build.py +0 -0
- {capt_hook-12.78.2 → capt_hook-12.79.1}/internal/wireproto/guard.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: capt-hook
|
|
3
|
-
Version: 12.
|
|
3
|
+
Version: 12.79.1
|
|
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/
|
|
@@ -36,7 +36,7 @@ Requires-Dist: pydantic-settings>=2.0
|
|
|
36
36
|
Requires-Dist: pydantic>=2.0
|
|
37
37
|
Requires-Dist: rich>=13
|
|
38
38
|
Requires-Dist: spacy>=3.7
|
|
39
|
-
Requires-Dist: spawnllm[sdk]<0.
|
|
39
|
+
Requires-Dist: spawnllm[sdk]<0.16,>=0.15.0
|
|
40
40
|
Requires-Dist: wn>=1.1.0
|
|
41
41
|
Provides-Extra: dev
|
|
42
42
|
Requires-Dist: hatchling>=1.27; extra == 'dev'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "captain-hook",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.79.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": {
|
{capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/commands.py
RENAMED
|
@@ -221,7 +221,8 @@ hook(
|
|
|
221
221
|
],
|
|
222
222
|
message=(
|
|
223
223
|
"This `git stash` takes from or adds to the stack shared by every worktree without a tag. "
|
|
224
|
-
'Run `git stash push -u -m "<unique-tag>"
|
|
224
|
+
'Run `git stash push -u -m "<unique-tag>"`, read its `stash@{N}` from `git stash list`, then run '
|
|
225
|
+
"`git stash apply stash@{N}` and `git stash drop stash@{N}` with that literal ref (never pop)."
|
|
225
226
|
),
|
|
226
227
|
block=True,
|
|
227
228
|
tests={
|
{capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/comments.py
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
"""Block an edit that leaves an over-budget comment block it created or
|
|
1
|
+
"""Block an edit that leaves an over-budget comment block it created or lengthened; warn on legacy rewords, doc,
|
|
2
|
+
and dense cases."""
|
|
2
3
|
|
|
3
4
|
from __future__ import annotations
|
|
4
5
|
|
|
@@ -85,6 +86,13 @@ PY_LONG_RUN = (
|
|
|
85
86
|
PY_ALL_COMMENT = (
|
|
86
87
|
"# note one line\n# note two line\n# note three ok\n# note four line\n# note five line\n# note six line ok\n"
|
|
87
88
|
)
|
|
89
|
+
GO_LEGACY_RUN = (
|
|
90
|
+
"package p\n\nfunc F() {\n"
|
|
91
|
+
"\t// legacy note that runs long enough to push three lines past the char budget one\n"
|
|
92
|
+
"\t// legacy note that runs long enough to push three lines past the char budget two\n"
|
|
93
|
+
"\t// legacy note that runs long enough to push three lines past the char budget six\n"
|
|
94
|
+
"\tx := 1\n}\n"
|
|
95
|
+
)
|
|
88
96
|
PY_DENSE_FIRES = "# c1 here\na = 1\n# c2 here\nb = 2\n# c3 here\n# c4 here\nc = 3\n# c5 here\n"
|
|
89
97
|
|
|
90
98
|
|
|
@@ -102,23 +110,28 @@ def touched_ancestry(evt: BaseHookEvent) -> list[TouchedComment]:
|
|
|
102
110
|
return touched_comment_ancestry(pre, post, lang)
|
|
103
111
|
|
|
104
112
|
|
|
113
|
+
def lengthened(touched: TouchedComment) -> bool:
|
|
114
|
+
"""True when the block is new, or has more lines than its over-budget ancestor."""
|
|
115
|
+
return touched.ancestor is None or touched.block.lines > touched.ancestor.lines
|
|
116
|
+
|
|
117
|
+
|
|
105
118
|
def touched(evt: BaseHookEvent) -> list[CommentBlock]:
|
|
106
119
|
"""The comment blocks this edit created or grew, or ``[]`` when the language is unparsable."""
|
|
107
120
|
return [t.block for t in touched_ancestry(evt)]
|
|
108
121
|
|
|
109
122
|
|
|
110
123
|
class VerboseComment(CustomCondition):
|
|
111
|
-
"""True when the edit leaves an over-budget comment block it created or
|
|
124
|
+
"""True when the edit leaves an over-budget comment block it created, or added lines to."""
|
|
112
125
|
|
|
113
126
|
def check(self, evt: BaseHookEvent) -> bool:
|
|
114
|
-
return any(t.block.too_long and t
|
|
127
|
+
return any(t.block.too_long and lengthened(t) for t in touched_ancestry(evt))
|
|
115
128
|
|
|
116
129
|
|
|
117
130
|
class LegacyCommentEdit(CustomCondition):
|
|
118
|
-
"""True when the edit
|
|
131
|
+
"""True when the edit rewords a comment that was already over budget without adding lines."""
|
|
119
132
|
|
|
120
133
|
def check(self, evt: BaseHookEvent) -> bool:
|
|
121
|
-
return any(t.block.too_long and
|
|
134
|
+
return any(t.block.too_long and not lengthened(t) for t in touched_ancestry(evt))
|
|
122
135
|
|
|
123
136
|
|
|
124
137
|
class VerboseDocComment(CustomCondition):
|
|
@@ -288,6 +301,16 @@ hook(
|
|
|
288
301
|
old="# a here\n# b here\n# c here",
|
|
289
302
|
content="# a here\n# b here\n# c here\n# d here\n# e here\n# f here",
|
|
290
303
|
): Block(pattern="Verbose comment"),
|
|
304
|
+
Input(
|
|
305
|
+
file=FileFixture(name="legacy-grow.py", content=PY_LONG_RUN),
|
|
306
|
+
old="# note six here",
|
|
307
|
+
content="# note six here\n# note seven here",
|
|
308
|
+
): Block(pattern="Verbose comment"),
|
|
309
|
+
Input(
|
|
310
|
+
file=FileFixture(name="legacy-grow.go", content=GO_LEGACY_RUN),
|
|
311
|
+
old="\tx := 1",
|
|
312
|
+
content="\t// and one more line\n\tx := 1",
|
|
313
|
+
): Block(pattern="Verbose comment"),
|
|
291
314
|
Input(
|
|
292
315
|
file=FileFixture(name="reflow.go", content="package p\n\nfunc F() {\n\t/* one two three */\n\tx := 1\n}\n"),
|
|
293
316
|
old="/* one two three */",
|
|
@@ -444,6 +467,11 @@ nudge(
|
|
|
444
467
|
content="// stale token from a much earlier session.",
|
|
445
468
|
): Warn(pattern="Legacy long comment"),
|
|
446
469
|
Input(file="new.py", content=PY_LONG_RUN): Allow(),
|
|
470
|
+
Input(
|
|
471
|
+
file=FileFixture(name="legacy-grow.py", content=PY_LONG_RUN),
|
|
472
|
+
old="# note six here",
|
|
473
|
+
content="# note six here\n# note seven here",
|
|
474
|
+
): Allow(),
|
|
447
475
|
Input(
|
|
448
476
|
file=FileFixture(name="grow.py", content="# a here\n# b here\n# c here\nx = 1\n"),
|
|
449
477
|
old="# a here\n# b here\n# c here",
|
|
@@ -10,6 +10,7 @@ from captain_hook import (
|
|
|
10
10
|
BaseHookEvent,
|
|
11
11
|
Block,
|
|
12
12
|
Clause,
|
|
13
|
+
Confirm,
|
|
13
14
|
Event,
|
|
14
15
|
FilePath,
|
|
15
16
|
FromSubagent,
|
|
@@ -198,6 +199,7 @@ hook(
|
|
|
198
199
|
"Drop the `model` pin so the spawn runs opus, or pin `model='sonnet'` when the lane calls for sonnet."
|
|
199
200
|
),
|
|
200
201
|
block=True,
|
|
202
|
+
confirm=Confirm(rule="A haiku-pinned spawn whose task needs judgment beyond one mechanical fact per item."),
|
|
201
203
|
tests={
|
|
202
204
|
Input(model="haiku", prompt="implement the retry backoff in the client"): Block(pattern="Drop the `model` pin"),
|
|
203
205
|
Input(model="haiku", prompt="implement the retry backoff"): Block(pattern="single-fact mechanical"),
|
|
@@ -302,12 +302,14 @@ def dispatch_event(
|
|
|
302
302
|
)
|
|
303
303
|
background_transcript = transcript.fork()
|
|
304
304
|
parent = raw.get("transcript_path")
|
|
305
|
+
in_lane = bool(parent) and resolved_path != parent
|
|
305
306
|
ctx = HookContext(
|
|
306
307
|
session=SessionStore(session_dir),
|
|
307
308
|
transcript=transcript,
|
|
308
309
|
settings=_state.settings,
|
|
309
310
|
project_root=root,
|
|
310
|
-
root_transcript=root_transcript(parent, ROOT_TAIL_EVENTS) if
|
|
311
|
+
root_transcript=root_transcript(parent, ROOT_TAIL_EVENTS) if in_lane else None,
|
|
312
|
+
root_path=Path(parent) if in_lane else None,
|
|
311
313
|
)
|
|
312
314
|
evt = event.event_class(_raw=raw, ctx=ctx)
|
|
313
315
|
within_margin = reqenv.deadline_within(SYNC_DEADLINE_MARGIN_SECONDS)
|
|
@@ -17,6 +17,8 @@ from captain_hook.util import reqenv
|
|
|
17
17
|
from captain_hook.util.paths import resolve_project_dir
|
|
18
18
|
|
|
19
19
|
if TYPE_CHECKING:
|
|
20
|
+
from collections.abc import Sequence
|
|
21
|
+
|
|
20
22
|
from cc_transcript.query import Session
|
|
21
23
|
from cc_transcript.render import Budget
|
|
22
24
|
from pydantic import BaseModel
|
|
@@ -134,6 +136,7 @@ class HookContext:
|
|
|
134
136
|
settings: HooksSettings | None
|
|
135
137
|
project_root: Path | None = None
|
|
136
138
|
root_transcript: Session | RemoteSession | LazyTranscript | None = None
|
|
139
|
+
root_path: Path | None = None
|
|
137
140
|
signal_evidence: dict[tuple[int | Literal["turn"], str, bool], tuple[str, ...]] = field(
|
|
138
141
|
default_factory=dict, init=False
|
|
139
142
|
)
|
|
@@ -279,6 +282,23 @@ class HookContext:
|
|
|
279
282
|
rendered = render_window(src, window=window, tool_results=tool_results, budget=budget)
|
|
280
283
|
return f"<root_transcript>\n{rendered}\n</root_transcript>"
|
|
281
284
|
|
|
285
|
+
def root_excerpt(self, needles: Sequence[str], *, around: int = 2) -> Session | None:
|
|
286
|
+
"""The root session's events that mention any of ``needles``, with ``around`` events either side,
|
|
287
|
+
from the whole transcript rather than its tail; ``None`` outside a lane.
|
|
288
|
+
"""
|
|
289
|
+
from captain_hook.transcripts import root_excerpt
|
|
290
|
+
|
|
291
|
+
return None if self.root_path is None else root_excerpt(self.root_path, needles, around=around)
|
|
292
|
+
|
|
293
|
+
def root_excerpt_block(
|
|
294
|
+
self, needles: Sequence[str], *, tool_results: bool = False, budget: Budget | None = None
|
|
295
|
+
) -> str:
|
|
296
|
+
"""The root excerpt for ``needles`` rendered as ``<root_excerpt>``; empty outside a lane or with no match."""
|
|
297
|
+
if (excerpt := self.root_excerpt(needles)) is None or not len(excerpt):
|
|
298
|
+
return ""
|
|
299
|
+
rendered = render_window(excerpt, window=None, tool_results=tool_results, budget=budget)
|
|
300
|
+
return f"<root_excerpt>\n{rendered}\n</root_excerpt>"
|
|
301
|
+
|
|
282
302
|
def call_cli(
|
|
283
303
|
self,
|
|
284
304
|
args: list[str],
|
|
@@ -476,10 +496,12 @@ class HookContext:
|
|
|
476
496
|
budget: Budget | None = None,
|
|
477
497
|
diff_text: str | None,
|
|
478
498
|
root_transcript: bool | int | Literal["recent", "full"] = False,
|
|
499
|
+
root_excerpt: Sequence[str] = (),
|
|
479
500
|
) -> str:
|
|
480
501
|
block = "\n\n".join(
|
|
481
502
|
rendered
|
|
482
503
|
for rendered in (
|
|
504
|
+
self.root_excerpt_block(root_excerpt, tool_results=tool_results, budget=budget) if root_excerpt else "",
|
|
483
505
|
self.root_transcript_block(
|
|
484
506
|
window=transcript_window(root_transcript), tool_results=tool_results, budget=budget
|
|
485
507
|
)
|
|
@@ -26,6 +26,9 @@ PLACEHOLDER = re.compile(r"\{[^{}]*\}")
|
|
|
26
26
|
ABBREVIATION = re.compile(r"\b(?:e\.g|i\.e|etc|vs)\.", re.IGNORECASE)
|
|
27
27
|
SENTENCE_BREAK = re.compile(r"(?<=[.!?])\s+|\n+")
|
|
28
28
|
ECHOED_INPUT = re.compile(r"\{[^{}]*\b(?:reasoning|user_prompt|prompt)\b[^{}]*\}")
|
|
29
|
+
RETIRED_ESCAPE = re.compile(
|
|
30
|
+
r"root:raw|(?<![\w=-])tooling-lane:|CAPT_HOOK_CCX_RAW=(?!(?:1|true|yes)\b)[\w-]*", re.IGNORECASE
|
|
31
|
+
)
|
|
29
32
|
|
|
30
33
|
COPY_RULES: tuple[tuple[str, re.Pattern[str]], ...] = (
|
|
31
34
|
("quoted text", re.compile(r"""(?<!\w)["“'‘][^"”'’\n]*\s[^"”'’\n]*\s[^"”'’\n]*["”'’](?!\w)""")),
|
|
@@ -61,6 +64,11 @@ COMMAND_TEXT = re.compile(r"\.raw\b|tool_input(?:\[|\.get\()[\"']command[\"']|^(
|
|
|
61
64
|
TRANSCRIPT_FILES = re.compile(r"\.jsonl\b|\.claude/projects")
|
|
62
65
|
BROAD_EXCEPTIONS = frozenset({"Exception", "BaseException"})
|
|
63
66
|
COMMAND_PATTERN_CALLS = frozenset({"Command", "CommandCondition", "block_command", "warn_command"})
|
|
67
|
+
ESCAPE_MARKERS = re.compile(r"ccx:raw|root:raw|tooling-lane:|^CAPT_HOOK_CCX_RAW$")
|
|
68
|
+
TEXT_PARSERS = REGEX_METHODS | frozenset(
|
|
69
|
+
{"compile", "startswith", "endswith", "find", "rfind", "index", "count", "partition", "rpartition", "getenv", "get"}
|
|
70
|
+
)
|
|
71
|
+
CONTEXT_TOOLS = frozenset({"Agent", "Task", "Skill", "Read", "Grep", "Glob"})
|
|
64
72
|
ALLOWED_COMMENT = re.compile(r"#!|#\s*(?:TODO|FIXME|WORKAROUND|noqa|type:|pyright:|ruff:|fmt:|pragma)")
|
|
65
73
|
|
|
66
74
|
|
|
@@ -89,6 +97,10 @@ def copy_violations(text: str) -> list[str]:
|
|
|
89
97
|
*([f"{len(sentences)} sentences; state the rule, then the remediation"] * (len(sentences) > MAX_SENTENCES)),
|
|
90
98
|
*([f"{len(stripped)} chars; keep it to {MAX_CHARS}"] * (len(stripped) > MAX_CHARS)),
|
|
91
99
|
*(["echoes the prompt or the judge's reasoning; state the rule instead"] * bool(ECHOED_INPUT.search(stripped))),
|
|
100
|
+
*(
|
|
101
|
+
f"retired escape {match.group(0)!r}; offer `# ccx:raw`, `CAPT_HOOK_CCX_RAW=1`, or a `ccx:` line"
|
|
102
|
+
for match in RETIRED_ESCAPE.finditer(stripped)
|
|
103
|
+
),
|
|
92
104
|
*(f"{name} {match.group(0)!r}" for name, pattern in COPY_RULES if (match := pattern.search(prose))),
|
|
93
105
|
]
|
|
94
106
|
|
|
@@ -218,6 +230,90 @@ def code_violation(node: ast.AST) -> str | None:
|
|
|
218
230
|
return None
|
|
219
231
|
|
|
220
232
|
|
|
233
|
+
def keyword(call: ast.Call, name: str) -> ast.expr | None:
|
|
234
|
+
return next((kw.value for kw in call.keywords if kw.arg == name), None)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def calls_named(node: ast.AST | None, name: str) -> list[ast.Call]:
|
|
238
|
+
return [] if node is None else [n for n in ast.walk(node) if isinstance(n, ast.Call) and callee(n) == name]
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def tool_names(call: ast.Call) -> set[str]:
|
|
242
|
+
return {
|
|
243
|
+
name
|
|
244
|
+
for tool in calls_named(keyword(call, "only_if"), "Tool")
|
|
245
|
+
for arg in tool.args
|
|
246
|
+
if isinstance(arg, ast.Constant) and isinstance(arg.value, str)
|
|
247
|
+
for name in arg.value.split("|")
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
def escapable(call: ast.Call) -> bool:
|
|
252
|
+
return keyword(call, "confirm") is not None or any(
|
|
253
|
+
calls_named(keyword(call, field), "Annotated") for field in ("skip_if", "only_if")
|
|
254
|
+
)
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def reads_annotations(node: ast.AST) -> bool:
|
|
258
|
+
return any(isinstance(n, ast.Attribute) and n.attr == "annotations" for n in ast.walk(node))
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
def unescaped_context_blocks(tree: ast.Module) -> Iterator[ast.AST]:
|
|
262
|
+
for node in ast.walk(tree):
|
|
263
|
+
match node:
|
|
264
|
+
case ast.Call() if (
|
|
265
|
+
callee(node) == "hook"
|
|
266
|
+
and isinstance(block := keyword(node, "block"), ast.Constant)
|
|
267
|
+
and block.value is True
|
|
268
|
+
and tool_names(node) & CONTEXT_TOOLS
|
|
269
|
+
and not escapable(node)
|
|
270
|
+
):
|
|
271
|
+
yield node
|
|
272
|
+
case ast.FunctionDef(decorator_list=decorators):
|
|
273
|
+
for on in (d for d in decorators if isinstance(d, ast.Call) and callee(d) == "on"):
|
|
274
|
+
if tool_names(on) & CONTEXT_TOOLS and not escapable(on) and not reads_annotations(node):
|
|
275
|
+
yield from (
|
|
276
|
+
block
|
|
277
|
+
for block in calls_named(node, "block")
|
|
278
|
+
if isinstance(block.func, ast.Attribute) and keyword(block, "confirm") is None
|
|
279
|
+
)
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
def parent_map(tree: ast.Module) -> dict[int, ast.AST]:
|
|
283
|
+
return {id(child): parent for parent in ast.walk(tree) for child in ast.iter_child_nodes(parent)}
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
def parses_text(node: ast.AST, parent: ast.AST | None) -> bool:
|
|
287
|
+
match parent:
|
|
288
|
+
case ast.Compare():
|
|
289
|
+
return True
|
|
290
|
+
case ast.Call() if callee(parent) in TEXT_PARSERS:
|
|
291
|
+
return True
|
|
292
|
+
case ast.Subscript(value=value) if "environ" in ast.unparse(value):
|
|
293
|
+
return True
|
|
294
|
+
case _:
|
|
295
|
+
return False
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
def escape_findings(path: Path, tree: ast.Module) -> Iterator[Finding]:
|
|
299
|
+
parents = parent_map(tree)
|
|
300
|
+
for node in ast.walk(tree):
|
|
301
|
+
if (
|
|
302
|
+
isinstance(node, ast.Constant)
|
|
303
|
+
and isinstance(node.value, str)
|
|
304
|
+
and ESCAPE_MARKERS.search(node.value)
|
|
305
|
+
and parses_text(node, parents.get(id(node)))
|
|
306
|
+
):
|
|
307
|
+
yield Finding(path, node.lineno, "code", "parses the ccx escape by hand; match it with Annotated(...)")
|
|
308
|
+
for node in unescaped_context_blocks(tree):
|
|
309
|
+
yield Finding(
|
|
310
|
+
path,
|
|
311
|
+
getattr(node, "lineno", 1),
|
|
312
|
+
"code",
|
|
313
|
+
"blocks a dispatch or read with no escape; add skip_if=[Annotated(...)] or confirm=Confirm(...)",
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
|
|
221
317
|
def code_findings(path: Path, tree: ast.Module) -> Iterator[Finding]:
|
|
222
318
|
for node in ast.walk(tree):
|
|
223
319
|
if (violation := code_violation(node)) is not None:
|
|
@@ -234,7 +330,12 @@ def lint_source(path: Path, source: str) -> list[Finding]:
|
|
|
234
330
|
"""Every finding in one hook file's source, ordered by line."""
|
|
235
331
|
tree = ast.parse(source, filename=str(path))
|
|
236
332
|
return sorted(
|
|
237
|
-
[
|
|
333
|
+
[
|
|
334
|
+
*copy_findings(path, tree),
|
|
335
|
+
*code_findings(path, tree),
|
|
336
|
+
*escape_findings(path, tree),
|
|
337
|
+
*comment_findings(path, source),
|
|
338
|
+
],
|
|
238
339
|
key=lambda finding: (finding.line, finding.rule, finding.detail),
|
|
239
340
|
)
|
|
240
341
|
|
|
@@ -88,6 +88,7 @@ def llm_evaluate[M: BaseModel](
|
|
|
88
88
|
agent: bool = False,
|
|
89
89
|
transcript: bool | int | Literal["recent", "full"] = False,
|
|
90
90
|
root_transcript: bool | int | Literal["recent", "full"] = False,
|
|
91
|
+
root_excerpt: Callable[[BaseHookEvent], Sequence[str]] | None = None,
|
|
91
92
|
tool_results: bool = False,
|
|
92
93
|
budget: Budget | None = None,
|
|
93
94
|
diff: bool | str = False,
|
|
@@ -104,6 +105,8 @@ def llm_evaluate[M: BaseModel](
|
|
|
104
105
|
backend rejects the model itself. ``root_transcript`` takes a window like ``transcript`` and, when
|
|
105
106
|
the event fires inside a subagent or teammate lane, adds that window of the root session that
|
|
106
107
|
spawned the lane as ``<root_transcript>``, so a judge can read the user's words a lane never saw.
|
|
108
|
+
``root_excerpt`` maps the event to needles (a quote, a thread, the text being judged) and adds every
|
|
109
|
+
root event that mentions one as ``<root_excerpt>``, however far back the root transcript it sits.
|
|
107
110
|
"""
|
|
108
111
|
from cc_transcript.render import clip
|
|
109
112
|
|
|
@@ -148,6 +151,7 @@ def llm_evaluate[M: BaseModel](
|
|
|
148
151
|
budget=budget,
|
|
149
152
|
diff_text=None,
|
|
150
153
|
root_transcript=root_transcript,
|
|
154
|
+
root_excerpt=root_excerpt(evt) if root_excerpt else (),
|
|
151
155
|
)
|
|
152
156
|
asked = dispatched
|
|
153
157
|
for attempt in count():
|
|
@@ -66,8 +66,35 @@ Code bar (every registration):
|
|
|
66
66
|
- [ ] No try/except fallbacks or broad `except`; the dispatcher records a raising hook's fault
|
|
67
67
|
- [ ] Zero comments; `TODO` and `WORKAROUND:` are the only exceptions
|
|
68
68
|
- [ ] Inline tests: one input that fires, one benign neighbor that stays silent
|
|
69
|
+
- [ ] Escapes and intent read through `Annotated(...)` or `evt.annotations`; never by parsing
|
|
70
|
+
`# ccx:raw`, `tooling-lane:`, or `CAPT_HOOK_CCX_RAW` by hand
|
|
71
|
+
- [ ] Messages offer only the live escapes: `# ccx:raw`, `CAPT_HOOK_CCX_RAW=1`, or a `ccx:` line
|
|
72
|
+
- [ ] A blocking hook names its escape: `skip_if=[Annotated(<key>)]`, `confirm=Confirm(rule=...)`,
|
|
73
|
+
or both; only security, merge, and session guards block with neither
|
|
69
74
|
```
|
|
70
75
|
|
|
76
|
+
### Escape and intent annotations
|
|
77
|
+
|
|
78
|
+
One notation carries every escape hatch and intent marker. `evt.annotations` maps `ccx:<key>[=<value>]`
|
|
79
|
+
tokens from three carriers: a real comment on a Bash command (`gt submit # ccx:raw`; quoted text and
|
|
80
|
+
heredoc bodies never count), a whole `ccx: key=value ...` line in an Agent or Task prompt or in Skill
|
|
81
|
+
args, and `CAPT_HOOK_CCX_RAW` set to `1`, `true`, or `yes` for `raw`; any other value, `0` included,
|
|
82
|
+
contributes nothing. Keys in use: `raw` (run the command as written), `tooling-lane=<key>` (this
|
|
83
|
+
dispatch is the tooling lane for `<key>`), and
|
|
84
|
+
`role=<fix|helper|reader|watch|export|evidence|handoff|comms|triage>` (a lane's job).
|
|
85
|
+
|
|
86
|
+
`# ccx:raw` is the single command escape. `# root:raw` and the bare `tooling-lane: <key>` prompt line
|
|
87
|
+
are retired; a hook neither honors nor offers them.
|
|
88
|
+
|
|
89
|
+
- Skip on an annotation with `skip_if=[Annotated("raw")]`. `Annotated("role", "evidence",
|
|
90
|
+
scope="session")` reads only the session's dispatch prompt, so a command can never claim a role.
|
|
91
|
+
- Route a block that tends to misfire through a small model with `confirm=Confirm(rule="<the one
|
|
92
|
+
sentence the block protects>")` on `hook(...)` or `evt.block(...)`. The block lands only when the
|
|
93
|
+
model confidently confirms the match; otherwise the call runs with a one-line note.
|
|
94
|
+
- `capt-hook lint` flags hand-parsed escapes, a message that offers a retired escape or a
|
|
95
|
+
`CAPT_HOOK_CCX_RAW` value other than `1`, `true`, or `yes`, and a blocking hook on Agent, Task,
|
|
96
|
+
Skill, Read, Grep, or Glob that carries neither an `Annotated` escape nor `confirm=`.
|
|
97
|
+
|
|
71
98
|
The history behind a rule (who asked for it, when, after which incident) belongs in the
|
|
72
99
|
PR body and the commit message. The agent reading a hook message needs the rule and the
|
|
73
100
|
next action, nothing else.
|
|
@@ -95,6 +95,7 @@ class StubbedContext(HookContext):
|
|
|
95
95
|
settings=ctx.settings,
|
|
96
96
|
project_root=ctx.project_root,
|
|
97
97
|
root_transcript=ctx.root_transcript,
|
|
98
|
+
root_path=ctx.root_path,
|
|
98
99
|
llm=llm or {},
|
|
99
100
|
)
|
|
100
101
|
|
|
@@ -177,13 +178,18 @@ def fixture_session(messages: list[dict[str, Any]], *, path: Path | None = None)
|
|
|
177
178
|
)
|
|
178
179
|
|
|
179
180
|
|
|
180
|
-
def
|
|
181
|
-
"""Write
|
|
181
|
+
def fixture_file(messages: list[dict[str, Any]]) -> Path:
|
|
182
|
+
"""Write raw transcript-line dicts to a temporary transcript file, synthesizing missing envelope fields."""
|
|
182
183
|
path = fixture_file_dir() / f"fixture-{next(FIXTURE_FILE_COUNTER)}.jsonl"
|
|
183
184
|
path.write_bytes(
|
|
184
185
|
b"\n".join(json.dumps(fixture_line(index, message)).encode() for index, message in enumerate(messages))
|
|
185
186
|
)
|
|
186
|
-
return
|
|
187
|
+
return path
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def disk_fixture_session(messages: list[dict[str, Any]]) -> RemoteSession:
|
|
191
|
+
"""Write a temporary transcript and read it through an isolated native evidence owner."""
|
|
192
|
+
return fixture_transcript(fixture_file(messages))
|
|
187
193
|
|
|
188
194
|
|
|
189
195
|
def build_context(
|
|
@@ -578,8 +584,10 @@ def input_to_event(
|
|
|
578
584
|
match inp.root_transcript:
|
|
579
585
|
case TranscriptFixture() as tf:
|
|
580
586
|
evt.ctx.root_transcript = fixture_session(tf.messages)
|
|
587
|
+
evt.ctx.root_path = fixture_file(tf.messages)
|
|
581
588
|
case Path() as p:
|
|
582
589
|
evt.ctx.root_transcript = fixture_transcript(p)
|
|
590
|
+
evt.ctx.root_path = p
|
|
583
591
|
|
|
584
592
|
evt.ctx = StubbedContext.wrapping(evt.ctx, inp.llm)
|
|
585
593
|
|
|
@@ -4,6 +4,7 @@ import hashlib
|
|
|
4
4
|
import json
|
|
5
5
|
import re
|
|
6
6
|
import threading
|
|
7
|
+
from collections import deque
|
|
7
8
|
from functools import partial
|
|
8
9
|
from pathlib import Path
|
|
9
10
|
from typing import TYPE_CHECKING, overload
|
|
@@ -324,6 +325,42 @@ def root_transcript(path: str | Path, events: int) -> LazyTranscript:
|
|
|
324
325
|
)
|
|
325
326
|
|
|
326
327
|
|
|
328
|
+
def root_excerpt(path: str | Path, needles: Sequence[str], *, around: int = 2, limit: int = 20) -> Session:
|
|
329
|
+
"""The newest ``limit`` events of a lane's root session transcript whose line contains any of
|
|
330
|
+
``needles``, each with ``around`` events either side, streamed from the whole file so an answer far
|
|
331
|
+
older than the tail still reaches the judge. A needle matches as typed or JSON-escaped, with or
|
|
332
|
+
without its non-ASCII escaped.
|
|
333
|
+
"""
|
|
334
|
+
from cc_transcript.parser import parse_events_from_bytes
|
|
335
|
+
|
|
336
|
+
forms = {
|
|
337
|
+
form
|
|
338
|
+
for needle in needles
|
|
339
|
+
if needle
|
|
340
|
+
for form in (
|
|
341
|
+
needle.encode(),
|
|
342
|
+
json.dumps(needle)[1:-1].encode(),
|
|
343
|
+
json.dumps(needle, ensure_ascii=False)[1:-1].encode(),
|
|
344
|
+
)
|
|
345
|
+
}
|
|
346
|
+
hits: deque[list[bytes]] = deque(maxlen=limit)
|
|
347
|
+
before: deque[bytes] = deque(maxlen=around)
|
|
348
|
+
after = 0
|
|
349
|
+
reqenv.checkpoint()
|
|
350
|
+
with Path(path).open("rb") as transcript:
|
|
351
|
+
for line in transcript:
|
|
352
|
+
if any(form in line for form in forms):
|
|
353
|
+
hits.append([*before, line])
|
|
354
|
+
before.clear()
|
|
355
|
+
after = around
|
|
356
|
+
elif after:
|
|
357
|
+
hits[-1].append(line)
|
|
358
|
+
after -= 1
|
|
359
|
+
else:
|
|
360
|
+
before.append(line)
|
|
361
|
+
return lift_session(parse_events_from_bytes(b"".join(line for hit in hits for line in hit)), path=Path(path))
|
|
362
|
+
|
|
363
|
+
|
|
327
364
|
def guarded_load[S: Session | RemoteSession](path: str | Path | None, read: Callable[[str | Path | None], S]) -> S:
|
|
328
365
|
from captain_hook.snapshots.client import EvidenceIncomplete
|
|
329
366
|
|
|
@@ -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.
|
|
4
|
+
version = "12.79.1"
|
|
5
5
|
description = "Stop repeating yourself to Claude."
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
license = "PolyForm-Noncommercial-1.0.0"
|
|
@@ -44,7 +44,7 @@ dependencies = [
|
|
|
44
44
|
"filelock>=3",
|
|
45
45
|
"pathspec>=0.12",
|
|
46
46
|
"loguru>=0.7.3",
|
|
47
|
-
"spawnllm[sdk]>=0.
|
|
47
|
+
"spawnllm[sdk]>=0.15.0,<0.16",
|
|
48
48
|
"mcp>=2.0,<3",
|
|
49
49
|
]
|
|
50
50
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/fixes/hooks/scratch_writes.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/_sessions.py
RENAMED
|
File without changes
|
{capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/deletions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/hook_files.py
RENAMED
|
File without changes
|
{capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/plain_english.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/questions.py
RENAMED
|
File without changes
|
|
File without changes
|
{capt_hook-12.78.2 → capt_hook-12.79.1}/captain_hook/builtin_packs/general/hooks/sessions.py
RENAMED
|
File without changes
|
|
File without changes
|