dsh-daoing-memory 0.1.17 → 0.1.18
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/client.js +51 -51
- package/lib/index.js +70 -10
- package/lib/types/core.d.ts +6 -1
- package/lib/types/core.js +39 -4
- package/lib/types/service.d.ts +2 -1
- package/lib/types/service.js +10 -0
- package/lib/types/store.d.ts +1 -1
- package/lib/types/store.js +14 -4
- package/lib/types/types.d.ts +20 -0
- package/package.json +116 -116
package/lib/client.js
CHANGED
|
@@ -8632,61 +8632,61 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
8632
8632
|
document.head.appendChild(tag);
|
|
8633
8633
|
}
|
|
8634
8634
|
var Workbench_module_css_default = {
|
|
8635
|
-
"
|
|
8636
|
-
"
|
|
8637
|
-
"
|
|
8638
|
-
"
|
|
8639
|
-
"
|
|
8640
|
-
"
|
|
8641
|
-
"payloadFull": "vPI34G_payloadFull",
|
|
8642
|
-
"tabActive": "vPI34G_tabActive",
|
|
8643
|
-
"badgeConflict": "vPI34G_badgeConflict",
|
|
8635
|
+
"cardDetail": "vPI34G_cardDetail",
|
|
8636
|
+
"btnDanger": "vPI34G_btnDanger",
|
|
8637
|
+
"warnLine": "vPI34G_warnLine",
|
|
8638
|
+
"badgePinned": "vPI34G_badgePinned",
|
|
8639
|
+
"workbenchTabs": "vPI34G_workbenchTabs",
|
|
8640
|
+
"cardMeta": "vPI34G_cardMeta",
|
|
8644
8641
|
"actions": "vPI34G_actions",
|
|
8645
|
-
"
|
|
8646
|
-
"
|
|
8647
|
-
"
|
|
8648
|
-
"subtitle": "vPI34G_subtitle",
|
|
8649
|
-
"toolbar": "vPI34G_toolbar",
|
|
8650
|
-
"okLine": "vPI34G_okLine",
|
|
8642
|
+
"statusCandidate": "vPI34G_statusCandidate",
|
|
8643
|
+
"title": "vPI34G_title",
|
|
8644
|
+
"titleBlock": "vPI34G_titleBlock",
|
|
8651
8645
|
"cardHead": "vPI34G_cardHead",
|
|
8646
|
+
"badge": "vPI34G_badge",
|
|
8647
|
+
"badgeNegative": "vPI34G_badgeNegative",
|
|
8648
|
+
"detailLabel": "vPI34G_detailLabel",
|
|
8649
|
+
"toolbar": "vPI34G_toolbar",
|
|
8650
|
+
"cardSub": "vPI34G_cardSub",
|
|
8651
|
+
"statusOther": "vPI34G_statusOther",
|
|
8652
|
+
"trust": "vPI34G_trust",
|
|
8653
|
+
"header": "vPI34G_header",
|
|
8652
8654
|
"concernBg": "vPI34G_concernBg",
|
|
8653
|
-
"
|
|
8654
|
-
"
|
|
8655
|
-
"
|
|
8655
|
+
"panel": "vPI34G_panel",
|
|
8656
|
+
"workbenchTabActive": "vPI34G_workbenchTabActive",
|
|
8657
|
+
"error": "vPI34G_error",
|
|
8658
|
+
"okLine": "vPI34G_okLine",
|
|
8659
|
+
"page": "vPI34G_page",
|
|
8660
|
+
"payloadFull": "vPI34G_payloadFull",
|
|
8661
|
+
"payloadToggle": "vPI34G_payloadToggle",
|
|
8662
|
+
"badgeConflict": "vPI34G_badgeConflict",
|
|
8663
|
+
"btn": "vPI34G_btn",
|
|
8664
|
+
"badgePositive": "vPI34G_badgePositive",
|
|
8665
|
+
"statusLive": "vPI34G_statusLive",
|
|
8666
|
+
"table": "vPI34G_table",
|
|
8667
|
+
"statusChallenged": "vPI34G_statusChallenged",
|
|
8668
|
+
"historyTitle": "vPI34G_historyTitle",
|
|
8656
8669
|
"workbenchTab": "vPI34G_workbenchTab",
|
|
8670
|
+
"tab": "vPI34G_tab",
|
|
8671
|
+
"field": "vPI34G_field",
|
|
8657
8672
|
"valueCell": "vPI34G_valueCell",
|
|
8673
|
+
"card": "vPI34G_card",
|
|
8674
|
+
"tabActive": "vPI34G_tabActive",
|
|
8675
|
+
"tabs": "vPI34G_tabs",
|
|
8676
|
+
"column": "vPI34G_column",
|
|
8677
|
+
"sectionTitle": "vPI34G_sectionTitle",
|
|
8658
8678
|
"statline": "vPI34G_statline",
|
|
8679
|
+
"check": "vPI34G_check",
|
|
8659
8680
|
"cardTitle": "vPI34G_cardTitle",
|
|
8660
|
-
"
|
|
8661
|
-
"
|
|
8681
|
+
"subtitle": "vPI34G_subtitle",
|
|
8682
|
+
"detailRow": "vPI34G_detailRow",
|
|
8662
8683
|
"form": "vPI34G_form",
|
|
8663
|
-
"
|
|
8664
|
-
"
|
|
8665
|
-
"cardDetail": "vPI34G_cardDetail",
|
|
8666
|
-
"badge": "vPI34G_badge",
|
|
8667
|
-
"warnLine": "vPI34G_warnLine",
|
|
8668
|
-
"historyTitle": "vPI34G_historyTitle",
|
|
8669
|
-
"tab": "vPI34G_tab",
|
|
8684
|
+
"body": "vPI34G_body",
|
|
8685
|
+
"list": "vPI34G_list",
|
|
8670
8686
|
"cellActions": "vPI34G_cellActions",
|
|
8671
|
-
"statusOther": "vPI34G_statusOther",
|
|
8672
|
-
"card": "vPI34G_card",
|
|
8673
|
-
"table": "vPI34G_table",
|
|
8674
|
-
"titleBlock": "vPI34G_titleBlock",
|
|
8675
|
-
"statusLive": "vPI34G_statusLive",
|
|
8676
|
-
"statusCandidate": "vPI34G_statusCandidate",
|
|
8677
|
-
"column": "vPI34G_column",
|
|
8678
|
-
"detailLabel": "vPI34G_detailLabel",
|
|
8679
|
-
"btnDanger": "vPI34G_btnDanger",
|
|
8680
8687
|
"empty": "vPI34G_empty",
|
|
8681
|
-
"
|
|
8682
|
-
"
|
|
8683
|
-
"detailRow": "vPI34G_detailRow",
|
|
8684
|
-
"header": "vPI34G_header",
|
|
8685
|
-
"field": "vPI34G_field",
|
|
8686
|
-
"error": "vPI34G_error",
|
|
8687
|
-
"title": "vPI34G_title",
|
|
8688
|
-
"payloadToggle": "vPI34G_payloadToggle",
|
|
8689
|
-
"badgeNegative": "vPI34G_badgeNegative"
|
|
8688
|
+
"columns": "vPI34G_columns",
|
|
8689
|
+
"rules": "vPI34G_rules"
|
|
8690
8690
|
};
|
|
8691
8691
|
//#endregion
|
|
8692
8692
|
//#region lib/types/client/ExperiencePage.js
|
|
@@ -9328,17 +9328,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
9328
9328
|
document.head.appendChild(tag);
|
|
9329
9329
|
}
|
|
9330
9330
|
var ReasonDialog_module_css_default = {
|
|
9331
|
-
"
|
|
9332
|
-
"
|
|
9331
|
+
"btnConfirm": "HH3IWW_btnConfirm",
|
|
9332
|
+
"title": "HH3IWW_title",
|
|
9333
|
+
"hint": "HH3IWW_hint",
|
|
9333
9334
|
"footer": "HH3IWW_footer",
|
|
9334
9335
|
"textarea": "HH3IWW_textarea",
|
|
9335
9336
|
"buttons": "HH3IWW_buttons",
|
|
9336
|
-
"btnConfirm": "HH3IWW_btnConfirm",
|
|
9337
|
-
"btnCancel": "HH3IWW_btnCancel",
|
|
9338
|
-
"title": "HH3IWW_title",
|
|
9339
9337
|
"subtitle": "HH3IWW_subtitle",
|
|
9338
|
+
"dialog": "HH3IWW_dialog",
|
|
9339
|
+
"overlay": "HH3IWW_overlay",
|
|
9340
9340
|
"header": "HH3IWW_header",
|
|
9341
|
-
"
|
|
9341
|
+
"btnCancel": "HH3IWW_btnCancel"
|
|
9342
9342
|
};
|
|
9343
9343
|
//#endregion
|
|
9344
9344
|
//#region lib/types/client/ReasonDialog.js
|
package/lib/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
|
14
14
|
* @module dsh-daoing-memory/store
|
|
15
15
|
*/
|
|
16
16
|
/** Monotone store schema version. v1→v2 is an additive ALTER migration (see open()). */
|
|
17
|
-
const MEMORY_SCHEMA_VERSION =
|
|
17
|
+
const MEMORY_SCHEMA_VERSION = 7;
|
|
18
18
|
/** Half-life (ms) of the recency weighting applied to verification samples. */
|
|
19
19
|
const TRUST_HALF_LIFE_MS = 4320 * 60 * 60 * 1e3;
|
|
20
20
|
/** Hash one ledger block's content, chained to the previous hash. */
|
|
@@ -87,6 +87,7 @@ var MemoryStore = class {
|
|
|
87
87
|
verified_count INTEGER NOT NULL DEFAULT 0,
|
|
88
88
|
reject_count INTEGER NOT NULL DEFAULT 0,
|
|
89
89
|
global_flag INTEGER NOT NULL DEFAULT 0,
|
|
90
|
+
approved_by TEXT NOT NULL DEFAULT '',
|
|
90
91
|
created_at INTEGER NOT NULL,
|
|
91
92
|
updated_at INTEGER NOT NULL,
|
|
92
93
|
PRIMARY KEY (family_id, revision)
|
|
@@ -184,7 +185,7 @@ var MemoryStore = class {
|
|
|
184
185
|
);
|
|
185
186
|
`);
|
|
186
187
|
const row = db.prepare("SELECT value FROM memory_meta WHERE key = ?").get("schema_version");
|
|
187
|
-
if (row === void 0) db.prepare("INSERT INTO memory_meta (key, value) VALUES (?, ?)").run("schema_version", String(
|
|
188
|
+
if (row === void 0) db.prepare("INSERT INTO memory_meta (key, value) VALUES (?, ?)").run("schema_version", String(7));
|
|
188
189
|
else {
|
|
189
190
|
let v = Number(row.value);
|
|
190
191
|
if (v === 1) {
|
|
@@ -225,8 +226,12 @@ var MemoryStore = class {
|
|
|
225
226
|
`);
|
|
226
227
|
v = 6;
|
|
227
228
|
}
|
|
228
|
-
if (v
|
|
229
|
-
|
|
229
|
+
if (v === 6 && true) {
|
|
230
|
+
db.exec("ALTER TABLE experiences ADD COLUMN approved_by TEXT NOT NULL DEFAULT '';");
|
|
231
|
+
v = 7;
|
|
232
|
+
}
|
|
233
|
+
if (v !== 7) throw new Error(`memory store schema version ${row.value} does not match 7; refusing to open`);
|
|
234
|
+
db.prepare("UPDATE memory_meta SET value = ? WHERE key = ?").run(String(7), "schema_version");
|
|
230
235
|
}
|
|
231
236
|
db.exec("CREATE INDEX IF NOT EXISTS idx_exp_context ON experiences (context);");
|
|
232
237
|
db.exec("CREATE INDEX IF NOT EXISTS idx_concern_parent ON concerns (parent_id);");
|
|
@@ -238,8 +243,8 @@ var MemoryStore = class {
|
|
|
238
243
|
family_id, revision, kind, source, family, gist, situation, path, reasoning, limits,
|
|
239
244
|
status, alpha, beta, last_verified_at, pinned, tokens_saved, tokens_spent,
|
|
240
245
|
parent_revision, failure_reason, evidence, challenge_reason, deleted,
|
|
241
|
-
context, verified_count, reject_count, global_flag, created_at, updated_at
|
|
242
|
-
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0
|
|
246
|
+
context, verified_count, reject_count, global_flag, approved_by, created_at, updated_at
|
|
247
|
+
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,?,?,?,?,?,?,?)
|
|
243
248
|
ON CONFLICT (family_id, revision) DO UPDATE SET
|
|
244
249
|
kind = excluded.kind,
|
|
245
250
|
source = excluded.source,
|
|
@@ -264,8 +269,9 @@ var MemoryStore = class {
|
|
|
264
269
|
verified_count = excluded.verified_count,
|
|
265
270
|
reject_count = excluded.reject_count,
|
|
266
271
|
global_flag = excluded.global_flag,
|
|
272
|
+
approved_by = excluded.approved_by,
|
|
267
273
|
updated_at = excluded.updated_at
|
|
268
|
-
`).run(s.id, s.revision, s.kind, s.source, s.family, s.gist, JSON.stringify(s.situation), JSON.stringify(s.path), s.reasoning, JSON.stringify(s.limits), s.status, s.alpha, s.beta, s.lastVerifiedAt ?? null, s.pinned ? 1 : 0, s.tokensSaved, s.tokensSpent, s.parentRevision ?? null, s.failureReason ?? null, s.evidence === void 0 ? null : JSON.stringify(s.evidence), s.challengeReason ?? null, s.context ?? "", s.verifiedCount ?? 0, s.rejectCount ?? 0, s.globalFlag === true ? 1 : 0, s.createdAt, s.updatedAt);
|
|
274
|
+
`).run(s.id, s.revision, s.kind, s.source, s.family, s.gist, JSON.stringify(s.situation), JSON.stringify(s.path), s.reasoning, JSON.stringify(s.limits), s.status, s.alpha, s.beta, s.lastVerifiedAt ?? null, s.pinned ? 1 : 0, s.tokensSaved, s.tokensSpent, s.parentRevision ?? null, s.failureReason ?? null, s.evidence === void 0 ? null : JSON.stringify(s.evidence), s.challengeReason ?? null, s.context ?? "", s.verifiedCount ?? 0, s.rejectCount ?? 0, s.globalFlag === true ? 1 : 0, s.approvedBy ?? "", s.createdAt, s.updatedAt);
|
|
269
275
|
}
|
|
270
276
|
/** Read one experience revision. */
|
|
271
277
|
getExperience(familyId, revision) {
|
|
@@ -820,6 +826,7 @@ var MemoryStore = class {
|
|
|
820
826
|
if (row.failure_reason !== null) snapshot.failureReason = row.failure_reason;
|
|
821
827
|
if (row.evidence !== null) snapshot.evidence = JSON.parse(row.evidence);
|
|
822
828
|
if (row.challenge_reason !== null) snapshot.challengeReason = row.challenge_reason;
|
|
829
|
+
if (row.approved_by === "human" || row.approved_by === "agent") snapshot.approvedBy = row.approved_by;
|
|
823
830
|
return snapshot;
|
|
824
831
|
}
|
|
825
832
|
rowToReport(row) {
|
|
@@ -1407,7 +1414,8 @@ var MemoryCore = class MemoryCore {
|
|
|
1407
1414
|
if (next.status === "candidate" && next.parentRevision !== void 0) {
|
|
1408
1415
|
const adopted = {
|
|
1409
1416
|
...next,
|
|
1410
|
-
status: "live"
|
|
1417
|
+
status: "live",
|
|
1418
|
+
approvedBy: "agent"
|
|
1411
1419
|
};
|
|
1412
1420
|
delete adopted.challengeReason;
|
|
1413
1421
|
next = adopted;
|
|
@@ -1423,7 +1431,8 @@ var MemoryCore = class MemoryCore {
|
|
|
1423
1431
|
} else if (next.status === "candidate") {
|
|
1424
1432
|
next = {
|
|
1425
1433
|
...next,
|
|
1426
|
-
status: "live"
|
|
1434
|
+
status: "live",
|
|
1435
|
+
approvedBy: "agent"
|
|
1427
1436
|
};
|
|
1428
1437
|
this.ledger("promote", "experience", next.id, actor, {
|
|
1429
1438
|
revision: next.revision,
|
|
@@ -1433,7 +1442,8 @@ var MemoryCore = class MemoryCore {
|
|
|
1433
1442
|
} else if (next.status === "archived") {
|
|
1434
1443
|
next = {
|
|
1435
1444
|
...next,
|
|
1436
|
-
status: "live"
|
|
1445
|
+
status: "live",
|
|
1446
|
+
approvedBy: "agent"
|
|
1437
1447
|
};
|
|
1438
1448
|
this.ledger("restore", "experience", next.id, actor, { revision: next.revision });
|
|
1439
1449
|
base.promoted = true;
|
|
@@ -2292,6 +2302,7 @@ var MemoryCore = class MemoryCore {
|
|
|
2292
2302
|
verifiedCount: 0,
|
|
2293
2303
|
rejectCount: 0,
|
|
2294
2304
|
globalFlag: false,
|
|
2305
|
+
approvedBy: "human",
|
|
2295
2306
|
createdAt: now,
|
|
2296
2307
|
updatedAt: now
|
|
2297
2308
|
};
|
|
@@ -2312,6 +2323,7 @@ var MemoryCore = class MemoryCore {
|
|
|
2312
2323
|
const next = {
|
|
2313
2324
|
...current,
|
|
2314
2325
|
status: "live",
|
|
2326
|
+
approvedBy: "human",
|
|
2315
2327
|
lastVerifiedAt: Date.now(),
|
|
2316
2328
|
updatedAt: Date.now()
|
|
2317
2329
|
};
|
|
@@ -2334,6 +2346,38 @@ var MemoryCore = class MemoryCore {
|
|
|
2334
2346
|
this.ledger("release-cold", "experience", next.id, actor, { revision: next.revision }, request.reason);
|
|
2335
2347
|
return next;
|
|
2336
2348
|
}
|
|
2349
|
+
/** Human-approved self-growth: merge new evidence into a live, human-approved
|
|
2350
|
+
* experience as an incremental new revision (revision+1, parent superseded).
|
|
2351
|
+
* Only approvedBy='human' + status='live' may evolve; agent/system-approved
|
|
2352
|
+
* and non-live (challenged/cold/archived) are rejected. */
|
|
2353
|
+
evolve(request, actor) {
|
|
2354
|
+
const current = this.store.getActiveRevision(request.id);
|
|
2355
|
+
if (current === void 0) throw new Error(`memory: experience not found: ${request.id}`);
|
|
2356
|
+
if (current.approvedBy !== "human") throw new Error(`memory: only human-approved experiences evolve (approvedBy=${String(current.approvedBy)})`);
|
|
2357
|
+
if (current.status !== "live") throw new Error(`memory: only live experiences evolve (status=${current.status})`);
|
|
2358
|
+
const situation = request.situation === void 0 ? current.situation : [...new Set([...current.situation, ...request.situation])];
|
|
2359
|
+
const limits = request.limits === void 0 ? current.limits : [...new Set([...current.limits, ...request.limits])];
|
|
2360
|
+
const now = Date.now();
|
|
2361
|
+
const next = {
|
|
2362
|
+
...current,
|
|
2363
|
+
revision: current.revision + 1,
|
|
2364
|
+
status: "live",
|
|
2365
|
+
parentRevision: current.revision,
|
|
2366
|
+
gist: request.gist ?? current.gist,
|
|
2367
|
+
situation,
|
|
2368
|
+
path: request.path ?? current.path,
|
|
2369
|
+
reasoning: request.reasoning ?? current.reasoning,
|
|
2370
|
+
limits,
|
|
2371
|
+
updatedAt: now
|
|
2372
|
+
};
|
|
2373
|
+
this.store.upsertExperience(next);
|
|
2374
|
+
this.supersedeParent(next, actor);
|
|
2375
|
+
this.ledger("evolve", "experience", next.id, actor, {
|
|
2376
|
+
revision: next.revision,
|
|
2377
|
+
by: current.revision
|
|
2378
|
+
}, request.reason);
|
|
2379
|
+
return next;
|
|
2380
|
+
}
|
|
2337
2381
|
/** Human acknowledgement of a pending diary entry: reviewed, no fact extracted. */
|
|
2338
2382
|
humanAckDiary(request, actor) {
|
|
2339
2383
|
const entry = this.store.getDiary(request.diaryId);
|
|
@@ -3629,6 +3673,7 @@ let MemoryService = (() => {
|
|
|
3629
3673
|
let _humanEditExperience_decorators;
|
|
3630
3674
|
let _humanAddExperience_decorators;
|
|
3631
3675
|
let _humanPromote_decorators;
|
|
3676
|
+
let _evolve_decorators;
|
|
3632
3677
|
let _humanReleaseCold_decorators;
|
|
3633
3678
|
let _humanRollback_decorators;
|
|
3634
3679
|
let _humanAddFact_decorators;
|
|
@@ -3683,6 +3728,7 @@ let MemoryService = (() => {
|
|
|
3683
3728
|
_humanEditExperience_decorators = [Remote("humanEditExperience")];
|
|
3684
3729
|
_humanAddExperience_decorators = [Remote("humanAddExperience")];
|
|
3685
3730
|
_humanPromote_decorators = [Remote("humanPromote")];
|
|
3731
|
+
_evolve_decorators = [Remote("evolve")];
|
|
3686
3732
|
_humanReleaseCold_decorators = [Remote("humanReleaseCold")];
|
|
3687
3733
|
_humanRollback_decorators = [Remote("humanRollback")];
|
|
3688
3734
|
_humanAddFact_decorators = [Remote("humanAddFact")];
|
|
@@ -4094,6 +4140,17 @@ let MemoryService = (() => {
|
|
|
4094
4140
|
},
|
|
4095
4141
|
metadata: _metadata
|
|
4096
4142
|
}, null, _instanceExtraInitializers);
|
|
4143
|
+
__esDecorate(this, null, _evolve_decorators, {
|
|
4144
|
+
kind: "method",
|
|
4145
|
+
name: "evolve",
|
|
4146
|
+
static: false,
|
|
4147
|
+
private: false,
|
|
4148
|
+
access: {
|
|
4149
|
+
has: (obj) => "evolve" in obj,
|
|
4150
|
+
get: (obj) => obj.evolve
|
|
4151
|
+
},
|
|
4152
|
+
metadata: _metadata
|
|
4153
|
+
}, null, _instanceExtraInitializers);
|
|
4097
4154
|
__esDecorate(this, null, _humanReleaseCold_decorators, {
|
|
4098
4155
|
kind: "method",
|
|
4099
4156
|
name: "humanReleaseCold",
|
|
@@ -4528,6 +4585,9 @@ ${deletionList}
|
|
|
4528
4585
|
humanPromote(agent, id, reason) {
|
|
4529
4586
|
return this.core.humanPromote(id, reason, "human");
|
|
4530
4587
|
}
|
|
4588
|
+
evolve(agent, request) {
|
|
4589
|
+
return this.core.evolve(request, "human");
|
|
4590
|
+
}
|
|
4531
4591
|
/** Human re-release of a cold-palace revision back to candidate (006 §3.2). */
|
|
4532
4592
|
humanReleaseCold(agent, request) {
|
|
4533
4593
|
return this.core.humanReleaseCold(request, "human");
|
package/lib/types/core.d.ts
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*
|
|
21
21
|
* @module dsh-daoing-memory/core
|
|
22
22
|
*/
|
|
23
|
-
import type { ConcernTree, ConsolidateRequest, ConsolidateResult, DiaryAppendRequest, DiaryAppendResult, DiaryEntry, ExperienceListFilter, ExperienceSnapshot, ExtractionRecord, ExtractFactsRequest, ExtractFactsResult, FactEntry, HumanAddExperienceRequest, HumanAddFactRequest, HumanAckDiaryRequest, HumanArchiveExperienceRequest, HumanConfirmFactRequest, HumanDeleteConcernRequest, HumanDeleteExperienceRequest, HumanDeleteFactRequest, HumanEditExperienceRequest, HumanEditFactRequest, HumanPinRequest, HumanSetConcernStatusRequest, HumanReleaseColdRequest, IngestRequest, IngestResult, LedgerIntegrityResult, LedgerQueryRequest, MemoryExport, MemoryStats, RecallExperiencesRequest, RecallExperiencesResult, RefineExperienceRequest, RefineExperienceResult, ReportUseRequest, ReportUseResult, ReviseExperienceRequest, RollbackExperienceRequest, VerifyShadowRequest, VerifyShadowResult, SkillArtifact, SkillForm, SkillStatus, ReviewSkillRequest, PublishSkillRequest } from './types.ts';
|
|
23
|
+
import type { ConcernTree, ConsolidateRequest, ConsolidateResult, DiaryAppendRequest, DiaryAppendResult, DiaryEntry, ExperienceListFilter, ExperienceSnapshot, ExtractionRecord, ExtractFactsRequest, ExtractFactsResult, FactEntry, EvolveExperienceRequest, HumanAddExperienceRequest, HumanAddFactRequest, HumanAckDiaryRequest, HumanArchiveExperienceRequest, HumanConfirmFactRequest, HumanDeleteConcernRequest, HumanDeleteExperienceRequest, HumanDeleteFactRequest, HumanEditExperienceRequest, HumanEditFactRequest, HumanPinRequest, HumanSetConcernStatusRequest, HumanReleaseColdRequest, IngestRequest, IngestResult, LedgerIntegrityResult, LedgerQueryRequest, MemoryExport, MemoryStats, RecallExperiencesRequest, RecallExperiencesResult, RefineExperienceRequest, RefineExperienceResult, ReportUseRequest, ReportUseResult, ReviseExperienceRequest, RollbackExperienceRequest, VerifyShadowRequest, VerifyShadowResult, SkillArtifact, SkillForm, SkillStatus, ReviewSkillRequest, PublishSkillRequest } from './types.ts';
|
|
24
24
|
import { MemoryStore } from './store.ts';
|
|
25
25
|
/** Tunable mechanism parameters, all overridable from the plugin config. */
|
|
26
26
|
export interface MemoryCoreConfig {
|
|
@@ -234,6 +234,11 @@ export declare class MemoryCore {
|
|
|
234
234
|
humanPromote(id: string, reason: string, actor: MemoryActor): ExperienceSnapshot;
|
|
235
235
|
/** Human re-release (006 §3.2): move a cold-palace revision back to candidate. */
|
|
236
236
|
humanReleaseCold(request: HumanReleaseColdRequest, actor: MemoryActor): ExperienceSnapshot;
|
|
237
|
+
/** Human-approved self-growth: merge new evidence into a live, human-approved
|
|
238
|
+
* experience as an incremental new revision (revision+1, parent superseded).
|
|
239
|
+
* Only approvedBy='human' + status='live' may evolve; agent/system-approved
|
|
240
|
+
* and non-live (challenged/cold/archived) are rejected. */
|
|
241
|
+
evolve(request: EvolveExperienceRequest, actor: MemoryActor): ExperienceSnapshot;
|
|
237
242
|
/** Human acknowledgement of a pending diary entry: reviewed, no fact extracted. */
|
|
238
243
|
humanAckDiary(request: HumanAckDiaryRequest, actor: MemoryActor): DiaryEntry;
|
|
239
244
|
/** Human lifecycle change of a top-level concern (007 §2.4, audited). */
|
package/lib/types/core.js
CHANGED
|
@@ -428,7 +428,7 @@ export class MemoryCore {
|
|
|
428
428
|
if (request.outcome === 'success' && attribution === 'experience') {
|
|
429
429
|
if (next.status === 'candidate' && next.parentRevision !== undefined) {
|
|
430
430
|
// Revised draft passed its one successful use: adopt it.
|
|
431
|
-
const adopted = { ...next, status: 'live' };
|
|
431
|
+
const adopted = { ...next, status: 'live', approvedBy: 'agent' };
|
|
432
432
|
delete adopted.challengeReason;
|
|
433
433
|
next = adopted;
|
|
434
434
|
this.store.upsertExperience(next);
|
|
@@ -439,13 +439,13 @@ export class MemoryCore {
|
|
|
439
439
|
base.promoted = true;
|
|
440
440
|
}
|
|
441
441
|
else if (next.status === 'candidate') {
|
|
442
|
-
next = { ...next, status: 'live' };
|
|
442
|
+
next = { ...next, status: 'live', approvedBy: 'agent' };
|
|
443
443
|
this.ledger('promote', 'experience', next.id, actor, { revision: next.revision, via: 'use' });
|
|
444
444
|
base.promoted = true;
|
|
445
445
|
}
|
|
446
446
|
else if (next.status === 'archived') {
|
|
447
447
|
// Found via deep recall and used successfully once: back to live.
|
|
448
|
-
next = { ...next, status: 'live' };
|
|
448
|
+
next = { ...next, status: 'live', approvedBy: 'agent' };
|
|
449
449
|
this.ledger('restore', 'experience', next.id, actor, { revision: next.revision });
|
|
450
450
|
base.promoted = true;
|
|
451
451
|
}
|
|
@@ -1282,6 +1282,7 @@ export class MemoryCore {
|
|
|
1282
1282
|
verifiedCount: 0,
|
|
1283
1283
|
rejectCount: 0,
|
|
1284
1284
|
globalFlag: false,
|
|
1285
|
+
approvedBy: 'human',
|
|
1285
1286
|
createdAt: now,
|
|
1286
1287
|
updatedAt: now,
|
|
1287
1288
|
};
|
|
@@ -1303,7 +1304,7 @@ export class MemoryCore {
|
|
|
1303
1304
|
if (current.status !== 'candidate') {
|
|
1304
1305
|
throw new Error(`memory: only candidates accept human promotion (status=${current.status})`);
|
|
1305
1306
|
}
|
|
1306
|
-
const next = { ...current, status: 'live', lastVerifiedAt: Date.now(), updatedAt: Date.now() };
|
|
1307
|
+
const next = { ...current, status: 'live', approvedBy: 'human', lastVerifiedAt: Date.now(), updatedAt: Date.now() };
|
|
1307
1308
|
this.store.upsertExperience(next);
|
|
1308
1309
|
if (next.parentRevision !== undefined)
|
|
1309
1310
|
this.supersedeParent(next, actor);
|
|
@@ -1323,6 +1324,40 @@ export class MemoryCore {
|
|
|
1323
1324
|
this.ledger('release-cold', 'experience', next.id, actor, { revision: next.revision }, request.reason);
|
|
1324
1325
|
return next;
|
|
1325
1326
|
}
|
|
1327
|
+
/** Human-approved self-growth: merge new evidence into a live, human-approved
|
|
1328
|
+
* experience as an incremental new revision (revision+1, parent superseded).
|
|
1329
|
+
* Only approvedBy='human' + status='live' may evolve; agent/system-approved
|
|
1330
|
+
* and non-live (challenged/cold/archived) are rejected. */
|
|
1331
|
+
evolve(request, actor) {
|
|
1332
|
+
const current = this.store.getActiveRevision(request.id);
|
|
1333
|
+
if (current === undefined)
|
|
1334
|
+
throw new Error(`memory: experience not found: ${request.id}`);
|
|
1335
|
+
if (current.approvedBy !== 'human') {
|
|
1336
|
+
throw new Error(`memory: only human-approved experiences evolve (approvedBy=${String(current.approvedBy)})`);
|
|
1337
|
+
}
|
|
1338
|
+
if (current.status !== 'live') {
|
|
1339
|
+
throw new Error(`memory: only live experiences evolve (status=${current.status})`);
|
|
1340
|
+
}
|
|
1341
|
+
const situation = request.situation === undefined ? current.situation : [...new Set([...current.situation, ...request.situation])];
|
|
1342
|
+
const limits = request.limits === undefined ? current.limits : [...new Set([...current.limits, ...request.limits])];
|
|
1343
|
+
const now = Date.now();
|
|
1344
|
+
const next = {
|
|
1345
|
+
...current,
|
|
1346
|
+
revision: current.revision + 1,
|
|
1347
|
+
status: 'live',
|
|
1348
|
+
parentRevision: current.revision,
|
|
1349
|
+
gist: request.gist ?? current.gist,
|
|
1350
|
+
situation,
|
|
1351
|
+
path: request.path ?? current.path,
|
|
1352
|
+
reasoning: request.reasoning ?? current.reasoning,
|
|
1353
|
+
limits,
|
|
1354
|
+
updatedAt: now,
|
|
1355
|
+
};
|
|
1356
|
+
this.store.upsertExperience(next);
|
|
1357
|
+
this.supersedeParent(next, actor);
|
|
1358
|
+
this.ledger('evolve', 'experience', next.id, actor, { revision: next.revision, by: current.revision }, request.reason);
|
|
1359
|
+
return next;
|
|
1360
|
+
}
|
|
1326
1361
|
/** Human acknowledgement of a pending diary entry: reviewed, no fact extracted. */
|
|
1327
1362
|
humanAckDiary(request, actor) {
|
|
1328
1363
|
const entry = this.store.getDiary(request.diaryId);
|
package/lib/types/service.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { Context } from '@deepseek-ai/cordis';
|
|
|
9
9
|
import type { Agent } from '@deepseek-ai/dsh-agent';
|
|
10
10
|
import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
|
|
11
11
|
import type { MemoryCore } from './core.ts';
|
|
12
|
-
import type { ConcernTree, ConsolidateRequest, ConsolidateResult, DiaryAppendRequest, DiaryAppendResult, DiaryEntry, ExperienceListFilter, ExperienceSnapshot, ExtractionRecord, ExtractFactsRequest, ExtractFactsResult, FactEntry, GenerateSkillDraftRequest, HumanAddExperienceRequest, HumanAddFactRequest, HumanAckDiaryRequest, HumanConfirmFactRequest, HumanArchiveExperienceRequest, HumanDeleteConcernRequest, HumanDeleteExperienceRequest, HumanDeleteFactRequest, HumanEditExperienceRequest, HumanEditFactRequest, HumanPinRequest, HumanReleaseColdRequest, HumanSetConcernStatusRequest, IngestRequest, IngestResult, LedgerBlock, LedgerIntegrityResult, LedgerQueryRequest, MemoryExport, MemoryStats, MemoryWorkbenchInfo, PublishSkillRequest, RecallExperiencesRequest, RecallExperiencesResult, RefineExperienceRequest, RefineExperienceResult, ReportUseRequest, ReportUseResult, ReviewSkillRequest, ReviseExperienceRequest, RollbackExperienceRequest, SkillArtifact, VerifyShadowRequest, VerifyShadowResult } from './types.ts';
|
|
12
|
+
import type { ConcernTree, ConsolidateRequest, ConsolidateResult, DiaryAppendRequest, DiaryAppendResult, DiaryEntry, ExperienceListFilter, ExperienceSnapshot, ExtractionRecord, ExtractFactsRequest, ExtractFactsResult, FactEntry, GenerateSkillDraftRequest, EvolveExperienceRequest, HumanAddExperienceRequest, HumanAddFactRequest, HumanAckDiaryRequest, HumanConfirmFactRequest, HumanArchiveExperienceRequest, HumanDeleteConcernRequest, HumanDeleteExperienceRequest, HumanDeleteFactRequest, HumanEditExperienceRequest, HumanEditFactRequest, HumanPinRequest, HumanReleaseColdRequest, HumanSetConcernStatusRequest, IngestRequest, IngestResult, LedgerBlock, LedgerIntegrityResult, LedgerQueryRequest, MemoryExport, MemoryStats, MemoryWorkbenchInfo, PublishSkillRequest, RecallExperiencesRequest, RecallExperiencesResult, RefineExperienceRequest, RefineExperienceResult, ReportUseRequest, ReportUseResult, ReviewSkillRequest, ReviseExperienceRequest, RollbackExperienceRequest, SkillArtifact, VerifyShadowRequest, VerifyShadowResult } from './types.ts';
|
|
13
13
|
/**
|
|
14
14
|
* Remote face of the memory library. All methods delegate to the core; the
|
|
15
15
|
* core carries the 生·用·修·记 mechanism semantics.
|
|
@@ -142,6 +142,7 @@ export declare class MemoryService extends TypertRemoteService {
|
|
|
142
142
|
humanAddExperience(agent: Agent, request: HumanAddExperienceRequest): ExperienceSnapshot;
|
|
143
143
|
/** Human authority (V2): promote a candidate straight to live. */
|
|
144
144
|
humanPromote(agent: Agent, id: string, reason: string): ExperienceSnapshot;
|
|
145
|
+
evolve(agent: Agent, request: EvolveExperienceRequest): ExperienceSnapshot;
|
|
145
146
|
/** Human re-release of a cold-palace revision back to candidate (006 §3.2). */
|
|
146
147
|
humanReleaseCold(agent: Agent, request: HumanReleaseColdRequest): ExperienceSnapshot;
|
|
147
148
|
/** Human rollback. */
|
package/lib/types/service.js
CHANGED
|
@@ -92,6 +92,7 @@ let MemoryService = (() => {
|
|
|
92
92
|
let _humanEditExperience_decorators;
|
|
93
93
|
let _humanAddExperience_decorators;
|
|
94
94
|
let _humanPromote_decorators;
|
|
95
|
+
let _evolve_decorators;
|
|
95
96
|
let _humanReleaseCold_decorators;
|
|
96
97
|
let _humanRollback_decorators;
|
|
97
98
|
let _humanAddFact_decorators;
|
|
@@ -146,6 +147,7 @@ let MemoryService = (() => {
|
|
|
146
147
|
_humanEditExperience_decorators = [Remote('humanEditExperience')];
|
|
147
148
|
_humanAddExperience_decorators = [Remote('humanAddExperience')];
|
|
148
149
|
_humanPromote_decorators = [Remote('humanPromote')];
|
|
150
|
+
_evolve_decorators = [Remote('evolve')];
|
|
149
151
|
_humanReleaseCold_decorators = [Remote('humanReleaseCold')];
|
|
150
152
|
_humanRollback_decorators = [Remote('humanRollback')];
|
|
151
153
|
_humanAddFact_decorators = [Remote('humanAddFact')];
|
|
@@ -197,6 +199,7 @@ let MemoryService = (() => {
|
|
|
197
199
|
__esDecorate(this, null, _humanEditExperience_decorators, { kind: "method", name: "humanEditExperience", static: false, private: false, access: { has: obj => "humanEditExperience" in obj, get: obj => obj.humanEditExperience }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
198
200
|
__esDecorate(this, null, _humanAddExperience_decorators, { kind: "method", name: "humanAddExperience", static: false, private: false, access: { has: obj => "humanAddExperience" in obj, get: obj => obj.humanAddExperience }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
199
201
|
__esDecorate(this, null, _humanPromote_decorators, { kind: "method", name: "humanPromote", static: false, private: false, access: { has: obj => "humanPromote" in obj, get: obj => obj.humanPromote }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
202
|
+
__esDecorate(this, null, _evolve_decorators, { kind: "method", name: "evolve", static: false, private: false, access: { has: obj => "evolve" in obj, get: obj => obj.evolve }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
200
203
|
__esDecorate(this, null, _humanReleaseCold_decorators, { kind: "method", name: "humanReleaseCold", static: false, private: false, access: { has: obj => "humanReleaseCold" in obj, get: obj => obj.humanReleaseCold }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
201
204
|
__esDecorate(this, null, _humanRollback_decorators, { kind: "method", name: "humanRollback", static: false, private: false, access: { has: obj => "humanRollback" in obj, get: obj => obj.humanRollback }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
202
205
|
__esDecorate(this, null, _humanAddFact_decorators, { kind: "method", name: "humanAddFact", static: false, private: false, access: { has: obj => "humanAddFact" in obj, get: obj => obj.humanAddFact }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
@@ -511,6 +514,13 @@ ${deletionList}
|
|
|
511
514
|
void agent;
|
|
512
515
|
return this.core.humanPromote(id, reason, 'human');
|
|
513
516
|
}
|
|
517
|
+
/// Human-approved self-growth: merge new evidence into a live, human-approved
|
|
518
|
+
/// experience. Semantic merge decision is made upstream (LLM); this is the
|
|
519
|
+
/// audited write that produces an incremental new revision.
|
|
520
|
+
evolve(agent, request) {
|
|
521
|
+
void agent;
|
|
522
|
+
return this.core.evolve(request, 'human');
|
|
523
|
+
}
|
|
514
524
|
/** Human re-release of a cold-palace revision back to candidate (006 §3.2). */
|
|
515
525
|
humanReleaseCold(agent, request) {
|
|
516
526
|
void agent;
|
package/lib/types/store.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import type { DatabaseSync } from 'node:sqlite';
|
|
9
9
|
import type { ConcernEntry, ConcernStatus, ConcernTree, DiaryEntry, EvidenceRef, ExperienceSnapshot, ExperienceStatus, ExtractionRecord, FactEntry, LedgerBlock, SkillArtifact, SkillStatus } from './types.ts';
|
|
10
10
|
/** Monotone store schema version. v1→v2 is an additive ALTER migration (see open()). */
|
|
11
|
-
export declare const MEMORY_SCHEMA_VERSION =
|
|
11
|
+
export declare const MEMORY_SCHEMA_VERSION = 7;
|
|
12
12
|
/** Half-life (ms) of the recency weighting applied to verification samples. */
|
|
13
13
|
export declare const TRUST_HALF_LIFE_MS: number;
|
|
14
14
|
/** One concerns-table row (007 §2). */
|
package/lib/types/store.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { createHash } from 'node:crypto';
|
|
9
9
|
/** Monotone store schema version. v1→v2 is an additive ALTER migration (see open()). */
|
|
10
|
-
export const MEMORY_SCHEMA_VERSION =
|
|
10
|
+
export const MEMORY_SCHEMA_VERSION = 7;
|
|
11
11
|
/** Half-life (ms) of the recency weighting applied to verification samples. */
|
|
12
12
|
export const TRUST_HALF_LIFE_MS = 180 * 24 * 60 * 60 * 1000;
|
|
13
13
|
/** Hash one ledger block's content, chained to the previous hash. */
|
|
@@ -74,6 +74,7 @@ export class MemoryStore {
|
|
|
74
74
|
verified_count INTEGER NOT NULL DEFAULT 0,
|
|
75
75
|
reject_count INTEGER NOT NULL DEFAULT 0,
|
|
76
76
|
global_flag INTEGER NOT NULL DEFAULT 0,
|
|
77
|
+
approved_by TEXT NOT NULL DEFAULT '',
|
|
77
78
|
created_at INTEGER NOT NULL,
|
|
78
79
|
updated_at INTEGER NOT NULL,
|
|
79
80
|
PRIMARY KEY (family_id, revision)
|
|
@@ -225,6 +226,12 @@ export class MemoryStore {
|
|
|
225
226
|
`);
|
|
226
227
|
v = 6;
|
|
227
228
|
}
|
|
229
|
+
if (v === 6 && MEMORY_SCHEMA_VERSION >= 7) {
|
|
230
|
+
// v6 → v7 (experience self-growth): mark who approved a live experience to
|
|
231
|
+
// human so only human-approved experiences may evolve.
|
|
232
|
+
db.exec("ALTER TABLE experiences ADD COLUMN approved_by TEXT NOT NULL DEFAULT '';");
|
|
233
|
+
v = 7;
|
|
234
|
+
}
|
|
228
235
|
if (v !== MEMORY_SCHEMA_VERSION) {
|
|
229
236
|
throw new Error(`memory store schema version ${row.value} does not match ${MEMORY_SCHEMA_VERSION}; refusing to open`);
|
|
230
237
|
}
|
|
@@ -243,8 +250,8 @@ export class MemoryStore {
|
|
|
243
250
|
family_id, revision, kind, source, family, gist, situation, path, reasoning, limits,
|
|
244
251
|
status, alpha, beta, last_verified_at, pinned, tokens_saved, tokens_spent,
|
|
245
252
|
parent_revision, failure_reason, evidence, challenge_reason, deleted,
|
|
246
|
-
context, verified_count, reject_count, global_flag, created_at, updated_at
|
|
247
|
-
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0
|
|
253
|
+
context, verified_count, reject_count, global_flag, approved_by, created_at, updated_at
|
|
254
|
+
) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,0,?,?,?,?,?,?,?)
|
|
248
255
|
ON CONFLICT (family_id, revision) DO UPDATE SET
|
|
249
256
|
kind = excluded.kind,
|
|
250
257
|
source = excluded.source,
|
|
@@ -269,8 +276,9 @@ export class MemoryStore {
|
|
|
269
276
|
verified_count = excluded.verified_count,
|
|
270
277
|
reject_count = excluded.reject_count,
|
|
271
278
|
global_flag = excluded.global_flag,
|
|
279
|
+
approved_by = excluded.approved_by,
|
|
272
280
|
updated_at = excluded.updated_at
|
|
273
|
-
`).run(s.id, s.revision, s.kind, s.source, s.family, s.gist, JSON.stringify(s.situation), JSON.stringify(s.path), s.reasoning, JSON.stringify(s.limits), s.status, s.alpha, s.beta, s.lastVerifiedAt ?? null, s.pinned ? 1 : 0, s.tokensSaved, s.tokensSpent, s.parentRevision ?? null, s.failureReason ?? null, s.evidence === undefined ? null : JSON.stringify(s.evidence), s.challengeReason ?? null, s.context ?? '', s.verifiedCount ?? 0, s.rejectCount ?? 0, s.globalFlag === true ? 1 : 0, s.createdAt, s.updatedAt);
|
|
281
|
+
`).run(s.id, s.revision, s.kind, s.source, s.family, s.gist, JSON.stringify(s.situation), JSON.stringify(s.path), s.reasoning, JSON.stringify(s.limits), s.status, s.alpha, s.beta, s.lastVerifiedAt ?? null, s.pinned ? 1 : 0, s.tokensSaved, s.tokensSpent, s.parentRevision ?? null, s.failureReason ?? null, s.evidence === undefined ? null : JSON.stringify(s.evidence), s.challengeReason ?? null, s.context ?? '', s.verifiedCount ?? 0, s.rejectCount ?? 0, s.globalFlag === true ? 1 : 0, s.approvedBy ?? '', s.createdAt, s.updatedAt);
|
|
274
282
|
}
|
|
275
283
|
/** Read one experience revision. */
|
|
276
284
|
getExperience(familyId, revision) {
|
|
@@ -850,6 +858,8 @@ export class MemoryStore {
|
|
|
850
858
|
snapshot.evidence = JSON.parse(row.evidence);
|
|
851
859
|
if (row.challenge_reason !== null)
|
|
852
860
|
snapshot.challengeReason = row.challenge_reason;
|
|
861
|
+
if (row.approved_by === 'human' || row.approved_by === 'agent')
|
|
862
|
+
snapshot.approvedBy = row.approved_by;
|
|
853
863
|
return snapshot;
|
|
854
864
|
}
|
|
855
865
|
rowToReport(row) {
|
package/lib/types/types.d.ts
CHANGED
|
@@ -93,6 +93,8 @@ export interface ExperienceSnapshot {
|
|
|
93
93
|
rejectCount: number;
|
|
94
94
|
/** Cross-context transferable (global) flag; default local-only (006 §2.4). */
|
|
95
95
|
globalFlag: boolean;
|
|
96
|
+
/** Who approved this live revision: 'human' only may self-grow (evolve). */
|
|
97
|
+
approvedBy?: 'human' | 'agent';
|
|
96
98
|
/** Epoch ms. */
|
|
97
99
|
createdAt: number;
|
|
98
100
|
/** Epoch ms. */
|
|
@@ -647,6 +649,24 @@ export interface HumanAddExperienceRequest {
|
|
|
647
649
|
/** Required reason (audited). */
|
|
648
650
|
reason: string;
|
|
649
651
|
}
|
|
652
|
+
/** Human-approved experience self-growth: merge new evidence into a live,
|
|
653
|
+
* human-approved experience as an incremental new revision. */
|
|
654
|
+
export interface EvolveExperienceRequest {
|
|
655
|
+
/** Experience family id (must be approvedBy='human' and live). */
|
|
656
|
+
id: string;
|
|
657
|
+
/** What new evidence is merged and why. */
|
|
658
|
+
reason: string;
|
|
659
|
+
/** Replacement/merged gist (kept when omitted). */
|
|
660
|
+
gist?: string;
|
|
661
|
+
/** Extra situations to absorb (combined when omitted). */
|
|
662
|
+
situation?: string[];
|
|
663
|
+
/** Replacement path (kept when omitted). */
|
|
664
|
+
path?: ExperienceStep[];
|
|
665
|
+
/** Replacement reasoning (kept when omitted). */
|
|
666
|
+
reasoning?: string;
|
|
667
|
+
/** Extra limits to absorb (combined when omitted). */
|
|
668
|
+
limits?: string[];
|
|
669
|
+
}
|
|
650
670
|
/** Human fact operations. */
|
|
651
671
|
export interface HumanAddFactRequest {
|
|
652
672
|
/** Profile slot. */
|
package/package.json
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-daoing-memory",
|
|
3
|
-
"description": "Self-evolving memory for DeepSeek Harness (DSH): earned experiences, diary/fact semantic memory, concern tracking, and an append-only audit ledger.",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"type": "module",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"author": "daoing",
|
|
8
|
-
"homepage": "https://github.com/daoing/dsh-daoing-memory",
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/daoing/dsh-daoing-memory.git"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
"dsh",
|
|
15
|
-
"deepseek-harness",
|
|
16
|
-
"dsh-plugin",
|
|
17
|
-
"memory",
|
|
18
|
-
"agent-memory",
|
|
19
|
-
"self-evolving",
|
|
20
|
-
"cordis"
|
|
21
|
-
],
|
|
22
|
-
"main": "lib/index.js",
|
|
23
|
-
"types": "lib/types/index.d.ts",
|
|
24
|
-
"exports": {
|
|
25
|
-
".": {
|
|
26
|
-
"types": "./lib/types/index.d.ts",
|
|
27
|
-
"default": "./lib/index.js"
|
|
28
|
-
},
|
|
29
|
-
"./types": {
|
|
30
|
-
"types": "./lib/types/types.d.ts",
|
|
31
|
-
"default": "./lib/types/types.js"
|
|
32
|
-
},
|
|
33
|
-
"./core": {
|
|
34
|
-
"types": "./lib/types/core.d.ts",
|
|
35
|
-
"default": "./lib/types/core.js"
|
|
36
|
-
},
|
|
37
|
-
"./store": {
|
|
38
|
-
"types": "./lib/types/store.d.ts",
|
|
39
|
-
"default": "./lib/types/store.js"
|
|
40
|
-
},
|
|
41
|
-
"./service": {
|
|
42
|
-
"types": "./lib/types/service.d.ts",
|
|
43
|
-
"default": "./lib/types/service.js"
|
|
44
|
-
},
|
|
45
|
-
"./tools": {
|
|
46
|
-
"types": "./lib/types/tools.d.ts",
|
|
47
|
-
"default": "./lib/tools.js"
|
|
48
|
-
},
|
|
49
|
-
"./invariant": {
|
|
50
|
-
"types": "./lib/types/invariant.d.ts",
|
|
51
|
-
"default": "./lib/invariant.js"
|
|
52
|
-
},
|
|
53
|
-
"./client": {
|
|
54
|
-
"types": "./lib/types/client/index.d.ts",
|
|
55
|
-
"default": "./lib/client.js"
|
|
56
|
-
},
|
|
57
|
-
"./typert": {
|
|
58
|
-
"types": "./lib/typert.host.d.ts",
|
|
59
|
-
"default": "./lib/typert.host.js"
|
|
60
|
-
},
|
|
61
|
-
"./remote": {
|
|
62
|
-
"types": "./lib/typert.remote-client.d.ts",
|
|
63
|
-
"default": "./lib/typert.remote-client.js"
|
|
64
|
-
},
|
|
65
|
-
"./package.json": "./package.json"
|
|
66
|
-
},
|
|
67
|
-
"dsh": {
|
|
68
|
-
"bundle": {
|
|
69
|
-
"patch": "./cordis.patch.yml"
|
|
70
|
-
},
|
|
71
|
-
"client": {
|
|
72
|
-
"inject": [
|
|
73
|
-
"@deepseek-ai/dsh-client-runtime",
|
|
74
|
-
"@deepseek-ai/dsh-api-remotes",
|
|
75
|
-
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
76
|
-
"@deepseek-ai/dsh-client-ui-primitives"
|
|
77
|
-
],
|
|
78
|
-
"platform": "web"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"files": [
|
|
82
|
-
"lib/index.js",
|
|
83
|
-
"lib/invariant.js",
|
|
84
|
-
"lib/tools.js",
|
|
85
|
-
"lib/client.js",
|
|
86
|
-
"lib/client.js.map",
|
|
87
|
-
"lib/typert.host.js",
|
|
88
|
-
"lib/typert.host.d.ts",
|
|
89
|
-
"lib/typert.remote-client.js",
|
|
90
|
-
"lib/typert.remote-client.d.ts",
|
|
91
|
-
"lib/types/**/*.js",
|
|
92
|
-
"lib/types/**/*.d.ts",
|
|
93
|
-
"skill",
|
|
94
|
-
"cordis.patch.yml",
|
|
95
|
-
"README.md",
|
|
96
|
-
"LICENSE"
|
|
97
|
-
],
|
|
98
|
-
"dependencies": {
|
|
99
|
-
"clsx": "^2.0.0",
|
|
100
|
-
"zod": "^4.4.3"
|
|
101
|
-
},
|
|
102
|
-
"peerDependencies": {
|
|
103
|
-
"@deepseek-ai/cordis": "*",
|
|
104
|
-
"@deepseek-ai/dsh-agent": "*",
|
|
105
|
-
"@deepseek-ai/dsh-api-remotes": "*",
|
|
106
|
-
"@deepseek-ai/dsh-client-runtime": "*",
|
|
107
|
-
"@deepseek-ai/dsh-client-ui-layout": "*",
|
|
108
|
-
"@deepseek-ai/dsh-client-ui-primitives": "*",
|
|
109
|
-
"@deepseek-ai/dsh-client-ui-sidebar": "*",
|
|
110
|
-
"@deepseek-ai/dsh-client-ui-slots": "*",
|
|
111
|
-
"@deepseek-ai/dsh-invariants": "*",
|
|
112
|
-
"@deepseek-ai/dsh-tools": "*",
|
|
113
|
-
"@deepseek-ai/dsh-typert-protocol": "*",
|
|
114
|
-
"react": ">=18"
|
|
115
|
-
}
|
|
116
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-daoing-memory",
|
|
3
|
+
"description": "Self-evolving memory for DeepSeek Harness (DSH): earned experiences, diary/fact semantic memory, concern tracking, and an append-only audit ledger.",
|
|
4
|
+
"version": "0.1.18",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "daoing",
|
|
8
|
+
"homepage": "https://github.com/daoing/dsh-daoing-memory",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/daoing/dsh-daoing-memory.git"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"dsh",
|
|
15
|
+
"deepseek-harness",
|
|
16
|
+
"dsh-plugin",
|
|
17
|
+
"memory",
|
|
18
|
+
"agent-memory",
|
|
19
|
+
"self-evolving",
|
|
20
|
+
"cordis"
|
|
21
|
+
],
|
|
22
|
+
"main": "lib/index.js",
|
|
23
|
+
"types": "lib/types/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./lib/types/index.d.ts",
|
|
27
|
+
"default": "./lib/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./types": {
|
|
30
|
+
"types": "./lib/types/types.d.ts",
|
|
31
|
+
"default": "./lib/types/types.js"
|
|
32
|
+
},
|
|
33
|
+
"./core": {
|
|
34
|
+
"types": "./lib/types/core.d.ts",
|
|
35
|
+
"default": "./lib/types/core.js"
|
|
36
|
+
},
|
|
37
|
+
"./store": {
|
|
38
|
+
"types": "./lib/types/store.d.ts",
|
|
39
|
+
"default": "./lib/types/store.js"
|
|
40
|
+
},
|
|
41
|
+
"./service": {
|
|
42
|
+
"types": "./lib/types/service.d.ts",
|
|
43
|
+
"default": "./lib/types/service.js"
|
|
44
|
+
},
|
|
45
|
+
"./tools": {
|
|
46
|
+
"types": "./lib/types/tools.d.ts",
|
|
47
|
+
"default": "./lib/tools.js"
|
|
48
|
+
},
|
|
49
|
+
"./invariant": {
|
|
50
|
+
"types": "./lib/types/invariant.d.ts",
|
|
51
|
+
"default": "./lib/invariant.js"
|
|
52
|
+
},
|
|
53
|
+
"./client": {
|
|
54
|
+
"types": "./lib/types/client/index.d.ts",
|
|
55
|
+
"default": "./lib/client.js"
|
|
56
|
+
},
|
|
57
|
+
"./typert": {
|
|
58
|
+
"types": "./lib/typert.host.d.ts",
|
|
59
|
+
"default": "./lib/typert.host.js"
|
|
60
|
+
},
|
|
61
|
+
"./remote": {
|
|
62
|
+
"types": "./lib/typert.remote-client.d.ts",
|
|
63
|
+
"default": "./lib/typert.remote-client.js"
|
|
64
|
+
},
|
|
65
|
+
"./package.json": "./package.json"
|
|
66
|
+
},
|
|
67
|
+
"dsh": {
|
|
68
|
+
"bundle": {
|
|
69
|
+
"patch": "./cordis.patch.yml"
|
|
70
|
+
},
|
|
71
|
+
"client": {
|
|
72
|
+
"inject": [
|
|
73
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
74
|
+
"@deepseek-ai/dsh-api-remotes",
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-primitives"
|
|
77
|
+
],
|
|
78
|
+
"platform": "web"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"files": [
|
|
82
|
+
"lib/index.js",
|
|
83
|
+
"lib/invariant.js",
|
|
84
|
+
"lib/tools.js",
|
|
85
|
+
"lib/client.js",
|
|
86
|
+
"lib/client.js.map",
|
|
87
|
+
"lib/typert.host.js",
|
|
88
|
+
"lib/typert.host.d.ts",
|
|
89
|
+
"lib/typert.remote-client.js",
|
|
90
|
+
"lib/typert.remote-client.d.ts",
|
|
91
|
+
"lib/types/**/*.js",
|
|
92
|
+
"lib/types/**/*.d.ts",
|
|
93
|
+
"skill",
|
|
94
|
+
"cordis.patch.yml",
|
|
95
|
+
"README.md",
|
|
96
|
+
"LICENSE"
|
|
97
|
+
],
|
|
98
|
+
"dependencies": {
|
|
99
|
+
"clsx": "^2.0.0",
|
|
100
|
+
"zod": "^4.4.3"
|
|
101
|
+
},
|
|
102
|
+
"peerDependencies": {
|
|
103
|
+
"@deepseek-ai/cordis": "*",
|
|
104
|
+
"@deepseek-ai/dsh-agent": "*",
|
|
105
|
+
"@deepseek-ai/dsh-api-remotes": "*",
|
|
106
|
+
"@deepseek-ai/dsh-client-runtime": "*",
|
|
107
|
+
"@deepseek-ai/dsh-client-ui-layout": "*",
|
|
108
|
+
"@deepseek-ai/dsh-client-ui-primitives": "*",
|
|
109
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "*",
|
|
110
|
+
"@deepseek-ai/dsh-client-ui-slots": "*",
|
|
111
|
+
"@deepseek-ai/dsh-invariants": "*",
|
|
112
|
+
"@deepseek-ai/dsh-tools": "*",
|
|
113
|
+
"@deepseek-ai/dsh-typert-protocol": "*",
|
|
114
|
+
"react": ">=18"
|
|
115
|
+
}
|
|
116
|
+
}
|