dsh-mnemon-source-skills 0.5.2 → 0.5.3
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/README.md +2 -0
- package/lib/client.js +2 -0
- package/lib/contracts.d.ts +4 -0
- package/lib/contracts.js +2 -0
- package/lib/index.js +30 -0
- package/lib/types/contracts.d.ts +4 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -20,6 +20,8 @@ The Source never calls a model and never joins a model View; skills reach the mo
|
|
|
20
20
|
|
|
21
21
|
Self-evolution, its review parameters, the line under each turn and the sidebar entry are dsh-mnemon settings, under `skills` in its configuration, edited on this component's page under **Plugins → dsh-mnemon**; see [Skills settings](https://github.com/omdsh-dev/dsh-mnemon/blob/main/docs/en/reference/configuration.md#skills-settings). The Host passes the admission rules with each review, so this Source keeps no settings of its own.
|
|
22
22
|
|
|
23
|
+
The Host's `skills.allowCreate` and `skills.allowUpdate` independently control new-skill and existing-skill improvement suggestions. Both default to `true` for older configurations. The Source enforces these rules against the current skill catalog for suggestions and proposed eval cases; labeling an existing skill as `create` does not bypass the update rule. Turning both off pauses conversation reviews, while existing suggestions and explicit draft, backtest and adopt actions remain available.
|
|
24
|
+
|
|
23
25
|
## A catalog
|
|
24
26
|
|
|
25
27
|
A team can publish its own curated list as one JSON file, by URL or path:
|
package/lib/client.js
CHANGED
package/lib/contracts.d.ts
CHANGED
|
@@ -298,6 +298,10 @@ interface ReviewLogEntry {
|
|
|
298
298
|
}
|
|
299
299
|
/** How the Source admits a review's suggestions; the Host sends its settings with each review. */
|
|
300
300
|
interface SkillsPolicy {
|
|
301
|
+
/** Whether a review may propose new skills; omitted by older Hosts, default true. */
|
|
302
|
+
allowCreate?: boolean;
|
|
303
|
+
/** Whether a review may improve existing skills; omitted by older Hosts, default true. */
|
|
304
|
+
allowUpdate?: boolean;
|
|
301
305
|
minConfidence: number;
|
|
302
306
|
expiryDays: number;
|
|
303
307
|
maxPendingPerSession: number;
|
package/lib/contracts.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -766,7 +766,14 @@ function policyFrom(value) {
|
|
|
766
766
|
const candidate = value?.[key];
|
|
767
767
|
return typeof candidate === "number" && Number.isFinite(candidate) && candidate >= minimum && candidate <= maximum ? candidate : DEFAULT_SKILLS_POLICY[key];
|
|
768
768
|
};
|
|
769
|
+
const allowed = (key) => {
|
|
770
|
+
const candidate = value?.[key];
|
|
771
|
+
if (candidate !== void 0 && typeof candidate !== "boolean") throw new Error(`skills policy ${key} must be a boolean`);
|
|
772
|
+
return candidate ?? true;
|
|
773
|
+
};
|
|
769
774
|
return {
|
|
775
|
+
allowCreate: allowed("allowCreate"),
|
|
776
|
+
allowUpdate: allowed("allowUpdate"),
|
|
770
777
|
minConfidence: pick("minConfidence", 0, 1),
|
|
771
778
|
expiryDays: Math.round(pick("expiryDays", 1, 90)),
|
|
772
779
|
maxPendingPerSession: Math.round(pick("maxPendingPerSession", 1, 20))
|
|
@@ -785,6 +792,7 @@ function admitReview(context, input) {
|
|
|
785
792
|
const stepIndexes = new Set(input.trajectory.steps.map((step) => step.index));
|
|
786
793
|
const steps = (values) => [...new Set(values.filter((value) => Number.isInteger(value) && stepIndexes.has(value)))].sort((a, b) => a - b);
|
|
787
794
|
const skipped = [];
|
|
795
|
+
const allowed = (action) => (action === "create" ? policy.allowCreate : policy.allowUpdate) !== false;
|
|
788
796
|
let inserted = 0;
|
|
789
797
|
let updated = 0;
|
|
790
798
|
let casesAdded = 0;
|
|
@@ -826,6 +834,14 @@ function admitReview(context, input) {
|
|
|
826
834
|
}
|
|
827
835
|
const existing = activeSkill(catalog, name);
|
|
828
836
|
const action = existing !== void 0 ? "update" : "create";
|
|
837
|
+
if (!allowed(action)) {
|
|
838
|
+
skipped.push({
|
|
839
|
+
skillName: name,
|
|
840
|
+
action,
|
|
841
|
+
reason: "suggestion_type_disabled"
|
|
842
|
+
});
|
|
843
|
+
continue;
|
|
844
|
+
}
|
|
829
845
|
if (raw.action === "update" && existing === void 0) {
|
|
830
846
|
skipped.push({
|
|
831
847
|
skillName: name,
|
|
@@ -940,6 +956,13 @@ function admitReview(context, input) {
|
|
|
940
956
|
});
|
|
941
957
|
continue;
|
|
942
958
|
}
|
|
959
|
+
if (!allowed(activeSkill(catalog, name) === void 0 ? "create" : "update")) {
|
|
960
|
+
skipped.push({
|
|
961
|
+
skillName: name,
|
|
962
|
+
reason: "suggestion_type_disabled"
|
|
963
|
+
});
|
|
964
|
+
continue;
|
|
965
|
+
}
|
|
943
966
|
if (similarCase(evals.cases, name, title, prompt) !== void 0) {
|
|
944
967
|
skipped.push({
|
|
945
968
|
skillName: name,
|
|
@@ -4362,7 +4385,14 @@ function step(value) {
|
|
|
4362
4385
|
function policyInput(value) {
|
|
4363
4386
|
const input = memoryInputRecord(value, "policy");
|
|
4364
4387
|
const number = (key) => typeof input[key] === "number" && Number.isFinite(input[key]) ? { [key]: input[key] } : {};
|
|
4388
|
+
const allowed = (key) => {
|
|
4389
|
+
if (input[key] === void 0) return {};
|
|
4390
|
+
if (typeof input[key] !== "boolean") throw new Error(`skills policy ${key} must be a boolean`);
|
|
4391
|
+
return { [key]: input[key] };
|
|
4392
|
+
};
|
|
4365
4393
|
return {
|
|
4394
|
+
...allowed("allowCreate"),
|
|
4395
|
+
...allowed("allowUpdate"),
|
|
4366
4396
|
...number("minConfidence"),
|
|
4367
4397
|
...number("expiryDays"),
|
|
4368
4398
|
...number("maxPendingPerSession")
|
package/lib/types/contracts.d.ts
CHANGED
|
@@ -280,6 +280,10 @@ export interface ReviewLogEntry {
|
|
|
280
280
|
}
|
|
281
281
|
/** How the Source admits a review's suggestions; the Host sends its settings with each review. */
|
|
282
282
|
export interface SkillsPolicy {
|
|
283
|
+
/** Whether a review may propose new skills; omitted by older Hosts, default true. */
|
|
284
|
+
allowCreate?: boolean;
|
|
285
|
+
/** Whether a review may improve existing skills; omitted by older Hosts, default true. */
|
|
286
|
+
allowUpdate?: boolean;
|
|
283
287
|
minConfidence: number;
|
|
284
288
|
expiryDays: number;
|
|
285
289
|
maxPendingPerSession: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon-source-skills",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "Skills Source for Composable View Memory: DSH skill management, evolution suggestions, evidence trajectories and eval sets.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@types/node": "^22.0.0",
|
|
63
63
|
"@types/react": "^18.3.0",
|
|
64
64
|
"@types/react-dom": "^18.3.0",
|
|
65
|
-
"dsh-mnemon": "^0.5.
|
|
65
|
+
"dsh-mnemon": "^0.5.36",
|
|
66
66
|
"jsdom": "^26.0.0",
|
|
67
67
|
"react": "^18.2.0",
|
|
68
68
|
"react-dom": "^18.2.0",
|