aiwcli 0.9.2 → 0.9.4
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.
- package/dist/templates/_shared/hooks/__pycache__/archive_plan.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/context_enforcer.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/context_monitor.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/file-suggestion.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/session_start.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/task_create_atomicity.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/task_create_capture.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/task_update_capture.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/__pycache__/user_prompt_submit.cpython-313.pyc +0 -0
- package/dist/templates/_shared/hooks/archive_plan.py +28 -38
- package/dist/templates/_shared/hooks/context_enforcer.py +6 -6
- package/dist/templates/_shared/hooks/context_monitor.py +4 -8
- package/dist/templates/_shared/hooks/file-suggestion.py +4 -10
- package/dist/templates/_shared/hooks/session_start.py +4 -9
- package/dist/templates/_shared/hooks/task_create_atomicity.py +90 -84
- package/dist/templates/_shared/hooks/task_create_capture.py +83 -146
- package/dist/templates/_shared/hooks/task_update_capture.py +116 -167
- package/dist/templates/_shared/hooks/user_prompt_submit.py +4 -9
- package/dist/templates/_shared/lib/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__pycache__/atomic_write.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__pycache__/constants.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__pycache__/hook_utils.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/__pycache__/utils.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/base/hook_utils.py +169 -0
- package/dist/templates/_shared/lib/context/__init__.py +9 -0
- package/dist/templates/_shared/lib/context/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/cache.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/context_extractor.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/context_manager.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/discovery.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/__pycache__/plan_archive.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/context/context_extractor.py +115 -0
- package/dist/templates/_shared/lib/context/discovery.py +4 -4
- package/dist/templates/_shared/lib/templates/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/templates/_shared/lib/templates/__pycache__/formatters.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/.claude/agents/cc-native/ARCHITECT-REVIEWER.md +20 -47
- package/dist/templates/cc-native/.claude/agents/cc-native/ASSUMPTION-CHAIN-TRACER.md +25 -203
- package/dist/templates/cc-native/.claude/agents/cc-native/CLARITY-AUDITOR.md +24 -75
- package/dist/templates/cc-native/.claude/agents/cc-native/COMPLETENESS-CHECKER.md +31 -76
- package/dist/templates/cc-native/.claude/agents/cc-native/DEVILS-ADVOCATE.md +25 -188
- package/dist/templates/cc-native/.claude/agents/cc-native/DOCUMENTATION-REVIEWER.md +30 -52
- package/dist/templates/cc-native/.claude/agents/cc-native/FEASIBILITY-ANALYST.md +26 -62
- package/dist/templates/cc-native/.claude/agents/cc-native/FRESH-PERSPECTIVE.md +31 -80
- package/dist/templates/cc-native/.claude/agents/cc-native/HANDOFF-READINESS.md +24 -105
- package/dist/templates/cc-native/.claude/agents/cc-native/HIDDEN-COMPLEXITY-DETECTOR.md +23 -208
- package/dist/templates/cc-native/.claude/agents/cc-native/INCENTIVE-MAPPER.md +25 -199
- package/dist/templates/cc-native/.claude/agents/cc-native/PRECEDENT-FINDER.md +35 -205
- package/dist/templates/cc-native/.claude/agents/cc-native/REVERSIBILITY-ANALYST.md +26 -176
- package/dist/templates/cc-native/.claude/agents/cc-native/RISK-ASSESSOR.md +22 -65
- package/dist/templates/cc-native/.claude/agents/cc-native/SECOND-ORDER-ANALYST.md +25 -161
- package/dist/templates/cc-native/.claude/agents/cc-native/SIMPLICITY-GUARDIAN.md +28 -58
- package/dist/templates/cc-native/.claude/agents/cc-native/SKEPTIC.md +27 -311
- package/dist/templates/cc-native/.claude/agents/cc-native/STAKEHOLDER-ADVOCATE.md +22 -73
- package/dist/templates/cc-native/_cc-native/hooks/__pycache__/add_plan_context.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/hooks/__pycache__/cc-native-plan-review.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/hooks/__pycache__/suggest-fresh-perspective.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.py +17 -3
- package/dist/templates/cc-native/_cc-native/lib/__pycache__/debug.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/debug.py +124 -0
- package/dist/templates/cc-native/_cc-native/lib/reviewers/__pycache__/agent.cpython-313.pyc +0 -0
- package/dist/templates/cc-native/_cc-native/lib/reviewers/agent.py +33 -1
- package/dist/templates/cc-native/_cc-native/plan-review.config.json +1 -1
- package/oclif.manifest.json +1 -1
- 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", "
|
|
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:
|
package/oclif.manifest.json
CHANGED