Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,15 @@ jobs:
run: |
python -m venv /tmp/wikibrain-wheel
/tmp/wikibrain-wheel/bin/python -m pip install dist/*.whl
/tmp/wikibrain-wheel/bin/wikibrain --version
/tmp/wikibrain-wheel/bin/brainctl --version
/tmp/wikibrain-wheel/bin/python -I -c 'from wikibrain.version_policy import _fetch_remote_policy; assert _fetch_remote_policy(child_code="import sys;sys.stdout.buffer.write(b\"{}\")") == b"{}"'

- name: Install and smoke-test the source distribution
run: |
python -m venv /tmp/wikibrain-sdist
/tmp/wikibrain-sdist/bin/python -m pip install dist/*.tar.gz
/tmp/wikibrain-sdist/bin/wikibrain --version
/tmp/wikibrain-sdist/bin/brainctl --version

windows:
Expand Down Expand Up @@ -129,11 +131,13 @@ jobs:
$pipxBin = (
py -3 -m pipx environment --value PIPX_BIN_DIR
).Trim()
$wikibrain = Join-Path $pipxBin "wikibrain.exe"
$brainctl = Join-Path $pipxBin "brainctl.exe"
& $wikibrain --version
& $brainctl --version
& $brainctl doctor --json
& $wikibrain doctor --json
if ($LASTEXITCODE -ne 0) {
throw "brainctl doctor failed"
throw "wikibrain doctor failed"
}

$brainHome = Join-Path $env:LOCALAPPDATA "WikiBrain"
Expand Down
8 changes: 4 additions & 4 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WikiBrain is deliberately a bridge, not a fourth knowledge database.

```text
Claude Code hooks ─┐
Codex hooks ───────┼─ brainctl ─ SQLite WAL (events and evidence)
Codex hooks ───────┼─ wikibrain ─ SQLite WAL (events and evidence)
Grok hooks ────────┘ │
├─ owned Markdown vault (durable truth)
└─ wikimap CLI (disposable index and recall)
Expand Down Expand Up @@ -47,7 +47,7 @@ Grok's passive events ignore hook stdout. WikiBrain therefore captures and
archives Grok events, but deliberately skips hook-time recall and context-usage
accounting for Grok. This prevents evidence that Grok never received from being
counted toward adaptive-memory promotion. Grok recall remains explicit through
the installed skill or `brainctl recall` until the host exposes a supported
the installed skill or `wikibrain recall` until the host exposes a supported
context-injection result.

The observed Grok binary sends lowercase event values such as
Expand All @@ -60,8 +60,8 @@ without a separate bounded, redacted transcript contract.

Workspace identity is the nearest Git root inside an allowlisted root. This
keeps two repositories isolated even when the allowlist is the user's home
directory. Only a manual `brainctl remember --global` crosses that boundary.
Zero-argument `brainctl init` uses the current user's home as that allowlisted
directory. Only a manual `wikibrain remember --global` crosses that boundary.
Zero-argument `wikibrain init` uses the current user's home as that allowlisted
root. This is a capture boundary, not a file crawler: WikiBrain receives only
agent lifecycle payloads and never walks the home directory for content.
Repeatable `--workspace` arguments replace the default when narrower roots are
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ The project follows [Semantic Versioning](https://semver.org/).

## [Unreleased]

## [0.1.9] - 2026-08-02

### Changed

- Rename the primary CLI from `brainctl` to `wikibrain` across package entry
points, hooks, installers, diagnostics, documentation, and release packaging.
The old `brainctl` entry point remains as a deprecated compatibility alias,
and setup continues to recognize and replace hooks installed with that name.

## [0.1.8] - 2026-07-23

### Security
Expand Down
96 changes: 48 additions & 48 deletions README.ja.md

Large diffs are not rendered by default.

96 changes: 48 additions & 48 deletions README.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,37 +58,37 @@ macOS 또는 Linux:

```bash
brew install hungrytech/tap/wikibrain
brainctl init
brainctl doctor
wikibrain init
wikibrain doctor
```

네이티브 Windows에서는 검토 가능한 [PowerShell 설치 스크립트](#native-windows)를
사용하세요. `brainctl init`이 명시적인 동의 지점이며, 프로그램만 설치하면
사용하세요. `wikibrain init`이 명시적인 동의 지점이며, 프로그램만 설치하면
Claude나 Codex 설정은 바뀌지 않습니다.

### 2. 새 에이전트 세션 시작하기

| 사용 방식 | `brainctl init` 이후 | 처음 한 번 할 일 |
| 사용 방식 | `wikibrain init` 이후 | 처음 한 번 할 일 |
| --- | --- | --- |
| Claude Code 자동 기억 | 새 세션에서 바로 사용 가능 | 없음. 필요하면 `/hooks`에서 확인합니다. |
| Codex 수동 기억 | 즉시 사용 가능 | `brainctl remember`와 `brainctl recall`을 사용합니다. |
| Codex 수동 기억 | 즉시 사용 가능 | `wikibrain remember`와 `wikibrain recall`을 사용합니다. |
| Codex 자동 수집·회상 | 정의는 설치되지만 처음에는 신뢰되지 않음 | 새 세션에서 `/hooks`를 열고 WikiBrain hook 다섯 개를 검토한 뒤 현재 해시를 신뢰합니다. |
| Grok 자동 수집 | Grok의 Claude hook 호환 기능으로 사용 가능하며 native 설치도 지원 | 기본 설치에는 추가 작업이 없습니다. Grok 전용 설치일 때만 `brainctl setup --clients grok`을 사용합니다. |
| Grok 회상 | 설치된 skill과 `brainctl recall` 사용 가능 | Grok은 passive hook의 stdout을 무시하므로 hook 기반 자동 문맥 주입은 지원하지 않습니다. |
| Grok 자동 수집 | Grok의 Claude hook 호환 기능으로 사용 가능하며 native 설치도 지원 | 기본 설치에는 추가 작업이 없습니다. Grok 전용 설치일 때만 `wikibrain setup --clients grok`을 사용합니다. |
| Grok 회상 | 설치된 skill과 `wikibrain recall` 사용 가능 | Grok은 passive hook의 stdout을 무시하므로 hook 기반 자동 문맥 주입은 지원하지 않습니다. |

### 3. 간단히 동작 확인하기

```bash
brainctl remember --global --title "WikiBrain 동작 확인" \
wikibrain remember --global --title "WikiBrain 동작 확인" \
"내 WikiBrain 확인 표식은 Cobalt-719다."
brainctl recall "Cobalt-719"
wikibrain recall "Cobalt-719"
```

결과에 `Cobalt-719`와 로컬 Markdown 출처가 표시되어야 합니다. `remember`가
반환한 문서 ID로 테스트 페이지를 삭제할 수 있습니다.

```bash
brainctl forget --document DOCUMENT_ID --apply
wikibrain forget --document DOCUMENT_ID --apply
```

<a id="how-it-works"></a>
Expand All @@ -97,7 +97,7 @@ brainctl forget --document DOCUMENT_ID --apply

```text
Claude Code hooks ─┐
Codex hooks ───────┼─ brainctl ─┬─ SQLite WAL: 영수증, 큐, 관계
Codex hooks ───────┼─ wikibrain ─┬─ SQLite WAL: 영수증, 큐, 관계
Grok hooks ────────┘ ├─ Markdown vault: 읽을 수 있는 영구 원본
└─ Wikimap: 다시 만들 수 있는 로컬 검색 인덱스
```
Expand All @@ -120,7 +120,7 @@ WikiBrain은 Grok hook 환경을 감지해 Claude 호환 경로에서 실행된
`grok`으로 기록합니다. 다만 Grok은 passive hook의 stdout을 무시합니다. 따라서
Grok의 근거는 자동 수집하지만, 전달되지 않은 회상을 문맥 주입으로 계산하거나
자동 회상이라고 주장하지 않습니다. 이전 맥락이 필요하면 Grok에게 WikiBrain
skill을 사용하도록 요청하거나 `brainctl recall`을 실행합니다.
skill을 사용하도록 요청하거나 `wikibrain recall`을 실행합니다.
실측 runtime payload의 event 값은 `user_prompt_submit`, `stop`처럼
lowercase이며 WikiBrain이 내부 lifecycle 이름으로 정규화합니다. `UserPromptSubmit`은
`prompt`와 `promptId`를 제공합니다. 실측 `Stop` payload에는 `transcriptPath`,
Expand All @@ -130,11 +130,11 @@ lowercase이며 WikiBrain이 내부 lifecycle 이름으로 정규화합니다. `
Grok만 사용한다면 먼저 [Grok Build overview](https://docs.x.ai/build/overview)에
따라 공식 `grok` 실행 파일을 설치합니다. xAI의 현재 명령은
`curl -fsSL https://x.ai/cli/install.sh | bash`이며 원격 설치 script는 실행 전에
검토해야 합니다. 그다음 `brainctl init --clients grok`을 사용합니다. Grok의
검토해야 합니다. 그다음 `wikibrain init --clients grok`을 사용합니다. Grok의
Claude hook scanner를 끄지 않았다면 native Grok hook과 Claude hook을 함께 설치하지
마세요. 같은 이벤트에서 두 정의가 모두 실행될 수 있습니다.

각 Git 저장소는 서로 격리된 기억 범위입니다. `brainctl remember --global`만
각 Git 저장소는 서로 격리된 기억 범위입니다. `wikibrain remember --global`만
의도적으로 프로젝트 경계를 넘습니다. Hook은 fail-open 방식이라 잘못된 이벤트,
바쁜 데이터베이스, 누락된 Wikimap 실행 파일, timeout이 코딩 에이전트를 막지
않습니다.
Expand All @@ -150,7 +150,7 @@ Claude hook scanner를 끄지 않았다면 native Grok hook과 Claude hook을
| --- | --- | --- |
| 단기기억 근거 | 민감정보를 제거한 session turn과 compaction handoff | 기본 90일 |
| 적응형 장기기억 | 에이전트 맥락에 반복해서 전달된 근거의 제한된 정제본 | 일반 retention 후에도 보존하며 `adaptive`로 표시 |
| 명시적 장기기억 | “기억해” 또는 `brainctl remember`로 사용자가 지정한 사실·선호 | 일반 retention 후에도 보존하며 `explicit`로 표시 |
| 명시적 장기기억 | “기억해” 또는 `wikibrain remember`로 사용자가 지정한 사실·선호 | 일반 retention 후에도 보존하며 `explicit`로 표시 |

### 적응형 승격 조건과 점수

Expand Down Expand Up @@ -189,7 +189,7 @@ threshold를 0부터 1 사이에서 조정할 수 있으며, `0`으로 설정하
이전 동작을 유지합니다.

같은 provider/session pair가 같은 UTC 날짜에 근거를 다시 받아도 한 번만 셉니다. 실제
consumer session identity가 없는 수동 `brainctl recall`은 세지 않습니다. 최종
consumer session identity가 없는 수동 `wikibrain recall`은 세지 않습니다. 최종
`<memory-data>`에 들어간 근거만 점수에 기여하며, query-backed 점수는 명시적 검색의
direct hit에만 줍니다. Related 및 recent fallback 결과는 포함하지 않습니다. Memory
페이지는 자신의 승격 점수를 높일 수 없고, workspace 사이의 사용량도 합치지 않습니다.
Expand Down Expand Up @@ -324,17 +324,17 @@ resume, 실제 초기화를 중단하고 정확한 Homebrew 갱신 명령을 표

```bash
brew update && brew upgrade hungrytech/tap/wikibrain
brainctl setup && brainctl doctor
wikibrain setup && wikibrain doctor
```

네이티브 Windows에서는 아래 설명처럼 버전이 고정된 설치 스크립트 URL을 표시하며,
내려받은 내용을 검토한 뒤 실행해야 합니다. `pipx`로 직접 설치했다면 다음처럼
갱신합니다.

```powershell
pipx install --force "git+https://github.com/hungrytech/wikibrain.git@v0.1.8"
brainctl setup
brainctl doctor
pipx install --force "git+https://github.com/hungrytech/wikibrain.git@v0.1.9"
wikibrain setup
wikibrain doctor
```

`--version`, `status`, `doctor`, `setup`, `pause`, `forget`, `retention`,
Expand Down Expand Up @@ -362,7 +362,7 @@ tell me whether native Windows or WSL is the correct path for where my agents an
repositories run. Use the version-pinned installer from the README. Download it,
show me the full PowerShell script, explain the settings changed by initialization,
then stop and wait for my explicit approval before running the script or initializing
WikiBrain. After I approve, install it and finish by running brainctl doctor.
WikiBrain. After I approve, install it and finish by running wikibrain doctor.
Do not bypass Codex hook trust.
```

Expand All @@ -372,23 +372,23 @@ AI가 제시한 계획과 권한 요청을 확인한 뒤 진행하세요. 직접
```powershell
$installer = Join-Path $env:TEMP "install-wikibrain.ps1"
Invoke-WebRequest `
"https://raw.githubusercontent.com/hungrytech/wikibrain/v0.1.8/scripts/install-windows.ps1" `
"https://raw.githubusercontent.com/hungrytech/wikibrain/v0.1.9/scripts/install-windows.ps1" `
-OutFile $installer
Get-Content $installer
powershell.exe -NoProfile -ExecutionPolicy Bypass `
-File $installer -Initialize
```

설치 스크립트는 Python 3.11 이상을 사용하고 격리된 `pipx` 환경에 설치합니다.
`-Initialize`를 명시했을 때만 `brainctl init`을 실행합니다. 이 옵션을 빼면
`-Initialize`를 명시했을 때만 `wikibrain init`을 실행합니다. 이 옵션을 빼면
에이전트 설정을 바꾸지 않고 CLI만 설치합니다. 네이티브 Windows의 기본 저장
위치는 `%LOCALAPPDATA%\WikiBrain`입니다. 에이전트와 저장소가 WSL 안에서
실행된다면 WSL 내부의 Linux 설치 방법을 사용하세요.

<details>
<summary><strong>Codex hook 신뢰 경계</strong></summary>

수동 `brainctl remember`와 `brainctl recall`에는 hook 승인이 필요 없습니다.
수동 `wikibrain remember`와 `wikibrain recall`에는 hook 승인이 필요 없습니다.
하지만 자동 프롬프트 수집과 문맥 주입은 다릅니다. Codex는 사용자가 `/hooks`에서
현재 정의의 해시를 검토하기 전까지 관리되지 않는 command hook을 건너뜁니다.

Expand All @@ -399,19 +399,19 @@ WikiBrain은 `--dangerously-bypass-hook-trust`를 alias, wrapper, 실행 설정
대기 중인 hook 경고가 없는 수동 전용 설치:

```bash
brainctl init --clients codex --no-hooks
brainctl remember --global "오래 보관할 사실"
brainctl recall "그 사실"
wikibrain init --clients codex --no-hooks
wikibrain remember --global "오래 보관할 사실"
wikibrain recall "그 사실"
```

호스트의 전체 신뢰 모델은 공식
[Codex hook 문서](https://learn.chatgpt.com/docs/hooks)를 참고하세요.

</details>

### `brainctl init`이 바꾸는 내용
### `wikibrain init`이 바꾸는 내용

`brainctl init`은 여러 번 실행해도 중복 항목을 만들지 않습니다. 기존 설정을
`wikibrain init`은 여러 번 실행해도 중복 항목을 만들지 않습니다. 기존 설정을
백업하고 WikiBrain 소유 항목만 구조적으로 병합하며, 관계없는 hook과 skill은
보존합니다.

Expand All @@ -436,17 +436,17 @@ brainctl recall "그 사실"
WikiBrain 소유 연동만 검토하거나 제거할 수 있습니다.

```bash
brainctl init --dry-run --json
brainctl hooks status
brainctl hooks uninstall
brainctl skills uninstall
wikibrain init --dry-run --json
wikibrain hooks status
wikibrain hooks uninstall
wikibrain skills uninstall
```

### 개발용 설치

```bash
uv sync --locked
uv run brainctl init
uv run wikibrain init
uv run python -m unittest discover -s tests -v
```

Expand All @@ -455,20 +455,20 @@ uv run python -m unittest discover -s tests -v
## 자주 쓰는 명령

```bash
brainctl status
brainctl recall "인증 구조에 대해 어떤 결정을 내렸지?"
brainctl remember --title "선호 패키지 관리자" "Python 도구에는 uv를 사용한다."
brainctl remember --global "한국어로 간결하게 답하는 것을 선호한다."
brainctl remember --title "uv 사용" \
wikibrain status
wikibrain recall "인증 구조에 대해 어떤 결정을 내렸지?"
wikibrain remember --title "선호 패키지 관리자" "Python 도구에는 uv를 사용한다."
wikibrain remember --global "한국어로 간결하게 답하는 것을 선호한다."
wikibrain remember --title "uv 사용" \
--relates-to 근거-ID --supersedes 이전-ID "uv를 사용한다."
brainctl pause
brainctl resume
brainctl forget --document memory-ID # 미리보기
brainctl forget --document memory-ID --apply
brainctl forget --document memory-ID --cascade # 원본 세션 미리보기
brainctl forget --document memory-ID --cascade --apply
brainctl retention # 90일 지난 근거 정리 미리보기
brainctl retention --apply
wikibrain pause
wikibrain resume
wikibrain forget --document memory-ID # 미리보기
wikibrain forget --document memory-ID --apply
wikibrain forget --document memory-ID --cascade # 원본 세션 미리보기
wikibrain forget --document memory-ID --cascade --apply
wikibrain retention # 90일 지난 근거 정리 미리보기
wikibrain retention --apply
```

<a id="data-and-privacy"></a>
Expand All @@ -494,7 +494,7 @@ brainctl retention --apply
- 단기 근거를 명시적으로 forget하면 여기서 파생된 적응형 기억도 함께 지웁니다.
일반 memory 삭제는 해당 페이지만 지웁니다. source session 전체도 지우려면
`--cascade`로 영향을 확인한 뒤 같은 명령에 `--apply`를 추가하세요.
- `WIKIBRAIN_HOME` 또는 `brainctl --home PATH`로 저장 위치를 바꿀 수 있습니다.
- `WIKIBRAIN_HOME` 또는 `wikibrain --home PATH`로 저장 위치를 바꿀 수 있습니다.

Homebrew나 pipx에서 프로그램을 제거해도 별도 두뇌 디렉터리는 삭제되지 않습니다.

Expand Down
Loading
Loading