sostenuto 0.1.0 → 0.1.1
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/package.json +3 -3
- package/src/memory/guidance.js +7 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sostenuto",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Selective long-term memory for AI companions
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Selective long-term memory for AI companions — chosen memories sustain, the rest fades. Named for the piano pedal.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"exports": {
|
|
@@ -55,4 +55,4 @@
|
|
|
55
55
|
"README.md",
|
|
56
56
|
"LICENSE"
|
|
57
57
|
]
|
|
58
|
-
}
|
|
58
|
+
}
|
package/src/memory/guidance.js
CHANGED
|
@@ -43,9 +43,14 @@ export const VALID_SENSITIVITY = new Set(["low", "medium", "high"]);
|
|
|
43
43
|
|
|
44
44
|
const SENSITIVITY_RANK = { low: 0, medium: 1, high: 2 };
|
|
45
45
|
|
|
46
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Higher-ranked sensitivity wins (used when merging on reinforce).
|
|
48
|
+
* Fail-safe: an unrecognized value (e.g. a legacy 'intimate' level from an
|
|
49
|
+
* older schema) ranks as the MOST sensitive, so a merge can never silently
|
|
50
|
+
* downgrade a level it can't classify.
|
|
51
|
+
*/
|
|
47
52
|
export function maxSensitivity(a, b) {
|
|
48
|
-
return (SENSITIVITY_RANK[a] ??
|
|
53
|
+
return (SENSITIVITY_RANK[a] ?? 99) >= (SENSITIVITY_RANK[b] ?? 99) ? a : b;
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
export function clamp(val, min, max) {
|