aiwcli 0.9.2 → 0.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/templates/_shared/hooks/__pycache__/archive_plan.cpython-313.pyc +0 -0
  2. package/dist/templates/_shared/hooks/__pycache__/context_enforcer.cpython-313.pyc +0 -0
  3. package/dist/templates/_shared/hooks/__pycache__/context_monitor.cpython-313.pyc +0 -0
  4. package/dist/templates/_shared/hooks/__pycache__/file-suggestion.cpython-313.pyc +0 -0
  5. package/dist/templates/_shared/hooks/__pycache__/session_start.cpython-313.pyc +0 -0
  6. package/dist/templates/_shared/hooks/__pycache__/task_create_atomicity.cpython-313.pyc +0 -0
  7. package/dist/templates/_shared/hooks/__pycache__/task_create_capture.cpython-313.pyc +0 -0
  8. package/dist/templates/_shared/hooks/__pycache__/task_update_capture.cpython-313.pyc +0 -0
  9. package/dist/templates/_shared/hooks/__pycache__/user_prompt_submit.cpython-313.pyc +0 -0
  10. package/dist/templates/_shared/hooks/archive_plan.py +28 -38
  11. package/dist/templates/_shared/hooks/context_enforcer.py +6 -6
  12. package/dist/templates/_shared/hooks/context_monitor.py +4 -8
  13. package/dist/templates/_shared/hooks/file-suggestion.py +4 -10
  14. package/dist/templates/_shared/hooks/session_start.py +4 -9
  15. package/dist/templates/_shared/hooks/task_create_atomicity.py +90 -84
  16. package/dist/templates/_shared/hooks/task_create_capture.py +83 -146
  17. package/dist/templates/_shared/hooks/task_update_capture.py +116 -167
  18. package/dist/templates/_shared/hooks/user_prompt_submit.py +4 -9
  19. package/dist/templates/_shared/lib/__pycache__/__init__.cpython-313.pyc +0 -0
  20. package/dist/templates/_shared/lib/base/__pycache__/__init__.cpython-313.pyc +0 -0
  21. package/dist/templates/_shared/lib/base/__pycache__/atomic_write.cpython-313.pyc +0 -0
  22. package/dist/templates/_shared/lib/base/__pycache__/constants.cpython-313.pyc +0 -0
  23. package/dist/templates/_shared/lib/base/__pycache__/hook_utils.cpython-313.pyc +0 -0
  24. package/dist/templates/_shared/lib/base/__pycache__/utils.cpython-313.pyc +0 -0
  25. package/dist/templates/_shared/lib/base/hook_utils.py +169 -0
  26. package/dist/templates/_shared/lib/context/__init__.py +9 -0
  27. package/dist/templates/_shared/lib/context/__pycache__/__init__.cpython-313.pyc +0 -0
  28. package/dist/templates/_shared/lib/context/__pycache__/cache.cpython-313.pyc +0 -0
  29. package/dist/templates/_shared/lib/context/__pycache__/context_extractor.cpython-313.pyc +0 -0
  30. package/dist/templates/_shared/lib/context/__pycache__/context_manager.cpython-313.pyc +0 -0
  31. package/dist/templates/_shared/lib/context/__pycache__/discovery.cpython-313.pyc +0 -0
  32. package/dist/templates/_shared/lib/context/__pycache__/plan_archive.cpython-313.pyc +0 -0
  33. package/dist/templates/_shared/lib/context/context_extractor.py +115 -0
  34. package/dist/templates/_shared/lib/context/discovery.py +4 -4
  35. package/dist/templates/_shared/lib/templates/__pycache__/__init__.cpython-313.pyc +0 -0
  36. package/dist/templates/_shared/lib/templates/__pycache__/formatters.cpython-313.pyc +0 -0
  37. package/dist/templates/cc-native/.claude/agents/cc-native/ARCHITECT-REVIEWER.md +20 -47
  38. package/dist/templates/cc-native/.claude/agents/cc-native/ASSUMPTION-CHAIN-TRACER.md +25 -203
  39. package/dist/templates/cc-native/.claude/agents/cc-native/CLARITY-AUDITOR.md +24 -75
  40. package/dist/templates/cc-native/.claude/agents/cc-native/COMPLETENESS-CHECKER.md +31 -76
  41. package/dist/templates/cc-native/.claude/agents/cc-native/DEVILS-ADVOCATE.md +25 -188
  42. package/dist/templates/cc-native/.claude/agents/cc-native/DOCUMENTATION-REVIEWER.md +30 -52
  43. package/dist/templates/cc-native/.claude/agents/cc-native/FEASIBILITY-ANALYST.md +26 -62
  44. package/dist/templates/cc-native/.claude/agents/cc-native/FRESH-PERSPECTIVE.md +31 -80
  45. package/dist/templates/cc-native/.claude/agents/cc-native/HANDOFF-READINESS.md +24 -105
  46. package/dist/templates/cc-native/.claude/agents/cc-native/HIDDEN-COMPLEXITY-DETECTOR.md +23 -208
  47. package/dist/templates/cc-native/.claude/agents/cc-native/INCENTIVE-MAPPER.md +25 -199
  48. package/dist/templates/cc-native/.claude/agents/cc-native/PRECEDENT-FINDER.md +35 -205
  49. package/dist/templates/cc-native/.claude/agents/cc-native/REVERSIBILITY-ANALYST.md +26 -176
  50. package/dist/templates/cc-native/.claude/agents/cc-native/RISK-ASSESSOR.md +22 -65
  51. package/dist/templates/cc-native/.claude/agents/cc-native/SECOND-ORDER-ANALYST.md +25 -161
  52. package/dist/templates/cc-native/.claude/agents/cc-native/SIMPLICITY-GUARDIAN.md +28 -58
  53. package/dist/templates/cc-native/.claude/agents/cc-native/SKEPTIC.md +27 -311
  54. package/dist/templates/cc-native/.claude/agents/cc-native/STAKEHOLDER-ADVOCATE.md +22 -73
  55. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/add_plan_context.cpython-313.pyc +0 -0
  56. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/cc-native-plan-review.cpython-313.pyc +0 -0
  57. package/dist/templates/cc-native/_cc-native/hooks/__pycache__/suggest-fresh-perspective.cpython-313.pyc +0 -0
  58. package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.py +17 -3
  59. package/dist/templates/cc-native/_cc-native/lib/__pycache__/debug.cpython-313.pyc +0 -0
  60. package/dist/templates/cc-native/_cc-native/lib/debug.py +124 -0
  61. package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/agent.cpython-313.pyc +0 -0
  62. package/dist/templates/cc-native/_cc-native/lib/reviewers/agent.py +33 -1
  63. package/dist/templates/cc-native/_cc-native/plan-review.config.json +1 -1
  64. package/oclif.manifest.json +1 -1
  65. package/package.json +1 -1
@@ -16,6 +16,7 @@ _lib_dir = Path(__file__).resolve().parent.parent
16
16
  sys.path.insert(0, str(_lib_dir))
17
17
 
18
18
  from utils import ReviewerResult, eprint, parse_json_maybe, coerce_to_review
19
+ from debug import debug_log, debug_raw
19
20
  from .base import AgentConfig, AGENT_REVIEW_PROMPT_PREFIX
20
21
 
21
22
  # Import shared subprocess utilities
@@ -81,6 +82,8 @@ def run_agent_review(
81
82
  schema: Dict[str, Any],
82
83
  timeout: int,
83
84
  max_turns: int = 3,
85
+ context_path: Optional[Path] = None,
86
+ session_name: str = "unknown",
84
87
  ) -> ReviewerResult:
85
88
  """Run a single Claude Code agent to review the plan.
86
89
 
@@ -90,6 +93,8 @@ def run_agent_review(
90
93
  schema: JSON schema for the review output
91
94
  timeout: Timeout in seconds
92
95
  max_turns: Maximum agent turns
96
+ context_path: Optional path to context folder for debug logging
97
+ session_name: Session name for debug logging
93
98
 
94
99
  Returns:
95
100
  ReviewerResult with the review output
@@ -122,7 +127,7 @@ PLAN:
122
127
  "-p", # Enable print mode to read prompt from stdin
123
128
  "--agent", agent.name,
124
129
  "--model", agent.model,
125
- "--permission-mode", "bypassPermissions",
130
+ "--permission-mode", "plan",
126
131
  "--output-format", "json",
127
132
  "--max-turns", str(max_turns),
128
133
  "--json-schema", schema_json,
@@ -160,10 +165,37 @@ PLAN:
160
165
  raw = (p.stdout or "").strip()
161
166
  err = (p.stderr or "").strip()
162
167
 
168
+ # Debug logging - capture full raw output for diagnosis
169
+ if context_path:
170
+ debug_raw(context_path, session_name, f"agent:{agent.name}", "stdout", raw)
171
+ if err:
172
+ debug_raw(context_path, session_name, f"agent:{agent.name}", "stderr", err)
173
+ debug_log(context_path, session_name, f"agent:{agent.name}", "subprocess_info", {
174
+ "exit_code": p.returncode,
175
+ "stdout_len": len(raw),
176
+ "stderr_len": len(err),
177
+ "model": agent.model,
178
+ "timeout": timeout,
179
+ "max_turns": max_turns,
180
+ })
181
+
163
182
  if raw:
164
183
  eprint(f"[{agent.name}] stdout preview: {raw[:500]}")
165
184
 
166
185
  obj = _parse_claude_output(raw)
186
+
187
+ # Debug logging - capture parsed result details
188
+ if context_path:
189
+ debug_log(context_path, session_name, f"agent:{agent.name}", "parsed_result", {
190
+ "parsed_keys": list(obj.keys()) if obj else None,
191
+ "verdict": obj.get("verdict") if obj else None,
192
+ "has_summary": bool(obj.get("summary")) if obj else False,
193
+ "summary_preview": (obj.get("summary", "")[:200] + "...") if obj and obj.get("summary") and len(obj.get("summary", "")) > 200 else (obj.get("summary") if obj else None),
194
+ "issues_count": len(obj.get("issues", [])) if obj else 0,
195
+ "missing_sections_count": len(obj.get("missing_sections", [])) if obj else 0,
196
+ "questions_count": len(obj.get("questions", [])) if obj else 0,
197
+ })
198
+
167
199
  if obj:
168
200
  eprint(f"[{agent.name}] Parsed JSON successfully, verdict: {obj.get('verdict', 'N/A')}")
169
201
  else:
@@ -24,7 +24,7 @@
24
24
  "enabled": true,
25
25
  "timeout": 120,
26
26
  "blockOnFail": true,
27
- "maxTurns": 3,
27
+ "maxTurns": 2,
28
28
  "orchestrator": {
29
29
  "enabled": true,
30
30
  "model": "haiku",
@@ -401,5 +401,5 @@
401
401
  ]
402
402
  }
403
403
  },
404
- "version": "0.9.2"
404
+ "version": "0.9.5"
405
405
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aiwcli",
3
3
  "description": "AI Workflow CLI - Command-line interface for AI-powered workflows",
4
- "version": "0.9.2",
4
+ "version": "0.9.5",
5
5
  "author": "jofu-tofu",
6
6
  "bin": {
7
7
  "aiw": "./bin/run.js"