@try-works/dsh-memory 0.2.0 → 0.2.2
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/STATUS.md +6 -4
- package/package.json +1 -1
- package/src/forget.js +7 -0
- package/src/store.js +1 -1
- package/src/system-doc.js +2 -1
package/STATUS.md
CHANGED
|
@@ -28,10 +28,12 @@ What does NOT exist, by design: content indexing. The store documents a file ("W
|
|
|
28
28
|
to read it"); it never extracts or indexes the file's contents, and a token that appears only
|
|
29
29
|
inside a PDF is deliberately not searchable (pinned by the acceptance suite).
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
would hide the entry while its inventory refcount stayed, orphaning the blob)
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
Three integration decisions worth keeping: `refresh` skips the asset layer entirely (a supersede
|
|
32
|
+
would hide the entry while its inventory refcount stayed, orphaning the blob); the generic
|
|
33
|
+
`memory_forget` REFUSES an asset entry and names `memory_asset_forget`, which is the only path
|
|
34
|
+
that decrements the inventory; and an automatic capture over quota records a notice instead of
|
|
35
|
+
asking, because `session/event` is reentrancy-sensitive and has no answerer — only
|
|
36
|
+
`memory_asset_put` asks.
|
|
35
37
|
|
|
36
38
|
## Store performance, 2026-11-01
|
|
37
39
|
|
package/package.json
CHANGED
package/src/forget.js
CHANGED
|
@@ -40,6 +40,13 @@ export function isSuppressed(root, scope, text) {
|
|
|
40
40
|
export function forget(store, id) {
|
|
41
41
|
const entry = buildLedger(store.root).find((e) => e.id === id)
|
|
42
42
|
if (!entry) throw new Error('no such entry: ' + id)
|
|
43
|
+
// An ASSET entry is removed by memory_asset_forget, which also decrements the inventory and
|
|
44
|
+
// deletes the object when it is the last reference. This function only marks an entry
|
|
45
|
+
// superseded, so allowing it here would hide the asset while the blob stayed in the store and in
|
|
46
|
+
// LFS with nothing pointing at it - the same orphan the refresh pass refuses to create.
|
|
47
|
+
if (entry.layer === 'asset') {
|
|
48
|
+
throw new Error('asset entries are removed with memory_asset_forget, not memory_forget (id ' + id + ')')
|
|
49
|
+
}
|
|
43
50
|
const scope = entry.file.startsWith('global/') ? 'global' : entry.file.split('/')[1]
|
|
44
51
|
const hash = suppressionHash(scope, entry.content)
|
|
45
52
|
appendTombstone(store.root, { hash, scope, id, createdAt: new Date().toISOString(), reason: 'user-forget' })
|
package/src/store.js
CHANGED
|
@@ -7,7 +7,7 @@ import { GLOBAL_LAYERED, LAYER_DIRS, LAYERED } from './entry.js'
|
|
|
7
7
|
import { sanitizeKey, deriveWorkspaceKey } from './workspace-key.js'
|
|
8
8
|
import { workingPreamble } from './working.js'
|
|
9
9
|
|
|
10
|
-
export const LAYER_FILES = ['INDEX.md', 'semantic.md', 'episodic.md', 'procedural.md', 'working.md', 'learnings.md', 'junk.md', 'codebase.md', 'history.md', 'decisions.md', 'state.md']
|
|
10
|
+
export const LAYER_FILES = ['INDEX.md', 'semantic.md', 'episodic.md', 'procedural.md', 'working.md', 'learnings.md', 'junk.md', 'codebase.md', 'history.md', 'decisions.md', 'assets.md', 'state.md']
|
|
11
11
|
|
|
12
12
|
/** Working memory is the current-state head of ONE repo/workspace, never of the
|
|
13
13
|
* whole store: a global working.md would mix unrelated repositories together. */
|
package/src/system-doc.js
CHANGED
|
@@ -14,7 +14,7 @@ import { fileURLToPath } from 'node:url'
|
|
|
14
14
|
import { LAYER_CODES, LAYER_DIRS, LAYERED, VOLATILITY_DAYS, WORKSPACE_ONLY_LAYERS } from './entry.js'
|
|
15
15
|
|
|
16
16
|
/** Bumped whenever the described behaviour changes, so a stale on-disk copy is detectable. */
|
|
17
|
-
export const SYSTEM_DOC_VERSION =
|
|
17
|
+
export const SYSTEM_DOC_VERSION = 3
|
|
18
18
|
|
|
19
19
|
/** The template ships beside this module; resolve it relative to the module, not the cwd. */
|
|
20
20
|
export function templatePath() {
|
|
@@ -83,6 +83,7 @@ const LAYER_PURPOSE = {
|
|
|
83
83
|
codebase: 'What a module, file or subsystem of THIS repository does. Workspace only.',
|
|
84
84
|
history: 'How the repository changed: one entry per commit, grouped by day. Workspace only.',
|
|
85
85
|
decision: 'A settled choice and why it won: dependencies, conventions, architecture. Available in both scopes.',
|
|
86
|
+
asset: 'A stored file - a document, an image or a data file - documented with what it is and when to read it. The bytes live under assets/objects and are fetched with memory_asset_get; the contents are never indexed.',
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
/**
|