Skip to content

fix(guardrails): review ListDir results without reading directories - #2001

Merged
JAORMX merged 1 commit into
mainfrom
fix/guardrail-listdir-evidence
Sep 30, 2026
Merged

JAORMX merged 1 commit into
mainfrom
fix/guardrail-listdir-evidence

Conversation

@JAORMX

@JAORMX JAORMX commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix the first narrow regression found while investigating contextual guardrail failures from #1510: ListDir was being treated as a source of supplemental text-file evidence.

The tool successfully produced a directory listing, but evidence preparation then attempted a bounded file read of the directory itself. The filesystem correctly rejected that read, setting EvidenceComplete=false. A checker returning acceptable was rejected on all three attempts; enforcing runs could then withhold an otherwise valid listing.

  • Exclude only ListDir from supplemental text-file evidence paths.
  • Continue reviewing the exact returned listing; prohibited and malformed assessments remain enforced.
  • Add real-application regression coverage and clarify listing-only review in the owning permissions guide.

Scope

Routine bug fix restoring documented behavior, delivered directly as requested. No acceptance plan, new interface, or authority change. The shared LocalFileOperands helper remains unchanged. Yolo/advisory policy, retries, evidence limits, and all other tools keep their existing behavior.

Large-file preview completeness, reviewer instruction isolation, end-to-end deadlines, and terminal failure semantics are deliberately separate increments. This PR does not claim to resolve every guardrail failure.

Verification

The regression was observed failing before the fix: three checker calls for an acceptable listing and a directory selected as file evidence. After the fix, the real Build test verifies one checker call, complete listing evidence, and delivery to the working model. Prohibited and malformed responses still produce a model-visible error without leaking the listing.

  • Focused regression tests and go test ./internal/app: passed.
  • task test: passed.
  • task docs: passed.
  • Offline demo: passed, including tool call, permission ask/approval, and final result.
  • Independent Spec, Standards, Test adequacy, Security, Architecture, Reuse, Duplication, and UX review: no findings.
  • task test:race and task site:build: passed.
  • task lint: passed with zero issues across every module. The initial outer 600-second deadline expired during root analysis; the retry completed with a longer outer budget and no code changes.

Candidate: ff425f8ec.

Documentation owner: user-docs/building/what-you-get/permissions.md. The added sentence explains what ListDir inbound review inspects; it does not add a new workflow or configuration option.

Exclude ListDir directory operands from supplemental text-file evidence while retaining inbound result review. Cover acceptable delivery and prohibited or malformed withholding through the real application composition.

Co-authored-by: Mecatl <[email protected]>
@JAORMX
JAORMX marked this pull request as ready for review September 29, 2026 14:02
@JAORMX
JAORMX merged commit 03cdfb5 into main Sep 30, 2026
70 of 72 checks passed
@JAORMX
JAORMX deleted the fix/guardrail-listdir-evidence branch September 30, 2026 05:42
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Sep 30, 2026
2 tasks

This branch was successfully deployed

1 active deployment
Preview — ff425f8e Deployed Sep 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant