@monoes/monomindcli 1.18.13 → 1.19.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/.claude/agents/core/researcher.md +29 -24
- package/.claude/agents/github/code-review-swarm.md +1 -1
- package/.claude/agents/github/github-modes.md +1 -1
- package/.claude/agents/github/issue-tracker.md +1 -1
- package/.claude/agents/github/multi-repo-swarm.md +1 -1
- package/.claude/agents/github/pr-manager.md +1 -1
- package/.claude/agents/github/project-board-sync.md +1 -1
- package/.claude/agents/github/release-manager.md +1 -1
- package/.claude/agents/github/repo-architect.md +1 -1
- package/.claude/agents/github/swarm-issue.md +1 -1
- package/.claude/agents/github/swarm-pr.md +1 -1
- package/.claude/agents/github/sync-coordinator.md +1 -1
- package/.claude/agents/github/workflow-automation.md +1 -1
- package/.claude/agents/goal/goal-planner.md +1 -1
- package/.claude/agents/specialized/specialized-workflow-architect.md +11 -14
- package/.claude/agents/testing/production-validator.md +8 -7
- package/.claude/agents/testing/testing-evidence-collector.md +3 -1
- package/.claude/commands/mastermind/_repeat.md +22 -3
- package/.claude/commands/mastermind/architect.md +1 -1
- package/.claude/commands/mastermind/autodev.md +1 -1
- package/.claude/commands/mastermind/build.md +1 -1
- package/.claude/commands/mastermind/code-review.md +5 -5
- package/.claude/commands/mastermind/debug.md +1 -1
- package/.claude/commands/mastermind/help.md +2 -2
- package/.claude/commands/mastermind/idea.md +1 -1
- package/.claude/commands/mastermind/improve.md +1 -1
- package/.claude/commands/mastermind/okf-export.md +14 -0
- package/.claude/commands/mastermind/okf-import.md +15 -0
- package/.claude/commands/mastermind/plan.md +1 -1
- package/.claude/commands/mastermind/research.md +1 -1
- package/.claude/commands/mastermind/review.md +12 -1
- package/.claude/commands/mastermind/runorg.md +1 -1
- package/.claude/commands/mastermind/taskdev.md +1 -1
- package/.claude/commands/mastermind/tdd.md +1 -1
- package/.claude/commands/mastermind/verify.md +1 -1
- package/.claude/helpers/graphify-freshen.cjs +16 -20
- package/.claude/helpers/handlers/agent-start-handler.cjs +11 -36
- package/.claude/helpers/handlers/capture-handler.cjs +110 -0
- package/.claude/helpers/handlers/route-handler.cjs +180 -256
- package/.claude/helpers/handlers/session-handler.cjs +139 -142
- package/.claude/helpers/handlers/session-restore-handler.cjs +15 -10
- package/.claude/helpers/handlers/task-handler.cjs +8 -155
- package/.claude/helpers/hook-handler.cjs +89 -5
- package/.claude/helpers/intelligence.cjs +164 -15
- package/.claude/helpers/learning-service.mjs +1 -0
- package/.claude/helpers/mastermind-activate.cjs +33 -51
- package/.claude/helpers/monolean-activate.cjs +13 -3
- package/.claude/helpers/monolean-propagate.cjs +7 -3
- package/.claude/helpers/router.cjs +47 -9
- package/.claude/helpers/utils/monograph.cjs +37 -20
- package/.claude/skills/mastermind-skills/_repeat.md +29 -4
- package/.claude/skills/mastermind-skills/architect.md +5 -6
- package/.claude/skills/mastermind-skills/autodev.md +8 -5
- package/.claude/skills/mastermind-skills/review.md +25 -11
- package/.claude/skills/mastermind-skills/techport.md +37 -3
- package/.claude/skills/monodesign/document.md +9 -6
- package/.claude/skills/monodesign/extract.md +1 -1
- package/.claude/skills/monodesign/reference/document.md +1 -1
- package/.claude/skills/monodesign/reference/live.md +1 -1
- package/.claude/skills/monolean/SKILL.md +1 -1
- package/bin/mcp-server.js +11 -1
- package/dist/src/commands/agent-ops.d.ts +1 -2
- package/dist/src/commands/agent-ops.d.ts.map +1 -1
- package/dist/src/commands/agent-ops.js +1 -59
- package/dist/src/commands/agent-ops.js.map +1 -1
- package/dist/src/commands/agent.d.ts.map +1 -1
- package/dist/src/commands/agent.js +2 -3
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/analyze-diff.js +1 -1
- package/dist/src/commands/analyze-diff.js.map +1 -1
- package/dist/src/commands/browse-action.d.ts.map +1 -1
- package/dist/src/commands/browse-action.js +94 -2
- package/dist/src/commands/browse-action.js.map +1 -1
- package/dist/src/commands/completions.d.ts.map +1 -1
- package/dist/src/commands/completions.js +11 -56
- package/dist/src/commands/completions.js.map +1 -1
- package/dist/src/commands/doctor-project-checks.d.ts +1 -1
- package/dist/src/commands/doctor-project-checks.js +1 -1
- package/dist/src/commands/hive-mind-helpers.js +2 -2
- package/dist/src/commands/hive-mind-helpers.js.map +1 -1
- package/dist/src/commands/hive-mind-ops.d.ts +1 -3
- package/dist/src/commands/hive-mind-ops.d.ts.map +1 -1
- package/dist/src/commands/hive-mind-ops.js +2 -116
- package/dist/src/commands/hive-mind-ops.js.map +1 -1
- package/dist/src/commands/hive-mind.d.ts.map +1 -1
- package/dist/src/commands/hive-mind.js +2 -5
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks-coverage-commands.d.ts.map +1 -1
- package/dist/src/commands/hooks-coverage-commands.js +8 -7
- package/dist/src/commands/hooks-coverage-commands.js.map +1 -1
- package/dist/src/commands/hooks-coverage-gaps.js +1 -1
- package/dist/src/commands/hooks-coverage-gaps.js.map +1 -1
- package/dist/src/commands/hooks-coverage-routing.js +2 -2
- package/dist/src/commands/hooks-coverage-routing.js.map +1 -1
- package/dist/src/commands/hooks-extended-commands.d.ts +0 -3
- package/dist/src/commands/hooks-extended-commands.d.ts.map +1 -1
- package/dist/src/commands/hooks-extended-commands.js +0 -307
- package/dist/src/commands/hooks-extended-commands.js.map +1 -1
- package/dist/src/commands/hooks.d.ts.map +1 -1
- package/dist/src/commands/hooks.js +1 -12
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts +3 -51
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +36 -184
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init-wizard.d.ts.map +1 -1
- package/dist/src/commands/init-wizard.js +2 -4
- package/dist/src/commands/init-wizard.js.map +1 -1
- package/dist/src/commands/mcp.d.ts.map +1 -1
- package/dist/src/commands/mcp.js +32 -4
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory-admin.d.ts +1 -2
- package/dist/src/commands/memory-admin.d.ts.map +1 -1
- package/dist/src/commands/memory-admin.js +1 -118
- package/dist/src/commands/memory-admin.js.map +1 -1
- package/dist/src/commands/memory-transfer.d.ts +1 -2
- package/dist/src/commands/memory-transfer.d.ts.map +1 -1
- package/dist/src/commands/memory-transfer.js +5 -171
- package/dist/src/commands/memory-transfer.js.map +1 -1
- package/dist/src/commands/memory.d.ts.map +1 -1
- package/dist/src/commands/memory.js +3 -6
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/neural-core.d.ts +3 -1
- package/dist/src/commands/neural-core.d.ts.map +1 -1
- package/dist/src/commands/neural-core.js +145 -6
- package/dist/src/commands/neural-core.js.map +1 -1
- package/dist/src/commands/neural-optimize.js +4 -4
- package/dist/src/commands/neural-optimize.js.map +1 -1
- package/dist/src/commands/neural-registry.d.ts +1 -1
- package/dist/src/commands/neural-registry.js +4 -4
- package/dist/src/commands/neural-registry.js.map +1 -1
- package/dist/src/commands/neural.d.ts +1 -1
- package/dist/src/commands/neural.js +6 -6
- package/dist/src/commands/neural.js.map +1 -1
- package/dist/src/commands/performance.d.ts.map +1 -1
- package/dist/src/commands/performance.js +68 -58
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/providers.d.ts.map +1 -1
- package/dist/src/commands/providers.js +2 -131
- package/dist/src/commands/providers.js.map +1 -1
- package/dist/src/commands/security-misc.d.ts +0 -1
- package/dist/src/commands/security-misc.d.ts.map +1 -1
- package/dist/src/commands/security-misc.js +69 -45
- package/dist/src/commands/security-misc.js.map +1 -1
- package/dist/src/commands/security.d.ts.map +1 -1
- package/dist/src/commands/security.js +2 -4
- package/dist/src/commands/security.js.map +1 -1
- package/dist/src/commands/session.d.ts.map +1 -1
- package/dist/src/commands/session.js +1 -285
- package/dist/src/commands/session.js.map +1 -1
- package/dist/src/commands/start.d.ts.map +1 -1
- package/dist/src/commands/start.js +2 -41
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.d.ts.map +1 -1
- package/dist/src/commands/status.js +18 -29
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.js +1 -1
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/commands/task.d.ts.map +1 -1
- package/dist/src/commands/task.js +2 -49
- package/dist/src/commands/task.js.map +1 -1
- package/dist/src/commands/workflow.d.ts.map +1 -1
- package/dist/src/commands/workflow.js +2 -104
- package/dist/src/commands/workflow.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +3 -14
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.d.ts.map +1 -1
- package/dist/src/init/helpers-generator.js +2 -22
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/settings-generator.d.ts.map +1 -1
- package/dist/src/init/settings-generator.js +0 -1
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +1 -3
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +0 -2
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/mcp-client.d.ts.map +1 -1
- package/dist/src/mcp-client.js +0 -6
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.d.ts.map +1 -1
- package/dist/src/mcp-server.js +16 -0
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +0 -17
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/coherence/causal-infer.d.ts +5 -5
- package/dist/src/mcp-tools/coherence/causal-infer.d.ts.map +1 -1
- package/dist/src/mcp-tools/coherence/causal-infer.js +32 -46
- package/dist/src/mcp-tools/coherence/causal-infer.js.map +1 -1
- package/dist/src/mcp-tools/coherence/consensus-verify.d.ts +2 -3
- package/dist/src/mcp-tools/coherence/consensus-verify.d.ts.map +1 -1
- package/dist/src/mcp-tools/coherence/consensus-verify.js +22 -20
- package/dist/src/mcp-tools/coherence/consensus-verify.js.map +1 -1
- package/dist/src/mcp-tools/coherence/memory-gate.d.ts +3 -2
- package/dist/src/mcp-tools/coherence/memory-gate.d.ts.map +1 -1
- package/dist/src/mcp-tools/coherence/memory-gate.js +32 -19
- package/dist/src/mcp-tools/coherence/memory-gate.js.map +1 -1
- package/dist/src/mcp-tools/coherence/quantum-topology.d.ts +4 -4
- package/dist/src/mcp-tools/coherence/quantum-topology.d.ts.map +1 -1
- package/dist/src/mcp-tools/coherence/quantum-topology.js +11 -17
- package/dist/src/mcp-tools/coherence/quantum-topology.js.map +1 -1
- package/dist/src/mcp-tools/coherence/spectral-analyze.d.ts +2 -3
- package/dist/src/mcp-tools/coherence/spectral-analyze.d.ts.map +1 -1
- package/dist/src/mcp-tools/coherence/spectral-analyze.js +51 -32
- package/dist/src/mcp-tools/coherence/spectral-analyze.js.map +1 -1
- package/dist/src/mcp-tools/coherence/types.d.ts +5 -9
- package/dist/src/mcp-tools/coherence/types.d.ts.map +1 -1
- package/dist/src/mcp-tools/coherence/types.js.map +1 -1
- package/dist/src/mcp-tools/guidance-tools.js +2 -2
- package/dist/src/mcp-tools/guidance-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.js +25 -3
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.d.ts +0 -3
- package/dist/src/mcp-tools/hooks-routing.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-routing.js +45 -159
- package/dist/src/mcp-tools/hooks-routing.js.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +1 -4
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/index.d.ts +0 -2
- package/dist/src/mcp-tools/index.d.ts.map +1 -1
- package/dist/src/mcp-tools/index.js +0 -3
- package/dist/src/mcp-tools/index.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +24 -0
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/monograph-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/monograph-tools.js +452 -7
- package/dist/src/mcp-tools/monograph-tools.js.map +1 -1
- package/dist/src/mcp-tools/neural-tools.d.ts +4 -10
- package/dist/src/mcp-tools/neural-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/neural-tools.js +28 -54
- package/dist/src/mcp-tools/neural-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +5 -17
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.js +2 -2
- package/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.js.map +1 -1
- package/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts +4 -4
- package/dist/src/mcp-tools/quality-tools.d.ts +7 -2
- package/dist/src/mcp-tools/quality-tools.d.ts.map +1 -1
- package/dist/src/mcp-tools/quality-tools.js +7 -257
- package/dist/src/mcp-tools/quality-tools.js.map +1 -1
- package/dist/src/memory/intelligence.d.ts +7 -8
- package/dist/src/memory/intelligence.d.ts.map +1 -1
- package/dist/src/memory/intelligence.js +15 -16
- package/dist/src/memory/intelligence.js.map +1 -1
- package/dist/src/memory/memory-bridge.d.ts +1 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -1
- package/dist/src/memory/memory-bridge.js +37 -0
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/services/worker-daemon.d.ts +3 -21
- package/dist/src/services/worker-daemon.d.ts.map +1 -1
- package/dist/src/services/worker-daemon.js +13 -80
- package/dist/src/services/worker-daemon.js.map +1 -1
- package/dist/src/suggest.d.ts.map +1 -1
- package/dist/src/suggest.js +0 -5
- package/dist/src/suggest.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +0 -503
- package/dist/src/commands/deployment.d.ts +0 -10
- package/dist/src/commands/deployment.d.ts.map +0 -1
- package/dist/src/commands/deployment.js +0 -706
- package/dist/src/commands/deployment.js.map +0 -1
- package/dist/src/ui/MODULARIZATION_PLAN.md +0 -79
|
@@ -15,16 +15,16 @@ export declare const DetectSecretsInputSchema: z.ZodObject<{
|
|
|
15
15
|
scanHistory: z.ZodDefault<z.ZodBoolean>;
|
|
16
16
|
}, "strip", z.ZodTypeAny, {
|
|
17
17
|
targetPath: string;
|
|
18
|
-
excludePatterns: string[];
|
|
19
18
|
secretTypes: ("password" | "api-key" | "private-key" | "token" | "connection-string" | "certificate" | "aws-key" | "aws-secret" | "gcp-key" | "azure-key" | "generic")[];
|
|
19
|
+
excludePatterns: string[];
|
|
20
20
|
includeEntropy: boolean;
|
|
21
21
|
entropyThreshold: number;
|
|
22
22
|
verifySecrets: boolean;
|
|
23
23
|
scanHistory: boolean;
|
|
24
24
|
}, {
|
|
25
25
|
targetPath: string;
|
|
26
|
-
excludePatterns?: string[] | undefined;
|
|
27
26
|
secretTypes?: ("password" | "api-key" | "private-key" | "token" | "connection-string" | "certificate" | "aws-key" | "aws-secret" | "gcp-key" | "azure-key" | "generic")[] | undefined;
|
|
27
|
+
excludePatterns?: string[] | undefined;
|
|
28
28
|
includeEntropy?: boolean | undefined;
|
|
29
29
|
entropyThreshold?: number | undefined;
|
|
30
30
|
verifySecrets?: boolean | undefined;
|
|
@@ -116,16 +116,16 @@ export declare const toolDefinition: {
|
|
|
116
116
|
scanHistory: z.ZodDefault<z.ZodBoolean>;
|
|
117
117
|
}, "strip", z.ZodTypeAny, {
|
|
118
118
|
targetPath: string;
|
|
119
|
-
excludePatterns: string[];
|
|
120
119
|
secretTypes: ("password" | "api-key" | "private-key" | "token" | "connection-string" | "certificate" | "aws-key" | "aws-secret" | "gcp-key" | "azure-key" | "generic")[];
|
|
120
|
+
excludePatterns: string[];
|
|
121
121
|
includeEntropy: boolean;
|
|
122
122
|
entropyThreshold: number;
|
|
123
123
|
verifySecrets: boolean;
|
|
124
124
|
scanHistory: boolean;
|
|
125
125
|
}, {
|
|
126
126
|
targetPath: string;
|
|
127
|
-
excludePatterns?: string[] | undefined;
|
|
128
127
|
secretTypes?: ("password" | "api-key" | "private-key" | "token" | "connection-string" | "certificate" | "aws-key" | "aws-secret" | "gcp-key" | "azure-key" | "generic")[] | undefined;
|
|
128
|
+
excludePatterns?: string[] | undefined;
|
|
129
129
|
includeEntropy?: boolean | undefined;
|
|
130
130
|
entropyThreshold?: number | undefined;
|
|
131
131
|
verifySecrets?: boolean | undefined;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Quality Tools — built-in quality MCP tools
|
|
3
3
|
*
|
|
4
|
-
* Wraps
|
|
5
|
-
*
|
|
4
|
+
* Wraps 2 tools: coverage gap prioritization and secret detection.
|
|
5
|
+
*
|
|
6
|
+
* monolean: 14 tools were removed — their handlers fabricated results
|
|
7
|
+
* (hardcoded fake file coverage, Math.random()-driven projections/predictions,
|
|
8
|
+
* invented defect data, fake security scan findings, hardcoded compliance
|
|
9
|
+
* results) rather than performing real analysis. Only prioritize-gaps
|
|
10
|
+
* (salvageable) and detect-secrets (real) remain.
|
|
6
11
|
*/
|
|
7
12
|
import type { MCPTool } from './types.js';
|
|
8
13
|
export declare const qualityTools: MCPTool[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quality-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp-tools/quality-tools.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"quality-tools.d.ts","sourceRoot":"","sources":["../../../src/mcp-tools/quality-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiB,MAAM,YAAY,CAAC;AAiBzD,eAAO,MAAM,YAAY,EAAE,OAAO,EAkCjC,CAAC"}
|
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Quality Tools — built-in quality MCP tools
|
|
3
3
|
*
|
|
4
|
-
* Wraps
|
|
5
|
-
*
|
|
4
|
+
* Wraps 2 tools: coverage gap prioritization and secret detection.
|
|
5
|
+
*
|
|
6
|
+
* monolean: 14 tools were removed — their handlers fabricated results
|
|
7
|
+
* (hardcoded fake file coverage, Math.random()-driven projections/predictions,
|
|
8
|
+
* invented defect data, fake security scan findings, hardcoded compliance
|
|
9
|
+
* results) rather than performing real analysis. Only prioritize-gaps
|
|
10
|
+
* (salvageable) and detect-secrets (real) remain.
|
|
6
11
|
*/
|
|
7
|
-
import { handler as generateTestsHandler } from './quality/test-generation/generate-tests.js';
|
|
8
|
-
import { handler as tddCycleHandler } from './quality/test-generation/tdd-cycle.js';
|
|
9
|
-
import { handler as suggestTestsHandler } from './quality/test-generation/suggest-tests.js';
|
|
10
|
-
import { handler as analyzeCoverageHandler } from './quality/coverage-analysis/analyze-coverage.js';
|
|
11
12
|
import { handler as prioritizeGapsHandler } from './quality/coverage-analysis/prioritize-gaps.js';
|
|
12
|
-
import { handler as trackTrendsHandler } from './quality/coverage-analysis/track-trends.js';
|
|
13
|
-
import { handler as evaluateGateHandler } from './quality/quality-assessment/evaluate-quality-gate.js';
|
|
14
|
-
import { handler as assessReadinessHandler } from './quality/quality-assessment/assess-readiness.js';
|
|
15
|
-
import { handler as calculateRiskHandler } from './quality/quality-assessment/calculate-risk.js';
|
|
16
|
-
import { handler as predictDefectsHandler } from './quality/defect-intelligence/predict-defects.js';
|
|
17
|
-
import { handler as analyzeDefectHandler } from './quality/defect-intelligence/analyze-root-cause.js';
|
|
18
|
-
import { handler as findSimilarDefectsHandler } from './quality/defect-intelligence/find-similar-defects.js';
|
|
19
|
-
import { handler as securityScanHandler } from './quality/security-compliance/security-scan.js';
|
|
20
|
-
import { handler as auditComplianceHandler } from './quality/security-compliance/audit-compliance.js';
|
|
21
13
|
import { handler as detectSecretsHandler } from './quality/security-compliance/detect-secrets.js';
|
|
22
|
-
import { handler as chaosInjectHandler } from './quality/chaos-resilience/chaos-inject.js';
|
|
23
14
|
// monolean: minimal context shim — quality handlers call context.get() which
|
|
24
15
|
// is optional; returning undefined is safe for all current handlers.
|
|
25
16
|
const noopContext = { get: (_key) => undefined };
|
|
@@ -30,84 +21,6 @@ function wrap(handler) {
|
|
|
30
21
|
};
|
|
31
22
|
}
|
|
32
23
|
export const qualityTools = [
|
|
33
|
-
{
|
|
34
|
-
name: 'quality_generate_tests',
|
|
35
|
-
description: 'Generate AI-powered tests for code. Supports unit, integration, e2e, property, mutation, and fuzz test types across multiple frameworks.',
|
|
36
|
-
category: 'quality',
|
|
37
|
-
version: '0.1.0',
|
|
38
|
-
inputSchema: {
|
|
39
|
-
type: 'object',
|
|
40
|
-
properties: {
|
|
41
|
-
targetPath: { type: 'string', description: 'Path to file/directory to test' },
|
|
42
|
-
testType: { type: 'string', enum: ['unit', 'integration', 'e2e', 'property', 'mutation', 'fuzz'] },
|
|
43
|
-
framework: { type: 'string', enum: ['vitest', 'jest', 'mocha', 'pytest', 'junit'] },
|
|
44
|
-
coverage: {
|
|
45
|
-
type: 'object',
|
|
46
|
-
properties: {
|
|
47
|
-
target: { type: 'number' },
|
|
48
|
-
focusGaps: { type: 'boolean' },
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
style: { type: 'string', enum: ['tdd-london', 'tdd-chicago', 'bdd', 'example-based'] },
|
|
52
|
-
language: { type: 'string', enum: ['typescript', 'javascript', 'python', 'java', 'go', 'rust'] },
|
|
53
|
-
includeEdgeCases: { type: 'boolean' },
|
|
54
|
-
includeMocks: { type: 'boolean' },
|
|
55
|
-
maxTests: { type: 'number' },
|
|
56
|
-
},
|
|
57
|
-
required: ['targetPath'],
|
|
58
|
-
},
|
|
59
|
-
handler: wrap(generateTestsHandler),
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: 'quality_tdd_cycle',
|
|
63
|
-
description: 'Run a TDD red-green-refactor cycle for a requirement. Creates failing test, minimal implementation, then refactors.',
|
|
64
|
-
category: 'quality',
|
|
65
|
-
version: '0.1.0',
|
|
66
|
-
inputSchema: {
|
|
67
|
-
type: 'object',
|
|
68
|
-
properties: {
|
|
69
|
-
requirement: { type: 'string', description: 'Requirement or feature to implement via TDD' },
|
|
70
|
-
targetPath: { type: 'string', description: 'Path to file/directory for implementation' },
|
|
71
|
-
framework: { type: 'string', enum: ['vitest', 'jest', 'mocha', 'pytest', 'junit'] },
|
|
72
|
-
language: { type: 'string', enum: ['typescript', 'javascript', 'python', 'java', 'go', 'rust'] },
|
|
73
|
-
style: { type: 'string', enum: ['tdd-london', 'tdd-chicago', 'bdd', 'example-based'] },
|
|
74
|
-
},
|
|
75
|
-
required: ['requirement', 'targetPath'],
|
|
76
|
-
},
|
|
77
|
-
handler: wrap(tddCycleHandler),
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'quality_suggest_tests',
|
|
81
|
-
description: 'Suggest tests to improve coverage for a given file or directory. Returns prioritized test suggestions.',
|
|
82
|
-
category: 'quality',
|
|
83
|
-
version: '0.1.0',
|
|
84
|
-
inputSchema: {
|
|
85
|
-
type: 'object',
|
|
86
|
-
properties: {
|
|
87
|
-
targetPath: { type: 'string', description: 'Path to file/directory to analyze' },
|
|
88
|
-
maxSuggestions: { type: 'number' },
|
|
89
|
-
focusAreas: { type: 'array', items: { type: 'string' } },
|
|
90
|
-
},
|
|
91
|
-
required: ['targetPath'],
|
|
92
|
-
},
|
|
93
|
-
handler: wrap(suggestTestsHandler),
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: 'quality_analyze_coverage',
|
|
97
|
-
description: 'Analyze test coverage for a file or directory. Returns coverage metrics and identifies gaps.',
|
|
98
|
-
category: 'quality',
|
|
99
|
-
version: '0.1.0',
|
|
100
|
-
inputSchema: {
|
|
101
|
-
type: 'object',
|
|
102
|
-
properties: {
|
|
103
|
-
targetPath: { type: 'string', description: 'Path to file/directory to analyze' },
|
|
104
|
-
includeUncovered: { type: 'boolean' },
|
|
105
|
-
threshold: { type: 'number' },
|
|
106
|
-
},
|
|
107
|
-
required: ['targetPath'],
|
|
108
|
-
},
|
|
109
|
-
handler: wrap(analyzeCoverageHandler),
|
|
110
|
-
},
|
|
111
24
|
{
|
|
112
25
|
name: 'quality_prioritize_gaps',
|
|
113
26
|
description: 'Prioritize coverage gaps by risk and impact. Returns ordered list of gaps to address.',
|
|
@@ -124,151 +37,6 @@ export const qualityTools = [
|
|
|
124
37
|
},
|
|
125
38
|
handler: wrap(prioritizeGapsHandler),
|
|
126
39
|
},
|
|
127
|
-
{
|
|
128
|
-
name: 'quality_track_trends',
|
|
129
|
-
description: 'Track coverage trends over time. Returns trend analysis and regression detection.',
|
|
130
|
-
category: 'quality',
|
|
131
|
-
version: '0.1.0',
|
|
132
|
-
inputSchema: {
|
|
133
|
-
type: 'object',
|
|
134
|
-
properties: {
|
|
135
|
-
targetPath: { type: 'string' },
|
|
136
|
-
period: { type: 'string', enum: ['day', 'week', 'month'] },
|
|
137
|
-
metric: { type: 'string', enum: ['line', 'branch', 'function'] },
|
|
138
|
-
},
|
|
139
|
-
required: [],
|
|
140
|
-
},
|
|
141
|
-
handler: wrap(trackTrendsHandler),
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
name: 'quality_evaluate_gate',
|
|
145
|
-
description: 'Evaluate whether code passes quality gates (coverage thresholds, complexity, etc.).',
|
|
146
|
-
category: 'quality',
|
|
147
|
-
version: '0.1.0',
|
|
148
|
-
inputSchema: {
|
|
149
|
-
type: 'object',
|
|
150
|
-
properties: {
|
|
151
|
-
targetPath: { type: 'string' },
|
|
152
|
-
gates: { type: 'array', items: { type: 'object' } },
|
|
153
|
-
strict: { type: 'boolean' },
|
|
154
|
-
},
|
|
155
|
-
required: [],
|
|
156
|
-
},
|
|
157
|
-
handler: wrap(evaluateGateHandler),
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
name: 'quality_assess_readiness',
|
|
161
|
-
description: 'Assess code readiness for release. Checks quality gates, test coverage, and risk factors.',
|
|
162
|
-
category: 'quality',
|
|
163
|
-
version: '0.1.0',
|
|
164
|
-
inputSchema: {
|
|
165
|
-
type: 'object',
|
|
166
|
-
properties: {
|
|
167
|
-
targetPath: { type: 'string' },
|
|
168
|
-
releaseType: { type: 'string', enum: ['major', 'minor', 'patch'] },
|
|
169
|
-
checkList: { type: 'array', items: { type: 'string' } },
|
|
170
|
-
},
|
|
171
|
-
required: [],
|
|
172
|
-
},
|
|
173
|
-
handler: wrap(assessReadinessHandler),
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
name: 'quality_calculate_risk',
|
|
177
|
-
description: 'Calculate risk score for a file or change. Returns risk metrics and recommendations.',
|
|
178
|
-
category: 'quality',
|
|
179
|
-
version: '0.1.0',
|
|
180
|
-
inputSchema: {
|
|
181
|
-
type: 'object',
|
|
182
|
-
properties: {
|
|
183
|
-
targetPath: { type: 'string', description: 'Path to file/directory to assess' },
|
|
184
|
-
includeHistory: { type: 'boolean' },
|
|
185
|
-
riskFactors: { type: 'array', items: { type: 'string' } },
|
|
186
|
-
},
|
|
187
|
-
required: ['targetPath'],
|
|
188
|
-
},
|
|
189
|
-
handler: wrap(calculateRiskHandler),
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
name: 'quality_predict_defects',
|
|
193
|
-
description: 'Predict defect-prone areas in code using static analysis and historical patterns.',
|
|
194
|
-
category: 'quality',
|
|
195
|
-
version: '0.1.0',
|
|
196
|
-
inputSchema: {
|
|
197
|
-
type: 'object',
|
|
198
|
-
properties: {
|
|
199
|
-
targetPath: { type: 'string', description: 'Path to file/directory to analyze' },
|
|
200
|
-
confidence: { type: 'number' },
|
|
201
|
-
maxPredictions: { type: 'number' },
|
|
202
|
-
},
|
|
203
|
-
required: ['targetPath'],
|
|
204
|
-
},
|
|
205
|
-
handler: wrap(predictDefectsHandler),
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
name: 'quality_analyze_defect',
|
|
209
|
-
description: 'Analyze root cause of a defect. Returns causal chain, contributing factors, and fix recommendations.',
|
|
210
|
-
category: 'quality',
|
|
211
|
-
version: '0.1.0',
|
|
212
|
-
inputSchema: {
|
|
213
|
-
type: 'object',
|
|
214
|
-
properties: {
|
|
215
|
-
defect: { type: 'object', description: 'Defect description with title, description, stackTrace' },
|
|
216
|
-
codeContext: { type: 'string' },
|
|
217
|
-
includeFixSuggestions: { type: 'boolean' },
|
|
218
|
-
},
|
|
219
|
-
required: ['defect'],
|
|
220
|
-
},
|
|
221
|
-
handler: wrap(analyzeDefectHandler),
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
name: 'quality_find_similar_defects',
|
|
225
|
-
description: 'Find defects similar to a given query using semantic search.',
|
|
226
|
-
category: 'quality',
|
|
227
|
-
version: '0.1.0',
|
|
228
|
-
inputSchema: {
|
|
229
|
-
type: 'object',
|
|
230
|
-
properties: {
|
|
231
|
-
query: { type: 'string', description: 'Defect description to search for' },
|
|
232
|
-
maxResults: { type: 'number' },
|
|
233
|
-
threshold: { type: 'number' },
|
|
234
|
-
},
|
|
235
|
-
required: ['query'],
|
|
236
|
-
},
|
|
237
|
-
handler: wrap(findSimilarDefectsHandler),
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
name: 'quality_security_scan',
|
|
241
|
-
description: 'Scan code for security vulnerabilities. Returns findings with severity, location, and remediation.',
|
|
242
|
-
category: 'quality',
|
|
243
|
-
version: '0.1.0',
|
|
244
|
-
inputSchema: {
|
|
245
|
-
type: 'object',
|
|
246
|
-
properties: {
|
|
247
|
-
targetPath: { type: 'string', description: 'Path to file/directory to scan' },
|
|
248
|
-
scanType: { type: 'string', enum: ['sast', 'dependency', 'all'] },
|
|
249
|
-
severity: { type: 'string', enum: ['low', 'medium', 'high', 'critical'] },
|
|
250
|
-
excludePatterns: { type: 'array', items: { type: 'string' } },
|
|
251
|
-
},
|
|
252
|
-
required: ['targetPath'],
|
|
253
|
-
},
|
|
254
|
-
handler: wrap(securityScanHandler),
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
name: 'quality_audit_compliance',
|
|
258
|
-
description: 'Audit code for compliance with security standards (OWASP, CWE, GDPR, etc.).',
|
|
259
|
-
category: 'quality',
|
|
260
|
-
version: '0.1.0',
|
|
261
|
-
inputSchema: {
|
|
262
|
-
type: 'object',
|
|
263
|
-
properties: {
|
|
264
|
-
targetPath: { type: 'string', description: 'Path to file/directory to audit' },
|
|
265
|
-
standards: { type: 'array', items: { type: 'string' } },
|
|
266
|
-
strict: { type: 'boolean' },
|
|
267
|
-
},
|
|
268
|
-
required: ['targetPath'],
|
|
269
|
-
},
|
|
270
|
-
handler: wrap(auditComplianceHandler),
|
|
271
|
-
},
|
|
272
40
|
{
|
|
273
41
|
name: 'quality_detect_secrets',
|
|
274
42
|
description: 'Detect hardcoded secrets, API keys, and credentials in code.',
|
|
@@ -286,23 +54,5 @@ export const qualityTools = [
|
|
|
286
54
|
},
|
|
287
55
|
handler: wrap(detectSecretsHandler),
|
|
288
56
|
},
|
|
289
|
-
{
|
|
290
|
-
name: 'quality_chaos_inject',
|
|
291
|
-
description: 'Inject chaos (failures, latency, errors) into a target to test resilience.',
|
|
292
|
-
category: 'quality',
|
|
293
|
-
version: '0.1.0',
|
|
294
|
-
inputSchema: {
|
|
295
|
-
type: 'object',
|
|
296
|
-
properties: {
|
|
297
|
-
target: { type: 'string', description: 'Target service or component' },
|
|
298
|
-
failureType: { type: 'string', enum: ['latency', 'error', 'crash', 'resource-exhaustion', 'network-partition'] },
|
|
299
|
-
duration: { type: 'number' },
|
|
300
|
-
intensity: { type: 'number' },
|
|
301
|
-
dryRun: { type: 'boolean' },
|
|
302
|
-
},
|
|
303
|
-
required: ['target', 'failureType'],
|
|
304
|
-
},
|
|
305
|
-
handler: wrap(chaosInjectHandler),
|
|
306
|
-
},
|
|
307
57
|
];
|
|
308
58
|
//# sourceMappingURL=quality-tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quality-tools.js","sourceRoot":"","sources":["../../../src/mcp-tools/quality-tools.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"quality-tools.js","sourceRoot":"","sources":["../../../src/mcp-tools/quality-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAClG,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AAElG,6EAA6E;AAC7E,qEAAqE;AACrE,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,CAAI,IAAY,EAAiB,EAAE,CAAC,SAAS,EAAE,CAAC;AAE3E,SAAS,IAAI,CACX,OAAqH;IAErH,OAAO,KAAK,EAAE,KAA8B,EAA0B,EAAE;QACtE,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACjD,OAAO,MAAuB,CAAC;IACjC,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAc;IACrC;QACE,IAAI,EAAE,yBAAyB;QAC/B,WAAW,EAAE,uFAAuF;QACpG,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;gBAClD,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC9B,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;aAC5B;YACD,QAAQ,EAAE,EAAE;SACb;QACD,OAAO,EAAE,IAAI,CAAC,qBAAmD,CAAC;KACnE;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,8DAA8D;QAC3E,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;gBAC7E,eAAe,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;gBAC7D,eAAe,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;gBAC7D,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE;aAC1E;YACD,QAAQ,EAAE,CAAC,YAAY,CAAC;SACzB;QACD,OAAO,EAAE,IAAI,CAAC,oBAAkD,CAAC;KAClE;CACF,CAAC"}
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
export interface SonaConfig {
|
|
14
14
|
instantLoopEnabled: boolean;
|
|
15
15
|
backgroundLoopEnabled: boolean;
|
|
16
|
-
|
|
17
|
-
loraRank: number;
|
|
16
|
+
confidenceLearningRate: number;
|
|
18
17
|
ewcLambda: number;
|
|
19
18
|
maxTrajectorySize: number;
|
|
20
19
|
patternThreshold: number;
|
|
@@ -104,7 +103,7 @@ declare class LocalSonaCoordinator {
|
|
|
104
103
|
*/
|
|
105
104
|
addTrajectoryStep(step: TrajectoryStep): void;
|
|
106
105
|
/**
|
|
107
|
-
* End the current trajectory with a verdict and apply
|
|
106
|
+
* End the current trajectory with a verdict and apply confidence updates.
|
|
108
107
|
* Reward mapping: success=1.0, partial=0.5, failure=-0.5
|
|
109
108
|
*
|
|
110
109
|
* For successful/partial trajectories, boosts confidence of similar patterns
|
|
@@ -116,10 +115,10 @@ declare class LocalSonaCoordinator {
|
|
|
116
115
|
}>;
|
|
117
116
|
/**
|
|
118
117
|
* Distill learning from recent successful trajectories.
|
|
119
|
-
* Applies
|
|
118
|
+
* Applies incremental confidence updates and integrates EWC consolidation.
|
|
120
119
|
*
|
|
121
120
|
* For each successful trajectory step with high confidence,
|
|
122
|
-
* increases the pattern's stored confidence by
|
|
121
|
+
* increases the pattern's stored confidence by confidenceLearningRate * reward.
|
|
123
122
|
* Before applying updates, checks EWC penalty to prevent catastrophic forgetting.
|
|
124
123
|
*/
|
|
125
124
|
distillLearning(bank: LocalReasoningBank): Promise<{
|
|
@@ -264,8 +263,8 @@ export declare function getSonaCoordinator(): LocalSonaCoordinator | null;
|
|
|
264
263
|
*/
|
|
265
264
|
export declare function getReasoningBank(): LocalReasoningBank | null;
|
|
266
265
|
/**
|
|
267
|
-
* End the current trajectory with a verdict and apply
|
|
268
|
-
* This is the public API for the SONA
|
|
266
|
+
* End the current trajectory with a verdict and apply confidence updates.
|
|
267
|
+
* This is the public API for the SONA feedback loop.
|
|
269
268
|
*
|
|
270
269
|
* @param verdict - 'success' (reward=1.0), 'partial' (0.5), or 'failure' (-0.5)
|
|
271
270
|
* @returns Update statistics or null if not initialized
|
|
@@ -276,7 +275,7 @@ export declare function endTrajectoryWithVerdict(verdict: 'success' | 'failure'
|
|
|
276
275
|
} | null>;
|
|
277
276
|
/**
|
|
278
277
|
* Distill learning from recent successful trajectories.
|
|
279
|
-
* Applies
|
|
278
|
+
* Applies incremental confidence updates with EWC consolidation protection.
|
|
280
279
|
*
|
|
281
280
|
* @returns Distillation statistics or null if not initialized
|
|
282
281
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intelligence.d.ts","sourceRoot":"","sources":["../../../src/memory/intelligence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG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ank: 8,
|
|
62
|
+
confidenceLearningRate: 0.001,
|
|
64
63
|
ewcLambda: 0.4,
|
|
65
64
|
maxTrajectorySize: 100,
|
|
66
65
|
patternThreshold: 0.7,
|
|
@@ -148,7 +147,7 @@ class LocalSonaCoordinator {
|
|
|
148
147
|
}
|
|
149
148
|
}
|
|
150
149
|
/**
|
|
151
|
-
* End the current trajectory with a verdict and apply
|
|
150
|
+
* End the current trajectory with a verdict and apply confidence updates.
|
|
152
151
|
* Reward mapping: success=1.0, partial=0.5, failure=-0.5
|
|
153
152
|
*
|
|
154
153
|
* For successful/partial trajectories, boosts confidence of similar patterns
|
|
@@ -198,10 +197,10 @@ class LocalSonaCoordinator {
|
|
|
198
197
|
}
|
|
199
198
|
/**
|
|
200
199
|
* Distill learning from recent successful trajectories.
|
|
201
|
-
* Applies
|
|
200
|
+
* Applies incremental confidence updates and integrates EWC consolidation.
|
|
202
201
|
*
|
|
203
202
|
* For each successful trajectory step with high confidence,
|
|
204
|
-
* increases the pattern's stored confidence by
|
|
203
|
+
* increases the pattern's stored confidence by confidenceLearningRate * reward.
|
|
205
204
|
* Before applying updates, checks EWC penalty to prevent catastrophic forgetting.
|
|
206
205
|
*/
|
|
207
206
|
async distillLearning(bank) {
|
|
@@ -249,13 +248,13 @@ class LocalSonaCoordinator {
|
|
|
249
248
|
// Check EWC penalty before applying update
|
|
250
249
|
if (ewcConsolidator) {
|
|
251
250
|
const oldWeights = [oldConfidence];
|
|
252
|
-
const proposedConfidence = Math.min(1.0, oldConfidence + this.config.
|
|
251
|
+
const proposedConfidence = Math.min(1.0, oldConfidence + this.config.confidenceLearningRate * reward);
|
|
253
252
|
const newWeights = [proposedConfidence];
|
|
254
253
|
const penalty = ewcConsolidator.getPenalty(oldWeights, newWeights);
|
|
255
254
|
totalEwcPenalty += penalty;
|
|
256
255
|
// If penalty is too high, reduce the update magnitude
|
|
257
256
|
if (penalty > this.config.ewcLambda) {
|
|
258
|
-
const dampedDelta = (this.config.
|
|
257
|
+
const dampedDelta = (this.config.confidenceLearningRate * reward) / (1 + penalty);
|
|
259
258
|
pattern.confidence = Math.max(0.0, Math.min(1.0, oldConfidence + dampedDelta));
|
|
260
259
|
}
|
|
261
260
|
else {
|
|
@@ -263,8 +262,8 @@ class LocalSonaCoordinator {
|
|
|
263
262
|
}
|
|
264
263
|
}
|
|
265
264
|
else {
|
|
266
|
-
// No
|
|
267
|
-
pattern.confidence = Math.max(0.0, Math.min(1.0, oldConfidence + this.config.
|
|
265
|
+
// No consolidation guard available: apply the full confidence update
|
|
266
|
+
pattern.confidence = Math.max(0.0, Math.min(1.0, oldConfidence + this.config.confidenceLearningRate * reward));
|
|
268
267
|
}
|
|
269
268
|
pattern.lastUsedAt = Date.now();
|
|
270
269
|
patternsDistilled++;
|
|
@@ -612,7 +611,7 @@ async function _doInitializeIntelligence(config) {
|
|
|
612
611
|
});
|
|
613
612
|
// Load persisted stats if available
|
|
614
613
|
loadPersistedStats();
|
|
615
|
-
// Seed neural learned patterns from
|
|
614
|
+
// Seed neural learned patterns from pattern store.
|
|
616
615
|
// This is the A→B bridge reader: connects the automatic learning loop to routing.
|
|
617
616
|
const neuralPatternsPath = join(getDataDir(), 'patterns.json');
|
|
618
617
|
if (existsSync(neuralPatternsPath) && statSync(neuralPatternsPath).size <= 50 * 1024 * 1024) {
|
|
@@ -756,7 +755,7 @@ export async function recordStep(step) {
|
|
|
756
755
|
metadata: step.metadata,
|
|
757
756
|
timestamp: step.timestamp || Date.now()
|
|
758
757
|
});
|
|
759
|
-
// Add to current trajectory for
|
|
758
|
+
// Add to current trajectory for outcome tracking
|
|
760
759
|
const stepWithEmbedding = { ...step, embedding };
|
|
761
760
|
sonaCoordinator.addTrajectoryStep(stepWithEmbedding);
|
|
762
761
|
// Store in ReasoningBank for retrieval
|
|
@@ -770,7 +769,7 @@ export async function recordStep(step) {
|
|
|
770
769
|
metadata: step.metadata
|
|
771
770
|
});
|
|
772
771
|
}
|
|
773
|
-
// When a 'result' step arrives, end the trajectory and run
|
|
772
|
+
// When a 'result' step arrives, end the trajectory and run the confidence-update loop
|
|
774
773
|
if (step.type === 'result' && reasoningBank) {
|
|
775
774
|
// Determine verdict from metadata or default to 'partial'
|
|
776
775
|
const verdict = step.metadata?.verdict || 'partial';
|
|
@@ -801,7 +800,7 @@ export async function recordTrajectory(steps, verdict) {
|
|
|
801
800
|
verdict,
|
|
802
801
|
timestamp: Date.now()
|
|
803
802
|
});
|
|
804
|
-
//
|
|
803
|
+
// Update pattern confidences based on verdict
|
|
805
804
|
if (reasoningBank) {
|
|
806
805
|
// Load steps into the coordinator for endTrajectory processing
|
|
807
806
|
for (const step of steps) {
|
|
@@ -904,8 +903,8 @@ export function getReasoningBank() {
|
|
|
904
903
|
return reasoningBank;
|
|
905
904
|
}
|
|
906
905
|
/**
|
|
907
|
-
* End the current trajectory with a verdict and apply
|
|
908
|
-
* This is the public API for the SONA
|
|
906
|
+
* End the current trajectory with a verdict and apply confidence updates.
|
|
907
|
+
* This is the public API for the SONA feedback loop.
|
|
909
908
|
*
|
|
910
909
|
* @param verdict - 'success' (reward=1.0), 'partial' (0.5), or 'failure' (-0.5)
|
|
911
910
|
* @returns Update statistics or null if not initialized
|
|
@@ -928,7 +927,7 @@ export async function endTrajectoryWithVerdict(verdict) {
|
|
|
928
927
|
}
|
|
929
928
|
/**
|
|
930
929
|
* Distill learning from recent successful trajectories.
|
|
931
|
-
* Applies
|
|
930
|
+
* Applies incremental confidence updates with EWC consolidation protection.
|
|
932
931
|
*
|
|
933
932
|
* @returns Distillation statistics or null if not initialized
|
|
934
933
|
*/
|