Skip to main content

sari v2

LSP-first 로컬 인덱싱/검색 엔진 + MCP 데몬.

설치

필수 런타임: Python 3.14+

uv tool install sari
# 또는
python3 -m pip install sari

기본 사용

sari doctor
sari daemon start
sari roots add /absolute/path/to/repo
sari roots deactivate /absolute/path/to/repo
sari roots activate /absolute/path/to/repo

Workspace 활성 정책 (Soft-OFF)

is_active는 수집/도구 접근 제어 플래그다.

  • is_active=true: 수집 루프와 MCP/HTTP repo 해석 경로에서 정상 접근된다.
  • is_active=false: 수집 스케줄 및 watcher 등록에서 제외되고, 도구 접근은 ERR_WORKSPACE_INACTIVE로 차단된다.
  • Soft-OFF 정책: 비활성화 시 기존 인덱스/메타데이터는 즉시 삭제하지 않는다(데이터 유지).

자세한 운영 규칙은 docs/workspace_activation_policy.md를 참고한다.

MCP 연동 (권장)

sari install --host gemini
sari install --host codex
  • Gemini/Codex 설정에 command = "sari" + args = ["mcp","stdio"]를 자동 반영한다.
  • Codex 설정에는 startup_timeout_sec = 45를 기본 반영한다.
  • 기존 설정 파일은 .bak.<timestamp>로 백업된다.

MCP handshake timeout 대응

MCP 클라이언트에서 아래와 같은 메시지가 보이면 startup timeout이 짧은 경우가 많다.

  • MCP client for "sari" timed out after 10 seconds
  • MCP startup incomplete

Codex 설정(~/.codex/config.toml)에서 startup_timeout_sec를 늘려준다.

[mcp_servers.sari]
command = "sari"
args = ["mcp", "stdio"]
startup_timeout_sec = 45
  • 권장 시작값: 30
  • 대형 DB/느린 디스크/초기 마이그레이션 환경: 45~60

수동 설정 예시

Gemini (~/.gemini/settings.json)

{
  "mcpServers": {
    "sari": {
      "command": "sari",
      "args": ["mcp", "stdio"]
    }
  }
}

Codex (~/.codex/config.toml)

[mcp_servers.sari]
command = "sari"
args = ["mcp", "stdio"]
startup_timeout_sec = 45

Troubleshooting

sqlite3.OperationalError: no such column: repo_id

기존(구버전) state.db를 현재 바이너리와 함께 사용할 때 발생할 수 있다.

복구 절차:

  1. 기존 DB 백업
  2. 새 DB 경로로 부팅해 초기 스키마/마이그레이션을 완료
  3. sari doctor와 MCP 연결 재확인

예시:

# 1) 백업
cp ~/.local/share/sari-v2/state.db ~/.local/share/sari-v2/state.db.bak.$(date +%Y%m%d-%H%M%S)

# 2) 새 DB로 실행(임시/영구 경로 모두 가능)
export SARI_DB_PATH=~/.local/share/sari-v2/state.new.db

# 3) 상태 확인
sari doctor

설치 직후 최소 점검 순서

sari doctor
sari install --host codex
# Codex config.toml에서 startup_timeout_sec = 30~60 확인

개발 검증

uv run pytest -q .
tools/ci/run_installed_freshdb_smoke.sh
uv run tools/ci/run_release_gate.sh
tools/manual/test_mcp_call_flow.sh /absolute/path/to/repo

GitHub Actions 배포

Release 워크플로우 파일: .github/workflows/release-pypi.yml

1) TestPyPI 선검증 (권장)

  1. GitHub Actions에서 Release PyPI를 수동 실행한다.
  2. 입력값 publish_to_testpypi=true로 실행한다.
  3. build job에서 release gate + wheel/sdist 빌드 + twine check 통과를 확인한다.
  4. publish-testpypi job 성공과 release-dist artifact 업로드를 확인한다.

2) PyPI 실배포

  1. pyproject.toml 버전을 확정한다.
  2. 동일 버전 태그(v<version>)를 push 한다. 예: v2.0.14
  3. 워크플로우의 tag/version 일치 검증 통과 후 publish-pypi job 성공을 확인한다.

로컬 wheel 테스트 (글로벌 tool 오염 방지)

로컬 빌드 산출물 검증은 uv tool install dist/*.whl 대신 아래 스크립트를 사용한다.

uv run --with build python -m build
tools/manual/test_local_wheel_ephemeral.sh
  • 위 방식은 uvx --from <wheel>로 일회성 실행만 하므로, ~/.local/bin/sari 글로벌 설치를 덮어쓰지 않는다.
  • 글로벌 업그레이드는 계속 uv tool upgrade sari를 사용한다.

실수로 글로벌 tool을 로컬 wheel로 덮어쓴 경우 복구

tools/manual/repair_global_sari_tool.sh
# 특정 버전으로 복구
tools/manual/repair_global_sari_tool.sh 2.0.13

Metadata

Release files for sari 2.0.47

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sari 2.0.47
File Size Uploaded Provenance Actions
sari-2.0.47.tar.gz 3.7 MB With provenance Details for sari-2.0.47.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sari 2.0.47
File Interpreter ABI Platform Actions
sari-2.0.47-py3-none-any.whl Python 3 none any Details for sari-2.0.47-py3-none-any.whl

Total release size: 7.7 MB

Release files / sari-2.0.47.tar.gz

Download URL sari-2.0.47.tar.gz
Size 3.7 MB
Tags Source
SHA-256 checksum
How to use checksums
669b100efaea469ec73aff134f57c02e416e7a185d9fad889c92b9a4192b8d49
BLAKE2b-256 checksum
How to use checksums
1de9ff49fec4369fde7ee2a49c56f7ad42fea5d4a9a15479f3fba087570f701f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.

Transparency log

Release files / sari-2.0.47-py3-none-any.whl

Download URL sari-2.0.47-py3-none-any.whl
Size 4.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f98d921fc15171d573990b0eb08a1767f6a3736b32399097f0ed25b794585146
BLAKE2b-256 checksum
How to use checksums
8a52c2f6f1938b5a1ffbe9dce637047b7b5a0855064e52f8400d29898f759e4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.

Transparency log

Security for sari 2.0.47

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sari-2.0.47.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.47 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page