Skip to content

[codex] Add loop decision memory export#31

Merged
Svaag merged 2 commits into
mainfrom
codex/loop-decision-memory
Jul 2, 2026
Merged

[codex] Add loop decision memory export#31
Svaag merged 2 commits into
mainfrom
codex/loop-decision-memory

Conversation

@Svaag

@Svaag Svaag commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a validated LoopDecisionEnvelope import path for sanitized loop decision JSONL
  • export loop decision envelopes into JSONL and SQLite, including fingerprint/loop/action indexes for replay and cross-loop comparison
  • add a hyrule-knowledge loop-decisions query command over the exported SQLite memory
  • add hyrule-knowledge loop-arbiter-shadow, which computes agent_core.arbiter ownership decisions from stored envelopes without suppressing loop speech
  • regenerate exports with the new memory table/file

Validation

  • uv run ruff check src tests
  • uv run mypy --strict src
  • uv run pytest
  • uv run hyrule-knowledge export --check
  • uv run hyrule-knowledge loop-decisions --limit 1
  • uv run hyrule-knowledge loop-arbiter-shadow --fingerprint shared-fp --limit 5

@Svaag Svaag marked this pull request as ready for review July 2, 2026 22:56
@Svaag Svaag merged commit 48684c9 into main Jul 2, 2026
1 check passed
@Svaag Svaag deleted the codex/loop-decision-memory branch July 2, 2026 22:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant