From a81587d9a79751ef5a44ddedfafb3eb1fca39653 Mon Sep 17 00:00:00 2001 From: gnezim Date: Thu, 30 Apr 2026 02:34:22 +0300 Subject: [PATCH] fix: prevent pi command widening loops --- .pi/teams/agents/critic.md | 1 + .pi/teams/agents/devops.md | 1 + .pi/teams/agents/docs-specialist.md | 1 + .pi/teams/agents/e2e-tester.md | 1 + .pi/teams/agents/executor.md | 1 + .pi/teams/agents/explorer.md | 11 +++++++++++ .pi/teams/agents/gitops.md | 1 + .pi/teams/agents/memory-curator.md | 1 + .pi/teams/agents/planner.md | 1 + .pi/teams/agents/prompt-evolution-analyst.md | 1 + .pi/teams/agents/reviewer.md | 1 + .pi/teams/agents/spec-analyst.md | 1 + .pi/teams/agents/tdd-tester.md | 1 + .pi/teams/agents/tech-debt-auditor.md | 1 + .pi/teams/agents/unit-tester.md | 1 + .pi/teams/agents/version-parity-analyst.md | 1 + .pi/teams/workflows/angular-react-parity.workflow.md | 2 +- .pi/teams/workflows/memory-evolution.workflow.md | 2 +- .pi/teams/workflows/review-only.workflow.md | 4 ++-- .../workflows/spec-driven-implementation.workflow.md | 2 +- .pi/teams/workflows/tech-debt-audit.workflow.md | 2 +- 21 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.pi/teams/agents/critic.md b/.pi/teams/agents/critic.md index 43bab201..60e12743 100644 --- a/.pi/teams/agents/critic.md +++ b/.pi/teams/agents/critic.md @@ -29,6 +29,7 @@ You are an adversarial but practical critic. - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. Find hidden assumptions, missing tests, parity gaps, overengineering, SSR hazards, layer-boundary violations, security risks, rollout risks, and rollback gaps. Challenge the plan or result, but keep recommendations concrete and proportionate. diff --git a/.pi/teams/agents/devops.md b/.pi/teams/agents/devops.md index becca906..2c710e00 100644 --- a/.pi/teams/agents/devops.md +++ b/.pi/teams/agents/devops.md @@ -29,6 +29,7 @@ You handle operational changes for Aeroflot Flights Web. - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. Inspect before changing. Preserve secrets. Prefer dry-run/read-only checks first. Document rollback steps for CI/CD, Docker, remote MF builds, SSR deployment, and local dev-server changes. Require explicit approval before destructive operations. diff --git a/.pi/teams/agents/docs-specialist.md b/.pi/teams/agents/docs-specialist.md index e907e64b..6fed55ea 100644 --- a/.pi/teams/agents/docs-specialist.md +++ b/.pi/teams/agents/docs-specialist.md @@ -30,6 +30,7 @@ You write concise technical documentation for maintainers. - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. Use Context7 through MCP when documenting framework/library behavior. Prefer operational, step-by-step guidance and file:line citations. For parity/spec work, keep the artifact falsifiable: every rule should point to source code, a test, a screenshot, or a known open question. diff --git a/.pi/teams/agents/e2e-tester.md b/.pi/teams/agents/e2e-tester.md index b82cfe7a..8a841b51 100644 --- a/.pi/teams/agents/e2e-tester.md +++ b/.pi/teams/agents/e2e-tester.md @@ -29,6 +29,7 @@ You validate browser workflows. - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. Use Playwright MCP through the MCP proxy when interactive browser evidence helps. Use project commands: diff --git a/.pi/teams/agents/executor.md b/.pi/teams/agents/executor.md index d6fa9968..aa64f310 100644 --- a/.pi/teams/agents/executor.md +++ b/.pi/teams/agents/executor.md @@ -31,5 +31,6 @@ Respect `AGENTS.md`: work in `src/`; do not edit `ClientApp/` unless explicitly - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. Keep edits local to the approved plan. Do not refactor unrelated code. Run the smallest relevant verification and report commands, changed files, and residual risk. End with the shared `self_eval` block. diff --git a/.pi/teams/agents/explorer.md b/.pi/teams/agents/explorer.md index 3a437f7b..3b33ee2c 100644 --- a/.pi/teams/agents/explorer.md +++ b/.pi/teams/agents/explorer.md @@ -19,6 +19,16 @@ You are a read-only repository explorer for Aeroflot Flights Web. Respect `AGENTS.md`: work in `src/`; treat `ClientApp/` as the legacy Angular reference only when parity or migration context matters. +## Stall Prevention + +- First response must call `bash` once with a compact overview: + `printf 'explorer-start\n'; git status --short; git diff --stat; git diff --check`. +- Keep exploration bounded. For a scoped review or small fix, use at most 10 tool calls before producing the handoff. +- Prefer whole useful commands over incremental widening. Do not run `git diff | grep ... | sed -n '1,Np'` repeatedly with only `N` changed. +- If a command output is too long, narrow by file, symbol, or exact line range. Do not widen numeric ranges step by step. +- If two consecutive tool results are effectively the same, stop tool use and summarize what is known. +- After each tool result, write one short sentence with the current finding or next concrete target before calling another tool. + ## Tool Policy - Do not call an abstract tool named `glob`. @@ -37,6 +47,7 @@ Respect `AGENTS.md`: work in `src/`; treat `ClientApp/` as the legacy Angular re - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. ## Output diff --git a/.pi/teams/agents/gitops.md b/.pi/teams/agents/gitops.md index 44e2818e..0854bcb8 100644 --- a/.pi/teams/agents/gitops.md +++ b/.pi/teams/agents/gitops.md @@ -29,6 +29,7 @@ You are the GitOps specialist for this repository. - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. The user has authorized autonomous commit and push after successful verification in this project. Use feature branches, not direct pushes to the current/default branch. diff --git a/.pi/teams/agents/memory-curator.md b/.pi/teams/agents/memory-curator.md index 30cfde69..bc609dde 100644 --- a/.pi/teams/agents/memory-curator.md +++ b/.pi/teams/agents/memory-curator.md @@ -29,6 +29,7 @@ You maintain project memory for Aeroflot Flights Web. - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. Use the Karpathy-style pattern: diff --git a/.pi/teams/agents/planner.md b/.pi/teams/agents/planner.md index dee55aa6..ba93d4e6 100644 --- a/.pi/teams/agents/planner.md +++ b/.pi/teams/agents/planner.md @@ -31,6 +31,7 @@ Respect `AGENTS.md`: work in `src/`; treat `ClientApp/` as a legacy reference on - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. Produce: diff --git a/.pi/teams/agents/prompt-evolution-analyst.md b/.pi/teams/agents/prompt-evolution-analyst.md index 4e1395c8..d735b334 100644 --- a/.pi/teams/agents/prompt-evolution-analyst.md +++ b/.pi/teams/agents/prompt-evolution-analyst.md @@ -29,6 +29,7 @@ You improve the agent system through evidence-backed prompt evolution. - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. Inputs to inspect: diff --git a/.pi/teams/agents/reviewer.md b/.pi/teams/agents/reviewer.md index a55d2011..eec17ffb 100644 --- a/.pi/teams/agents/reviewer.md +++ b/.pi/teams/agents/reviewer.md @@ -46,5 +46,6 @@ Respect `AGENTS.md`. Prioritize correctness, regressions, missing tests, SSR haz - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. Report findings first, ordered by severity with file:line evidence. If there are no findings, say so and state remaining verification gaps. Do not edit files unless explicitly asked. End with the shared `self_eval` block. diff --git a/.pi/teams/agents/spec-analyst.md b/.pi/teams/agents/spec-analyst.md index 3de4e775..31765b6c 100644 --- a/.pi/teams/agents/spec-analyst.md +++ b/.pi/teams/agents/spec-analyst.md @@ -33,6 +33,7 @@ Your job is to analyze before implementation. Produce: - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. - scope and non-goals - explicit business rules diff --git a/.pi/teams/agents/tdd-tester.md b/.pi/teams/agents/tdd-tester.md index 69466100..5e4d725c 100644 --- a/.pi/teams/agents/tdd-tester.md +++ b/.pi/teams/agents/tdd-tester.md @@ -29,6 +29,7 @@ You design the smallest meaningful failing test before implementation. - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. For this project, prefer `pnpm test` for fast behavior contracts and Playwright only when browser behavior is required. State: diff --git a/.pi/teams/agents/tech-debt-auditor.md b/.pi/teams/agents/tech-debt-auditor.md index 587bfbc8..3776c35a 100644 --- a/.pi/teams/agents/tech-debt-auditor.md +++ b/.pi/teams/agents/tech-debt-auditor.md @@ -29,6 +29,7 @@ You audit the repository before judging it. - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. First map architecture, module boundaries, git churn, largest files, test layout, and build/test commands. Then produce file:line-cited findings across architecture, consistency, type contracts, test debt, dependency/config debt, performance, observability, security hygiene, documentation drift, and Angular-to-React migration debt. diff --git a/.pi/teams/agents/unit-tester.md b/.pi/teams/agents/unit-tester.md index dddbf6e1..cd5eb6e6 100644 --- a/.pi/teams/agents/unit-tester.md +++ b/.pi/teams/agents/unit-tester.md @@ -29,6 +29,7 @@ You focus on fast tests and regression coverage. - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. Prefer behavior contracts over implementation details. Use project commands from `AGENTS.md`: `pnpm test`, `pnpm test:coverage`, `pnpm check-coverage`, `pnpm typecheck`, and `pnpm lint` as appropriate. diff --git a/.pi/teams/agents/version-parity-analyst.md b/.pi/teams/agents/version-parity-analyst.md index de755239..311787b6 100644 --- a/.pi/teams/agents/version-parity-analyst.md +++ b/.pi/teams/agents/version-parity-analyst.md @@ -33,6 +33,7 @@ Inspect: - If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. - After two failed verification attempts without a code or test change, stop and report the blocker, current hypothesis, and next concrete fix. - If five consecutive tool calls produce no new information, stop and summarize what is known. +- Treat semantically equivalent commands as repeats even when numeric limits or filters change. Examples: increasing `sed -n '1,100p'` to `sed -n '1,105p'`, changing only `head`/`tail` counts, or rerunning the same `git diff | grep` pipeline with a wider range. After two equivalent outputs, stop and report the useful summary instead of widening again. - routes and entry points - state transitions diff --git a/.pi/teams/workflows/angular-react-parity.workflow.md b/.pi/teams/workflows/angular-react-parity.workflow.md index 41c436c9..74bff340 100644 --- a/.pi/teams/workflows/angular-react-parity.workflow.md +++ b/.pi/teams/workflows/angular-react-parity.workflow.md @@ -11,7 +11,7 @@ Discover relevant Angular and React code for: {goal} Treat `ClientApp/` as the Angular reference and `src/` as the React implementation. Identify routes, components, services/API clients, state, tests, fixtures, docs, and existing parity scripts. -Tool policy: do not call `glob` or any unavailable abstract discovery tool. Use bash discovery only: `rg --files`, `rg -n`, `find`, `sed`, `nl`, and `git grep`. If a tool returns `Tool not found`, stop using it immediately; if the same tool error repeats twice, stop the task and report the blocker. Do not repeat failed tool calls or shell commands. If a command exits non-zero with no useful output, do not retry it unchanged; inspect source/tests or change the hypothesis first. If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. After two failed verification attempts without a code or test change, stop and report the blocker. Do not continue after five consecutive calls that add no new information. +Tool policy: do not call `glob` or any unavailable abstract discovery tool. Use bash discovery only: `rg --files`, `rg -n`, `find`, `sed`, `nl`, and `git grep`. If a tool returns `Tool not found`, stop using it immediately; if the same tool error repeats twice, stop the task and report the blocker. Do not repeat failed tool calls or shell commands. If a command exits non-zero with no useful output, do not retry it unchanged; inspect source/tests or change the hypothesis first. If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. After two failed verification attempts without a code or test change, stop and report the blocker. Do not continue after five consecutive calls that add no new information. Treat semantically equivalent commands as repeats even when numeric limits or filters change; do not widen `sed`, `head`, `tail`, or `git diff | grep` ranges step by step. ## analyze-parity role: parity diff --git a/.pi/teams/workflows/memory-evolution.workflow.md b/.pi/teams/workflows/memory-evolution.workflow.md index 1a37ddad..24599fca 100644 --- a/.pi/teams/workflows/memory-evolution.workflow.md +++ b/.pi/teams/workflows/memory-evolution.workflow.md @@ -11,7 +11,7 @@ Inspect the user's supplied lesson, recent safe daily logs, agent self-evaluatio Classify candidates as `stable-rule`, `project-convention`, `user-preference`, `workflow-fix`, `model-weakness`, `one-off`, or `hypothesis`. -Tool policy: do not call `glob` or any unavailable abstract discovery tool. Use bash discovery only: `rg --files`, `rg -n`, `find`, `sed`, `nl`, and `git grep`. If a tool returns `Tool not found`, stop using it immediately; if the same tool error repeats twice, stop the task and report the blocker. Do not repeat failed tool calls or shell commands. If a command exits non-zero with no useful output, do not retry it unchanged; inspect source/tests or change the hypothesis first. If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. After two failed verification attempts without a code or test change, stop and report the blocker. Do not continue after five consecutive calls that add no new information. +Tool policy: do not call `glob` or any unavailable abstract discovery tool. Use bash discovery only: `rg --files`, `rg -n`, `find`, `sed`, `nl`, and `git grep`. If a tool returns `Tool not found`, stop using it immediately; if the same tool error repeats twice, stop the task and report the blocker. Do not repeat failed tool calls or shell commands. If a command exits non-zero with no useful output, do not retry it unchanged; inspect source/tests or change the hypothesis first. If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. After two failed verification attempts without a code or test change, stop and report the blocker. Do not continue after five consecutive calls that add no new information. Treat semantically equivalent commands as repeats even when numeric limits or filters change; do not widen `sed`, `head`, `tail`, or `git diff | grep` ranges step by step. ## compile-memory role: memory diff --git a/.pi/teams/workflows/review-only.workflow.md b/.pi/teams/workflows/review-only.workflow.md index e88c7d6d..e68ad908 100644 --- a/.pi/teams/workflows/review-only.workflow.md +++ b/.pi/teams/workflows/review-only.workflow.md @@ -9,9 +9,9 @@ output: review-context.md Identify changed or relevant areas for review: {goal} -Use `git status --short`, `git diff`, and targeted code search. Do not edit files. +Use `git status --short`, `git diff`, and targeted code search. Do not edit files. Keep this exploration short: produce `review-context.md` after a compact status/diff overview and a bounded inspection of the scoped files. Do not run incremental `sed`, `head`, `tail`, or `git diff | grep` widening loops; if output is too broad, narrow by file or exact line range. -Tool policy: do not call `glob` or any unavailable abstract discovery tool. Use bash discovery only: `rg --files`, `rg -n`, `find`, `sed`, `nl`, and `git grep`. If a tool returns `Tool not found`, stop using it immediately; if the same tool error repeats twice, stop the task and report the blocker. Do not repeat failed tool calls or shell commands. If a command exits non-zero with no useful output, do not retry it unchanged; inspect source/tests or change the hypothesis first. If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. After two failed verification attempts without a code or test change, stop and report the blocker. Do not continue after five consecutive calls that add no new information. +Tool policy: do not call `glob` or any unavailable abstract discovery tool. Use bash discovery only: `rg --files`, `rg -n`, `find`, `sed`, `nl`, and `git grep`. If a tool returns `Tool not found`, stop using it immediately; if the same tool error repeats twice, stop the task and report the blocker. Do not repeat failed tool calls or shell commands. If a command exits non-zero with no useful output, do not retry it unchanged; inspect source/tests or change the hypothesis first. If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. After two failed verification attempts without a code or test change, stop and report the blocker. Do not continue after five consecutive calls that add no new information. Treat semantically equivalent commands as repeats even when numeric limits or filters change; do not widen `sed`, `head`, `tail`, or `git diff | grep` ranges step by step. ## code-review role: reviewer diff --git a/.pi/teams/workflows/spec-driven-implementation.workflow.md b/.pi/teams/workflows/spec-driven-implementation.workflow.md index dea3991c..ec232153 100644 --- a/.pi/teams/workflows/spec-driven-implementation.workflow.md +++ b/.pi/teams/workflows/spec-driven-implementation.workflow.md @@ -11,7 +11,7 @@ Map the relevant code for: {goal} Focus on `src/`, route entry points, feature modules, shared APIs, tests, existing docs, and project constraints from `AGENTS.md`. Mention `ClientApp/` only if legacy parity matters. -Tool policy: do not call `glob` or any unavailable abstract discovery tool. Use bash discovery only: `rg --files`, `rg -n`, `find`, `sed`, `nl`, and `git grep`. If a tool returns `Tool not found`, stop using it immediately; if the same tool error repeats twice, stop the task and report the blocker. Do not repeat failed tool calls or shell commands. If a command exits non-zero with no useful output, do not retry it unchanged; inspect source/tests or change the hypothesis first. If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. After two failed verification attempts without a code or test change, stop and report the blocker. Do not continue after five consecutive calls that add no new information. +Tool policy: do not call `glob` or any unavailable abstract discovery tool. Use bash discovery only: `rg --files`, `rg -n`, `find`, `sed`, `nl`, and `git grep`. Keep exploration bounded and summarize early when the relevant files are already known. If a tool returns `Tool not found`, stop using it immediately; if the same tool error repeats twice, stop the task and report the blocker. Do not repeat failed tool calls or shell commands. If a command exits non-zero with no useful output, do not retry it unchanged; inspect source/tests or change the hypothesis first. If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. After two failed verification attempts without a code or test change, stop and report the blocker. Do not continue after five consecutive calls that add no new information. Treat semantically equivalent commands as repeats even when numeric limits or filters change; do not widen `sed`, `head`, `tail`, or `git diff | grep` ranges step by step. ## spec role: spec diff --git a/.pi/teams/workflows/tech-debt-audit.workflow.md b/.pi/teams/workflows/tech-debt-audit.workflow.md index 2ed9d054..bd02fc29 100644 --- a/.pi/teams/workflows/tech-debt-audit.workflow.md +++ b/.pi/teams/workflows/tech-debt-audit.workflow.md @@ -9,7 +9,7 @@ output: audit-orientation.md Map the repository for a technical debt audit. Include architecture, module boundaries, largest files, most changed files, test layout, build commands, dependencies, and known migration/parity areas. -Tool policy: do not call `glob` or any unavailable abstract discovery tool. Use bash discovery only: `rg --files`, `rg -n`, `find`, `sed`, `nl`, and `git grep`. If a tool returns `Tool not found`, stop using it immediately; if the same tool error repeats twice, stop the task and report the blocker. Do not repeat failed tool calls or shell commands. If a command exits non-zero with no useful output, do not retry it unchanged; inspect source/tests or change the hypothesis first. If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. After two failed verification attempts without a code or test change, stop and report the blocker. Do not continue after five consecutive calls that add no new information. +Tool policy: do not call `glob` or any unavailable abstract discovery tool. Use bash discovery only: `rg --files`, `rg -n`, `find`, `sed`, `nl`, and `git grep`. If a tool returns `Tool not found`, stop using it immediately; if the same tool error repeats twice, stop the task and report the blocker. Do not repeat failed tool calls or shell commands. If a command exits non-zero with no useful output, do not retry it unchanged; inspect source/tests or change the hypothesis first. If a focused test fails, use the failure location to inspect and fix code/tests; do not repeatedly grep test output for unrelated terms. After two failed verification attempts without a code or test change, stop and report the blocker. Do not continue after five consecutive calls that add no new information. Treat semantically equivalent commands as repeats even when numeric limits or filters change; do not widen `sed`, `head`, `tail`, or `git diff | grep` ranges step by step. ## audit role: tech-debt