Skip to content

chore(wiki): 采纳 #437 review 小建议(import 规范 + Javadoc 英文)#449

Merged
mateaix merged 1 commit into
mateaix:devfrom
ncw1992120:chore/wiki-failure-center-review-nits
Jun 28, 2026
Merged

chore(wiki): 采纳 #437 review 小建议(import 规范 + Javadoc 英文)#449
mateaix merged 1 commit into
mateaix:devfrom
ncw1992120:chore/wiki-failure-center-review-nits

Conversation

@ncw1992120

Copy link
Copy Markdown
Contributor

跟进 #437 review 中的两个不阻塞建议:

  1. WikiRawMaterialService.listFailures 内联全限定名 → 改为顶部 import + 简单名(List<WikiFailureItem>),符合仓库规范
  2. 新加实体字段 Javadoc 改英文WikiRawMaterialEntityerrorCode / warningCode / warningMessage / progressPhase / progressTotal / progressDone 六个字段的中文 Javadoc 翻译为英文

纯代码风格清理,零行为变化。(重建分支,干净的 1 个 commit)

- WikiRawMaterialService.listFailures: inline FQN return type
  (java.util.List<vip.mate.wiki.dto.WikiFailureItem>) replaced with
  top-level import + simple name, per repo convention
- WikiRawMaterialEntity: Javadoc on new fields (errorCode, warningCode,
  warningMessage, progressPhase, progressTotal, progressDone) translated
  to English, per repo convention
@mateaix

mateaix commented Jun 28, 2026

Copy link
Copy Markdown
Owner

感谢这么快跟进 #437 的两个建议 🙏 改动正是预期的:listFailures 返回类型改成 List<WikiFailureItem> + 顶部 import(java.util.List 本就已 import),六个字段 Javadoc 也都翻成了英文,零行为变化。已合并到 dev

一个可选的小尾巴(不影响本次合并):progressPhase/progressTotal/progressDone 的 Javadoc 这次被你重写了,但还保留着 RFC-012 M2 v2 UI: 前缀 —— 按仓库规范代码里不该出现 RFC-XX 内部引用。既然已经在改这几行,下次可以顺手把前缀也去掉(例如直接写 "Current processing phase ...")。纯粹是锦上添花,不必为此再开 PR。

@mateaix mateaix merged commit 04197d7 into mateaix:dev Jun 28, 2026
ncw1992120 added a commit to ncw1992120/mateclaw that referenced this pull request Jun 28, 2026
…x#449 nit)

Per mateaix#449 review (4825113234): the internal RFC-012 reference should not
appear in code. progressPhase/progressTotal/progressDone Javadocs still
carried the "RFC-012 M2 v2 UI:" prefix after mateaix#449's English translation
pass — drop it now that these lines are touched.

Zero behavior change.
@ncw1992120

Copy link
Copy Markdown
Contributor Author

顺手把 #449 留下的 RFC-012 前缀尾巴也清了:progressPhase/progressTotal/progressDone 三个字段的 Javadoc 去掉了 RFC-012 M2 v2 UI: 前缀,直接写描述。零行为变化。

改动塞进了 #445(commit 3cbc07c9)—— 那个分支刚好 rebase 到最新 dev(含 #449 的英文 Javadoc),改这几行零冲突。

mateaix pushed a commit that referenced this pull request Jun 30, 2026
* feat(kb-open): P0-B 9 open API endpoints

Implements the 9 read-only KB Open API endpoints on top of the P0-A
auth skeleton (#441). Each returns an explicit DTO (A5: never raw
entities) and delegates assembly to service-layer methods that return
pure DTOs (A6: no HTTP coupling, MCP-ready).

Endpoints:
- GET  /pages/{slug}        entity card (mode=summary/full/section:{heading})
- POST /search              hybrid retrieval (granularity=entity/chunk)
- POST /search/chunks       chunk-level semantic search
- POST /pages/{slug}/traverse  entity relation graph (depth ≤ 2)
- GET  /pages/{slug}/trace  provenance (page → chunk → raw)
- GET  /taxonomy            pageType/entityType/relationType enumeration
- GET  /whats-new           recent changes + stale pages
- GET  /stats               KB statistics
- GET  /pages               lightweight page list

Components:
- KbOpenApiController: 9 endpoints, each @RequireKbScope annotated
- KbOpenApiService: assembly layer (card, traverse BFS, metadata parsing)
- KbOpenApiDtos: all response DTOs as records (PageCard, TraceResult,
  TaxonomyResult, KbStats, WhatsNewResult, TraverseResult, PageList)

Traverse (pragmatic version):
- depth ≤ 2 with explosion guard, predicate LIKE matching
- slug → pageId → mention → primaryEntity (salience-highest)
- neighbor nodes echo slug when available (R11)
- edge sourceHandle via evidenceChunkId → citing page

Tests (4 new, all green):
- KbOpenApiControllerTest: 404 on missing page/slug, delegation to service

Closes #442

* fix(kb-open): address review feedback on #445

BLOCKERS:
- stats.pagesWithLinks always returned 0 because listByKbId() nulls out
  content. Switch to listByKbIdWithContent() so [[wiki link]] detection works.
- Test file: replace inline java.util.List.of() FQN with import + simple name
  (sync-opensource would expose the unidiomatic style).

NITS (inherited from P0-A rebase):
- V162→V164, prefix VARCHAR(12), FQN imports, parseScopes trim, ?token=
  fallback removal, design doc moved to rfcs/ — all now in ancestor commit
  6fd6244.

EXTRA:
- whatsNew staleReason: hardcoded Chinese "上游 fact 页面变更" → English
  "Upstream fact page changed" (external-facing API response).

* chore(wiki): drop RFC-012 prefix from progress field Javadocs (#449 nit)

Per #449 review (4825113234): the internal RFC-012 reference should not
appear in code. progressPhase/progressTotal/progressDone Javadocs still
carried the "RFC-012 M2 v2 UI:" prefix after #449's English translation
pass — drop it now that these lines are touched.

Zero behavior change.

* chore(kb-open): drop inline FQN in parseScopes (#444 nit)

Per #444 review (4825157096): parseScopes used
`.collect(java.util.stream.Collectors.toUnmodifiableSet())` while
`Collectors` is already imported at the top of the file. Use the simple
name. Zero behavior change.
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.

2 participants