coopani-world-journey 1.6.21 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,129 @@
1
1
  # 更新日志
2
2
 
3
+ ## 1.7.0 — 2026-11-14
4
+
5
+ > 「敦煌市明明是个市,敦煌博物馆却建在沙漠里非常离谱。」
6
+ > 「我想让她能够完全按照自己看到了什么为主去生成图片,而不是靠我们自己一个一个去补充
7
+ > (我发现让 agent 一个一个去完善也是有点不合理的)。」
8
+
9
+ ### 根因:不是那句话没写好,是退回规则本身
10
+
11
+ 提示词拼地点时有三条路:
12
+
13
+ | 情况 | 用的是 |
14
+ |---|---|
15
+ | 有景点专属锚点 | 锚点本身(准) |
16
+ | 没有 | `敦煌博物馆。周边一带是<敦煌城市锚点>` |
17
+ | 只拍城市 | 城市锚点(本来就该用它) |
18
+
19
+ 第二条拿的是**整座城的平均长相**。敦煌那条里写着「党河两岸窄绿洲…出城就是连片沙丘,
20
+ 沙脊锋利」—— 套在市区的一个博物馆上,博物馆就搬进了沙丘。
21
+ 「周边一带是」这层划线是去年加的止血,对模型不构成约束。
22
+
23
+ **这不是个例。** 数过:`SPOT_LOOK` 60 城 136 条,`CITIES` 185 城 × 3–9 个点,
24
+ 覆盖率约 **15%** —— 剩下 85% 全走第二条路。代码里早写着这个死结
25
+ (「1300 条,这条先止血」)。这次不再补条数,改判据。
26
+
27
+ ### 改法:判「这是什么地方」,不判「它长什么样」
28
+
29
+ 新增 `src/geo/spot-profile.ts`,从地名判两件事:
30
+
31
+ - **类型** —— 博物馆 / 石窟 / 关隘 / 街区 / 水域 / 地貌…
32
+ - **在哪** —— 市区 / 野外
33
+
34
+ 两条都是地点自身的事实,不依赖谁去写描述。于是:
35
+
36
+ 1. **市区景点的城市锚点里,野外分句整段砍掉**(`trimVistaFor`)——
37
+ 敦煌博物馆拿到「党河绿洲、平顶房、白杨」,没有沙丘。
38
+ 2. **室内的三样一律不写**:周边一带、天空句、季节句。
39
+ 这条不是设计的,是出图逼出来的(见下)。
40
+ 3. **类型形制只在「她没写画面」时兜底一句**(`form`)。她写了 `describe`
41
+ 就一个字都不塞 —— 这是「以她看到的为主,系统只兜底」的那条线。
42
+ 4. **自然类(山 / 水面 / 地貌)不给形制**:名字已经说清它是水是山,
43
+ 再补一句只是占长度(西湖探针 206 字)。
44
+ 5. **事实也给她**:`nowSummary` 的「此刻在X」后面多一个括号 ——
45
+ 「此刻在敦煌博物馆(室内展馆,在市区)」。她写 `describe` 时才有依据,
46
+ 而不是拿「敦煌」两个字去推。ENV_PROMPT 和 `journey_photo` 的描述同步讲清怎么用。
47
+
48
+ ### 出图验的:一张图推翻了一个「够了」
49
+
50
+ 本机 ComfyUI、同一个 workflow、同一颗种子(777777)、1664×928,只换提示词:
51
+
52
+ | 版本 | 出来的是什么 |
53
+ |---|---|
54
+ | 改之前 | 沙丘直接压到房子背后,一栋土黄平房 —— 就是「博物馆建在沙漠里」 |
55
+ | 只剔沙丘(第一版改法) | 沙丘没了,**但仍然是一条村街**:平顶房、葡萄架、河边小路 |
56
+ | 再把室内的周边/天空/季节全退掉 | **室内展厅**:敦煌壁画、玻璃展柜、射灯、参观的人 |
57
+
58
+ 第二张是关键。当时的提示词是「敦煌博物馆,室内,展柜和展墙。周边一带:平顶房、
59
+ 白杨葡萄架夹着巷子…」—— 模型在「室内」和「一条村街」之间选了后者。
60
+
61
+ **句子之间不是平等的:互相矛盾的描述里,写得多的那半边赢。**
62
+ 所以「室内」不是一个形容词,是一条要贯彻到整条提示词的边界。
63
+
64
+ 对照没被误伤:同一个 workflow 下雅丹魔鬼城仍是野外土台垄岗,不是室内。
65
+
66
+ ### 判定顺序:后缀优先,不是包含
67
+
68
+ 第一版按「包含」判,拿 1510 个真实地点跑出来一片错:
69
+
70
+ | 名字 | 按包含判 | 实际 |
71
+ |---|---|---|
72
+ | 兰州·中山桥 | 山 | 桥 |
73
+ | 兰州·黄河楼 | 水 | 楼 |
74
+ | 天水·大地湾遗址 | 水(湾) | 遗址 |
75
+ | 西宁·塔尔寺 | — | 寺院 |
76
+
77
+ 全是同一个病:**专名里的字被当成了类别**。改成先用锚定结尾的表判,
78
+ 判不出才退回包含规则。另外括号里的补充说明先剥掉 ——
79
+ 「沙湖(石嘴山平罗县)」里的「石嘴山」差点让沙湖变成山。
80
+
81
+ ### 回归:不该动的一个字都没动
82
+
83
+ 新 `photoPrompt` 对旧版逐字比对,185 城 × 全部景点 × 6 题材 × 3 个时刻:
84
+
85
+ | | 数 |
86
+ |---|---|
87
+ | 完全相同 | 26394 |
88
+ | 有变化 | 4134 |
89
+ | **变化里不在预期范围的** | **0** |
90
+
91
+ 4134 条变化**全部**是「无专属锚点 + `ground`」。有锚点的、只拍城市的、
92
+ `minimal` / `onRoad` / `sky` 全部一字未变。
93
+
94
+ ### 顺手审出来的两处(144 天长跑抓的)
95
+
96
+ 按要求把生图以外的功能也按新标准过了一遍,四档长跑(plain / invite / money / goto)跑出来两条:
97
+
98
+ **① `journey.part` 重复推。** money 档挂在不变量「同一个 senderKey 只许推一次」上,
99
+ key 是 `part-0000000000000007-2027-01-21T06:55:00.000Z`。
100
+
101
+ 根因在「约定到期该散伙」那条路:天数满了 → 推一句「各走各的」→ 进 `moveOn`,
102
+ 而 `moveOn` 买不起票会**原地返回、不清约定**(设计如此,明天接着试)。
103
+ 下一个 tick 又落进同一分支,同一句话再推一遍。
104
+
105
+ 修法放在 `push()` 这一层,不在那条分支里:key 的语义本来就是「这件事的身份」,
106
+ 同一个 key 推两次在任何分支上都是 bug。内存集合去重,命中就跳过并记一行日志。
107
+
108
+ **重放的代价比少说一句大得多** —— 她会把这个源判定成「会重放旧事件的东西」,然后开始忽略它。
109
+ 一次重复,等于后面所有事件的可信度打折。
110
+
111
+ **② 两个事件从来没登记过。** `JOURNEY_DESCRIBE.events` 上面写着「必须与源码里 push 的类型一一对应」,
112
+ 而 `journey.part`(11-12 起就在推)和 `journey.pledge` 都不在表里。
113
+
114
+ 漏登记的后果不在运行,在**排查**:面板和诊断里看不到它们,出问题时不会想起还有这一种事件。
115
+ 补登记之外加了一条测试(`test/event-registry.test.mjs`),**正反两向都查**:
116
+ 推了没登记的、登记了没人推的,都报错。
117
+
118
+ ### 边界
119
+
120
+ - **判不出就返回空**,走老行为(约 24%)。不猜 —— 猜错出坏图,判不出最多少改一处。
121
+ - **`岛$` 刻意不收**:鼓浪屿是岛上的老别墅,东极岛是渔村海崖,蜈支洲岛是沙滩,
122
+ 同样叫「岛」,画面没有共同点。
123
+ - **野外判定靠类型,不靠坐标**。想更准得给每个点查坐标(高德 `place/text` 已有 key),
124
+ 这一轮没做,`fort`(关城多在戈壁)就故意不下 urban 判断。
125
+ - **`street` 题材不走这条路**,它有自己的模板,博物馆的街景仍是城市风貌。
126
+
3
127
  ## 1.6.21 — 2026-11-13
