@lmzhen/dsh-evolution-feedback 0.1.0-rc.69 → 0.1.0-rc.70

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.
Files changed (2) hide show
  1. package/lib/index.js +7 -2
  2. package/package.json +6 -6
package/lib/index.js CHANGED
@@ -51,6 +51,11 @@ function isEventRecord(event) {
51
51
  * Parse an event log body. A missing file, a whitespace-only file (rc.69:
52
52
  * rebuildable, NOT malformed) or a corrupt one reads as empty; corrupt content
53
53
  * is still refused on append, never overwritten.
54
+ *
55
+ * Per-entry normalization (rc.70 F-1): entries without a numeric `seq` are
56
+ * skipped here and dropped at the next append — valid entries survive, the
57
+ * damaged record is the only loss (self-heal semantics, matching the usage
58
+ * sidecar's per-field normalization on read).
54
59
  */
55
60
  function parseEvolutionEvents(raw) {
56
61
  if (raw === null || raw.trim() === "") return [];
@@ -104,7 +109,7 @@ async function readEvolutionEvents(io, path) {
104
109
  const parsed = JSON.parse(raw);
105
110
  if (!Array.isArray(parsed.events)) return {
106
111
  events: [],
107
- malformed: true
112
+ malformed: false
108
113
  };
109
114
  return {
110
115
  events: parsed.events.filter(isEventRecord),
@@ -514,7 +519,7 @@ async function migrateFeedbackEvents(io, eventsPath, aggregate) {
514
519
  const expected = synthesizeFeedbackEvents(aggregate);
515
520
  await transactIo(io, eventsPath, (current) => {
516
521
  const existing = parseEvolutionEvents(current);
517
- if (containsLegacySequence(existing, expected)) return Promise.resolve(current ?? "");
522
+ if (containsLegacySequence(existing, expected)) return Promise.resolve(current);
518
523
  const maxSeq = existing.reduce((max, event) => Math.max(max, event.seq), 0);
519
524
  const merged = [...existing, ...expected.map((event, index) => ({
520
525
  ...event,
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.1.0-rc.69",
4
+ "version": "0.1.0-rc.70",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -37,13 +37,13 @@
37
37
  "peerDependencies": {
38
38
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
39
39
  "@deepseek-ai/cordis": "^4.0.1",
40
- "@lmzhen/dsh-evolution-io": "^0.1.0-rc.69",
41
- "@lmzhen/dsh-skill-usage": "^0.1.0-rc.69"
40
+ "@lmzhen/dsh-evolution-io": "^0.1.0-rc.70",
41
+ "@lmzhen/dsh-skill-usage": "^0.1.0-rc.70"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
45
- "@lmzhen/dsh-evolution-io": "^0.1.0-rc.69",
46
- "@lmzhen/dsh-evolution-io-node": "^0.1.0-rc.69",
47
- "@lmzhen/dsh-skill-usage": "^0.1.0-rc.69"
45
+ "@lmzhen/dsh-evolution-io": "^0.1.0-rc.70",
46
+ "@lmzhen/dsh-evolution-io-node": "^0.1.0-rc.70",
47
+ "@lmzhen/dsh-skill-usage": "^0.1.0-rc.70"
48
48
  }
49
49
  }