Whether path is an artifact in a cargo output directory on this disk:
directly in a profile directory (<profile>/lean-ctx) or in its
deps/examples (test and example binaries).
True when command is <our hook binary> hook <operation>: the binary is
ours (is_lean_ctx_hook_binary) and carries no shell metacharacters, so
a user wrapper is never mistaken for a LeanCTX hook.
Whether path is an intermediate cargo artifact (#2232): anything under
target/{debug,release}/{deps,build,examples,incremental}/ or the same
below a target/<triple>/ directory, or below any other cargo profile
directory recognised by what cargo wrote into it (a CARGO_TARGET_DIR of
another name, a named profile).
True when writing binary into the agent or shell configuration of
home would bake a transient cargo artifact into the real account’s
configuration (#2232). A test that runs a server or a hook refresh with
the real HOME would otherwise point the user’s live hooks at a test
binary that the next build deletes.