Review round 2 of #270, all non-blocking.
- Resolve `timeout`/`gtimeout` before choosing apm, so a machine with
neither stays silent on every path, the uv not-synced notice included.
- The uv-path unreadable-version notice also offers `uv sync --frozen`.
- Tests: a `timeout` shim replaces the real binary in the whitelisted PATH
(and backs `gtimeout`), so the suite runs on macOS without coreutils; add
a PATH-route case where `apm --version` exits 1, and a no-timeout case on
the uv path; fix two stale comments.
- ADR-0034: contract item 1 now spells out `--frozen --no-sync --offline`
and the missing-environment short-circuit; amendment dated 2026-12-02.
- ADR-0019: the 2026-12-02 amendment moves below the 2026-09-16 one.
- docs/hooks.md: rewrap an over-long line.
Refs: #270
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
Review round 1 of #270.
- Resolve `timeout`, else `gtimeout`, once after choosing apm, and call it
through "$to" at all three sites. Stock macOS has neither `timeout` nor a
GNU coreutils default, so the `--version` call failed there and every
session printed a false too-old notice. With neither binary the hook exits
0 silently. The budget test now parses `"$to" N` too.
- Check that the project environment ($UV_PROJECT_ENVIRONMENT, else
<root>/.venv) exists before taking the uv path. If it is missing, print a
fixed not-synced notice and never call uv, because `uv run --no-sync`
would create an empty .venv in the consumer repo.
- Separate "version too old" from "version unreadable or timed out", with a
fixed literal for each on each path, so a timeout no longer blames an
unsynced environment.
- Raise the hooks.json timeout from 380 to 400 for the 375s script budget,
refresh the outdated-timing comment, and note the budget in ADR-0019.
- Tests: no timeout binary, gtimeout only, missing and relocated project
environment, a failing `uv run`, `--offline` required on every uv call,
and the hostile-output notice compared to its exact literal.
- ADR-0034: until the #271 cutover, this repo prints the too-old notice and
auto-refresh is paused.
Refs: #270
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
The hook now picks one apm and uses it for both the outdated check and the
update (ADR-0034): `uv run --project <root> --frozen --no-sync --offline apm`
when the project pins apm-cli (a quoted apm-cli requirement in pyproject.toml
plus a uv.lock) and uv is on PATH, else the PATH apm, else it exits silently.
uv is only ever called as `uv run`; `--no-sync` keeps a plain run from syncing
the environment, and `--offline` keeps uv off the network.
Before the outdated check it reads `--version`. Below 0.39.2, or when the
version cannot be read, it prints a fixed notice naming the chosen binary and
skips the check, since an older apm refuses a lockfile v4 and would report it
as up to date. All advice strings are fixed literals that name the chosen
binary; no command output is interpolated.
Tests use seam A: a fake uv first on a whitelisted PATH logs every call and
reaches the pinned fake apm only through `uv run`. They cover pin plus uv, pin
without uv, pin without uv.lock, no pin, no apm, too-old and boundary
versions, stale and current output on both paths, and hostile output.
ADR-0034 is amended to record that seam.
Impact: kyberforge 2.2.1 -> 2.3.0, catalog 0.9.0 -> 0.9.1.
Refs: #270
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi