@lmzhen/dsh-evolution-feedback 0.3.63 → 0.3.64

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/lib/index.js CHANGED
@@ -130,6 +130,18 @@ var EvolutionFeedback = class EvolutionFeedback {
130
130
  } catch {}
131
131
  });
132
132
  }
133
+ /** External-producer contract (审计 B-4, v18): nothing inside the family
134
+ * calls `record` — the upstream `/feedback` command only appends a
135
+ * `feedback/record` session event carrying free text, which cannot be mapped
136
+ * to a (target, rating) pair without inventing semantics. A host that wants
137
+ * feedback-driven curation wires its own command/event to this method; the
138
+ * curator's union read (`feedback_warn`) then shortens the stale window.
139
+ * `feedback.spec.ts` pins that channel end to end.
140
+ * @param target - skill name or session id the rating belongs to.
141
+ * @param rating - `positive` or `negative`; other values are refused.
142
+ * @param note - optional free-text note carried into the durable event.
143
+ * @param kind - `skill` (default `session`) selects the score table.
144
+ */
133
145
  record(target, rating, note, kind = "session") {
134
146
  const mode = kind === "skill" ? "skills" : "sessions";
135
147
  const table = this.state[mode];
@@ -372,6 +384,10 @@ function foldWithDelta(cache, events, warn = () => {}) {
372
384
  }
373
385
  function applyFeedbackEvent(state, event, warn = () => {}) {
374
386
  if (event.type !== "feedback") return;
387
+ if (event.kind !== "skill" && event.kind !== "session") {
388
+ warn(`evolution-feedback: skipping feedback event with invalid kind: ${String(event.kind)}`);
389
+ return;
390
+ }
375
391
  if (event.rating !== "positive" && event.rating !== "negative") {
376
392
  warn(`evolution-feedback: skipping feedback event with invalid rating: ${String(event.rating)}`);
377
393
  return;
@@ -70,6 +70,18 @@ export declare class EvolutionFeedback {
70
70
  private noteKey;
71
71
  private mutate;
72
72
  restore(io: IoLike): Promise<void>;
73
+ /** External-producer contract (审计 B-4, v18): nothing inside the family
74
+ * calls `record` — the upstream `/feedback` command only appends a
75
+ * `feedback/record` session event carrying free text, which cannot be mapped
76
+ * to a (target, rating) pair without inventing semantics. A host that wants
77
+ * feedback-driven curation wires its own command/event to this method; the
78
+ * curator's union read (`feedback_warn`) then shortens the stale window.
79
+ * `feedback.spec.ts` pins that channel end to end.
80
+ * @param target - skill name or session id the rating belongs to.
81
+ * @param rating - `positive` or `negative`; other values are refused.
82
+ * @param note - optional free-text note carried into the durable event.
83
+ * @param kind - `skill` (default `session`) selects the score table.
84
+ */
73
85
  record(target: string, rating: 'positive' | 'negative', note?: string, kind?: 'skill' | 'session'): void;
74
86
  score(target: string, kind?: 'skill' | 'session'): number;
75
87
  snapshot(): FeedbackState;
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.63",
4
+ "version": "0.3.64",
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.63"
34
+ "@lmzhen/dsh-evolution-core": "^0.3.64"
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.63",
40
- "@lmzhen/dsh-skill-usage": "^0.3.63"
39
+ "@lmzhen/dsh-evolution-io": "^0.3.64",
40
+ "@lmzhen/dsh-skill-usage": "^0.3.64"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
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"
44
+ "@lmzhen/dsh-evolution-io": "^0.3.64",
45
+ "@lmzhen/dsh-evolution-io-node": "^0.3.64",
46
+ "@lmzhen/dsh-skill-usage": "^0.3.64"
47
47
  }
48
48
  }