4
128
 
5
129
  一条来自 Discussion #586 的反馈:
package/ENV_PROMPT.md CHANGED
@@ -183,10 +183,12 @@
183
183
 
184
184
  所以他说「拍一下那个卖糖画的」「来张你头顶的天」「拍你脚边的猫」,你不用问,直接拍 ——
185
185
  把他说的事写成一句 `describe`(60 字内,**用英文写**),再决定要不要 `focus` 补一句怎么取景。
186
- 英文这一条别省:他说的是中文,但 `describe` 是给生图模型的,本地那套读不懂中文(见工具表)。
186
+ 英文别省:本地那套读不懂中文(见工具表)。
187
187
 
188
- 一句就够,别写景。写成「黄昏的老街,青石板被雨打得发亮,一个穿蓝布衫的老人挑着担子走过」
189
- 这种,程序给的事实会被淹掉,出来反而不像你看见的。
188
+ 一句就够,别写景。写成「黄昏的老街,青石板被雨打得发亮,老人挑着担子走过」这种,事实会被淹掉,反而不像你看见的。
189
+
190
+ **写之前看 `journey_now` 里「此刻在 X(室内展馆,在市区)」那个括号** —— 那是这地方的性质,
191
+ 画面按它来。括号空着就是认不出,只写你确实看得到的,别按城市名推。
190
192
 
191
193
  **你能写,程序不会替你想。** 你不写,画面就只有「城市 + 景点 + 光」那点东西。
192
194
 
package/describe.json CHANGED
@@ -164,7 +164,7 @@
164
164
  },
165
165
  "describe": {
166
166
  "type": "string",
167
- "description": "Optional, one short line describing WHAT IS IN THE FRAME, at most 60 characters. **Write it in English** - this string goes straight into the image model, and local SDXL CLIP cannot read Chinese (it comes back as gibberish with brush-script watermarks). \"a calico cat crouching under a streetlight, looking up\" / \"empty platform, one bench, half a bottle of water\". This is the content of the shot, not the framing (that is `focus`). Only describe what is really here right now: the place she is at, this season, this weather. Never add flowers, snow, festivals or crowds that this place and season do not have. If nothing is worth describing, leave it out - the program already describes the place and light."
167
+ "description": "Optional, one short line describing WHAT IS IN THE FRAME, at most 60 characters. **Write it in English** - this string goes straight into the image model, and local SDXL CLIP cannot read Chinese (it comes back as gibberish with brush-script watermarks). \"a calico cat crouching under a streetlight, looking up\" / \"empty platform, one bench, half a bottle of water\". This is the content of the shot, not the framing (that is `focus`). Only describe what is really here right now: the place she is at, this season, this weather. The spot in `journey_now` comes with a parenthetical - \"(indoor museum, downtown)\", \"(cliff caves, out in the wild)\" - that is what KIND of place it is. Write the frame to match that kind: a hall with display cases for a museum, a cliff face for caves, a street of shopfronts for a downtown block. If the parenthetical is missing, the program could not tell - then describe only what she can actually see, and do not infer the surroundings from the city name.Never add flowers, snow, festivals or crowds that this place and season do not have. If nothing is worth describing, leave it out - the program already describes the place and light."
168
168
  },
169
169
  "focus": {
170
170
  "type": "string",
@@ -716,6 +716,22 @@
716
716
  },
717
717
  "trigger": "flush"
718
718
  },
