tomobit

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2026 License: AGPL-3.0

README

tomobit

Tomobit is not built to use AI. Tomobit is built to grow with it.

複数のコーディングAIの前に立ち、経験(Experience)からConnectionを育てる Living Harness。

English: README.en.md(正本はこの日本語版)

Getting Started

前提:

  • Go 1.26+
  • Provider CLI — claude(claude-code)/ codex の少なくとも一方が PATH にあること
  • 知覚バックエンド(任意・推奨)— Ollama または mlx-lm。 無くてもタスク実行はでき、知覚(Connectionを育てる素材の抽出)は保留と表示され、 後から tomobit perceive で追いつける。選択の背景は ADR-0029
git clone https://github.com/Rererr/tomobit.git && cd tomobit
go install ./cmd/tomobit ./cmd/tomobit-face   # tomobit-face は顔窓(無くても動く。警告1行で続行)
tomobit setup    # 対話式で配線を決める(claude profile / 知覚バックエンド / 顔窓) → ~/.tomobit/config.json
tomobit          # 相棒ビュー → そのまま対話へ。単発なら `tomobit do "..."`

do / chat の --provider の既定は auto — Tomoが台帳の経験から実行者を選ぶ (ADR-0043)。autoの候補になるのは実際に 起動できるProviderだけなので、codex未導入でもそのまま動く。--provider claude-code の 明示指定は今までどおり効く。

台帳は ~/.tomobit/tomobit.db に住む(経験主権 — ADR-0018)。 コマンド一覧は tomobit help。初期導入の設計は ADR-0021。

デスクトップGUIは別リポジトリ tomobit-gui。

Docs

