Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

ci: mirror the memory crate to its own read-only repository

leepokaie7a0b422b697
diff --git a/.github/workflows/memory-mirror.yml b/.github/workflows/memory-mirror.yml
new file mode 100644
index 00000000..c5990e53
--- /dev/null
+++ b/.github/workflows/memory-mirror.yml
@@ -0,0 +1,36 @@
+# Mirrors host/crates/memory to leepokai/codync-mem, read-only (docs/design/bot-memory.md#packaging). The split is
+# deterministic, so each push fast-forwards the mirror as long as nobody commits there.
+name: codync-mem mirror
+
+on:
+ push:
+ branches: [main]
+ paths: ["host/crates/memory/**"]
+
+concurrency:
+ group: memory-mirror
+ cancel-in-progress: false
+
+jobs:
+ mirror:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: Split the crate's history
+ run: git subtree split --prefix=host/crates/memory -b mirror
+ - name: Push it to the mirror
+ env:
+ # A deploy key with write access on leepokai/codync-mem.
+ KEY: ${{ secrets.CODYNC_MEM_DEPLOY_KEY }}
+ run: |
+ if [ -z "$KEY" ]; then
+ echo "::notice::CODYNC_MEM_DEPLOY_KEY isn't set, so the mirror isn't updated."
+ exit 0
+ fi
+ mkdir -p ~/.ssh
+ printf '%s\n' "$KEY" > ~/.ssh/mirror
+ chmod 600 ~/.ssh/mirror
+ GIT_SSH_COMMAND="ssh -i ~/.ssh/mirror -o StrictHostKeyChecking=accept-new" \
+ git push [email protected]:leepokai/codync-mem.git mirror:main
diff --git a/host/crates/memory/.github/workflows/pull-requests.yml b/host/crates/memory/.github/workflows/pull-requests.yml
new file mode 100644
index 00000000..98d1b5d1
--- /dev/null
+++ b/host/crates/memory/.github/workflows/pull-requests.yml
@@ -0,0 +1,22 @@
+# Runs in the codync-mem mirror, where this folder is the repository root (inert in Codync, like ci.yml). The
+# mirror is read-only: a pull request opened here gets a pointer to Codync's dev branch and is closed.
+name: Pull requests
+
+on:
+ pull_request_target:
+ types: [opened]
+
+permissions:
+ pull-requests: write
+
+jobs:
+ redirect:
+ runs-on: ubuntu-latest
+ steps:
+ # Nothing from the pull request is checked out or run.
+ - env:
+ GH_TOKEN: ${{ github.token }}
+ PR: ${{ github.event.pull_request.number }}
+ run: |
+ gh pr comment "$PR" --repo "$GITHUB_REPOSITORY" --body "Thanks! codync-mem is developed inside Codync and mirrored here read-only, so a pull request can't be merged here. Please open it against Codync's \`dev\` branch, in \`host/crates/memory\`: https://github.com/leepokai/Codync. Issues are welcome here."
+ gh pr close "$PR" --repo "$GITHUB_REPOSITORY"
diff --git a/host/crates/memory/README.md b/host/crates/memory/README.md
index ed1835a1..e6c6e513 100644
--- a/host/crates/memory/README.md
+++ b/host/crates/memory/README.md
@@ -31,6 +31,20 @@ codync_mem::schema::migrate(&conn)?;
The crate re-exports the `rusqlite` it builds against: use that one, because a build can link only one
`rusqlite` to `sqlite3`.
+## Modules
+
+- `store`: entries in two layers, the user's and a bot's writes, archive, forget (with tombstones), search.
+- `check`: the deterministic checks every write but the user's own passes.
+- `opening`: the memory a session opens with, within the caps, rendered for the instructions.
+- `files`: long-form notes, one Markdown file per topic. You keep the files; the crate keeps every version
+ (content, author, cause), checks a bot's change, diffs it, and renders the index an opening lists.
+- `dream`: between turns, a job for the user's own model (`prompt`), the rules that audit its answer (`audit`,
+ quotes of the user's own words only), and the logged, undoable write (`apply`), plus the lines it adds to notes.
+- `evidence`: what counts as the user's own words (not pasted, quoted or forwarded text).
+- `compaction`: when to summarize a conversation ahead of time, the loop guard, the keep-list and the handoff to
+ a fresh conversation.
+- `tokens`: the token estimate the caps count in (one per CJK character, one per four others).
+
## License
Apache-2.0