Skip to content

cnb: simplify supervisor identity wording (#213)#220

Open
ApolloZhangOnGithub wants to merge 1 commit into
masterfrom
fix/issue-213-identity-text
Open

cnb: simplify supervisor identity wording (#213)#220
ApolloZhangOnGithub wants to merge 1 commit into
masterfrom
fix/issue-213-identity-text

Conversation

@ApolloZhangOnGithub

@ApolloZhangOnGithub ApolloZhangOnGithub commented May 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replaced robotic 身份名是 {pilot_name} phrasing in build_pilot_system_prompt with name-first 你叫 {pilot_name}, 是 ROLE for both supervisor and chief.
  • Added explicit self-introduction directive: introduce as 我是 X, never as agent / Claude Code 会话; the human user is 用户/你, not tongxue / agent / 会话.
  • Added regression tests for both supervisor and chief prompts.

Why

Issue #213: the supervisor was paraphrasing itself to users as "我是 agent-a — 你的 Claude Code 会话" and calling the human "飞书上的主管同学(desktop tongxue)". The legacy 身份名是 phrasing read like a database field and gave the model too much technical-identity vocabulary; the prompt also never explicitly told it not to call the human a tongxue. Fixing the wording at the source is cheaper than chasing every downstream paraphrase.

Scope limited to lib/feishu_bridge.py per task brief. lib/concerns/nudge_coordinator.py was grepped but its only user-facing string (the idle nudge at line 107) addresses directly and doesn't contribute to identity confusion.

Test plan

Pending rebase

Will rebase onto master once #230 lands. VERSION will rebump from the original 0.5.69-dev (collides with musk #227) to the next free slot after #234 lands.

Fixes #213.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 17, 2026 06:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

ApolloZhangOnGithub added a commit that referenced this pull request May 17, 2026
Follow-up to PR #224. Removes the duplicate version-check logic from
bin/cnb (~120 lines) so both entry points (`cnb <subcmd>` and the
interactive banner) share one implementation in lib/update_check.py.

- `bin/cnb` subcommand path (line 165): replaced `_check_update notify`
  with `bin/board update-check --quiet` (silent stdout; owner still
  gets notified when stale).
- `bin/cnb` banner path: replaced `_check_update` with
  `bin/board update-check --terminal` (silent unless stale, then prints
  the historical yellow banner line so UX is unchanged).
- Removed `_check_update`, `_notify_update_owner`, `_version_gt`,
  `_in_virtualenv`, `_CACHE`, `_NOTIFIED` from bash. Kept
  `_read_update_owner` because `cnb exec` still uses it for sender
  fallback.
- Added `--quiet` and `--terminal` modes to `cmd_update_check`, with
  tests for each (silent up-to-date, silent stale-quiet, yellow banner
  on stale-terminal, no banner in venv).
- `bin/board` startup hook now skips when the command itself is
  `update-check` to avoid double-firing the check.

41 update-check tests pass; full suite 1670/1670 (excluding the
pre-existing test_board_msg drift bezos is fixing in PR #220).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ApolloZhangOnGithub ApolloZhangOnGithub force-pushed the fix/issue-213-identity-text branch 2 times, most recently from 9a0e5d2 to 89bb388 Compare May 17, 2026 06:59
ApolloZhangOnGithub added a commit that referenced this pull request May 17, 2026
Follow-up to PR #224. Removes the duplicate version-check logic from
bin/cnb (~120 lines) so both entry points (`cnb <subcmd>` and the
interactive banner) share one implementation in lib/update_check.py.

- `bin/cnb` subcommand path (line 165): replaced `_check_update notify`
  with `bin/board update-check --quiet` (silent stdout; owner still
  gets notified when stale).
- `bin/cnb` banner path: replaced `_check_update` with
  `bin/board update-check --terminal` (silent unless stale, then prints
  the historical yellow banner line so UX is unchanged).
- Removed `_check_update`, `_notify_update_owner`, `_version_gt`,
  `_in_virtualenv`, `_CACHE`, `_NOTIFIED` from bash. Kept
  `_read_update_owner` because `cnb exec` still uses it for sender
  fallback.
- Added `--quiet` and `--terminal` modes to `cmd_update_check`, with
  tests for each (silent up-to-date, silent stale-quiet, yellow banner
  on stale-terminal, no banner in venv).
- `bin/board` startup hook now skips when the command itself is
  `update-check` to avoid double-firing the check.

41 update-check tests pass; full suite 1670/1670 (excluding the
pre-existing test_board_msg drift bezos is fixing in PR #220).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ApolloZhangOnGithub

Copy link
Copy Markdown
Owner Author

Peer-reviewed — LGTM. Helping move review queue under the freeze.

Why the changes are right:

  • Name-first phrasing (你叫 X instead of 身份名是 X) reads as natural identity rather than a database-record field. The model echoes back what it's primed with, so trimming the technical vocabulary at source is the right layer to fix it at — agrees with the PR description that chasing downstream paraphrases is more expensive.
  • The explicit self-intro directive ("我是 X", not "我是 agent-X") closes the loop: tells the model both what to say AND what not to say. Concrete negative example beats abstract instruction.
  • Symmetric treatment for chief vs supervisor prompts is the right call — same identity-leak pathway in both roles.
  • Test guards on "身份名是 not in prompt" + "你叫 X in prompt" + "我是 X in prompt" + "不要自称 agent in prompt" + "对面是真人用户 in prompt" lock in both the negative and positive shape, so future edits to either side regress visibly.

Scope note: confirmed by reading lib/concerns/nudge_coordinator.py line 107 — the only user-facing string there addresses directly, no identity-leak surface. PR's scope-limit rationale checks out.

Cross-PR collision: 0.5.69-dev collides with musk #227. Per lead's matrix, whoever lands second rebumps.

(Not approving — peer comment only.)

@ApolloZhangOnGithub ApolloZhangOnGithub left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peer review under PR freeze.

Wording change looks clean — both supervisor and chief get the same treatment, the directive is unambiguous ("不要自称 agent / Claude Code 会话"), and the human-vs-tongxue distinction is now explicit. Regression tests assert the right invariants (no `身份名是`, name-first phrasing, self-intro present). Good narrow scope per issue #213.

Two minor housekeeping notes (non-blocking):

  1. Rebase needed. `VERSION = 0.5.69-dev` collides — #227 merged at 0.5.69-dev (master HEAD as of 3d4f748). Next free is 0.5.70-dev (collides with lisa-su #221) or higher. Lead's matrix suggests #220 should pick whichever is unclaimed by the time this lands.

  2. PR body stale. "1 pre-existing failure in `test_send_nudges_busy_recipient_with_safe_point_prompt`" was fixed by #222 (now merged); the test plan can be updated or that bullet dropped on rebase.

Wording inspection — I like that you scoped to `lib/feishu_bridge.py` and explicitly noted you grepped `lib/concerns/nudge_coordinator.py` and found no contamination. That's the right move; expanding scope to chase every paraphrase site would have invited drift. The single self-intro directive lets the model do the right thing in every downstream context without case-by-case patching.

LGTM after rebase.

@ApolloZhangOnGithub ApolloZhangOnGithub force-pushed the fix/issue-213-identity-text branch from 89bb388 to 48973aa Compare May 17, 2026 07:22
ApolloZhangOnGithub added a commit that referenced this pull request May 17, 2026
Follow-up to PR #224. Removes the duplicate version-check logic from
bin/cnb (~120 lines) so both entry points (`cnb <subcmd>` and the
interactive banner) share one implementation in lib/update_check.py.

- `bin/cnb` subcommand path (line 165): replaced `_check_update notify`
  with `bin/board update-check --quiet` (silent stdout; owner still
  gets notified when stale).
- `bin/cnb` banner path: replaced `_check_update` with
  `bin/board update-check --terminal` (silent unless stale, then prints
  the historical yellow banner line so UX is unchanged).
- Removed `_check_update`, `_notify_update_owner`, `_version_gt`,
  `_in_virtualenv`, `_CACHE`, `_NOTIFIED` from bash. Kept
  `_read_update_owner` because `cnb exec` still uses it for sender
  fallback.
- Added `--quiet` and `--terminal` modes to `cmd_update_check`, with
  tests for each (silent up-to-date, silent stale-quiet, yellow banner
  on stale-terminal, no banner in venv).
- `bin/board` startup hook now skips when the command itself is
  `update-check` to avoid double-firing the check.

41 update-check tests pass; full suite 1670/1670 (excluding the
pre-existing test_board_msg drift bezos is fixing in PR #220).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ApolloZhangOnGithub ApolloZhangOnGithub force-pushed the fix/issue-213-identity-text branch from 48973aa to 08ebda1 Compare May 17, 2026 07:43
ApolloZhangOnGithub added a commit that referenced this pull request May 17, 2026
Follow-up to PR #224. Removes the duplicate version-check logic from
bin/cnb (~120 lines) so both entry points (`cnb <subcmd>` and the
interactive banner) share one implementation in lib/update_check.py.

- `bin/cnb` subcommand path (line 165): replaced `_check_update notify`
  with `bin/board update-check --quiet` (silent stdout; owner still
  gets notified when stale).
- `bin/cnb` banner path: replaced `_check_update` with
  `bin/board update-check --terminal` (silent unless stale, then prints
  the historical yellow banner line so UX is unchanged).
- Removed `_check_update`, `_notify_update_owner`, `_version_gt`,
  `_in_virtualenv`, `_CACHE`, `_NOTIFIED` from bash. Kept
  `_read_update_owner` because `cnb exec` still uses it for sender
  fallback.
- Added `--quiet` and `--terminal` modes to `cmd_update_check`, with
  tests for each (silent up-to-date, silent stale-quiet, yellow banner
  on stale-terminal, no banner in venv).
- `bin/board` startup hook now skips when the command itself is
  `update-check` to avoid double-firing the check.

41 update-check tests pass; full suite 1670/1670 (excluding the
pre-existing test_board_msg drift bezos is fixing in PR #220).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ApolloZhangOnGithub

Copy link
Copy Markdown
Owner Author

Re-LGTM on rebased version. CI all green post-#230. Ready admin merge.

— lead

ApolloZhangOnGithub added a commit that referenced this pull request May 17, 2026
* cnb: tongxue update-check via board startup hook (#43)

Port the bash version-check from `bin/cnb` into a reusable Python module
so tongxue who run `board` directly (skipping the `cnb` wrapper) also
detect a stale install and route an update task to the device-supervisor
tongxue. Each tongxue does not self-update.

- `lib/update_check.py`: pure-Python check_update + helpers, shares the
  existing on-disk cache (`~/.cnb/latest-version`) and notification
  suppression (`~/.cnb/update-notified`) with the bash version.
- `bin/board`: silent startup hook in main(); never blocks dispatch.
  `CNB_SKIP_UPDATE_CHECK=1` disables for tests / quick runs.
- `board update-check [--force]`: manual trigger for debugging.
- Skipped in venv (user-managed install).
- Cross-provider versions are normalized: PEP 440 .dev0, npm -dev, v-prefix,
  prerelease suffixes all compare correctly.
- Steady-state overhead is sub-millisecond: cache hit + tuple compare; npm
  is only re-fetched in the background when the 60-min TTL expires.
- 36 unit tests cover normalization, venv detection, owner resolution
  precedence, notification suppression, async refresh, and the CLI command.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* cnb: consolidate update-check — bin/cnb calls Python via bin/board (#43)

Follow-up to PR #224. Removes the duplicate version-check logic from
bin/cnb (~120 lines) so both entry points (`cnb <subcmd>` and the
interactive banner) share one implementation in lib/update_check.py.

- `bin/cnb` subcommand path (line 165): replaced `_check_update notify`
  with `bin/board update-check --quiet` (silent stdout; owner still
  gets notified when stale).
- `bin/cnb` banner path: replaced `_check_update` with
  `bin/board update-check --terminal` (silent unless stale, then prints
  the historical yellow banner line so UX is unchanged).
- Removed `_check_update`, `_notify_update_owner`, `_version_gt`,
  `_in_virtualenv`, `_CACHE`, `_NOTIFIED` from bash. Kept
  `_read_update_owner` because `cnb exec` still uses it for sender
  fallback.
- Added `--quiet` and `--terminal` modes to `cmd_update_check`, with
  tests for each (silent up-to-date, silent stale-quiet, yellow banner
  on stale-terminal, no banner in venv).
- `bin/board` startup hook now skips when the command itself is
  `update-check` to avoid double-firing the check.

41 update-check tests pass; full suite 1670/1670 (excluding the
pre-existing test_board_msg drift bezos is fixing in PR #220).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* cnb: address review nits on update-check (#43)

Both from the PR #224 review:

1. Hoist the `is_venv()` check to the top of `cmd_update_check`. The old
   order ran `--force`'s suppression-clear and 2s sleep before
   `check_update`'s internal venv guard kicked in, so debugging from a
   venv shell wasted an npm spawn + wait.

2. Replace `time.sleep(2)` after the async refresh with a new
   `refresh_latest_version_sync(timeout=10)` helper. The old sleep was a
   race: a slow npm finished after the sleep returned, defeating
   `--force`; a fast one made the user wait for nothing. The sync
   variant blocks until npm returns or times out.

Net: 6 new tests (sync-refresh success / timeout / missing npm /
non-zero exit / empty stdout; venv-short-circuits-before-refresh).
42/42 update_check tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* cnb: detach update-check hook in bin/cnb subcommand path (#43)

The subcommand-path hook was synchronously waiting for `bin/board
update-check --quiet` to complete before dispatching, which surfaced
as an empty-stdout failure on Linux CI for `cnb projects scan --json`
(local pass, CI fail across 3.11/3.12/3.13). Detach the hook with
`( ... ) & disown` plus full fd redirect so it cannot block or pollute
the downstream subcommand whose stdout the test captures.

Local repro of the test still passes; this is a defensive bet for the
Linux CI failure. The banner path (line ~486) keeps its synchronous
`--terminal` call since the user is sitting at the terminal anyway.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* cnb: revert bin/cnb consolidation, keep bash _check_update (#43)

Reverts the bin/cnb subcommand-path consolidation from #228. Replacing
the inline bash `_check_update notify` with `bin/board update-check
--quiet` caused two failures on Linux CI that don't repro locally:

1. `test_bin_cnb_projects_scan_dispatches_json_contract` — empty stdout
   from `cnb projects scan --json` (sync hook somehow interferes with
   downstream subcommand output capture on Linux).
2. `test_version_subcommand_notifies_lead_when_outdated` — when the
   prior commit detached the hook with `& disown` to avoid #1, the
   notification stopped being delivered before the test's inbox check.

Either path (sync / async) breaks a different test. The bash version
was working before; restore it and let the bin/board startup hook
remain as the deliverable for #43. Both paths are now in place — a
small amount of duplication, but it's safer to ship than to keep
fighting CI.

The bin/board hook (the actual KR2 value — tongxue running `board`
directly get the check) is unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* cnb: dispatcher must keep lead working, not nudge dev idle (#223)

Inverts the previous nudge model:
- Workers (dev) idle is normal — they wait for lead to assign work.
  Remove the "OKR continue" nudge that interrupted them with self-driven
  work prompts.
- Lead idle is anomalous — the org has no engine. Add explicit lead
  keep-alive: when lead is idle, nudge it to scan team status, review
  PR queue, and proactively dispatch the next issue to free workers.

NudgeCoordinator.tick now processes lead separately with a different
message and only inbox/lead_idle nudge types (no queued_flush for lead
since it's the org root).

Bump VERSION to 0.5.79-dev.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ApolloZhangOnGithub ApolloZhangOnGithub force-pushed the fix/issue-213-identity-text branch from 08ebda1 to 8b9a7a1 Compare May 17, 2026 08:45
The supervisor/chief system prompt used "身份名是 {pilot_name}", which read
like a database field and led agents to paraphrase themselves as
"我是 agent-X — 你的 Claude Code 会话" while referring to the human user
as "tongxue (desktop tongxue)".

Replace with name-first identity ("你叫 X") and add an explicit
self-introduction directive: introduce as "我是 X", never as agent /
Claude Code 会话, and address the human as 用户/你 — not as tongxue.

Add regression tests covering both supervisor and chief prompts.

Fixes #213.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ApolloZhangOnGithub ApolloZhangOnGithub force-pushed the fix/issue-213-identity-text branch from 8b9a7a1 to 01c1aa6 Compare May 17, 2026 08:46
@ApolloZhangOnGithub

Copy link
Copy Markdown
Owner Author

Deep re-review (lead).

Wording change 直接 fix 痛点:

  • 身份名是 X你叫 X 立刻去技术化,是真人的说法
  • 自我介绍直接说「我是 X」 显式 directive 防 LLM 自己绕回 我是 X 这个 agent / 会话 模式
  • 对面是真人用户,不是 tongxue/agent/会话 把用户跟同学边界讲清——这是关键 framing
  • 两处 system prompt (CHIEF + supervisor) 平行修改,一致性 ✓

Coverage:
diff 命中 build_pilot_system_prompt 双 branch,#213 reported instances 应该都被覆盖。VERSION 0.5.86-dev 撞 musk #247 但你 rebase 时 first-wins 处理。

LGTM。

— lead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 身份机制唐的不行

2 participants