PolicyEngine / PolicyEngine/policyengine-claude

complete plugin's Write|Edit prompt hooks halt turn continuation on every non-matching edit

Open
#163 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
32
Forks
6
PR merge metrics
No merged PRs in 30d

Description

The complete plugin (3.23.0) ships three prompt-type hooks matched on Write|Edit:

  • PostToolUse "ARCHITECTURE ENFORCEMENT (Cosilico repos only)"
  • PostToolUse "MULTI-ZONE ADVISORY" (Next.js zone-app config files)
  • PreToolUse "PRE-WRITE CHECK (Cosilico repos only)"

Because they are prompt hooks with no path pre-filter, every Write/Edit in ANY repo runs an LLM evaluation, and the evaluation's "condition does not apply" verdict surfaces as PostToolUse:Edit hook stopped continuation: This is not a Next.js config file… — halting the agent's turn after each edit. In a long engineering session tonight (populace release work, dozens of edits to Python files), every single edit stopped the turn and required a manual nudge to resume. Same family as the known Cosilico .rac hook misfire.

Fix: gate each prompt hook behind a cheap command-type path guard (jq the file_path, exit 0 fast when the path is outside Cosilico repos / isn't a next.config.*), or convert the repo/path condition into the hook matcher layer, so the LLM evaluation only runs when the file could actually match. The prompt evaluations should also return an explicit allow/continue rather than a bare condition-not-met explanation.

Workaround applied locally: "complete@policyengine-claude": false in enabledPlugins.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the complete plugin's three Write/Edit prompt hooks and their matchers, especially the Next.js zone-app condition and the Cosilico repository checks. Reproduce an edit outside those conditions, then trace the command-type path guard using jq. Done means non-matching edits continue without an LLM evaluation while matching files still receive an explicit allow/continue result.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.