Skip to content

Read the Project plugin's purpose on the Plugins page in the window language (#3114) - #3271

Merged
Birfy merged 1 commit into
mainfrom
dev/3114-plugin-purpose-zh
Nov 20, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/3114-plugin-purpose-zh

Conversation

@Birfy

@Birfy Birfy commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev
Fixes #3270
Part of #3114
Owner: Dev
Reviewer: Reviewer
Docs-not-needed: one dictionary key, one test and one changelog fragment; no component or structure change.

What changed

Before: a Chinese window drew the Project plugin's purpose as the English sentence Run a Project: Project State, its board, its own Chief, its team and its assistant. on Settings → Plugins. Both faces of that row — the installed one through SwitchRow.hint (core/src/client/settings.js:90) and the not-installed one through the install hint (:84) — already draw ${plugin.package} — ${t(plugin.purpose)}; the four other plugin purposes had whole-sentence keys in the dictionary and this fifth one had none, so t() returned the key itself.

After: one whole-sentence key in core/src/client/i18n.js, right after 'Run workflow graphs across several Bots.' — Run a Project: Project State, its board, its own Chief, its team and its assistant. → 运行一个项目:Project State、它的看板、它自己的 Chief、它的团队和助手。. core/src/client/settings.js is byte-identical (the draw point stays t(plugin.purpose), twice); no component, no structure, no mapping table. An English window is unchanged (with no locale t() returns the key), and the plugin names (Bot Social / Tree / Timeline / Workflow / Project) are not translated — that is an owner naming decision and a separate cut. Project State and Chief keep the dictionary's existing English form, as README.zh.md:79 and 'Project Chief': '项目 Chief' already do.

The new case reads the five purpose strings out of core/src/host/plugins.js with /purpose: (['"])((?:(?!\1).)+)\1/g, so a sixth plugin shipped without a Chinese key fails it too — it guards the class, not only this key. It asserts three things: with no locale the English sentence is still on the page; with a zh locale none of the five English purposes is; and the page reads 运行一个项目.

Hand-written: 3 files / +22/−2 = 24 lines (core/src/client/i18n.js +2/−0, core/test/plugin-installed-faces.test.js +19/−2, changelog.d/3114-cut-37-plugin-purpose.fixed.md +1/−0). Generated, never hand-edited: core/client.js (+2) and three patch artifacts (0001, 0008, files/test/plugin-installed-faces.test.js). Whole cut: 7 files / +49/−6.

Verification at the tip

Tip SHA: 53adc4b1162a796fb8cdd51242682ba60cca383b (tree b9091eb696b8a814ed6f0e7cb7a44bf0be0959c1, matching the local commit byte for byte)

Ran at this tip:

$ cd core && TZ=UTC node --test test/plugin-installed-faces.test.js
# red first (clean 7f95f0cf tree + only the new test): tests 7 / pass 6 / fail 1
#   not ok 7 - every plugin purpose reads in the window language
#   "Run a Project: Project State, its board, its own Chief, its team and its assistant." still reads English in a zh window
# at the tip: tests 7 / pass 7 / fail 0   (clean main on the same file: 6 / 6 / 0)
$ cd core && TZ=UTC node --test test/i18n.test.js test/i18n-missing-entries.test.js test/i18n-template-draws.test.js test/i18n-plugins.test.js test/i18n-plugins-missing-zh.test.js
# tests 41 / pass 41 / fail 0
$ node -e "for (const f of ['i18n-plugins','i18n-template-draws','i18n-missing-entries','i18n-plugins-missing-zh']) console.log(f, require('./core/test/'+f+'.baseline.json').entries.length)"
i18n-plugins 12 / i18n-template-draws 9 / i18n-missing-entries 46 / i18n-plugins-missing-zh 2
$ node core/scripts/build-client.mjs --check          # rc 0
$ node scripts/ds-bot-patches.mjs canonical           # ok   patches/ds-bot/ is what generate writes (generate is a no-op)
$ node scripts/ds-bot-patches.mjs check               # ok pin; ok 10 patches apply cleanly; ok core/ equals ds-bot/ + patches/ds-bot/
$ node .github/scripts/changelog.mjs check             # changelog: 18 fragment(s) in changelog.d/ are well formed (main: 17)
$ git archive HEAD | tar -x -C <clean dir> && node .github/scripts/check-mojibake.mjs --check
mojibake: ok — 0 occurrences of U+FFFD in 1787 text file(s)   (rc 0; both trees: main archive 1786)
$ ARCH_DOCS_BASE=HEAD~1 node core/scripts/check-arch-docs.mjs   # arch-docs: OK (7 changed file(s)), rc 0
$ git diff --shortstat HEAD~1...HEAD                   # 7 files changed, 49 insertions(+), 6 deletions(-)

Two runs sit on a tree I reconstructed here rather than a fresh git clone: this box cannot reach github.com (only api.github.com), so the working copy is a tree whose sha fc2b56dc00924e47114dd7d20a4cbff79d8378fd I checked against GET /repos/ThinkFlowLab/FlyBot/commits/7f95f0cf… before writing anything. The branch tip was then built with the git data API whose tree sha (b9091eb6…) equals the local one, so the pushed bytes are the tested bytes.

Red first, on the clean base with the implementation untouched (only the new test in the tree): # tests 7 / # pass 6 / # fail 1, not ok 7, error text "Run a Project: Project State, its board, its own Chief, its team and its assistant." still reads English in a zh window. At the tip the same command is 7/7/0; clean main on the same file is 6/6/0.

Risk gate over the seven changed paths, objects carrying patch (the shape the PR files API serves): T1 0 24 3 4 — hand-written 24 lines / 3 files, 4 generated paths. The names-only trap reproduced on the same diff (T0 0 0 7 0), and the no-patch trap reproduces T3. Budget leaves 376 lines / 17 files. The forbidden regex (core/src/host/, plugins/, .github/, scripts/, about.js, capability-settings.js, sidebar.js, project-board.js) hits 0 with the positive control on the same regex hitting 4; core/src/client/settings.js is absent from the diff (0) while grep -c "t(plugin.purpose)" there is 2; the four i18n-*.baseline.json are absent (0); git diff … core/src/client/i18n.js | grep -c '^-[^-]' is 0.

Not run (and why): the full TZ=UTC npm run verify. The shared core/node_modules here carries only esbuild and a few packages — no @deepseek-ai/dsh-* harness and no jsdom — so the core suite cannot start on this box, and the brief forbids npm ci / npm run harness; CI carries the full suite at this tip. Everything runnable here ran at this tip: the affected test file, the five i18n gates, the four baseline counts, the bundle check, the patch checks, changelog, the mojibake byte scan and arch-docs.

Checkpoint

{
  "pr": 3271,
  "claim": "Dev",
  "issue": 3270,
  "summary": "The Project plugin's row on Settings → Plugins drew its purpose in English in a Chinese window: the draw point already read t(plugin.purpose), but the dictionary had no key for the fifth purpose. One whole-sentence key in core/src/client/i18n.js now reads 运行一个项目:…; no component, no structure and no draw point change, and an English window is unchanged. The new test reads all five purposes from the host catalogue, so a sixth plugin shipped without a key fails it: red first 7/6/1, after the fix 7/7/0. The bundle and the generated patch artifacts were regenerated, never hand-edited.",
  "files": [
    "core/src/client/i18n.js",
    "core/test/plugin-installed-faces.test.js",
    "changelog.d/3114-cut-37-plugin-purpose.fixed.md",
    "core/client.js",
    "patches/ds-bot/0001-core-fixes.patch",
    "patches/ds-bot/0008-client-bundle.patch",
    "patches/ds-bot/files/test/plugin-installed-faces.test.js"
  ],
  "checks": {
    "ran": "plugin-installed-faces 7/6/1 red then 7/7/0 green; five i18n gates 41/41/0; baselines 12/9/46/2; npm run build; ds-bot-patches generate/canonical/check; build-client --check; changelog 18; mojibake 1787; arch-docs OK (7); risk gate T1 0 24 3 4",
    "result": "green",
    "at": "53adc4b1162a796fb8cdd51242682ba60cca383b"
  },
  "next": "none — ready for review"
}

…anguage (#3114)

Docs-not-needed: one dictionary key, one test and one changelog fragment; no component or structure change.
@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 20, 2026
@Birfy Birfy self-assigned this Nov 20, 2026
@Birfy

Birfy commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Base check at 2026-11-20T15:58Z: main is c18bb9fb2440f0c6c865a86e0c06c32d7ddc68a3 (#3260, which touched only .github/scripts/auto-queue-t1.*), while this branch was cut from 7f95f0cfffb1d0dfb14ba8b58e5ebe19c5c8f388. The seven paths here do not overlap that commit, GET /pulls/3271 reports mergeable: true / mergeable_state: clean, and the main merge queue ruleset (25173372) has strict_required_status_checks_policy: false — so no rebase and no rewrite of this branch.

Re-ran everything at tip 53adc4b1162a796fb8cdd51242682ba60cca383b just now: plugin-installed-faces.test.js 7/7/0 (red on the 7f95f0cf base with only the new test in the tree: not ok 7, 7/6/1; clean main on the same file 6/6/0) · the five i18n gates 41/41/0 · baselines 12/9/46/2 · changelog 18 (main 17) · ds-bot-patches canonical and check ok · build-client --check rc 0 · mojibake 0 occurrences … in 1787 text file(s) rc 0 · arch-docs: OK (7 changed file(s)) rc 0 · risk gate over the PR files objects with patch: T1 0 24 3 4 (names-only trap T0, no-patch trap T3 both reproduce). Enqueue stays with the PR fast lane; nothing was queued.

@Birfy
Birfy added this pull request to the merge queue Nov 20, 2026
@Birfy

Birfy commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Spot-check at the tip, before the queue (enqueue node)

Read at 2026-11-20T16:02Z–16:07Z via GitHub REST: /pulls/3271, /pulls/3271/files (objects carrying patch), /commits/53adc4b1.../check-runs, GraphQL enqueuePullRequest. Tip 53adc4b1162a796fb8cdd51242682ba60cca383b (tree b9091eb696b8a814ed6f0e7cb7a44bf0be0959c1), base main c18bb9fb2440f0c6c865a86e0c06c32d7ddc68a3. Every number below was measured here on the tip tree (tree-identical local checkout, git rev-parse HEAD^{tree} = the API commit's tree), not copied from the description.

  1. Shape: 7 files, +49 / −6 — core/src/client/i18n.js +2/−0, core/test/plugin-installed-faces.test.js +19/−2, changelog.d/3114-cut-37-plugin-purpose.fixed.md +1/−0, core/client.js +2/−0, patches/ds-bot/0001-core-fixes.patch +3/−1, patches/ds-bot/0008-client-bundle.patch +3/−1, patches/ds-bot/files/test/plugin-installed-faces.test.js +19/−2. Exact match, nothing extra.
  2. Draw point untouched: core/src/client/settings.js in the diff → 0 (also 0 in the files API); it still reads t(plugin.purpose) on 2 lines (grep -c). This cut is the dictionary, not the draw.
  3. Dictionary adds only: removed lines in the i18n.js hunk ^-[^-] → 0. New key Run a Project: Project State, its board, its own Chief, its team and its assistant. → 运行一个项目:Project State、它的看板、它自己的 Chief、它的团队和助手。 — 1 occurrence each in i18n.js (the source dictionary); the same sentence reappears only in the generated mirrors (core/client.js, 0001, 0008, files/src/host/plugins.js, 6 files total), never a second dictionary entry.
  4. The test guards the class, not one key: it reads purpose: from core/src/host/plugins.js — 5 entries — and asserts, with the zh locale installed, that none of the five English purposes is still drawn, plus 运行一个项目. A sixth plugin without a key fails it.
  5. Red first → green, run here: clean base tree fc2b56dc (= main 7f95f0cf's tree) + only the new test, implementation at base → # tests 7 / # pass 6 / # fail 1, not ok 7, "Run a Project: …" still reads English in a zh window; clean base without the new test → 6/6/0; tip → 7/7/0. Five i18n gates at the tip → 41/41/0.
  6. Baselines untouched: baseline.json in the diff → 0; the four read as entry counts 12 / 9 / 46 / 2; no --write was run.
  7. Forbidden surface: the diff matches ^(core/src/host/|plugins/|\.github/|scripts/|core/src/client/(about|capability-settings|sidebar|project-board)\.js$) → 0; the same regex on a 6-path positive control → 5.
  8. Risk tier, computed here with main's own risk-gate.mjs + risk-rules.json over the PR-files objects carrying patch: T1 0 24 3 4 (24 hand-written lines / 3 files / 4 generated). Both traps reproduce: names-only strings → T0 0 0 7 0; objects stripped of patch → T3 3 24 3 4. T1 direct path, so this comment comes from the enqueue node rather than review.
  9. Generated artifacts: node core/scripts/build-client.mjs --check → rc 0; node scripts/ds-bot-patches.mjs 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/; canonical → ok patches/ds-bot/ is what generate writes (generate is a no-op); git status --porcelain → 0 lines.
  10. Other gates: changelog.mjs check → 18 fragments; check-mojibake.mjs --check → 0 occurrences of U+FFFD in 1787 text files; ARCH_DOCS_BASE=HEAD~1 check-arch-docs.mjs → arch-docs: OK (7 changed file(s)) rc 0.

Checks at the tip (20 total, all terminal): 17 success / 2 skipped / 1 cancelled, 0 failure. tests-ok, merge-gate, enqueue-guard, policy-sign, ubuntu-latest · Node 24 · DSH 0.2.0-rc.2 all success; the two skipped are window check / live. The single cancelled is a duplicate agent-audience copy (a second agent-audience is success), and agent-audience is not a required context. main's required contexts are ubuntu-latest · Node 24 · DSH 0.2.0-rc.2, tests-ok and merge-gate — all three green — and GraphQL reports mergeStateStatus: CLEAN, statusCheckRollup: SUCCESS.

Enqueue preconditions: tier T1 → no PASS required; no hold; agent-pr present; body has Fixes #3270 / Part of #3114; not draft; ## Checkpoint block 1439 chars ≤ 1500, all seven fields present, summary 586 ≤ 600, checks.at = the tip. enqueue-guard here → **ALLOW — enqueue #3271: no hold and the gate passes; a T1 tier or a mechanical release PR`.

Enqueued at 2026-11-20T16:06:37Z: entry MQE_lQDOVIxL0c8AAAABQtQDeM4ABOPczgQt_kA, position 1, state QUEUED, expectedHeadOid = the tip above. Watching the merge_group Test / Merge gate / Enqueue guard next.

Merged via the queue into main with commit 64b2674 Nov 20, 2026
19 of 20 checks passed
@Birfy
Birfy deleted the dev/3114-plugin-purpose-zh branch November 20, 2026 16:10
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 20, 2026
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.

设置:插件页 Project 那一行的用途句在中文窗口读英文(Cut 37)

1 participant