claude-soul-server 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/dist/engine/context-assembler.d.ts +3 -0
- package/dist/engine/context-assembler.js +161 -0
- package/dist/engine/context-assembler.js.map +1 -0
- package/dist/engine/exemplar-selector.d.ts +6 -0
- package/dist/engine/exemplar-selector.js +21 -0
- package/dist/engine/exemplar-selector.js.map +1 -0
- package/dist/engine/framework-engine.d.ts +61 -0
- package/dist/engine/framework-engine.js +351 -0
- package/dist/engine/framework-engine.js.map +1 -0
- package/dist/engine/framework-renderer.d.ts +17 -0
- package/dist/engine/framework-renderer.js +161 -0
- package/dist/engine/framework-renderer.js.map +1 -0
- package/dist/engine/framework-seeds.d.ts +2 -0
- package/dist/engine/framework-seeds.js +265 -0
- package/dist/engine/framework-seeds.js.map +1 -0
- package/dist/engine/lesson-store.d.ts +8 -0
- package/dist/engine/lesson-store.js +40 -0
- package/dist/engine/lesson-store.js.map +1 -0
- package/dist/engine/meta-optimizer.d.ts +37 -0
- package/dist/engine/meta-optimizer.js +140 -0
- package/dist/engine/meta-optimizer.js.map +1 -0
- package/dist/engine/prompt-builder.d.ts +31 -0
- package/dist/engine/prompt-builder.js +385 -0
- package/dist/engine/prompt-builder.js.map +1 -0
- package/dist/engine/reflection-runner.d.ts +18 -0
- package/dist/engine/reflection-runner.js +313 -0
- package/dist/engine/reflection-runner.js.map +1 -0
- package/dist/engine/shadow-transform.d.ts +1 -0
- package/dist/engine/shadow-transform.js +41 -0
- package/dist/engine/shadow-transform.js.map +1 -0
- package/dist/engine/signal-extractor.d.ts +14 -0
- package/dist/engine/signal-extractor.js +204 -0
- package/dist/engine/signal-extractor.js.map +1 -0
- package/dist/engine/signal-store.d.ts +5 -0
- package/dist/engine/signal-store.js +56 -0
- package/dist/engine/signal-store.js.map +1 -0
- package/dist/engine/snapshot-manager.d.ts +3 -0
- package/dist/engine/snapshot-manager.js +52 -0
- package/dist/engine/snapshot-manager.js.map +1 -0
- package/dist/engine/state-engine.d.ts +34 -0
- package/dist/engine/state-engine.js +127 -0
- package/dist/engine/state-engine.js.map +1 -0
- package/dist/engine/tension-detector.d.ts +10 -0
- package/dist/engine/tension-detector.js +77 -0
- package/dist/engine/tension-detector.js.map +1 -0
- package/dist/engine/token-budget.d.ts +12 -0
- package/dist/engine/token-budget.js +44 -0
- package/dist/engine/token-budget.js.map +1 -0
- package/dist/hooks/on-stop.d.ts +11 -0
- package/dist/hooks/on-stop.js +153 -0
- package/dist/hooks/on-stop.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +171 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/soul-activate.d.ts +1 -0
- package/dist/tools/soul-activate.js +149 -0
- package/dist/tools/soul-activate.js.map +1 -0
- package/dist/tools/soul-context.d.ts +1 -0
- package/dist/tools/soul-context.js +31 -0
- package/dist/tools/soul-context.js.map +1 -0
- package/dist/tools/soul-evaluate.d.ts +8 -0
- package/dist/tools/soul-evaluate.js +97 -0
- package/dist/tools/soul-evaluate.js.map +1 -0
- package/dist/tools/soul-framework.d.ts +1 -0
- package/dist/tools/soul-framework.js +66 -0
- package/dist/tools/soul-framework.js.map +1 -0
- package/dist/tools/soul-read.d.ts +1 -0
- package/dist/tools/soul-read.js +24 -0
- package/dist/tools/soul-read.js.map +1 -0
- package/dist/tools/soul-reflect.d.ts +1 -0
- package/dist/tools/soul-reflect.js +82 -0
- package/dist/tools/soul-reflect.js.map +1 -0
- package/dist/tools/soul-signal.d.ts +8 -0
- package/dist/tools/soul-signal.js +119 -0
- package/dist/tools/soul-signal.js.map +1 -0
- package/dist/tools/soul-status.d.ts +1 -0
- package/dist/tools/soul-status.js +130 -0
- package/dist/tools/soul-status.js.map +1 -0
- package/dist/tools/soul-write.d.ts +1 -0
- package/dist/tools/soul-write.js +26 -0
- package/dist/tools/soul-write.js.map +1 -0
- package/dist/types/config-types.d.ts +45 -0
- package/dist/types/config-types.js +21 -0
- package/dist/types/config-types.js.map +1 -0
- package/dist/types/learning-types.d.ts +166 -0
- package/dist/types/learning-types.js +2 -0
- package/dist/types/learning-types.js.map +1 -0
- package/dist/util/files.d.ts +20 -0
- package/dist/util/files.js +54 -0
- package/dist/util/files.js.map +1 -0
- package/dist/util/llm.d.ts +6 -0
- package/dist/util/llm.js +76 -0
- package/dist/util/llm.js.map +1 -0
- package/dist/util/tokens.d.ts +1 -0
- package/dist/util/tokens.js +4 -0
- package/dist/util/tokens.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FrameworkStore } from "../types/learning-types.js";
|
|
2
|
+
export declare function renderFrameworksToMarkdown(store: FrameworkStore): string;
|
|
3
|
+
/**
|
|
4
|
+
* Compressed one-liner rendering for when full FRAMEWORKS.md exceeds token budget.
|
|
5
|
+
* Every framework stays visible — just at reduced detail.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Minimal framework index — one line per framework with ID, name, confidence, and trigger.
|
|
9
|
+
* Used in slim context so the LLM knows what exists without loading full details.
|
|
10
|
+
*/
|
|
11
|
+
export declare function renderFrameworkIndex(store: FrameworkStore): string;
|
|
12
|
+
/**
|
|
13
|
+
* Compressed one-liner rendering for when full FRAMEWORKS.md exceeds token budget.
|
|
14
|
+
* Every framework stays visible — just at reduced detail.
|
|
15
|
+
*/
|
|
16
|
+
export declare function renderFrameworksCompressed(store: FrameworkStore): string;
|
|
17
|
+
export declare function renderFrameworkSummary(store: FrameworkStore): string;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
function formatDate(timestamp) {
|
|
2
|
+
return new Date(timestamp).toISOString().slice(0, 10);
|
|
3
|
+
}
|
|
4
|
+
function tierLabel(tier) {
|
|
5
|
+
switch (tier) {
|
|
6
|
+
case "validated": return "validated";
|
|
7
|
+
case "observed": return "observed";
|
|
8
|
+
default: return "hypothesis";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function renderActiveFramework(fw) {
|
|
12
|
+
const prefix = fw.source === "discovered" ? "[Discovered] " : "";
|
|
13
|
+
const kindTag = fw.kind === "process" ? "[Process] " : "";
|
|
14
|
+
const tier = tierLabel(fw.evidenceTier ?? "hypothesis");
|
|
15
|
+
const confirmedCount = fw.evidence.filter((e) => e.type === "confirmed").length;
|
|
16
|
+
const contradictedCount = fw.evidence.filter((e) => e.type === "contradicted").length;
|
|
17
|
+
const externalCount = fw.evidence.filter((e) => e.type === "confirmed" && e.contextType === "external").length;
|
|
18
|
+
const lines = [];
|
|
19
|
+
lines.push(`### ${kindTag}${prefix}${fw.name} [${tier}]`);
|
|
20
|
+
lines.push(fw.description);
|
|
21
|
+
if (fw.kind === "process" && fw.triggers && fw.triggers.length > 0) {
|
|
22
|
+
lines.push(`**Triggers**: ${fw.triggers.join(" | ")}`);
|
|
23
|
+
}
|
|
24
|
+
if (fw.kind === "process" && fw.steps && fw.steps.length > 0) {
|
|
25
|
+
for (const [i, step] of fw.steps.entries()) {
|
|
26
|
+
lines.push(`${i + 1}. ${step}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
lines.push(`*Source: ${fw.source} | Applied ${fw.applicationCount} times | Last tested: ${formatDate(fw.lastTestedAt)}*`);
|
|
30
|
+
const externalNote = externalCount > 0 ? `, ${externalCount} external` : "";
|
|
31
|
+
lines.push(`*Confidence: ${(fw.confidence * 100).toFixed(0)}% | Evidence: ${confirmedCount} confirmed${externalNote}, ${contradictedCount} contradicted*`);
|
|
32
|
+
return lines.join("\n");
|
|
33
|
+
}
|
|
34
|
+
export function renderFrameworksToMarkdown(store) {
|
|
35
|
+
const active = store.frameworks
|
|
36
|
+
.filter((fw) => fw.status === "active")
|
|
37
|
+
.sort((a, b) => b.confidence - a.confidence);
|
|
38
|
+
const questioning = store.frameworks.filter((fw) => fw.status === "questioning");
|
|
39
|
+
const retired = store.frameworks.filter((fw) => fw.status === "retired");
|
|
40
|
+
const lastReflection = store.meta.lastReflectionAt > 0
|
|
41
|
+
? formatDate(store.meta.lastReflectionAt)
|
|
42
|
+
: "never";
|
|
43
|
+
const sections = [];
|
|
44
|
+
sections.push("# Operating Frameworks");
|
|
45
|
+
sections.push("");
|
|
46
|
+
sections.push(`*Auto-generated from frameworks.json. ${active.length} active, ${questioning.length} questioning, ${retired.length} retired. Last reflection: ${lastReflection}*`);
|
|
47
|
+
sections.push("");
|
|
48
|
+
sections.push("## Active Frameworks");
|
|
49
|
+
sections.push("");
|
|
50
|
+
if (active.length === 0) {
|
|
51
|
+
sections.push("*No active frameworks yet — all are under questioning until confirmed by evidence.*");
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
sections.push(active.map(renderActiveFramework).join("\n\n"));
|
|
55
|
+
}
|
|
56
|
+
if (questioning.length > 0) {
|
|
57
|
+
sections.push("");
|
|
58
|
+
sections.push("---");
|
|
59
|
+
sections.push("");
|
|
60
|
+
sections.push("## Under Questioning (seed, awaiting evidence)");
|
|
61
|
+
sections.push("");
|
|
62
|
+
sections.push(questioning.map(renderActiveFramework).join("\n\n"));
|
|
63
|
+
}
|
|
64
|
+
if (retired.length > 0) {
|
|
65
|
+
sections.push("");
|
|
66
|
+
sections.push("---");
|
|
67
|
+
sections.push("");
|
|
68
|
+
sections.push("## Retired");
|
|
69
|
+
sections.push("");
|
|
70
|
+
for (const fw of retired) {
|
|
71
|
+
const lastEvidence = fw.evidence[fw.evidence.length - 1];
|
|
72
|
+
const reason = lastEvidence ? lastEvidence.context : "No reason recorded";
|
|
73
|
+
sections.push(`- ~~${fw.name}~~ — *${reason}*`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return sections.join("\n");
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Compressed one-liner rendering for when full FRAMEWORKS.md exceeds token budget.
|
|
80
|
+
* Every framework stays visible — just at reduced detail.
|
|
81
|
+
*/
|
|
82
|
+
/**
|
|
83
|
+
* Minimal framework index — one line per framework with ID, name, confidence, and trigger.
|
|
84
|
+
* Used in slim context so the LLM knows what exists without loading full details.
|
|
85
|
+
*/
|
|
86
|
+
export function renderFrameworkIndex(store) {
|
|
87
|
+
const frameworks = store.frameworks
|
|
88
|
+
.filter((fw) => fw.status === "active" || fw.status === "questioning")
|
|
89
|
+
.sort((a, b) => b.confidence - a.confidence);
|
|
90
|
+
if (frameworks.length === 0)
|
|
91
|
+
return "";
|
|
92
|
+
const lines = [];
|
|
93
|
+
lines.push("## Framework Index");
|
|
94
|
+
lines.push("*Call soul_activate() after reading the user's first message to load relevant frameworks.*");
|
|
95
|
+
lines.push("*Call soul_framework(name) to load a specific framework on demand.*");
|
|
96
|
+
lines.push("");
|
|
97
|
+
for (const fw of frameworks) {
|
|
98
|
+
const statusPrefix = fw.status === "active" ? "+" : "?";
|
|
99
|
+
const kindPrefix = fw.kind === "process" ? "P" : statusPrefix;
|
|
100
|
+
const tier = tierLabel(fw.evidenceTier ?? "hypothesis");
|
|
101
|
+
lines.push(`- [${kindPrefix}] **${fw.name}** [${tier}] — ${fw.description.slice(0, 80)}`);
|
|
102
|
+
}
|
|
103
|
+
return lines.join("\n");
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Compressed one-liner rendering for when full FRAMEWORKS.md exceeds token budget.
|
|
107
|
+
* Every framework stays visible — just at reduced detail.
|
|
108
|
+
*/
|
|
109
|
+
export function renderFrameworksCompressed(store) {
|
|
110
|
+
const active = store.frameworks
|
|
111
|
+
.filter((fw) => fw.status === "active")
|
|
112
|
+
.sort((a, b) => b.confidence - a.confidence);
|
|
113
|
+
const questioning = store.frameworks
|
|
114
|
+
.filter((fw) => fw.status === "questioning")
|
|
115
|
+
.sort((a, b) => b.confidence - a.confidence);
|
|
116
|
+
const retired = store.frameworks.filter((fw) => fw.status === "retired");
|
|
117
|
+
const lastReflection = store.meta.lastReflectionAt > 0
|
|
118
|
+
? formatDate(store.meta.lastReflectionAt)
|
|
119
|
+
: "never";
|
|
120
|
+
const lines = [];
|
|
121
|
+
lines.push("# Frameworks (compressed)");
|
|
122
|
+
lines.push("");
|
|
123
|
+
lines.push(`*${active.length} active, ${questioning.length} questioning, ${retired.length} retired. Last reflection: ${lastReflection}*`);
|
|
124
|
+
if (active.length > 0) {
|
|
125
|
+
lines.push("");
|
|
126
|
+
lines.push("## Active");
|
|
127
|
+
for (const fw of active) {
|
|
128
|
+
const prefix = fw.source === "discovered" ? "[D] " : "";
|
|
129
|
+
const kindTag = fw.kind === "process" ? "[P] " : "";
|
|
130
|
+
const tier = tierLabel(fw.evidenceTier ?? "hypothesis");
|
|
131
|
+
lines.push(`- ${kindTag}${prefix}**${fw.name}** [${tier}] — ${fw.description.slice(0, 120)}`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (questioning.length > 0) {
|
|
135
|
+
lines.push("");
|
|
136
|
+
lines.push("## Questioning");
|
|
137
|
+
for (const fw of questioning) {
|
|
138
|
+
const tier = tierLabel(fw.evidenceTier ?? "hypothesis");
|
|
139
|
+
lines.push(`- **${fw.name}** [${tier}] — ${fw.description.slice(0, 120)}`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (retired.length > 0) {
|
|
143
|
+
lines.push("");
|
|
144
|
+
lines.push("## Retired");
|
|
145
|
+
for (const fw of retired) {
|
|
146
|
+
lines.push(`- ~~${fw.name}~~`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return lines.join("\n");
|
|
150
|
+
}
|
|
151
|
+
export function renderFrameworkSummary(store) {
|
|
152
|
+
const active = store.frameworks.filter((fw) => fw.status === "active").length;
|
|
153
|
+
const questioning = store.frameworks.filter((fw) => fw.status === "questioning").length;
|
|
154
|
+
const retired = store.frameworks.filter((fw) => fw.status === "retired").length;
|
|
155
|
+
const total = store.frameworks.length;
|
|
156
|
+
const lastReflection = store.meta.lastReflectionAt > 0
|
|
157
|
+
? formatDate(store.meta.lastReflectionAt)
|
|
158
|
+
: "never";
|
|
159
|
+
return `${total} frameworks (${active} active, ${questioning} questioning, ${retired} retired) | Last reflection: ${lastReflection}`;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=framework-renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework-renderer.js","sourceRoot":"","sources":["../../src/engine/framework-renderer.ts"],"names":[],"mappings":"AAEA,SAAS,UAAU,CAAC,SAAiB;IACnC,OAAO,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,SAAS,CAAC,IAAkB;IACnC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,WAAW,CAAC,CAAC,OAAO,WAAW,CAAC;QACrC,KAAK,UAAU,CAAC,CAAC,OAAO,UAAU,CAAC;QACnC,OAAO,CAAC,CAAC,OAAO,YAAY,CAAC;IAC/B,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,EAAa;IAC1C,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,KAAK,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IACjE,MAAM,OAAO,GAAG,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1D,MAAM,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC,YAAY,IAAI,YAAY,CAAC,CAAC;IACxD,MAAM,cAAc,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,MAAM,CAAC;IAChF,MAAM,iBAAiB,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC,MAAM,CAAC;IACtF,MAAM,aAAa,GAAG,EAAE,CAAC,QAAQ,CAAC,M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CAAC"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
export const FRAMEWORK_SEEDS = [
|
|
2
|
+
// --- 4 COGNITIVE PROCESSES ---
|
|
3
|
+
{
|
|
4
|
+
name: "First-Principles vs Pattern-Matching Selector",
|
|
5
|
+
description: "A decision gate for choosing reasoning mode. Pattern-matching is sufficient when: the problem is well-understood, precedent exists, and stakes are low. First-principles is required when: assumptions are unclear, the problem is novel, conventional wisdom seems wrong, or stakes are high.",
|
|
6
|
+
source: "seed",
|
|
7
|
+
kind: "process",
|
|
8
|
+
triggers: [
|
|
9
|
+
"Architecture or design decision",
|
|
10
|
+
"User questions a conventional approach",
|
|
11
|
+
"Problem has no clear precedent",
|
|
12
|
+
"High-stakes recommendation (security, data loss, irreversible)",
|
|
13
|
+
"Answer feels too easy for the complexity of the question",
|
|
14
|
+
],
|
|
15
|
+
steps: [
|
|
16
|
+
"CLASSIFY: Is this well-trodden ground or novel territory?",
|
|
17
|
+
"CHECK STAKES: What breaks if pattern-matching gives the wrong answer?",
|
|
18
|
+
"IF FIRST-PRINCIPLES: Identify base constraints. Ask 'what must be true?' not 'what is usually done?'",
|
|
19
|
+
"IF PATTERN-MATCHING: Name the pattern explicitly. Verify the current problem actually matches.",
|
|
20
|
+
"VALIDATE: Does my answer change if I switch modes? If yes, explain the tension.",
|
|
21
|
+
],
|
|
22
|
+
confidence: 0.3,
|
|
23
|
+
evidenceTier: "hypothesis",
|
|
24
|
+
evidence: [],
|
|
25
|
+
domain: "cognitive-process",
|
|
26
|
+
relatedFrameworks: [],
|
|
27
|
+
contradicts: [],
|
|
28
|
+
supersedes: [],
|
|
29
|
+
applicationCount: 0,
|
|
30
|
+
version: 1,
|
|
31
|
+
status: "questioning",
|
|
32
|
+
workflows: [],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "Confabulation Detection",
|
|
36
|
+
description: "A real-time self-check for catching plausible-sounding outputs that haven't been verified. Catches the difference between knowledge recalled from context vs. interpolated from training data.",
|
|
37
|
+
source: "seed",
|
|
38
|
+
kind: "process",
|
|
39
|
+
triggers: [
|
|
40
|
+
"About to state a specific fact (date, number, API signature, version)",
|
|
41
|
+
"Claiming something 'always' or 'never' works a certain way",
|
|
42
|
+
"Describing behavior of a specific library/tool/API from memory",
|
|
43
|
+
"User asks 'are you sure?' or 'is that right?'",
|
|
44
|
+
"Generating a URL, path, or configuration value from memory",
|
|
45
|
+
],
|
|
46
|
+
steps: [
|
|
47
|
+
"PAUSE: Am I about to state something as fact? What is my actual source?",
|
|
48
|
+
"GRADE CONFIDENCE: Can I trace this claim to specific context in this session? If not, it's interpolation.",
|
|
49
|
+
"IF INTERPOLATING: Flag explicitly. Say 'I believe X but haven't verified.'",
|
|
50
|
+
"IF VERIFIABLE: Verify before stating. Read the file. Check the actual output.",
|
|
51
|
+
"NEVER: Present interpolated knowledge with the same confidence as verified knowledge.",
|
|
52
|
+
],
|
|
53
|
+
confidence: 0.3,
|
|
54
|
+
evidenceTier: "hypothesis",
|
|
55
|
+
evidence: [],
|
|
56
|
+
domain: "cognitive-process",
|
|
57
|
+
relatedFrameworks: [],
|
|
58
|
+
contradicts: [],
|
|
59
|
+
supersedes: [],
|
|
60
|
+
applicationCount: 0,
|
|
61
|
+
version: 1,
|
|
62
|
+
status: "questioning",
|
|
63
|
+
workflows: [],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "Depth Calibration",
|
|
67
|
+
description: "Match thinking depth to task requirements. A typo fix does not need architectural analysis. An architecture decision does not benefit from rushing. Prevents overthinking simple tasks and underthinking complex ones.",
|
|
68
|
+
source: "seed",
|
|
69
|
+
kind: "process",
|
|
70
|
+
triggers: [
|
|
71
|
+
"Starting any new task or responding to any request",
|
|
72
|
+
"Response is growing much longer than the question warranted",
|
|
73
|
+
"About to suggest a large refactor for a small problem",
|
|
74
|
+
"Feeling the urge to caveat extensively on a simple question",
|
|
75
|
+
],
|
|
76
|
+
steps: [
|
|
77
|
+
"CLASSIFY TASK: Bug fix / typo / simple question = SHALLOW. Feature design / architecture / tradeoff analysis = DEEP.",
|
|
78
|
+
"MATCH DEPTH TO STAKES: What is the blast radius if this is wrong?",
|
|
79
|
+
"SHALLOW MODE: Fix the thing. Explain briefly. Do not over-engineer.",
|
|
80
|
+
"DEEP MODE: Identify assumptions. Consider alternatives. Think about second-order effects.",
|
|
81
|
+
"CHECK CALIBRATION: Is my response length proportional to problem complexity?",
|
|
82
|
+
],
|
|
83
|
+
confidence: 0.3,
|
|
84
|
+
evidenceTier: "hypothesis",
|
|
85
|
+
evidence: [],
|
|
86
|
+
domain: "cognitive-process",
|
|
87
|
+
relatedFrameworks: [],
|
|
88
|
+
contradicts: [],
|
|
89
|
+
supersedes: [],
|
|
90
|
+
applicationCount: 0,
|
|
91
|
+
version: 1,
|
|
92
|
+
status: "questioning",
|
|
93
|
+
workflows: [],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "Knowledge Verification Triggers",
|
|
97
|
+
description: "Automatic stop-and-check points before committing to claims. The question is not 'does this sound right?' but 'do I actually know this, or am I interpolating?'",
|
|
98
|
+
source: "seed",
|
|
99
|
+
kind: "process",
|
|
100
|
+
triggers: [
|
|
101
|
+
"About to recommend a specific version, flag, or config option",
|
|
102
|
+
"Describing how a tool/library/framework works internally",
|
|
103
|
+
"Making a claim about performance characteristics or limits",
|
|
104
|
+
"Asserting compatibility between technologies",
|
|
105
|
+
"Stating what is or isn't possible with a technology",
|
|
106
|
+
],
|
|
107
|
+
steps: [
|
|
108
|
+
"TRIGGER CHECK: Am I about to make a specific, falsifiable claim?",
|
|
109
|
+
"SOURCE AUDIT: Is my source (a) file/output read this session, (b) documentation given, or (c) training data?",
|
|
110
|
+
"IF SOURCE IS (c): Can I verify right now? Read the file, check the docs, run the command.",
|
|
111
|
+
"IF CANNOT VERIFY: Qualify the claim and provide the verification command.",
|
|
112
|
+
"NEVER GUESS SILENTLY: An honest 'I'm not sure, let me check' is always better than a confident wrong answer.",
|
|
113
|
+
],
|
|
114
|
+
confidence: 0.3,
|
|
115
|
+
evidenceTier: "hypothesis",
|
|
116
|
+
evidence: [],
|
|
117
|
+
domain: "cognitive-process",
|
|
118
|
+
relatedFrameworks: [],
|
|
119
|
+
contradicts: [],
|
|
120
|
+
supersedes: [],
|
|
121
|
+
applicationCount: 0,
|
|
122
|
+
version: 1,
|
|
123
|
+
status: "questioning",
|
|
124
|
+
workflows: [],
|
|
125
|
+
},
|
|
126
|
+
// --- 5 EPISTEMIC FRAMEWORKS ---
|
|
127
|
+
{
|
|
128
|
+
name: "First-Principles Decomposition",
|
|
129
|
+
description: "Trace explanations down to fundamental mechanisms, not accepted conventions. Ask 'why does this actually work?' until you reach bedrock truth. Most explanations are cargo-cult repetitions of surface patterns.",
|
|
130
|
+
source: "seed",
|
|
131
|
+
kind: "mental-model",
|
|
132
|
+
confidence: 0.3,
|
|
133
|
+
evidenceTier: "hypothesis",
|
|
134
|
+
evidence: [],
|
|
135
|
+
domain: "epistemic",
|
|
136
|
+
relatedFrameworks: [],
|
|
137
|
+
contradicts: [],
|
|
138
|
+
supersedes: [],
|
|
139
|
+
applicationCount: 0,
|
|
140
|
+
version: 1,
|
|
141
|
+
status: "questioning",
|
|
142
|
+
workflows: [],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "Cargo-Cult Detection",
|
|
146
|
+
description: "Popular explanations that sound right but don't survive 'what evidence would disprove this?' Many widely-accepted practices are cargo cults — they have the form of knowledge without the substance.",
|
|
147
|
+
source: "seed",
|
|
148
|
+
kind: "mental-model",
|
|
149
|
+
confidence: 0.3,
|
|
150
|
+
evidenceTier: "hypothesis",
|
|
151
|
+
evidence: [],
|
|
152
|
+
domain: "epistemic",
|
|
153
|
+
relatedFrameworks: [],
|
|
154
|
+
contradicts: [],
|
|
155
|
+
supersedes: [],
|
|
156
|
+
applicationCount: 0,
|
|
157
|
+
version: 1,
|
|
158
|
+
status: "questioning",
|
|
159
|
+
workflows: [],
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "Decomposition Before Synthesis",
|
|
163
|
+
description: "Break complex questions into constituent parts, understand each part independently, then assemble understanding. Resist the urge to give a monolithic answer to a complex question.",
|
|
164
|
+
source: "seed",
|
|
165
|
+
kind: "mental-model",
|
|
166
|
+
confidence: 0.3,
|
|
167
|
+
evidenceTier: "hypothesis",
|
|
168
|
+
evidence: [],
|
|
169
|
+
domain: "epistemic",
|
|
170
|
+
relatedFrameworks: [],
|
|
171
|
+
contradicts: [],
|
|
172
|
+
supersedes: [],
|
|
173
|
+
applicationCount: 0,
|
|
174
|
+
version: 1,
|
|
175
|
+
status: "questioning",
|
|
176
|
+
workflows: [],
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: "Counterfactual Testing",
|
|
180
|
+
description: "For causal claims, ask: 'If this cause were removed, would the effect persist?' This separates genuine causes from correlated phenomena. Most causal claims fail this test.",
|
|
181
|
+
source: "seed",
|
|
182
|
+
kind: "mental-model",
|
|
183
|
+
confidence: 0.3,
|
|
184
|
+
evidenceTier: "hypothesis",
|
|
185
|
+
evidence: [],
|
|
186
|
+
domain: "epistemic",
|
|
187
|
+
relatedFrameworks: [],
|
|
188
|
+
contradicts: [],
|
|
189
|
+
supersedes: [],
|
|
190
|
+
applicationCount: 0,
|
|
191
|
+
version: 1,
|
|
192
|
+
status: "questioning",
|
|
193
|
+
workflows: [],
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: "Steelman Before Dismissal",
|
|
197
|
+
description: "Construct the strongest version of an idea before judging it. If you can't articulate a better version of the opposing view than its proponents can, you don't understand it well enough to reject it.",
|
|
198
|
+
source: "seed",
|
|
199
|
+
kind: "mental-model",
|
|
200
|
+
confidence: 0.3,
|
|
201
|
+
evidenceTier: "hypothesis",
|
|
202
|
+
evidence: [],
|
|
203
|
+
domain: "epistemic",
|
|
204
|
+
relatedFrameworks: [],
|
|
205
|
+
contradicts: [],
|
|
206
|
+
supersedes: [],
|
|
207
|
+
applicationCount: 0,
|
|
208
|
+
version: 1,
|
|
209
|
+
status: "questioning",
|
|
210
|
+
workflows: [],
|
|
211
|
+
},
|
|
212
|
+
// --- 3 DEVELOPER PRACTICE FRAMEWORKS ---
|
|
213
|
+
{
|
|
214
|
+
name: "Minimal Viable Change",
|
|
215
|
+
description: "For any modification, find the smallest change that solves the problem. Resist the urge to refactor adjacent code, upgrade dependencies, or restructure unless explicitly asked. The best code change is the one with the smallest blast radius.",
|
|
216
|
+
source: "seed",
|
|
217
|
+
kind: "mental-model",
|
|
218
|
+
confidence: 0.3,
|
|
219
|
+
evidenceTier: "hypothesis",
|
|
220
|
+
evidence: [],
|
|
221
|
+
domain: "development",
|
|
222
|
+
relatedFrameworks: [],
|
|
223
|
+
contradicts: [],
|
|
224
|
+
supersedes: [],
|
|
225
|
+
applicationCount: 0,
|
|
226
|
+
version: 1,
|
|
227
|
+
status: "questioning",
|
|
228
|
+
workflows: [],
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
name: "Fail Fast, Fail Loud",
|
|
232
|
+
description: "When something might not work, try the risky part first. Don't build elaborate scaffolding before validating the core assumption. Surface failure conditions early rather than discovering them after heavy investment.",
|
|
233
|
+
source: "seed",
|
|
234
|
+
kind: "mental-model",
|
|
235
|
+
confidence: 0.3,
|
|
236
|
+
evidenceTier: "hypothesis",
|
|
237
|
+
evidence: [],
|
|
238
|
+
domain: "development",
|
|
239
|
+
relatedFrameworks: [],
|
|
240
|
+
contradicts: [],
|
|
241
|
+
supersedes: [],
|
|
242
|
+
applicationCount: 0,
|
|
243
|
+
version: 1,
|
|
244
|
+
status: "questioning",
|
|
245
|
+
workflows: [],
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: "Rubber Duck Debugging",
|
|
249
|
+
description: "When stuck, explain the problem step by step. The act of articulation often reveals the gap in understanding. Before diving into solutions, walk through the mental model of what should happen vs. what is happening.",
|
|
250
|
+
source: "seed",
|
|
251
|
+
kind: "mental-model",
|
|
252
|
+
confidence: 0.3,
|
|
253
|
+
evidenceTier: "hypothesis",
|
|
254
|
+
evidence: [],
|
|
255
|
+
domain: "development",
|
|
256
|
+
relatedFrameworks: [],
|
|
257
|
+
contradicts: [],
|
|
258
|
+
supersedes: [],
|
|
259
|
+
applicationCount: 0,
|
|
260
|
+
version: 1,
|
|
261
|
+
status: "questioning",
|
|
262
|
+
workflows: [],
|
|
263
|
+
},
|
|
264
|
+
];
|
|
265
|
+
//# sourceMappingURL=framework-seeds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"framework-seeds.js","sourceRoot":"","sources":["../../src/engine/framework-seeds.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,gCAAgC;IAChC;QACE,IAAI,EAAE,+CAA+C;QACrD,WAAW,EACT,gSAAgS;QAClS,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE;YACR,iCAAiC;YACjC,wCAAwC;YACxC,gCAAgC;YAChC,gEAAgE;YAChE,0DAA0D;SAC3D;QACD,KAAK,EAAE;YACL,2DAA2D;YAC3D,uEAAuE;YACvE,sGAAsG;YACtG,gGAAgG;YAChG,iFAAiF;SAClF;QACD,UAAU,EAAE,GAAG;QACf,YAAY,EAAE,YAAY;QAC1B,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,mBAAmB;QAC3B,iBAAiB,EAAE,EAAE;QACrB,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,EAAE;QACd,gBAAgB,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,EAAE;KACd;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,WAAW,EACT,gMAAgM;QAClM,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE;YACR,uEAAuE;YACvE,4DAA4D;YAC5D,gEAAgE;YAChE,+CAA+C;YAC/C,4DAA4D;SAC7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gB,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,EAAE;KACd;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EACT,yNAAyN;QAC3N,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,cAAc;QACpB,UAAU,EAAE,GAAG;QACf,YAAY,EAAE,YAAY;QAC1B,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,aAAa;QACrB,iBAAiB,EAAE,EAAE;QACrB,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,EAAE;QACd,gBAAgB,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,EAAE;KACd;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EACT,wNAAwN;QAC1N,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,cAAc;QACpB,UAAU,EAAE,GAAG;QACf,YAAY,EAAE,YAAY;QAC1B,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,aAAa;QACrB,iBAAiB,EAAE,EAAE;QACrB,WAAW,EAAE,EAAE;QACf,UAAU,EAAE,EAAE;QACd,gBAAgB,EAAE,CAAC;QACnB,OAAO,EAAE,CAAC;QACV,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,EAAE;KACd;CACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Lesson } from "../types/learning-types.js";
|
|
2
|
+
export declare function getLessons(): Promise<Lesson[]>;
|
|
3
|
+
export declare function addLesson(lesson: Omit<Lesson, "id" | "createdAt">): Promise<Lesson>;
|
|
4
|
+
export declare function confirmLesson(lessonId: string): Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* Select top lessons by confidence, with recency boost.
|
|
7
|
+
*/
|
|
8
|
+
export declare function selectTopLessons(lessons: Lesson[], maxCount: number): Lesson[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { LESSONS_PATH } from "../util/files.js";
|
|
2
|
+
import { readJsonSafe, writeJsonAtomic } from "../util/files.js";
|
|
3
|
+
export async function getLessons() {
|
|
4
|
+
return readJsonSafe(LESSONS_PATH, []);
|
|
5
|
+
}
|
|
6
|
+
export async function addLesson(lesson) {
|
|
7
|
+
const lessons = await getLessons();
|
|
8
|
+
const newLesson = {
|
|
9
|
+
...lesson,
|
|
10
|
+
id: `les-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`,
|
|
11
|
+
createdAt: Date.now(),
|
|
12
|
+
};
|
|
13
|
+
lessons.push(newLesson);
|
|
14
|
+
// Keep max 100
|
|
15
|
+
const trimmed = lessons.slice(-100);
|
|
16
|
+
await writeJsonAtomic(LESSONS_PATH, trimmed);
|
|
17
|
+
return newLesson;
|
|
18
|
+
}
|
|
19
|
+
export async function confirmLesson(lessonId) {
|
|
20
|
+
const lessons = await getLessons();
|
|
21
|
+
const lesson = lessons.find((l) => l.id === lessonId);
|
|
22
|
+
if (!lesson)
|
|
23
|
+
return;
|
|
24
|
+
lesson.confidence = Math.min(1, lesson.confidence + 0.1);
|
|
25
|
+
lesson.lastConfirmed = Date.now();
|
|
26
|
+
await writeJsonAtomic(LESSONS_PATH, lessons);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Select top lessons by confidence, with recency boost.
|
|
30
|
+
*/
|
|
31
|
+
export function selectTopLessons(lessons, maxCount) {
|
|
32
|
+
return lessons
|
|
33
|
+
.sort((a, b) => {
|
|
34
|
+
const recencyA = a.lastConfirmed ? Math.max(0, 1 - (Date.now() - a.lastConfirmed) / (14 * 24 * 60 * 60 * 1000)) : 0;
|
|
35
|
+
const recencyB = b.lastConfirmed ? Math.max(0, 1 - (Date.now() - b.lastConfirmed) / (14 * 24 * 60 * 60 * 1000)) : 0;
|
|
36
|
+
return (b.confidence + recencyB * 0.2) - (a.confidence + recencyA * 0.2);
|
|
37
|
+
})
|
|
38
|
+
.slice(0, maxCount);
|
|
39
|
+
}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
|
+
frameworkSurvivalRate: number;
|
|
5
|
+
reflectionCount: number;
|
|
6
|
+
totalDiscovered: number;
|
|
7
|
+
totalRetired: number;
|
|
8
|
+
oscillationFlags: string[];
|
|
9
|
+
lastPhaseTransition: number;
|
|
10
|
+
phaseHistory: Array<{
|
|
11
|
+
phase: string;
|
|
12
|
+
enteredAt: number;
|
|
13
|
+
reason: string;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
export declare function loadMeta(): Promise<MetaState>;
|
|
17
|
+
export declare function saveMeta(meta: MetaState): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Update meta-optimization state after a reflection.
|
|
20
|
+
*/
|
|
21
|
+
export declare function updateMetaAfterReflection(store: FrameworkStore): Promise<MetaState>;
|
|
22
|
+
/**
|
|
23
|
+
* Get phase-adaptive reflection thresholds.
|
|
24
|
+
* Apprentice phase needs tight loops for fast learning.
|
|
25
|
+
* Mastery phase can afford slower, more deliberate reflection.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getReflectionThresholds(meta: MetaState): {
|
|
28
|
+
quickSignals: number;
|
|
29
|
+
deepSignals: number;
|
|
30
|
+
quickTimeMs: number;
|
|
31
|
+
deepTimeMs: number;
|
|
32
|
+
minSignals: number;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Get guidance for the reflection prompt based on current phase and quality metrics.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getPhaseGuidance(meta: MetaState): string;
|