Skip to content

Commit 79fca12

Browse files
authored
Merge branch 'main' into fix/581-edit-note-disk-recovery
2 parents 1374080 + ec94feb commit 79fca12

7 files changed

Lines changed: 476 additions & 41 deletions

File tree

.github/workflows/bm-bossbot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ jobs:
282282
git config user.name "github-actions[bot]"
283283
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
284284
git switch --orphan "${asset_branch}"
285-
git rm -rf .
285+
git rm -rf --ignore-unmatch .
286286
mkdir -p "$(dirname "${asset_path}")"
287287
cp "${tmp_asset}" "${asset_path}"
288288
git add "${asset_path}"

.github/workflows/docker.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ env:
1313

1414
jobs:
1515
docker:
16-
runs-on: ubuntu-latest
16+
runs-on: depot-ubuntu-24.04
1717
permissions:
1818
contents: read
19+
id-token: write
1920
packages: write
2021

2122
steps:
@@ -24,10 +25,8 @@ jobs:
2425
with:
2526
fetch-depth: 0
2627

27-
- name: Set up Docker Buildx
28-
uses: docker/setup-buildx-action@v4
29-
with:
30-
platforms: linux/amd64,linux/arm64
28+
- name: Set up Depot
29+
uses: depot/setup-action@v1
3130

3231
- name: Log in to GitHub Container Registry
3332
uses: docker/login-action@v4
@@ -49,13 +48,12 @@ jobs:
4948
type=raw,value=latest,enable={{is_default_branch}}
5049
5150
- name: Build and push Docker image
52-
uses: docker/build-push-action@v7
51+
uses: depot/build-push-action@v1
5352
with:
53+
project: ${{ vars.DEPOT_BASIC_MEMORY_PROJECT_ID || vars.DEPOT_PROJECT_ID }}
5454
context: .
5555
file: ./Dockerfile
5656
platforms: linux/amd64,linux/arm64
5757
push: true
5858
tags: ${{ steps.meta.outputs.tags }}
5959
labels: ${{ steps.meta.outputs.labels }}
60-
cache-from: type=gha
61-
cache-to: type=gha,mode=max

.github/workflows/test.yml

Lines changed: 84 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ on:
1313

1414
env:
1515
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
16+
# Required CI records pytest-testmon data but still runs the full selected suite.
17+
# The selective mode stays on explicit developer flows such as `just testmon`.
18+
BASIC_MEMORY_TESTMON_FLAGS: "--testmon-noselect"
1619

1720
jobs:
1821
static-checks:
1922
name: Static Checks (Python 3.12)
2023
timeout-minutes: 20
21-
runs-on: ubuntu-latest
24+
runs-on: depot-ubuntu-24.04
2225

2326
steps:
2427
- uses: actions/checkout@v6
@@ -60,10 +63,12 @@ jobs:
6063
fail-fast: false
6164
matrix:
6265
include:
63-
- os: ubuntu-latest
66+
- os: depot-ubuntu-24.04
6467
python-version: "3.12"
65-
- os: ubuntu-latest
68+
- os: depot-ubuntu-24.04
6669
python-version: "3.13"
70+
# Python 3.14 unit tests are the longest full-suite slice; keep this
71+
# one on GitHub-hosted runners after Depot terminated it mid-suite.
6772
- os: ubuntu-latest
6873
python-version: "3.14"
6974
- os: windows-latest
@@ -87,6 +92,19 @@ jobs:
8792
8893
- uses: extractions/setup-just@v4
8994

95+
- name: Cache pytest-testmon results
96+
uses: actions/cache@v4
97+
with:
98+
path: |
99+
.testmondata
100+
.testmondata-shm
101+
.testmondata-wal
102+
key: ${{ runner.os }}-testmon-sqlite-unit-py${{ matrix.python-version }}-${{ github.ref_name }}-${{ github.run_id }}
103+
restore-keys: |
104+
${{ runner.os }}-testmon-sqlite-unit-py${{ matrix.python-version }}-${{ github.ref_name }}-
105+
${{ runner.os }}-testmon-sqlite-unit-py${{ matrix.python-version }}-main-
106+
${{ runner.os }}-testmon-sqlite-unit-py${{ matrix.python-version }}-
107+
90108
- name: Create virtual env
91109
run: |
92110
uv venv
@@ -106,11 +124,11 @@ jobs:
106124
fail-fast: false
107125
matrix:
108126
include:
109-
- os: ubuntu-latest
127+
- os: depot-ubuntu-24.04
110128
python-version: "3.12"
111-
- os: ubuntu-latest
129+
- os: depot-ubuntu-24.04
112130
python-version: "3.13"
113-
- os: ubuntu-latest
131+
- os: depot-ubuntu-24.04
114132
python-version: "3.14"
115133
- os: windows-latest
116134
python-version: "3.12"
@@ -133,6 +151,19 @@ jobs:
133151
134152
- uses: extractions/setup-just@v4
135153

154+
- name: Cache pytest-testmon results
155+
uses: actions/cache@v4
156+
with:
157+
path: |
158+
.testmondata
159+
.testmondata-shm
160+
.testmondata-wal
161+
key: ${{ runner.os }}-testmon-sqlite-integration-py${{ matrix.python-version }}-${{ github.ref_name }}-${{ github.run_id }}
162+
restore-keys: |
163+
${{ runner.os }}-testmon-sqlite-integration-py${{ matrix.python-version }}-${{ github.ref_name }}-
164+
${{ runner.os }}-testmon-sqlite-integration-py${{ matrix.python-version }}-main-
165+
${{ runner.os }}-testmon-sqlite-integration-py${{ matrix.python-version }}-
166+
136167
- name: Create virtual env
137168
run: |
138169
uv venv
@@ -153,9 +184,14 @@ jobs:
153184
matrix:
154185
include:
155186
- python-version: "3.12"
187+
os: depot-ubuntu-24.04
156188
- python-version: "3.13"
189+
os: depot-ubuntu-24.04
190+
# Match the SQLite unit slice: this full Python 3.14 path outlived
191+
# the Depot runner and was terminated mid-suite.
157192
- python-version: "3.14"
158-
runs-on: ubuntu-latest
193+
os: ubuntu-latest
194+
runs-on: ${{ matrix.os }}
159195
services:
160196
postgres:
161197
image: pgvector/pgvector:pg16
@@ -190,6 +226,19 @@ jobs:
190226
191227
- uses: extractions/setup-just@v4
192228

229+
- name: Cache pytest-testmon results
230+
uses: actions/cache@v4
231+
with:
232+
path: |
233+
.testmondata
234+
.testmondata-shm
235+
.testmondata-wal
236+
key: ${{ runner.os }}-testmon-postgres-unit-py${{ matrix.python-version }}-${{ github.ref_name }}-${{ github.run_id }}
237+
restore-keys: |
238+
${{ runner.os }}-testmon-postgres-unit-py${{ matrix.python-version }}-${{ github.ref_name }}-
239+
${{ runner.os }}-testmon-postgres-unit-py${{ matrix.python-version }}-main-
240+
${{ runner.os }}-testmon-postgres-unit-py${{ matrix.python-version }}-
241+
193242
- name: Create virtual env
194243
run: |
195244
uv venv
@@ -212,7 +261,7 @@ jobs:
212261
- python-version: "3.12"
213262
- python-version: "3.13"
214263
- python-version: "3.14"
215-
runs-on: ubuntu-latest
264+
runs-on: depot-ubuntu-24.04
216265
services:
217266
postgres:
218267
image: pgvector/pgvector:pg16
@@ -247,6 +296,19 @@ jobs:
247296
248297
- uses: extractions/setup-just@v4
249298

299+
- name: Cache pytest-testmon results
300+
uses: actions/cache@v4
301+
with:
302+
path: |
303+
.testmondata
304+
.testmondata-shm
305+
.testmondata-wal
306+
key: ${{ runner.os }}-testmon-postgres-integration-py${{ matrix.python-version }}-${{ github.ref_name }}-${{ github.run_id }}
307+
restore-keys: |
308+
${{ runner.os }}-testmon-postgres-integration-py${{ matrix.python-version }}-${{ github.ref_name }}-
309+
${{ runner.os }}-testmon-postgres-integration-py${{ matrix.python-version }}-main-
310+
${{ runner.os }}-testmon-postgres-integration-py${{ matrix.python-version }}-
311+
250312
- name: Create virtual env
251313
run: |
252314
uv venv
@@ -262,7 +324,7 @@ jobs:
262324
test-semantic:
263325
name: Test Semantic (Python 3.12)
264326
timeout-minutes: 45
265-
runs-on: ubuntu-latest
327+
runs-on: depot-ubuntu-24.04
266328

