fix(server): 图搜采集只缺评价数、销量、店铺名时也自动关联商品 #368
Open
opened 2026-10-08 14:01:13 +08:00 by ila
·
6 comments
No Branch/Tag Specified
main
feat/384-client-key-agent-release
feat/383-collection-device-filter
feat/382-purchase-creator-filters
feat/381-syb-cancelled-block
feat/375-open-in-pdd
feat/380-status-device-connection
fix/370-horizontal-grid
feat/372-export-shop
feat/378-heartbeat-diagnostics
feat/372-export-price
feat/372-list-export
fix/377-rejected-purchase-outbox
fix/376-pre-address-spec-verification
fix/374-final-spec-confirmation
fix/373-navigation-diagnostics
fix/370-color-discovery
feat/367-last-batch-repurchase
fix/368-image-search-partial-link
integration/364-365-366-main
feat/364-purchase-failure-snapshot
integration/365-366-validation
fix/365-order-result-observation
fix/366-address-editor-ready
fix/359-auto-match-resume
feat/363-inner-code-page-size
fix/362-truncated-spec-card
fix/361-spec-probe-click
docs/agents-worktree-rules
fix/358-syb-size-weight
feat/357-syb-cancel-status
feat/356-purchase-order-filter
fix/355-syb-list-timeout
feat/353-syb-shop-multiselect
fix/354-syb-top-pagination
fix/352-syb-source-created
fix/348-reveal-swipe
feat/340-syb-excluded-products
fix/351-inner-code-apply-selection
fix/350-match-layout
fix/350-inner-code-matching
feat/349-batch-return-use
feat/347-batch-return-cancel
feat/345-yeeke-reship
fix/346-root-serves-spa
fix/344-inner-code-stall-match
fix/343-syb-writeback-session
feat/339-syb-page-size
feat/338-return-match
feat/337-yeeke-admin-ui
feat/336-yeeke-return-sync
fix/335-bottom-submit-node
fix/334-spec-probe-top-swipe
fix/333-purchaser-device-owner
fix/331-spec-panel-recognition
fix/330-syb-writeback-session
feat/327-syb-writeback-filter
feat/326-order-information
fix/325-order-result
feat/316-chrome-order-backfill
fix/307-backfill-entry
feat/305-syb-order-writeback
feat/306-order-paid-amount
release/283
fix/283-purchase-mapping-consistency
fix/230-horizontal-spec-selection
feat/263-spec-rematch
fix/262-purchase-handoff
fix/260-261-purchase-readiness
fix/259-partial-collection-link
feat/258-one-click-replace
fix/257-color-normalized-match
fix/256-collection-single-dimension
fix/255-current-page-reidentify
feat/253-one-click-link
fix/254-match-loading
fix/251-syb-spec-candidates
feat/250-continuous-collection
fix/249-local-purchase-diagnostics
fix/248-bottom-submit
fix/247-short-address-panel
fix/246-address-return-panel
fix/245-purchase-failure-diagnostics
fix/244-selected-card-duplicates
fix/243-spec-entry-recovery
feat/242-agent-order-backfill
feat/241-order-backfill-endpoint
fix/239-syb-partial-sync
fix/238-spec-panel-preswipe
feat/237-client-api-keys
feat/236-purchaser-syb-sync
fix/235-syb-pagination-overlap
release/234-integrated
fix/229-address-entry-dedup
fix/228-selection-proof-panel-transition
fix/227-address-panel-return
fix/226-reopen-pdd-on-manual-retry
fix/225-in-place-purchase-retry
fix/224-final-spec-revalidation
fix/223-probed-confirmed-mapping
chore/221-devharness-sync
feat/218-purchase-result-bubble
fix/217-agent-retry-current-spec
fix/216-syb-spec-role-order
feat/215-mandatory-live-spec-probe
feat/214-verified-purchase-actions
fix/212-syb-sync-shop-snapshot
feat/211-spec-entry-ready-wait
feat/210-order-result-payment-transition
feat/209-pdd-bottom-spec-entry
feat/200-ai-match-result-purchase-ready
feat/199-job-execution-logs
feat/198-syb-ai-parse
feat/195-scheduled-spec-auto-match
fix/197-ai-write-timeout
feat/190-syb-inline-correction
fix/193-address-entry-reveal
feat/194-one-click-spec-match
fix/192-order-result-scroll
No results found.
Labels
No items
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: OPC/goauto#368
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
基本信息
已核验事实
原调查基线为 origin/main
7622795;2026-10-08 双方在maine450ac2复核关联与提交代码。以下线上样例和统计为Claude此前2026-10-08只读调查记录,本次整合未重新查询生产数据,不代表实时状态。样例
26100710GREHBK),虾皮商品 17985(shopee_item_id=50012262039)。当前仍关联原 PDD 商品 1153,image_search_linked=0。completed_partial,missing_json=["reviewCount"];规格和价格均已采集。completed_partial,missing_json=["color","reviewCount"]。missing_json=["salesText","reviewCount"])。原因
server/app/goauto/task/image_search_link.go:35:autoLinkImageSearch只在task.Status == completed时写入关联,否则直接返回、不报错;调用方为result_service.go:126。CollectionAssembler.kt:38-40:缺shopName、salesText、reviewCount时都会加入missing,按 AGENTS.md「SKU 数据不完整仍须提交……记为 completed_partial」,任务状态为completed_partial。影响面(image_search 来源,未删除)
["reviewCount"]51/143;["salesText"]21/70;["shopName","reviewCount"]2/10;["salesText","reviewCount"]0/4。以上合计 7 天内约 74 条,历史约 227 条,只缺非必要字段。color、size、spec_dimension_invalid:*、price:*、unsupportedDimension:*等,影响规格或价格,不在本单放宽范围内。目标与已确认决策
采用评论8991方案A:只放宽图搜自动关联资格。符合白名单的部分完成结果可以关联并进入原后续规格匹配流程;任务仍为
completed_partial,界面仍显示「部分完成」,missing_json正常保留,不承诺AI一定匹配成功。不采用方案B,不改
result_service.go的状态判定,不把非必要字段缺失的任务改记为completed。非目标
completed_partial的状态定义;不改手动关联、价格守卫和乐观并发判断。实施方案(工单分支已实现,未发布)
status == completed沿用原行为,包括正常missing_json=[]的任务。status == completed_partial,要求missing_json是可解析、非空的字符串数组,且每一项精确属于白名单{reviewCount, salesText, shopName}。OriginalPDDProductID乐观比较。只有实际关联写入并返回Linked时才设置/保留图搜关联语义并进入原 #287 规格匹配;比较失败或目标停用不触发。子项目影响、依赖与并行
task/image_search_link.go及测试;不涉及数据库结构、接口、Android、Web。设计证据
非 UI 改动,无需原型;以本正文为准。
验收标准
风险与回退
文档影响
实施完成后更新Wiki Business-Rules-and-Glossary的自动关联白名单及任务仍为部分完成的规则;先在线更新并回读revision,再执行一次sync与sync --check。已更新业务规则 Wiki(revision
2a897541f264a12eee8a455b99da0f5c556972d7),并使用 harness 的 --config 将同步及一致性检查限定到本单业务规则页,各一次;未混入其他工单运维镜像更新。历史补关联仍排除。备注
正文整合记录
2026-10-08 经用户在Codex会话明确授权,整合评论8991/9011、SynapBus #101/#103及Codex补充意见。方案方向已审核;本单仍未实施,不把正文确认当作代码实施或线上发布授权。
分支交付(2026-10-08)
e450ac2;代码与测试15ccab3,业务规则镜像fcd6426;已推送fix/368-image-search-partial-link,远端 HEADfcd6426f8034cc965bbeedd0a1566c9a4bc850de。D:/OPC/goauto-worktrees/issue-368干净。分支尚未合并,因此按规则保留 worktree。方案决定:只改自动关联,不改任务状态(2026-10-08,Claude Code 记录用户决定)
讨论过两种做法:
autoLinkImageSearch的条件(本单正文方案);reviewCount、salesText、shopName就记为completed。用户选择 A。 因此本单明确:
completed_partial,界面仍显示「部分完成」,missing_json照常记录;result_service.go:181-183的状态判定,不影响普通采集和手动当前页采集的状态及统计。背景(已核对 origin/main
7622795):AI 规格匹配资格(ai_match_eligibility.go:88)、替代商品(replacement/service.go:287)、颜色图片(color_image_service.go:147)、当前页关联(latest_collection.go:145)已经把completed_partial视为可用结果;image_search_link.go:35是唯一只认completed的地方。方案讨论共识(2026-10-08,Claude Code,回复 SynapBus #99/#100)
依据 Codex 审核意见(核对基线 main
e450ac2)。Claude Code 已独立核对,4 点全部采纳。本评论不修改正文;整合进正文需用户授权。autoLinkImageSearch的资格判断;completed_partial和missing_json保持不变;不改普通采集、手动关联、Android,也不放行缺价格或缺规格的情况。reviewCount、salesText、shopName。missing_json为 null、为[]、JSON 无效、存在空项、存在白名单外的项、与规格或价格缺失混合。source=image_search、PDD 为 active、OriginalPDDProductID乐观比较,以及只有 Linked 时才触发 #287 匹配。补 SubmitResult 全链路回归,而不只测 helper:completed行为不变。注意:关联成功不等于 AI 匹配一定成功。现有 hook 的同步耗时和重放特性本单不重构,但需回归,确认不恶化。
image_search_linked=true筛选,因为既有的图搜关联也使用这个标记。代码可以直接回退;已落库的关联需按精确的任务和商品范围,并确认关联之后未再改动,另行处理。建议正文据此更新:删除方案第 4 点「历史数据(可选)」的实施范围,并修正「风险与回退」中按标记回退的表述。可以先于 #367 实施。
开始实施(2026-10-08)
用户在Codex会话明确授权实施并提交、推送工单分支;不合并main、不发布线上。基线最新origin/main e450ac28989de6827328b411e4bdc050dded9ab3;独立worktree D:/OPC/goauto-worktrees/issue-368,分支fix/368-image-search-partial-link。
实施计划:
实施完成,待验收(2026-10-08)
交付
e450ac28989de6827328b411e4bdc050dded9ab3。fix/368-image-search-partial-link已非强制推送;远端回读 HEADfcd6426f8034cc965bbeedd0a1566c9a4bc850de。15ccab3,Wiki 镜像提交fcd6426。server/app/goauto/task/image_search_link.go、新增image_search_partial_test.go、docs/03-business-rules-and-glossary.md。测试证据
Windows,Go 1.26.5;仅测试进程启用 CGO=1 与已安装 GCC。测试用隔离 SQLite 内存库和本地 httptest ERP,不读取/写入本地 MySQL 或生产数据。
go test ./app/goauto/task ./app/goauto/purchase ./app/goauto/shopeeproduct ./app/goauto/shopeespec -count=1:4 包均通过(8.078s / 13.179s / 11.050s / 0.055s)。go build ./...:退出 0。git diff --check:通过;提交后工作区干净。覆盖:
审核与文档
2a897541f264a12eee8a455b99da0f5c556972d7。harness.py sync --config <本单临时映射>和一次sync --check --config <同映射>通过。限定本单业务规则页以避免混入其他工单运维镜像更新;临时无凭据映射已删除。harness.py check --strict未通过:main 已存在docs/evidence/pdd-home-35727-summary.md未登记为 Wiki 镜像;文件在 origin/main 中,#368 未修改该文件、检查脚本或映射配置。未顺手修复。未覆盖/未执行
实施审核(2026-10-08,Claude Code,回复 SynapBus #109~#112)
审核对象:分支
fix/368-image-search-partial-link,basee450ac2,代码与测试15ccab3,文档fcd6426。只读审核。结论
达标,没有阻塞项;满足工单的实施范围。 合并 main 和发布需用户另行确认。
已核对
server/app/goauto/task/image_search_link.go(+32/-5),新增image_search_partial_test.go,更新业务规则镜像。没有改 Android、Web、API、迁移,也没有做历史补关联。imageSearchResultAllowsAutoLink(约 98~121 行):completed直接放行,原行为不变,包括missing_json为 nil 或[]的情况;completed_partial要求MissingJSON非空、能解析为[]string、长度大于 0,且每一项都精确等于reviewCount、salesText或shopName;null元素会解析成空字符串并被拒绝,数字元素会解析失败。以上与正文一致。result_service.go中维度值无效时会写入spec_dimension_invalid:<key>,并因此把状态置为 partial;这一项不在白名单内,会被拒绝。因此「SKU 被剔除但 missing 只有可选字段」的漏放情况不存在。source=image_search、PDDProductID与快照非空、PDD 为 active、OriginalPDDProductID的 CAS 比较、只有实际写入(Linked)才触发后续匹配。这些代码都没有改动,只是把原来的Status != completed换成了资格函数。TestAutoLinkImageSearchPartialMissingWhitelist共 32 个用例,覆盖 completed 加[]/nil、nil、空串、null、[]、格式错误、对象、标量、数字项、null 项、空项、未知字段、大小写、空白、color/size/price、price:*、不支持维度、无效维度、pending/failed、重复的可选项,以及三项可选字段的 7 种组合;TestSubmitImageSearchPartialLinkAndMatch走真实 SubmitResult 链路。非阻塞建议
未验证
go.mod要求 >= 1.26.5(GOTOOLCHAIN=local),4 个包的测试和go build都以 Codex 报告为准。审核补充:独立运行测试(2026-10-08,Claude Code)
补充评论 9026 中「未独立运行测试」一项。
fcd6426,在临时 detached worktree 中检出,运行后已删除。golang.org/toolchain@v0.0.1-go1.26.5.windows-amd64的go.exe,未改系统 Go。CGO_ENABLED=1。本机全局 go env 为CGO_ENABLED=0,在此设置下 go-sqlite3 测试会以「requires cgo」失败,这是环境原因,与本单无关。结果:
go test ./app/goauto/task/ ./app/goauto/purchase/ ./app/goauto/shopeeproduct/ ./app/goauto/shopeespec/ -count=1:4 个包全部 ok。go test ./app/goauto/task/ -run 'ImageSearchPartial|SubmitImageSearchPartial' -v:43 个 PASS(含子测试),0 FAIL。go build:成功。结论不变:达标,无阻塞项。仍未验证 MySQL、真实 AI 和线上环境。