1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Copyright 2026 AlphaOne LLC
// SPDX-License-Identifier: Apache-2.0
//
// v0.7 Track G — programmable lifecycle hook pipeline.
//
// This module is the substrate for tasks G1-G11 of the
// `attested-cortex` epic. G1 lands the configuration schema
// (`hooks.toml`) and the SIGHUP-driven hot-reload plumbing.
// Subsequent tasks layer on:
//
// * G2 — full payload structs for the 20 lifecycle events.
// * G3 — subprocess executor (exec + daemon modes).
// * G4 — `HookDecision` contract.
// * G5 — chain ordering with first-deny-wins short-circuit.
// * G6 — per-event-class deadlines.
// * G7+ — actual firing at the memory operation points.
//
// G1 deliberately ships *only* the schema + loader + hot-reload
// signal handler. It does not fire hooks, validate command paths
// against a sandbox, or implement the executor. Those land in
// follow-up PRs on this same `feat/v0.7-g-*` track.
// G10 — recall hot-path helper. Wraps `HookChain::fire` with the
// `PreRecallExpand` payload-marshalling so `mcp::handle_recall`
// stays a one-liner at the fire site.
// v0.7.0 QW-1 — `post_reflect` substrate-side hook plug-ins (file-
// backed auto-export, future post-commit notifications). These are
// distinct from the cross-process `HookEvent::PostReflect` family in
// `events.rs` — those serialise across subprocess boundaries; this
// module is in-substrate (`std::thread::spawn` + the rusqlite
// connection on the worker thread).
// v0.7.0 WT-1-D — `pre_store` substrate-side hook plug-ins
// (auto-atomisation deferred-enqueue, future pre-commit observers).
// Same in-substrate discipline as `post_reflect` — distinct from the
// cross-process `HookEvent::PreStore` family in `events.rs`.
// G2 lifted `HookEvent` out of `config.rs` into `events.rs` and
// attached payload structs to every variant. The re-export keeps
// G1's `use crate::hooks::HookEvent` (and the
// `crate::hooks::config::HookEvent` compatibility alias) resolving.
pub use ;
pub use ;
pub use ;
// G4 — full HookDecision contract. G3 shipped a local `Allow +
// Deny` prototype inside `executor.rs`; G4 lifts the type into
// `decision.rs` with the four-variant epic spec (Allow / Modify /
// Deny / AskUser) and a strict JSON wire contract. The re-export
// here keeps G3 call sites (`use crate::hooks::HookDecision`,
// `use crate::hooks::executor::HookDecision`) resolving via the
// canonical `crate::hooks::decision::HookDecision` path.
pub use ;
// G3 — subprocess hook executor. Re-exports keep call sites
// (`use crate::hooks::HookExecutor`) tidy without requiring every
// caller to know the `executor::` submodule path.
pub use ;
// G6 — per-event-class hard timeouts. Re-exports the budget table
// + violation counter so the doctor surface and the chain runner
// can both reach for the canonical type without a deeper import.
pub use ;
// G10 — pre_recall_expand hot-path helper.
pub use ;