aiwcli 0.11.0 → 0.11.1

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 (25) hide show
  1. package/dist/templates/_shared/hooks-ts/session_end.ts +4 -1
  2. package/dist/templates/_shared/lib-ts/base/git-state.ts +1 -1
  3. package/dist/templates/_shared/lib-ts/base/logger.ts +15 -18
  4. package/dist/templates/_shared/lib-ts/base/subprocess-utils.ts +18 -15
  5. package/dist/templates/_shared/lib-ts/context/plan-manager.ts +26 -30
  6. package/dist/templates/_shared/lib-ts/handoff/handoff-reader.ts +12 -13
  7. package/dist/templates/_shared/scripts/resume_handoff.ts +62 -38
  8. package/dist/templates/_shared/scripts/save_handoff.ts +24 -24
  9. package/dist/templates/_shared/scripts/status_line.ts +101 -147
  10. package/dist/templates/cc-native/_cc-native/hooks/cc-native-plan-review.ts +239 -133
  11. package/dist/templates/cc-native/_cc-native/lib-ts/aggregate-agents.ts +11 -12
  12. package/dist/templates/cc-native/_cc-native/lib-ts/artifacts.ts +139 -56
  13. package/dist/templates/cc-native/_cc-native/lib-ts/cli-output-parser.ts +22 -2
  14. package/dist/templates/cc-native/_cc-native/lib-ts/corroboration.ts +115 -0
  15. package/dist/templates/cc-native/_cc-native/lib-ts/index.ts +1 -0
  16. package/dist/templates/cc-native/_cc-native/lib-ts/json-parser.ts +7 -1
  17. package/dist/templates/cc-native/_cc-native/lib-ts/orchestrator.ts +5 -4
  18. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/agent.ts +133 -13
  19. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/codex.ts +6 -6
  20. package/dist/templates/cc-native/_cc-native/lib-ts/reviewers/gemini.ts +5 -4
  21. package/dist/templates/cc-native/_cc-native/lib-ts/state.ts +30 -33
  22. package/dist/templates/cc-native/_cc-native/lib-ts/types.ts +118 -43
  23. package/dist/templates/cc-native/_cc-native/plan-review.config.json +21 -0
  24. package/oclif.manifest.json +1 -1
  25. package/package.json +2 -2
@@ -12,71 +12,107 @@ export type { ContextState, HookInput, HookOutput } from "../../_shared/lib-ts/t
12
12
  // ---------------------------------------------------------------------------
13
13
 
14
14
  /** Verdict from a single reviewer */
15
- export type Verdict = "error" | "fail" | "pass" | "skip" | "warn";
15
+ export type Verdict = "pass" | "warn" | "fail" | "error" | "skip";
16
16
 
17
17
  /** Decision after aggregating all verdicts */
18
18
  export type ReviewDecision = "allow" | "deny";
19
19
 
20
20
  /** Complexity level assigned by orchestrator */
21
- export type ComplexityCategory = "high" | "medium" | "simple";
21
+ export type ComplexityCategory = "simple" | "medium" | "high";
22
22
 
23
23
  // ---------------------------------------------------------------------------
24
24
  // Review Data Structures
25
25
  // ---------------------------------------------------------------------------
26
26
 
27
+ /** Dimension classification for corroboration-based verdict */
28
+ export type IssueDimension =
29
+ | "completeness"
30
+ | "simplicity"
31
+ | "security"
32
+ | "performance"
33
+ | "reliability"
34
+ | "maintainability"
35
+ | "testability"
36
+ | "scope"
37
+ | "feasibility"
38
+ | "clarity";
39
+
27
40
  /** A single issue found during review */
28
41
  export interface ReviewIssue {
42
+ severity: "high" | "medium" | "low";
29
43
  category: string;
30
44
  issue: string;
31
- severity: "high" | "low" | "medium";
32
45
  suggested_fix: string;
46
+ dimension?: IssueDimension;
47
+ }
48
+
49
+ /** A group of issues in one dimension, classified as blocking or solo */
50
+ export interface DimensionGroup {
51
+ dimension: IssueDimension;
52
+ issues: Array<{ agent: string; issue: ReviewIssue }>;
53
+ agentCount: number;
54
+ threshold: number; // 2 × agentCount
55
+ }
56
+
57
+ /** Corroborated (blocking) group — threshold exceeded */
58
+ export type CorroboratedGroup = DimensionGroup;
59
+
60
+ /** Solo finding — below threshold, informational only */
61
+ export type SoloFinding = DimensionGroup;
62
+
63
+ /** Result of corroboration-based verdict computation */
64
+ export interface CorroborationResult {
65
+ blocking: CorroboratedGroup[];
66
+ solo: SoloFinding[];
67
+ unclassified: Array<{ agent: string; issue: ReviewIssue }>;
68
+ verdict: "pass" | "fail";
33
69
  }
