From 0fdcce7bf85f7912ff5553393d82dc18b5c2ca41 Mon Sep 17 00:00:00 2001 From: Davide Cappellini Date: Sun, 22 Nov 2026 16:10:32 +0100 Subject: [PATCH] feat: sirmem v0.1.0 knowledge-graph memory CLI --- .gitea/workflows/release.yml | 52 +++ .gitignore | 4 + AGENTS.md | 30 ++ LICENSE | 21 + README.md | 24 ++ devbox.json | 24 ++ devbox.lock | 169 ++++++++ scripts/build.sh | 24 ++ scripts/zigcc | 12 + src/sirmem.nim | 38 ++ src/sirmem/core.nim | 796 +++++++++++++++++++++++++++++++++++ tests/test_all.nim | 328 +++++++++++++++ 12 files changed, 1522 insertions(+) create mode 100644 .gitea/workflows/release.yml create mode 100644 .gitignore create mode 100644 AGENTS.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 devbox.json create mode 100644 devbox.lock create mode 100755 scripts/build.sh create mode 100755 scripts/zigcc create mode 100644 src/sirmem.nim create mode 100644 src/sirmem/core.nim create mode 100644 tests/test_all.nim diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..6144f39 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,52 @@ +# Gitea Actions (GitHub-Actions-compatible). NOT YET RUN: untested on a real runner. +# Assumptions: +# - A runner labelled `ubuntu-latest` (adjust `runs-on`) with Docker/Node available for actions. +# - Nim and zig are installed via devbox (jetify-com/devbox-install-action); the nix store is fetched from cache.nixos.org. +# - Release upload goes through the Gitea REST API (curl) with the built-in token +# `${{ github.token }}` (Gitea maps it to GITEA_TOKEN); the token must be allowed to write releases. +# This avoids depending on third-party release actions that target GitHub only. +name: ci +on: + push: + branches: ["**"] + tags: ["v*"] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: jetify-com/devbox-install-action@v0.13.0 + with: + enable-cache: "false" + - run: devbox run test + + release: + if: startsWith(github.ref, 'refs/tags/v') + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: jetify-com/devbox-install-action@v0.13.0 + with: + enable-cache: "false" + - name: Build all targets + run: devbox run cross-all + - name: Checksums + run: cd dist && sha256sum sirmem-* > SHA256SUMS && cat SHA256SUMS + - name: Create release and upload assets + env: + TOKEN: ${{ github.token }} + SERVER: ${{ github.server_url }} + REPO: ${{ github.repository }} + TAG: ${{ github.ref_name }} + run: | + set -euo pipefail + api="$SERVER/api/v1/repos/$REPO" + id=$(curl -fsS -X POST "$api/releases" \ + -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \ + -d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\"}" | sed -n 's/.*"id":\([0-9]*\).*/\1/p' | head -1) + for f in dist/*; do + curl -fsS -X POST "$api/releases/$id/assets?name=$(basename "$f")" \ + -H "Authorization: token $TOKEN" -F "attachment=@$f" + done diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cc88f0d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +bin/ +dist/ +nimcache/ +*.tmp diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..83c2a86 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,30 @@ +# sirmem + +Nim CLI (stdlib only, no nimble deps) for a file-based knowledge-graph memory. + +## Tooling: devbox +All tooling comes from devbox (nim, zig, git). Use `devbox shell` or +`devbox run