memory-cli 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.
- memory_cli/__init__.py +1 -0
- memory_cli/__main__.py +49 -0
- memory_cli/capture/__init__.py +7 -0
- memory_cli/capture/codex_rollout.py +164 -0
- memory_cli/capture/event_lines.py +66 -0
- memory_cli/capture/extract.py +458 -0
- memory_cli/capture/state.py +183 -0
- memory_cli/commands/__init__.py +21 -0
- memory_cli/commands/admin.py +363 -0
- memory_cli/commands/common.py +609 -0
- memory_cli/commands/curate.py +1189 -0
- memory_cli/commands/diagnostics.py +126 -0
- memory_cli/commands/edit.py +1282 -0
- memory_cli/commands/hooks.py +730 -0
- memory_cli/commands/import_recovery.py +45 -0
- memory_cli/commands/install.py +152 -0
- memory_cli/commands/integrate.py +480 -0
- memory_cli/commands/memory.py +2152 -0
- memory_cli/commands/read.py +1290 -0
- memory_cli/commands/sources.py +766 -0
- memory_cli/commands/split.py +97 -0
- memory_cli/commands/split_plan.py +196 -0
- memory_cli/commands/split_transaction.py +230 -0
- memory_cli/commands/synthesis.py +1122 -0
- memory_cli/core/__init__.py +16 -0
- memory_cli/core/auto_state.py +30 -0
- memory_cli/core/codex_pass.py +109 -0
- memory_cli/core/config.py +87 -0
- memory_cli/core/file_journal.py +163 -0
- memory_cli/core/headless.py +130 -0
- memory_cli/core/jobs.py +130 -0
- memory_cli/core/resources.py +57 -0
- memory_cli/core/runner.py +398 -0
- memory_cli/core/safe_io.py +155 -0
- memory_cli/core/store_git.py +407 -0
- memory_cli/core/yaml_load.py +14 -0
- memory_cli/corroborate/__init__.py +11 -0
- memory_cli/corroborate/cli.py +267 -0
- memory_cli/corroborate/decide.py +893 -0
- memory_cli/corroborate/digest.py +425 -0
- memory_cli/corroborate/fill.py +744 -0
- memory_cli/corroborate/job.py +15 -0
- memory_cli/corroborate/reword.py +446 -0
- memory_cli/corroborate/run.py +1142 -0
- memory_cli/corroborate/state.py +300 -0
- memory_cli/digest/__init__.py +4 -0
- memory_cli/digest/lessons.py +483 -0
- memory_cli/entry/__init__.py +12 -0
- memory_cli/entry/auto.py +660 -0
- memory_cli/entry/capture.py +1403 -0
- memory_cli/entry/corroborate.py +214 -0
- memory_cli/entry/integrate.py +684 -0
- memory_cli/entry/integrate_self_check.py +203 -0
- memory_cli/entry/research.py +9 -0
- memory_cli/entry/settle.py +614 -0
- memory_cli/entry/split_auto.py +460 -0
- memory_cli/entry/synthesize.py +22 -0
- memory_cli/integrate/__init__.py +9 -0
- memory_cli/integrate/answers.py +42 -0
- memory_cli/integrate/briefs/check-brief.md +16 -0
- memory_cli/integrate/briefs/place-brief.md +26 -0
- memory_cli/integrate/log.py +43 -0
- memory_cli/integrate/plan.py +125 -0
- memory_cli/integrate/rows.py +99 -0
- memory_cli/integrate/state.py +158 -0
- memory_cli/integrate/undo.py +143 -0
- memory_cli/mem.py +1180 -0
- memory_cli/memories/__init__.py +16 -0
- memory_cli/memories/fingerprints.py +51 -0
- memory_cli/memories/journal.py +93 -0
- memory_cli/memories/locations.py +282 -0
- memory_cli/memories/matching.py +451 -0
- memory_cli/memories/model.py +205 -0
- memory_cli/memories/parse.py +237 -0
- memory_cli/memories/records.py +266 -0
- memory_cli/memories/rules.py +291 -0
- memory_cli/memories/sightings.py +314 -0
- memory_cli/memories/terms.py +148 -0
- memory_cli/memories/write.py +358 -0
- memory_cli/notes/__init__.py +13 -0
- memory_cli/notes/check.py +806 -0
- memory_cli/notes/due.py +260 -0
- memory_cli/notes/fields.py +217 -0
- memory_cli/notes/index.py +230 -0
- memory_cli/notes/links.py +170 -0
- memory_cli/notes/note.py +222 -0
- memory_cli/notes/search.py +391 -0
- memory_cli/notes/split_candidates.py +72 -0
- memory_cli/research/__init__.py +5 -0
- memory_cli/research/checks.py +1065 -0
- memory_cli/research/pipeline.py +952 -0
- memory_cli/session/__init__.py +5 -0
- memory_cli/session/handoff.py +139 -0
- memory_cli/session/notices.py +111 -0
- memory_cli/settle/__init__.py +5 -0
- memory_cli/settle/state.py +111 -0
- memory_cli/settle/verdicts.py +693 -0
- memory_cli/split/briefs/checker-brief.md +5 -0
- memory_cli/split/briefs/editor-brief.md +20 -0
- memory_cli/syntheses/__init__.py +8 -0
- memory_cli/syntheses/document.py +400 -0
- memory_cli/syntheses/edit.py +581 -0
- memory_cli/syntheses/project.py +384 -0
- memory_cli/syntheses/split_conservation.py +50 -0
- memory_cli/syntheses/units.py +427 -0
- memory_cli/synthesize/__init__.py +9 -0
- memory_cli/synthesize/backfill.py +431 -0
- memory_cli/synthesize/briefs/backfill-brief.md +26 -0
- memory_cli/synthesize/briefs/checker-brief.md +13 -0
- memory_cli/synthesize/briefs/fixer-brief.md +19 -0
- memory_cli/synthesize/briefs/memory-brief.md +30 -0
- memory_cli/synthesize/briefs/settle-brief.md +32 -0
- memory_cli/synthesize/briefs/verdict-brief.md +50 -0
- memory_cli/synthesize/briefs/web-brief.md +33 -0
- memory_cli/synthesize/cli.py +311 -0
- memory_cli/synthesize/pipeline.py +764 -0
- memory_cli/synthesize/references.py +164 -0
- memory_cli/synthesize/run.py +150 -0
- memory_cli/synthesize/topics.py +528 -0
- memory_cli/templates/knowledge.md +23 -0
- memory_cli/templates/literature.md +25 -0
- memory_cli/templates/research.md +23 -0
- memory_cli/templates/synthesis.md +6 -0
- memory_cli-0.1.0.dist-info/METADATA +102 -0
- memory_cli-0.1.0.dist-info/RECORD +128 -0
- memory_cli-0.1.0.dist-info/WHEEL +4 -0
- memory_cli-0.1.0.dist-info/entry_points.txt +9 -0
- memory_cli-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
"""Reading a memory: a Markdown file with YAML frontmatter becomes a Memory, tolerating what a hand edit may leave."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import datetime
|
|
6
|
+
import logging
|
|
7
|
+
import re
|
|
8
|
+
from dataclasses import replace
|
|
9
|
+
from typing import TYPE_CHECKING
|
|
10
|
+
|
|
11
|
+
from memory_cli.core.yaml_load import safe_load
|
|
12
|
+
from memory_cli.memories.model import (
|
|
13
|
+
KINDS,
|
|
14
|
+
ORIGINS,
|
|
15
|
+
REACHES,
|
|
16
|
+
STATUSES,
|
|
17
|
+
TRIAGES,
|
|
18
|
+
WEIGHTS,
|
|
19
|
+
FieldTypeError,
|
|
20
|
+
Memory,
|
|
21
|
+
valid_short,
|
|
22
|
+
valid_topic,
|
|
23
|
+
valid_triage_reason,
|
|
24
|
+
)
|
|
25
|
+
from memory_cli.memories.sightings import (
|
|
26
|
+
_version,
|
|
27
|
+
case,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
if TYPE_CHECKING:
|
|
31
|
+
from collections.abc import Sequence
|
|
32
|
+
from pathlib import Path
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
logger = logging.getLogger(__name__)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _date(value, name: str) -> datetime.date | None:
|
|
39
|
+
if value is None:
|
|
40
|
+
return None
|
|
41
|
+
if isinstance(value, datetime.datetime):
|
|
42
|
+
raise FieldTypeError(f"{name} must be a date")
|
|
43
|
+
if isinstance(value, datetime.date):
|
|
44
|
+
return value
|
|
45
|
+
if isinstance(value, str):
|
|
46
|
+
return datetime.date.fromisoformat(value)
|
|
47
|
+
raise FieldTypeError(f"{name} must be an ISO date")
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _split(text: str) -> tuple[dict, str]:
|
|
51
|
+
m = re.match(r"---\r?\n(.*?)\r?\n---[ \t]*(?:\r?\n|$)", text, re.DOTALL)
|
|
52
|
+
if not m:
|
|
53
|
+
raise ValueError("no YAML frontmatter")
|
|
54
|
+
meta = safe_load(m.group(1))
|
|
55
|
+
if not isinstance(meta, dict):
|
|
56
|
+
raise FieldTypeError("frontmatter is not a mapping")
|
|
57
|
+
return meta, text[m.end() :]
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def _checked_kind(meta: dict) -> str:
|
|
61
|
+
kind = meta.get("kind")
|
|
62
|
+
if kind not in KINDS:
|
|
63
|
+
raise ValueError(f"unknown kind {kind!r}")
|
|
64
|
+
return kind
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _checked_claim(meta: dict) -> str:
|
|
68
|
+
claim = meta.get("claim")
|
|
69
|
+
if not isinstance(claim, str) or not claim.strip():
|
|
70
|
+
raise ValueError("claim is missing")
|
|
71
|
+
return claim
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _checked_observed(meta: dict) -> int:
|
|
75
|
+
observed = meta.get("observed", 1)
|
|
76
|
+
if isinstance(observed, bool) or not isinstance(observed, int) or observed < 1:
|
|
77
|
+
raise ValueError("observed must be an integer of at least 1")
|
|
78
|
+
return observed
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def _checked_status(meta: dict) -> str:
|
|
82
|
+
status = meta.get("status", "active")
|
|
83
|
+
if status not in STATUSES:
|
|
84
|
+
raise ValueError(f"unknown status {status!r}")
|
|
85
|
+
return status
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def _checked_context(meta: dict) -> str | None:
|
|
89
|
+
context = meta.get("context")
|
|
90
|
+
if context is not None and not isinstance(context, str):
|
|
91
|
+
raise ValueError("context must be a string")
|
|
92
|
+
return context
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def _checked_sources(meta: dict) -> list[str]:
|
|
96
|
+
sources = meta.get("sources") or []
|
|
97
|
+
if not isinstance(sources, list) or not all(isinstance(s, str) for s in sources):
|
|
98
|
+
raise ValueError("sources must be a list of strings")
|
|
99
|
+
return list(sources)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def _required_fields(meta: dict) -> dict:
|
|
103
|
+
"""The fields a memory needs, each checked in this order; the first bad one raises ValueError."""
|
|
104
|
+
return {
|
|
105
|
+
"kind": _checked_kind(meta),
|
|
106
|
+
"claim": _checked_claim(meta).strip(),
|
|
107
|
+
"observed": _checked_observed(meta),
|
|
108
|
+
"status": _checked_status(meta),
|
|
109
|
+
"context": _checked_context(meta),
|
|
110
|
+
"sources": _checked_sources(meta),
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
# a bad value reads as absent: only curation reads these dates, and one must not hide the memory
|
|
115
|
+
_LENIENT_DATES = (
|
|
116
|
+
"last_observed",
|
|
117
|
+
"refuted",
|
|
118
|
+
"reviewed",
|
|
119
|
+
"reworded",
|
|
120
|
+
"reword_failed",
|
|
121
|
+
"owner_confirmed",
|
|
122
|
+
"released",
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def _lenient_date(meta: dict, key: str) -> datetime.date | None:
|
|
127
|
+
try:
|
|
128
|
+
return _date(meta.get(key), key)
|
|
129
|
+
except ValueError:
|
|
130
|
+
return None
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
_PROMOTE_NO = ("no", False) # a tuple, not a set: a YAML list or mapping is unhashable
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def _promote_of(meta: dict) -> str | None:
|
|
137
|
+
value = meta.get("promote") # YAML reads a bare no as False
|
|
138
|
+
return "no" if value in _PROMOTE_NO else "done" if value == "done" else None
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def _load_of(meta: dict) -> str | None:
|
|
142
|
+
value = meta.get("load") # YAML reads a bare no as False; 0 is not no
|
|
143
|
+
return "index" if value == "index" else "no" if value == "no" or value is False else None
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def _choice(meta: dict, key: str, allowed: Sequence[str]) -> str | None:
|
|
147
|
+
value = meta.get(key)
|
|
148
|
+
return value if value in allowed else None
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def _text_fields(meta: dict) -> dict:
|
|
152
|
+
"""The optional text fields; a bad value reads as absent."""
|
|
153
|
+
superseded_by = meta.get("superseded_by")
|
|
154
|
+
general = meta.get("general")
|
|
155
|
+
triage = _choice(meta, "triage", TRIAGES)
|
|
156
|
+
reason = meta.get("triage_reason")
|
|
157
|
+
return {
|
|
158
|
+
"superseded_by": str(superseded_by) if superseded_by else None,
|
|
159
|
+
"general": general if isinstance(general, str) and general.strip() else None,
|
|
160
|
+
"short": meta.get("short") if valid_short(meta.get("short")) else None,
|
|
161
|
+
"short_by": "model" if meta.get("short_by") == "model" else None,
|
|
162
|
+
"triage": triage,
|
|
163
|
+
"triage_reason": reason if triage == "pending" and valid_triage_reason(reason) else None,
|
|
164
|
+
"topic": meta.get("topic") if valid_topic(meta.get("topic")) else None,
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def _list_fields(meta: dict) -> dict:
|
|
169
|
+
"""The optional list fields; a bad value reads as absent."""
|
|
170
|
+
distinct = meta.get("distinct_from")
|
|
171
|
+
raw_log = meta.get("log")
|
|
172
|
+
raw_versions = meta.get("versions")
|
|
173
|
+
return {
|
|
174
|
+
"distinct_from": [str(h) for h in distinct] if isinstance(distinct, list) else [],
|
|
175
|
+
"log": [e for e in raw_log if isinstance(e, str) and case(e)]
|
|
176
|
+
if isinstance(raw_log, list)
|
|
177
|
+
else [],
|
|
178
|
+
"versions": sorted((e for e in raw_versions if _version(e)), key=lambda e: e[:10])
|
|
179
|
+
if isinstance(raw_versions, list)
|
|
180
|
+
else [],
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def _optional_fields(meta: dict) -> dict:
|
|
185
|
+
return {
|
|
186
|
+
**{key: _lenient_date(meta, key) for key in _LENIENT_DATES},
|
|
187
|
+
**_text_fields(meta),
|
|
188
|
+
**_list_fields(meta),
|
|
189
|
+
"promote": _promote_of(meta),
|
|
190
|
+
"load": _load_of(meta),
|
|
191
|
+
"origin": _choice(meta, "origin", ORIGINS),
|
|
192
|
+
"reach": _choice(meta, "reach", REACHES),
|
|
193
|
+
"weight": _choice(meta, "weight", WEIGHTS),
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def _parse_text(base: Memory, text: str) -> Memory:
|
|
198
|
+
meta, body = _split(text)
|
|
199
|
+
required = _required_fields(meta)
|
|
200
|
+
optional = _optional_fields(meta)
|
|
201
|
+
return replace(
|
|
202
|
+
base,
|
|
203
|
+
**required,
|
|
204
|
+
**optional,
|
|
205
|
+
created=_date(meta.get("created"), "created"),
|
|
206
|
+
valid_until=_date(meta.get("valid_until"), "valid_until"),
|
|
207
|
+
body=body,
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def _parse(path: Path, scope: str) -> Memory:
|
|
212
|
+
base = Memory(scope, path, path.stem, "lesson", "", None, 1, "active", None, None, [], "", None)
|
|
213
|
+
try:
|
|
214
|
+
return _parse_text(base, path.read_text(encoding="utf-8"))
|
|
215
|
+
except Exception as e: # one broken file must not break the rest
|
|
216
|
+
logger.debug("cannot parse %s", path, exc_info=True)
|
|
217
|
+
name = (
|
|
218
|
+
"ValueError" if isinstance(e, FieldTypeError) else type(e).__name__
|
|
219
|
+
) # the error text predates the subclass
|
|
220
|
+
return replace(base, error=f"{name}: {e}".splitlines()[0])
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def load_memories(folder: Path | None, scope: str) -> list[Memory]:
|
|
224
|
+
try:
|
|
225
|
+
if folder is None or not folder.is_dir():
|
|
226
|
+
return []
|
|
227
|
+
if (
|
|
228
|
+
scope == "project" and folder.is_symlink()
|
|
229
|
+
): # a cloned repository's planted link; global folders may be synced links
|
|
230
|
+
return []
|
|
231
|
+
return [
|
|
232
|
+
_parse(p, scope)
|
|
233
|
+
for p in sorted(folder.glob("*.md"), key=lambda p: p.stem)
|
|
234
|
+
if p.is_file() and not (scope == "project" and p.is_symlink())
|
|
235
|
+
]
|
|
236
|
+
except OSError:
|
|
237
|
+
return []
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
"""The records facade: re-exports the names importers reach as `records.<name>`; the code lives in the sibling modules.
|
|
2
|
+
|
|
3
|
+
Holds imports and `__all__` only. Store modules import the defining module, never this one (test_import_graph).
|
|
4
|
+
Names that are not the store's own (`safe_load`, `datetime`, `replace`, `Path`) are here because importers reach them through it.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import datetime
|
|
10
|
+
from dataclasses import replace
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
from memory_cli.core.yaml_load import safe_load
|
|
14
|
+
from memory_cli.memories.journal import (
|
|
15
|
+
CURATION_LOG,
|
|
16
|
+
Logged,
|
|
17
|
+
last_log_entry,
|
|
18
|
+
log_before,
|
|
19
|
+
restore,
|
|
20
|
+
)
|
|
21
|
+
from memory_cli.memories.locations import (
|
|
22
|
+
REGISTRY_FILE,
|
|
23
|
+
_main_worktree,
|
|
24
|
+
default_store,
|
|
25
|
+
ensure_excluded,
|
|
26
|
+
forget_project,
|
|
27
|
+
global_memories_root,
|
|
28
|
+
mark_repository,
|
|
29
|
+
memories_root,
|
|
30
|
+
project_dir,
|
|
31
|
+
project_key,
|
|
32
|
+
project_root,
|
|
33
|
+
read_registry,
|
|
34
|
+
register_project,
|
|
35
|
+
tracked_memories,
|
|
36
|
+
under_temp,
|
|
37
|
+
)
|
|
38
|
+
from memory_cli.memories.matching import (
|
|
39
|
+
MIN_TERMS,
|
|
40
|
+
OPPOSITES,
|
|
41
|
+
POSSIBLE,
|
|
42
|
+
STOPWORDS,
|
|
43
|
+
STRONG,
|
|
44
|
+
Budget,
|
|
45
|
+
MatchOptions,
|
|
46
|
+
PairSearch,
|
|
47
|
+
Related,
|
|
48
|
+
containment,
|
|
49
|
+
differing_words,
|
|
50
|
+
flagged_words,
|
|
51
|
+
match_memories,
|
|
52
|
+
pairs,
|
|
53
|
+
pairs_by,
|
|
54
|
+
refuted_pairs,
|
|
55
|
+
related_records,
|
|
56
|
+
similarity,
|
|
57
|
+
tokenize,
|
|
58
|
+
)
|
|
59
|
+
from memory_cli.memories.model import (
|
|
60
|
+
GLOBAL_DIR,
|
|
61
|
+
GLOBAL_MIN_PROJECTS,
|
|
62
|
+
KINDS,
|
|
63
|
+
ORIGINS,
|
|
64
|
+
OUTCOMES,
|
|
65
|
+
PROJECT_DIR,
|
|
66
|
+
PROJECT_KEY_LEN,
|
|
67
|
+
REACHES,
|
|
68
|
+
SESSION_PREFIX,
|
|
69
|
+
SHORT_DATE_LEN,
|
|
70
|
+
SHORT_LIMIT,
|
|
71
|
+
SIGHTINGS_NEEDED,
|
|
72
|
+
STATUSES,
|
|
73
|
+
STORE_MARKER,
|
|
74
|
+
TOPIC_LIMIT,
|
|
75
|
+
TRIAGE_REASON_LIMIT,
|
|
76
|
+
TRIAGES,
|
|
77
|
+
UNCONFIRMED_DAYS,
|
|
78
|
+
WEIGHTS,
|
|
79
|
+
FieldTypeError,
|
|
80
|
+
Memory,
|
|
81
|
+
is_live,
|
|
82
|
+
slug_of,
|
|
83
|
+
valid_short,
|
|
84
|
+
valid_topic,
|
|
85
|
+
valid_triage_reason,
|
|
86
|
+
)
|
|
87
|
+
from memory_cli.memories.parse import (
|
|
88
|
+
_parse,
|
|
89
|
+
load_memories,
|
|
90
|
+
logger,
|
|
91
|
+
)
|
|
92
|
+
from memory_cli.memories.sightings import (
|
|
93
|
+
FAILED_TO_LIST,
|
|
94
|
+
MAX_SESSION_ID,
|
|
95
|
+
Case,
|
|
96
|
+
Tally,
|
|
97
|
+
case,
|
|
98
|
+
case_entry,
|
|
99
|
+
cases,
|
|
100
|
+
counted,
|
|
101
|
+
got_worse,
|
|
102
|
+
has_case,
|
|
103
|
+
mark_words,
|
|
104
|
+
merged_log,
|
|
105
|
+
merged_versions,
|
|
106
|
+
normalized_sources,
|
|
107
|
+
projects,
|
|
108
|
+
quarantined,
|
|
109
|
+
reword_note,
|
|
110
|
+
session_key,
|
|
111
|
+
sessions,
|
|
112
|
+
sighting,
|
|
113
|
+
sighting_entry,
|
|
114
|
+
standing,
|
|
115
|
+
standing_changes,
|
|
116
|
+
tallies,
|
|
117
|
+
version_entry,
|
|
118
|
+
version_list,
|
|
119
|
+
)
|
|
120
|
+
from memory_cli.memories.terms import (
|
|
121
|
+
SECRET_PATTERNS,
|
|
122
|
+
TERM_KINDS,
|
|
123
|
+
TERMS_HEADER,
|
|
124
|
+
ForbiddenListError,
|
|
125
|
+
Term,
|
|
126
|
+
ensure_terms_file,
|
|
127
|
+
forbidden_file,
|
|
128
|
+
forbidden_line,
|
|
129
|
+
inside,
|
|
130
|
+
parse_term,
|
|
131
|
+
read_terms,
|
|
132
|
+
secret_in,
|
|
133
|
+
store_is_writable,
|
|
134
|
+
term_hits,
|
|
135
|
+
)
|
|
136
|
+
from memory_cli.memories.write import (
|
|
137
|
+
SightingOptions,
|
|
138
|
+
WriteOptions,
|
|
139
|
+
add_case,
|
|
140
|
+
add_sighting,
|
|
141
|
+
observe,
|
|
142
|
+
update,
|
|
143
|
+
write_memory,
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
__all__ = [
|
|
147
|
+
"CURATION_LOG",
|
|
148
|
+
"FAILED_TO_LIST",
|
|
149
|
+
"GLOBAL_DIR",
|
|
150
|
+
"GLOBAL_MIN_PROJECTS",
|
|
151
|
+
"KINDS",
|
|
152
|
+
"MAX_SESSION_ID",
|
|
153
|
+
"MIN_TERMS",
|
|
154
|
+
"OPPOSITES",
|
|
155
|
+
"ORIGINS",
|
|
156
|
+
"OUTCOMES",
|
|
157
|
+
"POSSIBLE",
|
|
158
|
+
"PROJECT_DIR",
|
|
159
|
+
"PROJECT_KEY_LEN",
|
|
160
|
+
"REACHES",
|
|
161
|
+
"REGISTRY_FILE",
|
|
162
|
+
"SECRET_PATTERNS",
|
|
163
|
+
"SESSION_PREFIX",
|
|
164
|
+
"SHORT_DATE_LEN",
|
|
165
|
+
"SHORT_LIMIT",
|
|
166
|
+
"SIGHTINGS_NEEDED",
|
|
167
|
+
"STATUSES",
|
|
168
|
+
"STOPWORDS",
|
|
169
|
+
"STORE_MARKER",
|
|
170
|
+
"STRONG",
|
|
171
|
+
"TERMS_HEADER",
|
|
172
|
+
"TERM_KINDS",
|
|
173
|
+
"TOPIC_LIMIT",
|
|
174
|
+
"TRIAGES",
|
|
175
|
+
"TRIAGE_REASON_LIMIT",
|
|
176
|
+
"UNCONFIRMED_DAYS",
|
|
177
|
+
"WEIGHTS",
|
|
178
|
+
"Budget",
|
|
179
|
+
"Case",
|
|
180
|
+
"FieldTypeError",
|
|
181
|
+
"ForbiddenListError",
|
|
182
|
+
"Logged",
|
|
183
|
+
"MatchOptions",
|
|
184
|
+
"Memory",
|
|
185
|
+
"PairSearch",
|
|
186
|
+
"Path",
|
|
187
|
+
"Related",
|
|
188
|
+
"SightingOptions",
|
|
189
|
+
"Tally",
|
|
190
|
+
"Term",
|
|
191
|
+
"WriteOptions",
|
|
192
|
+
"_main_worktree",
|
|
193
|
+
"_parse",
|
|
194
|
+
"add_case",
|
|
195
|
+
"add_sighting",
|
|
196
|
+
"case",
|
|
197
|
+
"case_entry",
|
|
198
|
+
"cases",
|
|
199
|
+
"containment",
|
|
200
|
+
"counted",
|
|
201
|
+
"datetime",
|
|
202
|
+
"default_store",
|
|
203
|
+
"differing_words",
|
|
204
|
+
"ensure_excluded",
|
|
205
|
+
"ensure_terms_file",
|
|
206
|
+
"flagged_words",
|
|
207
|
+
"forbidden_file",
|
|
208
|
+
"forbidden_line",
|
|
209
|
+
"forget_project",
|
|
210
|
+
"global_memories_root",
|
|
211
|
+
"got_worse",
|
|
212
|
+
"has_case",
|
|
213
|
+
"inside",
|
|
214
|
+
"is_live",
|
|
215
|
+
"last_log_entry",
|
|
216
|
+
"load_memories",
|
|
217
|
+
"log_before",
|
|
218
|
+
"logger",
|
|
219
|
+
"mark_repository",
|
|
220
|
+
"mark_words",
|
|
221
|
+
"match_memories",
|
|
222
|
+
"memories_root",
|
|
223
|
+
"merged_log",
|
|
224
|
+
"merged_versions",
|
|
225
|
+
"normalized_sources",
|
|
226
|
+
"observe",
|
|
227
|
+
"pairs",
|
|
228
|
+
"pairs_by",
|
|
229
|
+
"parse_term",
|
|
230
|
+
"project_dir",
|
|
231
|
+
"project_key",
|
|
232
|
+
"project_root",
|
|
233
|
+
"projects",
|
|
234
|
+
"quarantined",
|
|
235
|
+
"read_registry",
|
|
236
|
+
"read_terms",
|
|
237
|
+
"refuted_pairs",
|
|
238
|
+
"register_project",
|
|
239
|
+
"related_records",
|
|
240
|
+
"replace",
|
|
241
|
+
"restore",
|
|
242
|
+
"reword_note",
|
|
243
|
+
"safe_load",
|
|
244
|
+
"secret_in",
|
|
245
|
+
"session_key",
|
|
246
|
+
"sessions",
|
|
247
|
+
"sighting",
|
|
248
|
+
"sighting_entry",
|
|
249
|
+
"similarity",
|
|
250
|
+
"slug_of",
|
|
251
|
+
"standing",
|
|
252
|
+
"standing_changes",
|
|
253
|
+
"store_is_writable",
|
|
254
|
+
"tallies",
|
|
255
|
+
"term_hits",
|
|
256
|
+
"tokenize",
|
|
257
|
+
"tracked_memories",
|
|
258
|
+
"under_temp",
|
|
259
|
+
"update",
|
|
260
|
+
"valid_short",
|
|
261
|
+
"valid_topic",
|
|
262
|
+
"valid_triage_reason",
|
|
263
|
+
"version_entry",
|
|
264
|
+
"version_list",
|
|
265
|
+
"write_memory",
|
|
266
|
+
]
|