-
-
Notifications
You must be signed in to change notification settings - Fork 745
fix(ideation): corrige import named do GotchasMemory (#517) #521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
d048050
dc8b007
7bf0f65
828a4e7
9caf3fd
d15bdc9
2c5f4c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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'); |
| 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'); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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')); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 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 -20Repository: 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 gotchasRepository: 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 -nRepository: 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.jsRepository: 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 -20Repository: 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 -20Repository: 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 -30Repository: 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 -20Repository: 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 -30Repository: 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 -30Repository: 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 -20Repository: 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 -20Repository: 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 -30Repository: 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 -20Repository: 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 -50Repository: 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 -lRepository: 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 -20Repository: 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 -100Repository: 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 -100Repository: 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 -50Repository: 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 🤖 Prompt for AI Agents |
||
| } catch (error) { | ||
| console.warn('[IdeationEngine] Failed to load GotchasMemory:', error.message); | ||
| GotchasMemory = null; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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:
.aios-core/core/execution/context-injector.js:24- UsesGotchasMemory = require('../memory/gotchas-memory')and tries to instantiate withnew GotchasMemory()on line 50.aios-core/core/execution/subagent-dispatcher.js:31- UsesGotchasMemory = require('../memory/gotchas-memory')and tries to instantiate withnew GotchasMemory()on line 99Both 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.