urdyn-memory 0.1.0__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.
- urdyn/__init__.py +53 -0
- urdyn/_attempt.py +41 -0
- urdyn/_cli.py +743 -0
- urdyn/_conflict.py +61 -0
- urdyn/_context.py +514 -0
- urdyn/_errors.py +44 -0
- urdyn/_event.py +46 -0
- urdyn/_evidence.py +97 -0
- urdyn/_gitignore.py +27 -0
- urdyn/_guard.py +164 -0
- urdyn/_manifest.py +72 -0
- urdyn/_memory.py +142 -0
- urdyn/_preflight.py +517 -0
- urdyn/_relevance.py +72 -0
- urdyn/_retrieval.py +128 -0
- urdyn/_semantic.py +816 -0
- urdyn/_semantic_store.py +410 -0
- urdyn/_skill.py +70 -0
- urdyn/_source.py +384 -0
- urdyn/_store.py +2104 -0
- urdyn/_terminal.py +143 -0
- urdyn/_watcher.py +1060 -0
- urdyn/_workspace.py +2206 -0
- urdyn/py.typed +0 -0
- urdyn_memory-0.1.0.dist-info/METADATA +236 -0
- urdyn_memory-0.1.0.dist-info/RECORD +29 -0
- urdyn_memory-0.1.0.dist-info/WHEEL +4 -0
- urdyn_memory-0.1.0.dist-info/entry_points.txt +3 -0
- urdyn_memory-0.1.0.dist-info/licenses/LICENSE +201 -0
urdyn/__init__.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Urdyn Memory Engine.
|
|
2
|
+
|
|
3
|
+
A standalone, local-first, persistent, model-independent memory engine.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from ._errors import (
|
|
7
|
+
UrdynAlreadyInitializedError,
|
|
8
|
+
UrdynError,
|
|
9
|
+
UrdynManifestError,
|
|
10
|
+
UrdynNotFoundError,
|
|
11
|
+
UrdynSemanticUnavailableError,
|
|
12
|
+
UrdynSourceError,
|
|
13
|
+
UrdynStorageError,
|
|
14
|
+
)
|
|
15
|
+
from ._attempt import Attempt
|
|
16
|
+
from ._conflict import Conflict
|
|
17
|
+
from ._context import DEFAULT_CONTEXT_BUDGET, CompiledContext, ContextItem, ContextSection
|
|
18
|
+
from ._evidence import Evidence
|
|
19
|
+
from ._guard import GuardResult
|
|
20
|
+
from ._memory import Memory
|
|
21
|
+
from ._preflight import Preflight, PreflightConflict
|
|
22
|
+
from ._semantic_store import SemanticState
|
|
23
|
+
from ._skill import Skill
|
|
24
|
+
from ._source import SeedResult, Source, SourceObservation
|
|
25
|
+
from ._workspace import Urdyn, SemanticSetupResult
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"Urdyn",
|
|
29
|
+
"Memory",
|
|
30
|
+
"Evidence",
|
|
31
|
+
"Attempt",
|
|
32
|
+
"Preflight",
|
|
33
|
+
"PreflightConflict",
|
|
34
|
+
"CompiledContext",
|
|
35
|
+
"ContextSection",
|
|
36
|
+
"ContextItem",
|
|
37
|
+
"DEFAULT_CONTEXT_BUDGET",
|
|
38
|
+
"Skill",
|
|
39
|
+
"GuardResult",
|
|
40
|
+
"SemanticSetupResult",
|
|
41
|
+
"SemanticState",
|
|
42
|
+
"Conflict",
|
|
43
|
+
"Source",
|
|
44
|
+
"SourceObservation",
|
|
45
|
+
"SeedResult",
|
|
46
|
+
"UrdynError",
|
|
47
|
+
"UrdynNotFoundError",
|
|
48
|
+
"UrdynAlreadyInitializedError",
|
|
49
|
+
"UrdynManifestError",
|
|
50
|
+
"UrdynStorageError",
|
|
51
|
+
"UrdynSourceError",
|
|
52
|
+
"UrdynSemanticUnavailableError",
|
|
53
|
+
]
|
urdyn/_attempt.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""The canonical `Attempt` model.
|
|
2
|
+
|
|
3
|
+
An `Attempt` is an observable record of trying to do something: what task
|
|
4
|
+
was being worked on, what approach was taken, and what happened. It is not
|
|
5
|
+
knowledge or a conclusion (that is what `Memory`/`Lesson` are for) — it is
|
|
6
|
+
a fact about what was done, kept even when the outcome was failure.
|
|
7
|
+
|
|
8
|
+
Attempts are append-only: a failed attempt is never rewritten to look
|
|
9
|
+
successful. A later successful attempt at the same task is a separate,
|
|
10
|
+
independent `Attempt` record.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
15
|
+
import dataclasses
|
|
16
|
+
import datetime as dt
|
|
17
|
+
import re
|
|
18
|
+
|
|
19
|
+
ATTEMPT_ID_PATTERN = re.compile(r"[0-9a-f]{32}")
|
|
20
|
+
|
|
21
|
+
OUTCOME_SUCCEEDED = "succeeded"
|
|
22
|
+
OUTCOME_FAILED = "failed"
|
|
23
|
+
OUTCOME_PARTIAL = "partial"
|
|
24
|
+
VALID_OUTCOMES = frozenset({OUTCOME_SUCCEEDED, OUTCOME_FAILED, OUTCOME_PARTIAL})
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@dataclasses.dataclass(frozen=True, slots=True)
|
|
28
|
+
class Attempt:
|
|
29
|
+
"""A single recorded attempt at a task, persisted by Urdyn.
|
|
30
|
+
|
|
31
|
+
`evidence_ids` is the same provenance mechanism used by `Memory`: the
|
|
32
|
+
ids of `Evidence` supporting what happened (e.g. an error message or a
|
|
33
|
+
test result), not a copy of that evidence's content.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
attempt_id: str
|
|
37
|
+
task: str
|
|
38
|
+
approach: str
|
|
39
|
+
outcome: str
|
|
40
|
+
recorded_at: dt.datetime
|
|
41
|
+
evidence_ids: tuple[str, ...] = ()
|