admin
|
1e30d4c355
|
docs+code: 通用化平台叙事,去掉尚数网业务绑定
## 文档重构(5 个 md + 1 个 html)
- README.md: '尚数网本体管理平台' → '本体元数据平台 · Ontology Platform'
- docs/README.md: 通用化定位,补全 P0/P1/P2 (Palantir Ontology 对标) + Materialization/BackingSource/Suggestions 全清单
- docs/PLAN.md: 通用化设计目标,改为 'Palantir Ontology 对标' 路线图
- docs/USAGE.md: 用通用占位符(项目/空间/组织)替换尚数网具体业务举例
- docs/IMPORT.md: 把 shangshu 当成 '一个采用方示例' 展示通用模式
- docs/product-intro.html: title/brand/hero/场景/footer 全改通用,沙数只作典型场景之一
## 代码字符串同步去 shangshu
- server/main.go: '[boot] 尚数网本体管理平台监听' → '[boot] 本体平台监听'
- server/handlers_connector.go: manifest 'server' 字段 → 'ontology-platform'
- server/handlers_mcp.go: tool description + serverInfo → 通用
- server/handlers_functions.go: builtin interface description → 通用
- server/handlers_backing_source.go: 注释去 shangshuwang.cn 具体网址
- server/config.go + server/db.go: 注释/seed 数据改占位 (demo_self / demo_partner_a/b)
- server/ai/anthropic.go: fallback systemPrompt → '通用本体平台工程师'
- server/ai/heuristic.go: 未识别 summary → '本体概念'
- server/ai/prompt.go: 静态 systemPrompt 头部 + JSON 示例去 shangshu
## 前端文案同步
- web/src/App.vue: title 改 '本体元数据平台'
- web/src/views/LoginView.vue: 登录页 h1 改通用
- web/src/views/OntologyView.vue: backing source placeholder 改 example.com
- web/src/components/ReviewWorkbench.vue + useReviewWorkbench.js: '尚数网' → '本体平台'
## 验证
- go build ./server OK
- 剩余 '尚数网' / 'shangshu-ontology' 引用:
- 文档 README/README/USAGE/PLAN/IMPORT 仅在 '采用方示例' 上下文出现
- 代码注释 sswOntologySystemPrompt 等 identifier 保持不变(避免改动 API 表面)
- skill 名 'ssw-ontology-reviewer' 保持不变(已发布技能)
Refs: docs/README.md (1.1 元数据组件表)、docs/PLAN.md (4 当前已完成能力)
|
2026-08-24 14:04:59 +08:00 |
|
admin
|
86730bd52d
|
feat: 对标 Palantir Ontology + P0/P1/P2 全落地 + xeo 端到端导入
## Palantir Ontology 对标(10 项)
P0 核心契约:
- when_to_suggest JSONB + llm_tool_description TEXT 加到 function_types/action_types
- Action 完整契约: submission_criteria / side_effects / impl_function_id / return_type
- FBA (Function-backed Action) 执行链: /api/v1/objects/:type/:pk/actions/:action
- /api/v1/ontology/suggestions 提示调度端点
P1 元原语补全:
- Object Type UX: title_property / subtitle_property / color / primary_key
- Property 字段元数据: format / default_value / indexable / vector_index / backing_column
- Link Type: directional + 独立 link_properties 子表
- Interface Type: shared_properties + parent_interface_id 多态
- Property extended types: geoshape / geopoint / media / timeseries / timestamp
P2 数据管道层:
- materializations / materialization_rows 物化层 + 60s ticker scheduler
- backing_sources 同步源元数据 + 投影字段映射
AI 提示词升级:
- ai/prompt.go 抽出 250+ 行静态 systemPrompt
- 动态上下文注入: 每次 Suggest 前查 db 拉已注册类型清单
- Suggestion struct 扩展 22 字段
## ON CONFLICT 漏 source 修复(4 处)
- handlers_objects createObject/updateObject: COALESCE(NULLIF(EXCLUDED.source,''), objects.source)
- handlers_km upsertObject + ai.ApplySuggestion: SET source=EXCLUDED.source
- 表名必须限定 objects.source, 否则报 ambiguous
## xeo mobileApi 端到端导入
- /api/v1/ai/ingest raw_text 改用 json.dumps 转义, 修复 ingestion_id=56 failed
- 1179 实例 + 1672 links + 1806 物化行
- 占位: 5 TrustedDataSpace + 158 MemberOrg
- 5 类 Materialization 配好(mat_xeo_dataproduct 等)
## 文档
- docs/update/2026-08-24.md: 10 节迁移 + 增量 11 节
- .gitignore: 加 web/vite.config.js.timestamp-*.mjs
Refs: docs/update/2026-08-24.md
|
2026-08-24 13:54:49 +08:00 |
|
admin
|
f6ae259574
|
feat(ontology): 对象类型梳理 - 健康度扫描 + AI 同义判定 + 合并向导
让平台自己就能诊断同义/零实例/孤立/低区分度 4 类问题, 由 manager 审核后执行合并.
后端:
- 新建 server/handlers_ontology_cleanup.go, 4 个接口 (analyze / merge-preview /
merge-execute / delete-zero-inst), 均走 managerAuth 仅 manager 可调.
- 新表 ontology_audit_log (actor / action / target_type / details / affected_rows),
analyze / merge / delete-zero-inst 都写审计.
- ai.Provider 接口加 Complete(ctx, prompt) 轻量补全 (anthropic / openai / heuristic 实现),
ExtractJSON 改为导出.
- db.go DDL 幂等 CREATE TABLE / INDEX.
前端:
- api.js 4 个新 wrapper.
- OntologyView 第 6 个 Tab「类型梳理」: 一键扫描 + 4 类问题清单 +
同义组展开 (radio 选 target) + 合并预览 dialog + 一键删除按钮.
合并事务要点:
- 先 pk 加 _m<src_id> 后缀再 UPDATE object_type_id, 避免 UNIQUE(object_type_id,pk).
- 同时 UPDATE object_type_id + type_api_name, 保持两字段一致 (否则连接器查不到).
- link.source_type / target_type / link_types.source_type / link_types.target_type 同步改写.
- action_types 没有 target_type 字段 (在 params jsonb), 跳过.
健康度判定:
- 启发式候选: 名称规范化后相同 / Levenshtein ≤2 / HasPrefix 双向 (含
TrustedCryptoCard vs TrustedCryptographyCard) / 描述 Jaccard ≥ 0.6.
- AI 用 anthropic MiniMax-M3 复核, 给 confidence + reason + 建议 target.
- AI 未明确表态的启发式候选不强行过滤, 标 conf=0.5 让 manager 自己决定.
辅助:
- 提供 docker-compose.ontology.yml 片段给 workspace compose 挂载使用
(二进制 + archive + env + healthcheck + autoheal 自愈).
测试: 54→39 个对象类型, 13 个零实例一键删 + 2 组同义合并
(FunctionNode→FunctionalNode, TrustedCryptoCard→TrustedCryptographyCard),
审计日志 12 条, AI 实际接入 anthropic:MiniMax-M3.
|
2026-08-07 19:16:13 +08:00 |
|