267329
steps:
268330
- uses: actions/checkout@v6
@@ -281,6 +343,19 @@ jobs:
281343
282344
- uses: extractions/setup-just@v4
283345

346+
- name: Cache pytest-testmon results
347+
uses: actions/cache@v4
348+
with:
349+
path: |
350+
.testmondata
351+
.testmondata-shm
352+
.testmondata-wal
353+
key: ${{ runner.os }}-testmon-semantic-py3.12-${{ github.ref_name }}-${{ github.run_id }}
354+
restore-keys: |
355+
${{ runner.os }}-testmon-semantic-py3.12-${{ github.ref_name }}-
356+
${{ runner.os }}-testmon-semantic-py3.12-main-
357+
${{ runner.os }}-testmon-semantic-py3.12-
358+
284359
- name: Create virtual env
285360
run: |
286361
uv venv

justfile

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Basic Memory - Modern Command Runner
22

3+
TESTMON_FLAGS := env_var_or_default("BASIC_MEMORY_TESTMON_FLAGS", "--testmon-noselect")
4+
TESTMON_SELECT_FLAGS := env_var_or_default("BASIC_MEMORY_TESTMON_SELECT_FLAGS", "--testmon --testmon-forceselect")
5+
TESTMON_REFRESH_FLAGS := env_var_or_default("BASIC_MEMORY_TESTMON_REFRESH_FLAGS", "--testmon-noselect")
6+
37
# Install dependencies
48
install:
59
uv sync
@@ -35,40 +39,55 @@ test-sqlite: test-unit-sqlite test-int-sqlite
3539
test-postgres: test-unit-postgres test-int-postgres
3640

3741
# Run unit tests against SQLite
38-
test-unit-sqlite:
39-
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov tests
42+
test-unit-sqlite: testmon-seed
43+
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov {{TESTMON_FLAGS}} --testmon-env=unit-sqlite tests
4044

4145
# Run unit tests against Postgres
42-
test-unit-postgres:
43-
BASIC_MEMORY_ENV=test BASIC_MEMORY_TEST_POSTGRES=1 uv run pytest -p pytest_mock -v --no-cov tests
46+
test-unit-postgres: testmon-seed
47+
BASIC_MEMORY_ENV=test BASIC_MEMORY_TEST_POSTGRES=1 uv run pytest -p pytest_mock -v --no-cov {{TESTMON_FLAGS}} --testmon-env=unit-postgres tests
4448

4549
# Run integration tests against SQLite (excludes semantic benchmarks — use just test-semantic)
46-
test-int-sqlite:
47-
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov -m "not semantic" test-int
50+
test-int-sqlite: testmon-seed
51+
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov {{TESTMON_FLAGS}} --testmon-env=int-sqlite -m "not semantic" test-int
4852

4953
# Run integration tests against Postgres
5054
# Note: Uses timeout due to FastMCP Client + asyncpg cleanup hang (tests pass, process hangs on exit)
5155
# See: https://github.com/jlowin/fastmcp/issues/1311
52-
test-int-postgres:
56+
test-int-postgres: testmon-seed
5357
#!/usr/bin/env bash
5458
set -euo pipefail
5559
# Use gtimeout (macOS/Homebrew) or timeout (Linux)
5660
TIMEOUT_CMD=$(command -v gtimeout || command -v timeout || echo "")
5761
if [[ -n "$TIMEOUT_CMD" ]]; then
58-
$TIMEOUT_CMD --signal=KILL 600 bash -c 'BASIC_MEMORY_ENV=test BASIC_MEMORY_TEST_POSTGRES=1 uv run pytest -p pytest_mock -v --no-cov -m "not semantic" test-int' || test $? -eq 137
62+
$TIMEOUT_CMD --signal=KILL 600 bash -c 'BASIC_MEMORY_ENV=test BASIC_MEMORY_TEST_POSTGRES=1 uv run pytest -p pytest_mock -v --no-cov {{TESTMON_FLAGS}} --testmon-env=int-postgres -m "not semantic" test-int' || test $? -eq 137
5963
else
6064
echo "⚠️ No timeout command found, running without timeout..."
61-
BASIC_MEMORY_ENV=test BASIC_MEMORY_TEST_POSTGRES=1 uv run pytest -p pytest_mock -v --no-cov -m "not semantic" test-int
65+
BASIC_MEMORY_ENV=test BASIC_MEMORY_TEST_POSTGRES=1 uv run pytest -p pytest_mock -v --no-cov {{TESTMON_FLAGS}} --testmon-env=int-postgres -m "not semantic" test-int
6266
fi
6367
6468
# Run tests impacted by recent changes (requires pytest-testmon)
6569
# Pass paths or node ids after `just testmon` to limit the candidate set further.
66-
testmon *args:
67-
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov --testmon {{args}}
70+
testmon *args: testmon-seed
71+
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov {{TESTMON_SELECT_FLAGS}} --testmon-env=local {{args}}
72+
73+
# Seed pytest-testmon data into this worktree from the shared Git cache.
74+
testmon-seed:
75+
uv run python scripts/testmon_cache.py seed
76+
77+
# Refresh the shared pytest-testmon cache from a full backend test run.
78+
testmon-refresh:
79+
#!/usr/bin/env bash
80+
set -euo pipefail
81+
BASIC_MEMORY_TESTMON_FLAGS="{{TESTMON_REFRESH_FLAGS}}" just test
82+
uv run python scripts/testmon_cache.py refresh
83+
84+
# Show local and shared pytest-testmon cache locations.
85+
testmon-status:
86+
uv run python scripts/testmon_cache.py status
6887

