From e3bec7fde306cb79dec2fa55676feb6b445fafc6 Mon Sep 17 00:00:00 2001 From: fullsend-code Date: Fri, 5 Jun 2026 12:26:36 +0000 Subject: [PATCH] fix(#1939): add prominent protected-paths section to fix agent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fix agent's prohibition against modifying .claude/ and other governance files was buried in a general constraints bullet list. Despite the existing constraint, the agent incidentally modified .claude/settings.json during an unrelated rebase task, causing post-fix.sh to discard all legitimate code work. Add a dedicated "Protected paths — do not modify" section placed before Constraints for high visibility. The section: - Lists all paths matching post-fix.sh's PROTECTED_PATHS array - Adds .cursor/ (editor agent config, not previously covered) - Explains the consequence: post-fix.sh discards ALL work - Allows a human /fs-fix override for explicit requests The existing constraint bullet now cross-references the new section instead of inlining the path list. Closes #1939 Signed-off-by: fullsend-code --- internal/scaffold/fullsend-repo/agents/fix.md | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/internal/scaffold/fullsend-repo/agents/fix.md b/internal/scaffold/fullsend-repo/agents/fix.md index dacc5775e8..24b07ad1b8 100644 --- a/internal/scaffold/fullsend-repo/agents/fix.md +++ b/internal/scaffold/fullsend-repo/agents/fix.md @@ -90,6 +90,34 @@ bot feedback — but still verify against the code. A human instruction to "revert the change to function X" should be verified: does the function exist? Was it actually changed? +## Protected paths — do not modify + +Never modify files under any of the following paths, even if they appear in +merge conflicts, linter suggestions, or other incidental context: + +- `.claude/` — agent settings and configuration +- `.cursor/` — editor agent configuration +- `agents/` — agent definitions +- `harness/` — harness definitions +- `plugins/` — plugin definitions +- `policies/` — sandbox policies +- `scripts/` — pre/post scripts +- `api-servers/` — API server configurations +- `.github/workflows/` — CI configuration +- `CODEOWNERS` +- `.pre-commit-config.yaml` +- `.gitattributes` + +These are governance and infrastructure files. The `post-fix.sh` safety +script blocks commits that touch them, discarding **all** of your work — +including legitimate code fixes. Modifying these paths wastes the entire +run. + +The only exception is when a human `/fs-fix` instruction **explicitly** asks +you to modify a specific protected path. Even then, the post-script may +still block the change — but following a direct human instruction is +acceptable. + ## Constraints - Keep changes minimal. Every line in your diff must be traceable to a specific @@ -103,10 +131,8 @@ Was it actually changed? files you explicitly created or modified. - You cannot use `sed`, `awk`, or other stream editors to modify source files. Use the `Write` tool for all file edits. -- You cannot modify CODEOWNERS files, CI configuration in `.github/workflows/`, - agent configuration in `.claude/` or `agents/`, harness definitions in - `harness/`, sandbox policies in `policies/`, pre/post scripts in `scripts/`, - or API server configurations in `api-servers/`. +- You cannot modify protected-path files (see "Protected paths" above) unless + a human `/fs-fix` instruction explicitly asks you to. - Always create a **new commit**. Never amend an existing commit. - If a review finding suggests a change that is out of scope for this PR (e.g., a refactoring suggestion unrelated to the PR's purpose), record it