Skip to main content

Module fingerprint

Module fingerprint 

Source
Expand description

Deterministic fingerprints: the same error seen by two drones (or two sessions weeks apart) must hash the same, regardless of line numbers, temp paths, ids or durations.

Functions§

bash_read_paths
Files a shell command pulls into context (cat a.rs, sed -n 1,80p src/x.rs | …). Agents read through Bash far more often than through the Read tool, so recall-on-touch must see these too.
command_shape
Program plus subcommand (cargo test, npm run, git status), the unit at which “how do I build/test this repo” knowledge transfers.
error_fingerprint
Fingerprint of the most specific error line (see error_line).
error_line
The most specific error line of a failed command’s output: the last line naming the error (Python tracebacks end with it), else the first error-looking line that is not a generic header. None for harness messages (permission denials, rejections).
invocation
The invocation structure of a command: program, subcommand, env assignments and flags, without test selectors, paths or quoted values. Two commands that differ only in which tests/files they target have the same invocation.
is_test_failure
Whether an error line is a failing test assertion rather than an environment/tooling error.
is_tool_shape
Whether a command shape is a reusable tool invocation (build, test, package, env sourcing), as opposed to an ad-hoc script or a one-off inspection that teaches nothing to the next drone.
looks_failed
A command can fail behind a pipe (pytest | tail exits 0), so judge by output too: tracebacks, test-runner failures, compiler errors.
normalize_error_line
Normalize one error line so incidental details don’t split fingerprints.
only_reads
True when every segment of the command just reads or lists files.