6988
# Run MCP smoke test (fast end-to-end loop)
70-
test-smoke:
71-
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov -m smoke test-int/mcp/test_smoke_integration.py
89+
test-smoke: testmon-seed
90+
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov {{TESTMON_FLAGS}} --testmon-env=smoke -m smoke test-int/mcp/test_smoke_integration.py
7291

7392
# Fast local loop: lint, format, typecheck, impacted tests via pytest-testmon
7493
fast-check:
@@ -97,18 +116,18 @@ postgres-migrate:
97116
# Run Windows-specific tests only (only works on Windows platform)
98117
# These tests verify Windows-specific database optimizations (locking mode, NullPool)
99118
# Will be skipped automatically on non-Windows platforms
100-
test-windows:
101-
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov -m windows tests test-int
119+
test-windows: testmon-seed
120+
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov {{TESTMON_FLAGS}} --testmon-env=windows -m windows tests test-int
102121

103122
# Run benchmark tests only (performance testing)
104123
# These are slow tests that measure sync performance with various file counts
105124
# Excluded from default test runs to keep CI fast
106-
test-benchmark:
107-
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov -m benchmark tests test-int
125+
test-benchmark: testmon-seed
126+
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov {{TESTMON_FLAGS}} --testmon-env=benchmark -m benchmark tests test-int
108127

109128
# Run semantic search quality benchmarks (all combos)
110-
test-semantic:
111-
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov -m semantic test-int/semantic/
129+
test-semantic: testmon-seed
130+
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov {{TESTMON_FLAGS}} --testmon-env=semantic -m semantic test-int/semantic/
112131

113132
# Run semantic benchmarks with JSON artifact output, then show report
114133
test-semantic-report:
@@ -120,8 +139,8 @@ test-litellm-live *args:
120139
BASIC_MEMORY_ENV=test BASIC_MEMORY_RUN_LITELLM_INTEGRATION=1 PYTHONPATH=test-int:src uv run python -m semantic.litellm_live_harness {{args}}
121140

122141
# Run semantic benchmarks (Postgres combos only)
123-
test-semantic-postgres:
124-
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov -m semantic -k postgres test-int/semantic/
142+
test-semantic-postgres: testmon-seed
143+
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov {{TESTMON_FLAGS}} --testmon-env=semantic-postgres -m semantic -k postgres test-int/semantic/
125144

126145
# View semantic benchmark results (rich formatted table)
127146
# Usage: just semantic-report [--filter-combo sqlite] [--filter-suite paraphrase] [--sort-by avg_latency_ms]
@@ -137,8 +156,8 @@ benchmark-compare baseline candidate *args:
137156

138157
# Run all tests including Windows, Postgres, and Benchmarks (for CI/comprehensive testing)
139158
# Use this before releasing to ensure everything works across all backends and platforms
140-
test-all:
141-
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov tests test-int
159+
test-all: testmon-seed
160+
BASIC_MEMORY_ENV=test uv run pytest -p pytest_mock -v --no-cov {{TESTMON_FLAGS}} --testmon-env=all tests test-int
142161

143162
# Generate HTML coverage report
144163
coverage:

0 commit comments

Comments
 (0)