Files
Andrey Kumanyaev 5f565b5ea2 fix(codex): count hooks from every user-level file Codex reads
Codex discovers hooks in a hooks.json as well as in inline [hooks] tables
in config.toml, and merges the two when both are in the same layer. The
inspection behind `gortex doctor` read only config.toml, so a machine
whose hooks are configured in hooks.json was reported as having none —
and pointed at `gortex install`, which would have written a second
declaration of the hooks it already had.

Inspect now reads both user-level files and reports a per-file breakdown
alongside the merged count, so a zero can no longer be read as "nothing
anywhere": doctor prints the files the counts came from, and the doc
comment states what is out of scope (the repo layer, which would make the
answer depend on the directory doctor ran in).

The breakdown is load-bearing rather than cosmetic. The uninstall preview
asks for the count in config.toml specifically, because that is the only
file removal rewrites and listing it for entries that live elsewhere
would promise a deletion that never happens.

Doctor also warns when the two files declare the same event, which
nothing else on the machine reports except a Codex startup warning nobody
attributes to the installer. The unit there is the event, not the file:
splitting different events across the two files is a valid configuration
and only an event present in both is merged into two runs, so a warning
keyed on the files would tell such a user to delete working hooks. The
remedy names the file the installer does NOT rewrite, because cleaning
the managed one looks like it worked and comes back on the next install.
`gortex install` and `gortex init --hooks-only` say the same thing at the
moment they would create the duplicate, per configuration layer; both
still write their own representation, because the hooks.json entries are
the user's and not ours to edit.

Also reads `[features] hooks`, the mirror-image defect: hooks that are
declared and switched off were diagnosed as untrusted, sending the user
through an approval flow that could not have helped. It is reported
whether or not anything is configured — installing hooks into a harness
that will not run them is no better — and it suppresses the silence rules
that would otherwise hand out the trust remedy, including the per-event
one, which fires on runs recorded before the switch was flipped.
2026-08-19 19:54:40 +02:00
..
2026-08-18 09:02:11 +02:00