Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
8907545
feat: decouple project.toml config version from DB schema version
RodCor Jun 3, 2026
ae5ed82
feat: schema migration runner (forward-only, per-migration txn)
RodCor Jun 3, 2026
1cf75b3
feat: fold legacy patches into v1->v2 migration; bump SCHEMA_VERSION=2
RodCor Jun 3, 2026
9c57555
feat: backup brain.db before migrating + keep-3 retention
RodCor Jun 3, 2026
cfe3603
feat: graceful read-only opens for un-migrated brains (SchemaNeedsMig…
RodCor Jun 3, 2026
865289a
feat: event-schema upcast seam in the projector (identity for v1.0)
RodCor Jun 3, 2026
3f9fc1a
feat: surface schema migration (status + tracing); skip empty-brain b…
RodCor Jun 3, 2026
cd07120
test: lock install config-merge safety + add Windows to PR CI
RodCor Jun 3, 2026
bd129b5
feat: brain analytics module + context.injected token telemetry
RodCor Jun 3, 2026
38b3758
feat: `brain insights` CLI + kimetsu_brain_insights MCP tool
RodCor Jun 3, 2026
967567d
feat: context.served event → retrieval hit-rate + skip-rate analytics
RodCor Jun 3, 2026
8ea6290
feat: register sqlite-vec extension (embeddings feature) + linking proof
RodCor Jun 3, 2026
aac109e
feat: sqlite-vec ANN candidate generation over memory embeddings
RodCor Jun 3, 2026
9d9f3ea
feat: semantic MMR + relevance floor + config-driven capsule caps
RodCor Jun 3, 2026
04699c3
feat: implement config edit + run abort; doctor --selftest quickstart
RodCor Jun 3, 2026
44d3fa0
chore: clear clippy backlog and enforce -D warnings (both flavors)
RodCor Jun 3, 2026
1b83b60
feat: per-run recall ledger (E/F substrate)
RodCor Jun 3, 2026
3e41a5c
feat: cross-stage capsule dedup via the run recall ledger (F1)
RodCor Jun 3, 2026
bd92c51
feat: proactive failure anticipation before first implementation atte…
RodCor Jun 3, 2026
88e6ebb
feat: task-kind classification + adaptive retrieval routing (E3)
RodCor Jun 3, 2026
0d3be52
feat: lazy capsule expansion — tiered injection + expand_capsule tool…
RodCor Jun 3, 2026
9a56349
fix: deterministic retrieval tiebreak on stable handle, not random id
RodCor Jun 3, 2026
133e74f
feat: adaptive sublinear brain budget with per-run cap + overhead rat…
RodCor Jun 3, 2026
9b679e9
release: v1.0.0
RodCor Jun 3, 2026
058d393
feat: make brain.db events table the durable log; rebuild in place (W…
RodCor Jun 4, 2026
adff737
feat: rebuild from the events table; --from-traces legacy import (W1.3)
RodCor Jun 4, 2026
68d15fd
feat: memory writes no longer create runs/ dirs (W1.4)
RodCor Jun 4, 2026
65ac352
feat: init_project creates .kimetsu/ not runs/ (W1.5)
RodCor Jun 4, 2026
3bd63eb
test: agent-run events survive rebuild from the events table (W1.6)
RodCor Jun 4, 2026
5a2e701
feat: persistent off-switches for embeddings, ambient, user-brain (W3)
RodCor Jun 4, 2026
b0d856b
fix: honor [embedder] enabled=false at runtime (W3.1 wiring)
RodCor Jun 4, 2026
5166b57
feat: relocate proactive/chat/bench to ~/.kimetsu/cache (W2)
RodCor Jun 4, 2026
5d97b1c
docs: update README + HOW-KIMETSU-WORKS for v1.0.0
RodCor Jun 4, 2026
e964522
docs: fix stale proactive-state path comment (now in user cache)
RodCor Jun 4, 2026
df315f7
feat: plugin_uninstall — surgical removal of Kimetsu host wiring
RodCor Jun 4, 2026
d32e629
feat: uninstall removes plugin wiring (3-tier) so hosts don't break
RodCor Jun 4, 2026
43f3aec
fix: handle a locked kimetsu binary on uninstall/update (Windows)
RodCor Jun 4, 2026
4a0a754
feat: kimetsu ps / stop / restart process control (QoL)
RodCor Jun 4, 2026
6ea7266
fix: GlobalUser add_memory works from non-project dirs (P0 regression)
RodCor Jun 4, 2026
bb7fa33
fix: GlobalUser memory writes no longer require a loadable project
RodCor Jun 4, 2026
00a8a5b
feat: update offers to stop locking kimetsu processes (QoL)
RodCor Jun 4, 2026
a78ce3f
feat: doctor detects stale running MCP servers (version skew)
RodCor Jun 4, 2026
9c32e72
feat: config set / config get (QoL)
RodCor Jun 4, 2026
e119a4e
feat: brain export / import — portable memories as JSON (QoL)
RodCor Jun 4, 2026
542b699
feat: memory edit / memory undo (QoL)
RodCor Jun 4, 2026
cb6c675
feat: runs prune — clean up old agent run dirs (QoL)
RodCor Jun 4, 2026
90b8ad5
feat: brain compact — VACUUM + optional purge/trim (QoL)
RodCor Jun 4, 2026
1528b05
docs: command-menu descriptions + fold v1.0 QoL into CHANGELOG/README
RodCor Jun 4, 2026
5dedbe9
docs: tighten chat help to a one-line menu entry
RodCor Jun 4, 2026
ec3d132
fix: concurrency-friendly project writer lock (multi-session safe)
RodCor Jun 4, 2026
5078651
fix: unsafe extern blocks in lock.rs for edition 2024 (Linux build)
RodCor Jun 4, 2026
7b420d4
feat: plugin status + standalone plugin uninstall (QoL)
RodCor Jun 4, 2026
a3b3af2
feat: --version shows build flavor + plugin install self-check (QoL)
RodCor Jun 4, 2026
1677227
feat: kimetsu setup — one-command onboarding (QoL)
RodCor Jun 4, 2026
9b280d4
feat: runs auto-GC on run creation + brain backup (QoL)
RodCor Jun 4, 2026
c24b4d2
feat: AWS Bedrock provider for the agent + distiller
RodCor Jun 4, 2026
6371da3
feat: Pi (earendil-works) host integration
RodCor Jun 4, 2026
89edd92
feat: OpenClaw host integration
RodCor Jun 4, 2026
216778f
docs: terser top-level menu descriptions (QoL)
RodCor Jun 4, 2026
01099d2
docs: fold Bedrock + Pi/OpenClaw + lifecycle into CHANGELOG/README
RodCor Jun 4, 2026
109abad
feat: make Pi + OpenClaw opt-in Cargo features (default off)
RodCor Jun 4, 2026
25caf73
polish: clearer, friendlier onboarding UX
RodCor Jun 5, 2026
6102579
polish: tighten doctor MCP-check label (no self-repetition)
RodCor Jun 5, 2026
a967f38
feat: clearer next-steps after `kimetsu update`
RodCor Jun 5, 2026
82ddc8e
chore: stop tracking local .codex-security-scans/ artifacts
RodCor Jun 5, 2026
c75ba91
build: bundle Pi + OpenClaw into all prebuilt + npm binaries
RodCor Jun 5, 2026
fb90e24
refactor: public allowlist-filterable MCP dispatch + no-git brain ent…
RodCor Jun 5, 2026
dd7b3b3
feat: kimetsu-remote — server-hosted brain over HTTP MCP (v1)
RodCor Jun 5, 2026
346ad92
feat: kimetsu plugin install --remote (R2 client wiring + packaging)
RodCor Jun 5, 2026
f9ec516
docs: label Kimetsu Remote as beta + separate install
RodCor Jun 5, 2026
af7d97d
feat: kimetsu-remote operational hardening (R3a — rate limit, metrics…
RodCor Jun 5, 2026
c9cc561
feat: kimetsu-remote shared/org brain (R3b)
RodCor Jun 5, 2026
a722eb3
feat: kimetsu-remote server-side ingest (R3c)
RodCor Jun 5, 2026
a25f1e0
build: ship kimetsu-remote as a separate npm package + archive
RodCor Jun 5, 2026
5176962
feat(npm): one-command persistent semantic build (kimetsu npm-flavor)
RodCor Jun 5, 2026
a513dcb
docs: consolidate README + HOW-KIMETSU-WORKS for v1.0.0
RodCor Jun 5, 2026
47578c3
feat: fixed from audit
RodCor Jun 5, 2026
c6e1833
fix: silence unix-only dead-code warning on ProcessLiveness::Indeterm…
RodCor Jun 5, 2026
a6345c3
perf: brain Tier-1 — conflict-detection via ANN, BLOB vec-index, pragmas
RodCor Jun 6, 2026
f5c683f
perf: brain Tier-2 — batch embedding for bulk seed + reindex
RodCor Jun 6, 2026
bd72675
perf: reindex — honor --limit exactly when batching (faithful candida…
RodCor Jun 6, 2026
33463bb
docs: Tier-3 HNSW (usearch) design spec
RodCor Jun 6, 2026
670a7fb
docs: Tier-3 HNSW (usearch) implementation plan
RodCor Jun 6, 2026
ac1da62
feat(brain): Tier-3 ann.rs — usearch HNSW index module (T3a)
RodCor Jun 6, 2026
95df72e
feat(brain): retrieval ANN candidates via usearch (was vec0 MATCH)
RodCor Jun 6, 2026
2c63067
feat(brain): conflict-detection pool via usearch (was vec0 MATCH)
RodCor Jun 6, 2026
33324a1
feat(brain): embed_and_persist maintains usearch index (was vec0 upsert)
RodCor Jun 6, 2026
2dd0aef
feat(brain): remove from usearch index on invalidation (projector + c…
RodCor Jun 6, 2026
c97d4d2
test(brain): ANN retrieval round-trip + invalidate-drops integration
RodCor Jun 6, 2026
7fecfa1
chore(brain): allow(dead_code) on vec0 fns pending T3c removal
RodCor Jun 6, 2026
5356326
chore(brain): drop stale dead_code allows on now-wired ann fns
RodCor Jun 6, 2026
a72da61
feat(brain): reindex invalidates the ANN sidecar (model change -> reb…
RodCor Jun 6, 2026
095fd66
feat(brain): persist ANN indexes on host shutdown (save_all)
RodCor Jun 6, 2026
e9e01f5
refactor(brain): drop sqlite-vec + vec0; usearch fully supersedes it
RodCor Jun 6, 2026
dc2fa74
perf(brain): parallel ANN index build + reconcile cached index on new…
RodrigoCordoba Jun 7, 2026
ecbfa23
perf(brain): persist ANN index after build + per-key build lock + sta…
RodrigoCordoba Jun 7, 2026
4ce1763
perf(brain): f16 ANN index quantization (configurable) + streaming re…
RodrigoCordoba Jun 8, 2026
663a1c7
docs: usearch HNSW + scale-to-1M in CHANGELOG/README (was sqlite-vec)
RodrigoCordoba Jun 8, 2026
246db12
chore: ignore docs/superpowers/ (untrack the Tier-3 spec + plan)
RodrigoCordoba Jun 8, 2026
33e1965
fix: review hardening — backups, remote auth/init, npm checksum
RodrigoCordoba Jun 8, 2026
fd5688f
fix(brain): ANN reconcile past malformed rows + de-flake parallel-bui…
RodrigoCordoba Jun 8, 2026
ac80021
fix: conflict
RodrigoCordoba Jun 8, 2026
4279ed3
fix(stop-hook): emit valid JSON instead of bare text
RodrigoCordoba Jun 9, 2026
ba422dd
feat(retrieval): IDF-weighted lexical relevance floor for the FTS hook
RodrigoCordoba Jun 9, 2026
e17767f
feat(config): add [embedder] daemon + warm_on_start toggles
RodrigoCordoba Jun 9, 2026
be87c3f
feat(brain): read-only retrieval with an injected embedder
RodrigoCordoba Jun 9, 2026
255f298
feat(embed-daemon): newline-JSON wire protocol
RodrigoCordoba Jun 9, 2026
b5344e2
feat(embed-daemon): interprocess transport + single-instance listen
RodrigoCordoba Jun 9, 2026
bf2dd00
feat(embed-daemon): server with worker pool + injected-embedder retri…
RodrigoCordoba Jun 9, 2026
845fb14
feat(embed-daemon): timeout-bounded client + detached spawn
RodrigoCordoba Jun 9, 2026
bdd8ded
feat(cli): embed-daemon / warm / daemon status|stop subcommands
RodrigoCordoba Jun 9, 2026
d63c689
feat(hook): route context-hook through the warm daemon with FTS fallback
RodrigoCordoba Jun 9, 2026
da41c02
feat(install): warm the embedder daemon at harness startup
RodrigoCordoba Jun 9, 2026
7fdeccb
docs: warm embedder daemon + warm-at-startup
RodrigoCordoba Jun 9, 2026
fd870f2
fix(embed-daemon): honor warm_on_start, reliable stop, tighter fallback
RodrigoCordoba Jun 9, 2026
a58313d
chore: lock interprocess dep for embed daemon
RodrigoCordoba Jun 9, 2026
6a23f6e
feat(brain): Reranker trait, fastembed cross-encoder backend, rerank_…
RodrigoCordoba Jun 9, 2026
c93bad6
feat(embed-daemon): cross-encoder rerank stage + 300ms hook budget
RodrigoCordoba Jun 9, 2026
815ad42
feat(retrieval): semantic relevance floor on by default (0.35) and ac…
RodrigoCordoba Jun 9, 2026
6d93cbe
feat(eval): retrieval quality harness — recall@k/MRR across fts|seman…
RodrigoCordoba Jun 9, 2026
763dbcf
docs: reranking stage, semantic floor default, 300ms budget, eval har…
RodrigoCordoba Jun 9, 2026
9a201b8
fix(embed-daemon): spawn hygiene + evidence-driven rerank defaults
RodrigoCordoba Jun 9, 2026
362e9db
feat(eval): user-defined ONNX rerankers + per-reranker benchmark mode
RodrigoCordoba Jun 9, 2026
f64e787
docs(config): recommend jina-tiny reranker per benchmark; keep off de…
RodrigoCordoba Jun 9, 2026
2f81167
feat(retrieval): rerank on by default — jina-tiny + pool 6, all measured
RodrigoCordoba Jun 10, 2026
082f09b
fix(retrieval): query-side stemming + lexical floor on the proactive …
RodrigoCordoba Jun 10, 2026
eea79bd
feat(mcp): config-driven write-tools gate, enabled by default locally
RodrigoCordoba Jun 10, 2026
f1de29b
feat(bench): retrieval benchmark from real memories — quality/latency…
RodrigoCordoba Jun 10, 2026
433f958
feat(retrieval): default jina-v2-base-code + tinybert per 100-case be…
RodrigoCordoba Jun 10, 2026
3402ac6
feat(bench): --remote mode — HTTP MCP retrieval benchmark for kimetsu…
RodrigoCordoba Jun 10, 2026
4c62b41
fix(retrieval): model-aware AUTO semantic floor — remote bench caught…
RodrigoCordoba Jun 10, 2026
918c986
docs: fix stale sqlite-vec mentions — the ANN is usearch HNSW
RodrigoCordoba Jun 10, 2026
3726297
feat(remote): cross-encoder rerank stage — operator --reranker, defau…
RodrigoCordoba Jun 10, 2026
37eb851
fix: pre-release audit — truthful numbers, rerank guard, bench child …
RodrigoCordoba Jun 10, 2026
ff3c8ef
chore: gitignore real-memory exports in the public repo
RodrigoCordoba Jun 10, 2026
d12b508
chore: satisfy CI gates — cargo fmt + lean all-targets clippy
RodrigoCordoba Jun 10, 2026
818e247
chore: allow Windows-only items on non-Windows clippy
RodrigoCordoba Jun 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Jobs (all required for a green PR):
# fmt — rustfmt check, no diffs allowed
# clippy — clippy with warnings denied (-D warnings)
# clippy — clippy hard gate: -D warnings on lean and embeddings flavors
# test — full workspace test suite
# audit — RUSTSEC advisory scan over the dependency tree
#
Expand Down Expand Up @@ -44,11 +44,8 @@ jobs:
clippy:
name: clippy
runs-on: ubuntu-latest
# Advisory for now: main carries a small pre-existing lint backlog.
# The job runs and surfaces warnings on every PR; once the backlog is
# cleared in a dedicated cleanup PR, drop `continue-on-error` and add
# `-D warnings` to make this a hard gate.
continue-on-error: true
# Hard gate on both the lean (no-default-features) and embeddings
# flavors. Any new warning fails the PR.
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -57,7 +54,8 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
shared-key: ci-clippy
- run: cargo clippy --workspace --all-targets
- run: cargo clippy --workspace --all-targets --no-default-features -- -D warnings
- run: cargo clippy --workspace --all-targets --features embeddings -- -D warnings

test:
name: test (${{ matrix.os }})
Expand All @@ -66,9 +64,9 @@ jobs:
fail-fast: false
matrix:
# Ubuntu is the primary gate; macOS guards the Apple-silicon
# build that ships in releases. Windows is exercised by the
# release workflow's build matrix.
os: [ubuntu-latest, macos-14]
# build that ships in releases. Windows now runs the full test
# suite here; the release workflow still does the build/smoke.
os: [ubuntu-latest, macos-14, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand Down
168 changes: 160 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
workflow_dispatch: {}

permissions:
contents: write # needed to upload release assets
contents: read

env:
CARGO_TERM_COLOR: always
Expand All @@ -42,16 +42,16 @@ jobs:
matrix:
include:
# Linux
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, flavor: lean, extra_features: "--no-default-features" }
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, flavor: embeddings, extra_features: "--features embeddings" }
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, flavor: lean, extra_features: "--no-default-features --features pi,openclaw" }
- { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, flavor: embeddings, extra_features: "--features embeddings,pi,openclaw" }
# macOS Intel
- { os: macos-15-intel, target: x86_64-apple-darwin, flavor: lean, extra_features: "--no-default-features" }
- { os: macos-15-intel, target: x86_64-apple-darwin, flavor: lean, extra_features: "--no-default-features --features pi,openclaw" }
# macOS Apple Silicon
- { os: macos-14, target: aarch64-apple-darwin, flavor: lean, extra_features: "--no-default-features" }
- { os: macos-14, target: aarch64-apple-darwin, flavor: embeddings, extra_features: "--features embeddings" }
- { os: macos-14, target: aarch64-apple-darwin, flavor: lean, extra_features: "--no-default-features --features pi,openclaw" }
- { os: macos-14, target: aarch64-apple-darwin, flavor: embeddings, extra_features: "--features embeddings,pi,openclaw" }
# Windows
- { os: windows-latest, target: x86_64-pc-windows-msvc, flavor: lean, extra_features: "--no-default-features" }
- { os: windows-latest, target: x86_64-pc-windows-msvc, flavor: embeddings, extra_features: "--features embeddings" }
- { os: windows-latest, target: x86_64-pc-windows-msvc, flavor: lean, extra_features: "--no-default-features --features pi,openclaw" }
- { os: windows-latest, target: x86_64-pc-windows-msvc, flavor: embeddings, extra_features: "--features embeddings,pi,openclaw" }
steps:
- uses: actions/checkout@v4

Expand All @@ -69,6 +69,11 @@ jobs:
run: |
cargo build --release --locked -p kimetsu-cli --target ${{ matrix.target }} ${{ matrix.extra_features }}

- name: build kimetsu-remote (server, embeddings archives only)
if: matrix.flavor == 'embeddings'
run: |
cargo build --release --locked -p kimetsu-remote --features embeddings,tls --target ${{ matrix.target }}

- name: smoke-test built binary (doctor --skip-mcp)
shell: bash
env:
Expand Down Expand Up @@ -107,6 +112,30 @@ jobs:
tar -czf "$NAME.tar.gz" "$NAME"
fi

- name: package kimetsu-remote archive (separate; embeddings targets only)
if: matrix.flavor == 'embeddings'
shell: bash
run: |
VERSION="${GITHUB_REF_NAME#v}"
NAME="kimetsu-remote-${VERSION}-${{ matrix.target }}"
mkdir -p "dist/$NAME"
if [ "${{ runner.os }}" = "Windows" ]; then
cp "target/${{ matrix.target }}/release/kimetsu-remote.exe" "dist/$NAME/"
else
cp "target/${{ matrix.target }}/release/kimetsu-remote" "dist/$NAME/"
fi
MIT_LICENSE="LICENSE-MIT"
APACHE_LICENSE="LICENSE-APACHE"
[ -f "$MIT_LICENSE" ] || MIT_LICENSE="docs/LICENSE-MIT"
[ -f "$APACHE_LICENSE" ] || APACHE_LICENSE="docs/LICENSE-APACHE"
cp "$MIT_LICENSE" "$APACHE_LICENSE" npm/kimetsu-remote/README.md "dist/$NAME/"
cd dist
if [ "${{ runner.os }}" = "Windows" ]; then
powershell -Command "Compress-Archive -Path $NAME -DestinationPath $NAME.zip"
else
tar -czf "$NAME.tar.gz" "$NAME"
fi

- name: upload artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -121,6 +150,10 @@ jobs:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write # needed to upload release assets
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -151,6 +184,26 @@ jobs:
echo "Generated from the kimetsu monorepo. See README.md for installation + usage." >> release-notes.md
fi

- name: generate checksums
shell: bash
run: |
set -euo pipefail
: > checksums.txt
while IFS= read -r file; do
hash="$(sha256sum "$file" | awk '{print $1}')"
name="$(basename "$file")"
printf '%s %s\n' "$hash" "$name" >> checksums.txt
done < <(find dist -type f \( -name '*.tar.gz' -o -name '*.zip' \) | sort)
cat checksums.txt

- name: attest release artifacts
uses: actions/attest-build-provenance@v2
with:
subject-path: |
dist/**/*.tar.gz
dist/**/*.zip
checksums.txt

- name: create release
uses: softprops/action-gh-release@v2
with:
Expand All @@ -160,6 +213,7 @@ jobs:
files: |
dist/**/*.tar.gz
dist/**/*.zip
checksums.txt
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -414,6 +468,104 @@ jobs:
( cd npm/kimetsu && npm publish --access public )
fi

- name: assemble + publish kimetsu-remote platform packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
set -euo pipefail
VERSION="${GITHUB_REF_NAME#v}"

# The server ships only where an embeddings build exists (ONNX prebuilts).
# npm-key target-triple os cpu binname ext
PLATFORMS=(
"linux-x64 x86_64-unknown-linux-gnu linux x64 kimetsu-remote tar.gz"
"darwin-arm64 aarch64-apple-darwin darwin arm64 kimetsu-remote tar.gz"
"win32-x64 x86_64-pc-windows-msvc win32 x64 kimetsu-remote.exe zip"
)

mkdir -p stage-remote
for row in "${PLATFORMS[@]}"; do
read -r key target osv cpuv binname ext <<<"$row"
stem="kimetsu-remote-${VERSION}-${target}"
# The remote archive is uploaded alongside the embeddings kimetsu archive.
archive="dist/kimetsu-${target}-embeddings/${stem}.${ext}"
if [ ! -f "$archive" ]; then
echo "::error::missing kimetsu-remote artifact for ${target}: ${archive}"
exit 1
fi

tmp="$(mktemp -d)"
if [ "$ext" = "zip" ]; then
7z x -y -o"$tmp" "$archive" >/dev/null
else
tar -xf "$archive" -C "$tmp"
fi

pkgdir="stage-remote/${key}"
mkdir -p "$pkgdir/bin"
if [ -f "$tmp/${stem}/${binname}" ]; then
src="$tmp/${stem}/${binname}"
elif [ -f "$tmp/${binname}" ]; then
src="$tmp/${binname}"
else
src="$(find "$tmp" -type f -name "${binname}" | head -n1)"
[ -z "$src" ] && src="$(find "$tmp" -type f -name "*${binname}" | head -n1)"
fi
if [ -z "${src:-}" ] || [ ! -f "$src" ]; then
echo "::error::binary ${binname} not found inside ${archive}"
find "$tmp" -maxdepth 3 -print
exit 1
fi
cp "$src" "$pkgdir/bin/${binname}"
[ "$ext" = "zip" ] || chmod +x "$pkgdir/bin/${binname}"

node -e '
const fs = require("fs");
const [dir, name, version, osv, cpuv] = process.argv.slice(1);
fs.writeFileSync(dir + "/package.json", JSON.stringify({
name,
version,
description: name + " — prebuilt kimetsu-remote server binary",
repository: { type: "git", url: "git+https://github.com/RodCor/kimetsu.git" },
license: "MIT OR Apache-2.0",
os: [osv],
cpu: [cpuv],
files: ["bin"],
}, null, 2) + "\n");
' "$pkgdir" "@kimetsu-ai/remote-${key}" "$VERSION" "$osv" "$cpuv"

if npm view "@kimetsu-ai/remote-${key}@${VERSION}" version >/dev/null 2>&1; then
echo "skip: @kimetsu-ai/remote-${key}@${VERSION} already published"
else
echo "publishing @kimetsu-ai/remote-${key}@${VERSION}"
( cd "$pkgdir" && npm publish --access public )
fi
done

- name: stamp + publish kimetsu-remote main package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
set -euo pipefail
VERSION="${GITHUB_REF_NAME#v}"
node -e '
const fs = require("fs");
const version = process.argv[1];
const p = "npm/kimetsu-remote/package.json";
const j = JSON.parse(fs.readFileSync(p, "utf8"));
j.version = version;
for (const k of Object.keys(j.optionalDependencies || {})) {
j.optionalDependencies[k] = version;
}
fs.writeFileSync(p, JSON.stringify(j, null, 2) + "\n");
' "$VERSION"
if npm view "kimetsu-remote@${VERSION}" version >/dev/null 2>&1; then
echo "skip: kimetsu-remote@${VERSION} already published"
else
echo "publishing kimetsu-remote@${VERSION}"
( cd npm/kimetsu-remote && npm publish --access public )
fi

- name: summary
run: |
VERSION="${GITHUB_REF_NAME#v}"
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,11 @@
.claude/
.codex/
.mcp.json

# Local Codex security-scan artifacts (not part of the project)
.codex-security-scans/
/docs/superpowers
# Real-memory exports must never land in this PUBLIC repo — they belong in
# the private kimetsu-bench repo, reviewed before commit (memories can carry
# environment/work context).
memories-export*.json
Loading
Loading