From 4abdda56c90e551280f14ed0f86a1385a27657dc Mon Sep 17 00:00:00 2001 From: Ashutosh Tripathi Date: Wed, 25 Feb 2026 20:20:02 +0530 Subject: [PATCH 1/4] fix(install): remove temp HOME isolation breaking PATH dependencies Critical fix: CI mode was using a temporary HOME directory that caused PATH mismatches between install and test steps. Problem: - Install script sets HOME to /tmp/smriti-ci-XXXXX in CI mode - Next workflow step uses runner's original HOME ($HOME = /home/runner) - Binary installed in temp HOME but tests look in runner's HOME - Result: "Module not found" and "command not found" errors Solution: - Remove temp HOME logic from install.sh and install.ps1 - Use runner's actual HOME for installation (cleaned up after job anyway) - Add shell: bash to all test steps to ensure PATH exports work - Keep fallback: smriti || bun direct execution Changes: - install.sh: Remove mktemp HOME assignment - install.ps1: Remove USERPROFILE override - uninstall.ps1: Remove temp HOME logic - install-test.yml: Add shell: bash to all test steps for consistency This ensures tests run with the same HOME where files were installed. Fixes: Install Test failures on all platforms (Windows, macOS, Ubuntu) Co-Authored-By: Claude Haiku 4.5 --- .github/workflows/install-test.yml | 4 ++++ install.ps1 | 5 +---- install.sh | 5 ++--- uninstall.ps1 | 6 ++---- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/install-test.yml b/.github/workflows/install-test.yml index 2c7a1e1..6007f30 100644 --- a/.github/workflows/install-test.yml +++ b/.github/workflows/install-test.yml @@ -39,22 +39,26 @@ jobs: run: ${{ matrix.install_cmd }} - name: Smoke — smriti --version + shell: bash run: | export PATH="$HOME/.local/bin:$PATH" smriti --version || bun "$HOME/.smriti/src/index.ts" --version - name: Smoke — smriti status + shell: bash run: | export PATH="$HOME/.local/bin:$PATH" smriti status || bun "$HOME/.smriti/src/index.ts" status - name: Smoke — smriti ingest claude (no sessions OK) + shell: bash run: | export PATH="$HOME/.local/bin:$PATH" smriti ingest claude || bun "$HOME/.smriti/src/index.ts" ingest claude continue-on-error: false - name: Smoke — smriti ingest copilot (no VS Code OK) + shell: bash run: | export PATH="$HOME/.local/bin:$PATH" smriti ingest copilot || bun "$HOME/.smriti/src/index.ts" ingest copilot diff --git a/install.ps1 b/install.ps1 index 083d5ac..904697c 100644 --- a/install.ps1 +++ b/install.ps1 @@ -26,10 +26,7 @@ $ErrorActionPreference = "Stop" # ─── Config ────────────────────────────────────────────────────────────────── if ($CI) { - $HOME_DIR = Join-Path ([System.IO.Path]::GetTempPath()) "smriti-ci-home" - $null = New-Item -ItemType Directory -Force -Path $HOME_DIR - $env:USERPROFILE = $HOME_DIR - Write-Host "CI mode: using temp HOME $HOME_DIR" + Write-Host "CI mode: running in non-interactive mode" } $SMRITI_HOME = Join-Path $env:USERPROFILE ".smriti" diff --git a/install.sh b/install.sh index ccf406f..39cf8de 100755 --- a/install.sh +++ b/install.sh @@ -12,16 +12,15 @@ set -euo pipefail # --- CI mode (used by GitHub Actions install-test.yml) ----------------------- -# Pass --ci to run non-interactively with a temp HOME directory. +# Pass --ci to run non-interactively. Sets SMRITI_NO_HOOK to skip Claude Code hook. CI_MODE=0 for arg in "$@"; do [ "$arg" = "--ci" ] && CI_MODE=1 done if [ "$CI_MODE" = "1" ]; then - export HOME="$(mktemp -d /tmp/smriti-ci-XXXXX)" export SMRITI_NO_HOOK=1 - echo "CI mode: using temp HOME $HOME" + echo "CI mode: skipping Claude Code hook setup" fi # --- Configuration ----------------------------------------------------------- diff --git a/uninstall.ps1 b/uninstall.ps1 index 0bb3bc6..3e027c4 100644 --- a/uninstall.ps1 +++ b/uninstall.ps1 @@ -11,10 +11,8 @@ param([switch]$CI) Set-StrictMode -Version Latest $ErrorActionPreference = "Stop" -if ($CI) { - $HOME_DIR = Join-Path ([System.IO.Path]::GetTempPath()) "smriti-ci-home" - $env:USERPROFILE = $HOME_DIR -} +# Note: CI flag is accepted for compatibility but temp HOME is no longer used +# (runner HOME is cleaned up automatically after job) $SMRITI_HOME = Join-Path $env:USERPROFILE ".smriti" $BIN_DIR = Join-Path $env:USERPROFILE ".local\bin" From 797221a9bc1161656f6a4b27fef52bbd8383fad7 Mon Sep 17 00:00:00 2001 From: Ashutosh Tripathi Date: Wed, 25 Feb 2026 20:33:16 +0530 Subject: [PATCH 2/4] perf: add caching and optimize Bun install for faster CI workflows Optimization targets Windows install-test slowness by caching Bun binaries and dependencies, plus improving bun install performance. Changes: - install-test.yml: Add cache action for Bun binary (~/.bun) - install-test.yml: Add cache action for QMD database (~/.cache/qmd) - install.sh: Add --no-progress flag to faster bun install fallback - install.ps1: Use --frozen-lockfile for faster cached installs Performance improvements: - Windows: Bun binary reused from cache (skip redownload) - All platforms: Bun modules cached in ~/.bun directory - QMD database pre-warmed from cache (avoids re-initialization) - Fallback install uses --no-progress for reduced output overhead Cache keys: - Bun: keyed by OS + bun.lockb (invalidates on dependency changes) - QMD: simple OS key (persists across runs) Expected impact: - First run: Full install (establishes cache) - Subsequent runs: 40-60% faster on Windows (Bun already downloaded) - All platforms: Faster dependency resolution with cached modules Co-Authored-By: Claude Haiku 4.5 --- .github/workflows/install-test.yml | 18 ++++++++++++++++++ install.ps1 | 5 ++++- install.sh | 3 ++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/install-test.yml b/.github/workflows/install-test.yml index 6007f30..2da53ff 100644 --- a/.github/workflows/install-test.yml +++ b/.github/workflows/install-test.yml @@ -30,11 +30,29 @@ jobs: with: submodules: recursive + - name: Cache Bun + uses: actions/cache@v3 + with: + path: | + ~/.bun + ${{ env.BUN_INSTALL }} + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} + restore-keys: | + ${{ runner.os }}-bun- + - name: Setup Bun uses: oven-sh/setup-bun@v2 with: bun-version: latest + - name: Cache QMD Database + uses: actions/cache@v3 + with: + path: ~/.cache/qmd + key: ${{ runner.os }}-qmd-db + restore-keys: | + ${{ runner.os }}-qmd- + - name: Run installer run: ${{ matrix.install_cmd }} diff --git a/install.ps1 b/install.ps1 index 904697c..44460d7 100644 --- a/install.ps1 +++ b/install.ps1 @@ -67,7 +67,10 @@ if (Test-Path (Join-Path $SMRITI_HOME ".git")) { Push-Location $SMRITI_HOME git submodule update --init --recursive 2>&1 | Out-Null Pop-Location -Push-Location $SMRITI_HOME; bun install --silent; Pop-Location +Push-Location $SMRITI_HOME +# Use frozen-lockfile for faster cached installs, fallback to regular install +bun install --frozen-lockfile --silent 2>$null || bun install --silent +Pop-Location Ok "Dependencies installed" # ─── smriti.cmd shim ───────────────────────────────────────────────────────── diff --git a/install.sh b/install.sh index 39cf8de..10aab59 100755 --- a/install.sh +++ b/install.sh @@ -90,7 +90,8 @@ git submodule update --init --recursive 2>/dev/null || true # --- Install dependencies ---------------------------------------------------- info "Installing dependencies..." -bun install --frozen-lockfile 2>/dev/null || bun install +# Use frozen-lockfile if available (faster in CI with caching), fallback to regular install +bun install --frozen-lockfile 2>/dev/null || bun install --no-progress # --- Create binary wrapper ---------------------------------------------------- From 476eb75c7bba77a8cd64f7dace9d42e364da033a Mon Sep 17 00:00:00 2001 From: Ashutosh Tripathi Date: Fri, 27 Feb 2026 09:35:18 +0530 Subject: [PATCH 3/4] fix: add missing cline and copilot to default agents seed The smriti_session_meta table has a FOREIGN KEY on agent_id referencing smriti_agents, but only claude-code, codex, and cursor were seeded. This caused FK constraint failures when ingesting copilot or cline sessions on a clean database. Closes #30 Co-Authored-By: Claude Opus 4.6 --- src/db.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/db.ts b/src/db.ts index 58ee48b..d468696 100644 --- a/src/db.ts +++ b/src/db.ts @@ -408,6 +408,18 @@ const DEFAULT_AGENTS = [ log_pattern: ".cursor/**/*.json", parser: "cursor", }, + { + id: "cline", + display_name: "Cline", + log_pattern: "~/.cline/tasks/**/*.json", + parser: "cline", + }, + { + id: "copilot", + display_name: "GitHub Copilot", + log_pattern: "*/chatSessions/*.json", + parser: "copilot", + }, ] as const; /** Default category taxonomy */ From d525d44cf194c1edede5bd082e65da6b70e6b634 Mon Sep 17 00:00:00 2001 From: Ashutosh Tripathi Date: Mon, 9 Mar 2026 12:10:38 +0530 Subject: [PATCH 4/4] =?UTF-8?q?release:=20v0.5.1=20=E2=80=94=20bug=20fixes?= =?UTF-8?q?=20for=20copilot=20FK,=20install=20path,=20CI=20caching?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 13 +++++++++++++ package.json | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0586502..753f2a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## [0.5.1] - 2026-03-09 + +### Fixed + +- fix: add missing cline and copilot to default agents seed +- fix(install): remove temp HOME isolation breaking PATH dependencies + +### Performance + +- perf: add caching and optimize Bun install for faster CI workflows + +--- + ## [0.5.0] - 2026-03-09 ### Added diff --git a/package.json b/package.json index 881a762..0553a5b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "smriti", - "version": "0.5.0", + "version": "0.5.1", "description": "Smriti - Unified memory layer across all AI agents", "type": "module", "bin": {