34
70
 
35
71
  /** Normalized review data from any reviewer */
36
72
  export interface ReviewData {
73
+ verdict: Verdict;
74
+ summary: string;
75
+ summary_source: "reviewer" | "default";
37
76
  issues: ReviewIssue[];
38
77
  missing_sections: string[];
39
78
  questions: string[];
40
- summary: string;
41
- summary_source: "default" | "reviewer";
42
- verdict: Verdict;
43
79
  }
44
80
 
45
81
  /** Result from a single plan reviewer (Codex, Gemini, or Claude agent) */
46
82
  export interface ReviewerResult {
47
- data: Record<string, unknown>;
48
- err: string;
49
83
  name: string;
50
84
  ok: boolean;
51
- raw: string;
52
85
  verdict: Verdict;
86
+ data: Record<string, unknown>;
87
+ raw: string;
88
+ err: string;
53
89
  }
54
90
 
55
91
  /** Result from the plan orchestrator */
56
92
  export interface OrchestratorResult {
57
- category: string;
58
93
  complexity: ComplexityCategory;
59
- error?: string;
60
- reasoning: string;
94
+ category: string;
61
95
  selected_agents: string[];
96
+ reasoning: string;
62
97
  skip_reason?: string;
98
+ error?: string;
63
99
  }
64
100
 
65
101
  /** Combined result from all review phases */
66
102
  export interface CombinedReviewResult {
67
- agents: Record<string, ReviewerResult>;
68
- cli_reviewers: Record<string, ReviewerResult>;
69
- orchestration: null | OrchestratorResult;
70
- overall_verdict: Verdict;
71
103
  plan_hash: string;
104
+ overall_verdict: Verdict;
105
+ cli_reviewers: Record<string, ReviewerResult>;
106
+ orchestration: OrchestratorResult | null;
107
+ agents: Record<string, ReviewerResult>;
72
108
  timestamp: string;
73
109
  }
74
110
 
75
111
  /** Result from verdict aggregation */
76
112
  export interface ReviewDecisionResult {
113
+ should_deny: boolean;
77
114
  reason: string; // "fail_veto" | "acceptable" | "no_signal"
78
115
  score: number;
79
- should_deny: boolean;
80
116
  }
81
117
 
82
118
  // ---------------------------------------------------------------------------
