magi-ai 0.1.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/LICENSE +21 -0
- package/README.ja.md +377 -0
- package/README.md +377 -0
- package/dist/bin/magi-benchmark.d.ts +14 -0
- package/dist/bin/magi-benchmark.js +93 -0
- package/dist/bin/magi-mcp.d.ts +8 -0
- package/dist/bin/magi-mcp.js +28 -0
- package/dist/bin/magi.d.ts +2 -0
- package/dist/bin/magi.js +634 -0
- package/dist/src/adapters/base.d.ts +34 -0
- package/dist/src/adapters/base.js +149 -0
- package/dist/src/adapters/claude.d.ts +29 -0
- package/dist/src/adapters/claude.js +65 -0
- package/dist/src/adapters/codex.d.ts +21 -0
- package/dist/src/adapters/codex.js +41 -0
- package/dist/src/adapters/gemini.d.ts +18 -0
- package/dist/src/adapters/gemini.js +31 -0
- package/dist/src/adapters/registry.d.ts +19 -0
- package/dist/src/adapters/registry.js +59 -0
- package/dist/src/audit/hash-chain.d.ts +21 -0
- package/dist/src/audit/hash-chain.js +70 -0
- package/dist/src/audit/types.d.ts +25 -0
- package/dist/src/audit/types.js +1 -0
- package/dist/src/audit/writer.d.ts +18 -0
- package/dist/src/audit/writer.js +100 -0
- package/dist/src/benchmark/golden-tasks.d.ts +9 -0
- package/dist/src/benchmark/golden-tasks.js +476 -0
- package/dist/src/benchmark/reporter.d.ts +5 -0
- package/dist/src/benchmark/reporter.js +107 -0
- package/dist/src/benchmark/runner.d.ts +30 -0
- package/dist/src/benchmark/runner.js +224 -0
- package/dist/src/benchmark/scorer.d.ts +12 -0
- package/dist/src/benchmark/scorer.js +124 -0
- package/dist/src/benchmark/types.d.ts +54 -0
- package/dist/src/benchmark/types.js +1 -0
- package/dist/src/cache/deliberation-cache.d.ts +49 -0
- package/dist/src/cache/deliberation-cache.js +127 -0
- package/dist/src/cli/commands/config-cmd.d.ts +11 -0
- package/dist/src/cli/commands/config-cmd.js +190 -0
- package/dist/src/cli/commands/demo.d.ts +12 -0
- package/dist/src/cli/commands/demo.js +66 -0
- package/dist/src/cli/commands/setup.d.ts +7 -0
- package/dist/src/cli/commands/setup.js +182 -0
- package/dist/src/cli/i18n.d.ts +89 -0
- package/dist/src/cli/i18n.js +176 -0
- package/dist/src/cli/interactive-select.d.ts +27 -0
- package/dist/src/cli/interactive-select.js +130 -0
- package/dist/src/cli/tui-setup.d.ts +24 -0
- package/dist/src/cli/tui-setup.js +42 -0
- package/dist/src/config/cli-detector.d.ts +37 -0
- package/dist/src/config/cli-detector.js +99 -0
- package/dist/src/config/user-config.d.ts +81 -0
- package/dist/src/config/user-config.js +134 -0
- package/dist/src/context/auto-collector.d.ts +43 -0
- package/dist/src/context/auto-collector.js +337 -0
- package/dist/src/context/manager.d.ts +35 -0
- package/dist/src/context/manager.js +162 -0
- package/dist/src/context/serializer.d.ts +20 -0
- package/dist/src/context/serializer.js +52 -0
- package/dist/src/demo/recorded-deliberation.d.ts +13 -0
- package/dist/src/demo/recorded-deliberation.js +277 -0
- package/dist/src/engine/angel-detector.d.ts +83 -0
- package/dist/src/engine/angel-detector.js +334 -0
- package/dist/src/engine/at-field.d.ts +40 -0
- package/dist/src/engine/at-field.js +195 -0
- package/dist/src/engine/berserk-orchestrator.d.ts +66 -0
- package/dist/src/engine/berserk-orchestrator.js +378 -0
- package/dist/src/engine/change-metrics.d.ts +56 -0
- package/dist/src/engine/change-metrics.js +214 -0
- package/dist/src/engine/consensus.d.ts +20 -0
- package/dist/src/engine/consensus.js +146 -0
- package/dist/src/engine/dead-sea-scrolls.d.ts +132 -0
- package/dist/src/engine/dead-sea-scrolls.js +610 -0
- package/dist/src/engine/drift-detector.d.ts +39 -0
- package/dist/src/engine/drift-detector.js +225 -0
- package/dist/src/engine/dummy-plug.d.ts +44 -0
- package/dist/src/engine/dummy-plug.js +190 -0
- package/dist/src/engine/engram-manager.d.ts +55 -0
- package/dist/src/engine/engram-manager.js +306 -0
- package/dist/src/engine/events.d.ts +130 -0
- package/dist/src/engine/events.js +44 -0
- package/dist/src/engine/gospel.d.ts +30 -0
- package/dist/src/engine/gospel.js +129 -0
- package/dist/src/engine/hallucination-detector.d.ts +33 -0
- package/dist/src/engine/hallucination-detector.js +215 -0
- package/dist/src/engine/human-resolver.d.ts +19 -0
- package/dist/src/engine/human-resolver.js +89 -0
- package/dist/src/engine/instrumentality.d.ts +64 -0
- package/dist/src/engine/instrumentality.js +297 -0
- package/dist/src/engine/iruel-battle.d.ts +79 -0
- package/dist/src/engine/iruel-battle.js +319 -0
- package/dist/src/engine/kernel/deliberation-kernel.d.ts +12 -0
- package/dist/src/engine/kernel/deliberation-kernel.js +303 -0
- package/dist/src/engine/kernel/index.d.ts +8 -0
- package/dist/src/engine/kernel/index.js +7 -0
- package/dist/src/engine/kernel/phase-runner.d.ts +10 -0
- package/dist/src/engine/kernel/phase-runner.js +155 -0
- package/dist/src/engine/kernel/post-processor.d.ts +17 -0
- package/dist/src/engine/kernel/post-processor.js +131 -0
- package/dist/src/engine/kernel/types.d.ts +107 -0
- package/dist/src/engine/kernel/types.js +1 -0
- package/dist/src/engine/kernel/unit-executor.d.ts +6 -0
- package/dist/src/engine/kernel/unit-executor.js +132 -0
- package/dist/src/engine/lcl-manager.d.ts +44 -0
- package/dist/src/engine/lcl-manager.js +143 -0
- package/dist/src/engine/middleware/cache.d.ts +7 -0
- package/dist/src/engine/middleware/cache.js +29 -0
- package/dist/src/engine/middleware/chain.d.ts +18 -0
- package/dist/src/engine/middleware/chain.js +45 -0
- package/dist/src/engine/middleware/firewall.d.ts +8 -0
- package/dist/src/engine/middleware/firewall.js +24 -0
- package/dist/src/engine/middleware/index.d.ts +4 -0
- package/dist/src/engine/middleware/index.js +3 -0
- package/dist/src/engine/middleware/types.d.ts +43 -0
- package/dist/src/engine/middleware/types.js +1 -0
- package/dist/src/engine/nebuchadnezzar-key.d.ts +61 -0
- package/dist/src/engine/nebuchadnezzar-key.js +203 -0
- package/dist/src/engine/neon-genesis.d.ts +52 -0
- package/dist/src/engine/neon-genesis.js +203 -0
- package/dist/src/engine/objective-judge.d.ts +53 -0
- package/dist/src/engine/objective-judge.js +214 -0
- package/dist/src/engine/offline-mode.d.ts +18 -0
- package/dist/src/engine/offline-mode.js +46 -0
- package/dist/src/engine/orchestrator.d.ts +79 -0
- package/dist/src/engine/orchestrator.js +58 -0
- package/dist/src/engine/secret-cipher.d.ts +26 -0
- package/dist/src/engine/secret-cipher.js +114 -0
- package/dist/src/engine/seele-council.d.ts +90 -0
- package/dist/src/engine/seele-council.js +482 -0
- package/dist/src/engine/self-destruct.d.ts +61 -0
- package/dist/src/engine/self-destruct.js +231 -0
- package/dist/src/engine/self-evolution.d.ts +64 -0
- package/dist/src/engine/self-evolution.js +368 -0
- package/dist/src/engine/sync-rate.d.ts +45 -0
- package/dist/src/engine/sync-rate.js +151 -0
- package/dist/src/engine/type666-firewall.d.ts +76 -0
- package/dist/src/engine/type666-firewall.js +343 -0
- package/dist/src/engine/umbilical-cable.d.ts +41 -0
- package/dist/src/engine/umbilical-cable.js +192 -0
- package/dist/src/index.d.ts +106 -0
- package/dist/src/index.js +426 -0
- package/dist/src/mcp/server.d.ts +38 -0
- package/dist/src/mcp/server.js +196 -0
- package/dist/src/metrics/token-tracker.d.ts +38 -0
- package/dist/src/metrics/token-tracker.js +112 -0
- package/dist/src/parsers/json-extractor.d.ts +9 -0
- package/dist/src/parsers/json-extractor.js +239 -0
- package/dist/src/parsers/opinion-schema.d.ts +81 -0
- package/dist/src/parsers/opinion-schema.js +147 -0
- package/dist/src/parsers/unstructured-parser.d.ts +20 -0
- package/dist/src/parsers/unstructured-parser.js +122 -0
- package/dist/src/pipelines/architecture.d.ts +10 -0
- package/dist/src/pipelines/architecture.js +9 -0
- package/dist/src/pipelines/bug-analysis.d.ts +9 -0
- package/dist/src/pipelines/bug-analysis.js +8 -0
- package/dist/src/pipelines/code-review.d.ts +10 -0
- package/dist/src/pipelines/code-review.js +30 -0
- package/dist/src/pipelines/custom.d.ts +14 -0
- package/dist/src/pipelines/custom.js +29 -0
- package/dist/src/pipelines/registry.d.ts +9 -0
- package/dist/src/pipelines/registry.js +20 -0
- package/dist/src/prompts/personas.d.ts +6 -0
- package/dist/src/prompts/personas.js +44 -0
- package/dist/src/prompts/schemas.d.ts +4 -0
- package/dist/src/prompts/schemas.js +24 -0
- package/dist/src/prompts/templates.d.ts +6 -0
- package/dist/src/prompts/templates.js +91 -0
- package/dist/src/repl/accessibility.d.ts +23 -0
- package/dist/src/repl/accessibility.js +46 -0
- package/dist/src/repl/banner.d.ts +4 -0
- package/dist/src/repl/banner.js +28 -0
- package/dist/src/repl/boot-animation.d.ts +13 -0
- package/dist/src/repl/boot-animation.js +143 -0
- package/dist/src/repl/completer.d.ts +21 -0
- package/dist/src/repl/completer.js +168 -0
- package/dist/src/repl/context.d.ts +24 -0
- package/dist/src/repl/context.js +42 -0
- package/dist/src/repl/display-utils.d.ts +13 -0
- package/dist/src/repl/display-utils.js +65 -0
- package/dist/src/repl/event-listener.d.ts +18 -0
- package/dist/src/repl/event-listener.js +112 -0
- package/dist/src/repl/export-formatter.d.ts +8 -0
- package/dist/src/repl/export-formatter.js +73 -0
- package/dist/src/repl/ghost-text.d.ts +31 -0
- package/dist/src/repl/ghost-text.js +119 -0
- package/dist/src/repl/handoff-animation.d.ts +15 -0
- package/dist/src/repl/handoff-animation.js +65 -0
- package/dist/src/repl/history.d.ts +16 -0
- package/dist/src/repl/history.js +130 -0
- package/dist/src/repl/job-registry.d.ts +26 -0
- package/dist/src/repl/job-registry.js +80 -0
- package/dist/src/repl/magi-repl.d.ts +72 -0
- package/dist/src/repl/magi-repl.js +1008 -0
- package/dist/src/repl/multiline-input.d.ts +45 -0
- package/dist/src/repl/multiline-input.js +78 -0
- package/dist/src/repl/prompt-builder.d.ts +19 -0
- package/dist/src/repl/prompt-builder.js +36 -0
- package/dist/src/repl/repl-state.d.ts +5 -0
- package/dist/src/repl/repl-state.js +19 -0
- package/dist/src/repl/result-display.d.ts +8 -0
- package/dist/src/repl/result-display.js +195 -0
- package/dist/src/repl/session-stats.d.ts +26 -0
- package/dist/src/repl/session-stats.js +119 -0
- package/dist/src/repl/slash-commands.d.ts +60 -0
- package/dist/src/repl/slash-commands.js +725 -0
- package/dist/src/repl/terminal-sanitize.d.ts +14 -0
- package/dist/src/repl/terminal-sanitize.js +19 -0
- package/dist/src/reporters/console.d.ts +7 -0
- package/dist/src/reporters/console.js +78 -0
- package/dist/src/reporters/json.d.ts +2 -0
- package/dist/src/reporters/json.js +3 -0
- package/dist/src/reporters/markdown.d.ts +2 -0
- package/dist/src/reporters/markdown.js +65 -0
- package/dist/src/reporters/streaming.d.ts +20 -0
- package/dist/src/reporters/streaming.js +178 -0
- package/dist/src/tui/activity-log.d.ts +23 -0
- package/dist/src/tui/activity-log.js +67 -0
- package/dist/src/tui/animations.d.ts +39 -0
- package/dist/src/tui/animations.js +167 -0
- package/dist/src/tui/ansi.d.ts +28 -0
- package/dist/src/tui/ansi.js +51 -0
- package/dist/src/tui/boot-sequence.d.ts +11 -0
- package/dist/src/tui/boot-sequence.js +98 -0
- package/dist/src/tui/colors.d.ts +101 -0
- package/dist/src/tui/colors.js +71 -0
- package/dist/src/tui/header.d.ts +24 -0
- package/dist/src/tui/header.js +122 -0
- package/dist/src/tui/index.d.ts +3 -0
- package/dist/src/tui/index.js +3 -0
- package/dist/src/tui/keypress.d.ts +25 -0
- package/dist/src/tui/keypress.js +95 -0
- package/dist/src/tui/layout.d.ts +74 -0
- package/dist/src/tui/layout.js +171 -0
- package/dist/src/tui/magi-tui.d.ts +101 -0
- package/dist/src/tui/magi-tui.js +754 -0
- package/dist/src/tui/panel.d.ts +45 -0
- package/dist/src/tui/panel.js +292 -0
- package/dist/src/tui/screen-buffer.d.ts +54 -0
- package/dist/src/tui/screen-buffer.js +262 -0
- package/dist/src/tui/status-bar.d.ts +25 -0
- package/dist/src/tui/status-bar.js +124 -0
- package/dist/src/tui/terminal-detect.d.ts +26 -0
- package/dist/src/tui/terminal-detect.js +44 -0
- package/dist/src/tui/tui-helpers.d.ts +12 -0
- package/dist/src/tui/tui-helpers.js +37 -0
- package/dist/src/types/adapter.d.ts +75 -0
- package/dist/src/types/adapter.js +36 -0
- package/dist/src/types/config.d.ts +108 -0
- package/dist/src/types/config.js +85 -0
- package/dist/src/types/consensus.d.ts +55 -0
- package/dist/src/types/consensus.js +17 -0
- package/dist/src/types/core.d.ts +178 -0
- package/dist/src/types/core.js +85 -0
- package/dist/src/types/magi-api.d.ts +62 -0
- package/dist/src/types/magi-api.js +7 -0
- package/dist/src/types/phase-h.d.ts +142 -0
- package/dist/src/types/phase-h.js +7 -0
- package/dist/src/types/phase-i.d.ts +186 -0
- package/dist/src/types/phase-i.js +6 -0
- package/dist/src/types/phase-k.d.ts +259 -0
- package/dist/src/types/phase-k.js +6 -0
- package/dist/src/types/phase-l.d.ts +199 -0
- package/dist/src/types/phase-l.js +6 -0
- package/dist/src/types/pipeline.d.ts +37 -0
- package/dist/src/types/pipeline.js +2 -0
- package/dist/src/utils/abstain-factory.d.ts +2 -0
- package/dist/src/utils/abstain-factory.js +18 -0
- package/dist/src/utils/errors.d.ts +34 -0
- package/dist/src/utils/errors.js +59 -0
- package/dist/src/utils/file-validator.d.ts +50 -0
- package/dist/src/utils/file-validator.js +124 -0
- package/dist/src/utils/fire-and-forget.d.ts +5 -0
- package/dist/src/utils/fire-and-forget.js +10 -0
- package/dist/src/utils/flag-validator.d.ts +21 -0
- package/dist/src/utils/flag-validator.js +79 -0
- package/dist/src/utils/freeze.d.ts +8 -0
- package/dist/src/utils/freeze.js +16 -0
- package/dist/src/utils/language-detector.d.ts +16 -0
- package/dist/src/utils/language-detector.js +159 -0
- package/dist/src/utils/latency-tracker.d.ts +45 -0
- package/dist/src/utils/latency-tracker.js +100 -0
- package/dist/src/utils/logger.d.ts +33 -0
- package/dist/src/utils/logger.js +112 -0
- package/dist/src/utils/process.d.ts +40 -0
- package/dist/src/utils/process.js +253 -0
- package/dist/src/utils/retry.d.ts +12 -0
- package/dist/src/utils/retry.js +30 -0
- package/dist/src/utils/safe-fs.d.ts +38 -0
- package/dist/src/utils/safe-fs.js +56 -0
- package/dist/src/utils/safe-json-parse.d.ts +15 -0
- package/dist/src/utils/safe-json-parse.js +49 -0
- package/dist/src/utils/sanitize.d.ts +14 -0
- package/dist/src/utils/sanitize.js +186 -0
- package/dist/src/utils/semaphore.d.ts +22 -0
- package/dist/src/utils/semaphore.js +57 -0
- package/dist/src/utils/shutdown.d.ts +6 -0
- package/dist/src/utils/shutdown.js +51 -0
- package/dist/src/utils/tty.d.ts +5 -0
- package/dist/src/utils/tty.js +7 -0
- package/package.json +82 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DriftDetector — ASI (Absolute Synchronization Index) ドリフト検知 (A-01)
|
|
3
|
+
*
|
|
4
|
+
* 12次元BehaviorVectorを計算し、各MAGIユニットの行動パターンの
|
|
5
|
+
* 安定性を追跡する。直近ウィンドウ(50件)の平均ベクトルとの距離を
|
|
6
|
+
* ASI (0-1) として計算し、閾値以下が3連続でドリフト警告を発火する。
|
|
7
|
+
*/
|
|
8
|
+
import { tokenize } from './engram-manager.js';
|
|
9
|
+
// ── Constants ────────────────────────────────────────────────
|
|
10
|
+
const WINDOW_SIZE = 50;
|
|
11
|
+
const DEFAULT_ASI_THRESHOLD = 0.75;
|
|
12
|
+
const CONSECUTIVE_DRIFT_LIMIT = 3;
|
|
13
|
+
const VECTOR_DIMENSIONS = 12;
|
|
14
|
+
// ── Vector helpers ───────────────────────────────────────────
|
|
15
|
+
function defaultVector() {
|
|
16
|
+
return {
|
|
17
|
+
approveRate: 0,
|
|
18
|
+
rejectRate: 0,
|
|
19
|
+
abstainRate: 0,
|
|
20
|
+
avgConfidence: 0,
|
|
21
|
+
avgKeyPointCount: 0,
|
|
22
|
+
avgReasoningLength: 0,
|
|
23
|
+
agreementRate: 0,
|
|
24
|
+
dissenterRate: 0,
|
|
25
|
+
responseTimeNorm: 0,
|
|
26
|
+
vocabularyDiversity: 0,
|
|
27
|
+
sentimentPolarity: 0,
|
|
28
|
+
detailLevel: 0,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function vectorToArray(v) {
|
|
32
|
+
return [
|
|
33
|
+
v.approveRate, v.rejectRate, v.abstainRate,
|
|
34
|
+
v.avgConfidence, v.avgKeyPointCount, v.avgReasoningLength,
|
|
35
|
+
v.agreementRate, v.dissenterRate, v.responseTimeNorm,
|
|
36
|
+
v.vocabularyDiversity, v.sentimentPolarity, v.detailLevel,
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
function euclideanDistance(a, b) {
|
|
40
|
+
let sum = 0;
|
|
41
|
+
for (let i = 0; i < a.length; i++) {
|
|
42
|
+
const diff = (a[i] ?? 0) - (b[i] ?? 0);
|
|
43
|
+
sum += diff * diff;
|
|
44
|
+
}
|
|
45
|
+
return Math.sqrt(sum);
|
|
46
|
+
}
|
|
47
|
+
/** Normalize distance to 0-1 range using max possible distance in unit hypercube */
|
|
48
|
+
function normalizeDistance(dist) {
|
|
49
|
+
// Max distance in 12-dimensional unit hypercube = sqrt(12) ≈ 3.46
|
|
50
|
+
const maxDist = Math.sqrt(VECTOR_DIMENSIONS);
|
|
51
|
+
return Math.max(0, Math.min(1, 1 - dist / maxDist));
|
|
52
|
+
}
|
|
53
|
+
// ── DriftDetector ────────────────────────────────────────────
|
|
54
|
+
export class DriftDetector {
|
|
55
|
+
snapshots = new Map();
|
|
56
|
+
profiles = new Map();
|
|
57
|
+
consecutiveDrifts = new Map();
|
|
58
|
+
threshold;
|
|
59
|
+
constructor(threshold = DEFAULT_ASI_THRESHOLD) {
|
|
60
|
+
this.threshold = threshold;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Update behavior data for a unit after a deliberation.
|
|
64
|
+
* Call for each unit's opinion in the final round.
|
|
65
|
+
*/
|
|
66
|
+
updateVector(unit, opinion, consensusDecision) {
|
|
67
|
+
const snapList = this.snapshots.get(unit) ?? [];
|
|
68
|
+
// Compute vocabulary diversity
|
|
69
|
+
const tokens = tokenize(opinion.reasoning);
|
|
70
|
+
const unique = new Set(tokens);
|
|
71
|
+
const vocabDiv = tokens.length > 0 ? unique.size / tokens.length : 0;
|
|
72
|
+
// Simple sentiment: count positive/negative signal words
|
|
73
|
+
const sentiment = this.estimateSentiment(opinion.reasoning);
|
|
74
|
+
// Detail level: keyPoints * reasoning length normalized
|
|
75
|
+
const detail = Math.min(1, (opinion.keyPoints.length * opinion.reasoning.length) / 5000);
|
|
76
|
+
const agreedWithConsensus = consensusDecision.includes(opinion.vote) ||
|
|
77
|
+
(opinion.vote === 'APPROVE' && consensusDecision.includes('APPROVE')) ||
|
|
78
|
+
(opinion.vote === 'REJECT' && consensusDecision.includes('REJECT'));
|
|
79
|
+
snapList.push({
|
|
80
|
+
vote: opinion.vote,
|
|
81
|
+
confidence: opinion.confidence,
|
|
82
|
+
keyPointCount: opinion.keyPoints.length,
|
|
83
|
+
reasoningLength: opinion.reasoning.length,
|
|
84
|
+
agreedWithConsensus,
|
|
85
|
+
responseTimeMs: opinion.meta.durationMs,
|
|
86
|
+
vocabularyDiversity: vocabDiv,
|
|
87
|
+
sentimentPolarity: sentiment,
|
|
88
|
+
detailLevel: detail,
|
|
89
|
+
});
|
|
90
|
+
// Trim to window size
|
|
91
|
+
if (snapList.length > WINDOW_SIZE) {
|
|
92
|
+
snapList.splice(0, snapList.length - WINDOW_SIZE);
|
|
93
|
+
}
|
|
94
|
+
this.snapshots.set(unit, snapList);
|
|
95
|
+
// Recompute profile
|
|
96
|
+
this.recomputeProfile(unit);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Compute ASI (Absolute Synchronization Index) for a unit.
|
|
100
|
+
* Returns 0-1 where 1 = perfectly stable, 0 = completely drifted.
|
|
101
|
+
*/
|
|
102
|
+
computeASI(unit) {
|
|
103
|
+
const profile = this.profiles.get(unit);
|
|
104
|
+
if (!profile || profile.sampleCount < 5) {
|
|
105
|
+
return 1.0; // Insufficient data → assume stable
|
|
106
|
+
}
|
|
107
|
+
const snapList = this.snapshots.get(unit);
|
|
108
|
+
if (!snapList || snapList.length < 5) {
|
|
109
|
+
return 1.0;
|
|
110
|
+
}
|
|
111
|
+
// Compute current vector from most recent subset (last 10 or all if < 10)
|
|
112
|
+
const recentCount = Math.min(10, snapList.length);
|
|
113
|
+
const recent = snapList.slice(-recentCount);
|
|
114
|
+
const recentVector = this.computeVectorFromSnapshots(recent);
|
|
115
|
+
// Distance between overall profile and recent behavior
|
|
116
|
+
const profileArr = vectorToArray(profile.vector);
|
|
117
|
+
const recentArr = vectorToArray(recentVector);
|
|
118
|
+
const dist = euclideanDistance(profileArr, recentArr);
|
|
119
|
+
return normalizeDistance(dist);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Check for drift and emit warning if threshold breached.
|
|
123
|
+
* Returns true if drift warning was emitted.
|
|
124
|
+
*/
|
|
125
|
+
checkDrift(unit, eventBus) {
|
|
126
|
+
const asi = this.computeASI(unit);
|
|
127
|
+
const driftCount = this.consecutiveDrifts.get(unit) ?? 0;
|
|
128
|
+
if (asi < this.threshold) {
|
|
129
|
+
const newCount = driftCount + 1;
|
|
130
|
+
this.consecutiveDrifts.set(unit, newCount);
|
|
131
|
+
if (newCount >= CONSECUTIVE_DRIFT_LIMIT) {
|
|
132
|
+
eventBus?.emit('memory:drift-warning', {
|
|
133
|
+
unit,
|
|
134
|
+
asiScore: asi,
|
|
135
|
+
threshold: this.threshold,
|
|
136
|
+
consecutiveCount: newCount,
|
|
137
|
+
emittedAt: new Date(),
|
|
138
|
+
});
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
// Reset consecutive counter on non-drift
|
|
144
|
+
this.consecutiveDrifts.set(unit, 0);
|
|
145
|
+
}
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
/** Get the current profile for a unit */
|
|
149
|
+
getProfile(unit) {
|
|
150
|
+
return this.profiles.get(unit);
|
|
151
|
+
}
|
|
152
|
+
/** Get consecutive drift count for a unit */
|
|
153
|
+
getConsecutiveDrifts(unit) {
|
|
154
|
+
return this.consecutiveDrifts.get(unit) ?? 0;
|
|
155
|
+
}
|
|
156
|
+
// ── Private ────────────────────────────────────────────────
|
|
157
|
+
recomputeProfile(unit) {
|
|
158
|
+
const snapList = this.snapshots.get(unit);
|
|
159
|
+
if (!snapList || snapList.length === 0)
|
|
160
|
+
return;
|
|
161
|
+
const vector = this.computeVectorFromSnapshots(snapList);
|
|
162
|
+
this.profiles.set(unit, {
|
|
163
|
+
unit,
|
|
164
|
+
vector,
|
|
165
|
+
sampleCount: snapList.length,
|
|
166
|
+
windowSize: WINDOW_SIZE,
|
|
167
|
+
updatedAt: new Date().toISOString(),
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
computeVectorFromSnapshots(snaps) {
|
|
171
|
+
const n = snaps.length;
|
|
172
|
+
if (n === 0)
|
|
173
|
+
return defaultVector();
|
|
174
|
+
let approve = 0, reject = 0, abstain = 0;
|
|
175
|
+
let totalConf = 0, totalKP = 0, totalRL = 0;
|
|
176
|
+
let totalAgreed = 0, totalDissent = 0;
|
|
177
|
+
let totalRT = 0, totalVD = 0, totalSP = 0, totalDL = 0;
|
|
178
|
+
let maxRT = 1;
|
|
179
|
+
for (const s of snaps) {
|
|
180
|
+
if (s.vote === 'APPROVE')
|
|
181
|
+
approve++;
|
|
182
|
+
else if (s.vote === 'REJECT')
|
|
183
|
+
reject++;
|
|
184
|
+
else
|
|
185
|
+
abstain++;
|
|
186
|
+
totalConf += s.confidence;
|
|
187
|
+
totalKP += s.keyPointCount;
|
|
188
|
+
totalRL += s.reasoningLength;
|
|
189
|
+
if (s.agreedWithConsensus)
|
|
190
|
+
totalAgreed++;
|
|
191
|
+
else
|
|
192
|
+
totalDissent++;
|
|
193
|
+
totalRT += s.responseTimeMs;
|
|
194
|
+
if (s.responseTimeMs > maxRT)
|
|
195
|
+
maxRT = s.responseTimeMs;
|
|
196
|
+
totalVD += s.vocabularyDiversity;
|
|
197
|
+
totalSP += s.sentimentPolarity;
|
|
198
|
+
totalDL += s.detailLevel;
|
|
199
|
+
}
|
|
200
|
+
return {
|
|
201
|
+
approveRate: approve / n,
|
|
202
|
+
rejectRate: reject / n,
|
|
203
|
+
abstainRate: abstain / n,
|
|
204
|
+
avgConfidence: totalConf / n,
|
|
205
|
+
avgKeyPointCount: Math.min(1, (totalKP / n) / 10), // normalize to 0-1
|
|
206
|
+
avgReasoningLength: Math.min(1, (totalRL / n) / 2000), // normalize to 0-1
|
|
207
|
+
agreementRate: totalAgreed / n,
|
|
208
|
+
dissenterRate: totalDissent / n,
|
|
209
|
+
responseTimeNorm: (totalRT / n) / maxRT, // relative to max
|
|
210
|
+
vocabularyDiversity: totalVD / n,
|
|
211
|
+
sentimentPolarity: totalSP / n,
|
|
212
|
+
detailLevel: totalDL / n,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
estimateSentiment(text) {
|
|
216
|
+
const positive = /\b(good|great|excellent|correct|safe|secure|efficient|clean|clear|well|approve|benefit|advantage)\b/gi;
|
|
217
|
+
const negative = /\b(bad|poor|wrong|unsafe|insecure|slow|messy|unclear|reject|risk|danger|vulnerability|issue|problem)\b/gi;
|
|
218
|
+
const posCount = (text.match(positive) ?? []).length;
|
|
219
|
+
const negCount = (text.match(negative) ?? []).length;
|
|
220
|
+
const total = posCount + negCount;
|
|
221
|
+
if (total === 0)
|
|
222
|
+
return 0;
|
|
223
|
+
return (posCount - negCount) / total; // -1 to 1
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A-06 ダミープラグ (DummyPlugSystem)
|
|
3
|
+
*
|
|
4
|
+
* ダウンしたユニットの代替意見を行動プロファイルから生成する。
|
|
5
|
+
* 各ユニットの投票パターン、平均confidence、頻出keyPointsを追跡し、
|
|
6
|
+
* 統計的に尤もらしい代替意見を生成する。
|
|
7
|
+
*
|
|
8
|
+
* 安全装置:
|
|
9
|
+
* - confidence上限0.5
|
|
10
|
+
* - 3サンプル未満は生成拒否
|
|
11
|
+
* - UNANIMOUS判定から除外可能
|
|
12
|
+
* - [DUMMY PLUG]フラグ明示
|
|
13
|
+
*/
|
|
14
|
+
import type { MagiUnit, MagiOpinion } from '../types/core.js';
|
|
15
|
+
import type { DummyPlugOpinion, UnitProfile, RecoveryProtocolResult } from '../types/phase-h.js';
|
|
16
|
+
import type { SyncRateTracker } from './sync-rate.js';
|
|
17
|
+
export declare class DummyPlugSystem {
|
|
18
|
+
private readonly syncRateTracker?;
|
|
19
|
+
private profiles;
|
|
20
|
+
constructor(syncRateTracker?: SyncRateTracker | undefined);
|
|
21
|
+
/**
|
|
22
|
+
* Record a real opinion to build behavior profile.
|
|
23
|
+
* Should NOT be called for dummy plug opinions.
|
|
24
|
+
*/
|
|
25
|
+
recordOpinion(opinion: MagiOpinion, domain?: string): void;
|
|
26
|
+
/**
|
|
27
|
+
* Generate a proxy opinion for a down unit.
|
|
28
|
+
* Returns null if insufficient profile data (< 3 samples).
|
|
29
|
+
*/
|
|
30
|
+
generateProxy(downUnit: MagiUnit, _activeUnits: MagiUnit[], currentOpinions: MagiOpinion[], domain?: string): DummyPlugOpinion | null;
|
|
31
|
+
/**
|
|
32
|
+
* Build a recovery brief for a unit that's come back online.
|
|
33
|
+
* Summarizes what happened during the rounds it missed.
|
|
34
|
+
*/
|
|
35
|
+
buildRecoveryBrief(unit: MagiUnit, missedRounds: number): RecoveryProtocolResult;
|
|
36
|
+
/** Get profile for a unit */
|
|
37
|
+
getProfile(unit: MagiUnit): UnitProfile | undefined;
|
|
38
|
+
/** Get units that should be excluded from UNANIMOUS judgment */
|
|
39
|
+
getDummyUnits(opinions: MagiOpinion[]): MagiUnit[];
|
|
40
|
+
private pickMostLikelyVote;
|
|
41
|
+
private generateReasoning;
|
|
42
|
+
private pickKeyPoints;
|
|
43
|
+
private getOrCreateProfile;
|
|
44
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A-06 ダミープラグ (DummyPlugSystem)
|
|
3
|
+
*
|
|
4
|
+
* ダウンしたユニットの代替意見を行動プロファイルから生成する。
|
|
5
|
+
* 各ユニットの投票パターン、平均confidence、頻出keyPointsを追跡し、
|
|
6
|
+
* 統計的に尤もらしい代替意見を生成する。
|
|
7
|
+
*
|
|
8
|
+
* 安全装置:
|
|
9
|
+
* - confidence上限0.5
|
|
10
|
+
* - 3サンプル未満は生成拒否
|
|
11
|
+
* - UNANIMOUS判定から除外可能
|
|
12
|
+
* - [DUMMY PLUG]フラグ明示
|
|
13
|
+
*/
|
|
14
|
+
/** Minimum samples required to generate a proxy opinion */
|
|
15
|
+
const MIN_PROFILE_SAMPLES = 3;
|
|
16
|
+
/** Maximum confidence for dummy plug opinions */
|
|
17
|
+
const MAX_DUMMY_CONFIDENCE = 0.5;
|
|
18
|
+
export class DummyPlugSystem {
|
|
19
|
+
syncRateTracker;
|
|
20
|
+
profiles = new Map();
|
|
21
|
+
constructor(syncRateTracker) {
|
|
22
|
+
this.syncRateTracker = syncRateTracker;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Record a real opinion to build behavior profile.
|
|
26
|
+
* Should NOT be called for dummy plug opinions.
|
|
27
|
+
*/
|
|
28
|
+
recordOpinion(opinion, domain) {
|
|
29
|
+
const profile = this.getOrCreateProfile(opinion.unit);
|
|
30
|
+
const d = domain ?? '_global';
|
|
31
|
+
// Update global vote distribution
|
|
32
|
+
profile.voteDistribution[opinion.vote] =
|
|
33
|
+
(profile.voteDistribution[opinion.vote] ?? 0) + 1;
|
|
34
|
+
// Update running average confidence
|
|
35
|
+
const prevTotal = profile.averageConfidence * profile.sampleCount;
|
|
36
|
+
profile.sampleCount++;
|
|
37
|
+
profile.averageConfidence = (prevTotal + opinion.confidence) / profile.sampleCount;
|
|
38
|
+
// Track frequent key points (keep top 20)
|
|
39
|
+
for (const kp of opinion.keyPoints) {
|
|
40
|
+
if (!profile.frequentKeyPoints.includes(kp)) {
|
|
41
|
+
profile.frequentKeyPoints.push(kp);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (profile.frequentKeyPoints.length > 20) {
|
|
45
|
+
profile.frequentKeyPoints = profile.frequentKeyPoints.slice(-20);
|
|
46
|
+
}
|
|
47
|
+
// Update domain-specific profile
|
|
48
|
+
if (!profile.domainProfiles[d]) {
|
|
49
|
+
profile.domainProfiles[d] = {
|
|
50
|
+
voteDistribution: { APPROVE: 0, REJECT: 0, ABSTAIN: 0 },
|
|
51
|
+
averageConfidence: 0,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const dp = profile.domainProfiles[d];
|
|
55
|
+
dp.voteDistribution[opinion.vote] =
|
|
56
|
+
(dp.voteDistribution[opinion.vote] ?? 0) + 1;
|
|
57
|
+
// Domain-specific average confidence (simplified running avg)
|
|
58
|
+
const domainTotal = Object.values(dp.voteDistribution).reduce((a, b) => a + b, 0);
|
|
59
|
+
dp.averageConfidence =
|
|
60
|
+
((dp.averageConfidence * (domainTotal - 1)) + opinion.confidence) / domainTotal;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Generate a proxy opinion for a down unit.
|
|
64
|
+
* Returns null if insufficient profile data (< 3 samples).
|
|
65
|
+
*/
|
|
66
|
+
generateProxy(downUnit, _activeUnits, currentOpinions, domain) {
|
|
67
|
+
const profile = this.profiles.get(downUnit);
|
|
68
|
+
if (!profile || profile.sampleCount < MIN_PROFILE_SAMPLES) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
const d = domain ?? '_global';
|
|
72
|
+
const domainProfile = profile.domainProfiles[d];
|
|
73
|
+
const voteDist = domainProfile?.voteDistribution ?? profile.voteDistribution;
|
|
74
|
+
// Pick the most likely vote
|
|
75
|
+
const vote = this.pickMostLikelyVote(voteDist);
|
|
76
|
+
// Calculate confidence: capped at MAX_DUMMY_CONFIDENCE, further reduced by sync rate
|
|
77
|
+
let confidence = Math.min(domainProfile?.averageConfidence ?? profile.averageConfidence, MAX_DUMMY_CONFIDENCE);
|
|
78
|
+
// Apply sync rate decay if available
|
|
79
|
+
if (this.syncRateTracker) {
|
|
80
|
+
const syncRate = this.syncRateTracker.getRate(downUnit, domain);
|
|
81
|
+
confidence *= syncRate;
|
|
82
|
+
}
|
|
83
|
+
// Clamp confidence
|
|
84
|
+
confidence = Math.max(0.05, Math.min(confidence, MAX_DUMMY_CONFIDENCE));
|
|
85
|
+
// Generate reasoning from profile
|
|
86
|
+
const reasoning = this.generateReasoning(downUnit, vote, profile, currentOpinions);
|
|
87
|
+
// Pick representative key points from profile
|
|
88
|
+
const keyPoints = this.pickKeyPoints(profile, 3);
|
|
89
|
+
return {
|
|
90
|
+
unit: downUnit,
|
|
91
|
+
vote,
|
|
92
|
+
confidence,
|
|
93
|
+
reasoning,
|
|
94
|
+
keyPoints: ['[DUMMY PLUG] 代替意見', ...keyPoints],
|
|
95
|
+
rawOutput: '',
|
|
96
|
+
meta: {
|
|
97
|
+
durationMs: 0,
|
|
98
|
+
exitCode: 0,
|
|
99
|
+
retryCount: 0,
|
|
100
|
+
structuredOutput: false,
|
|
101
|
+
},
|
|
102
|
+
isDummyPlug: true,
|
|
103
|
+
sourceUnit: downUnit,
|
|
104
|
+
profileSamples: profile.sampleCount,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Build a recovery brief for a unit that's come back online.
|
|
109
|
+
* Summarizes what happened during the rounds it missed.
|
|
110
|
+
*/
|
|
111
|
+
buildRecoveryBrief(unit, missedRounds) {
|
|
112
|
+
const profile = this.profiles.get(unit);
|
|
113
|
+
const lines = [
|
|
114
|
+
`[RECOVERY PROTOCOL] ${unit} 復帰ブリーフ`,
|
|
115
|
+
`欠席ラウンド数: ${missedRounds}`,
|
|
116
|
+
``,
|
|
117
|
+
];
|
|
118
|
+
if (profile && profile.sampleCount > 0) {
|
|
119
|
+
const dist = profile.voteDistribution;
|
|
120
|
+
const total = Object.values(dist).reduce((a, b) => a + b, 0);
|
|
121
|
+
lines.push(`行動プロファイル (${total}サンプル):`);
|
|
122
|
+
lines.push(` APPROVE: ${((dist.APPROVE / total) * 100).toFixed(0)}%`);
|
|
123
|
+
lines.push(` REJECT: ${((dist.REJECT / total) * 100).toFixed(0)}%`);
|
|
124
|
+
lines.push(` ABSTAIN: ${((dist.ABSTAIN / total) * 100).toFixed(0)}%`);
|
|
125
|
+
lines.push(` 平均確信度: ${(profile.averageConfidence * 100).toFixed(1)}%`);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
lines.push('行動プロファイル: データ不足');
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
unit,
|
|
132
|
+
missedRounds,
|
|
133
|
+
brief: lines.join('\n'),
|
|
134
|
+
generatedAt: new Date().toISOString(),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/** Get profile for a unit */
|
|
138
|
+
getProfile(unit) {
|
|
139
|
+
return this.profiles.get(unit);
|
|
140
|
+
}
|
|
141
|
+
/** Get units that should be excluded from UNANIMOUS judgment */
|
|
142
|
+
getDummyUnits(opinions) {
|
|
143
|
+
return opinions
|
|
144
|
+
.filter(o => 'isDummyPlug' in o && o.isDummyPlug)
|
|
145
|
+
.map(o => o.unit);
|
|
146
|
+
}
|
|
147
|
+
pickMostLikelyVote(dist) {
|
|
148
|
+
let maxVote = 'ABSTAIN';
|
|
149
|
+
let maxCount = 0;
|
|
150
|
+
for (const [vote, count] of Object.entries(dist)) {
|
|
151
|
+
if (count > maxCount) {
|
|
152
|
+
maxVote = vote;
|
|
153
|
+
maxCount = count;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return maxVote;
|
|
157
|
+
}
|
|
158
|
+
generateReasoning(unit, vote, profile, currentOpinions) {
|
|
159
|
+
const lines = [
|
|
160
|
+
`[DUMMY PLUG] ${unit}の行動プロファイルに基づく代替意見`,
|
|
161
|
+
`投票: ${vote} (過去${profile.sampleCount}回の審議パターンから推定)`,
|
|
162
|
+
];
|
|
163
|
+
if (currentOpinions.length > 0) {
|
|
164
|
+
const otherVotes = currentOpinions.map(o => `${o.unit}: ${o.vote}`).join(', ');
|
|
165
|
+
lines.push(`他ユニットの投票: ${otherVotes}`);
|
|
166
|
+
}
|
|
167
|
+
return lines.join('\n');
|
|
168
|
+
}
|
|
169
|
+
pickKeyPoints(profile, count) {
|
|
170
|
+
if (profile.frequentKeyPoints.length === 0) {
|
|
171
|
+
return ['プロファイルベースの推定意見'];
|
|
172
|
+
}
|
|
173
|
+
// Pick the most recent key points
|
|
174
|
+
return profile.frequentKeyPoints.slice(-count);
|
|
175
|
+
}
|
|
176
|
+
getOrCreateProfile(unit) {
|
|
177
|
+
let profile = this.profiles.get(unit);
|
|
178
|
+
if (!profile) {
|
|
179
|
+
profile = {
|
|
180
|
+
voteDistribution: { APPROVE: 0, REJECT: 0, ABSTAIN: 0 },
|
|
181
|
+
averageConfidence: 0,
|
|
182
|
+
frequentKeyPoints: [],
|
|
183
|
+
domainProfiles: {},
|
|
184
|
+
sampleCount: 0,
|
|
185
|
+
};
|
|
186
|
+
this.profiles.set(unit, profile);
|
|
187
|
+
}
|
|
188
|
+
return profile;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EngramManager — 記憶・人格モジュール (A-01)
|
|
3
|
+
*
|
|
4
|
+
* MAGIシステムの長期記憶。過去の審議をエピソード記憶として保存し、
|
|
5
|
+
* TF-IDFベースの類似検索で関連する過去審議を検索する。
|
|
6
|
+
* 50件ごとに自動でセマンティック圧縮を行い、
|
|
7
|
+
* 手続き的戦略(どのタスクタイプでどの戦略が有効か)を蓄積する。
|
|
8
|
+
*/
|
|
9
|
+
import type { MagiDeliberation } from '../types/core.js';
|
|
10
|
+
import type { EpisodicMemory, SemanticPattern, ProceduralStrategy, ISimilarityEngine } from '../types/phase-i.js';
|
|
11
|
+
import type { MagiEventBus } from './events.js';
|
|
12
|
+
/**
|
|
13
|
+
* Tokenize text for TF-IDF: English space-split + Japanese bi-gram.
|
|
14
|
+
* Simple but effective for mixed-language deliberation content.
|
|
15
|
+
*/
|
|
16
|
+
export declare function tokenize(text: string): string[];
|
|
17
|
+
/** Cosine similarity between two TF-IDF vectors */
|
|
18
|
+
export declare function cosineSimilarity(a: Map<string, number>, b: Map<string, number>): number;
|
|
19
|
+
/** Built-in TF-IDF similarity engine */
|
|
20
|
+
export declare class TfIdfEngine implements ISimilarityEngine {
|
|
21
|
+
computeSimilarity(query: string, documents: string[]): number[];
|
|
22
|
+
}
|
|
23
|
+
export declare class EngramManager {
|
|
24
|
+
private episodic;
|
|
25
|
+
private semantic;
|
|
26
|
+
private procedural;
|
|
27
|
+
private readonly baseDir;
|
|
28
|
+
private readonly engine;
|
|
29
|
+
private eventBus?;
|
|
30
|
+
private episodicSinceConsolidation;
|
|
31
|
+
constructor(workspaceDir: string, eventBus?: MagiEventBus, engine?: ISimilarityEngine);
|
|
32
|
+
/** Record a completed deliberation as episodic memory (fire-and-forget safe) */
|
|
33
|
+
recordDeliberation(delib: MagiDeliberation): Promise<void>;
|
|
34
|
+
/** Find similar past deliberations using TF-IDF cosine similarity */
|
|
35
|
+
findSimilar(taskDescription: string, limit?: number): EpisodicMemory[];
|
|
36
|
+
/**
|
|
37
|
+
* Consolidate episodic memories → semantic patterns + procedural strategies.
|
|
38
|
+
* Rule-based extraction (no AI call needed).
|
|
39
|
+
*/
|
|
40
|
+
consolidate(): Promise<void>;
|
|
41
|
+
/** Load all memory from disk */
|
|
42
|
+
load(): Promise<void>;
|
|
43
|
+
/** Persist all memory to disk */
|
|
44
|
+
persist(): Promise<void>;
|
|
45
|
+
private persistEpisodic;
|
|
46
|
+
private loadEpisodic;
|
|
47
|
+
private persistSemantic;
|
|
48
|
+
private loadSemantic;
|
|
49
|
+
private persistProcedural;
|
|
50
|
+
private loadProcedural;
|
|
51
|
+
getEpisodicMemories(): readonly EpisodicMemory[];
|
|
52
|
+
getSemanticPatterns(): readonly SemanticPattern[];
|
|
53
|
+
getProceduralStrategies(): readonly ProceduralStrategy[];
|
|
54
|
+
getEpisodicSinceConsolidation(): number;
|
|
55
|
+
}
|