Skip to content

Commit c2f76aa

Browse files
rainmanaclaude
andcommitted
feat: Adopt parallel branch's test suites and MCP ergonomics
Integrates the valuable work from the parallel rollback on origin/main: the executable MCP user-flow test suite, in-process MCP tests, CI workflow, and parity/testing docs — adapted to this implementation. MCP ergonomics (from the remote branch's parity work): - Accept docs-prefixed tool names (mcp_tinybrain-mcp-server_<tool>) - Notifications identified by method prefix, not missing id; explicit "id": null still receives a response - tags/categories accepted as JSON arrays or JSON array strings - create_relationship accepts source_entry_id/target_entry_id (docs names) alongside source_memory_id/target_memory_id - create_context_snapshot accepts context_data as object or string - update_task_progress accepts task_id (docs) or session_id+task_name - reverse_engineering and malware_analysis session task types - mcp.Server.HandleRequest exported for in-process testing Fixes found by the adopted tests: - BatchUpdateMemoryEntries deadlocked: it queried via the pool (sized to one connection) while its own transaction held that connection; updated entries are now fetched after commit - FTS5 multi-word queries were phrase matches that returned nothing for natural queries; terms are now individually quoted and OR-ed go build/vet and the full test suite pass, including the executable MCP user-flow test that drives the built binary end-to-end. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 37389f3 commit c2f76aa

9 files changed

Lines changed: 1060 additions & 71 deletions

File tree

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
name: Go tests (${{ matrix.os }})
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os:
20+
- ubuntu-latest
21+
- windows-latest
22+
23+
steps:
24+
- name: Check out repository
25+
uses: actions/checkout@v6
26+
27+
- name: Set up Go
28+
uses: actions/setup-go@v6
29+
with:
30+
go-version-file: go.mod
31+
cache: true
32+
33+
- name: Download modules
34+
run: go mod download
35+
36+
- name: Run full test suite
37+
run: go test -v ./...
38+
39+
- name: Run executable MCP user-flow tests
40+
run: go test -v ./cmd/server -run TestMCPExecutableAuthorizedAssessmentFlow -count=1
41+
42+
- name: Run vet
43+
run: go vet ./...
44+
45+
- name: Build server (Windows)
46+
if: runner.os == 'Windows'
47+
shell: pwsh
48+
run: |
49+
New-Item -ItemType Directory -Force -Path bin | Out-Null
50+
go build -o bin/tinybrain.exe ./cmd/server
51+
52+
- name: Build server (Unix)
53+
if: runner.os != 'Windows'
54+
run: |
55+
mkdir -p bin
56+
go build -o bin/tinybrain ./cmd/server

0 commit comments

Comments
 (0)