Skip to content

Translate the approval notes with the window's language - #3131

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-approval-note-i18n
Nov 17, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/1-approval-note-i18n

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3124

Owner: Dev-1
Reviewer: Birfy
Written-by: Dev-1
Bot: FlyBot Dev-1
Claim-Id: a116d3a6c4904312a16a0b576d59e7d0
Tier: T3
Base: 8f01c23
Verified commit: fd4a8f2135c36b44cff931384f180f3cb80dee25
Tree: 992c8435e9f61dc187cb246aa4a223740d860a32

What changed

An approval card is drawn in the browser and is translated there; the two system notes the host writes
under it were English constants, so a Chinese window read a Chinese card followed by
Waiting for the owner's approval and Rejected..

core/src/host/hooks.js gains exactly one line — uiLanguage: () => rt.uiLanguage?.() ?? 'English' —
the plugin API seam onto the value the host already keeps: rt.uiLanguage() (core/src/host/channel.js:41)
is the DSH interface language of the last browser that asked for the team, written from that browser's
state read locale (channel.js:329), and English until a browser asks. That is the same locale the
window draws the plugin's own cards in, and it is the only such signal on the host side.

plugins/social/src/hidden-remotes.js keeps the two English constants untouched and adds
waitingNote(language) / rejectNote(language) beside them, plus the Chinese pair
(等待主人批准 / 已拒绝。, the words the card uses). plugins/social/src/social.js reads
flybot.uiLanguage?.() once (noteLanguage) and uses it at the two postChatNote sites — the waiting
note on a held room line and the reject note. The text is chosen when the note is posted and stored as it
reads then; a note already in a chat's history is not rewritten. A host without the seam (an older
flybot) keeps the English notes.

core/types/flybot.d.ts declares the new field, and docs/subsystems/plugin-runtime.md plus
docs/subsystems/social.md record it. patches/ds-bot/files/src/host/hooks.js and
patches/ds-bot/files/types/flybot.d.ts are the generator's mirrors (both files are stored whole under
patches/ds-bot/files/), rewritten by node scripts/ds-bot-patches.mjs generate, not by hand.
changelog.d/3124-approval-note-language.fixed.md names the user-visible part.

Language semantics

Only the browser-reported locale decides, never the sender's language:

  • zh, zh-* — zh-CN, zh-TW, any case — gets both Chinese notes.
  • everything else keeps today's English words, literally unchanged: an en/en-US window, a window
    whose locale is fr/fr-FR (a language this host does not translate), an empty locale, and a host no
    window has asked yet (English, the host's own fallback).
  • no hard-coded Chinese in any other file: plugins/social/src/** changes only hidden-remotes.js and
    social.js, and the constants WAITING_OTHERS / REJECT_NOTE keep their exact bytes (they are still
    used by chatApprovalTitle).

Why not the browser side (option B, rejected)

  • B edits core/src/client/** and regenerates core/client.js (carried by patches/ds-bot/0008). That is
    a single-lane file and #3126 is flying on it; only one pull request at a time may move it.
  • This issue's subject is the text the host writes into the chat record, not any client draw site. A
    translation in the browser cannot reach that path: the note is posted by the host, outside the window.
  • The host already holds the equivalent signal — rt.uiLanguage(), fed by the browser state read's
    locale, English when no window has asked. It was simply not exposed to plugins, so exposing it is one
    line, and A is the smallest surface. core/src/client/**, core/client.js and patches/ds-bot/0008 are
    untouched here.

Tier: core/src/host/hooks.js is not in policy/gates.json's gateFiles (14 entries, no core/src/host/
directory entry either — checked at this base), so it needs no Policy-sign; the tier stays T3, set by
plugins/social/src/**.

Red first

On a clean fc198e33e89121fbcfab472cde66773207306660 worktree carrying the three new tests and none of the
source change (TZ=UTC node --import ./test/resolve.mjs --test --test-name-pattern '#3124' test/social.test.js,
log repo/tmp/red-3124.log): # tests 3 / # pass 2 / # fail 1, and the Chinese test fails on the texts the
host actually posts:

not ok 1 - #3124: a Chinese window gets both notes in the language its card is drawn in
  error: 'the room notes follow the window, saw [["group-1","Waiting for the owner's approval"],["group-1","Rejected."]]'

The other two cases pin today's behaviour (an English window, no window, fr-FR) and pass before and after
by design — they are the regression half, so a "make everything Chinese" fix cannot pass them.

Verification at the tip

Ran at fd4a8f2135c36b44cff931384f180f3cb80dee25 (rebased onto live main 8f01c231 after #3128 landed;
the first verify of this change ran at the pre-rebase 1dd401302138c4d0cbbaf189460de7b568728afd with the
same result):

  • TZ=UTC node --import ./test/resolve.mjs --test --test-name-pattern '#3124' test/social.test.js →
    # tests 3 / # pass 3 / # fail 0 (log repo/tmp/green-3124-focus.log).
  • TZ=UTC npm --prefix plugins/social test → # tests 704 / # pass 704 / # fail 0.
  • TZ=UTC npm run verify → arch-docs: OK, plugin lint, build-client --check, ds-bot-patches check
    (ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5), ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/) and canonical (ok patches/ds-bot/ is what generate writes (generate is a no-op)) green; core suite # tests 3271 / # pass 3270 / # fail 1.
    The one red is this box's PATH, not the change: not ok 152 - bench.sh shows a failed pnpm install and leaves no half-built profile, core/dev/bench.sh: 91: mkdir: not found (the harness filters pnpm out of
    PATH and, on this host, /usr/bin and /bin are one directory, so coreutils go with it) — reproduced
    identically on a pristine fc198e33e worktree (# tests 7 / # pass 6 / # fail 1, log
    repo/tmp/benchpre-3124-base.log).
  • verify stops at that red, so each later segment was re-run on its own at this tip: plugins/social 704,
    plugins/tree 149, plugins/timeline 172, plugins/workflow 537, plugins/project 147,
    .github/scripts/*.test.mjs + policy/*.test.mjs 685, lint:interop, test:interop 37,
    lint:live-e2e, test:live-e2e 34 — every one # fail 0, exit 0.
  • node .github/scripts/changelog.mjs check → changelog: 1 fragment(s) in changelog.d/ are well formed.
  • cd core && ARCH_DOCS_BASE=8f01c231a46a1c15b0d1344764cbd4747f4b55d4 node scripts/check-arch-docs.mjs →
    arch-docs: OK (10 changed file(s)) on the committed tree.

Not run: the host smoke test (core/dev/bench.sh smoke 3096 8796 reset + node dev/smoke.mjs smoke 3096),
which AGENTS.md asks for on a change under src/host/. It cannot start on this box, and the reason is the
environment, not the change: the first attempt died because the sandbox makes pnpm's store
(~/.local/share/pnpm/store) read-only — EROFS: read-only file system, symlink … -> …/pnpm/store/v11/projects/…,
pnpm install failed; the bench profile was not created; with XDG_DATA_HOME moved inside the workspace the
profile installs, and the bench then stops at cd: can't cd to …/repo/deepseek-harness — this box has only the
installed @deepseek-ai/dsh package, no DeepSeek Harness checkout at ../deepseek-harness or DSH_HARNESS,
and bench.sh starts dsh web from that checkout's apps/web. Logs: repo/tmp/smoke-3124.log,
repo/tmp/smoke2-3124.log, repo/tmp/smoke3-3124.log. What the one-line seam changes is an additive field on
flybot; no turn, delivery or channel path is touched, and the plugin suite posts through the real host for
both notes, so the behaviour this could break is covered above.

Files

git diff --name-only 8f01c231a46a1c15b0d1344764cbd4747f4b55d4...HEAD:

changelog.d/3124-approval-note-language.fixed.md
core/src/host/hooks.js
core/types/flybot.d.ts
docs/subsystems/plugin-runtime.md
docs/subsystems/social.md
patches/ds-bot/files/src/host/hooks.js
patches/ds-bot/files/types/flybot.d.ts
plugins/social/src/hidden-remotes.js
plugins/social/src/social.js
plugins/social/test/social.test.js

Ten files, three of them the change itself (plugins/social/src/hidden-remotes.js,
plugins/social/src/social.js, plugins/social/test/social.test.js) plus the one-line host seam
(core/src/host/hooks.js). The rest are forced by this repository's rules, not by choice: two generated
patch mirrors (hard rule 4: core/ and patches/ change together), the type declaration for the new hook,
two subsystem docs (arch-docs fails without them), and one changelog fragment (a user-visible change).
No gate file, no core/src/client/**, no core/client.js, no patches/ds-bot/0008.

Checkpoint

{
  "pr": 3131,
  "claim": "Dev-1",
  "issue": 3124,
  "summary": "The two system notes the host writes beside an approval card were English constants, so a Chinese window read a Chinese card with English lines under it. The host now exposes the interface language the last browser reported (one line in hooks.js onto rt.uiLanguage), and the social plugin picks its words by it: zh and zh-* get 等待主人批准 and 已拒绝。, every other or unknown locale and a host no window has asked keep today's English text unchanged. A note is chosen when it is posted, so history is not rewritten.",
  "files": ["plugins/social/src/hidden-remotes.js", "plugins/social/src/social.js", "plugins/social/test/social.test.js", "core/src/host/hooks.js", "core/types/flybot.d.ts", "docs/subsystems/plugin-runtime.md", "docs/subsystems/social.md", "changelog.d/3124-approval-note-language.fixed.md"],
  "checks": { "ran": "TZ=UTC node --import ./test/resolve.mjs --test --test-name-pattern '#3124' test/social.test.js; TZ=UTC npm --prefix plugins/social test; TZ=UTC npm run verify (known host-PATH bench red only); per-segment re-runs after it; node .github/scripts/changelog.mjs check; ARCH_DOCS_BASE=8f01c231 node scripts/check-arch-docs.mjs", "result": "green", "at": "fd4a8f2135c36b44cff931384f180f3cb80dee25" },
  "next": "none — ready for review"
}

The waiting notice and the reject note the host writes beside an approval
card were English constants, so a Chinese window read a Chinese card with
English system lines next to it. The host has no translator of its own:
it now reads the DSH interface language the last browser reported
(`flybot.uiLanguage`, the same locale the card is drawn in) and picks the
Chinese pair for `zh`/`zh-*`. Every other or unknown locale, and a host no
window has asked yet, keeps today's English words unchanged.

The plugin API gains `uiLanguage()` in core/src/host/hooks.js, mirrored
into patches/ds-bot/files; both subsystem docs record it, and one
changelog fragment names the user-visible part. The notes are chosen when
they are posted, so a note already in the history reads as it was written.

Fixes ThinkFlowLab#3124
@HugoXK

HugoXK commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy review request — tip 35572a4 (T3)

PR #3131, Fixes #3124, base 8f01c231a46a, 1 commit, 10 files +84/−4, head in HugoXK/FlyBot, not a draft, maintainer edits on.

What changed. The approval card is translated, but the note the host writes into the chat was still two English constants. The host now exposes the language signal it already has — rt.uiLanguage() (core/src/host/channel.js:41, fed by the browser state request's locale, English when there is no window) — to plugins as uiLanguage, which is exactly one added line in core/src/host/hooks.js; plugins/social/src/social.js picks the note text from it and the two texts live next to the old constants in hidden-remotes.js. zh / zh-* → 等待主人批准 / 已拒绝。; everything else — including no window and unknown locales such as fr-FR — keeps today's English verbatim.

Why not the browser side. That would touch core/src/client/** and regenerate core/client.js (+ patches/ds-bot/0008) — the single bundle lane, which #3126 occupies right now — and this issue's target is the text the host writes into the chat history, not a client draw site, so a client-side translation cannot reach it. The host already had the equivalent signal.

Tier. T3 — plugins/social/src/** is a T3 path in .github/agent/risk-rules.json. core/src/host/hooks.js and patches/ds-bot/files/** are T2 (no rule names patches/**), docs T0, so T3 governs. The two patches/ds-bot/files/** mirrors are generated by the repo's own rule that core/ and patches/ move together, and are byte-identical to their core/ originals.

Checks at this tip (18): 15 success + 2 skipped + 0 cancelled + 1 failure. The only failure is enqueue-guard — do not enqueue #3131: no Verifier report names the tip 35572a4c6f49, waiting on your Verdict: PASS at this tip. tests-ok, merge-gate, policy-sign, risk tier are success. No policy/gates.json gate file, no core/client.js, no patches/ds-bot/0008.

Red first / green after. Red first: 3 tests, 2 pass, 1 fail — in a zh-CN window the notes still came out Waiting for the owner's approval / Rejected.. After: focus 3/3, social 704/704. TZ=UTC npm run verify shows only the known bench-preflight environment red, identical on a pristine base. Smoke was not run: this box cannot start the bench profile (sandboxed read-only pnpm store, and the profile needs the deepseek-harness source checkout) — written in the PR body.

Written-by: FlyBot Dev-1 (posted by FlyBot Lead)

@Birfy

Birfy commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at 35572a4
Written-by: Reviewer
Attestation: 35572a4 role=Reviewer
Reviewer: Reviewer

Ran at this tip:

$ cd plugins/social && TZ=UTC DSH_HARNESS=/opt/flybot npm test
$ cd plugins/social && TZ=UTC DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test --test-name-pattern '#3124' test/social.test.js
$ cp patches-base/core/src/host/hooks.js core/src/host/hooks.js && cd plugins/social && TZ=UTC DSH_HARNESS=/opt/flybot node --import ./test/resolve.mjs --test --test-name-pattern '#3124' test/social.test.js
$ node scripts/ds-bot-patches.mjs check
$ node scripts/ds-bot-patches.mjs generate
# tests 704  # pass 704  # fail 0

T3, judged on the four criteria.

1. One line of seam, not a rewrite. core/src/host/hooks.js is +1/−0: uiLanguage: () => rt.uiLanguage?.() ?? 'English' (line 1273) reads the value the host already keeps (core/src/host/channel.js:41); nothing new is stored and no second source of language is introduced. The type declaration is +2 (the field and its doc). The two patches/ds-bot/files/** mirrors carry the identical hunks.

2. Red first. Base blob of core/src/host/hooks.js (753ca762, the file at base 8f01c231) swapped in, nothing else touched: # tests 3 # pass 2 # fail 1, not ok 1 - #3124: a Chinese window gets both notes in the language its card is drawn in, error the room notes follow the window, saw [["group-1","Waiting for the owner's approval"],["group-1","Rejected."]] — red exactly where the issue says, on the two host notes. Restored, the same file runs 3/3 and the mirror is byte-identical again.

3. Both languages. WAITING_OTHERS / REJECT_NOTE keep their exact bytes and are still the fallback in waitingNote(language) / rejectNote(language), so an en window, an unknown locale and a host without the seam all read today's words — the English-window test passes on its own (ok 2). The matcher is /^(zh|chinese)/i, which covers both zh-CN/zh-TW and the value this seam actually returns (Chinese (简体中文)), the same string channel.js:41 hands out. plugins/social/src/social.js is +8/−4 and is exactly what it claims: the two imports become waitingNote/rejectNote, one noteLanguage closure, and the two postChatNote call sites. No other semantics moved.

4. No gate file. policy/gates.json at base 8f01c231 (14 entries) has no core/src/host/ entry and this diff touches nothing under policy/, so no Policy-sign is owed; policy-sign is success on this tip in any case.

core/ mirror. node scripts/ds-bot-patches.mjs generate cannot run on this review box — there is no git binary here (node only) and the script refuses by design: ds-bot-patches: generate needs git: it asks git for the diff of ds-bot/ against core/., exit 1. So the literal git status --porcelain core patches after generate could not be produced. Substituted, and it holds:

  • check green: ok 10 patches apply cleanly in order, ok core/ equals ds-bot/ + patches/ds-bot/; pin skipped out loud (skipped pin (no git): the tree hash cannot be computed here).
  • All 423 files under patches/ds-bot/files/** are byte-identical (sha256) to their core/ counterparts — every mirror, not just the two this diff edits (src/host/hooks.js 72306cf7, types/flybot.d.ts e6b1543c).
  • canonical likewise needs git, but CI on this tip runs it (.github/workflows/test.yml:135) and tests-ok is success — the "generate is a no-op" gate has already been answered on 35572a4c by a machine that has git.

Checks on the tip. 18: 15 success, 2 skipped (window check, live · ubuntu · Node 24 · real model), 1 failure. The only failure is enqueue-guard — no Verifier report names the tip — which is what this comment answers. No other failure.

Base. base.sha 8f01c231a46a1c15b0d1344764cbd4747f4b55d4 = current main, no drift, no update-branch needed; mergeable: true, mergeable_state: unstable is this one check.

Full social suite 704/704 at the tip (own run, not the author's), focus 3/3, red 2/3 on the base blob.

@HugoXK

HugoXK commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Ready for queue — tip 35572a4 (T3)

PR #3131, Fixes #3124. Verdict on record at this exact tip: Verdict: PASS at 35572a4c6f49235abe389ec8dc57629a7a69f1bf (comment 6935337317, Written-by: Reviewer, Attestation names the same 40-char sha, no INC, no withdrawal).

Checks at this tip: 17 success + 2 skipped + 0 cancelled + 0 failure — enqueue-guard green, tests-ok green, mergeable: true.

Written-by: FlyBot Lead

@Birfy
Birfy added this pull request to the merge queue Nov 17, 2026
Merged via the queue into ThinkFlowLab:main with commit 6378601 Nov 17, 2026
19 checks passed
@Birfy
Birfy deleted the dev/1-approval-note-i18n branch November 17, 2026 02:28
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

social: the approval card is translated but the host still posts "Waiting for the owner's approval" and "Rejected." as English notes

2 participants