AbstractMemory 0.3.1__py3-none-any.whl → 0.3.2__py3-none-any.whl
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.
- abstractmemory/journal.py +14 -4
- abstractmemory/system.py +2 -1
- {abstractmemory-0.3.1.dist-info → abstractmemory-0.3.2.dist-info}/METADATA +2 -2
- {abstractmemory-0.3.1.dist-info → abstractmemory-0.3.2.dist-info}/RECORD +6 -6
- {abstractmemory-0.3.1.dist-info → abstractmemory-0.3.2.dist-info}/WHEEL +0 -0
- {abstractmemory-0.3.1.dist-info → abstractmemory-0.3.2.dist-info}/licenses/LICENSE +0 -0
abstractmemory/journal.py
CHANGED
|
@@ -221,12 +221,22 @@ class ScopeBinding:
|
|
|
221
221
|
return _jsonify(asdict(self))
|
|
222
222
|
|
|
223
223
|
|
|
224
|
+
#: The closure kinds a ClosureRecord accepts (``reinterpreted`` is additive, 0.3.2).
|
|
225
|
+
CLOSURE_KINDS = frozenset({"retract", "supersede", "reinterpreted"})
|
|
226
|
+
|
|
227
|
+
|
|
224
228
|
@dataclass(frozen=True)
|
|
225
229
|
class ClosureRecord:
|
|
226
|
-
"""Append-only belief-lifecycle record (backlog 0010): retract or
|
|
230
|
+
"""Append-only belief-lifecycle record (backlog 0010): retract, supersede or reinterpreted.
|
|
231
|
+
|
|
232
|
+
``reinterpreted`` (additive, 0.3.2): the writer no longer reads its source this way (AbstractNote ADR 0008: a
|
|
233
|
+
note understood again against an earlier foundation withdraws its previous reading). It is neither a
|
|
234
|
+
correction of the fact (``retract``) nor a later fact replacing it (``supersede``); like both it leaves
|
|
235
|
+
ranked retrieval. ``replacement_ids`` is optional (the new reading's assertions, when there are any).
|
|
236
|
+
"""
|
|
227
237
|
|
|
228
238
|
assertion_id: str
|
|
229
|
-
kind: str # retract | supersede
|
|
239
|
+
kind: str # retract | supersede | reinterpreted
|
|
230
240
|
reason: str
|
|
231
241
|
replacement_ids: Tuple[str, ...] = ()
|
|
232
242
|
observed_at: str = field(default_factory=utc_now_iso)
|
|
@@ -240,8 +250,8 @@ class ClosureRecord:
|
|
|
240
250
|
raise ValueError("ClosureRecord requires assertion_id")
|
|
241
251
|
object.__setattr__(self, "assertion_id", self.assertion_id.strip())
|
|
242
252
|
kind = str(self.kind or "").strip().lower()
|
|
243
|
-
if kind not in
|
|
244
|
-
raise ValueError("ClosureRecord.kind must be 'retract' or '
|
|
253
|
+
if kind not in CLOSURE_KINDS:
|
|
254
|
+
raise ValueError("ClosureRecord.kind must be 'retract', 'supersede' or 'reinterpreted'")
|
|
245
255
|
object.__setattr__(self, "kind", kind)
|
|
246
256
|
if not (isinstance(self.reason, str) and self.reason.strip()):
|
|
247
257
|
raise ValueError("ClosureRecord requires a non-empty reason")
|
abstractmemory/system.py
CHANGED
|
@@ -853,7 +853,8 @@ class MemorySystem(ValenceOps, AccessOps):
|
|
|
853
853
|
replacement_ids: Sequence[str] = (),
|
|
854
854
|
reason: str,
|
|
855
855
|
) -> List[str]:
|
|
856
|
-
"""Append one ClosureRecord per assertion (retract | supersede
|
|
856
|
+
"""Append one ClosureRecord per assertion (retract | supersede |
|
|
857
|
+
reinterpreted);
|
|
857
858
|
returns closure ids. Supersede requires replacement_ids; reason is
|
|
858
859
|
mandatory — validated by ClosureRecord BEFORE any append. A multi-
|
|
859
860
|
assertion supersede shares one replacement set. Accepts either id
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: AbstractMemory
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: AbstractMemory: temporal, provenance-aware semantic memory primitives for AbstractFramework.
|
|
5
5
|
Project-URL: AbstractFramework (monorepo), https://github.com/lpalbou/abstractframework
|
|
6
6
|
Author: Laurent-Philippe Albou
|
|
@@ -164,7 +164,7 @@ system.commit_selection(result.trace_id, [h.record_id for h in result.handles[:2
|
|
|
164
164
|
|
|
165
165
|
## Design principles
|
|
166
166
|
|
|
167
|
-
- **Append-only, no deletion**: updates are new assertions; belief revision is closure records (retract/supersede); forgetting is decay of retrieval strength plus closures and silencing — the substrate is lossless.
|
|
167
|
+
- **Append-only, no deletion**: updates are new assertions; belief revision is closure records (retract/supersede/reinterpreted); forgetting is decay of retrieval strength plus closures and silencing — the substrate is lossless.
|
|
168
168
|
- **Reads are pure**: reconstruction, inspection, replay, and the entity card deposit nothing. `commit_selection` is the only strengthening path.
|
|
169
169
|
- **One seq axis**: the journal assigns a monotonic `seq` to every record; any past state is reproducible by anchoring reads at `as_of`.
|
|
170
170
|
- **Works-or-loud**: degraded paths are labeled `#FALLBACK` in result warnings; invalid inputs raise actionable errors instead of silently meaning something else.
|
|
@@ -26,7 +26,7 @@ abstractmemory/folds.py,sha256=DPy8po7k0Hp8HdEwbXwsS376mCYiECPk1-Ct2l_CNJg,17004
|
|
|
26
26
|
abstractmemory/gradation.py,sha256=iee4w4hoEmGw72BN7XeoWru2-AF3viPsCrAY_8k3sVk,11850
|
|
27
27
|
abstractmemory/identity_review.py,sha256=6PajkCICR4JXiG53T2EeNQuJitMnefxLni2x0zI6Ai8,7434
|
|
28
28
|
abstractmemory/in_memory_store.py,sha256=hbJhfQonNYXI3ywLbuFU9XRNHuxG0fb3PXWrYeDVR58,13241
|
|
29
|
-
abstractmemory/journal.py,sha256=
|
|
29
|
+
abstractmemory/journal.py,sha256=Xe6vxGFfkuN-8wkWOX9vF_spr9q41jUu5I9Wo4Bv-Rg,24157
|
|
30
30
|
abstractmemory/journal_common.py,sha256=nB9jnUKFe-TTtc1YD5__kZTuqH56K5-A2oxaWNaIO34,9303
|
|
31
31
|
abstractmemory/journal_memory.py,sha256=fHMSSw8CLfKPMMaI6yIoyxjpN6h_reqPI6ILuptngU0,23611
|
|
32
32
|
abstractmemory/journal_sqlite.py,sha256=7Te1Lsh2d-Em9IMVUELcJa-flaqWRAQUBX994hAie20,28480
|
|
@@ -56,7 +56,7 @@ abstractmemory/spark.py,sha256=9Pmof_9TKHNkts-yMekOMV3Z-RrbQxEEwN56MK73iUE,8833
|
|
|
56
56
|
abstractmemory/spreading.py,sha256=22-UZCuLrQ9w-2YbsOrTAR5pQOgopSJv9qbYeWGn3uE,16031
|
|
57
57
|
abstractmemory/sqlite_store.py,sha256=Fz2ChaUfJ-OrCELpJrdgK9z2BS605Gao-stpKMv58_I,32527
|
|
58
58
|
abstractmemory/store.py,sha256=4PXG-4JsNaBojr39CkrmR6fKRT9McRHK-bKXqB0eHaY,4195
|
|
59
|
-
abstractmemory/system.py,sha256=
|
|
59
|
+
abstractmemory/system.py,sha256=jox7PPMmg9XV7TZXO9Wh1l_A78sYUmLRSLbV_AL1Bug,47384
|
|
60
60
|
abstractmemory/system_access.py,sha256=cwj6fTyyApzWtaZiQbI72gbh03650rc4SxlePr-MwLY,6696
|
|
61
61
|
abstractmemory/system_valence.py,sha256=JqX2W0GHkuzxkyl0QoJt7r24EEk8LIPAeN8eZNPUwqk,11627
|
|
62
62
|
abstractmemory/tend.py,sha256=ubOh-Bb01Ro0B3WCNvdfquO-qExoF06_uo8RKPAq4HM,30080
|
|
@@ -64,7 +64,7 @@ abstractmemory/text_tokens.py,sha256=kYWAdNEEnGi50zuCam3bA6VY91An0C_6HlDlxqwkun8
|
|
|
64
64
|
abstractmemory/vector_scoring.py,sha256=1NlC8DdoN0VFv5z6r2wyURvs86p6kbCJsKg4f__FEtw,2511
|
|
65
65
|
abstractmemory/world_model.py,sha256=aHlRyyXz8hQOTbjtXzJpUpFy01wjkShyyUviAs4ST0w,46714
|
|
66
66
|
abstractmemory/world_model_alias.py,sha256=A4_or9kmhgCu6AdxaZQEJQQsPi0RG9ZsePdBG9_JYnM,9436
|
|
67
|
-
abstractmemory-0.3.
|
|
68
|
-
abstractmemory-0.3.
|
|
69
|
-
abstractmemory-0.3.
|
|
70
|
-
abstractmemory-0.3.
|
|
67
|
+
abstractmemory-0.3.2.dist-info/METADATA,sha256=TY3BUpPbVdVcKkda9Uyc5eVvQfDzZChMUVCmdf2hpVY,7506
|
|
68
|
+
abstractmemory-0.3.2.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
69
|
+
abstractmemory-0.3.2.dist-info/licenses/LICENSE,sha256=7t9ARuV3s_QVhJahnkFBnX_E5GPLW8BE9geplO1CGko,1079
|
|
70
|
+
abstractmemory-0.3.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|