Documentation Index
Fetch the complete documentation index at: https://mintlify.com/xxyoudeadpunkxx/canon-boundary-guard-for-gpt-project/llms.txt
Use this file to discover all available pages before exploring further.
artifact_fingerprint.py creates mechanical fingerprints for files: path, existence, type, size in bytes, UTC modification time, and SHA-256 hash. Use it to anchor file identity when recording L0 sources in SESSION_STATE, or to verify that a file has not changed between sessions. The script always emits JSON — there is no human-readable output mode.
This script does not classify provenance. It only emits mechanical file identity data. Whether a fingerprint constitutes valid L0 evidence is an operator decision.
Usage
Arguments
One or more file paths to fingerprint. Accepts glob expansion from the shell. Each path is processed independently; a missing file produces a minimal entry rather than causing the entire invocation to fail.
JSON indentation level for the output array. Defaults to
2. Pass 0 to produce compact single-line JSON.Output
The script always prints a JSON array to stdout, one object per input path, in the same order as the arguments.| Field | Type | Description |
|---|---|---|
path | string | The path exactly as supplied on the command line |
exists | boolean | true if the path exists on the filesystem |
is_file | boolean | true if the path is a regular file |
is_dir | boolean | true if the path is a directory |
size_bytes | integer | File size in bytes as reported by stat |
mtime_utc | string | Last-modified time in ISO-8601 format with UTC offset (+00:00) |
sha256 | string | Full lowercase hex SHA-256 digest of the file contents. Only present when is_file is true. |
sha256 field is computed by reading the file in 1 MiB chunks to support large files without loading the entire content into memory. It is omitted for directories (is_dir: true) even when the path exists.
Missing files
If a path does not exist, its entry contains onlypath and exists: false. All other fields are omitted:
Use in provenance anchoring
SESSION_STATE last_state_hash
The sha256 value from fingerprinting a _SESSION_STATE.json file can be recorded directly as the last_state_hash field of the next state:
CANON_STATE_DELTA references basis.previous_hash, it should use the same sha256: prefixed format. This allows validate_state.py and manual inspection to confirm that no intermediate state was lost.
Source-staged extraction identity anchoring
When registering a file as an L0 source inactive_l0_sources, fingerprint the file before and after the session to detect any unintended mutations. Record the sha256 in the notes field of the source entry: