[codex] Add loop decision memory export#31
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d4db007db
ℹ️ 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".
| params.append(loop) | ||
| where = f" WHERE {' AND '.join(clauses)}" if clauses else "" | ||
| params.append(max(1, min(limit, 500))) | ||
| conn = sqlite3.connect(db_path) |
There was a problem hiding this comment.
Open loop memory database read-only
When loop-decisions or loop-arbiter-shadow is run before exports/knowledge.sqlite exists, or with a config pointing at the wrong exports directory, sqlite3.connect(db_path) creates a brand-new empty SQLite file and then the SELECT fails with no such table. That leaves a bogus export DB on disk and breaks the read-only query behavior used elsewhere by KnowledgeStore; check existence and/or open the database with SQLite URI mode=ro instead.
Useful? React with 👍 / 👎.
Summary
LoopDecisionEnvelopeimport path for sanitized loop decision JSONLhyrule-knowledge loop-decisionsquery command over the exported SQLite memoryhyrule-knowledge loop-arbiter-shadow, which computesagent_core.arbiterownership decisions from stored envelopes without suppressing loop speechValidation
uv run ruff check src testsuv run mypy --strict srcuv run pytestuv run hyrule-knowledge export --checkuv run hyrule-knowledge loop-decisions --limit 1uv run hyrule-knowledge loop-arbiter-shadow --fingerprint shared-fp --limit 5