Expand description
Bundled git hooks — decided hook (PORT-CONTRACT.d/15).
Port of src/rac/core/hooks.py (registry + resource loading) and
src/asdecided/services/hook.py (install_hook). The packaged <style>.sh
scripts are embedded verbatim from rust/decided-engine/assets/hooks/,
vendored byte-identical copies of the Python package files (unit test
below); the INSTALLED file is named <style> with no extension, under
<dir>/.git/hooks/, and is made executable (hook brief, landmines 1-2).
Structs§
- Hook
Spec - One bundled git hook: its style (the git hook filename) and description.
- Installed
Hook - Result of a
decided hook installrun (InstalledHook;bytes_writtenis in the oracle’s model but absent from its JSON).
Enums§
- Hook
Install Error - The failure contract of
install_hook, message-shaped like the oracle.HookNotFoundis unreachable via the CLI (argparse--stylechoices fire first) and is folded into the usage-error path by the caller.
Constants§
- BUNDLED_
HOOKS - Bundled hooks, registry order.
installdefaults to the first. - DEFAULT_
STYLE DEFAULT_STYLE— the first bundled hook.
Functions§
- available_
hooks available_hooks()— bundled hook styles, registry order.- install_
hook install_hook(target_dir, style)— write the bundledstylescript to<dir>/.git/hooks/<style>and make it executable (git requires the exec bit; the oracle ORsS_IXUSR|S_IXGRP|S_IXOTHonto the fresh file’s mode, yielding 0755 under the usual umask).