[codex] publish cross-client DNA Memory - #7
Conversation
🔍 Tessl Skill Review
|
49d0cf8 to
2947e89
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2947e890b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| tail, size = _read_tail_bytes(path, max_bytes) | ||
| if path.suffix.lower() == ".json": | ||
| try: | ||
| return _messages_from_data(json.loads(tail.decode("utf-8")))[:max_messages] |
There was a problem hiding this comment.
Read the newest JSON session messages
When a complete .json session fits within max_bytes but contains more than max_messages entries, this slices the parsed list from the front, so automatic import examines the oldest messages and misses recent preferences/decisions at the end of the session. The JSONL and truncated-JSON paths both take the tail, so this should also keep the last max_messages after parsing the full JSON.
Useful? React with 👍 / 👎.
| root = self.config.knowledge_root / self.config.managed_memory_dir | ||
| targets = self._load_active_targets(supersedes, root) | ||
| memory_id = "mem_{}".format(uuid.uuid4().hex) | ||
| now = time.strftime("%Y-%m-%dT%H:%M:%S%z") |
There was a problem hiding this comment.
Store SQLite-parseable memory timestamps
Memories created through memory_remember are indexed with timestamps like 2026-07-14T12:00:00+0000, but the value metrics compare created_at with SQLite datetime(...); SQLite does not parse the +0000 offset form, so 7d/30d new_memories counts exclude freshly created memories. Use a SQLite-parseable format, such as a space-separated timestamp or an offset with a colon, before writing these fields.
Useful? React with 👍 / 👎.
What changed
dna-memory-loopWhy
The local implementation had advanced beyond the public repository, but its development history and examples included machine-specific paths, personal workflow Skills, and runtime data. This PR publishes the reusable system as one sanitized snapshot without exposing those intermediate commits.
Validation
python3 -m pytest -q(108 passed)python3 -m compileall -q dna.py dna scripts testspython3 scripts/check_public_safety.pygit diff --check origin/main...HEADmain