YujunZhou/tellonce / codex
tellonce
VerifiedUse to view, explain, correct, delete or reorganize the user's saved preferences, or to record one by hand when automatic recording is off; learning and rule injection otherwise run automatically through Codex hooks.
tellonce_codex/index.py
View on GitHubfrom __future__ import annotations
import json
from pathlib import Path
from .ledger import read_events, secure_mkdir, secure_write_text
from .memory import canonical_key, parse_memory, validate_memory_data
def build_active_index(state_root: Path) -> dict:
commits = {}
for event in read_events(state_root):
if event.get("event_type") == "promotion_committed":
payload = event.get("payload", {})
commits[payload.get("atomic_id")] = payload
active = []
active_dir = state_root / "memories" / "active"
if active_dir.is_dir():
for path in sorted(active_dir.glob("*.md")):
try:
parsed = parse_memory(path)
except Exception:
continue
data = parsed.data
commit = commits.get(data.get("atomic_id"))
if data.get("status") != "active" or validate_memory_data(data) or not commit:
continue
if commit.get("content_sha256") != data.get("content_sha256"):
continue
active.append(
{
"atomic_id": data["atomic_id"],
"canonical_key": canonical_key(data),
"path": str(path),
"type": data.get("type"),
"domain": data.get("domain"),
"scope": data.get("scope"),
"condition": data.get("condition"),
"rule_text": data.get("rule_text"),
"confidence": data.get("confidence"),
}
)
out = {"active": active}
index_dir = state_root / "index"
secure_mkdir(index_dir)
secure_write_text(
index_dir / "active_memories.json",
json.dumps(out, indent=2) + "\n",
atomic=True,
)
return out
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |