Conversation
Oversized, unreadable, or binary regular files mark the scan incomplete so off-limits rules cannot pass on uninspected contents. Co-authored-by: Mathis <echobt@users.noreply.github.com>
Greptile SummaryHarbor artefact inspection now fails closed when regular files cannot be fully scanned. One diagnostic issue remains: unreadable and binary files are reported as file or byte limit failures, which can misdirect operators during remediation. Confidence Score: 4/5Safe to merge; the remaining issue affects the accuracy of failure diagnostics rather than the fail-closed inspection result. The reproduced issue is limited to misleading operator evidence for incomplete scans caused by non-limit conditions. Files Needing Attention: deploy/guest/runners/rlm_fc_in_guest_harbor/inspect_scan.py
What T-Rex did
|
| except OSError: | ||
| incomplete = True | ||
| continue | ||
| if size == 0: | ||
| continue | ||
| if size == 0 or size > MAX_FILE_BYTES: | ||
| if size > MAX_FILE_BYTES: | ||
| incomplete = True | ||
| continue | ||
| try: | ||
| data = path.read_bytes() | ||
| except OSError: | ||
| incomplete = True | ||
| continue | ||
| if b"\x00" in data[:1024]: | ||
| incomplete = True |
There was a problem hiding this comment.
Stat failures, read failures, and NUL-classified binary files set the same incomplete flag as file or byte limits. The later checklist evidence consequently says file/byte limit even when no limit was reached. This is a non-blocking diagnostic concern: operators investigating a rejected artefact are directed to the wrong cause, increasing time to remediate access or content problems. Retain the reason for an incomplete scan and report it in the failed off-limits evidence.
Artifacts
- The authored executable imports the repository scanner, runs a clean baseline and controlled failure branches, and asserts the resulting checklist evidence; it provides the reproducible test source.
- The baseline command scanned a harmless text file and passed both off-limits rules with clean-absence evidence, establishing the comparison behavior.
- The failure command exercised stat, read, and binary paths and showed every resulting failed rule claims a file/byte-limit condition; the evidence is misleading.
- The repository diff check completed cleanly and status showed only validation artifacts, confirming repository source was not modified.
- The Python compile command completed successfully for the inspected scanner module, confirming the executed target is syntactically valid.
Summary
Follow-up to squash-merged #267 (
5efc405d). That merge landed the original five Harbor P1s but not the later skipped-file fix.Greptile/T-Rex on #267: oversized regular files and files that raise
OSErroronstat()/read_bytes()were skipped whileincompletestayed false, sono_eval_short_circuit/no_tb4_hardcodingcould pass despite markers in those files.This PR marks the scan incomplete when a regular file is oversized, unreadable, or binary, so those off-limits rules fail closed.
Greptile
Every PR is reviewed by Greptile before merge. Config:
.greptile/.@greptileai reviewTest plan
deploy/guest/runners/rlm_fc_in_guest_harbor/tests/run.shincluding oversized / stat-failed / read-failed / binary skipped-file regressionscargo test --workspace(adaptor-only change; CI)cargo fmt --all -- --check(CI)Risk
Operators must re-bake or replace the live Harbor adaptor for inspect to change. No
BASE_*env, deployed path, or crypto domain tag changes.Naming
I did not rename
BASE_*environment variables, deployed host paths(
/opt/base,/run/base, …), GHCRbaseintelligence/basepackage names, orbase-*-v1cryptographic domain tags, unless this PR’s purpose is a coordinatedcutover documented in
docs/NAMING.md.