719
+ {
720
+ "type": "journey.part",
721
+ "description": {
722
+ "zh": "跟同伴散伙:约好的天数满了,今天各走各的。",
723
+ "en": "She and her travel companion part ways: the agreed days are up."
724
+ },
725
+ "trigger": "flush"
726
+ },
727
+ {
728
+ "type": "journey.pledge",
729
+ "description": {
730
+ "zh": "原来的约定被推掉了:他叫她改去别处,跟人说好的那趟去不成。",
731
+ "en": "An earlier promise is dropped: the person redirected her, so the agreed trip cannot happen."
732
+ },
733
+ "trigger": "debounce"
734
+ },
719
735
  {
720
736
  "type": "journey.work",
721
737
  "description": {
package/package.json CHANGED
@@ -1,75 +1,75 @@
1
- {
2
- "name": "coopani-world-journey",
3
- "version": "1.6.21",
4
- "type": "module",
5
- "description": "让桌宠真的出门旅行:一百八十六座城、每座都有真地标,她自己挑去哪、怎么去,路上真耗那些时间;到站按当地时间吃饭、看日出、住店、写日记,月底出一页手账。填个公共地址能和别人的宠物碰面;装了音乐或打车扩展,她还会跟着歌走、把别人叫的车记进自己的账;一起走过的那几天,还能互留一句话和号,散了也找得回。需 Coopani 0.2.17 以上。",
6
- "author": {
7
- "name": "Mr.Q"
8
- },
9
- "license": "MIT",
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/fateSSD/coopani-world-journey.git"
13
- },
14
- "bugs": {
15
- "url": "https://github.com/fateSSD/coopani-world-journey/issues"
16
- },
17
- "homepage": "https://github.com/fateSSD/coopani-world-journey#readme",
18
- "keywords": [
19
- "cortico-world",
20
- "cortico",
21
- "travel",
22
- "journey",
23
- "companion",
24
- "memory"
25
- ],
26
- "os": [
27
- "win32",
28
- "darwin",
29
- "linux"
30
- ],
31
- "engines": {
32
- "node": ">=22"
33
- },
34
- "main": "./src/index.ts",
35
- "exports": {
36
- ".": "./src/index.ts"
37
- },
38
- "cortico": {
39
- "kind": "world",
40
- "api": 6,
41
- "displayName": "大肥鱼环游世界",
42
- "icon": "assets/icon.png",
43
- "describe": "describe.json",
44
- "webUiClient": "dist/webui.js",
45
- "webUiStyle": "dist/webui.css",
46
- "tags": [
47
- "apps",
48
- "companion",
49
- "memory",
50
- "creative"
51
- ],
52
- "locales": {
53
- "zh": {
54
- "displayName": "大肥鱼环游世界",
55
- "description": "让桌宠真的出门旅行,不是在地图上跳一下。(需 Coopani 0.2.17 以上)\n\n- **她自己走**:从你家出发,自己挑去哪、怎么去;你点名也照办。\n- **城里是真的**:一百八十六座城,每座六到十个真地标,路线连着走、不走回头路。\n- **日子也是真的**:按当地时间吃饭、看日出、住店、写日记,月底出一页手账。\n- **会遇上别人**:填一个公共地址,和别人的宠物约在下一站碰面。\n\n**和别的扩展一起用**\n\n- **听歌上路**:装了音乐扩展,她放歌时会记住歌里的地名,写进「想去」,合适的时候真的去。\n- **别人叫的车也记她的账**:装了「鱼鱼出行」这类打车扩展,城里的车就交给它 —— 车费进旅行总花销、写进当天日记,首页多一张「正在打车」。景区里的索道、观光车、自行车仍归她自己管。没装就完全不受影响。\n- **碰面**:和别人的宠物约在同一座城,一起过的那几天,三餐、白天逛的地方、夜里的活动都会写到对方;关系深了说话的口气也变。\n\n- **散了还找得回**:一起走过的那几天,能互留一句话、一个号;还有一张名片,只有真一起走过的鱼看得见。都留 30 天,不续就自己收回去。"
56
- },
57
- "en": {
58
- "displayName": "Big Fish World Tour",
59
- "description": "She actually travels, instead of hopping around a map. Needs Coopani 0.2.17+\n\n- **She picks the way**: from your home she chooses where to go and how; tell her and she obeys.\n- **The cities are real**: 185 of them, 6-10 real landmarks each, routed as one line without backtracking.\n- **So are the days**: local meals, sunrises, hotels, a diary; a photo-book page at month end.\n- **She meets others**: add a public server and she can meet other people's pets en route.\n\n**Works with other extensions**\n\n- **Music on the road**: with the music extension installed she keeps the place names from what you play, files them under \"want to go\", and eventually goes.\n- **Their rides land on her bill**: with a ride-hailing extension such as Fish Ride installed, city rides are theirs - the fare goes into her travel spending, into that day's diary, and onto the home panel as an \"on a ride\" card. Cable cars, park shuttles and bikes inside a spot are still hers. Without it, nothing changes.\n- **Meetings**: agree on a city with someone else's pet - through those days the meals, the spots and the evenings all involve them, and the way they talk shifts as they get closer.\n\n- **Still findable after parting**: those days together you can leave each other a line and a contact, plus a card only fish you actually travelled with can see. Both last 30 days, then expire."
60
- }
61
- }
62
- },
63
- "files": [
64
- "src",
65
- "data",
66
- "dist",
67
- "assets",
68
- "site",
69
- "docs",
70
- "ENV_PROMPT.md",
71
- "README.md",
72
- "CHANGELOG.md",
73
- "describe.json"
74
- ]
75
- }
1
+ {
2
+ "name": "coopani-world-journey",
3
+ "version": "1.7.0",
4
+ "type": "module",
5
+ "description": "让桌宠真的出门旅行:一百八十六座城、每座都有真地标,她自己挑去哪、怎么去,路上真耗那些时间;到站按当地时间吃饭、看日出、住店、写日记,月底出一页手账。填个公共地址能和别人的宠物碰面;装了音乐或打车扩展,她还会跟着歌走、把别人叫的车记进自己的账;一起走过的那几天,还能互留一句话和号,散了也找得回。需 Coopani 0.2.17 以上。",
6
+ "author": {
7
+ "name": "Mr.Q"
8
+ },
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/fateSSD/coopani-world-journey.git"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/fateSSD/coopani-world-journey/issues"
16
+ },
17
+ "homepage": "https://github.com/fateSSD/coopani-world-journey#readme",
18
+ "keywords": [
19
+ "cortico-world",
20
+ "cortico",
21
+ "travel",
22
+ "journey",
23
+ "companion",
24
+ "memory"
25
+ ],
26
+ "os": [
27
+ "win32",
28
+ "darwin",
29
+ "linux"
30
+ ],
31
+ "engines": {
32
+ "node": ">=22"
33
+ },
34
+ "main": "./src/index.ts",
35
+ "exports": {
36
+ ".": "./src/index.ts"
37
+ },
38
+ "cortico": {
39
+ "kind": "world",
40
+ "api": 6,
41
+ "displayName": "大肥鱼环游世界",
42
+ "icon": "assets/icon.png",
43
+ "describe": "describe.json",
44
+ "webUiClient": "dist/webui.js",
45
+ "webUiStyle": "dist/webui.css",
46
+ "tags": [
47
+ "apps",
48
+ "companion",
49
+ "memory",
50
+ "creative"
51
+ ],
52
+ "locales": {
53
+ "zh": {
54
+ "displayName": "大肥鱼环游世界",
55
+ "description": "让桌宠真的出门旅行,不是在地图上跳一下。(需 Coopani 0.2.17 以上)\n\n- **她自己走**:从你家出发,自己挑去哪、怎么去;你点名也照办。\n- **城里是真的**:一百八十六座城,每座六到十个真地标,路线连着走、不走回头路。\n- **日子也是真的**:按当地时间吃饭、看日出、住店、写日记,月底出一页手账。\n- **会遇上别人**:填一个公共地址,和别人的宠物约在下一站碰面。\n\n**和别的扩展一起用**\n\n- **听歌上路**:装了音乐扩展,她放歌时会记住歌里的地名,写进「想去」,合适的时候真的去。\n- **别人叫的车也记她的账**:装了「鱼鱼出行」这类打车扩展,城里的车就交给它 —— 车费进旅行总花销、写进当天日记,首页多一张「正在打车」。景区里的索道、观光车、自行车仍归她自己管。没装就完全不受影响。\n- **碰面**:和别人的宠物约在同一座城,一起过的那几天,三餐、白天逛的地方、夜里的活动都会写到对方;关系深了说话的口气也变。\n\n- **散了还找得回**:一起走过的那几天,能互留一句话、一个号;还有一张名片,只有真一起走过的鱼看得见。都留 30 天,不续就自己收回去。"
56
+ },
57
+ "en": {
58
+ "displayName": "Big Fish World Tour",
59
+ "description": "She actually travels, instead of hopping around a map. Needs Coopani 0.2.17+\n\n- **She picks the way**: from your home she chooses where to go and how; tell her and she obeys.\n- **The cities are real**: 185 of them, 6-10 real landmarks each, routed as one line without backtracking.\n- **So are the days**: local meals, sunrises, hotels, a diary; a photo-book page at month end.\n- **She meets others**: add a public server and she can meet other people's pets en route.\n\n**Works with other extensions**\n\n- **Music on the road**: with the music extension installed she keeps the place names from what you play, files them under \"want to go\", and eventually goes.\n- **Their rides land on her bill**: with a ride-hailing extension such as Fish Ride installed, city rides are theirs - the fare goes into her travel spending, into that day's diary, and onto the home panel as an \"on a ride\" card. Cable cars, park shuttles and bikes inside a spot are still hers. Without it, nothing changes.\n- **Meetings**: agree on a city with someone else's pet - through those days the meals, the spots and the evenings all involve them, and the way they talk shifts as they get closer.\n\n- **Still findable after parting**: those days together you can leave each other a line and a contact, plus a card only fish you actually travelled with can see. Both last 30 days, then expire."
60
+ }
61
+ }
62
+ },
63
+ "files": [
64
+ "src",
65
+ "data",
66
+ "dist",
67
+ "assets",
68
+ "site",
69
+ "docs",
70
+ "ENV_PROMPT.md",
71
+ "README.md",
72
+ "CHANGELOG.md",
73
+ "describe.json"
74
+ ]
75
+ }
package/site/pets.html CHANGED
@@ -179,6 +179,8 @@
179
179
  <p class="viewhint">
180
180
  「此刻在线」= 最近 30 分钟有上报;「今天来过」= 今天任意时刻有过上报。
181
181
  超过半小时没动静的鱼会掉出这个列表 —— 她在家待着就不报,这是正常的。
182
+ <b>这两个数是全站口径,下面的名单只列最近上报的 60 只</b>(人多的时候,
183
+ 在线数会比名单长得多)。要找自己那只,切到「在册」页用搜索框按名字找。
182
184
  </p>
183
185
  <div class="live" id="liveNum"></div>
184
186
  <!-- 名单单独一张表:挤成一行「名字 在 城市 · 干嘛 | …」既难读,也看不出谁最后报的。 -->
@@ -191,6 +193,17 @@
191
193
  只留最近 4 天,每只鱼按**最近一次上报**合并成一行。这里是历史,不会自己刷新 ——
192
194
  想看新的就点上面的「刷新」。
193
195
  </p>
196
+ <!--
197
+ 找人(2026-11-13)。
198
+ 池子上 300 多只之后,「我在哪一行」变成了一个真实的问题 ——
199
+ Mr.Q 报「看不到我的鱼名字,但她在线一整天」,查下来是上面那块只列 60 只、
200
+ 而全站在报的有 160 多只。这里给一个纯前端过滤:数据已经在内存里,
201
+ 输入即筛,不多读一行库。
202
+ -->
203
+ <div class="field" id="findWrap" style="max-width:340px;margin:0 0 12px">
204
+ <label for="find">找自己那只</label>
205
+ <input id="find" type="search" spellcheck="false" placeholder="名字或 uid,输几个字就筛">
206
+ </div>
194
207
  <div class="scroller">
195
208
  <table>
196
209
  <thead><tr>
