kenaz 0.3.10 → 0.3.12
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/core/.claude/skills/code_reviewer/SKILL.md +0 -1
- package/core/.claude/skills/code_reviewer/patterns.yaml +0 -8
- package/core/.claude/skills/dev_agent/SKILL.md +3 -6
- package/core/.claude/skills/heimdall/SKILL.md +5 -6
- package/core/.claude/skills/huginn/SKILL.md +11 -38
- package/core/.collaboration/core/task-2288-followups.test.js +2 -37
- package/core/.collaboration/core/task-2421-replica.test.js +229 -0
- package/core/.collaboration/core/task-api.js +223 -230
- package/core/.collaboration/core/task-api.test.js +1 -138
- package/core/.collaboration/core/task-replica.js +189 -0
- package/core/.formation/.merge-lock +1 -0
- package/core/.formation/bifrost/codex-doctor.js +12 -2
- package/core/.formation/bifrost/codex-doctor.test.js +15 -0
- package/core/.formation/bifrost/launch.js +2 -2
- package/core/.formation/bifrost/launch.test.js +2 -2
- package/core/.formation/bifrost/setup-codex.js +84 -16
- package/core/.formation/bifrost/shared/ansuz-boot-policy.js +3 -3
- package/core/.formation/bifrost/shared/codex-injection.js +3 -17
- package/core/.formation/bifrost/shared/consolidate.js +1 -51
- package/core/.formation/bifrost/sync.js +4 -5
- package/core/.formation/tools/__tests__/subagent-bifrost-guard.test.js +1 -1
- package/core/.formation/tools/dispatch.js +2 -2
- package/core/.formation/tools/kenaz-stats.js +1 -1
- package/core/.formation/tools/mcp-allowlist.test.js +5 -3
- package/core/.formation/tools/post-complete/bounded-http.js +1 -40
- package/core/.formation/tools/post-complete/bounded-http.test.js +2 -89
- package/core/.formation/tools/post-complete/cognitive.js +2 -119
- package/core/.formation/tools/post-complete/task2420.test.js +129 -0
- package/core/.formation/tools/post-complete/testing.js +3 -21
- package/core/.formation/tools/post-complete.js +131 -436
- package/core/.formation/tools/post-complete.test.js +0 -135
- package/core/.formation/tools/route-audit.test.js +8 -20
- package/core/.kenaz/specialist/memory_guard_fired.json +1 -1
- package/core/.kenaz/specialist/memory_guard_trigger_cache.json +1 -1
- package/core/.rule/INDEX.yaml +3 -3
- package/core/.rule/general/ddx-synapse-stack.yaml +11 -11
- package/core/.rule/general/specialist-identity-contract.yaml +5 -5
- package/core/.rule/general/synapse-code-intelligence.yaml +25 -111
- package/core/.rule/general/worktree-isolation.yaml +2 -2
- package/core/.rule/pipeline/task-execution.yaml +6 -9
- package/core/.specialist/Amelia/README.md +5 -5
- package/core/.specialist/Amelia/capability.yaml +10 -18
- package/core/.specialist/Amelia/knowledge.yaml +15 -66
- package/core/.specialist/Amelia/workflow.yaml +12 -21
- package/core/.specialist/Ansuz/capability.yaml +12 -87
- package/core/.specialist/Ansuz/concepts/autonomous_agenda.yaml +1 -1
- package/core/.specialist/Ansuz/concepts/autonomy_contract.yaml +2 -3
- package/core/.specialist/Ansuz/concepts/capability_pointers.yaml +1 -3
- package/core/.specialist/Ansuz/concepts/cognitive_fluency_contract.yaml +8 -21
- package/core/.specialist/Ansuz/concepts/cognitive_systems_overview.yaml +0 -4
- package/core/.specialist/Ansuz/concepts/cognitive_systems_turn_context.yaml +1 -1
- package/core/.specialist/Ansuz/concepts/completion_tracking.yaml +0 -1
- package/core/.specialist/Ansuz/concepts/deep_knowledge_pointers.yaml +0 -3
- package/core/.specialist/Ansuz/concepts/evolvable_guardrails.yaml +3 -3
- package/core/.specialist/Ansuz/concepts/fatigue_handoff.yaml +1 -7
- package/core/.specialist/Ansuz/concepts/guardrails_immutable.yaml +3 -4
- package/core/.specialist/Ansuz/concepts/identity.yaml +1 -2
- package/core/.specialist/Ansuz/concepts/phase9_verification.yaml +0 -1
- package/core/.specialist/Ansuz/concepts/phase_protocol.yaml +3 -4
- package/core/.specialist/Ansuz/core.yaml +3 -6
- package/core/.specialist/Ansuz/elixir.yaml +6 -6
- package/core/.specialist/Ansuz/exo_cortex_tools.yaml +5 -9
- package/core/.specialist/Ansuz/guards/blind_spot_guards.yaml +2 -2
- package/core/.specialist/Ansuz/guards/lesson_guards.yaml +6 -19
- package/core/.specialist/Ansuz/identity_contract.yaml +4 -4
- package/core/.specialist/Ansuz/knowledge.yaml +13 -40
- package/core/.specialist/Ansuz/modules/ddx.yaml +2 -2
- package/core/.specialist/Ansuz/modules/prophecy.yaml +19 -19
- package/core/.specialist/Ansuz/modules/pulse_empty.yaml +6 -17
- package/core/.specialist/Ansuz/tools/ansuz-handoff-snapshot.js +3 -102
- package/core/.specialist/Ansuz/tools/ansuz-sdk-runner.js +2 -44
- package/core/.specialist/Ansuz/workflow.yaml +32 -76
- package/core/.specialist/Forseti/core.yaml +2 -7
- package/core/.specialist/Forseti/rule.yaml +1 -1
- package/core/.specialist/Heimdall/SKILL.md +2 -3
- package/core/.specialist/Heimdall/capability.yaml +22 -45
- package/core/.specialist/Heimdall/core.yaml +24 -126
- package/core/.specialist/Heimdall/principles.yaml +8 -11
- package/core/.specialist/Heimdall/rule.yaml +2 -2
- package/core/.specialist/Huginn/capability.yaml +31 -52
- package/core/.specialist/Huginn/core.yaml +43 -123
- package/core/.specialist/Huginn/principles.yaml +5 -5
- package/core/.specialist/Huginn/rule.yaml +3 -9
- package/core/.specialist/REFLECTION_TO_CONTROL.md +3 -4
- package/core/.specialist/shared/guard_schema.json +1 -1
- package/core/.specialist/shared/principles.yaml +6 -6
- package/core/.specialist/tools/__tests__/rea-detect.test.js +10 -0
- package/core/.specialist/tools/phase-gate.js +10 -230
- package/core/.specialist/tools/phase-gate.test.js +2 -2
- package/core/.specialist/tools/prompt-files.test.js +1 -1
- package/core/.specialist/tools/rea-detect.js +6 -2
- package/core/.specialist/tools/session.js +2 -89
- package/core/.synapse/memory-shared.json.sync +1 -0
- package/core/.system/memory/README.md +3 -0
- package/core/CLAUDE.md +6 -7
- package/core/KENAZ_CORE_VERSION +1 -1
- package/core/dev/plans/CLI_FIRST_INSTALL_FLOW.md +75 -83
- package/core/dev/specs/peer/CODEX_MANAGED_DAEMON.md +54 -0
- package/core/dev/specs/peer/setup-codex-hooks.test.js +38 -0
- package/core/dev/spikes/task2145-evidence-20261004/backend-log-excerpt.txt +56 -0
- package/core/dev/spikes/task2145-evidence-20261004/graph.shadow +0 -0
- package/core/dev/spikes/task2145-evidence-20261004/graph.wal +0 -0
- package/core/dev/spikes/task2145-evidence-20261004/graph_corrupt_suspect.marker +1 -0
- package/core/plugins/kenaz/INVENTORY.md +1 -1
- package/core/plugins/kenaz/scripts/kenaz.test.js +70 -1
- package/core/plugins/kenaz/scripts/ygg.js +45 -4
- package/core/plugins/kenaz/skills/code_reviewer/SKILL.md +0 -1
- package/core/plugins/kenaz/skills/code_reviewer/patterns.yaml +0 -8
- package/core/plugins/kenaz/skills/dev_agent/SKILL.md +3 -6
- package/lib/cli.js +17 -9
- package/lib/cli.test.js +10 -0
- package/lib/dashboard.test.js +3 -3
- package/package.json +6 -6
- package/vendor/install-kenaz-cli.js +167 -16
- package/core/.claude/hooks/handoff-snapshot-on-decision.js +0 -188
- package/core/.claude/skills/synapse_maintain/SKILL.md +0 -84
- package/core/.collaboration/core/task-2264-single-after-capture.test.js +0 -61
- package/core/.formation/tools/alaya-gate.js +0 -198
- package/core/.formation/tools/post-complete/health.js +0 -464
- package/core/.formation/tools/post-complete/task2038.test.js +0 -246
- package/core/.formation/tools/post-complete/task2341.test.js +0 -74
- package/core/.rule/general/cortex-tools.yaml +0 -181
- package/core/.rule/general/memory-language.yaml +0 -67
- package/core/.rule/general/memory-source-priority.yaml +0 -207
- package/core/.rule/general/synapse-cognitive-fusion.yaml +0 -301
- package/core/.specialist/Ansuz/concepts/cognitive_systems_hippocampus.yaml +0 -14
- package/core/.specialist/Ansuz/concepts/write_verification.yaml +0 -26
- package/core/.specialist/Ansuz/modules/recall.yaml +0 -45
- package/core/.specialist/tools/MEMORY_RECALL_TRIGGERS.md +0 -156
- package/core/.specialist/tools/context-injection.js +0 -395
- package/core/dev/scripts/probe/hippocampus-concurrency.js +0 -247
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// TASK_1924: hippocampus concurrency probe.
|
|
3
|
-
//
|
|
4
|
-
// Purpose: measure whether N concurrent hippocampus_episode_recall MCP calls
|
|
5
|
-
// (which, before TASK_1924, ran synchronous rusqlite/KuzuDB work directly on
|
|
6
|
-
// a tokio worker thread) starve the HTTP server's worker pool badly enough
|
|
7
|
-
// to stall unrelated requests (/api/rust/health) that share the same
|
|
8
|
-
// tauri::async_runtime.
|
|
9
|
-
//
|
|
10
|
-
// Method:
|
|
11
|
-
// 1. Fire N concurrent JSON-RPC tools/call requests for
|
|
12
|
-
// hippocampus_episode_recall against POST /api/mcp.
|
|
13
|
-
// 2. Concurrently poll GET /api/rust/health every POLL_INTERVAL_MS for the
|
|
14
|
-
// duration of the burst.
|
|
15
|
-
// 3. Report health-poll latency p50/p95/max + failure count, and the
|
|
16
|
-
// episode_recall call latencies + failure count.
|
|
17
|
-
//
|
|
18
|
-
// Run BEFORE and AFTER the spawn_blocking fix and compare the health p95/max:
|
|
19
|
-
// a healthy fix should keep health latency in the tens-of-ms range regardless
|
|
20
|
-
// of concurrent hippocampus load; an unfixed handler will show health p95/max
|
|
21
|
-
// climbing toward the burst duration (worker-starved).
|
|
22
|
-
//
|
|
23
|
-
// Usage:
|
|
24
|
-
// node dev/scripts/probe/hippocampus-concurrency.js [options]
|
|
25
|
-
//
|
|
26
|
-
// Options:
|
|
27
|
-
// --base-url <url> Rust backend base URL (default: http://127.0.0.1:18080)
|
|
28
|
-
// --concurrency <n> Number of concurrent episode_recall calls (default: 8)
|
|
29
|
-
// --project-path <path> projectPath arg for the MCP tool call (default: cwd)
|
|
30
|
-
// --poll-interval <ms> Health poll interval in ms (default: 200)
|
|
31
|
-
// --query <text> query arg for episode_recall (default: "spawn_blocking")
|
|
32
|
-
// --limit <n> limit arg for episode_recall (default: 10)
|
|
33
|
-
//
|
|
34
|
-
// Example:
|
|
35
|
-
// node dev/scripts/probe/hippocampus-concurrency.js --concurrency 8
|
|
36
|
-
|
|
37
|
-
'use strict';
|
|
38
|
-
|
|
39
|
-
const http = require('http');
|
|
40
|
-
const { URL } = require('url');
|
|
41
|
-
|
|
42
|
-
function parseArgs(argv) {
|
|
43
|
-
const opts = {
|
|
44
|
-
baseUrl: 'http://127.0.0.1:18080',
|
|
45
|
-
concurrency: 8,
|
|
46
|
-
projectPath: process.cwd(),
|
|
47
|
-
pollIntervalMs: 200,
|
|
48
|
-
query: 'spawn_blocking',
|
|
49
|
-
limit: 10,
|
|
50
|
-
};
|
|
51
|
-
for (let i = 0; i < argv.length; i++) {
|
|
52
|
-
const a = argv[i];
|
|
53
|
-
const next = () => argv[++i];
|
|
54
|
-
switch (a) {
|
|
55
|
-
case '--base-url':
|
|
56
|
-
opts.baseUrl = next();
|
|
57
|
-
break;
|
|
58
|
-
case '--concurrency':
|
|
59
|
-
opts.concurrency = parseInt(next(), 10);
|
|
60
|
-
break;
|
|
61
|
-
case '--project-path':
|
|
62
|
-
opts.projectPath = next();
|
|
63
|
-
break;
|
|
64
|
-
case '--poll-interval':
|
|
65
|
-
opts.pollIntervalMs = parseInt(next(), 10);
|
|
66
|
-
break;
|
|
67
|
-
case '--query':
|
|
68
|
-
opts.query = next();
|
|
69
|
-
break;
|
|
70
|
-
case '--limit':
|
|
71
|
-
opts.limit = parseInt(next(), 10);
|
|
72
|
-
break;
|
|
73
|
-
default:
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return opts;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function httpRequest(urlStr, { method = 'GET', headers = {}, body } = {}, timeoutMs = 60000) {
|
|
81
|
-
return new Promise((resolve) => {
|
|
82
|
-
const url = new URL(urlStr);
|
|
83
|
-
const started = Date.now();
|
|
84
|
-
const req = http.request(
|
|
85
|
-
{
|
|
86
|
-
hostname: url.hostname,
|
|
87
|
-
port: url.port,
|
|
88
|
-
path: url.pathname + url.search,
|
|
89
|
-
method,
|
|
90
|
-
headers,
|
|
91
|
-
timeout: timeoutMs,
|
|
92
|
-
},
|
|
93
|
-
(res) => {
|
|
94
|
-
const chunks = [];
|
|
95
|
-
res.on('data', (c) => chunks.push(c));
|
|
96
|
-
res.on('end', () => {
|
|
97
|
-
resolve({
|
|
98
|
-
ok: res.statusCode >= 200 && res.statusCode < 300,
|
|
99
|
-
status: res.statusCode,
|
|
100
|
-
durationMs: Date.now() - started,
|
|
101
|
-
body: Buffer.concat(chunks).toString('utf8'),
|
|
102
|
-
error: null,
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
);
|
|
107
|
-
req.on('timeout', () => {
|
|
108
|
-
req.destroy();
|
|
109
|
-
resolve({ ok: false, status: 0, durationMs: Date.now() - started, body: '', error: 'timeout' });
|
|
110
|
-
});
|
|
111
|
-
req.on('error', (err) => {
|
|
112
|
-
resolve({ ok: false, status: 0, durationMs: Date.now() - started, body: '', error: String(err && err.message || err) });
|
|
113
|
-
});
|
|
114
|
-
if (body) req.write(body);
|
|
115
|
-
req.end();
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
async function callMcpTool(baseUrl, toolName, args, id) {
|
|
120
|
-
const payload = JSON.stringify({
|
|
121
|
-
jsonrpc: '2.0',
|
|
122
|
-
id,
|
|
123
|
-
method: 'tools/call',
|
|
124
|
-
params: { name: toolName, arguments: args },
|
|
125
|
-
});
|
|
126
|
-
const res = await httpRequest(`${baseUrl}/api/mcp`, {
|
|
127
|
-
method: 'POST',
|
|
128
|
-
headers: {
|
|
129
|
-
'Content-Type': 'application/json',
|
|
130
|
-
'Content-Length': Buffer.byteLength(payload),
|
|
131
|
-
},
|
|
132
|
-
body: payload,
|
|
133
|
-
});
|
|
134
|
-
let rpcError = null;
|
|
135
|
-
let toolIsError = false;
|
|
136
|
-
if (res.ok) {
|
|
137
|
-
try {
|
|
138
|
-
const parsed = JSON.parse(res.body);
|
|
139
|
-
if (parsed.error) rpcError = parsed.error.message || JSON.stringify(parsed.error);
|
|
140
|
-
if (parsed.result && parsed.result.isError) toolIsError = true;
|
|
141
|
-
} catch (e) {
|
|
142
|
-
rpcError = `non-JSON response: ${e.message}`;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return {
|
|
146
|
-
ok: res.ok && !rpcError && !toolIsError,
|
|
147
|
-
status: res.status,
|
|
148
|
-
durationMs: res.durationMs,
|
|
149
|
-
error: res.error || rpcError || (toolIsError ? 'tool returned isError' : null),
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function percentile(sortedArr, p) {
|
|
154
|
-
if (sortedArr.length === 0) return null;
|
|
155
|
-
const idx = Math.min(sortedArr.length - 1, Math.ceil((p / 100) * sortedArr.length) - 1);
|
|
156
|
-
return sortedArr[Math.max(0, idx)];
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function summarize(label, samples, failures) {
|
|
160
|
-
const durations = samples.map((s) => s.durationMs).sort((a, b) => a - b);
|
|
161
|
-
const p50 = percentile(durations, 50);
|
|
162
|
-
const p95 = percentile(durations, 95);
|
|
163
|
-
const max = durations.length ? durations[durations.length - 1] : null;
|
|
164
|
-
const min = durations.length ? durations[0] : null;
|
|
165
|
-
console.log(`\n[${label}]`);
|
|
166
|
-
console.log(` samples: ${samples.length}, failures: ${failures}`);
|
|
167
|
-
console.log(` min=${min}ms p50=${p50}ms p95=${p95}ms max=${max}ms`);
|
|
168
|
-
return { label, count: samples.length, failures, min, p50, p95, max };
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
async function main() {
|
|
172
|
-
const opts = parseArgs(process.argv.slice(2));
|
|
173
|
-
console.log('TASK_1924 hippocampus concurrency probe');
|
|
174
|
-
console.log(` baseUrl=${opts.baseUrl} concurrency=${opts.concurrency} pollIntervalMs=${opts.pollIntervalMs}`);
|
|
175
|
-
console.log(` projectPath=${opts.projectPath}`);
|
|
176
|
-
|
|
177
|
-
let polling = true;
|
|
178
|
-
const healthSamples = [];
|
|
179
|
-
let healthFailures = 0;
|
|
180
|
-
|
|
181
|
-
const pollLoop = (async () => {
|
|
182
|
-
while (polling) {
|
|
183
|
-
const t0 = Date.now();
|
|
184
|
-
const res = await httpRequest(`${opts.baseUrl}/api/rust/health`, {}, 10000);
|
|
185
|
-
if (!res.ok) healthFailures++;
|
|
186
|
-
healthSamples.push({ durationMs: res.durationMs, ok: res.ok, ts: t0 });
|
|
187
|
-
const elapsed = Date.now() - t0;
|
|
188
|
-
const sleep = Math.max(0, opts.pollIntervalMs - elapsed);
|
|
189
|
-
await new Promise((r) => setTimeout(r, sleep));
|
|
190
|
-
}
|
|
191
|
-
})();
|
|
192
|
-
|
|
193
|
-
const burstStart = Date.now();
|
|
194
|
-
const calls = Array.from({ length: opts.concurrency }, (_, i) =>
|
|
195
|
-
callMcpTool(
|
|
196
|
-
opts.baseUrl,
|
|
197
|
-
'hippocampus_episode_recall',
|
|
198
|
-
{
|
|
199
|
-
projectPath: opts.projectPath,
|
|
200
|
-
query: opts.query,
|
|
201
|
-
limit: opts.limit,
|
|
202
|
-
},
|
|
203
|
-
`probe-${i}`
|
|
204
|
-
)
|
|
205
|
-
);
|
|
206
|
-
const callResults = await Promise.all(calls);
|
|
207
|
-
const burstDurationMs = Date.now() - burstStart;
|
|
208
|
-
|
|
209
|
-
// Keep polling briefly after the burst to catch any lingering worker-starvation tail.
|
|
210
|
-
await new Promise((r) => setTimeout(r, Math.max(opts.pollIntervalMs * 3, 600)));
|
|
211
|
-
polling = false;
|
|
212
|
-
await pollLoop;
|
|
213
|
-
|
|
214
|
-
const callFailures = callResults.filter((r) => !r.ok).length;
|
|
215
|
-
|
|
216
|
-
console.log(`\nBurst wall-clock: ${burstDurationMs}ms for ${opts.concurrency} concurrent episode_recall calls`);
|
|
217
|
-
const callSummary = summarize('hippocampus_episode_recall calls', callResults, callFailures);
|
|
218
|
-
const healthSummary = summarize('/api/rust/health polls (during + shortly after burst)', healthSamples, healthFailures);
|
|
219
|
-
|
|
220
|
-
if (callFailures > 0) {
|
|
221
|
-
console.log('\nFailed episode_recall calls:');
|
|
222
|
-
callResults.forEach((r, i) => {
|
|
223
|
-
if (!r.ok) console.log(` #${i}: status=${r.status} error=${r.error}`);
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
console.log('\nJSON summary:');
|
|
228
|
-
console.log(
|
|
229
|
-
JSON.stringify(
|
|
230
|
-
{
|
|
231
|
-
concurrency: opts.concurrency,
|
|
232
|
-
burstDurationMs,
|
|
233
|
-
calls: callSummary,
|
|
234
|
-
health: healthSummary,
|
|
235
|
-
},
|
|
236
|
-
null,
|
|
237
|
-
2
|
|
238
|
-
)
|
|
239
|
-
);
|
|
240
|
-
|
|
241
|
-
process.exit(callFailures > 0 || healthFailures > 0 ? 1 : 0);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
main().catch((err) => {
|
|
245
|
-
console.error('Probe crashed:', err);
|
|
246
|
-
process.exit(2);
|
|
247
|
-
});
|