返回 CodeWhale
CODEWHALE_AGENT.md
根目录 / docs / CODEWHALE_AGENT.md
1 # Codewhale Agent — one identity, many surfaces
2
3 "Codewhale Agent" is one product identity with many transport surfaces.
4 This page is the identity map: what each surface is, where each lives, and
5 the rules that keep them one product instead of several.
6
7 ## The one identity
8
9 | Surface | Identity object | Where it lives | State |
10 |---|---|---|---|
11 | GitHub PR review | GitHub App bot `codewhale-agent[bot]` | GitHub org settings; repo variable `CODEWHALE_APP_ID` + secret `CODEWHALE_APP_PRIVATE_KEY` | `codewhale review --pr N --post` ships with the `codewhale-review.yml` workflow; it no-ops green until the App is configured (founder-gated), then posts as the App instead of the workflow token. Posting is always opt-in via `--post`. |
12 | Commit co-author | `.github/AUTHOR_MAP` | repo | existing; harvested co-author credit lands in the contributor graph |
13 | Chat channels (Telegram today; Slack/Feishu/Lark next; Discord/WeCom to come) | per-user bot registration bound to a Codewhale membership | CWC control-plane `services/control-plane/src` BotGateway + `integrations/chat/`; contracts in `packages/contracts` | Telegram pairing end-to-end (token → vault `credentialRef` → one-time code → `/start` binds chat↔membership). Default read-only command allowlist; opt-in write verbs; approve/deny keyboards route as permission decisions. |
14
15 ## Rules that make it one identity
16
17 - Every surface is I/O around the single `Engine::run_turn`
18 (`crates/tui/src/core/engine/turn_loop.rs`). No surface gets its own
19 engine or turn loop.
20 - Every surface authenticates to the same Codewhale membership
21 (`codewhale login` account session). Membership gates cloud agents;
22 provider brands stay internal and invisible.
23 - Approvals from any surface route back as permission decisions into the
24 same engine. A bare message never executes a gated action.
25 - Every command and approval is audited, on every channel.
26 - All surfaces are FREE. Rate limits are anti-abuse only. There is no
27 per-channel fee, message metering, team gating, or trial timer — and a
28 billing hook on a channel feature is forbidden by the money model.
29
30 ## Naming
31
32 - Product: Codewhale. Agent surface: "Codewhale Agent".
33 - Bot handle wherever it can be chosen: `codewhale-agent`.
34 - The agent speaks as "Codewhale cloud agent" — never as a provider brand.
35
36 ## Channel contract
37
38 Per-channel command allowlists (default read-only: `status`, `jobs`,
39 `receipts`, `help`; opt-in: `new task`, `approve`, `deny`), inline
40 approve/deny keyboards routed as permission decisions, `assistant_changes`
41 reply mode (message only when something changed), per-channel message
42 format adapters (Telegram markdown today; Slack blocks, Feishu/Lark cards,
43 WeCom markdown planned), quiet hours + digest, automation output routable
44 to any paired channel, one pairing code bound inside the authenticated
45 app, unbind revokes instantly.
46
47 WeChat note: personal-WeChat automation is **not supported** —
48 reverse-engineered protocols get users banned. Official 公众号/服务号 APIs
49 are the only acceptable path and are still under assessment.
50
51 ## Pointer
52
53 Channel contracts live in `packages/contracts` (CWC repo); the gateway and
54 adapters live in `services/control-plane/src` (CWC repo). The GitHub
55 surface lives in `.github/workflows/codewhale-review.yml` here.
56
56 lines MARKDOWN