思想
認知アーキテクチャ
実行アーキテクチャ
実装設計
意思決定の記録
  • ADR-0001 — Connectionの誕生モデル(粗→Split採用)

  • ADR-0002 — Surpriseの定義(超過surprisal)とSplit有意判定(補正付きln BF+ヒステリシス。Merge側の安全弁「誤Splitは減衰で静かに畳まれる」は減衰だけでは働かないと実測で判明 — ADR-0037)

  • ADR-0003 — Outcome三層信号、能力/好みの二重Connection、Tomoの質問

  • ADR-0004 — 技術選定(Go / SQLite真実と射影の分離 / Ollama+Deferred Perception / 段階的デーモン化。知覚バックエンド選択はADR-0029で一般化)

  • ADR-0005 — 知覚の実装(qwen3:8b確定 / schemaは「形」・プロンプトは「意味」)

  • ADR-0006 — Executor統合(tomobit do / claude-code Adapter / ダイジェスト記帳 / Feedback)

  • ADR-0007 — Curiosityの最初の器官(Preference GapはView / 質問予算はeventsから導出 / doの区切りでTomoの質問。発火条件(対人ゲート)はADR-0035が改定)

  • ADR-0008 — Tomoの姿(成長ステージはView / ドット絵=半ブロック+ANSI / 依存ゼロ — 端末描画はADR-0025で廃止)

  • ADR-0009 — Tomoの声(発話=Viewの写像 / LLM不使用 / 語調は確信度のView)

  • ADR-0010 — 2つ目のAdapter(codex / do --provider / 写像はエラー経路実採取+仕様準拠)

  • ADR-0011 — Meaning by Model, Judgment by Math(判断は純関数、LLMの座席はextractorのみ)

  • ADR-0012 — 決定則=Thompson Sampling(探索は好みの側で、ミスは構造になる。Decision 3の名誉回復は継承事前下で未解決 — ADR-0037実測/ADR-0038 Proposed)

  • ADR-0013 — 事前分布の継承(平均だけ継ぎ、確信は継がない)

  • ADR-0014 — Plan学習(台帳は賭ける対象を選ばない)

  • ADR-0015 — Reflection(第一級の器官、実体は射影、核は双方向性。発火条件(対人ゲート)はADR-0035が改定)

  • ADR-0016 — Curiosityの優先度=Value of Information

  • ADR-0017 — ステージ関数の改版(成長のゲートは量でなく較正度)

  • ADR-0018 — Experience Sovereignty(経験主権と、humanの台帳)

  • ADR-0019 — 相棒らしさは導出される(感情・儀式・個性は台帳のView)

  • ADR-0020 — Tomoの顔窓(窓は第二のレンダラである)

  • ADR-0021 — 初期導入(配線は経験ではない / config.json / tomobit setup。知覚配線の質問はADR-0029で拡張)

  • ADR-0022 — 対話セッション(会話は入力の器・タスクは記帳の単位 / ターンはスレッドを継ぐ / インラインの自前ラインエディタ)

  • ADR-0023 — タスク分割(Providerの分割提案はプロトコル / サブタスクは独立タスク / 実行者は親の選択方法を継ぐ — autoなら台帳が分配。opt-in --split と逐次のみはADR-0028が改定)

  • ADR-0024 — チャットUX(履歴永続化・Ctrl-R・Tab補完・markdown-lite描画・ツールdetailは表示専用チャネル — 出力そのものへの拡張はADR-0030)

  • ADR-0025 — 端末アバターの廃止と顔窓の自動起動(姿は窓に一本化 / 端末=声とテキスト / 顔窓は既定で出る・設定で止める)

  • ADR-0026 — A/B実走(好奇心が問いから比較実験へ / Tomoが「試していい?」と申し出てY/n・2Providerを並走・ユーザー判定をpreference経験化 / 顔窓は「考える」吹き出し⚪︎つなぎで可視化 — orchestrator化しない)

  • ADR-0027 — 顔窓の寿命(窓は対話が生きている間だけ居る=既定エフェメラル / 在席は~/.tomobit/sessions/<pid>.lockのflockで測る / 常駐はface_residentでオプトイン)

  • ADR-0028 — 判断ゼロの分割と並走(分割プロトコルは常時ON=判断は毎回Provider / 独立群はProviderが宣言・既定は逐次 / 並走だけ実行直前にy/Nで人が許す=コストは実測中央値 / chatは成果を親スレッドにfeedし親Providerが統合 / 子は客観信号のみ・主観Feedbackは区切りの親に1回)

  • ADR-0029 — 知覚バックエンドの選択(perceive.MLXLMをOllamaと並ぶExtractorとして追加 / mlx-lmは構造化出力が無くプロンプト+Go側検証で「形」を保証 / configはperceive_backend+バックエンド別URL・モデル / --backendフラグとextractor生成の1箇所集約 / setupはバックエンド選択→URL・モデル→診断)

  • ADR-0030 — Providerのツール出力を表示専用で受け取る(tool_resultは表示専用キーで運び台帳はR3不変 / mdliteに通さずSGRのみ通す=色は残しレイアウト破壊を防ぐ / 先頭優先で上限に切る / codexも対称。ターン総量はADR-0031が追補)

  • ADR-0031 — ターンのツール出力表示予算(per-result上限はNで積む洪水を縛れない / turnViewにターン累積予算=先頭優先のターンスケール拡張 / 予算切れは一度だけ省略行を出し以後沈黙・detail行と本文textは予算外 / 上限値は実stream計測で較正)

  • ADR-0032 — pipe chatのGUI一級市民化(chat --view ndjson=stdout全体をNDJSON viewストリームにするオプトイン・台帳はR3不変 / cookedの行継続=末尾\はrawの\+Enterと同じ意味論 / TOMOBIT_FACE=1の明示はpipeでも顔窓を出す=TTYゲートはenv沈黙時の既定へ改版・presenceも同条件)

  • ADR-0033 — 忘却の器官(忘却は主権の行使=人間の動詞・Tomoは提案も実行もしない / forget=物理削除+VACUUM・amend=人間による再知覚(追記) / 人の手が入ったセッションは再知覚しない / 直後に自動rebuildで射影整合。忘却の到達範囲(行単位か世代単位か)はADR-0034が改定)

  • ADR-0034 — 忘却の到達範囲(forget --idは指名行だけでなく同一(session,kind)の下位世代も削除し版数の巻き戻りを防ぐ / 現行世代でないidの指名はエラー / 巻き添え行数は+N superseded rowsで告知 — ADR-0033 Decision 2/5を改定)

  • ADR-0035 — 対人ゲートの改版(Tomoの質問・鏡の発火条件をisTTY(os.Stdin)からisTTY(os.Stdin) || --view ndjsonへ拡張しGUI経由でも境界の器官が届くようにする / 対人(humanPresent)と端末描画(c.interactive)の述語を分離 — ADR-0007/ADR-0015を改定)

  • ADR-0036 — 判断が読むトークン(判断はcap=1トークンしか読まず粒度1のConnectionとSplit子は到達不能だった / Decision 1は決定的に既知のsizeもトークンにする / Decision 2はタスク記述をextractorに通してlang/framework/topicを判断へ配線=遅延して1タスク1回・誰も読まないなら叩かない・期限ノブは置かない・判断の記録は抽出プロンプトから外す・事前知覚と事後知覚のズレは埋めず監査に残す)

  • ADR-0037 — 継承事前の下での名誉回復を試みるも実測で頓挫(μ<0.48の親から生まれた子は減衰しても悲観ゲートを通らず、選ばれないから経験も来ずmerge判定機会も来ない自己強化デッドロック / merge判定の到達性は修復したが、実測でln BFはThetaMerge=0へ「上から」漸近するのみで実質到達不能(約15年)と判明 — 名誉回復は未解決のままADR-0038へ引き継ぐ)

  • ADR-0038 — 継承事前下の能力ゲート(悲観ゲートの基準線をq−marginからmin(q, PriorQuantile(q))−marginへ一般化し、低いμを継いだ子の恒久ゲート落ちを解消 / 一様事前の根では今日と同一判定・継承事前でも今日より厳しくならない片側緩和 / 定数0.20は一様事前のq分位点を書き下したたまたまの値だった — ADR-0012 Decision 3の未解決点への回答、ADR-0037 Decision 1を改版)

  • ADR-0039 — 相棒ビューの機械可読view(tomobit status --view json でstage/mood/speakを1オブジェクトで出す / 台帳が無ければ作らずexists:false / 顔窓起動・挨拶記帳なし — GUIのstage移植570行を廃し、台帳を書くバイナリ自身が導出する。Proposed)

  • ADR-0040 — 判断の監査行をviewへ流す(tomo.decidedに記帳済みのCandidates〈分位点・ゲート・勝ち数〉をchat --view ndjsonのdecidedイベントとしても流し、GUIが「なぜこのProviderか」を開示可能にする / 声は不変・既定は畳む — ADR-0011根拠3の監査可能性を表示経路へ延伸。Proposed)

  • ADR-0041 — 順序外の知覚は正典に立ち返る(遅延知覚がlive射影を減衰重み1.0で汚し無期限に残る実測 / バッチが既知覚より古ければlive Applyを捨ててrebuild — forgetの自動rebuildと同じ姿勢。Proposed)

  • ADR-0042 — Splitの飢餓と辞書順の遮蔽(均衡混合でexcess surprisalが発火せず、同粒度tie-breakの辞書順でlang=系Connectionが系統的に読まれない — 11連敗Providerが最頻選択される実測 / 対案5件を実測で序列づけ、対案2「選ぶのは一つ、拒否は同粒度の全員」を先行適用。ADR-0013 Decision 2改版。所有者の追認待ち)

  • ADR-0043 — 既定をautoへ(実台帳41セッション全てclaude-code・tomo.decided 0件=判断の器官が既定経路で一度も呼ばれていない実測 / do・chatの--provider既定をautoにし、候補は起動できるProviderに限る=環境の不備をProviderの能力の証拠にしない / 起動できなかった実行は非ゼロ終了・経験にもしない / humanは知っている文脈でのみ候補 / GUIはProviderを明示的に持ち既定auto — ADR-0010 Decision 1・ADR-0018 Decision 2を改版。Accepted・配備済み)

  • ADR-0044 — Providerの残量観測(公式手段は無いが、自分のOAuthトークンでベンダー自身のusage端点を読む経路が実在する〈着想元CodexBar・MIT・独立実装〉— 所有者許可の下で実測済み・両端点200 / claudeの資格情報はプロファイル依存Keychain(サービス名=sha256(configDir)先頭8桁)・取り違えは401でなく429に化ける実測→エラーに資格情報の出所を必ず載せる / 経路A採用を推奨・PTYスクレイプとブラウザcookie読みとcodexbar依存は却下 / 取れないときは「不明」=推定値を出さない・決定則には混ぜない / curiosity予算への残量ゲートとquota.observed記帳は将来ADRへ保留。Accepted・経路A採用しstatus --view json/人間view/GUIへ配線済み・実端点疎通のみ所有者確認待ち)

  • ADR-0045 — 鋭さは選択肢が無ければ測れない(候補1つだとWobbleが構造的に常に0で「おとな」へ素通り・2Providerだと90セッションでも未到達の正反対の病理を合成dogfoodで実測 / 鋭さは競争のある島でのみ測る・較正判定に標本数を要求〈ThetaCalMin=8.0実測較正〉・S5「あいぼう」は自分との比較を知っていること — ADR-0017の3ゲートを精密化。Accepted・配備済み)

  • ADR-0046 — 次の段に何が足りないかを開示する(成長は段が変わる瞬間しか見えず、しかも3ゲートが同時に開いて段が踏まれない=育てている実感が生まれない / status --view jsonにgrowth〈各ゲートの値・閾値・充足〉を足し、測定不能と未達を別の顔で出す / 声は不変・見せ方はレンダラの裁量・既定は畳む — ADR-0040 Decision 2と同じ二層。Accepted・実装済み)

  • ADR-0047 — 働く場所は配線である(作業ディレクトリと読み取り先が claude 固有の env 経由でしか渡らず、codex を選ぶと無言で効かなくなっていた / executor.Request に WorkDir・AddDirs を持たせ cwd は Executor が落とし --add-dir は各 Adapter が翻訳・chat に /cd と /add-dir を追加〈他の配線と同じくタスク境界でだけ替わる〉 / 台帳には書かない — 配線は経験ではない。Accepted・実装済み)

  • ADR-0048 — 姿の機械可読view(第三のレンダラが姿を欲しがったが、資産を書き写せば正本が割れ internal/ は import できない — ADR-0039と同じ構造の問題 / tomobit-face --view json が格子・パレット・気分記号の座・アニメのノブを1オブジェクトで配り、窓も台帳も顔ロックも触らずに返る / 口は主CLIでなく顔窓側=資産を持つ者が配る・Ebiten依存を端末利用者へ伝播させない / 犬種は導出せず引数のまま — ADR-0020 Decision 5。Accepted・実装済み)

  • ADR-0049 — 沈黙は同意ではない(ADR-0044の「所有者許可の下で実測済み」は所有者の機械にしか及ばず、公開すると全員の機械で無言で走る / quota_observe を追加し他のポインタboolと非対称にnil=OFF=降格の事故より無言の実行の事故が重い / 無効時は行を出さず「不明」を使わない=訊いていないのにその語を出すとviewで唯一正直な言葉が嘘になる / setupの質問文にコストを書く=理解されていないopt-inは同意ではない / ADR-0044は撤回せず既定値だけを変える・既存の機械も一度OFFに落ちる=自分の機械にも同じ規則を適用する。Accepted・実装済み)