@@ -85,12 +121,13 @@ export interface ReviewDecisionResult {
85
121
 
86
122
  /** Configuration for a Claude Code review agent */
87
123
  export interface AgentConfig {
124
+ name: string;
125
+ model: string;
126
+ provider: string; // e.g. "claude" | "codex" — assigned at runtime by assignModelsToAgents()
127
+ focus: string;
128
+ enabled: boolean;
88
129
  categories: string[];
89
130
  description: string;
90
- enabled: boolean;
91
- focus: string;
92
- model: string;
93
- name: string;
94
131
  system_prompt: string; // Markdown body content for --system-prompt
95
132
  }
96
133
 
@@ -101,6 +138,17 @@ export interface OrchestratorConfig {
101
138
  timeout: number;
102
139
  }
103
140
 
141
+ /** Configuration for a model provider (Claude, Codex, etc.) */
142
+ export interface ProviderConfig {
143
+ enabled: boolean;
144
+ models: string[];
145
+ }
146
+
147
+ /** Model provider pool configuration */
148
+ export interface ModelsConfig {
149
+ providers: Record<string, ProviderConfig>;
150
+ }
151
+
104
152
  // ---------------------------------------------------------------------------
105
153
  // State Interfaces
106
154
  // ---------------------------------------------------------------------------
@@ -108,37 +156,40 @@ export interface OrchestratorConfig {
108
156
  /** A single iteration history entry */
109
157
  export interface IterationEntry {
110
158
  hash: string;
111
- timestamp: string;
112
159
  verdict: string;
160
+ timestamp: string;
113
161
  }
114
162
 
115
163
  /** Iteration tracking state (stored adjacent to plan file) */
116
164
  export interface IterationState {
117
- complexity: string;
118
165
  current: number;
119
- graduated: string[];
120
- history: IterationEntry[];
121
166
  max: number;
167
+ complexity: string;
168
+ history: IterationEntry[];
169
+ graduated: string[];
170
+ passStreaks: Record<string, number>;
171
+ lastPlanHash: string;
122
172
  }
123
173
 
124
174
  /** CC-native state stored in context state.json under cc_native key */
125
175
  export interface CcNativeState {
126
- [key: string]: unknown;
127
176
  plan_review?: PlanReviewState;
128
177
  questions_asked?: QuestionsAskedState;
178
+ stuck_detection?: StuckDetectionState;
179
+ [key: string]: unknown;
129
180
  }
130
181
 
131
182
  /** Plan review state within cc_native */
132
183
  export interface PlanReviewState {
184
+ plan_hash: string;
185
+ reviewed_at: string;
133
186
  decision: string;
134
187
  iteration?: {
135
- complexity: string;
136
188
  current: number;
137
- latest_verdict?: string;
138
189
  max: number;
190
+ complexity: string;
191
+ latest_verdict?: string;
139
192
  };
140
- plan_hash: string;
141
- reviewed_at: string;
142
193
  }
143
194
 
144
195
  /** Questions-asked tracking state */
@@ -147,6 +198,15 @@ export interface QuestionsAskedState {
147
198
  asked_at: string;
148
199
  }
149
200
 
201
+ /** Stuck detection state — tracks repeated errors, file edits, and test failures */
202
+ export interface StuckDetectionState {
203
+ error_hashes: Record<string, number>;
204
+ file_edits: Record<string, number>;
205
+ test_failures: number;
206
+ tool_calls_since_suggestion: number;
207
+ suggestion_count: number;
208
+ }
209
+
150
210
  // ---------------------------------------------------------------------------
151
211
  // Configuration
152
212
  // ---------------------------------------------------------------------------
@@ -160,25 +220,25 @@ export interface DisplaySettings {
160
220
 
161
221
  /** Full plan review configuration (from plan-review.config.json) */
162
222
  export interface PlanReviewConfig {
163
- [key: string]: unknown;
164
- display?: Partial<DisplaySettings>;
165
223
  planReview?: {
224
+ enabled?: boolean;
225
+ reviewers?: {
226
+ codex?: { enabled?: boolean; timeout?: number; model?: string };
227
+ gemini?: { enabled?: boolean; timeout?: number; model?: string };
228
+ };
166
229
  agentReview?: {
167
- agentSelection?: Record<string, unknown>;
168
- complexityCategories?: string[];
169
230
  enabled?: boolean;
170
- orchestrator?: { enabled?: boolean; model?: string; timeout?: number };
171
231
  timeout?: number;
232
+ orchestrator?: { enabled?: boolean; model?: string; timeout?: number };
233
+ agentSelection?: Record<string, unknown>;
234
+ complexityCategories?: string[];
172
235
  };
173
236
  display?: Partial<DisplaySettings>;
174
- earlyExitOnAllPass?: boolean;
175
- enabled?: boolean;
176
- reviewers?: {
177
- codex?: { enabled?: boolean; model?: string; timeout?: number; };
178
- gemini?: { enabled?: boolean; model?: string; timeout?: number; };
179
- };
180
237
  reviewIterations?: Record<string, number>;
238
+ earlyExitOnAllPass?: boolean;
181
239
  };
240
+ display?: Partial<DisplaySettings>;
241
+ [key: string]: unknown;
182
242
  }
183
243
 
184
244
  // ---------------------------------------------------------------------------
@@ -187,9 +247,9 @@ export interface PlanReviewConfig {
187
247
 
188
248
  /** Options passed to reviewer implementations */
189
249
  export interface ReviewOptions {
250
+ timeout: number;
190
251
  context_path?: string;
191
252
  session_name?: string;
192
- timeout: number;
193
253
  }
194
254
 
195
255
  /** Interface all reviewers must implement */
@@ -220,6 +280,14 @@ export const REVIEW_SCHEMA: Record<string, unknown> = {
220
280
  category: { type: "string" },
221
281
  issue: { type: "string" },
222
282
  suggested_fix: { type: "string" },
283
+ dimension: {
284
+ type: "string",
285
+ enum: [
286
+ "completeness", "simplicity", "security", "performance",
287
+ "reliability", "maintainability", "testability", "scope",
288
+ "feasibility", "clarity",
289
+ ],
290
+ },
223
291
  },
224
292
  required: ["severity", "category", "issue", "suggested_fix"],
225
293
  additionalProperties: false,
@@ -283,7 +351,13 @@ Call StructuredOutput with:
283
351
  - **verdict**: "pass" (no concerns), "warn" (some concerns), or "fail" (critical issues)
284
352
  - **summary**: 2-3 sentences with your overall assessment and key findings (REQUIRED)
285
353
  - **issues**: Array of concerns found. Format each as:
286
- {"severity": "high/medium/low", "category": "...", "issue": "...", "suggested_fix": "..."}
354
+ {"severity": "high/medium/low", "category": "...", "issue": "...", "suggested_fix": "...", "dimension": "..."}
355
+ - **dimension**: Classify each issue into exactly one dimension:
356
+ completeness, simplicity, security, performance, reliability,
357
+ maintainability, testability, scope, feasibility, or clarity.
358
+ Examples: "missing error handling" → reliability, "excessive abstraction" → simplicity,
359
+ "no test strategy" → testability, "missing deployment steps" → completeness,
360
+ "unclear interaction between components" → clarity.
287
361
  - **missing_sections**: Topics the plan should address but doesn't
288
362
  - **questions**: Things that need clarification before implementation
289
363
 
@@ -292,6 +366,7 @@ Call StructuredOutput with:
292
366
  2. Summary MUST explain your reasoning, not just "looks good" or empty
293
367
  3. Focus on your expertise area (architecture, security, performance, etc.)
294
368
  4. Output StructuredOutput NOW - no other tools, no questions, no delays
369
+ 5. Return ONLY your top 3 most critical issues. Prioritize high-severity over medium/low. Quality over quantity.
295
370
  `;
296
371
 
297
372
  // ---------------------------------------------------------------------------
@@ -1,4 +1,16 @@
1
1
  {
2
+ "models": {
3
+ "providers": {
4
+ "claude": {
5
+ "enabled": true,
6
+ "models": ["sonnet"]
7
+ },
8
+ "codex": {
9
+ "enabled": true,
10
+ "models": ["gpt-5.1-codex-mini"]
11
+ }
12
+ }
13
+ },
2
14
  "planReview": {
3
15
  "enabled": true,
4
16
  "reviewers": {
@@ -23,6 +35,7 @@
23
35
  "enabled": true,
24
36
  "timeout": 180,
25
37
  "warnThreshold": 0.01,
38
+ "maxIssuesPerAgent": 3,
26
39
  "orchestrator": {
27
40
  "enabled": true,
28
41
  "model": "opus",
@@ -71,5 +84,13 @@
71
84
  "planContext": {
72
85
  "enabled": true,
73
86
  "offerClarifyingQuestions": true
87
+ },
88
+ "stuckDetection": {
89
+ "enabled": true,
90
+ "errorThreshold": 3,
91
+ "fileEditThreshold": 4,
92
+ "testFailureThreshold": 3,
93
+ "cooldown": 10,
94
+ "maxSuggestions": 3
74
95
  }
75
96
  }
@@ -416,5 +416,5 @@
416
416
  ]
417
417
  }
418
418
  },
419
- "version": "0.11.0"
419
+ "version": "0.11.1"
420
420
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "aiwcli",
3
3
  "description": "AI Workflow CLI - Command-line interface for AI-powered workflows",
4
- "version": "0.11.0",
4
+ "version": "0.11.1",
5
5
  "author": "jofu-tofu",
6
6
  "bin": {
7
- "aiw": "./bin/run.js"
7
+ "aiw": "bin/run.js"
8
8
  },
9
9
  "bugs": {
10
10
  "url": "https://github.com/jofu-tofu/AI-Workflow-CLI/issues"