Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .aios-core/core/ideation/ideation-engine.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Backward compatibility wrapper
module.exports = require('../../../.aiox-core/core/ideation/ideation-engine');
2 changes: 2 additions & 0 deletions .aios-core/core/memory/gotchas-memory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Backward compatibility wrapper
module.exports = require('../../../.aiox-core/core/memory/gotchas-memory');
5 changes: 3 additions & 2 deletions .aiox-core/core/execution/context-injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ try {
MemoryQuery = null;
}
try {
GotchasMemory = require('../memory/gotchas-memory');
} catch {
({ GotchasMemory } = require('../memory/gotchas-memory'));
} catch (error) {
console.warn('[ContextInjector] Failed to load GotchasMemory:', error.message);
GotchasMemory = null;
}
try {
Expand Down
5 changes: 3 additions & 2 deletions .aiox-core/core/execution/subagent-dispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ try {
MemoryQuery = null;
}
try {
GotchasMemory = require('../memory/gotchas-memory');
} catch {
({ GotchasMemory } = require('../memory/gotchas-memory'));
} catch (error) {
console.warn('[SubagentDispatcher] Failed to load GotchasMemory:', error.message);
GotchasMemory = null;
}

Expand Down
5 changes: 3 additions & 2 deletions .aiox-core/core/ideation/ideation-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ const { execSync } = require('child_process');
// Import dependencies with fallbacks
let GotchasMemory;
try {
GotchasMemory = require('../memory/gotchas-memory');
} catch {
({ GotchasMemory } = require('../memory/gotchas-memory'));
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix correctly addresses the import issue in this file, but the same bug exists in two other files that also need to be fixed:

  1. .aios-core/core/execution/context-injector.js:24 - Uses GotchasMemory = require('../memory/gotchas-memory') and tries to instantiate with new GotchasMemory() on line 50
  2. .aios-core/core/execution/subagent-dispatcher.js:31 - Uses GotchasMemory = require('../memory/gotchas-memory') and tries to instantiate with new GotchasMemory() on line 99

Both files have the exact same bug where they import the entire module object instead of destructuring the GotchasMemory class, which will cause the same TypeError when instantiating. These should be fixed in the same PR to ensure consistency and prevent the same silent failure across the codebase.

Copilot uses AI. Check for mistakes.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find the ideation-engine.js file
fd -HI "ideation-engine.js"

# Check the directory structure
find .aios-core/core/ideation -type f -name "*.js" -o -name "*.ts" | head -20

Repository: SynkraAI/aios-core

Length of output: 149


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for test files related to ideation engine
fd -HI "test|spec" | grep -i ideation

# Also search for gotchas-memory tests
fd -HI "test|spec" | grep -i gotchas

Repository: SynkraAI/aios-core

Length of output: 44


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find the ideation-engine.js file and read it to understand the constructor
fd -t f "ideation-engine.js" --path "*/core/ideation/*" -x wc -l

# Then examine the file
fd -t f "ideation-engine.js" --path "*/core/ideation/*" -x cat -n

Repository: SynkraAI/aios-core

Length of output: 295


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find and read the ideation-engine.js file
cat -n .aios-core/core/ideation/ideation-engine.js

Repository: SynkraAI/aios-core

Length of output: 28750


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for test files anywhere in the repo matching ideation pattern
find . -type f \( -name "*test*.js" -o -name "*spec*.js" -o -name "*test*.ts" -o -name "*spec*.ts" \) | grep -iE "(ideation|gotchas)" | head -20

Repository: SynkraAI/aios-core

Length of output: 44


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for any test files in the ideation directory
find .aios-core/core/ideation -type f | head -20

Repository: SynkraAI/aios-core

Length of output: 105


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find all test-like files in the entire repo
find . -type f -name "*.test.js" -o -name "*.spec.js" -o -name "*.test.ts" -o -name "*.spec.ts" | head -30

Repository: SynkraAI/aios-core

Length of output: 1971


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for directory patterns that commonly contain tests
find . -type d \( -name "test" -o -name "tests" -o -name "__tests__" -o -name "spec" -o -name "specs" \) | head -20

Repository: SynkraAI/aios-core

Length of output: 403


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for any mention of IdeationEngine in the entire codebase
rg -l "IdeationEngine" --type js --type ts | head -30

Repository: SynkraAI/aios-core

Length of output: 44


🏁 Script executed:

#!/bin/bash
set -euso pipefail

# Search for gotchas-memory references
rg -l "gotchas-memory|GotchasMemory" --type js --type ts | head -30

Repository: SynkraAI/aios-core

Length of output: 346


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for test files mentioning ideation or gotchas
find . -type f \( -name "*.test.js" -o -name "*.spec.js" -o -name "*.test.ts" -o -name "*.spec.ts" \) -exec grep -l "ideation\|gotchas" {} \; 2>/dev/null | head -20

Repository: SynkraAI/aios-core

Length of output: 180


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check if there's a test directory under ideation
find . -path "*/ideation/*" -type f \( -name "*.test.js" -o -name "*.spec.js" -o -name "*test*.js" \) | head -20

Repository: SynkraAI/aios-core

Length of output: 44


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for any file that requires ideation-engine
rg "require.*ideation-engine|from.*ideation-engine" --type js --type ts | head -30

Repository: SynkraAI/aios-core

Length of output: 44


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check if gotchas-memory has its own tests
find . -path "*/memory/*" -type f -name "*.test.js" -o -name "*.spec.js" -o -name "*test*.js" 2>/dev/null | head -20

Repository: SynkraAI/aios-core

Length of output: 1301


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# List all files in the memory test directory if it exists
ls -la .aios-core/core/memory/__tests__/ 2>/dev/null || echo "Directory does not exist"

Repository: SynkraAI/aios-core

Length of output: 247


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find and read gotchas-memory.js
find . -name "gotchas-memory.js" -type f -exec cat -n {} \;

Repository: SynkraAI/aios-core

Length of output: 38907


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Look for any existing test that might test ideation-engine indirectly
rg "new IdeationEngine|ideation.*engine" --type js tests/ .aios-core/ -A 3 -B 1 | head -50

Repository: SynkraAI/aios-core

Length of output: 44


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check if ideation-engine is imported/used anywhere in the codebase
rg "IdeationEngine" --type js --type ts -l

Repository: SynkraAI/aios-core

Length of output: 44


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Look for any test that might be testing core modules or memory modules
find . -name "*.test.js" -o -name "*.spec.js" | xargs grep -l "GotchasMemory\|ideation" 2>/dev/null || echo "No tests found matching pattern"

Repository: SynkraAI/aios-core

Length of output: 140


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check test directories near ideation or memory
ls -la .aios-core/core/ideation/ 2>/dev/null || echo "No test dir in ideation"
ls -la .aios-core/core/memory/__tests__/ 2>/dev/null || echo "No tests in memory"

Repository: SynkraAI/aios-core

Length of output: 433


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Look for getAll method usage in tests since ideation-engine calls it (line 79)
rg "getAll" --type js -l | head -20

Repository: SynkraAI/aios-core

Length of output: 341


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check what's in those test files that mention GotchasMemory
cat -n ./tests/core/context-injector.test.js | head -100

Repository: SynkraAI/aios-core

Length of output: 3865


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check the other test file
cat -n ./tests/core/subagent-dispatcher.test.js | head -100

Repository: SynkraAI/aios-core

Length of output: 4239


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Final check: does IdeationEngine appear in any actual test that isn't just mocking?
rg "IdeationEngine" --type js tests/ .aios-core/ -B 2 -A 5 | head -50

Repository: SynkraAI/aios-core

Length of output: 1313


Add regression test coverage for IdeationEngine constructor's GotchasMemory initialization path.

This core framework module lacks test coverage. Per the coding guidelines for .aios-core/core/** paths, verify test coverage exists for new/modified functions. Specifically, test that new IdeationEngine({ ...without gotchasMemory... }) instantiates a GotchasMemory instance when the module loads successfully, confirming the backwards compatibility contract for agents consuming this core module.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.aios-core/core/ideation/ideation-engine.js at line 16, Add a regression
unit test that instantiates IdeationEngine without a gotchasMemory option and
asserts that the constructor creates a GotchasMemory instance; specifically, in
your test suite import/require IdeationEngine and the GotchasMemory symbol (from
core/ideation/ideation-engine.js), call new IdeationEngine({ /* omit
gotchasMemory */ }) and verify the resulting engine has a gotchasMemory property
that is an instance of GotchasMemory; place the test under the
.aios-core/core/** tests to satisfy coverage rules and include module load
success setup/mocks as needed so the constructor path runs.

} catch (error) {
console.warn('[IdeationEngine] Failed to load GotchasMemory:', error.message);
GotchasMemory = null;
}

Expand Down
Loading
Loading