Repository navigation
Commit 64b2674
authored
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:
```text
$ cd core && TZ=UTC node --test test/plugin-installed-faces.test.js
# red first (clean 7f95f0c 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
<!-- flybot:checkpoint -->
```json
{
"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"
}
```
<!-- /flybot:checkpoint -->
1 parent c18bb9f commit 64b2674
7 files changed
Lines changed: 49 additions & 6 deletions
File tree
- changelog.d
- core
- src/client
- test
- patches/ds-bot
- files/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1519 | 1519 | | |
1520 | 1520 | | |
1521 | 1521 | | |
| 1522 | + | |
| 1523 | + | |
1522 | 1524 | | |
1523 | 1525 | | |
1524 | 1526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1476 | 1476 | | |
1477 | 1477 | | |
1478 | 1478 | | |
| 1479 | + | |
| 1480 | + | |
1479 | 1481 | | |
1480 | 1482 | | |
1481 | 1483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1828 | 1828 | | |
1829 | 1829 | | |
1830 | 1830 | | |
1831 | | - | |
| 1831 | + | |
1832 | 1832 | | |
1833 | 1833 | | |
1834 | 1834 | | |
| |||
1847 | 1847 | | |
1848 | 1848 | | |
1849 | 1849 | | |
| 1850 | + | |
| 1851 | + | |
1850 | 1852 | | |
1851 | 1853 | | |
1852 | 1854 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1081 | 1081 | | |
1082 | 1082 | | |
1083 | 1083 | | |
1084 | | - | |
| 1084 | + | |
1085 | 1085 | | |
1086 | 1086 | | |
1087 | 1087 | | |
| |||
1100 | 1100 | | |
1101 | 1101 | | |
1102 | 1102 | | |
| 1103 | + | |
| 1104 | + | |
1103 | 1105 | | |
1104 | 1106 | | |
1105 | 1107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
0 commit comments