Skip to content

fix(coding-agents): survey prompt says Glob, not Read, for the directory layout - #3796

Open
MasterST1337 wants to merge 1 commit into
vectorize-io:mainfrom
MasterST1337:fix/survey-prompt-glob-not-read-on-directory
Open

fix(coding-agents): survey prompt says Glob, not Read, for the directory layout#3796
MasterST1337 wants to merge 1 commit into
vectorize-io:mainfrom
MasterST1337:fix/survey-prompt-glob-not-read-on-directory

Conversation

@MasterST1337

Copy link
Copy Markdown

The cold-repo survey spawns a headless claude -p --model haiku --allowedTools Read Glob Grep session. SURVEY_PROMPT asks the model to understand "the directory layout" but never says which tool shows it, and haiku reaches for Read(<repoRoot>) — a bare directory path, which errors EISDIR before the survey has read anything.

Evidence

Measured on one machine's OTel export, 2026-08-23..25: 10 distinct survey sessions failed this way on their first tool call. The transcripts all open the same way:

"I'll survey this repository's architecture to build Hindsight memory. Let me start by sampling the structure."
Read({"file_path": "/Users/…/<repo>"}) → EISDIR

Affected repos: kids-yt-factory, hindsight, sitebrain.eu, PlanView, Meridian, plus four separate git worktrees. That is every repo the survey ran cold against — and because a fresh worktree is a fresh bank, it re-fires per worktree rather than once per project.

The change

One sentence added to SURVEY_PROMPT naming Glob for the directory layout and forbidding Read on a directory. Glob was already in --allowedTools; the model was simply never told to prefer it here.

What this is not

A prompt sentence cannot guarantee a model's tool choice. The structurally robust fix is at the tool-wiring layer — reject Read on a directory client-side, or give the survey an ls-shaped tool — which this PR does not attempt. Happy to follow up there if you would rather fix it that way.

No test pins prompt content in this package (survey.test.ts asserts against the SURVEY_PROMPT constant, not its text), so no test changed. scripts/hooks/lint.sh clean; package suite 655 passing.

…ory layout

The cold-repo survey spawns a headless `claude -p --model haiku
--allowedTools Read Glob Grep` session. SURVEY_PROMPT asks the model to
understand "the directory layout" but never says which tool shows it, and
haiku reaches for `Read(<repoRoot>)` — a bare directory path, which errors
with EISDIR before the survey has read anything.

Measured on one machine's OTel export, 2026-08-23..25: 10 distinct survey
sessions failed this way on first tool call, across kids-yt-factory,
hindsight, sitebrain.eu, PlanView, Meridian and four .traycer worktrees —
i.e. every repo the survey ran cold against, plus a fresh worktree each
time (a new worktree is a new bank, so the survey re-runs).

Glob was already in --allowedTools; the model was simply never told to
prefer it here. This is a prompt-level counter-instruction, not a
structural guarantee — the robust fix is at the tool-wiring layer (deny
Read on a directory, or give the survey an ls-shaped tool), which this
does not attempt.
@strix-security

strix-security Bot commented Aug 25, 2026

Copy link
Copy Markdown

Strix Security Review

No security issues found.

Updated for 7ab1283.


Reviewed by Strix
Re-run review · Configure security review settings

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