@hy-sde-org/dsh-memory-extraction 0.1.2-rc.1
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/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +148 -0
- package/README.zh.md +134 -0
- package/dist/control.d.ts +42 -0
- package/dist/control.d.ts.map +1 -0
- package/dist/control.js +125 -0
- package/dist/control.js.map +1 -0
- package/dist/engine.d.ts +78 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +411 -0
- package/dist/engine.js.map +1 -0
- package/dist/events.d.ts +19 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +76 -0
- package/dist/events.js.map +1 -0
- package/dist/evidence.d.ts +66 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +221 -0
- package/dist/evidence.js.map +1 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +72 -0
- package/dist/index.js.map +1 -0
- package/dist/memory-adapter.d.ts +44 -0
- package/dist/memory-adapter.d.ts.map +1 -0
- package/dist/memory-adapter.js +69 -0
- package/dist/memory-adapter.js.map +1 -0
- package/dist/proposal.d.ts +63 -0
- package/dist/proposal.d.ts.map +1 -0
- package/dist/proposal.js +309 -0
- package/dist/proposal.js.map +1 -0
- package/dist/runtime.d.ts +56 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +172 -0
- package/dist/runtime.js.map +1 -0
- package/dist/types.d.ts +196 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +18 -0
- package/dist/types.js.map +1 -0
- package/package.json +58 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vocabulary for automatic long-term-memory extraction (Maka port, slice No. 2):
|
|
3
|
+
* the frozen source snapshot, evidence records, proposal items, admission
|
|
4
|
+
* results, and the durable cursor / receipt / pending-failure records the
|
|
5
|
+
* pipeline commits through.
|
|
6
|
+
*
|
|
7
|
+
* The pipeline is additive to DSH's explicit `retain`/`learn`/`memory_edit`
|
|
8
|
+
* surface — same `ctx.memory` store, one new trigger (compaction checkpoints).
|
|
9
|
+
* Maka's 8-facet memory-item schema (kind/statementType/temporalType/scope/
|
|
10
|
+
* keys) is deliberately NOT ported: DSH's bank stores plain content + context
|
|
11
|
+
* + source + importance. The Maka discipline that IS load-bearing — verbatim
|
|
12
|
+
* quote admission, deterministic policy rejection, canonicalization
|
|
13
|
+
* re-admission, bounded evidence, deterministic operation ids — lives in
|
|
14
|
+
* `evidence.ts`/`proposal.ts`/`engine.ts` unchanged.
|
|
15
|
+
* @module @hy-sde-org/dsh-memory-extraction/types
|
|
16
|
+
*/
|
|
17
|
+
/** v1 triggers only `compaction`; `remember`/`extract` are reserved (Maka names, not ported as tools). */
|
|
18
|
+
export type MemoryExtractionTrigger = 'compaction';
|
|
19
|
+
export type MemoryExtractionGate = {
|
|
20
|
+
readonly allowed: true;
|
|
21
|
+
} | {
|
|
22
|
+
readonly allowed: false;
|
|
23
|
+
readonly reason: 'disabled' | 'ineligible' | 'unavailable';
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Frozen extraction request. The runtime builds it from the live session at
|
|
27
|
+
* trigger time and freezes exactly the facts the pipeline may read; the engine
|
|
28
|
+
* never touches the live session after this point.
|
|
29
|
+
*/
|
|
30
|
+
export interface MemoryExtractionSourceSnapshot {
|
|
31
|
+
readonly trigger: MemoryExtractionTrigger;
|
|
32
|
+
readonly sessionId: string;
|
|
33
|
+
/** Durable boundary: the seq of the triggering `compaction/summary` event. */
|
|
34
|
+
readonly boundarySeq: number;
|
|
35
|
+
/** Absolute project cwd for the memory commit (session header). */
|
|
36
|
+
readonly workspaceKey?: string;
|
|
37
|
+
/** Routed provider/model for the auxiliary call (session request header). */
|
|
38
|
+
readonly provider?: string;
|
|
39
|
+
readonly model?: string;
|
|
40
|
+
/** Gate facts: subagent children are policy-denied from the automatic path. */
|
|
41
|
+
readonly origin?: 'subagent';
|
|
42
|
+
readonly delegationDepth?: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* One session-log entry reduced to the portable text facts the engine needs.
|
|
46
|
+
* The runtime adapter projects real `SessionEvent`s into this shape, so the
|
|
47
|
+
* engine stays testable without a live `Session`. Anything the adapter does
|
|
48
|
+
* not carry (tool calls, thinking, attachments, provider metadata) is
|
|
49
|
+
* deliberately outside the memory interpretation domain.
|
|
50
|
+
*/
|
|
51
|
+
export interface MemoryExtractionTextEvent {
|
|
52
|
+
/** Session seq — the pipeline's ordinal. */
|
|
53
|
+
readonly seq: number;
|
|
54
|
+
/** `user` / `assistant` / `other` (tool, plugin checkpoint, log marker). */
|
|
55
|
+
readonly role: 'user' | 'assistant' | 'other';
|
|
56
|
+
/** Producer identity: `user` (human), `model`, `plugin`, `tool`, `other`. */
|
|
57
|
+
readonly author: 'user' | 'model' | 'plugin' | 'tool' | 'other';
|
|
58
|
+
/** Joined text of the event's text content blocks; absent for non-text events. */
|
|
59
|
+
readonly text?: string;
|
|
60
|
+
/** Turn identity when the adapter can derive one (DSH turn number); absent otherwise. */
|
|
61
|
+
readonly turn?: number;
|
|
62
|
+
/** Unix epoch milliseconds. */
|
|
63
|
+
readonly time: number;
|
|
64
|
+
}
|
|
65
|
+
/** One seq-positioned entry in the event window. */
|
|
66
|
+
export interface MemoryExtractionEventEntry {
|
|
67
|
+
readonly seq: number;
|
|
68
|
+
readonly event: MemoryExtractionTextEvent;
|
|
69
|
+
}
|
|
70
|
+
/** One bounded user-authored evidence record. */
|
|
71
|
+
export interface MemoryExtractionEvidence {
|
|
72
|
+
/** Stable ref used in proposal citations: `event:<seq>`. */
|
|
73
|
+
readonly sourceRef: string;
|
|
74
|
+
readonly type: 'user_message';
|
|
75
|
+
/** Exactly the bounded text shown to the model and used for admission. */
|
|
76
|
+
readonly text: string;
|
|
77
|
+
readonly events: readonly MemoryExtractionTextEvent[];
|
|
78
|
+
}
|
|
79
|
+
/** The complete coverage plan for one trigger range. */
|
|
80
|
+
export interface MemoryCoveragePlan {
|
|
81
|
+
readonly entries: readonly MemoryExtractionEventEntry[];
|
|
82
|
+
readonly evidence: readonly MemoryExtractionEvidence[];
|
|
83
|
+
}
|
|
84
|
+
/** One verbatim-cited evidence citation inside a proposal item. */
|
|
85
|
+
export interface MemoryEvidenceCitation {
|
|
86
|
+
readonly sourceRef: string;
|
|
87
|
+
readonly quote: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* One proposed memory item (stage 1). Maka's facet set is reduced to content
|
|
91
|
+
* + citations; admission enforces bounds, verbatim quotes, and policy.
|
|
92
|
+
*/
|
|
93
|
+
export interface MemoryProposalItem {
|
|
94
|
+
readonly content: string;
|
|
95
|
+
readonly evidence: readonly MemoryEvidenceCitation[];
|
|
96
|
+
}
|
|
97
|
+
/** Stage-1 result for an incidental (automatic) extraction. */
|
|
98
|
+
export type MemoryProposal = {
|
|
99
|
+
readonly status: 'complete';
|
|
100
|
+
readonly incidents: readonly MemoryProposalItem[];
|
|
101
|
+
} | {
|
|
102
|
+
readonly status: 'search_required';
|
|
103
|
+
readonly search: {
|
|
104
|
+
readonly terms: readonly string[];
|
|
105
|
+
readonly roles?: readonly ('user' | 'assistant')[];
|
|
106
|
+
};
|
|
107
|
+
} | {
|
|
108
|
+
readonly status: 'cannot_resolve';
|
|
109
|
+
};
|
|
110
|
+
/** Localized (second-pass) result: complete or cannot_resolve. */
|
|
111
|
+
export type LocalizedMemoryProposal = {
|
|
112
|
+
readonly status: 'complete';
|
|
113
|
+
readonly incidents: readonly MemoryProposalItem[];
|
|
114
|
+
} | {
|
|
115
|
+
readonly status: 'cannot_resolve';
|
|
116
|
+
};
|
|
117
|
+
/** Canonicalization result: accept/rewrite or reject per candidate id. */
|
|
118
|
+
export type MemoryCanonicalization = {
|
|
119
|
+
readonly results: readonly {
|
|
120
|
+
readonly candidateId: string;
|
|
121
|
+
readonly status: 'accepted' | 'rejected';
|
|
122
|
+
/** Rewritten durable content for `accepted` (admission re-runs against the original evidence quotes). */
|
|
123
|
+
readonly content?: string;
|
|
124
|
+
}[];
|
|
125
|
+
};
|
|
126
|
+
/** One admitted item ready to commit. */
|
|
127
|
+
export interface AdmittedMemoryItem {
|
|
128
|
+
readonly content: string;
|
|
129
|
+
readonly citedSeqs: readonly number[];
|
|
130
|
+
}
|
|
131
|
+
/** Session-wide watermark: the highest seq already evaluated for memory. */
|
|
132
|
+
export interface MemoryExtractionCursor {
|
|
133
|
+
readonly sessionId: string;
|
|
134
|
+
readonly processedSeq: number;
|
|
135
|
+
readonly updatedAt: number;
|
|
136
|
+
}
|
|
137
|
+
/** One frozen range retained for exactly one later retry. */
|
|
138
|
+
export interface PendingMemoryExtractionFailure {
|
|
139
|
+
readonly sessionId: string;
|
|
140
|
+
readonly fromSeq: number;
|
|
141
|
+
readonly throughSeq: number;
|
|
142
|
+
readonly coverageHash: string;
|
|
143
|
+
readonly operationId: string;
|
|
144
|
+
readonly attempts: number;
|
|
145
|
+
readonly failureClass: MemoryExtractionFailureClass;
|
|
146
|
+
readonly failedAt: number;
|
|
147
|
+
}
|
|
148
|
+
export type MemoryExtractionFailureClass = 'provider' | 'schema' | 'evidence' | 'localization' | 'admission';
|
|
149
|
+
export interface MemoryExtractionReceipt {
|
|
150
|
+
readonly operationId: string;
|
|
151
|
+
readonly sessionId: string;
|
|
152
|
+
readonly status: 'extracted' | 'skipped' | 'discarded';
|
|
153
|
+
/** Committed contents, in commit order (for the result message). */
|
|
154
|
+
readonly items: readonly string[];
|
|
155
|
+
readonly committedAt: number;
|
|
156
|
+
}
|
|
157
|
+
/** Ports request the range hash is verified against — the idempotency key. */
|
|
158
|
+
export interface CommitMemoryExtractionRequest {
|
|
159
|
+
readonly operationId: string;
|
|
160
|
+
readonly sessionId: string;
|
|
161
|
+
readonly expectedCursorSeq: number;
|
|
162
|
+
readonly nextCursorSeq: number;
|
|
163
|
+
readonly coverageHash: string;
|
|
164
|
+
/** Admitted, canonicalized contents to commit. */
|
|
165
|
+
readonly items: readonly AdmittedMemoryItem[];
|
|
166
|
+
readonly trigger: MemoryExtractionTrigger;
|
|
167
|
+
}
|
|
168
|
+
export type SettleMemoryExtractionFailureResult = {
|
|
169
|
+
readonly status: 'retry_later';
|
|
170
|
+
readonly pending: PendingMemoryExtractionFailure;
|
|
171
|
+
} | {
|
|
172
|
+
readonly status: 'discarded';
|
|
173
|
+
readonly cursor: MemoryExtractionCursor;
|
|
174
|
+
};
|
|
175
|
+
export interface SettleMemoryExtractionFailureRequest {
|
|
176
|
+
readonly operationId: string;
|
|
177
|
+
readonly sessionId: string;
|
|
178
|
+
readonly expectedCursorSeq: number;
|
|
179
|
+
readonly failedThroughSeq: number;
|
|
180
|
+
readonly coverageHash: string;
|
|
181
|
+
readonly failureClass: MemoryExtractionFailureClass;
|
|
182
|
+
readonly trigger: MemoryExtractionTrigger;
|
|
183
|
+
}
|
|
184
|
+
/** Result of one `engine.execute` run (fail-open by contract: never throws). */
|
|
185
|
+
export type MemoryExtractionRunResult = {
|
|
186
|
+
readonly status: 'extracted';
|
|
187
|
+
readonly items: readonly string[];
|
|
188
|
+
} | {
|
|
189
|
+
readonly status: 'skipped';
|
|
190
|
+
} | {
|
|
191
|
+
readonly status: 'no_range';
|
|
192
|
+
} | {
|
|
193
|
+
readonly status: 'unavailable';
|
|
194
|
+
readonly reason?: string;
|
|
195
|
+
};
|
|
196
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,0GAA0G;AAC1G,MAAM,MAAM,uBAAuB,GAAG,YAAY,CAAA;AAElD,MAAM,MAAM,oBAAoB,GAC5B;IAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAA;CAAE,GAC1B;IAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CA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,CAAC,OAAO,EAAE,uBAAuB,CAAA;CAC1C;AAED,gFAAgF;AAChF,MAAM,MAAM,yBAAyB,GACjC;IAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GACnE;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;CAAE,GAC/B;IAAE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vocabulary for automatic long-term-memory extraction (Maka port, slice No. 2):
|
|
3
|
+
* the frozen source snapshot, evidence records, proposal items, admission
|
|
4
|
+
* results, and the durable cursor / receipt / pending-failure records the
|
|
5
|
+
* pipeline commits through.
|
|
6
|
+
*
|
|
7
|
+
* The pipeline is additive to DSH's explicit `retain`/`learn`/`memory_edit`
|
|
8
|
+
* surface — same `ctx.memory` store, one new trigger (compaction checkpoints).
|
|
9
|
+
* Maka's 8-facet memory-item schema (kind/statementType/temporalType/scope/
|
|
10
|
+
* keys) is deliberately NOT ported: DSH's bank stores plain content + context
|
|
11
|
+
* + source + importance. The Maka discipline that IS load-bearing — verbatim
|
|
12
|
+
* quote admission, deterministic policy rejection, canonicalization
|
|
13
|
+
* re-admission, bounded evidence, deterministic operation ids — lives in
|
|
14
|
+
* `evidence.ts`/`proposal.ts`/`engine.ts` unchanged.
|
|
15
|
+
* @module @hy-sde-org/dsh-memory-extraction/types
|
|
16
|
+
*/
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hy-sde-org/dsh-memory-extraction",
|
|
3
|
+
"description": "Automatic long-term-memory extraction at compaction checkpoints: evidence projection, proposal/canonicalization pipeline, gated ctx.memory commit, and durable cursors/receipts/failure ledger (Maka port, slice No. 2)",
|
|
4
|
+
"version": "0.1.2-rc.1",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "packages/memory/memory-extraction"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
31
|
+
"@deepseek-ai/dsh-compaction": "^0.1.2-rc.1",
|
|
32
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-rc.1",
|
|
33
|
+
"@deepseek-ai/dsh-session": "^0.1.2-rc.1",
|
|
34
|
+
"@deepseek-ai/dsh-storage": "^0.1.2-rc.1",
|
|
35
|
+
"@hy-sde-org/dsh-memory": "^0.1.2-rc.2"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@deepseek-ai/schemastery": "3.18.1"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
42
|
+
"@deepseek-ai/dsh-compaction": "^0.1.2-rc.1",
|
|
43
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-rc.1",
|
|
44
|
+
"@deepseek-ai/dsh-session": "^0.1.2-rc.1",
|
|
45
|
+
"@deepseek-ai/dsh-storage": "^0.1.2-rc.1",
|
|
46
|
+
"@deepseek-ai/dsh-storage-sqlite": "^0.0.1-rc.1",
|
|
47
|
+
"@types/node": "^24.0.0",
|
|
48
|
+
"typescript": "^5.9.3",
|
|
49
|
+
"vitest": "^3.2.7",
|
|
50
|
+
"@hy-sde-org/dsh-memory": "0.1.2-rc.2"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"clean": "rm -rf dist",
|
|
54
|
+
"build": "tsc -p tsconfig.build.json",
|
|
55
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
56
|
+
"test": "vitest run"
|
|
57
|
+
}
|
|
58
|
+
}
|