Skip to content

Commit 54416ec

Browse files
committed
feat(tests): add hook event format snapshot and config TOML template
Seal two derived-data fixtures for B3a conformance: * hook_event_format_snapshot.json — captures generate_codex_hooks_config() output keyed by _registry_hash bound to HOOK_REGISTRY_HASH. Trusted hashes are sanitized to a deterministic sentinel and command paths replaced with a placeholder so the fixture is portable across hosts. * config_toml_schema_template.json — declares the four CODEX_MCP_REQUIRED_KEYS with their expected Python types and the two top-level token limit floors (tool_output_token_limit >= 50000, model_auto_compact_token_limit >= 999999999) using a 'constraint: minimum' annotation so WP3 conformance tests compare with >= rather than equality.
1 parent 9628927 commit 54416ec

2 files changed

Lines changed: 330 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"_codex_mcp_required_keys": [
3+
"command",
4+
"env_vars",
5+
"startup_timeout_sec",
6+
"tool_timeout_sec"
7+
],
8+
"mcp_server_entry_required_keys": {
9+
"command": {
10+
"expected_type": "str"
11+
},
12+
"env_vars": {
13+
"expected_type": "list"
14+
},
15+
"startup_timeout_sec": {
16+
"expected_type": "float"
17+
},
18+
"tool_timeout_sec": {
19+
"expected_type": "float"
20+
}
21+
},
22+
"top_level_keys": {
23+
"model_auto_compact_token_limit": {
24+
"constraint": "minimum",
25+
"expected_type": "int",
26+
"floor_value": 999999999
27+
},
28+
"tool_output_token_limit": {
29+
"constraint": "minimum",
30+
"expected_type": "int",
31+
"floor_value": 50000
32+
}
33+
}
34+
}
Lines changed: 296 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,296 @@
1+
{
2+
"_registry_hash": "e2026897c0e2c46ff1b6beb448cade141294f1c7b296dad2b4cf46e61d8c646e",
3+
"_staleness_note": "Regenerate in the same commit as P5-A6 (B4-hookdef-extension) when mechanism/enforcement_strength fields are added to HookDef.",
4+
"hooks": {
5+
"PostToolUse": [
6+
{
7+
"hooks": [
8+
{
9+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py formatters/pretty_output_hook",
10+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
11+
"type": "command"
12+
}
13+
],
14+
"matcher": "mcp__.*autoskillit.*"
15+
},
16+
{
17+
"hooks": [
18+
{
19+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py token_summary_hook",
20+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
21+
"type": "command"
22+
},
23+
{
24+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py quota_post_hook",
25+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
26+
"type": "command"
27+
},
28+
{
29+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py pipeline_step_post_hook",
30+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
31+
"type": "command"
32+
},
33+
{
34+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py recipe_confirmed_post_hook",
35+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
36+
"type": "command"
37+
}
38+
],
39+
"matcher": "mcp__.*autoskillit.*__run_skill.*"
40+
},
41+
{
42+
"hooks": [
43+
{
44+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py review_gate_post_hook",
45+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
46+
"type": "command"
47+
}
48+
],
49+
"matcher": "mcp__.*autoskillit.*__(run_skill|run_python).*"
50+
},
51+
{
52+
"hooks": [
53+
{
54+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py resume_gate_post_hook",
55+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
56+
"type": "command"
57+
}
58+
],
59+
"matcher": "(mcp__.*autoskillit.*__)?dispatch_food_truck"
60+
},
61+
{
62+
"hooks": [
63+
{
64+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py lint_after_edit_hook",
65+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
66+
"type": "command"
67+
}
68+
],
69+
"matcher": "Write|Edit"
70+
}
71+
],
72+
"PreToolUse": [
73+
{
74+
"hooks": [
75+
{
76+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/skill_cmd_guard",
77+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
78+
"type": "command"
79+
},
80+
{
81+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/quota_guard",
82+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
83+
"type": "command"
84+
},
85+
{
86+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/skill_command_guard",
87+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
88+
"type": "command"
89+
},
90+
{
91+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/ingredient_lock_guard",
92+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
93+
"type": "command"
94+
},
95+
{
96+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/pipeline_step_guard",
97+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
98+
"type": "command"
99+
}
100+
],
101+
"matcher": "mcp__.*autoskillit.*__run_skill.*"
102+
},
103+
{
104+
"hooks": [
105+
{
106+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/remove_clone_guard",
107+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
108+
"type": "command"
109+
}
110+
],
111+
"matcher": "mcp__.*autoskillit.*__remove_clone"
112+
},
113+
{
114+
"hooks": [
115+
{
116+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/open_kitchen_guard",
117+
"timeout": 5,
118+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
119+
"type": "command"
120+
}
121+
],
122+
"matcher": "mcp__.*autoskillit.*__open_kitchen.*"
123+
},
124+
{
125+
"hooks": [
126+
{
127+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/branch_protection_guard",
128+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
129+
"type": "command"
130+
}
131+
],
132+
"matcher": "mcp__.*autoskillit.*__merge_worktree"
133+
},
134+
{
135+
"hooks": [
136+
{
137+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/branch_protection_guard",
138+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
139+
"type": "command"
140+
}
141+
],
142+
"matcher": "mcp__.*autoskillit.*__push_to_remote"
143+
},
144+
{
145+
"hooks": [
146+
{
147+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/unsafe_install_guard",
148+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
149+
"type": "command"
150+
},
151+
{
152+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/pr_create_guard",
153+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
154+
"type": "command"
155+
},
156+
{
157+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/compose_pr_body_guard",
158+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
159+
"type": "command"
160+
},
161+
{
162+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/planner_gh_discovery_guard",
163+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
164+
"type": "command"
165+
},
166+
{
167+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/artifact_download_guard",
168+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
169+
"type": "command"
170+
},
171+
{
172+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/git_ops_guard",
173+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
174+
"type": "command"
175+
},
176+
{
177+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/test_runner_guard",
178+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
179+
"type": "command"
180+
}
181+
],
182+
"matcher": "Bash|mcp__.*autoskillit.*__run_cmd"
183+
},
184+
{
185+
"hooks": [
186+
{
187+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/generated_file_write_guard",
188+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
189+
"type": "command"
190+
},
191+
{
192+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/planner_result_naming_guard",
193+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
194+
"type": "command"
195+
}
196+
],
197+
"matcher": "Write|Edit"
198+
},
199+
{
200+
"hooks": [
201+
{
202+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/write_guard",
203+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
204+
"type": "command"
205+
}
206+
],
207+
"matcher": "Write|Edit|Bash|mcp__.*autoskillit.*__run_cmd"
208+
},
209+
{
210+
"hooks": [
211+
{
212+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/skill_orchestration_guard",
213+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
214+
"type": "command"
215+
}
216+
],
217+
"matcher": "mcp__.*autoskillit.*__(run_skill|run_cmd|run_python).*"
218+
},
219+
{
220+
"hooks": [
221+
{
222+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/recipe_read_guard",
223+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
224+
"type": "command"
225+
}
226+
],
227+
"matcher": "Bash|mcp__.*autoskillit.*__(run_cmd|run_python)"
228+
},
229+
{
230+
"hooks": [
231+
{
232+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/background_exec_guard",
233+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
234+
"type": "command"
235+
}
236+
],
237+
"matcher": "Bash|Agent"
238+
},
239+
{
240+
"hooks": [
241+
{
242+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/fleet_dispatch_guard",
243+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
244+
"type": "command"
245+
},
246+
{
247+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/resume_ownership_guard",
248+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
249+
"type": "command"
250+
},
251+
{
252+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/ingredient_lock_guard",
253+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
254+
"type": "command"
255+
},
256+
{
257+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/fleet_claim_guard",
258+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
259+
"type": "command"
260+
}
261+
],
262+
"matcher": "(mcp__.*autoskillit.*__)?dispatch_food_truck"
263+
},
264+
{
265+
"hooks": [
266+
{
267+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/skill_load_guard",
268+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
269+
"type": "command"
270+
}
271+
],
272+
"matcher": "Read|Write|Edit|Bash|Grep|Glob"
273+
},
274+
{
275+
"hooks": [
276+
{
277+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/review_loop_gate",
278+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
279+
"type": "command"
280+
}
281+
],
282+
"matcher": "mcp__.*autoskillit.*__(wait_for_ci|enqueue_pr)"
283+
},
284+
{
285+
"hooks": [
286+
{
287+
"command": "python3 SANITIZED_HOOKS_DIR/_dispatch.py guards/reset_resume_gate",
288+
"trusted_hash": "SANITIZED_FOR_DETERMINISM",
289+
"type": "command"
290+
}
291+
],
292+
"matcher": "(mcp__.*autoskillit.*__)?reset_dispatch"
293+
}
294+
]
295+
}
296+
}

0 commit comments

Comments
 (0)