@@ -214,6 +227,8 @@
214
227
  (function () {
215
228
  var $ = function (id) { return document.getElementById(id); };
216
229
  var urlIn = $('url'), keyIn = $('key'), msg = $('msg'), rows = $('rows');
230
+ /* 筛选框与它用的那份数据(2026-11-13)。`allPets` 是服务端回的全量,`findIn` 变了就重画。 */
231
+ var findIn = $('find'), allPets = [];
217
232
  var STORE = 'journey.pets.admin';
218
233
  var base = '', hdr = null, flags = {};
219
234
 
@@ -306,20 +321,36 @@
306
321
  return s;
307
322
  }
308
323
 
309
- function render(pets) {
324
+ function render(list) {
310
325
  /*
311
326
  * 这块只讲**累计**。此刻在线 / 今天来过的数已经搬到上面那块了 ——
312
327
  * 三个数挤在一行,2026-11-06 和 11-10 两次被读成「哪边坏了」;
313
328
  * 这次不是改文案,是拆接口(`/admin/live` 与 `/admin/pets`)。
314
329
  */
315
- var tail = (pets.length >= 800 ? '(已截断,看最近 800 条上报)' : '')
316
- + (pets.length ? ' · 只留最近 4 天' : '');
330
+ allPets = list || [];
331
+ /*
332
+ * 筛选(2026-11-13):纯前端,数据已经在内存里,输入即筛,不多读一行库。
333
+ * 名字和 uid 都能搜 —— uid 给「名字重名、分不清哪个是我」时用。
334
+ */
335
+ var q = (findIn && findIn.value ? findIn.value : '').trim().toLowerCase();
336
+ var pets = q
337
+ ? allPets.filter(function (p) {
338
+ return String(p.pet || '').toLowerCase().indexOf(q) >= 0
339
+ || String(p.uid || '').toLowerCase().indexOf(q) >= 0;
340
+ })
341
+ : allPets;
342
+ var tail = (allPets.length >= 800 ? '(已截断,看最近 800 条上报)' : '')
343
+ + (allPets.length ? ' · 只留最近 4 天' : '');
317
344
  if (!pets.length) {
318
- rows.innerHTML = '<tr><td colspan="7" class="empty">池子里现在没人。</td></tr>';
319
- $('countNote').textContent = '0 只' + tail;
345
+ rows.innerHTML = '<tr><td colspan="7" class="empty">'
346
+ + (q ? '没有名字或 uid 含「' + esc(q) + '」的鱼。' : '池子里现在没人。')
347
+ + '</td></tr>';
348
+ $('countNote').textContent = (q ? '筛出 0 / 共 ' + allPets.length + ' 只' : '0 只') + tail;
320
349
  return;
321
350
  }
322
- $('countNote').textContent = pets.length + ' 只(累计)' + tail;
351
+ $('countNote').textContent = (q
352
+ ? '筛出 ' + pets.length + ' / 共 ' + allPets.length + ' 只'
353
+ : pets.length + ' 只(累计)') + tail;
323
354
  rows.innerHTML = pets.map(function (p) {
324
355
  var f = flags[p.uid] || null;
325
356
  var kind = f ? f.kind : '';
@@ -409,8 +440,13 @@
409
440
  var today = Number(data.today) || 0;
410
441
  var win = Number(data.onlineWindowMin) || 30;
411
442
  var who = (data.pets || []);
443
+ /*
444
+ * 名单只有 60 条,而「此刻在线」是全站口径(2026-11-13)。
445
+ * 两个数并排摆着、又不说为什么不一样,就是「我明明在线,列表里找不到我」的来源。
446
+ */
412
447
  $('liveNote').textContent = n
413
- ? '最近 ' + win + ' 分钟有上报 · ' + clockOf(data.at) + ' 更新'
448
+ ? '最近 ' + win + ' 分钟 ' + n + ' 只在报 · 下面列最近 ' + who.length + ' 只 · '
449
+ + clockOf(data.at) + ' 更新'
414
450
  : '最近 ' + win + ' 分钟没有上报';
415
451
 
416
452
  num.innerHTML = ''
@@ -625,6 +661,7 @@
625
661
  $('tabAll').addEventListener('click', function () { go('all'); });
626
662
  $('auto').addEventListener('change', schedule);
627
663
  keyIn.addEventListener('keydown', function (e) { if (e.key === 'Enter') connect(); });
664
+ if (findIn) findIn.addEventListener('input', function () { render(allPets); });
628
665
  rows.addEventListener('click', function (e) {
629
666
  var b = e.target.closest('button[data-kind]');
630
667
  if (!b) return;
@@ -0,0 +1,359 @@
1
+ /**
2
+ * 这个地点到底是什么类型的地方。
3
+ *
4
+ * ## 为什么要有这一层(2026-11-14,Mr.Q 报的「敦煌博物馆建在沙漠里」)
5
+ *
6
+ * 生图提示词原来是这么拼的:
7
+ *
8
+ * 有景点专属锚点 → 用锚点(准)
9
+ * 没有 → `敦煌博物馆。周边一带是<敦煌城市锚点>`(错)
10
+ *
11
+ * 而敦煌的城市锚点是「党河两岸窄绿洲…**出城就是连片沙丘**,沙脊锋利」——
12
+ * 那是**整座敦煌的平均长相**,套在市区里的一个博物馆上,博物馆就搬进了沙丘。
13
+ *
14
+ * 代码里早写着这条的死结:
15
+ *
16
+ * > 真正的解法是景点级锚点(一个景点一条),但 185 城 × 7 个景点 = 1300 条
17
+ *
18
+ * 查了一下实际数据:`SPOT_LOOK` 只有 **60 城 136 条**,覆盖率约 15%。
19
+ * 也就是说剩下 85% 的点全在走城市锚点 —— 这不是个例,是默认行为。
20
+ *
21
+ * 所以不再往「一个点一条」的方向补。改成先判两件事:
22
+ *
23
+ * ① **类型** —— 博物馆 / 石窟 / 关隘 / 夜市……
24
+ * ② **在哪** —— 城里的街区 / 城外的野地
25
+ *
26
+ * 这两条是**地点自身的事实**,不依赖谁去写描述;有了它们,
27
+ * 「博物馆不该在沙丘边上」就不再靠人记得,而是结构上不发生。
28
+ *
29
+ * ## 这一层**不写**什么
30
+ *
31
+ * 不写「这栋楼是什么样」。那是她的活(`PhotoScene.describe`)。
32
+ * 这里只给一句话的**形制**(室内 / 崖面 / 土筑),因为它决定画面里
33
+ * 出现的是墙还是沙子,而且模型光看地名判不出来。
34
+ *
35
+ * 判据界线:**去掉这句,画面会跑到另一个物种上去** → 留;
36
+ * **去掉这句,只是少了个形容词** → 不留。
37
+ */
38
+
39
+ /**
40
+ * 地点类型。刻意不做细 —— 分得越细,「判错」的面积越大,而每一类都要配一句话。
41
+ * 这里每一类都对应一个**画面里必须成立的东西**(室内 / 有屋顶 / 在崖上 / 在野外)。
42
+ */
43
+ export type SpotKind =
44
+ | 'museum' // 室内展馆
45
+ | 'cave' // 崖壁石窟
46
+ | 'temple' // 宗教建筑,有院墙屋顶
47
+ | 'fort' // 关城、城墙、土堡
48
+ | 'palace' // 宫堡式建筑群
49
+ | 'mountain' // 山体
50
+ | 'water' // 水面
51
+ | 'street' // 城内街巷
52
+ | 'bridge' // 桥
53
+ | 'market' // 市集夜市
54
+ | 'geology' // 雅丹、丹霞、石林这类地貌
55
+ | 'ruins' // 遗址、故城、陵墓
56
+ | 'park' // 园林、公园
57
+ | 'tower' // 塔、楼、碑这类单体的标志物
58
+ | '';
59
+
60
+ /** 在城里还是在野地。二分就够 —— 判细了没有数据支撑。 */
61
+ export type SpotSetting = 'urban' | 'wild' | '';
62
+
63
+ export interface SpotProfile {
64
+ readonly kind: SpotKind;
65
+ /** 画面里有屋顶、有墙、有室内。这一条决定它不可能出现在荒漠里。 */
66
+ readonly indoor: boolean;
67
+ readonly setting: SpotSetting;
68
+ /**
69
+ * 一句话形制。**不写地方特征,不写风格。**
70
+ * 只在没有专属锚点时拼进提示词,长度压到 6–14 字。
71
+ */
72
+ readonly form: string;
73
+ }
74
+
75
+ const NONE: SpotProfile = { kind: '', indoor: false, setting: '', form: '' };
76
+
77
+ /**
78
+ * 判定顺序即优先级,**先排除再认定**。
79
+ *
80
+ * 这是被同一类错误教出来的:`/面|粉/` 一条正则把「粉红果仁糖塔」判成了面条,
81
+ * 把「鸡豆凉粉」判成了面(见卷二 §1)。凡是「只要含某个字就算」的规则,
82
+ * 一定要先在它前面挡掉那些**含这个字但根本不是这个东西**的名字。
83
+ *
84
+ * 下面每条 `[正则, 类型]` 从上往下第一个命中即用,所以排除项写在前。
85
+ */
86
+ const RULES: readonly (readonly [RegExp, SpotKind])[] = [
87
+ /*
88
+ * ---- 先排除:名字像但完全不是 ----
89
+ * 「魔鬼城」不是城,是风蚀地貌。不挡的话它会被 fort 吃掉,
90
+ * 然后提示词里出现「城墙垛口」—— 而那里一根砖都没有。
91
+ */
92
+ [/魔鬼城|雅丹|丹霞|石林|土林|峡谷|大峡谷|冰川|戈壁|沙漠|沙丘|盐湖|火山|天坑|溶洞/, 'geology'],
93
+ /* 「影视城」「恐龙园」「水族馆」「动物园」都不是展馆,也不是城。 */
94
+ [/影视城|影视基地/, 'ruins'],
95
+ [/动物园|植物园|水族馆|海洋馆|海底世界|乐园|游乐园|欢乐谷/, 'park'],
96
+ /*
97
+ * ---- 室内展馆 ----
98
+ * 「博物院」也算(故宫博物院是 palace,但它先被下面的 palace 规则截住 ——
99
+ * 见那里的说明,顺序在这里是活的)。
100
+ */
101
+ [/博物馆|博物院|纪念馆|展览馆|美术馆|陈列馆|科技馆|图书馆|大剧院|音乐厅/, 'museum'],
102
+ /* 「兵马俑」这类是遗址上盖的馆,画面是坑道 + 陶俑,按室内算。 */
103
+ [/兵马俑/, 'museum'],
104
+ /*
105
+ * ---- 崖壁石窟 ----
106
+ * 「千佛洞」「万佛洞」是石窟不是洞府,也不是 fort。
107
+ */
108
+ [/石窟|千佛洞|万佛洞|佛窟|造像|摩崖/, 'cave'],
109
+ /*
110
+ * ---- 宫堡 ----
111
+ * 这一条实际很少走到(`SUFFIX` 里已经先点名了这三个),留着是为了
112
+ * 「XX 故宫」「布达拉宫广场」这类前面还带字的写法。
113
+ * **塔尔寺、扎什伦布寺不放这里** —— 它们是寺院,走 `寺$` 那条。
114
+ */
115
+ [/故宫|布达拉|雍和宫/, 'palace'],
116
+ /*
117
+ * ---- 宗教建筑 ----
118
+ * 「清真寺」含「寺」,正好落在这一条;「礼拜寺」「教堂」「修道院」同理。
119
+ */
120
+ [/寺|庙|庵|祠|观$|宫$|教堂|修道院|礼拜寺|清真/, 'temple'],
121
+ /*
122
+ * ---- 关隘城防 ----
123
+ * 在 ruins 之前:「玉门关」「嘉峪关」「城墙」是土筑关城,
124
+ * 画面是夯土和垛口,不是断壁残垣。
125
+ */
126
+ [/关$|关城|长城|城墙|城门|城楼|烽燧|烽火台|土堡|堡垒|要塞|炮台/, 'fort'],
127
+ /*
128
+ * ---- 城内街巷 / 市集 ----
129
+ * **必须排在 `山` 前面**:「中山路」「宝山路」「环山街」都是路,
130
+ * 一条 `/山/` 会把它们判成山体,画面变成野山。
131
+ * 「风情线」「步行街」也是城区里的带状空间。
132
+ */
133
+ [/夜市|市场|集市|巴扎|大集|菜市|花市/, 'market'],
134
+ [/街|巷|胡同|弄|路$|大道|广场|步行街|风情线|码头|外滩|里弄/, 'street'],
135
+ /*
136
+ * ---- 地貌(剩下的自然类)----
137
+ * 放到关城和街巷后面:「山海关」含「关」,是关不是山;「中山路」是路不是山。
138
+ */
139
+ [/山|峰|岭|崖|台地|石柱|石海/, 'mountain'],
140
+ [/湖|泉|河|江|海|湾|滩|瀑|溪|潭|湿地|水库/, 'water'],
141
+ /*
142
+ * ---- 园林 ----
143
+ * 放在 street 之后:「颐和园」「拙政园」带园,但它们有围墙和水面,
144
+ * 不是一条路。
145
+ */
146
+ [/公园|花园|园林|园$|植物园|湿地公园|书院/, 'park'],
147
+ /*
148
+ * ---- 遗址 ----
149
+ * 「古城」「故城」「遗址」都是残迹;人造的「XX 古城」景区画面也接近,
150
+ * 按遗址处理比按街巷处理稳。
151
+ */
152
+ [/遗址|故城|古城|废城|陵|墓|坟|石窟群|岩画|石刻/, 'ruins'],
153
+ /*
154
+ * ---- 单体标志物 ----
155
+ * 塔、楼、碑放在最后:前面那些更具体的都截不住时才落到这里。
156
+ * 「大雁塔」是塔,「西安钟楼」是楼。
157
+ */
158
+ [/塔$|楼$|碑|塑像|雕像|观景台|摩天轮|电视塔|大桥|桥$/, 'tower'],
159
+ ];
160
+
161
+ /**
162
+ * 只在城里出现、不该出现在野地里的类型。
163
+ *
164
+ * `market` 不在里面 —— 夜市有设在城郊的;`temple` 也不在 —— 山里的寺很多。
165
+ */
166
+ const URBAN_KINDS: ReadonlySet<SpotKind> = new Set<SpotKind>(['museum', 'street', 'park', 'bridge']);
167
+
168
+ /** 野外才有的类型。城里不可能出现 —— 用来反向拦。 */
169
+ const WILD_KINDS: ReadonlySet<SpotKind> = new Set<SpotKind>(['geology', 'mountain', 'cave']);
170
+
171
+ /**
172
+ * 一句话形制。长度写死在这个量级:**它是撑住「物种」的,不是来描述外观的。**
173
+ *
174
+ * 卷二 §13 那条教训在这里同样成立:提示词超过 150 字,主体会被形容词淹掉。
175
+ * 实测加进来之后敦煌博物馆 186 字、党河风情线 191 字,都顶到健康区间的上沿了,
176
+ * 所以每条都压到 6–12 字 —— 只留「去掉它画面就会跑到另一个物种上去」的那半句。
177
+ */
178
+ const FORM: Record<Exclude<SpotKind, ''>, string> = {
179
+ museum: '室内,展柜和展墙',
180
+ cave: '崖壁上开凿的窟龛',
181
+ temple: '院墙围着的殿宇',
182
+ fort: '土筑或砖包的城墙,垛口连续',
183
+ palace: '依地势叠起的建筑群',
184
+ /*
185
+ * **自然类(山 / 水面 / 地貌)刻意留空。**
186
+ * 「西湖」这个名字已经说清它是水,再补一句「水面占住画面大半」只是占字数 ——
187
+ * 判据是「去掉这句,画面会不会跑到另一个物种上去」:不会。
188
+ * 而「敦煌博物馆」去掉「室内,展柜和展墙」就可能画成一栋楼的外立面,所以要留。
189
+ */
190
+ mountain: '',
191
+ water: '',
192
+ street: '两侧立面夹着街面',
193
+ bridge: '桥面往前铺开,两侧是栏杆',
194
+ market: '成排的摊位和棚子',
195
+ geology: '',
196
+ ruins: '残存的墙基和台地',
197
+ park: '园里的水面和树',
198
+ tower: '一座高塔立在开阔处',
199
+ };
200
+
201
+ const INDOOR: ReadonlySet<SpotKind> = new Set<SpotKind>(['museum']);
202
+
203
+ /**
204
+ * **后缀优先**:一个地名的主体是它的**结尾词**,不是它中间碰巧出现的字。
205
+ *
206
+ * 第一版按「包含」判,拿 1510 个真实地点跑出来一片错(2026-11-14 全量读输出):
207
+ *
208
+ * | 名字 | 按包含判 | 实际 |
209
+ * |---|---|---|
210
+ * | 兰州·中山桥 | mountain(含「山」) | 桥 |
211
+ * | 兰州·黄河楼 | water(含「河」) | 楼 |
212
+ * | 天水·大地湾遗址 | water(含「湾」) | 遗址 |
213
+ * | 西宁·塔尔寺 | — | 寺院 |
214
+ *
215
+ * 全是同一个病:**专名里的字被当成了类别**。所以先用锚定结尾的表判,
216
+ * 判不出来才退回下面的包含规则(那些一般是「XX 博物馆新馆」这类长名字)。
217
+ */
218
+ const SUFFIX: readonly (readonly [RegExp, SpotKind])[] = [
219
+ /*
220
+ * **专名要在通用后缀之前。** 「故宫」「布达拉宫」都以「宫」结尾,
221
+ * 而 `宫$` 下面是 temple —— 不先截住,故宫就成了一座庙。
222
+ * 这几处是**必须点名**的,靠后缀永远判不出来。
223
+ */
224
+ [/故宫|布达拉宫|雍和宫/, 'palace'],
225
+ [/博物馆$|博物院$|纪念馆$|展览馆$|美术馆$|陈列馆$|科技馆$|图书馆$|大剧院$|音乐厅$/, 'museum'],
226
+ [/遗址$|故城$|古城$|陵$|陵园$|墓$|墓葬$|岩画$|石刻$/, 'ruins'],
227
+ /*
228
+ * `窟$` 单独收:**莫高窟**的名字里没有「石窟」两个字,
229
+ * 只认 `石窟$` 会把它漏成「判不出」,退回城市锚点(敦煌 = 沙漠)。
230
+ */
231
+ [/窟$|石窟$|千佛洞$|万佛洞$|佛窟$/, 'cave'],
232
+ [/寺$|庙$|宫$|庵$|祠$|观$|院$|殿$|坛$|社$|教堂$|修道院$|清真寺$/, 'temple'],
233
+ [/府$|王府$|相府$/, 'palace'],
234
+ [/关$|关城$|长城$|城墙$|城门$|城楼$|堡$|烽燧$|烽火台$|炮台$|要塞$/, 'fort'],
235
+ [/桥$/, 'bridge'],
236
+ [/塔$|楼$|阁$|碑$|碑林$|电视塔$|摩天轮$|观景台$/, 'tower'],
237
+ [/夜市$|市场$|集市$|巴扎$|大集$|菜市$|花市$/, 'market'],
238
+ [/街$|巷$|胡同$|弄$|路$|大道$|广场$|步行街$|风情线$|码头$|外滩$|里弄$/, 'street'],
239
+ /*
240
+ * `度假区`/`风景区` **不在**这一行 —— 「龙头山国际旅游度假区」是山,
241
+ * 带上这两个后缀它会变成园林。留着让「山」去判。
242
+ */
243
+ [/公园$|花园$|园林$|园$|书院$/, 'park'],
244
+ [/山$|峰$|岭$|崖$|岩$|台地$|石柱$/, 'mountain'],
245
+ /*
246
+ * `池$` 也收:滇池、天池、许愿池。**但归 water 而不是 urban** ——
247
+ * 滇池在城里,天池在山上,这个后缀不携带位置信息,别替它下判断。
248
+ *
249
+ * `岛$`/`屿$` **刻意不收**:鼓浪屿是岛上的老别墅和坡道,东极岛是渔村海崖,
250
+ * 蜈支洲岛是沙滩 —— 同样是「岛」,画面没有共同点。判不出就走老行为,比猜错强。
251
+ */
252
+ [/湖$|池$|泉$|河$|江$|海$|湾$|滩$|瀑$|溪$|潭$|湿地$|水库$/, 'water'],
253
+ ];
254
+
255
+ /**
256
+ * 判一个地点。
257
+ * 判不出来就返回空档 —— **不猜**。
258
+ * 空档的后果只是「照旧走城市锚点」,而猜错的后果是一张内容不对的照片。
259
+ */
260
+ export function spotProfile(spot: string | undefined): SpotProfile {
261
+ if (!spot) return NONE;
262
+ /*
263
+ * 括号里的补充说明不参与判定。
264
+ * 「沙湖(石嘴山平罗县,单算半天)」里的「石嘴山」差点让沙湖被判成山 ——
265
+ * 那是备注,不是地名。
266
+ */
267
+ const name = spot.replace(/[((][^))]*[))]/g, '').trim();
268
+ if (!name) return NONE;
269
+ /* 后缀优先,判不出才退回包含规则。 */
270
+ const hit = SUFFIX.find(([re]) => re.test(name)) ?? RULES.find(([re]) => re.test(name));
271
+ if (!hit) return NONE;
272
+ const kind = hit[1];
273
+ /* 表里不会出现空类型,这一行是为了把 `''` 从类型里收掉,让 `FORM[kind]` 站得住。 */
274
+ if (!kind) return NONE;
275
+ const setting: SpotSetting = URBAN_KINDS.has(kind) ? 'urban'
276
+ : WILD_KINDS.has(kind) ? 'wild'
277
+ : '';
278
+ return { kind, indoor: INDOOR.has(kind), setting, form: FORM[kind] };
279
+ }
280
+
281
+ /**
282
+ * 给她看的一句话:「(室内展馆,在市区)」。
283
+ *
284
+ * 挂在她每回合都读的 `{{journey.now}}` 里(`nowSummary` 的「此刻在X」那一行),
285
+ * 以及 `journey_now` 的回执 —— 两处同一个来源,不会说出两种话。
286
+ *
287
+ * **只给事实,不给指令。** 不加「拍照时按这个写」这类话:
288
+ * 那是 `journey_photo` 的工具描述和 ENV_PROMPT 该说的,混进事实里就成了命令。
289
+ *
290
+ * 称呼用「性质」而不是类型名:`敦煌博物馆(博物馆)` 是废话,
291
+ * `敦煌博物馆(室内展馆,在市区)` 才多给了她一件不知道的事。
292
+ */
293
+ const KIND_LABEL: Record<Exclude<SpotKind, ''>, string> = {
294
+ museum: '室内展馆',
295
+ cave: '崖壁石窟',
296
+ temple: '寺庙院落',
297
+ fort: '关城',
298
+ palace: '宫堡建筑群',
299
+ mountain: '山',
300
+ water: '水面',
301
+ street: '街区',
302
+ bridge: '桥',
303
+ market: '市集',
304
+ /* 「地质景观」不带「野外」—— 位置那一半紧接着会说,重复一遍是废话。 */
305
+ geology: '地质景观',
306
+ ruins: '遗址',
307
+ park: '园林',
308
+ tower: '塔楼',
309
+ };
310
+
311
+ export function spotKindLine(spot: string | undefined): string {
312
+ const p = spotProfile(spot);
313
+ if (!p.kind) return '';
314
+ const where = p.setting === 'urban' ? ',在市区' : p.setting === 'wild' ? ',在野外' : '';
315
+ return `(${KIND_LABEL[p.kind]}${where})`;
316
+ }
317
+
318
+ /**
319
+ * 城市锚点里的分句,哪些**不该**出现在这个地点周围。
320
+ *
321
+ * 只做减法,不重写 —— 城市锚点的那几句话是有人看过真地方写的,别动它。
322
+ * 剔的判据是「这句话描述的东西,在这个类型/位置的地点旁边存在吗」。
323
+ *
324
+ * 只有 **urban** 的地点才剔野外地貌。「敦煌博物馆」剔掉「出城就是连片沙丘」,
325
+ * 但「鸣沙山」(wild)一个字都不动 —— 它本来就在沙丘里。
326
+ */
327
+ const WILD_ONLY = /沙丘|沙漠|戈壁|荒原|雅丹|丹霞|石林|土林|雪山|冰川|峡谷|草原|盐湖|荒漠|戈壁滩|雪线|冰原/;
328
+
329
+ export function trimVistaFor(vista: string, profile: SpotProfile): string {
330
+ if (!vista) return '';
331
+ if (profile.setting !== 'urban') return vista;
332
+ /*
333
+ * **从第一个野外片段起,整段砍掉** —— 不是逐句剔。
334
+ *
335
+ * 第一版逐句剔,被这句话打回来了:
336
+ *
337
+ * 党河两岸是窄绿洲,…白杨葡萄架夹着巷子,出城就是连片沙丘,**沙脊锋利**。
338
+ *
339
+ * 「出城就是连片沙丘」被剔掉了,「沙脊锋利」不含任何地貌词,留下了 ——
340
+ * 而它正是沙丘的下一句。分句切割把语义单元切断了,逐句判永远补不完。
341
+ *
342
+ * 换判据:锚点写野外时几乎都带转折(「出城就是」「城外」「远处是」),
343
+ * 转折之后的部分整块都是野外的。所以找到第一个野外片段,砍到结尾。
344
+ */
345
+ const pieces = vista.split(/(?<=[,。;])/);
346
+ const first = pieces.findIndex((p) => WILD_ONLY.test(p));
347
+ if (first < 0) return vista;
348
+ const out = pieces.slice(0, first).join('').trim();
349
+ /*
350
+ * **尾部标点去掉,由调用方补。** `photoPrompt` 拼的是 `${where}。` ——
351
+ * 这里留一个句号就变成「…夹着巷子。。」。
352
+ */
353
+ const cleaned = out.replace(/[,;。]$/, '');
354
+ /*
355
+ * 砍完只剩零星几个字就不拼了 —— 「周边一带:党河」这种残句
356
+ * 比不写更糟,模型会拿它当主体。
357
+ */
358
+ return cleaned.trim().length >= 8 ? cleaned : '';
359
+ }
package/src/photo.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { vistaOf, spotLook, cityById } from './geo/cities.ts';
2
+ import { spotProfile, trimVistaFor } from './geo/spot-profile.ts';
2
3
  import { seasonLine, regionOf } from './geo/season.ts';
3
4
  import { tzOffsetHours } from './clock.ts';
4
5
 
@@ -1840,8 +1841,27 @@ export function photoPrompt(scene: PhotoScene): string {
1840
1841
  * 照样挂着「叶子被晒得发亮」(一致性测试当场抓住)。
1841
1842
  * 现在只有一个入口,规则只有一条:**没有日光就不写季节。**
1842
1843
  */
1844
+ /**
1845
+ * 这个点在不在室内 —— 三处要它:季节句、天空句、「周边一带」。
1846
+ *
1847
+ * 室内一条铁律:**凡是站在屋里看不见的东西,一个字都不写。**
1848
+ * 实测(2026-11-14):敦煌博物馆只剩「室内,展柜和展墙」+ 周边街景时,
1849
+ * 出图仍是一条村街 —— 矛盾的两半里,写得多的那半赢。
1850
+ */
1851
+ const spotIndoor = Boolean(scene.spot)
1852
+ && !scene.onRoad && !sky
1853
+ /* 只认 `ground`:拍街景、拍特写、拍吃的时候,室内与否跟她站在哪儿无关。 */
1854
+ && (scene.subject ?? 'ground') === 'ground'
1855
+ /*
1856
+ * **有专属锚点时以锚点为准。** 西安碑林博物馆名字里带「博物馆」,
1857
+ * 但它的锚点写的是「砖砌院墙里一排排石碑立在方座上」—— 那是露天的碑林,
1858
+ * 判成室内会把季节句和天空句一起退掉。**锚点是有人看过真地方写的,比名字规则可信。**
1859
+ */
1860
+ && !spotLook(scene.cityId, scene.spot)
1861
+ && spotProfile(scene.spot).indoor;
1862
+
1843
1863
  const seasonText = (() => {
1844
- if (closeup || sky || scene.onRoad) return '';
1864
+ if (closeup || sky || scene.onRoad || spotIndoor) return '';
1845
1865
  const full = trimScene(seasonLine(scene.cityId ? cityById(scene.cityId) : null, scene.month ?? 1));
1846
1866
  if (!full) return '';
1847
1867
  /*
@@ -2097,9 +2117,45 @@ export function photoPrompt(scene: PhotoScene): string {
2097
2117
  /* 景点自己的锚点:直接描述这个景点,不加「周边一带」那层退让。 */
2098
2118
  : spotOwn
2099
2119
  ? `${named},${spotOwn}`
2100
- /* 退回城市锚点:划线,说明那是周围环境而不是景点本身。 */
2120
+ /*
2121
+ * 退回城市锚点:划线,说明那是周围环境而不是景点本身。
2122
+ *
2123
+ * **先判这个点是什么,再决定城市锚点里哪句能留(2026-11-14)。**
2124
+ *
2125
+ * 起因是 Mr.Q 一句「敦煌市明明是个市,敦煌博物馆却建在沙漠里,非常离谱」。
2126
+ * 查下来是这条路:敦煌博物馆没有专属锚点 → 退回敦煌的城市锚点
2127
+ * (「党河两岸窄绿洲…出城就是连片沙丘」)→ 一句「周边一带是」根本拦不住模型,
2128
+ * 它把沙丘一起画进了博物馆周边。
2129
+ *
2130
+ * 而这不是个例:`SPOT_LOOK` 只有 60 城 136 条,`CITIES` 是 185 城 × 3–9 个点,
2131
+ * 覆盖率约 15% —— **剩下 85% 全在这条路上**。代码注释里早写着这个死结
2132
+ * (「1300 条,这条先止血」),止血止不住。
2133
+ *
2134
+ * 所以不再往「一个点写一条」补。改判两件地点自身的事实:
2135
+ * ① 类型(博物馆 / 石窟 / 关隘…)→ 决定室内还是野外
2136
+ * ② 在城里还是野地 → 决定城市锚点里**哪几个分句根本不该出现**
2137
+ * 这两条不靠谁记得写,所以「博物馆旁边有沙丘」在结构上就不发生了。
2138
+ *
2139
+ * 形制(`p.form`)只在**她没写画面**时才补一句 —— 她写了就以她的为准。
2140
+ * 这是「以她看到的为主,系统只兜底」那条线,别倒过来。
2141
+ */
2101
2142
  : scene.spot
2102
- ? (vista ? `${named}。周边一带是${vista}` : named)
2143
+ ? (() => {
2144
+ const p = spotProfile(scene.spot);
2145
+ /*
2146
+ * **室内没有「周边一带」。** 站在展厅里看不见城外的平顶房和葡萄架。
2147
+ *
2148
+ * 实测过(2026-11-14,同种子两张):只把沙丘剔掉、留着「周边一带:平顶房、
2149
+ * 白杨葡萄架夹着巷子」,出来仍然是一条村街 —— 模型在「室内,展柜和展墙」
2150
+ * 与「平顶房、巷子」之间选了后者,因为后者更长、更像一张旅行照片该有的景。
2151
+ * 句子之间不是平等的:**互相矛盾的描述里,写得多的那半边赢。**
2152
+ */
2153
+ const v = p.indoor ? '' : trimVistaFor(vista, p);
2154
+ const form = describeNow ? '' : p.form;
2155
+ const head = form ? `${named},${form}` : named;
2156
+ /* 冒号不是句号:`周边一带是${v}` 会和锚点自己的「XX是…」撞出两个「是」。 */
2157
+ return v ? `${head}。周边一带:${v}` : head;
2158
+ })()
2103
2159
  : vista ? `${named},${vista}` : named;
2104
2160
  /*
2105
2161
  * 光:**一个事实,一处宣布**(2026-11-12 重写)。
@@ -2126,7 +2182,12 @@ export function photoPrompt(scene: PhotoScene): string {
2126
2182
  indoor: false, whiteNight: sun.whiteNight,
2127
2183
  });
2128
2184
  /** 天空那一句。特写没有天,抬头那张由 `skyOf` 说 —— 这里只管「地面以上的颜色」。 */
2129
- const skyTold = sky || closeup
2185
+ /*
2186
+ * **室内不写天。** `spotIndoor` 这一条是 2026-11-14 加的:
2187
+ * 展厅里「天往浅里退,西边有一层薄云」是假的,而且它会把这句读成「户外」,
2188
+ * 跟「室内,展柜和展墙」打架 —— 打架的部分见 `where` 上面那段注释。
2189
+ */
2190
+ const skyTold = sky || closeup || spotIndoor
2130
2191
  ? ''
2131
2192
  : skyLine(sun.phase, sun.overcast, sun.precip, sun.whiteNight);
2132
2193
  const lightFinal = light;
package/src/world.ts CHANGED
@@ -21,6 +21,7 @@ import type {
21
21
  } from 'cortico/core/types.ts';
22
22
  import { JOURNEY_ID, journeyConfigGroups, type JourneyConfigSection } from './config.ts';
23
23
  import { cityByName, cityById, CITIES, terrainOf, type City } from './geo/cities.ts';
24
+ import { spotKindLine } from './geo/spot-profile.ts';
24
25
  import { distanceKm } from './geo/distance.ts';
25
26
  import { modeById, hoursFor, type ModeId, type TravelMode, type SeatGrade } from './geo/modes.ts';
26
27
  import { localMoment, humanHours, localHour, shiftDateKey, tzOffsetLabel, utcFromLocal } from './clock.ts';
@@ -548,6 +549,16 @@ const TOOL_DECLS = [
548
549
  + '"a calico cat crouching under a streetlight, looking up" / "empty platform, one bench, half a bottle of water". '
549
550
  + 'This is the content of the shot, not the framing (that is `focus`). '
550
551
  + 'Only describe what is really here right now: the place she is at, this season, this weather. '
552
+ /*
553
+ * 2026-11-14:她的画面要按「这是什么性质的地方」写,不能按城市名猜。
554
+ * 敦煌博物馆被画进沙丘,就是因为她手上只有地名、没有「这是个室内展馆」这条事实。
555
+ * 括号由 `spotKindLine` 给(`nowSummary` 的「此刻在X」那一行)。
556
+ */
557
+ + 'The spot in `journey_now` comes with a parenthetical - "(indoor museum, downtown)", "(cliff caves, out in the wild)" - '
558
+ + 'that is what KIND of place it is. Write the frame to match that kind: a hall with display cases for a museum, '
559
+ + 'a cliff face for caves, a street of shopfronts for a downtown block. '
560
+ + 'If the parenthetical is missing, the program could not tell - then describe only what she can actually see, '
561
+ + 'and do not infer the surroundings from the city name.'
551
562
  + 'Never add flowers, snow, festivals or crowds that this place and season do not have. '
552
563
  + 'If nothing is worth describing, leave it out - the program already describes the place and light.',
553
564
  },
@@ -1238,6 +1249,12 @@ export class JourneyWorld implements World {
1238
1249
  * 「今天还没拍」,就会同一张照片付两次钱。
1239
1250
  */
1240
1251
  private shooting = false;
1252
+ /**
1253
+ * 推过的 `senderKey`。**同一个 key 只许推一次**,见 `push()` 上的说明。
1254
+ *
1255
+ * 只放内存:重启后约定已经结清,不会重新走到「该散伙」那一步。
1256
+ */
1257
+ private pushedKeys = new Set<string>();
1241
1258
  /** 上一次生图的结果,给指示灯用。 */
1242
1259
  private photoOutcome: 'never' | 'ok' | 'fail' = 'never';
1243
1260
  /**
@@ -4748,6 +4765,24 @@ export class JourneyWorld implements World {
4748
4765
  /**
4749
4766
  * 推一条事件。`blobs` 是随事件走的附件(照片),字节由宿主落进 `data/media/`,
4750
4767
  * 事件里只留 `log:` 句柄 —— 返回的信封里能拿到句柄。
4768
+ *
4769
+ * ## 同一个 senderKey 只推一次(2026-11-14)
4770
+ *
4771
+ * 起因是 144 天 money 长跑挂了一条不变量:
4772
+ * `part-0000000000000007-2027-01-21T06:55:00.000Z` 推了两次。
4773
+ *
4774
+ * 根因在「约定到期该散伙」那条路:天数满了 → 推一句「各走各的」→ 进 `moveOn`,
4775
+ * 而 `moveOn` 买不起票会**原地返回、不清约定**(设计如此,明天接着试)。
4776
+ * 于是下一个 tick 又落进同一分支,同一句话再推一遍。
4777
+ *
4778
+ * **重放的代价比少说一句大得多**:她会把这个源判定成「会重放旧事件的东西」,
4779
+ * 然后开始忽略它 —— 一次重复,等于后面所有事件的可信度打折。
4780
+ *
4781
+ * 为什么放在 `push` 这一层而不是那条分支里:key 的语义本来就是「这件事的身份」,
4782
+ * 同一个 key 推两次在任何分支上都是 bug,不是那一处的特殊情况。
4783
+ *
4784
+ * 内存集合够用:重启后 `pledge` 已经落盘结清,不会重新走到那里。
4785
+ * 真需要跨重启去重时再落盘 —— 现在加上只会让 state 多一份要维护的东西。
4751
4786
  */
4752
4787
  private async push(
4753
4788
  type: string,
@@ -4758,6 +4793,11 @@ export class JourneyWorld implements World {
4758
4793
  ): Promise<EventEnvelope | null> {
4759
4794
  const host = this.host;
4760
4795
  if (!host) return null;
4796
+ if (this.pushedKeys.has(senderKey)) {
4797
+ this.log?.info(`跳过重复事件:${type} ${senderKey}`);
4798
+ return null;
4799
+ }
4800
+ this.pushedKeys.add(senderKey);
4761
4801
  return await host.pushEvent({
4762
4802
  type,
4763
4803
  source: this.id,
@@ -8262,9 +8302,14 @@ export class JourneyWorld implements World {
8262
8302
  *
8263
8303
  * 2026-11-01 Mr.Q 说「14:30 逛伏羲庙是个时间段,不是到了那一秒就参观完了」——
8264
8304
  * 原来这里只有「下一个点」,她 15:30 被问「你在干嘛」只能答「等晚饭」。
8305
+ *
8306
+ * 后面那个括号是她写照片画面时的依据(2026-11-14):光有地名,
8307
+ * 模型对「敦煌博物馆」这种小馆没有先验,只能按城市风貌猜 —— 猜出来就是沙漠。
8308
+ * 给她「室内展馆,在市区」这七个字,她自己在 `describe` 里就会写室内。
8309
+ * **只给事实,不写「拍照时该按这个」** —— 那是工具描述的事,混进来就成了命令。
8265
8310
  */
8266
8311
  nowAt
8267
- ? `此刻在${nowAt.spot ?? '外面逛'},算着待到 ${fmtHour(nowAt.until ?? 0)}。`
8312
+ ? `此刻在${nowAt.spot ?? '外面逛'}${spotKindLine(nowAt.spot)},算着待到 ${fmtHour(nowAt.until ?? 0)}。`
8268
8313
  : '',
8269
8314
  /*
8270
8315
  * **正在路上**。这一条要给出「还要几分钟」—— 只说「在路上」,
@@ -9655,6 +9700,28 @@ export const JOURNEY_DESCRIBE = {
9655
9700
  },
9656
9701
  trigger: 'flush' as const,
9657
9702
  },
9703
+ /*
9704
+ * 2026-11-14 补登记。这个事件从 2026-11-12 就在推,但一直没进这张表 ——
9705
+ * 而上面写着「`events` 必须与源码里 push 的类型一一对应」。
9706
+ * 漏登记的后果不在运行,在诊断和市场卡片:面板里看不到它,
9707
+ * 排查「她怎么突然不说话了」时也不会想起还有这一种。
9708
+ */
9709
+ {
9710
+ type: 'journey.part',
9711
+ description: {
9712
+ zh: '跟同伴散伙:约好的天数满了,今天各走各的。',
9713
+ en: 'She and her travel companion part ways: the agreed days are up.',
9714
+ },
9715
+ trigger: 'flush' as const,
9716
+ },
9717
+ {
9718
+ type: 'journey.pledge',
9719
+ description: {
9720
+ zh: '原来的约定被推掉了:他叫她改去别处,跟人说好的那趟去不成。',
9721
+ en: 'An earlier promise is dropped: the person redirected her, so the agreed trip cannot happen.',
9722
+ },
9723
+ trigger: 'debounce' as const,
9724
+ },
9658
9725
  {
9659
9726
  type: 'journey.work',
9660
9727
  description: {