貢献 / セキュリティ

  • CONTRIBUTING.md — CLAは採りません(DCO / git commit -s)。 設計に関わる変更はADRのドラフトから
  • SECURITY.md — 脆弱性の非公開報告と、このソフトウェアが触るもの

License

コードと文書で分けています。

対象 ライセンス
docs/ 以下の文書、README.md、VISION.ja.md CC BY-SA 4.0
上記以外のすべて(Goコード・テスト・tools/・スプライト資産) AGPL-3.0-only

© 2026 Rererr

文書を分けているのは、このプロジェクトで最も時間がかかっているのが コードではなく設計の記録だからです。理由は docs/LICENSE.md に書いています。

ライセンスは再実装を止めません(著作権が守るのは表現であってアイデアではない)。 この設計を読んで、別の言語で、別の名前で、もっと良いものを作るのは歓迎します。 そのときこの記録を参照してもらえれば、目的は果たされています。

Citation

設計を参照・引用する場合は CITATION.cff を使ってください (GitHubの "Cite this repository" から各形式で取得できます)。

Directories

Path Synopsis
cmd
tomobit command
tomobit chat — the conversational session (ADR-0022).
tomobit chat — the conversational session (ADR-0022).
tomobit-face command
tomobit-face — Tomo's face window: a display-only second renderer over the same SQLite truth (ADR-0020).
tomobit-face — Tomo's face window: a display-only second renderer over the same SQLite truth (ADR-0020).
internal
config
Package config is the machine-local wiring file (ADR-0021): which Claude profile runs, where the truth DB lives, which local perception server (Ollama / MLX LM, ADR-0029) serves perception.
Package config is the machine-local wiring file (ADR-0021): which Claude profile runs, where the truth DB lives, which local perception server (Ollama / MLX LM, ADR-0029) serves perception.
core
Package core implements the Connection Engine: decaying Beta posteriors, the surprise ledger, and the split/merge judgment (ADR-0001..0003).
Package core implements the Connection Engine: decaying Beta posteriors, the surprise ledger, and the split/merge judgment (ADR-0001..0003).
curiosity
Package curiosity derives Tomo's questions from the Knowledge Network.
Package curiosity derives Tomo's questions from the Knowledge Network.
decide
Package decide implements the Decision Engine (ADR-0012): a deterministic capability gate on the pessimistic posterior quantile, then Thompson Sampling on the preference side.
Package decide implements the Decision Engine (ADR-0012): a deterministic capability gate on the pessimistic posterior quantile, then Thompson Sampling on the preference side.
executor
Package executor runs a provider CLI as a child process and turns its stream into canonical events (ADR-0006).
Package executor runs a provider CLI as a child process and turns its stream into canonical events (ADR-0006).
executor/claudecode
Package claudecode adapts the Claude Code CLI (`claude -p ...
Package claudecode adapts the Claude Code CLI (`claude -p ...
executor/codex
Package codex adapts the Codex CLI (`codex exec --json`) to the executor's canonical events (ADR-0010 Decision 3).
Package codex adapts the Codex CLI (`codex exec --json`) to the executor's canonical events (ADR-0010 Decision 3).
face
Package face derives Tomo's growth stage and mood as a View over the Knowledge Network (ADR-0008).
Package face derives Tomo's growth stage and mood as a View over the Knowledge Network (ADR-0008).
facelock
Package facelock guards against a second face window: the mascot is one per machine (ADR-0025 Decision 2), not one per DB.
Package facelock guards against a second face window: the mascot is one per machine (ADR-0025 Decision 2), not one per DB.
facewin
Package facewin is the face window — a second, display-only renderer over the same SQLite truth (ADR-0020).
Package facewin is the face window — a second, display-only renderer over the same SQLite truth (ADR-0020).
lineedit
Package lineedit is Tomobit's inline line editor (ADR-0022 Decision 3).
Package lineedit is Tomobit's inline line editor (ADR-0022 Decision 3).
mdlite
Package mdlite prepares a provider's output for a terminal.
Package mdlite prepares a provider's output for a terminal.
perceive
Package perceive turns Sessions (event streams) into Experiences.
Package perceive turns Sessions (event streams) into Experiences.
plan
Package plan implements Plan learning (ADR-0014): plans are a closed menu of capability sequences — the ledger's second bet target.
Package plan implements Plan learning (ADR-0014): plans are a closed menu of capability sequences — the ledger's second bet target.
presence
Package presence answers one question for the face window: "is any tomobit conversation alive on this machine right now?" (ADR-0027).
Package presence answers one question for the face window: "is any tomobit conversation alive on this machine right now?" (ADR-0027).
quota
Package quota reads each provider's own usage endpoint with the user's own OAuth token (ADR-0044 Decision 1).
Package quota reads each provider's own usage endpoint with the user's own OAuth token (ADR-0044 Decision 1).
reflection
Package reflection is the organ that mirrors Tomo's discoveries back to the human (ADR-0015): Curiosity learns for Tomo, Tomo's question asks for Tomo — Reflection alone exists so the *user* grows.
Package reflection is the organ that mirrors Tomo's discoveries back to the human (ADR-0015): Curiosity learns for Tomo, Tomo's question asks for Tomo — Reflection alone exists so the *user* grows.
store
Package store implements SCHEMA.md v1.0 on SQLite: append-only truth (events, experiences), rebuildable projections (connections, surprise_ledger), and persistent working state (curiosity_queue).
Package store implements SCHEMA.md v1.0 on SQLite: append-only truth (events, experiences), rebuildable projections (connections, surprise_ledger), and persistent working state (curiosity_queue).
subtask
Package subtask implements the split-proposal protocol (ADR-0023, always-on since ADR-0028): every `do` target run carries the protocol, and a Provider that judges the task too large returns a small JSON marker instead of doing the work.
Package subtask implements the split-proposal protocol (ADR-0023, always-on since ADR-0028): every `do` target run carries the protocol, and a Provider that judges the task too large returns a small JSON marker instead of doing the work.
voice
Package voice renders Tomo's spoken lines (ADR-0009): deterministic Go templates over Connection/Experience/Stage Views, no LLM.
Package voice renders Tomo's spoken lines (ADR-0009): deterministic Go templates over Connection/Experience/Stage Views, no LLM.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL