Skip to content

Make HookDef carry enforcement_strength metadata#4145

Merged
Trecek merged 1 commit into
developfrom
t5-p5-a6-wp1-make-hookdef-carry-enforcement-strength-metadat/4039
Jun 28, 2026
Merged

Make HookDef carry enforcement_strength metadata#4145
Trecek merged 1 commit into
developfrom
t5-p5-a6-wp1-make-hookdef-carry-enforcement-strength-metadat/4039

Conversation

@Trecek

@Trecek Trecek commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add an enforcement_strength: dict[str, str] field to HookDef with field(default_factory=dict). Update _canonical_registry_payload to include the field in the hash computation. Bump format_version from 2 to 3. Populate all 33 HOOK_REGISTRY entries with {"claude_code": "<hard|soft>", "codex": "<codex_status_value>"} based on matcher classification. Add unit tests for field presence, default value, round-trip, hash sensitivity, payload completeness, and classification correctness. Regenerate registry.sha256 and update the hook_event_format_snapshot.json fixture.

Closes #4039

Implementation Plan

Plan file: /home/talon/projects/autoskillit-runs/impl-20260628-110552-838218/.autoskillit/temp/make-plan/t5_p5_a6_wp1_enforcement_strength_plan_2026-06-28_111500.md

🤖 Generated with Claude Code via AutoSkillit

Token Usage Summary

Step Model count uncached output cache_read peak_ctx turns cache_write time
plan* opus[1m] 1 1.5k 25.8k 1.3M 106.4k 47 106.5k 15m 18s
verify* sonnet 1 819 12.3k 344.6k 60.6k 21 42.1k 6m 58s
implement* MiniMax-M3 1 78.3k 14.3k 1.9M 0 87 0 7m 22s
audit_impl* sonnet 1 1.3k 9.3k 291.4k 47.1k 18 35.2k 6m 31s
prepare_pr* MiniMax-M3 1 42.5k 2.0k 147.2k 0 14 0 31s
compose_pr* MiniMax-M3 1 36.6k 1.4k 249.0k 0 15 0 40s
review_pr* sonnet 1 166 30.0k 1.2M 85.1k 46 67.7k 7m 16s
resolve_review* sonnet 1 157 14.9k 1.1M 75.7k 44 58.2k 7m 47s
Total 161.3k 109.9k 6.5M 106.4k 309.7k 52m 26s

* Step used a non-Anthropic provider; caching behavior may differ.

Token Efficiency

Step LoC Changed cache_read/LoC cache_write/LoC output/LoC
plan 0
verify 0
implement 114 17008.3 0.0 125.6
audit_impl 0
prepare_pr 0
compose_pr 0
review_pr 0
resolve_review 0
Total 114 57207.6 2716.4 964.4

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
opus[1m] 1 1.5k 25.8k 1.3M 106.5k 15m 18s
sonnet 4 2.4k 66.5k 2.9M 203.2k 28m 33s
MiniMax-M3 3 157.4k 17.7k 2.3M 0 8m 33s

Add an enforcement_strength: dict[str, str] field to HookDef carrying
per-backend enforcement classification. Populate all 33 HOOK_REGISTRY
entries with {claude_code, codex} keys based on matcher classification:
OS-native-only matchers are 'hard' (10 entries), MCP-containing /
SessionStart matchers are 'soft' (23 entries). The codex key mirrors
the entry's codex_status value.

Include enforcement_strength in _canonical_registry_payload for hash
sensitivity and bump format_version from 2 to 3.

Add 9 unit tests covering field presence, default value, completeness,
value validation, codex/codex_status parity, hash sensitivity,
format_version, round-trip, and payload inclusion.

Regenerate registry.sha256 and update hook_event_format_snapshot.json
fixture; remove the deferred _staleness_note.
@Trecek Trecek added this pull request to the merge queue Jun 28, 2026
Merged via the queue into develop with commit 083b32c Jun 28, 2026
3 checks passed
@Trecek Trecek deleted the t5-p5-a6-wp1-make-hookdef-carry-enforcement-strength-metadat/4039 branch June 28, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant