You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extract the triplicated CLI-resolution logic from the three gate hooks, and narrow CODEV_CLI #65
Two related shapes, both raised by the architecture specialist reviewing #57
(findings a2 and a3).
The resolution logic is triplicated. The block from _INFRASTRUCTURE
through _decide is byte-identical in require_plan.py, require_wave_shape.py and require_small_change.py — six copies counting
the bundle mirrors, roughly 420 of that PR's 839 added lines for one
function's worth of logic. The bundle-mirror half is genuinely mandated by verify_self_install.py; the three-way copy is not.
It has already cost three times. Every defect in that block had to be fixed
six times: the POSIX lexer eating backslashes in a Windows path, the
non-POSIX lexer keeping the quotes it split on, and -P breaking the
flat-layout test fallback.
test_every_gate_hook_resolves_the_cli_the_same_way currently greps for the
string _codev_argv in each file, which pins the duplication rather than the
behaviour and would pass on three copies that had drifted.
CODEV_CLI is shaped unlike its own precedent.git_ops.py's CODEV_GH_PATH is a single path validated with Path(...).is_file() — no
lexing. CODEV_CLI takes a whole command line, so it needs shlex.split(..., posix=...) plus a hand-written matched-quote stripper,
which is precisely where two of the three defects above came from.
Fix: extract .claude/hooks/_gate_common.py (sibling import works — the
host runs python3 .../hook.py), replace the substring test with a
behavioural one, and either narrow CODEV_CLI to a path like CODEV_GH_PATH or drop it.
Activity
feat(claude-code-adapter): recovery hooks, statusline, isolation, bud…