Skip to content

Commit 8807e52

Browse files
oalanicolasclaude
andcommitted
fix: address CodeRabbit review issues for PR #584
- ideation-engine.js: replace getAll() (non-existent) with listGotchas() and improve empty catch to log the error with context so filtering failures are no longer silently ignored - gotchas-memory.js: replace gap-based reset with true sliding window using a timestamps array; prune entries older than errorWindowMs on each trackError() call and recompute count/firstSeen from the pruned window so errorWindowMs genuinely bounds counted occurrences - condition-evaluator.js: register six workflow guidance conditions (user_wants_ai_generation, stories_remaining, epic_complete, architecture_suggests_prd_changes, po_checklist_issues, user_has_generated_ui) that are human-driven and cannot be inferred from TechStackProfile; defaulting to true preserves backwards compatibility with greenfield-ui.yaml after the fail-safe false introduced in #472 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d885f81 commit 8807e52

4 files changed

Lines changed: 40 additions & 12 deletions

File tree

.aiox-core/core/ideation/ideation-engine.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ class IdeationEngine {
7676
let filtered = suggestions;
7777
if (this.gotchasMemory) {
7878
try {
79-
const knownIssues = await this.gotchasMemory.getAll();
79+
const knownIssues = this.gotchasMemory.listGotchas();
8080
filtered = suggestions.filter((s) => !this.isKnownGotcha(s, knownIssues));
81-
} catch {
82-
// Ignore
81+
} catch (error) {
82+
console.warn('[IdeationEngine] Failed to load known gotchas for filtering:', error.message);
8383
}
8484
}
8585

.aiox-core/core/memory/gotchas-memory.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ class GotchasMemory extends EventEmitter {
253253
count: 0,
254254
firstSeen: now,
255255
lastSeen: now,
256+
timestamps: [],
256257
samples: [],
257258
errorPattern: errorData.message,
258259
category: this._detectCategory(errorData.message + ' ' + (errorData.stack || '')),
@@ -266,9 +267,25 @@ class GotchasMemory extends EventEmitter {
266267
tracking.samples = [];
267268
}
268269

269-
// Update tracking
270-
tracking.count++;
270+
// Ensure timestamps array exists for entries loaded from disk before this fix
271+
if (!Array.isArray(tracking.timestamps)) {
272+
tracking.timestamps = [];
273+
}
274+
275+
// Add current timestamp and prune occurrences outside the sliding error window.
276+
// This ensures errorWindowMs truly bounds the counted occurrences rather than
277+
// relying on inactivity gaps — the previous gap-based reset allowed stale errors
278+
// (e.g., at 0h, 20h, 40h) to keep accumulating as long as each repeat landed
279+
// just inside the gap boundary.
280+
const windowStart = now - this.options.errorWindowMs;
281+
tracking.timestamps.push(now);
282+
tracking.timestamps = tracking.timestamps.filter((ts) => ts >= windowStart);
283+
284+
// Recompute derived fields from the pruned sliding window
285+
tracking.count = tracking.timestamps.length;
286+
tracking.firstSeen = tracking.timestamps.length > 0 ? tracking.timestamps[0] : now;
271287
tracking.lastSeen = now;
288+
272289
if (tracking.samples.length < 5) {
273290
tracking.samples.push({
274291
timestamp: new Date(now).toISOString(),

.aiox-core/core/orchestration/condition-evaluator.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@ class ConditionEvaluator {
9797
// Composite conditions
9898
has_any_data_to_analyze: () =>
9999
this.profile.hasDatabase || this.profile.hasFrontend || this.profile.hasBackend,
100+
101+
// Workflow guidance conditions — human-driven, cannot be inferred from tech
102+
// stack profile. Default to true so these optional/iterative steps are not
103+
// silently skipped by the fail-safe false introduced in #472.
104+
// Each condition describes intent that the executing agent confirms at runtime.
105+
user_wants_ai_generation: () => true, // Optional AI UI generation step
106+
stories_remaining: () => true, // Repeat story cycle until agent signals done
107+
epic_complete: () => true, // Optional epic retrospective step
108+
architecture_suggests_prd_changes: () => true, // Optional PRD update after arch review
109+
po_checklist_issues: () => true, // Optional fix delegation when PO finds issues
110+
user_has_generated_ui: () => true, // Optional project-setup guidance for generated UI
100111
};
101112

102113
// Check for built-in evaluator

.aiox-core/install-manifest.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# - File types for categorization
99
#
1010
version: 5.0.3
11-
generated_at: "2026-03-11T02:07:59.305Z"
11+
generated_at: "2026-03-11T12:49:21.536Z"
1212
generator: scripts/generate-install-manifest.js
1313
file_count: 1089
1414
files:
@@ -689,9 +689,9 @@ files:
689689
type: core
690690
size: 7755
691691
- path: core/ideation/ideation-engine.js
692-
hash: sha256:0022cd3c1e9f834be277718ef7edb3378950b568a1a85e24df5ed8a55873098b
692+
hash: sha256:2ba5de0721a5496e0484a6c68c4a5657998ba509d0e0bfd8957e9c26286dd9cd
693693
type: core
694-
size: 22871
694+
size: 22961
695695
- path: core/ids/circuit-breaker.js
696696
hash: sha256:8ded35421a12a87c3de36f17ea9987c2c17d27aff1d3bd875813113de224b7f7
697697
type: core
@@ -789,9 +789,9 @@ files:
789789
type: core
790790
size: 8850
791791
- path: core/memory/gotchas-memory.js
792-
hash: sha256:f6a151445aab302116218ff044b1a379adcd9963ddd77e58cd8bc9eb13cd8597
792+
hash: sha256:5f10e5111598c23c2ec27cf945c656fd957494895981aa321a9cfe5360c1a8e8
793793
type: core
794-
size: 33294
794+
size: 34193
795795
- path: core/migration/migration-config.yaml
796796
hash: sha256:c251213b99ce86c9b15311d51a0b464b7fc25179455c4c6c107cae76cf49d1ab
797797
type: core
@@ -829,9 +829,9 @@ files:
829829
type: core
830830
size: 19293
831831
- path: core/orchestration/condition-evaluator.js
832-
hash: sha256:3beeadc14168659bfa6e86a49fa454e7c54ad55d559a09aa8deee423d068b9a4
832+
hash: sha256:a896e92c5b49ea187170d17c396ff4d239e7c355a6bc64b7a45a742959086531
833833
type: core
834-
size: 10846
834+
size: 11675
835835
- path: core/orchestration/context-manager.js
836836
hash: sha256:7bf273723a2c08cb84e670b9d4c55aacec51819b1fbd5f3b0c46c4ccfa2ec192
837837
type: core

0 commit comments

Comments
 (0)