-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Bug Description
The power-steering stop hook (power_steering_checker.py) incorrectly classifies Q&A and PM/Operations sessions (e.g., those initiated via /pm-architect) as INVESTIGATION and applies development-focused checks that are irrelevant to these session types.
Affected Session Types
/pm-architectsessions (pure project management prioritization)/qasessions (Q&A, informational queries)- Any session focused on backlog triage, roadmap planning, sprint prioritization
Reproduction Steps
- Start a new session with
/pm-architectprompt - Agent reads backlogs, issues, and roadmap files (multiple Read/Grep operations, no Write/Edit of code files)
- Agent provides PM analysis/recommendations and attempts to stop
- Power-steering hook fires at stop time
Expected behavior: Hook detects PM/Operations session type and skips or reduces irrelevant development checks.
Actual behavior: Hook classifies session as INVESTIGATION (because many Read/Grep without Write/Edit = investigation indicator). Applies the following irrelevant checks:
workflow_invocation— Was a development workflow invoked? (irrelevant: PM sessions don't need dev workflows)next_steps— Were all next steps completed? (false positive: PM sessions naturally produce prioritization lists as output, not incomplete tasks)documentation_updates— Were docs updated to reflect code changes? (irrelevant: no code was changed)
Root Cause
In detect_session_type() in power_steering_checker.py:
# INVESTIGATION: Tool-based heuristics (Read/Grep without modifications)
# Catches investigation sessions that don't have explicit keywords
if self._has_investigation_indicators(read_grep_operations, write_edit_operations):
self._log("Session classified as INVESTIGATION via tool usage patterns", "INFO")
return "INVESTIGATION"The _has_investigation_indicators heuristic (read_grep_operations >= 2 and write_edit_operations == 0) correctly identifies investigation sessions but cannot distinguish them from PM/Operations sessions, which also involve reading many files without writing code.
There is no session type for PM/Operations/Planning sessions. The existing types are: SIMPLE, DEVELOPMENT, INFORMATIONAL, MAINTENANCE, INVESTIGATION.
Proposed Fix
- Add an
OPERATIONSsession type for PM, planning, backlog triage, and operations tasks. - Add PM-specific keyword detection in
detect_session_type()(keywords:prioritize,backlog,roadmap,sprint,triage,pm-architect,project management, etc.). - Check for OPERATIONS keywords before the investigation tool-usage fallback.
- Update
considerations.yamlso thatworkflow_invocation,next_steps, anddocumentation_updatesdo not apply toOPERATIONSsessions. - Add test coverage in
test_power_steering_checker.pyto verify PM sessions are classified asOPERATIONS.
Impact
- False positive blocking loops during PM sessions
- Repeated irrelevant prompts blocking legitimate PM work
- No workaround without setting
AMPLIHACK_SESSION_TYPE=INFORMATIONALenv var
Related
- This is similar to fixes for SIMPLE sessions (#see SIMPLE_TASK_KEYWORDS) and INFORMATIONAL detection
- The existing
_is_qa_session()method has a limit oftool_uses >= 2that causes PM sessions with many Read operations to not qualify as Q&A