summaryrefslogtreecommitdiff
path: root/docs/evidence/p65-verification.txt
blob: 12a8e1c63e4237b2af7bc91fe3dbe4057c402a21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
P65(职业切片五:货郎「打听行情」接 World.Rumors)验证记录
基线:commit a2103b2(P65 派发 doc tick);本单未 push。

范围与设计
- 仅「判定 + 文案」纯函数,不改 Sim.fs 数值路径、不新增任何存档状态、不改 HUD 结构。
- 货郎「提议交易」(DialogueIntent.OfferTrade,即 3 号对话选项,与 MarketInquiry 任务共用
  「一次玩家对话事件」判定)读取**对话前**既有 World.Rumors 工作集,产出一条中文行情短答。
- 同一套新鲜度/可信度口径:`Tick<=now` 且在 `rumorFreshnessTicks` 窗口内、衰减强度
  `Sim.rumorStrengthAt now` >= `rumorMinimumStrength`(对齐 Sim.latestRumorFor)。
- 命中规则全序:强度最大 → Tick 更大 → RumorId 更大;地点/货品索引由 (RumorId, Depth) 决定,
  涨落由强度分档,新鲜度前缀(今日/近日)由 Tick 差决定。无随机、无哈希顺序依赖。
- 非货郎 / 无职业 / 无命中谣言 → `None`,逐字节退回既有 `dialogue intent=...` 文案。

改动文件
- src/LivingVillage.Kernel/Occupation.fs(+freshReliableRumors / inquiryRumor / marketInquiryText,
  及私有地点/货品/涨落表;不改 Sim.fs)
- src/LivingVillage.Desktop/Interaction.fs(chooseIntent 计算 inquiry;Status 前缀 `inquiry|`;
  statusLabel 新增 `inquiry|` 分支)
- src/LivingVillage.Desktop/CjkGlyphAtlas.fs + Assets/cjk-glyphs.txt + Assets/cjk-glyph-atlas.png
  (真字补 17 字:东 头 西 北 巷 口 盐 巴 米 布 茶 柴 涨 两 文 落 些;生成式脚本重出,禁程序字形)
- src/LivingVillage.Desktop/Game.fs(LV_P65_SHOT 钩子,additive)
- scripts/analyze-p65.py(新)
- src/LivingVillage.Desktop.Tests/P65RumorInquiryTests.fs(新,6 例)+ .fsproj 挂载
- src/LivingVillage.Desktop.Tests/PrototypeTests.fs(字形表 323→340、rowCount 21→22、height 504→528)
- docs/evidence/p65-{menu,answer}.png、p65-analysis.txt、p65-run-log.txt

红先
- 先建 P65RumorInquiryTests 引用未实现的 marketInquiryText/freshReliableRumors/inquiryRumor
  → 编译红(FS0039,仅缺 API)。

构建/测试
- dotnet build LivingVillage.sln -c Release → 0 错误,1 警告(P40ArtTests.fs FS0760,既有)
- dotnet test LivingVillage.sln -c Release --no-build → Desktop 320/320(314→+6),Kernel 119/119
- 新例覆盖:命中既有谣言池出中文短答 / 同输入两次逐字符串一致 / 陈旧·微弱·空池均 None /
  仅货郎 OfferTrade 出短答 / 非货郎回归逐字节 + 货郎 status=inquiry| 透出 statusText /
  save v2 头逐字节不变 + v3 round-trip 稳定 / 穷举地点·货品·涨落组合无缺字。

证据实跑(真实 Desktop + xvfb 1280x720)
LV_P65_SHOT=1 LV_LEGACY_MAP=1 xvfb-run -a -s "-screen 0 1280x720x24"(exit=0)
log:
  new-game=ok seed=42 npcs=30 occupation=货郎 tick=0
  p65-shot=p65-menu  panel=dialogue status=dialogue target=NpcId 0 options=6; press 1-6
  p65-regression status=dialogue intent=OfferTrade response=Bargaining
  p65-inquiry rumors=1 fresh=1 hit=true text1=今日东头的布价涨了两文 text2=今日东头的布价涨了两文 equal=true
  p65-shot=p65-answer panel=world status=inquiry|今日东头的布价涨了两文

scripts/analyze-p65.py → verdict: PASS
  p65-menu   1280x720 mean=78.7 std=32.4 黑块=0 白块=0
  p65-answer 1280x720 mean=83.5 std=30.7 黑块=0 白块=0
  sha256(text1)=14f359b3777162f5a69d2823b114d7005a9bb321dd9f3617c3a0a7ada2336645
  状态药丸带亮色文字:answer bright=752 span=173px(≈11 CJK@scale2=176px)/ menu bright=0
  两帧 mean_abs_diff=6.9;缺字空白位=0
check-no-white-blocks.py 两帧 → failures=0

确定性
--performance-baseline ×3 → 953775FAEB2FDDE97289491AA260BD8D390C571E48A7A13AD2CB6FB7124F7F6C ×3,PASS

存档兼容
- save(None) 仍 `LV_WORLD_SAVE_V2` 且 = saveWith None(逐字节,单测断言)。
- v3(含货郎 sidecar)写盘→loadFromFileWith round-trip:kind=peddler、背包条数稳定;未新增 sidecar 字段。

边界
- 未改 Kernel/Sim.fs、HUD/对话框结构、地图 seed、外部素材;未 push。
- 逐帧「字形是否清晰可辨」的 vision 复核本写入模型不支持图像输入(P60 G3),留 Hermes 侧;
  本单给出可量化像素判据(药丸带亮色文字像素+铺满宽度)与字形覆盖单测。