@try-works/dsh-memory 0.2.0 → 0.2.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/STATUS.md +6 -4
- package/package.json +1 -1
- package/src/forget.js +7 -0
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' })
|