Expand description
The $PATH shim adapter.
When a directory of symlinks (rm, git, terraform, …) all pointing at the
kintsugi-shim binary is prepended to $PATH, every matching shell-out lands
here first. The shim:
- recovers the command name from
argv[0](orargv[1]if invoked directly), - captures
argv+ cwd into aProposedCommandtaggedagent = "shim", - asks the daemon for a
Verdictand enforces it, then - on allow, execs the real binary so exit code, stdio, and signals are forwarded with perfect fidelity (on Unix the shim becomes the real process).
Fail-open by default (record-but-don’t-block when the daemon is down), which
matches the honest guarantee — “nothing unrecoverable”, not “nothing
un-warned”. Set KINTSUGI_FAIL_CLOSED=1 to block instead.
Constants§
- EXIT_
BLOCKED - Exit code used when Kintsugi refuses to run a command (mirrors shell “cannot execute”: 126).
- EXIT_
NOT_ FOUND - Exit code when the real binary cannot be found (mirrors shell 127).
Functions§
- resolve_
real_ binary - Resolve the real binary for
nameby walking$PATH, skipping the shim’s own directory and any entry that resolves back to the shim itself. - run
- Entry point for the
kintsugi-shimbinary.