Skip to content
Merged
Show file tree
Hide file tree
Changes from 104 commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
d6a0942
feat(config): transactional setup persistence + secret redaction (#3410)
claude Jun 30, 2026
cf0f47a
feat(config): unified setup-state model + constitution fields (#3403)
claude Jun 30, 2026
ffa384d
feat(config): structured user-global constitution + deterministic ren…
claude Jun 30, 2026
120882d
test(config): bind must_use render_block result in constitution test
claude Jun 30, 2026
e068156
feat(tui): inject user-global constitution prompt block
Hmbown Jun 30, 2026
4b46985
feat(tui): add constitution-first setup wizard shell
Hmbown Jul 1, 2026
185cea4
fix(tui): hide setup test helper from release builds
Hmbown Jul 1, 2026
2b75ab3
feat(tui): add constitution manager command
Hmbown Jul 1, 2026
f66267a
feat(tui): add setup readiness cards
Hmbown Jul 1, 2026
489b0ce
fix(tui): retire WHALE.md context fallback
Hmbown Jul 1, 2026
4539e6c
feat(tui): add setup verification report
Hmbown Jul 1, 2026
12e0f56
feat(tui): add guided constitution preset save
Hmbown Jul 1, 2026
0950f10
docs: center constitution management surface
Hmbown Jul 1, 2026
526ba16
docs(tui): clarify Ctrl+B shell wait wording
Hmbown Jul 1, 2026
93d67cc
chore(tui): remove ignored mock LLM placeholders
Hmbown Jul 1, 2026
ab88768
chore(tui): remove stale project_doc loader
Hmbown Jul 1, 2026
3c98188
chore(tui): trim dead model catalog helpers
Hmbown Jul 1, 2026
8c5c671
chore(tui): remove legacy flash auto-router
Hmbown Jul 1, 2026
e6a2878
chore(tui): remove dormant tab subsystem
Hmbown Jul 1, 2026
b174dc4
fix(tui): keep sub-agent tool catalogs in parent parity
Hmbown Jul 1, 2026
77e326b
fix(tui): reconcile sub-agent terminals live
Hmbown Jul 1, 2026
9e1aef9
feat(tui): ship hotbar route editor
Hmbown Jul 1, 2026
ed87ef1
feat(tui): target custom model routes
Hmbown Jul 1, 2026
2a03194
fix(tui): persist setup skip retry state
Hmbown Jul 1, 2026
1627bbd
test(tui): stabilize hotbar route keyboard fixture
Hmbown Jul 1, 2026
f51af1b
fix(tui): hand first-run onboarding into setup
Hmbown Jul 1, 2026
2021ba4
feat(tui): surface constitution actions in diagnostics
Hmbown Jul 1, 2026
abce799
docs: add v0.8.67 setup qa matrix
Hmbown Jul 1, 2026
9006cc4
feat(tui): preview guided constitution before save
Hmbown Jul 1, 2026
e28e7d8
feat(tui): add guided constitution answer draft
Hmbown Jul 1, 2026
9c68c0f
feat(tui): show constitution file state in setup
Hmbown Jul 1, 2026
dae0d42
test(tui): cover setup modal blocker sizes
Hmbown Jul 1, 2026
8fc3281
fix(tui): keep guided constitution fixture test-only
Hmbown Jul 1, 2026
32eefe3
feat(tui): localize constitution manager body
Hmbown Jul 1, 2026
f299702
fix(tui): alias auto mode to agent policy
Hmbown Jul 1, 2026
b6fbe44
feat(tui): add guided constitution principles
Hmbown Jul 1, 2026
2311029
feat(tui): hand setup provider card to route pickers
Hmbown Jul 1, 2026
38ed6cd
feat(tui): hand setup runtime card to mode config
Hmbown Jul 1, 2026
40ab62f
fix(tui): keep review-only turns read-only
Hmbown Jul 1, 2026
a6a4e12
feat(tui): report constitution and runtime posture
Hmbown Jul 1, 2026
5565e3f
feat(tui): apply setup runtime presets
Hmbown Jul 1, 2026
814cbf0
feat(tui): warn setup runtime project overrides
Hmbown Jul 1, 2026
1af696b
fix(tui): derive Default for SetupRuntimePreset
claude Jul 1, 2026
49e4620
fix(tui): restore auto-review safety floor
Hmbown Jul 1, 2026
5bc921a
feat(tui): add constitution repair guidance
Hmbown Jul 1, 2026
ec67ec7
fix(tui): persist sub-agent state to .codewhale/ instead of .deepseek/
yekern Jul 1, 2026
01f458c
fix(tui): show mode-derived safety policy in status
cyq1017 Jul 1, 2026
78e6aff
fix(tui): update setup status copy
Hmbown Jul 1, 2026
8acb119
chore(tui): remove unused approval cache container
nightt5879 Jul 1, 2026
4235b66
fix(tui): center first-run follow-up on constitution
Hmbown Jul 1, 2026
3509fe2
fix(tui): improve ask-rules diagnostics
greyfreedom Jul 1, 2026
5dde626
docs: record setup evidence snapshot
Hmbown Jul 1, 2026
3127172
feat(runtime-api): add GUI config persistence
gaord Jun 29, 2026
377ac4a
fix(update): prefer exact binary release assets
LI-Jialu Jul 1, 2026
0effc4c
feat(tui): add custom provider setup form
Hmbown Jul 1, 2026
dc05cab
fix(tui): stack model picker panes on narrow modals
Hmbown Jul 1, 2026
4056e7d
fix(tui): add provider picker detail layout
Hmbown Jul 1, 2026
4350ac7
docs(tui): clarify hotbar help shortcuts
roian6 Jun 29, 2026
50f9c13
test(tui): serialize pdf config-path test on shared env lock
Hmbown Jul 1, 2026
57b51a9
test(tui): cover setup wizard back navigation keys
Hmbown Jul 1, 2026
6c4839c
fix(tui): scope context menu backdrop to the popup rect
Hmbown Jul 1, 2026
deff09a
test(config): wire ConfigStore body through setup transactions
Hmbown Jul 1, 2026
2ddf711
feat(tui): detect half-applied setup state in doctor
Hmbown Jul 1, 2026
1c6160b
docs(evidence): document zh-Hant setup localization fallback
Hmbown Jul 1, 2026
3590773
test(tui): pin config command tests to agent mode
Hmbown Jul 1, 2026
edac179
feat(config): add untrusted constitution draft gate and authoring pro…
Hmbown Jul 2, 2026
8bd23dc
feat(tui): let the first configured model draft the constitution for …
Hmbown Jul 2, 2026
fa7c4b0
fix(subagent): bound worker output so Fleet fanout cannot exhaust TUI…
Hmbown Jul 2, 2026
4d9199f
docs(evidence): record model-assisted constitution drafting coverage
Hmbown Jul 2, 2026
0089874
feat(tui): give constitution-first setup its ritual voice
Hmbown Jul 2, 2026
b58dcf9
fix(subagent): surface the real Responses API error in failure records
Hmbown Jul 2, 2026
b4ca8b5
fix(tui): stop the durable-review floor from holding routine YOLO work
Hmbown Jul 2, 2026
1997147
docs(evidence): add failed-health and legacy-config rows to the setup…
Hmbown Jul 2, 2026
e1fc91d
docs(evidence): record release-orchestration gate snapshot at 19971477a
Hmbown Jul 2, 2026
d46047a
feat(tui): let updating users keep their existing constitution unchanged
Hmbown Jul 2, 2026
ed6b21b
feat(tui): make the approval prompt calm, compact, and honest
Hmbown Jul 2, 2026
41d26c7
perf(tui): stop boot janitors and store scans from blocking the first…
Hmbown Jul 2, 2026
c570620
perf(tui): stop @mention completion from re-walking the workspace per…
Hmbown Jul 2, 2026
7f82737
perf(tui): add startup milestone tracing
Hmbown Jul 2, 2026
28efab3
feat(web): live star badge, live version, trimmed top nav
Hmbown Jul 2, 2026
5a38e20
feat(web): terminal player for the real constitution traces
Hmbown Jul 2, 2026
d3d1d5e
feat(web): rewrite homepage hero around the constitution
Hmbown Jul 2, 2026
a429f82
test(tui): pin route identity in UI test apps for hermeticity
Hmbown Jul 2, 2026
d73875b
feat(tui): let the model draft fleet profiles behind the ratify gate
Hmbown Jul 2, 2026
e160b50
docs(evidence): record overnight enhancement-pass snapshot at d73875b7a
Hmbown Jul 2, 2026
d14d82f
feat(web): constitution thesis page and homepage three-layers section
Hmbown Jul 2, 2026
22e5adb
chore(tui): silence unused recovered binding in task_manager test
Hmbown Jul 2, 2026
cc7be76
chore(tui): prune dead fleet runtime compatibility helpers
Hmbown Jul 2, 2026
00c38ae
feat(web): models page generated from the provider registry
Hmbown Jul 2, 2026
4481d8d
chore(tui): remove unused execpolicy amend module and reexports
Hmbown Jul 2, 2026
c13254d
chore(tui): trim dead MCP/client retry helpers
Hmbown Jul 2, 2026
48926db
chore(tui): remove dead QA harness helpers and facade reexports
Hmbown Jul 2, 2026
54c1c13
feat(tui): enforce repo-law protected invariants as mechanism, and cl…
Hmbown Jul 2, 2026
16a8d89
fix(tui): address ultracode review findings — janitor races, fleet-dr…
Hmbown Jul 2, 2026
5ff1189
test(tui): close ultracode-flagged test-adequacy gaps
Hmbown Jul 2, 2026
7cd5ccf
fix(tui): stop the fleet-profile model draft from freezing the event …
Hmbown Jul 2, 2026
1ccc2fe
fix(tui): stop misleading success toasts and leaking debug/jargon copy
Hmbown Jul 2, 2026
18914a4
feat(tui): hand off to provider key entry on a missing-auth route swi…
Hmbown Jul 2, 2026
3e8bee5
test(evidence): add headless setup-lane QA probe script
Hmbown Jul 2, 2026
f9c0920
fix(tui): remove issue-number leaks and dead-end empty states
Hmbown Jul 2, 2026
137b74c
feat(web): community hub + homepage non-goals
Hmbown Jul 2, 2026
abfaed7
fix(tui): stop the constitution model draft from freezing the event loop
Hmbown Jul 2, 2026
d0de164
feat(web): dark mode for the docs routes
Hmbown Jul 2, 2026
952d0ee
docs(evidence): record overnight review + hardening snapshot at 44eb7…
Hmbown Jul 2, 2026
2cf05fc
feat(web): give docs routes full SEO metadata and list them in the si…
Hmbown Jul 2, 2026
4f6d062
fix(web): point the Community nav link at the community hub
Hmbown Jul 2, 2026
4820217
docs: document enforced repo-law invariants and constitution flow
Hmbown Jul 2, 2026
625b19d
docs: document /fleet setup profile-authoring wizard
Hmbown Jul 2, 2026
18c5e8e
fix(tui): close repo-law + safety-floor bypasses found by adversarial…
Hmbown Jul 2, 2026
a64d01f
fix(tui): finish the adversarial-review follow-ups (fail-closed guard…
Hmbown Jul 2, 2026
3fbdc27
perf(tui): skip idle offline-queue clone and hash tool output once
Hmbown Jul 2, 2026
a28d8d4
fix(tui): gate the string-keyed output-rows cache helper to tests
Hmbown Jul 2, 2026
70c4978
docs(rebrand): document Homebrew rollout strategy and add distributio…
idling11 Jun 29, 2026
59b1ef9
chore(tui): remove unused model registry helpers
cyq1017 Jul 2, 2026
451cd35
chore(cleanup): remove unused request tuning metadata
cyq1017 Jul 2, 2026
a41db7b
feat(i18n): define localization matrix with locale registry and drift…
idling11 Jul 2, 2026
0d0bfc3
docs(changelog): credit v0.8.67 community harvests in [Unreleased]
Hmbown Jul 2, 2026
3b58fbd
docs(changelog): sync crates/tui slice after harvest-credit entries
Hmbown Jul 2, 2026
9357645
docs(evidence): record PR-push + community-harvest snapshot
Hmbown Jul 2, 2026
e7303e9
fix(execpolicy): make deny/trust rules segment-aware (close the chain…
Hmbown Jul 2, 2026
007aa67
fix(tui): web_run open/click is destructive; allow-list gains wildcar…
Hmbown Jul 2, 2026
cee3874
fix(tui): fail closed for a catalog-present tool with no execution path
Hmbown Jul 2, 2026
e2891e9
fix(tui): preserve pins on emergency compaction, harden summary fallb…
Hmbown Jul 2, 2026
d4107f2
fix(tui): correct backtrack boundary, checkpoint clear ordering, prun…
Hmbown Jul 2, 2026
5582cb8
docs(tui): drop stale centered-takeover comment above inline_region_for
Hmbown Jul 2, 2026
2c43a67
fix(client): stop corrupting multibyte UTF-8 split across network reads
Hmbown Jul 2, 2026
c9012f7
fix(client): flush final SSE frame and join multi-line data fields
Hmbown Jul 2, 2026
de610b2
fix(mcp): close SSE-endpoint SSRF, UTF-8 corruption, unbounded buffer…
Hmbown Jul 2, 2026
c74aa40
fix(mcp): bound HTTP body and stdio line reads (OOM DoS)
Hmbown Jul 2, 2026
c526cff
fix(tools): stop apply_patch mangling newlines; default fuzz to 3; at…
Hmbown Jul 2, 2026
0564262
fix(mcp): bound HTTP body via Content-Length, not a streaming read
Hmbown Jul 2, 2026
389446e
chore(gitignore): never track agent-local .agents/ and scratchpad/
Hmbown Jul 2, 2026
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
3 changes: 3 additions & 0 deletions .github/AUTHOR_MAP
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ nightt5879 = nightt5879 <87569709+nightt5879@users.noreply.github.com>
Liu-Vince = Liu-Vince <56624166+Liu-Vince@users.noreply.github.com>
Vince = Liu-Vince <56624166+Liu-Vince@users.noreply.github.com>
liuwenchang.x@qq.com = Liu-Vince <56624166+Liu-Vince@users.noreply.github.com>
LI-Jialu = LI-Jialu <55438527+LI-Jialu@users.noreply.github.com>
JiarenWang = JiarenWang <33421508+JiarenWang@users.noreply.github.com>
wdw8276 = wdw8276 <3972439+wdw8276@users.noreply.github.com>
pengyou200902 = pengyou200902 <35026241+pengyou200902@users.noreply.github.com>
Expand Down Expand Up @@ -113,6 +114,8 @@ tdccccc = tdccccc <79492752+tdccccc@users.noreply.github.com>
greyfreedom = greyfreedom <11493871+greyfreedom@users.noreply.github.com>
greyfreedom@163.com = greyfreedom <11493871+greyfreedom@users.noreply.github.com>
puneetdixit200 = puneetdixit200 <236133619+puneetdixit200@users.noreply.github.com>
roian6 = Chanhyo Jung <23256775+roian6@users.noreply.github.com>
roian6@naver.com = Chanhyo Jung <23256775+roian6@users.noreply.github.com>
yekern = Stime <13691766+yekern@users.noreply.github.com>
Stime = Stime <13691766+yekern@users.noreply.github.com>
pkeging = pkeging <237035657+pkeging@users.noreply.github.com>
Expand Down
9 changes: 5 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
gate: `cargo test --workspace`. Release build:
`cargo build --release -p codewhale-cli -p codewhale-tui`.
- **Known suite papercuts (pre-existing, not regressions):**
`config_command_allow_shell_*` fail on machines whose `~/.codewhale/settings.toml`
sets `default_mode = "yolo"` (the tests aren't hermetic); `run_verifiers_background_*`
is flaky under full-suite parallelism but passes in isolation. Don't treat
these as caused by your change.
`run_verifiers_background_*` is flaky under full-suite parallelism but passes
in isolation. Don't treat it as caused by your change. (The old
`config_command_allow_shell_*` failures on machines with
`default_mode = "yolo"` were fixed by pinning the command-test app to
Agent mode.)

## Continuous agent work conventions

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions README.ja-JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,12 @@ DeepSeek API は広めに、サブスクリプション型や rate-limit のあ
次に必要なのは法です。実際の作業セッションは衝突の積み重ねです: 現在のリクエスト、リポジトリの指示、新しい Shell 出力、古い記憶、前のエージェントの引き継ぎが、同じターンの中で競合します。**CodeWhale Constitution** は権威の順序を固定します:

1. **ユーザーの意図が主権を持つ。** 現在のリクエストは、古いリポジトリの指示、記憶、過去の引き継ぎ、人格オーバーレイより上位です。
2. **リポジトリの法は明示する。** `.codewhale/constitution.json` を追加して、プロジェクトの持続的な権威を宣言します: 保護すべき不変条件、ブランチポリシー、検証ルール。
3. **証拠は語りより上。** ツール出力は、自信たっぷりの推測に勝ちます。失敗した `cargo test` は失敗した `cargo test` として報告され、楽観へ要約されることはありません。検証はタスクの一部であり、後日談ではありません。
4. **記憶は最後。** 有用ですが、決して権威にはなりません。
2. **ユーザーグローバル constitution は `/constitution` で管理する。** 通常のセットアップは構造化された個人の常設法を `$CODEWHALE_HOME/constitution.json` に保存し、モデル向けの prose block としてレンダリングします。生の prompt エディタではありません。
3. **リポジトリの法は明示する。** `.codewhale/constitution.json` を追加して、プロジェクトの持続的な権威を宣言します: 保護すべき不変条件、ブランチポリシー、検証ルール。
4. **証拠は語りより上。** ツール出力は、自信たっぷりの推測に勝ちます。失敗した `cargo test` は失敗した `cargo test` として報告され、楽観へ要約されることはありません。検証はタスクの一部であり、後日談ではありません。
5. **記憶は最後。** 有用ですが、決して権威にはなりません。

重要なポリシーはプロンプトではなくコードで強制されます: 承認ゲート、サンドボックス、スナップショット、ロールバック、ツールスキーマは、モデルが口先で回避できないランタイムの仕組みです。
重要なポリシーはプロンプトではなくコードで強制されます: 承認ゲート、サンドボックス、スナップショット、ロールバック、ツールスキーマは、モデルが口先で回避できないランタイムの仕組みです。Constitution は好みを表現できますが、承認、サンドボックス、ネットワーク、信頼、MCP 権限を黙って変更しません。

そして、この法はどれもモデルの中には住んでいません — だからこそモデルは交換可能なのです。ハーネスが Constitution を担い、モデルは推論を提供します。DeepSeek とオープンウェイトの世界は第一級市民であり、LAN 上で vLLM や Ollama を動かす一台のマシンも完全に対等な存在です。そして手元にあるのが Claude や OpenAI のキーなら、CodeWhale はそれらの API にもネイティブ対応します。

Expand All @@ -140,7 +141,7 @@ README は考え方と最初の経路だけを持ちます。詳細はドキュ

- [User guide](docs/GUIDE.md) — CodeWhale との最初の 1 時間。
- [Install guide](docs/INSTALL.md) — すべてのパッケージ経路とトラブルシューティング。
- [Configuration](docs/CONFIGURATION.md) — 設定ファイル、リポジトリ constitution、プロバイダ設定。
- [Configuration](docs/CONFIGURATION.md) — `/constitution`、ユーザーグローバル constitution、リポジトリ constitution、プロバイダ設定。
- [Provider registry](docs/PROVIDERS.md) — モデルルート、認証情報、base URL、能力の境界。
- [Sub-agents](docs/SUBAGENTS.md) — 役割、ライフサイクル、出力コントラクト、復旧挙動。
- [MCP](docs/MCP.md) — 外部ツールサーバーへの接続と、CodeWhale 自身を MCP サーバーとして動かす方法。
Expand Down
12 changes: 9 additions & 3 deletions README.ko-KR.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,17 +247,23 @@ CodeWhale은 파일을 편집하고 명령을 실행하므로, 안전 태세는

1. **전역 헌장** — 모든 바이너리에 컴파일되는 기본 법입니다. 그
우선순위 조항은 모든 충돌에 대한 권한 순서를 고정합니다.
2. **프로젝트의 법** — 저장소에 `.codewhale/constitution.json`을 두어
2. **사용자 전역 헌장** — `/constitution`과 `/setup`에서 관리하며,
`$CODEWHALE_HOME/constitution.json`에 구조화된 데이터로 저장되고
모델이 읽는 prose block으로 렌더링됩니다. 일반 설정 경로이며 원시
프롬프트 편집기가 아닙니다.
3. **프로젝트의 법** — 저장소에 `.codewhale/constitution.json`을 두어
`protected_invariants`, `branch_policy`, `verification_policy`,
`escalate_when`을 선언합니다. 이는 메모리와 핸드오프보다 위에 있는
독립 권한 블록으로 로드됩니다.
3. **현재 요청** — 이번 턴에서 작동하는 지시사항입니다.
4. **실시간 증거** — 도구가 실제로 반환한 내용입니다. 정답 기준이며,
4. **현재 요청** — 이번 턴에서 작동하는 지시사항입니다.
5. **실시간 증거** — 도구가 실제로 반환한 내용입니다. 정답 기준이며,
모델은 그 너머로 지시받을 수는 있지만 존재하지 않는 사실을 보고해서는
안 됩니다.

두 지시사항이 충돌하면 각각은 위에 있는 것에 양보합니다. 이 법은 모델이
아니라 하네스 안에 있으므로, 모델을 바꿔도 구조는 그대로 유지됩니다.
헌장 텍스트는 선호를 표현할 수 있지만 승인, 샌드박스, 네트워크, 신뢰,
MCP 권한 같은 런타임 보안 설정을 조용히 바꾸지는 않습니다.

## 세부 정보 위치

Expand Down
35 changes: 24 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,18 +234,31 @@ of vibes.
The system prompt is layered, most-static first, and the order is enforced in
code (there are tests asserting it can't drift):

1. **Global constitution** — the base law, compiled into every binary. Its
priority article fixes the authority order for any conflict.
2. **Your project's law** — drop a `.codewhale/constitution.json` in a repo to
1. **Bundled global Constitution** — the base law, compiled into every binary.
Its priority article fixes the authority order for any conflict.
2. **Your user-global constitution** — managed through `/constitution` and
`/setup`, saved as structured data under `$CODEWHALE_HOME/constitution.json`,
and rendered into a separate model-facing prose block. It is normal guided
setup output, not a raw prompt editor.
3. **Your project's law** — drop a `.codewhale/constitution.json` in a repo to
declare `protected_invariants`, `branch_policy`, `verification_policy`, and
`escalate_when`. It's loaded as its own authority block, above memory and
handoffs.
3. **Your current request** — the operative instruction this turn.
4. **Live evidence** — what the tools actually returned. Ground truth; the model
may be ordered past it, but it may never report a fact that isn't there.

When two instructions conflict, each yields to the one above. Because the law
lives in the harness, not the model, swapping models keeps the structure intact.
`escalate_when`. It's loaded as its own repo-local authority block, above
project instructions, memory, and handoffs.
4. **Project instructions** — `AGENTS.md` and compatibility fallbacks explain
how agents should work in this repo.
5. **Memory and handoffs** — useful recalled state, lower authority than
constitution layers and project instructions.

Your current request and live tool evidence still control the active turn: the
model may be given many layers, but it may never report a fact that the tools did
not return. Runtime approval, sandbox, network, and trust controls are enforced
in code and are not changed by constitution text.

There is also an expert-only full base-prompt override at
`$CODEWHALE_HOME/prompts/constitution.md` behind an explicit opt-in flag. It is
not the normal guided setup path. When two instructions conflict, each yields to
the higher authority layer. Because the law lives in the harness, not the model,
swapping models keeps the structure intact.

## Where details live

Expand Down
18 changes: 12 additions & 6 deletions README.vi.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,18 +181,24 @@ của CodeWhale** cố định thứ tự quyền lực:

1. **Ý định người dùng là tối thượng.** Yêu cầu hiện tại của bạn đứng trên
hướng dẫn repo đã cũ, memory, handoff trước đó và các lớp personality.
2. **Luật của repo phải tường minh.** Thêm `.codewhale/constitution.json` để
2. **Constitution toàn cục của người dùng được quản lý bằng `/constitution`.**
Setup bình thường lưu luật cá nhân bền vững ở dạng dữ liệu có cấu trúc trong
`$CODEWHALE_HOME/constitution.json`, rồi render thành prose block cho model;
đây không phải trình sửa prompt thô.
3. **Luật của repo phải tường minh.** Thêm `.codewhale/constitution.json` để
khai báo quyền lực bền vững của dự án: các bất biến cần bảo vệ, chính sách
branch, quy tắc kiểm chứng.
3. **Bằng chứng đứng trên lời kể.** Output của công cụ thắng một phỏng đoán
4. **Bằng chứng đứng trên lời kể.** Output của công cụ thắng một phỏng đoán
tự tin. `cargo test` thất bại được báo cáo đúng là `cargo test` thất bại,
không bao giờ bị tóm tắt thành lạc quan. Kiểm chứng là một phần của nhiệm
vụ, không phải phần vĩ thanh.
4. **Memory xếp cuối.** Hữu ích, nhưng không bao giờ có thẩm quyền.
5. **Memory xếp cuối.** Hữu ích, nhưng không bao giờ có thẩm quyền.

Phần chính sách quan trọng được thực thi bằng code, không phải bằng prompt:
cổng phê duyệt, sandbox, snapshot, rollback và schema công cụ là các cơ chế
runtime mà model không thể nói khéo để lách qua.
runtime mà model không thể nói khéo để lách qua. Constitution có thể diễn đạt
preference, nhưng không âm thầm đổi approval, sandbox, network, trust hoặc
quyền MCP.

Và không phần nào của bộ luật đó nằm trong model — vì thế model mới thay
được. Harness mang constitution; model cung cấp khả năng suy luận. DeepSeek
Expand All @@ -210,8 +216,8 @@ trên [codewhale.net](https://codewhale.net/):

- [User guide](docs/GUIDE.md) — giờ đầu tiên với CodeWhale.
- [Install guide](docs/INSTALL.md) — mọi đường cài đặt và troubleshooting.
- [Configuration](docs/CONFIGURATION.md) — file cấu hình, constitution của
repo và cài đặt provider.
- [Configuration](docs/CONFIGURATION.md) — `/constitution`, constitution toàn
cục của người dùng, constitution của repo và cài đặt provider.
- [Provider registry](docs/PROVIDERS.md) — đường model, credentials, base URL
và ranh giới năng lực.
- [Sub-agents](docs/SUBAGENTS.md) — vai trò, vòng đời, hợp đồng output và
Expand Down
14 changes: 9 additions & 5 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,18 @@ codewhale exec --allowed-tools read_file,exec_shell --max-turns 10 "fix the fail

1. **用户意图至上。** 你当前的请求高于过期的仓库指引、记忆、先前的交接和
人格叠加层。
2. **仓库法律必须显式。** 添加 `.codewhale/constitution.json`,声明项目的
2. **用户全局宪法由 `/constitution` 管理。** 正常设置会把结构化个人常驻法写到
`$CODEWHALE_HOME/constitution.json`,再渲染成模型可读的 prose block;这不是裸
prompt 编辑器。
3. **仓库法律必须显式。** 添加 `.codewhale/constitution.json`,声明项目的
持久权威:受保护的不变量、分支策略、验证规则。
3. **证据高于叙述。** 工具输出胜过自信的猜测。`cargo test` 失败就如实报告
4. **证据高于叙述。** 工具输出胜过自信的猜测。`cargo test` 失败就如实报告
`cargo test` 失败,绝不被总结成乐观措辞。验证是任务的一部分,不是尾声。
4. **记忆排在最后。** 有用,但永不具备权威。
5. **记忆排在最后。** 有用,但永不具备权威。

真正起作用的策略由代码强制执行,而非靠提示词:审批门、沙箱、快照、回滚和
工具 schema 都是模型无法靠话术绕过的运行时机制。
工具 schema 都是模型无法靠话术绕过的运行时机制。宪法可以表达偏好,但不会静默
改变审批、沙箱、网络、信任或 MCP 权限。

而这些法律没有一条住在模型里——这正是模型可以随时更换的原因。运行框架承载
宪法;模型提供推理。DeepSeek 和开放权重世界是一等公民,你局域网里那台跑着
Expand All @@ -186,7 +190,7 @@ README 承载理念和最快路径,细节放在文档和 [codewhale.net](https

- [用户指南](docs/GUIDE.md) —— 上手 CodeWhale 的第一个小时。
- [安装指南](docs/INSTALL.md) —— 所有安装路径与故障排查。
- [配置](docs/CONFIGURATION.md) —— 配置文件、仓库 constitution 和 provider 设置。
- [配置](docs/CONFIGURATION.md) —— `/constitution`、用户全局宪法、仓库 constitution 和 provider 设置。
- [Provider 注册表](docs/PROVIDERS.md) —— 模型路由、凭据、base URL 与能力边界。
- [子 Agent](docs/SUBAGENTS.md) —— 角色、生命周期、输出契约与恢复行为。
- [MCP](docs/MCP.md) —— 接入外部工具服务器,或让 CodeWhale 自己作为 MCP 服务器运行。
Expand Down
55 changes: 54 additions & 1 deletion crates/cli/src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,21 @@ pub(crate) fn asset_matches_platform(asset_name: &str, binary_name: &str) -> boo
|| asset_name.starts_with(&format!("{binary_name}."))
}

fn asset_is_exact_platform_binary(asset_name: &str, binary_name: &str) -> bool {
asset_name == binary_name || asset_name == format!("{binary_name}.exe")
}

fn select_platform_asset<'a>(release: &'a Release, binary_name: &str) -> Option<&'a Asset> {
release
.assets
.iter()
.find(|asset| asset_matches_platform(&asset.name, binary_name))
.find(|asset| asset_is_exact_platform_binary(&asset.name, binary_name))
.or_else(|| {
release
.assets
.iter()
.find(|asset| asset_matches_platform(&asset.name, binary_name))
})
}

fn select_checksum_manifest_asset(release: &Release) -> Option<&Asset> {
Expand Down Expand Up @@ -1271,6 +1281,49 @@ mod tests {
));
}

#[test]
fn select_platform_asset_prefers_bare_binary_over_archive() {
let release = Release {
tag_name: "v0.8.8".to_string(),
prerelease: false,
assets: vec![
Asset {
name: "codewhale-macos-arm64.tar.gz".to_string(),
browser_download_url: "https://example.invalid/codewhale-macos-arm64.tar.gz"
.to_string(),
},
Asset {
name: "codewhale-macos-arm64".to_string(),
browser_download_url: "https://example.invalid/codewhale-macos-arm64"
.to_string(),
},
],
};

let asset =
select_platform_asset(&release, "codewhale-macos-arm64").expect("platform asset");

assert_eq!(asset.name, "codewhale-macos-arm64");
}

#[test]
fn select_platform_asset_falls_back_to_archive_when_bare_binary_is_missing() {
let release = Release {
tag_name: "v0.8.8".to_string(),
prerelease: false,
assets: vec![Asset {
name: "codewhale-macos-arm64.tar.gz".to_string(),
browser_download_url: "https://example.invalid/codewhale-macos-arm64.tar.gz"
.to_string(),
}],
};

let asset =
select_platform_asset(&release, "codewhale-macos-arm64").expect("platform asset");

assert_eq!(asset.name, "codewhale-macos-arm64.tar.gz");
}

#[test]
fn test_sha256_hex_known_value() {
let data = b"hello";
Expand Down
Loading
Loading