@lmzhen/dsh-evolution-feedback 0.3.62 → 0.3.63
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 +1 -0
- package/lib/index.js +17 -5
- package/lib/types/index.d.ts +12 -3
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -22,3 +22,4 @@ Independent of request-prefix construction. This package does not alter the asse
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
- Persists through the IO seam; quality propagation into skill usage requires the `skillUsage` service.
|
|
25
|
+
- P1-1 (v15): feedback writes the FEEDBACK-OWNED `feedback_score`/`feedback_warn` usage fields. The lifecycle engine and the scope view read the union `quality_warn || feedback_warn`, so a negative feedback shortens the stale window even though the curator's six-factor run always recomputes `quality_warn` itself.
|
package/lib/index.js
CHANGED
|
@@ -6,8 +6,15 @@ import { join } from "node:path";
|
|
|
6
6
|
* Feedback-to-quality scoring for self-evolution.
|
|
7
7
|
*
|
|
8
8
|
* Feedback is durable through `ctx.evolutionIo` (when mounted) and skill
|
|
9
|
-
* feedback feeds `
|
|
10
|
-
*
|
|
9
|
+
* feedback feeds the FEEDBACK-OWNED `feedback_score` / `feedback_warn` pair on
|
|
10
|
+
* the usage record. P1-1 (v15): this package used to write
|
|
11
|
+
* `quality_score`/`quality_warn` — but the curator's six-factor `scoreTree`
|
|
12
|
+
* overwrote those fields on every run BEFORE the lifecycle engine read them,
|
|
13
|
+
* so the advertised "curator decisions consume feedback deterministically"
|
|
14
|
+
* channel was dead. The lifecycle engine and the scope view now read the
|
|
15
|
+
* union `quality_warn || feedback_warn`, and the curator never writes the
|
|
16
|
+
* feedback pair (field-ownership contract on `UsageRecord` in
|
|
17
|
+
* evolution-core/usage.ts).
|
|
11
18
|
*
|
|
12
19
|
* Persistence (rc.68): the EVENTS LOG (`evolution/events.json`, via
|
|
13
20
|
* `evolution-core/evolution-events.ts`) is the single source of truth —
|
|
@@ -187,9 +194,14 @@ var EvolutionFeedback = class EvolutionFeedback {
|
|
|
187
194
|
return (record.positive - record.negative) / total;
|
|
188
195
|
}
|
|
189
196
|
snapshot() {
|
|
197
|
+
const copyRecords = (table) => {
|
|
198
|
+
const out = {};
|
|
199
|
+
for (const [key, record] of Object.entries(table)) out[key] = { ...record };
|
|
200
|
+
return out;
|
|
201
|
+
};
|
|
190
202
|
return {
|
|
191
|
-
skills:
|
|
192
|
-
sessions:
|
|
203
|
+
skills: copyRecords(this.state.skills),
|
|
204
|
+
sessions: copyRecords(this.state.sessions)
|
|
193
205
|
};
|
|
194
206
|
}
|
|
195
207
|
/** Await the pending record-task chain (unload safety; rc.66). */
|
|
@@ -458,7 +470,7 @@ function apply(ctx, rawConfig = {}) {
|
|
|
458
470
|
if (kind !== "skill") return;
|
|
459
471
|
const score = feedback.score(target, "skill");
|
|
460
472
|
const warn = score < qualityWarnThreshold;
|
|
461
|
-
skillUsage.
|
|
473
|
+
skillUsage.setFeedbackQuality(target, score, warn).catch((error) => {
|
|
462
474
|
skillCtx.logger.warn(error);
|
|
463
475
|
});
|
|
464
476
|
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
* Feedback-to-quality scoring for self-evolution.
|
|
3
3
|
*
|
|
4
4
|
* Feedback is durable through `ctx.evolutionIo` (when mounted) and skill
|
|
5
|
-
* feedback feeds `
|
|
6
|
-
*
|
|
5
|
+
* feedback feeds the FEEDBACK-OWNED `feedback_score` / `feedback_warn` pair on
|
|
6
|
+
* the usage record. P1-1 (v15): this package used to write
|
|
7
|
+
* `quality_score`/`quality_warn` — but the curator's six-factor `scoreTree`
|
|
8
|
+
* overwrote those fields on every run BEFORE the lifecycle engine read them,
|
|
9
|
+
* so the advertised "curator decisions consume feedback deterministically"
|
|
10
|
+
* channel was dead. The lifecycle engine and the scope view now read the
|
|
11
|
+
* union `quality_warn || feedback_warn`, and the curator never writes the
|
|
12
|
+
* feedback pair (field-ownership contract on `UsageRecord` in
|
|
13
|
+
* evolution-core/usage.ts).
|
|
7
14
|
*
|
|
8
15
|
* Persistence (rc.68): the EVENTS LOG (`evolution/events.json`, via
|
|
9
16
|
* `evolution-core/evolution-events.ts`) is the single source of truth —
|
|
@@ -86,7 +93,9 @@ export declare class EvolutionFeedback {
|
|
|
86
93
|
export declare function migrateFeedbackEvents(io: IoLike, eventsPath: string, aggregate: FeedbackState): Promise<void>;
|
|
87
94
|
export declare const name = "evolution-feedback";
|
|
88
95
|
export interface Config {
|
|
89
|
-
/** Score below which
|
|
96
|
+
/** Score below which the FEEDBACK pair flips to warned (P1-1, v15: written
|
|
97
|
+
* to `feedback_score`/`feedback_warn`; the lifecycle engine reads the union
|
|
98
|
+
* with the curator-owned `quality_warn`). */
|
|
90
99
|
qualityWarnThreshold?: number;
|
|
91
100
|
/** Explicit boot-cache file path; empty derives $DSH_HOME/evolution/feedback.json.
|
|
92
101
|
* The event log always stays at $DSH_HOME/evolution/events.json (derived from
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-feedback",
|
|
3
3
|
"description": "Feedback-to-quality scoring for self-evolution (community build)",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.63",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
34
|
-
"@lmzhen/dsh-evolution-core": "^0.3.
|
|
34
|
+
"@lmzhen/dsh-evolution-core": "^0.3.63"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
|
|
38
38
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
39
|
-
"@lmzhen/dsh-evolution-io": "^0.3.
|
|
40
|
-
"@lmzhen/dsh-skill-usage": "^0.3.
|
|
39
|
+
"@lmzhen/dsh-evolution-io": "^0.3.63",
|
|
40
|
+
"@lmzhen/dsh-skill-usage": "^0.3.63"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
|
|
44
|
-
"@lmzhen/dsh-evolution-io": "^0.3.
|
|
45
|
-
"@lmzhen/dsh-evolution-io-node": "^0.3.
|
|
46
|
-
"@lmzhen/dsh-skill-usage": "^0.3.
|
|
44
|
+
"@lmzhen/dsh-evolution-io": "^0.3.63",
|
|
45
|
+
"@lmzhen/dsh-evolution-io-node": "^0.3.63",
|
|
46
|
+
"@lmzhen/dsh-skill-usage": "^0.3.63"
|
|
47
47
|
}
|
|
48
48
|
}
|