aios-core 4.3.0 → 4.4.0
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/.aios-core/core/code-intel/code-intel-client.js +19 -5
- package/.aios-core/core/code-intel/hook-runtime.js +186 -0
- package/.aios-core/core/code-intel/index.js +2 -0
- package/.aios-core/core/code-intel/providers/code-graph-provider.js +8 -0
- package/.aios-core/core/code-intel/providers/provider-interface.js +9 -0
- package/.aios-core/core/code-intel/providers/registry-provider.js +515 -0
- package/.aios-core/core/doctor/checks/code-intel.js +95 -21
- package/.aios-core/core/doctor/checks/hooks-claude-count.js +15 -4
- package/.aios-core/core/doctor/checks/ide-sync.js +24 -7
- package/.aios-core/core/synapse/memory/memory-bridge.js +17 -43
- package/.aios-core/core/synapse/memory/synapse-memory-provider.js +201 -0
- package/.aios-core/data/entity-registry.yaml +836 -812
- package/.aios-core/data/workflow-chains.yaml +156 -0
- package/.aios-core/development/agents/aios-master.md +17 -10
- package/.aios-core/development/agents/analyst.md +17 -10
- package/.aios-core/development/agents/architect.md +17 -10
- package/.aios-core/development/agents/data-engineer.md +17 -10
- package/.aios-core/development/agents/dev.md +17 -10
- package/.aios-core/development/agents/devops.md +22 -10
- package/.aios-core/development/agents/pm.md +17 -10
- package/.aios-core/development/agents/po.md +17 -10
- package/.aios-core/development/agents/qa.md +17 -10
- package/.aios-core/development/agents/sm.md +17 -10
- package/.aios-core/development/agents/squad-creator.md +18 -9
- package/.aios-core/development/agents/ux-design-expert.md +16 -9
- package/.aios-core/development/tasks/apply-qa-fixes.md +7 -0
- package/.aios-core/development/tasks/architect-analyze-impact.md +8 -1
- package/.aios-core/development/tasks/brownfield-create-story.md +7 -0
- package/.aios-core/development/tasks/build-autonomous.md +7 -0
- package/.aios-core/development/tasks/create-deep-research-prompt.md +7 -0
- package/.aios-core/development/tasks/create-next-story.md +7 -0
- package/.aios-core/development/tasks/create-suite.md +7 -0
- package/.aios-core/development/tasks/dev-develop-story.md +8 -0
- package/.aios-core/development/tasks/execute-checklist.md +7 -0
- package/.aios-core/development/tasks/github-devops-github-pr-automation.md +7 -0
- package/.aios-core/development/tasks/github-devops-pre-push-quality-gate.md +7 -0
- package/.aios-core/development/tasks/po-close-story.md +7 -0
- package/.aios-core/development/tasks/qa-create-fix-request.md +7 -0
- package/.aios-core/development/tasks/qa-fix-issues.md +7 -0
- package/.aios-core/development/tasks/qa-gate.md +8 -0
- package/.aios-core/development/tasks/qa-review-story.md +8 -0
- package/.aios-core/development/tasks/release-management.md +7 -0
- package/.aios-core/development/tasks/spec-critique.md +8 -0
- package/.aios-core/development/tasks/spec-gather-requirements.md +7 -0
- package/.aios-core/development/tasks/spec-write-spec.md +5 -0
- package/.aios-core/development/tasks/validate-next-story.md +7 -0
- package/.aios-core/install-manifest.yaml +105 -89
- package/.aios-core/product/templates/ide-rules/claude-rules.md +48 -0
- package/package.json +1 -1
- package/packages/installer/src/config/templates/core-config-template.js +25 -0
- package/packages/installer/src/wizard/ide-config-generator.js +24 -3
- package/packages/installer/tests/unit/artifact-copy-pipeline/artifact-copy-pipeline.test.js +15 -5
- package/packages/installer/tests/unit/claude-md-template-v5/claude-md-template-v5.test.js +3 -3
- package/packages/installer/tests/unit/doctor/doctor-checks.test.js +68 -9
|
@@ -35,14 +35,31 @@ async function run(context) {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
let sourceAgents, ideFiles;
|
|
39
|
+
try {
|
|
40
|
+
sourceAgents = fs.readdirSync(agentsSourceDir)
|
|
41
|
+
.filter((f) => f.endsWith('.md'))
|
|
42
|
+
.map((f) => f.replace('.md', ''));
|
|
43
|
+
} catch (_err) {
|
|
44
|
+
return {
|
|
45
|
+
check: name,
|
|
46
|
+
status: 'FAIL',
|
|
47
|
+
message: 'Cannot read source agents directory',
|
|
48
|
+
fixCommand: 'npx aios-core install --force',
|
|
49
|
+
};
|
|
50
|
+
}
|
|
43
51
|
|
|
44
|
-
|
|
45
|
-
|
|
52
|
+
try {
|
|
53
|
+
ideFiles = fs.readdirSync(agentsIdeDir)
|
|
54
|
+
.filter((f) => f.endsWith('.md'));
|
|
55
|
+
} catch (_err) {
|
|
56
|
+
return {
|
|
57
|
+
check: name,
|
|
58
|
+
status: 'WARN',
|
|
59
|
+
message: 'Cannot read IDE agents directory',
|
|
60
|
+
fixCommand: 'npx aios-core install --force',
|
|
61
|
+
};
|
|
62
|
+
}
|
|
46
63
|
|
|
47
64
|
const ideAgents = ideFiles.map((f) => f.replace('.md', ''));
|
|
48
65
|
const sourceCount = sourceAgents.length;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Memory Bridge —
|
|
2
|
+
* Memory Bridge — MIS consumer for SYNAPSE engine.
|
|
3
3
|
*
|
|
4
4
|
* Connects SynapseEngine to the Memory Intelligence System (MIS)
|
|
5
|
-
* via
|
|
5
|
+
* via SynapseMemoryProvider. Implements bracket-aware retrieval with
|
|
6
6
|
* agent-scoped sector filtering and token budget enforcement.
|
|
7
7
|
*
|
|
8
8
|
* Consumer-only: reads from MIS APIs, never modifies memory stores.
|
|
9
|
-
* Graceful no-op when
|
|
9
|
+
* Graceful no-op when MIS module is not installed.
|
|
10
10
|
*
|
|
11
11
|
* @module core/synapse/memory/memory-bridge
|
|
12
|
-
* @version
|
|
12
|
+
* @version 2.0.0
|
|
13
13
|
* @created Story SYN-10 - Pro Memory Bridge (Feature-Gated MIS Consumer)
|
|
14
|
+
* @migrated Story INS-4.11 - Removed pro feature gate (AC9)
|
|
14
15
|
*/
|
|
15
16
|
|
|
16
17
|
'use strict';
|
|
@@ -39,15 +40,15 @@ const BRACKET_LAYER_MAP = {
|
|
|
39
40
|
const DEFAULT_SECTORS = ['semantic'];
|
|
40
41
|
|
|
41
42
|
/**
|
|
42
|
-
* MemoryBridge —
|
|
43
|
+
* MemoryBridge — MIS consumer for SYNAPSE engine.
|
|
43
44
|
*
|
|
44
45
|
* Provides bracket-aware memory retrieval with:
|
|
45
|
-
* - Feature gate check (sync, <1ms)
|
|
46
46
|
* - Agent-scoped sector filtering
|
|
47
47
|
* - Token budget enforcement
|
|
48
48
|
* - Session-level caching
|
|
49
49
|
* - Timeout protection (<15ms)
|
|
50
50
|
* - Error catch-all with warn-and-proceed
|
|
51
|
+
* - Graceful no-op when MIS module is not installed
|
|
51
52
|
*/
|
|
52
53
|
class MemoryBridge {
|
|
53
54
|
/**
|
|
@@ -57,32 +58,12 @@ class MemoryBridge {
|
|
|
57
58
|
constructor(options = {}) {
|
|
58
59
|
this._timeout = options.timeout || BRIDGE_TIMEOUT_MS;
|
|
59
60
|
this._provider = null;
|
|
60
|
-
this._featureGate = null;
|
|
61
61
|
this._initialized = false;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
* Lazy-load
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* @private
|
|
69
|
-
*/
|
|
70
|
-
_init() {
|
|
71
|
-
if (this._initialized) return;
|
|
72
|
-
this._initialized = true;
|
|
73
|
-
|
|
74
|
-
try {
|
|
75
|
-
const { featureGate } = require('../../../../pro/license/feature-gate');
|
|
76
|
-
this._featureGate = featureGate;
|
|
77
|
-
} catch {
|
|
78
|
-
// Pro not installed — feature gate unavailable
|
|
79
|
-
this._featureGate = null;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Lazy-load the SynapseMemoryProvider (pro).
|
|
85
|
-
* Only loaded when feature gate confirms availability.
|
|
65
|
+
* Lazy-load the SynapseMemoryProvider (open-source).
|
|
66
|
+
* Gracefully returns null if MIS dependencies are not available.
|
|
86
67
|
*
|
|
87
68
|
* @private
|
|
88
69
|
* @returns {object|null} Provider instance or null
|
|
@@ -91,11 +72,11 @@ class MemoryBridge {
|
|
|
91
72
|
if (this._provider) return this._provider;
|
|
92
73
|
|
|
93
74
|
try {
|
|
94
|
-
const { SynapseMemoryProvider } = require('
|
|
75
|
+
const { SynapseMemoryProvider } = require('./synapse-memory-provider');
|
|
95
76
|
this._provider = new SynapseMemoryProvider();
|
|
96
77
|
return this._provider;
|
|
97
78
|
} catch {
|
|
98
|
-
// Provider not available
|
|
79
|
+
// Provider or MIS not available — graceful degradation
|
|
99
80
|
return null;
|
|
100
81
|
}
|
|
101
82
|
}
|
|
@@ -105,7 +86,7 @@ class MemoryBridge {
|
|
|
105
86
|
*
|
|
106
87
|
* Returns an array of memory hint objects suitable for injection
|
|
107
88
|
* into the SYNAPSE pipeline. Gracefully returns [] when:
|
|
108
|
-
* -
|
|
89
|
+
* - MIS module is not installed
|
|
109
90
|
* - Bracket is FRESH (no memory needed)
|
|
110
91
|
* - Provider fails or times out
|
|
111
92
|
* - Any error occurs
|
|
@@ -117,19 +98,13 @@ class MemoryBridge {
|
|
|
117
98
|
*/
|
|
118
99
|
async getMemoryHints(agentId, bracket, tokenBudget) {
|
|
119
100
|
try {
|
|
120
|
-
// 1.
|
|
121
|
-
this._init();
|
|
122
|
-
if (!this._featureGate || !this._featureGate.isAvailable('pro.memory.synapse')) {
|
|
123
|
-
return [];
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// 2. Bracket check — FRESH needs no memory
|
|
101
|
+
// 1. Bracket check — FRESH needs no memory
|
|
127
102
|
const bracketConfig = BRACKET_LAYER_MAP[bracket];
|
|
128
103
|
if (!bracketConfig || bracketConfig.layer === 0) {
|
|
129
104
|
return [];
|
|
130
105
|
}
|
|
131
106
|
|
|
132
|
-
//
|
|
107
|
+
// 2. Calculate effective token budget
|
|
133
108
|
const effectiveBudget = Math.min(
|
|
134
109
|
bracketConfig.maxTokens,
|
|
135
110
|
tokenBudget > 0 ? tokenBudget : bracketConfig.maxTokens,
|
|
@@ -139,19 +114,19 @@ class MemoryBridge {
|
|
|
139
114
|
return [];
|
|
140
115
|
}
|
|
141
116
|
|
|
142
|
-
//
|
|
117
|
+
// 3. Load provider
|
|
143
118
|
const provider = this._getProvider();
|
|
144
119
|
if (!provider) {
|
|
145
120
|
return [];
|
|
146
121
|
}
|
|
147
122
|
|
|
148
|
-
//
|
|
123
|
+
// 4. Execute with timeout protection
|
|
149
124
|
const hints = await this._executeWithTimeout(
|
|
150
125
|
() => provider.getMemories(agentId, bracket, effectiveBudget),
|
|
151
126
|
this._timeout,
|
|
152
127
|
);
|
|
153
128
|
|
|
154
|
-
//
|
|
129
|
+
// 5. Enforce token budget on results
|
|
155
130
|
return this._enforceTokenBudget(hints || [], effectiveBudget);
|
|
156
131
|
} catch (error) {
|
|
157
132
|
// Catch-all: warn and proceed with empty results
|
|
@@ -233,7 +208,6 @@ class MemoryBridge {
|
|
|
233
208
|
*/
|
|
234
209
|
_reset() {
|
|
235
210
|
this._provider = null;
|
|
236
|
-
this._featureGate = null;
|
|
237
211
|
this._initialized = false;
|
|
238
212
|
}
|
|
239
213
|
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Synapse Memory Provider — MIS retrieval for SYNAPSE engine.
|
|
3
|
+
*
|
|
4
|
+
* Implements the provider interface consumed by MemoryBridge.
|
|
5
|
+
* Open-source: no feature gate required.
|
|
6
|
+
*
|
|
7
|
+
* Responsibilities:
|
|
8
|
+
* - Agent-scoped memory retrieval using AGENT_SECTOR_PREFERENCES
|
|
9
|
+
* - Progressive disclosure layer selection based on bracket
|
|
10
|
+
* - Session-level caching (keyed by agentId-bracket)
|
|
11
|
+
* - Token budget respect
|
|
12
|
+
*
|
|
13
|
+
* @module core/synapse/memory/synapse-memory-provider
|
|
14
|
+
* @version 2.0.0
|
|
15
|
+
* @created Story SYN-10 - Pro Memory Bridge (Feature-Gated MIS Consumer)
|
|
16
|
+
* @migrated Story INS-4.11 - Moved from pro/ to open-source (AC9)
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
'use strict';
|
|
20
|
+
|
|
21
|
+
const { estimateTokens } = require('../utils/tokens');
|
|
22
|
+
|
|
23
|
+
/** Default sectors for unknown agents. */
|
|
24
|
+
const DEFAULT_SECTORS = ['semantic'];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Agent sector preferences for memory retrieval.
|
|
28
|
+
* Defines which cognitive sectors each agent prefers.
|
|
29
|
+
*
|
|
30
|
+
* Moved from pro/memory/memory-loader.js to open-source.
|
|
31
|
+
*/
|
|
32
|
+
const AGENT_SECTOR_PREFERENCES = {
|
|
33
|
+
dev: ['procedural', 'semantic'],
|
|
34
|
+
qa: ['reflective', 'episodic'],
|
|
35
|
+
architect: ['semantic', 'reflective'],
|
|
36
|
+
pm: ['episodic', 'semantic'],
|
|
37
|
+
po: ['episodic', 'semantic'],
|
|
38
|
+
sm: ['procedural', 'episodic'],
|
|
39
|
+
devops: ['procedural', 'episodic'],
|
|
40
|
+
analyst: ['semantic', 'reflective'],
|
|
41
|
+
'data-engineer': ['procedural', 'semantic'],
|
|
42
|
+
'ux-design-expert': ['reflective', 'procedural'],
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Bracket → retrieval configuration.
|
|
47
|
+
*/
|
|
48
|
+
const BRACKET_CONFIG = {
|
|
49
|
+
MODERATE: { layer: 1, limit: 3, minRelevance: 0.7 },
|
|
50
|
+
DEPLETED: { layer: 2, limit: 5, minRelevance: 0.5 },
|
|
51
|
+
CRITICAL: { layer: 3, limit: 10, minRelevance: 0.3 },
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* SynapseMemoryProvider — Open-source memory retrieval.
|
|
56
|
+
*
|
|
57
|
+
* Provides memories from MIS for SYNAPSE engine injection.
|
|
58
|
+
* Session-level caching avoids repeated MIS queries for
|
|
59
|
+
* the same agent + bracket combination.
|
|
60
|
+
*
|
|
61
|
+
* Uses lazy-loading for MemoryLoader to gracefully degrade
|
|
62
|
+
* when the MIS module is not installed.
|
|
63
|
+
*/
|
|
64
|
+
class SynapseMemoryProvider {
|
|
65
|
+
/**
|
|
66
|
+
* @param {object} [options={}]
|
|
67
|
+
* @param {string} [options.projectDir] - Project directory for MemoryLoader
|
|
68
|
+
*/
|
|
69
|
+
constructor(options = {}) {
|
|
70
|
+
this._projectDir = options.projectDir || process.cwd();
|
|
71
|
+
this._loader = null;
|
|
72
|
+
/** @type {Map<string, Array>} Session-level cache keyed by `${agentId}-${bracket}` */
|
|
73
|
+
this._cache = new Map();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Lazy-load MemoryLoader.
|
|
78
|
+
* Gracefully returns null if pro/memory module is not available.
|
|
79
|
+
*
|
|
80
|
+
* @private
|
|
81
|
+
* @returns {object|null}
|
|
82
|
+
*/
|
|
83
|
+
_getLoader() {
|
|
84
|
+
if (this._loader) return this._loader;
|
|
85
|
+
|
|
86
|
+
try {
|
|
87
|
+
const { MemoryLoader } = require('../../../../pro/memory/memory-loader');
|
|
88
|
+
this._loader = new MemoryLoader(this._projectDir);
|
|
89
|
+
return this._loader;
|
|
90
|
+
} catch {
|
|
91
|
+
// MIS module not available — graceful degradation
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Get memories for SYNAPSE engine injection.
|
|
98
|
+
*
|
|
99
|
+
* Uses bracket to determine:
|
|
100
|
+
* - Which MIS layer to query (1=metadata, 2=chunks, 3=full)
|
|
101
|
+
* - How many results to return
|
|
102
|
+
* - Minimum relevance threshold
|
|
103
|
+
*
|
|
104
|
+
* Results are cached per session (agentId + bracket).
|
|
105
|
+
*
|
|
106
|
+
* @param {string} agentId - Active agent ID
|
|
107
|
+
* @param {string} bracket - Context bracket (MODERATE, DEPLETED, CRITICAL)
|
|
108
|
+
* @param {number} tokenBudget - Max tokens for memory hints
|
|
109
|
+
* @returns {Promise<Array<{content: string, source: string, relevance: number, tokens: number}>>}
|
|
110
|
+
*/
|
|
111
|
+
async getMemories(agentId, bracket, tokenBudget) {
|
|
112
|
+
// Cache lookup
|
|
113
|
+
const cacheKey = `${agentId}-${bracket}`;
|
|
114
|
+
if (this._cache.has(cacheKey)) {
|
|
115
|
+
return this._cache.get(cacheKey);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Get bracket config
|
|
119
|
+
const config = BRACKET_CONFIG[bracket];
|
|
120
|
+
if (!config) {
|
|
121
|
+
return [];
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Get loader (lazy-load, graceful if unavailable)
|
|
125
|
+
const loader = this._getLoader();
|
|
126
|
+
if (!loader) {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Get agent sectors
|
|
131
|
+
const sectors = AGENT_SECTOR_PREFERENCES[agentId] || DEFAULT_SECTORS;
|
|
132
|
+
|
|
133
|
+
// Query MIS via MemoryLoader
|
|
134
|
+
const memories = await loader.queryMemories(agentId, {
|
|
135
|
+
sectors,
|
|
136
|
+
layer: config.layer,
|
|
137
|
+
limit: config.limit,
|
|
138
|
+
minRelevance: config.minRelevance,
|
|
139
|
+
tokenBudget,
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// Transform to hint format
|
|
143
|
+
const hints = this._transformToHints(memories, tokenBudget);
|
|
144
|
+
|
|
145
|
+
// Cache results
|
|
146
|
+
this._cache.set(cacheKey, hints);
|
|
147
|
+
|
|
148
|
+
return hints;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Transform MIS memory results into hint format.
|
|
153
|
+
*
|
|
154
|
+
* @private
|
|
155
|
+
* @param {Array} memories - Raw memories from MemoryLoader
|
|
156
|
+
* @param {number} tokenBudget - Max tokens
|
|
157
|
+
* @returns {Array<{content: string, source: string, relevance: number, tokens: number}>}
|
|
158
|
+
*/
|
|
159
|
+
_transformToHints(memories, tokenBudget) {
|
|
160
|
+
if (!Array.isArray(memories) || memories.length === 0) {
|
|
161
|
+
return [];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const hints = [];
|
|
165
|
+
let tokensUsed = 0;
|
|
166
|
+
|
|
167
|
+
for (const memory of memories) {
|
|
168
|
+
const content = memory.content || memory.summary || memory.title || '';
|
|
169
|
+
const tokens = estimateTokens(content);
|
|
170
|
+
|
|
171
|
+
if (tokensUsed + tokens > tokenBudget) {
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
hints.push({
|
|
176
|
+
content,
|
|
177
|
+
source: memory.source || memory.sector || 'memory',
|
|
178
|
+
relevance: memory.relevance || memory.attention || 0,
|
|
179
|
+
tokens,
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
tokensUsed += tokens;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return hints;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Clear the session cache.
|
|
190
|
+
*/
|
|
191
|
+
clearCache() {
|
|
192
|
+
this._cache.clear();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
module.exports = {
|
|
197
|
+
SynapseMemoryProvider,
|
|
198
|
+
AGENT_SECTOR_PREFERENCES,
|
|
199
|
+
BRACKET_CONFIG,
|
|
200
|
+
DEFAULT_SECTORS,
|
|
201
|
+
};
|