lili
|
1cf2ab389a
|
docs(knowledge): 回写 parse worker 里程碑 + AI 授权 fail-closed 边界到模块 .agent
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-23 23:26:28 -07:00 |
|
lili
|
635045cc30
|
feat(knowledge): 补 parse 轮询推进 worker,打通摄入 parsing→searchable 终态
处理链 startParseDocuments 触发 RAGFlow 解析后置 parsing/processing 即返回,RAGFlow 解析+embedding+索引为异步;此前无 worker 轮询其完成态(pollDocumentStatuses 仅 IT 手动调用),文档永久卡 parsing 无法 searchable。
新增 MuseKnowledgeParseStatusPollWorker(@Scheduled,默认关闭开关 muse.knowledge.parse-poll-worker.enabled):
- 跨租户捞 parsing 任务(selectParsingForPoll + executeIgnore),逐个切回任务租户轮询 RAGFlow 文档状态
- museStatus=searchable(RAGFlow run=done)→ markRagflowParseCompleted(task completed + version processingStatus=searchable → 文档 isSearchable=true,可进检索)
- failed → markRagflowParseFailed;processing → markRagflowParsePolling 刷新进度并保持 parsing
- RAGFlow 临时不可达/轮询异常一律保持 parsing 等下轮重试,绝不误判失败
ProcessingTaskService 补 markRagflowParseCompleted/markRagflowParsePolling;Mapper 补 selectParsingForPoll。
验证: worker 接线 7 + 回归(DocumentService 17 + Facade 3 + ScanService 9 + P-B RetrievalApiImpl 11) 全绿。端到端启用开关后真验。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-23 21:14:07 -07:00 |
|
lili
|
ec4a02ded2
|
feat(knowledge): 文本内容安全扫描,打通知识库摄入 scanning 关卡
实现 KnowledgeContentScanService(同步纯文本字符扫描),替换 KnowledgeFileFacade.materialize 恒 scanBlocked 占位:合法文本→scanStatus=passed→放行入 RAG,恶意字符→隔离,扫描异常→fail-closed。
范围:纯文本(txt/md/entry),内容只作检索文本、不渲染,故不做 HTML 消毒。
- L1 硬阻断:非法 UTF-8 / null 字节 / 危险 C0-C1 控制符 / Bidi 覆盖(Trojan Source) / 体量超限
- L2 规整:Unicode NFC + 去零宽 + 统一换行 → 干净内容入库/入 RAG
- L3 软策略:prompt 注入特征仅写 riskSummary 不阻断(误报高,真正防线是 P-A prompt 边界)
- 服务端权威 + fail-closed(对齐 SSOT 契约);特殊字符判定用十六进制码点,避免源码出现字面不可见字符
- MaterializedFile.scanBlocked 加 reasonCode/message;下游 isRagflowAllowed 总开关已就绪,无需改动
设计 spec:docs/agent-specs/2026-06-23-knowledge-content-scan-execution.md
验证:ScanService 9 + Facade 接线 3 + DocumentService 17(无回归) + P-B RetrievalApiImpl 11(无回归) 全绿。端到端真摄入(scan→RAGFlow→检索)验收待 rebuild 重启后补。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-23 10:28:19 -07:00 |
|
lili
|
a5b91da7a5
|
fix(infra): 补 muse_slice_live 缺失的 yudao @KeySequence 命名序列(dev 环境修复工具)
slice 库建表时漏建 yudao 各模块命名序列(@KeySequence 依赖),导致 system_login_log 等表 insert 时 SELECT nextval 报序列不存在(admin login 500)、知识库摄入受阻。
新增 sql/dev/muse-slice-sequences-repair-postgres.sql:
- 序列清单=全仓 @KeySequence 扫描(92 个),与代码一致(已 diff 校验无漏无多)
- DO block:CREATE SEQUENCE IF NOT EXISTS(幂等)+ 按对应表 MAX(id) setval 对齐(避免序列从 1 起与既有数据主键冲突);表不存在或主键非 id 则只建序列、跳过对齐
- 只新增序列对象,不改表结构、不动数据,可重跑
适用命名序列版 slice 库(与 sql/dev/yudao-base-schema 的 IDENTITY 自增版策略不同,后者自洽不需此补丁)。对 muse_slice_live 执行后 public 序列 2→93,配合 muse-file-config-master-seed 打通文件存储链路(FILE_SERVICE_UNAVAILABLE 解除)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-23 07:57:45 -07:00 |
|
lili
|
d07770c701
|
feat(ai-knowledge): P-C 质量门控可追溯,固化 Context Assembly Snapshot 到生成记录
专题-03 AI 检索串联第三期(P-C):AI 生成时把检索上下文组装结果固化为 Context Assembly Snapshot,内联进 generation.sourceSummary(jsonb,复用现有快照机制,无新表/无 DDL),作为质量评测可追溯输入(§8;门控评分本身归专题-04)。
- facade ContextAssembly 补 assemblySnapshot:status/chunkCount/retrievedKbIds/authorizationSnapshotIds/omittedSources(§8 可追溯)
- executor:检索组装提到 runtimeCommand 层,快照放进 command.inputSummary,经 command 流到 projection
- projection applyRuntimeResponse:把 contextAssembly merge 进 generation.sourceSummary 持久化(command/inputSummary null 防御)
- 整改 P-A 测试债:MuseAiTaskServiceTest 补 knowledgeRetrievalFacade mock(executor 自 P-A 起注入但未接桩,致 runtimeCommand 路径 14 例 NPE)
验证:facade 7 单测(含 snapshot 断言)+ projection 5 + task 40 防回归 + impl 11 回归 + ArchUnit 3 全绿。端到端真链路(真生成验 generation.sourceSummary 含 contextAssembly)验收待补。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-23 04:19:27 -07:00 |
|
lili
|
5659eb66c6
|
feat(ai-knowledge): P-B 授权过滤 fail-closed,检索结果补齐 §5.3 合同字段 + omittedSources
专题-03 AI 检索串联第二期(P-B):在 P-A 最小检索链路上叠加按用途授权 + 来源状态门控(fail-closed),检索结果补齐 §5.3 可追溯合同字段,被过滤来源透出 omittedSources 供审计。
- §4.3 用途门:binding.bindingScope 须含 "search" 上下文检索用途(阅读/导出≠检索),否则拒
- §4.3 来源状态门:projection.status ∈ {revoked,recalled,delisted,blocked,owner_missing,unauthorized} 一律拒;active/stale 纳入(stale 非阻断);active binding 无投影则 fail-closed
- §5.3 授权快照门:缺 authorizationSnapshot 的来源不进 Prompt
- §5.3 chunk 补字段:sourceOwner/sourceObjectVersion/authorizationSnapshot/sourceStatus/allowedPurpose
- omittedSources:被授权门过滤的来源(kbId/reason/sourceStatus)透出;executor metadata 透出 omittedSourceCount
- 全部消费已有 binding + source_binding_projection 数据,无新建授权模型/表
验证:knowledge 11 单测 + ai 6 单测 + ArchUnit(BcBoundary/AiGrantRuntime)全绿。端到端真链路(真 RAGFlow 摄入 + 真 New-API 生成 + 授权门生效)验收待补(攒 P-B 后一次做)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-23 03:59:36 -07:00 |
|
lili
|
987a20b5b7
|
feat(ai-knowledge): P-A 最小检索串联,AI 生成接入知识库 RAGFlow 检索填充上下文 L3
专题-03 AI 编排上下文核心链路第一期(P-A):打通 AI 生成链消费 knowledge 知识库 RAGFlow 检索,将授权知识片段填入 provider prompt 的上下文 Layer 3(§4.2 授权资料)。
- knowledge-api:新增 MuseKnowledgeRetrievalApi 对外检索端口(BC 合规,他域只依赖 -api)
- knowledge-server:MuseKnowledgeRetrievalApiImpl 实现 work→active binding→kb→active dataset→RAGFlow retrieveChunks→解析 data.chunks→脱敏;最小授权门(tenant/owner/work 必填 fail-closed)+ 检索失败/无命中一律返回 empty 不抛、不阻断主生成链
- ai-server:KnowledgeRetrievalFacade(@Primary,fail-closed 降级)+ executor executionPrompt 注入 L3 检索上下文(无命中退化为仅 metadata、不臆造)
- chunk 字段解析经 RAGFlow /api/v1/retrieval 官方契约验证(content/kb_id/document_id/similarity)
验证:knowledge 7 单测 + ai 4 单测 + ArchUnit(BcBoundary/AiGrantRuntime)全绿;chunk 解析对齐官方 RAGFlow HTTP API 响应结构。端到端真链路(真 RAGFlow 摄入 + 真 New-API 生成)验收待补。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-23 02:18:40 -07:00 |
|
lili
|
9ad619fcd6
|
docs(ai): AI 生成链↔knowledge RAGFlow 检索串联评审版(专题-03 核心)
2 路调研(反假绿 file:line)裁定 AI 检索消费链路:
- 缺口=中间层非基建:两端齐备(executionPrompt 明文"Source text not included this phase";
knowledge retrieveChunks 已被真实 RAGFlow IT 验收 chunksCount>0、但 0 对外暴露、生产调用方 0),
缺 knowledge-api 检索端口 + AI 侧 Context Assembly 层
- 外部全在线可真验(RAGFlow status:ok + New-API MiniMax-M2.5 实证)
- 专题-03 §4 四层上下文 + §5.3 检索结果合同 + §4.3 按用途授权过滤为硬约束(fail-closed)
- 建议分 3 期:P-A 最小检索串联真验 → P-B 授权过滤 fail-closed → P-C 质量门控快照
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-23 01:22:44 -07:00 |
|
lili
|
b5a6b1b423
|
docs(handoff): market 资产物化架构评审版(裁决伪缺口 + O1 跨租户验证)
2 路调研 + O1 验证(反假绿 file:line)裁决"market 资产物化":
- B(内容副本)与产品-02F:135 禁止项 + Candidate Envelope 已确认决策冲突 → 否
- O1 实证:单租户运行(system_tenant 仅 id=1)+ AI 消费链路(binding→kb 正文)未建成
(ai application 全量 grep 零命中)→ C/B' 解决的跨租户可读问题当前不触发、
服务的消费场景不存在 → 双重假想未来建设(违 YAGNI)
- 结论:整条物化主线暂缓,前置(真多租户 or AI 检索消费链路/RAGFlow)就绪前不投入
- SSOT 内部矛盾(A 不物化 vs B 物化)待人类裁决;V27 物化注释系 P2 自写、证据弱
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-23 00:52:47 -07:00 |
|
lili
|
b9993177eb
|
docs(handoff): 回写 P3 content asset_use 交付(三 owner token 红线全覆盖)
进度总账加 P3 条 + 总览 handoff 行(knowledge P1/agent P2/content P3 三 owner 全覆盖)+
P3 review spec §九实施状态。诚实范围:asset_use=使用授权事实记录非物化、AI 上下文消费另立、
剩 market→kb/agent 资产物化独立主线。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 23:48:40 -07:00 |
|
lili
|
26425b1755
|
test(handoff): P3 content asset_use 真后端 e2e + global-setup #14
handoff-content.spec(48080+真 PG+V28 真表):正路 bind-precheck(content)→
createHandoff(content/asset_use)→asset-use-precheck(后端 verify+consume)→asset-uses
落使用事实(单表转 consumed、assetUseId=precheckId);负路伪造 token 被后端 verify 拒(0 写)。
global-setup #14 每轮清 work4 asset_use precheck(asset_use 不绑实体、无需 seed fixture)。
验证:handoff-content 2 passed、全量 e2e 50→52(1 flaky knowledge-disable-restore 单跑绿、非回归)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 23:48:40 -07:00 |
|
lili
|
7bb15a5cf4
|
feat(handoff): P3 content 兑现侧落地 + 02F 来源侧发起(完整闭环)
ContentHandoffLanding(P3 完整闭环):bind-precheck(targetOwner=content)拿可信 source →
assetUsePrecheck(market+token,后端 verify+consume)→ setPrecheck(token 用完即弃)→
读 work revision → createAssetUse(凭 precheckId)→ 完成。useContentHandoff hooks +
HandoffLandingPage content dispatch + MarketAssetDetailPage「用于作品(进入作品空间)」发起入口
(asset_use 不依赖物化、sourceAssetId 真实,故来源侧发起完整可用、比 P1/P2 更完整)。
验证:tsc OK、eslint 空、vitest 97→101(ContentHandoffLanding 4:就绪/闭环/核验拒绝/会话失效)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 22:52:16 -07:00 |
|
lili
|
d113f4ee15
|
feat(handoff): P3 content asset_use 两段式后端(token 红线 + 单表事实)
content asset_use 从零建(SSOT 后端-04 定义表名/索引、建表 SQL 此前未写、feature disabled):
- V28 建表 muse_content_work_asset_use_precheck(单表,照 knowledge bind_precheck)
- 两段式:asset-use-prechecks(market 来源 verify(content/asset_use)+consume token、明文仅此阶段)
→ asset-uses(凭 precheckId + work 级乐观锁,单表转 consumed 即使用事实,AI archive 引用 precheckId)
- purposes 白名单 reference/ai_context/generate_reference(禁 template 模板化=forbiddenPurpose)
- content-server 依赖 market-api(经端口,不碰 market.dal)+ 错误码 1_041_002_xxx
验证:编译 OK、MuseContentAssetUseServiceTest 8/0(正路 verify+consume/伪造拒/缺 token 拒/禁用 purpose 拒/
越权拒/create 闭环/work revision 冲突/precheck 过期)、BcBoundaryArchTest 0 违例(content→market-api)。
asset_use 只记录使用授权事实、不写正文/参考来源(产品-02F L456),不涉及资产物化。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 22:51:59 -07:00 |
|
lili
|
1a11bbde7a
|
docs(handoff): P3 content asset_use 从零建评审版(基于 2 路真实调研)
handoff 最后一 owner。基于 content 后端代码 + design-docs SSOT 2 路只读调研:
- asset_use=使用凭证记录非物化(后端-04 L135/产品-02F L456),P3 范围无物化分裂
- SSOT 定义 precheck 表+precheck_id 索引但建表 SQL 未写(后端-04a 13 表无 asset_use),
无独立绑定事实表(AI archive 引用 work_asset_use_precheck_id,后端-04 L849)
- 两段式照 knowledge/P2 同款(token verify+consume 在 precheck 阶段、create 凭 precheckId)
- purposes 禁模板化(forbiddenPurpose);revision work 级
拍板点 Q1(落库形态)/Q2(用户价值锚点)/Q4(范围),Q3/Q5 SSOT 已定确认即可。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 22:26:17 -07:00 |
|
lili
|
6616bf1022
|
docs(handoff): 回写 P2 agent 兑现进度(总账 + 总览 + review 实施状态)
- 进度总账:加 2026-06-22 P2 时间线条目(后端放宽+verify/consume+V27、前端落地组件、
真后端 e2e 2/2、单测 25/0、ArchUnit 3/0、vitest 97、全量 e2e 50;诚实标注 market→agent
物化未接、e2e 用 seed fixture 替代、来源侧发起暂不做)
- 总览:handoff 令牌消费端 knowledge(P1)→ +agent(P2)红线闭环已接,剩 content(P3)
- P2 review:加实施状态行(✅ 已按方案 A 实施并真后端验证)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 13:13:00 -07:00 |
|
lili
|
2a7906c74e
|
test(handoff): P2 agent 兑现真后端 e2e + seed market agent fixture
global-setup #13:seed market 类型 agent(固定 agent_key)+ active version + work4 槽位绑定,
每轮幂等复位(子表先删再重建);供 market→agent 跨空间 handoff e2e(market→agent 资产物化未接,
此处为预置 fixture)。
handoff-agent.spec(真后端,反假绿):
- 正路:bind-precheck(targetOwner=agent)→ createHandoff 签一次性 token → agent precheck
(market_agent + token):后端 verify+consume+放宽接纳 market 类型 agent → bind 落槽位(slotRevision=2)
- 负路:伪造 token 调 agent precheck → 后端 verify 拒(code≠0),不放宽、0 写
验证:V27 已应用共享 muse_slice_live(flyway "now at version v27",用户拍板应用);handoff-agent
2/2 passed(真 PG + 真 token + V27 真列);全量 e2e 50 passed(唯一 flaky=knowledge-disable-restore
全量时序、单跑 2/2 绿、用 KB id=1 与 handoff 用 work4 无关,非 P2 回归)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 13:09:47 -07:00 |
|
lili
|
4c3e8bb905
|
feat(handoff): P2 agent 兑现侧前端落地组件(token 红线闭环)
AgentHandoffLanding(P2 兑现侧):从 store 取 token + URL params 取 agent 参数(slotKey/
sourceAgentId/version/revision)→ agentSlotPrecheck(market_agent + handoffToken,后端核验+核销)
→ setPrecheck(token 用完即弃)→ bindAgentSlot(只消费 precheckId)→ 绑定完成。
useAgentHandoff hooks + HandoffLandingPage owner dispatch +agent。
诚实范围:来源侧发起入口(MarketAssetDetailPage agent 按钮)依赖 market→agent 资产物化
(未接、列独立后续),做了会是半成品故暂不做;agent 参数经 URL 透传,e2e 用 seed market
agent + 直接构造落地 URL 验证兑现侧放宽红线。
验证:tsc -b OK、eslint 空、vitest 97/97(含 AgentHandoffLanding 4:就绪/闭环/核验拒绝/会话失效)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 12:38:45 -07:00 |
|
lili
|
65f949c997
|
feat(handoff): P2 agent 放宽接纳 market 来源 + verify/consume(后端)
跨空间 handoff(market→agent)兑现侧:放宽 requireVisibleActiveSourceAgent 的 agentType
校验仅接纳 verify 通过的 market token(precheck+bind 两处);precheck 阶段 verify(targetOwner=
agent)+consume(token 用完即弃)、落 source_owner/handoff_hash;bind 凭 precheck.source_owner=
market 识别放宽路径(不重复核验、凭 precheckId 信任)。保护节点/work 属主/agent-version active/
非 handoff 原校验全不放宽。
- ai-server pom +market-api;V27 加 source_owner/handoff_hash + muse_agent.source_market_asset_id(可空)
- AgentSlotPrecheckReqVO +sourceType/handoffToken/sourceId/sourceVersion/authorizationSummaryId
- ErrorCodeConstants +AI_MARKET_HANDOFF_UNAVAILABLE;precheckAgentSlot 签名 +apiVersion(consume 需要)
验证:MuseAgentSlotServiceTest 25/0(含 5 P2 红线单测:正路放宽接纳/verify 拒/无 token 拒/
非 handoff 维持 system-user 校验/bind 凭 source_owner 放宽);Bc+AiGrantRuntime ArchUnit 3/0
(ai 依赖 market-api 合法、consume 在 application 层不破 runtime 隔离)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 12:30:50 -07:00 |
|
lili
|
d42e2b8be3
|
docs(handoff): 订正 P1 完成度表述 + P2 拍板(方案 A,反假绿)
P2 调研连带发现 handoff "资产物化"维度(market asset→目标 owner 实体)P1–P3 全缺:
knowledge sourceMarketAssetId 字段在却无人写入、binding kb_id=parseLong(sourceId)
直用预存 kb、market install 不建实体(MarketInstallServiceImpl:63);agent 连字段都无。
P1 e2e 绿靠 fixture 巧合(asset1→kb_id1)。订正 P1 表述为"token 红线端到端 + 绑定
落库"(红线真生效属实、物化维度未接,列独立后续)。
P2 拍板方案 A(最小验证放宽红线,与 P1 同口径):加字段 + agent_type=market + seed
fixture + 放宽 + verify/consume + e2e;install 自动物化列独立后续。评审版落 §十 拍板结论。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 12:12:23 -07:00 |
|
lili
|
cd75b0247c
|
docs(handoff): P2 agent 放宽安全评审版(spec §六.3 单独评审)
基于真实代码实证(2 路只读调研)产出 P2 单阶段评审:精确放宽
requireVisibleActiveSourceAgent 的 agentType 校验仅接纳 verify 通过的 market
token;precheck+bind 两处放宽(bind 凭 precheck.source_owner 识别);precheck
DO/表加 source_owner/handoff_hash 列;不破保护节点/work 属主/active/AI 授权
隔离。三拍板点待人类定(头号:market→agent 资产物化模型决定放宽是否必要)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 10:50:58 -07:00 |
|
lili
|
a09bf9cda3
|
fix(handoff): P1 knowledge 落地闭环修复(ready 态 + returnUrl 契约)
KnowledgeHandoffLanding: token 用完即弃后(setPrecheck 清 handoffToken)以 precheckId
维持就绪态,兑现中不误退"会话失效"。
MarketAssetDetailPage: createHandoff 的 returnUrl 用绝对 URL(后端 validateReturnUrl
要求 scheme+host),前端 navigate 仍用相对 path。
均为 handoff-knowledge e2e 正路闭环验证依赖的修复(真后端 2 passed)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 10:35:38 -07:00 |
|
lili
|
610ba7ce6a
|
docs(progress): 回写 handoff P0/P1 knowledge 端到端闭环交付
进度总账加 handoff 跨空间统一接入 P0 基座 + P1 knowledge 流水(真后端 e2e
反假绿:正路完整兑现闭环 + 负路伪造 token 被后端 verify 拒,2 passed + 二次
幂等);总览市场待办行标注 handoff 令牌消费端 knowledge owner 已闭环、剩
agent/content owner(P2/P3)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 10:34:50 -07:00 |
|
lili
|
86bdba7974
|
test(handoff): P1 knowledge 兑现端到端真后端 e2e + fixture 复位
handoff-knowledge.spec(真后端 48080, MSW off):
- 正路:市场资产→获取授权→bind-precheck 就绪→前往绑定(createHandoff token)→落地页(URL token 经 replaceState
清除)→确认→kbBindPrecheck(后端核验+核销 token)→createBinding→绑定完成。证红线兑现闭环真生效。
- 负路:伪造 handoffToken 直打 kbBindPrecheck→后端 verify 拒(code 非 0)。证"不信客户端 token"红线后端真拦截。
- 用 work4(creator=test1、未占 uk);work1+kb1 已被 installed binding 占,避 uk_muse_knowledge_binding_work_kb 冲突。
global-setup #12:每轮清理 handoff 兑现产生的 market_kb 绑定(work4+kb1,按 source_snapshot_id 精准删),供闭环幂等重跑。
验证:handoff-knowledge 2 passed + 二次幂等绿;全量 48 passed。
(knowledge-disable-restore 全量时序 flaky——单跑 2 passed,预存在共享 fixture 时序、与本改动无关:handoff 不碰 KB id=1。)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 10:31:18 -07:00 |
|
lili
|
6a56524679
|
feat(handoff): P1 前端 knowledge 兑现闭环——发起+落地组件+mock+单测
P1 knowledge 端到端前端(纯前端,零后端改动——bind-precheck 已返回全部可信 source):
- 发起(MarketAssetDetailPage):bind-precheck 就绪→createHandoff 创建一次性 token→跳 /handoff/land/knowledge
(token 走 URL query,落地页随即 replaceState 清除,防刷新重复消费)。
- 落地(KnowledgeHandoffLanding):3 步兑现闭环——来源侧 bind-precheck 拿后端可信 source(authorizationSummaryId/
Snapshot/sourceVersion/sourceStatus,不信客户端自造)→目标侧 kbBindPrecheck(后端核验+核销 token,换 precheckId、
token 用完即弃)→createKnowledgeBinding(读 work revision 防乐观锁,落 binding)→clearSession 返回来源。
- owner 分发(HandoffLandingPage):按 targetOwner=knowledge 渲染落地组件,agent/content 留 P2/P3。
- 兑现 hooks(useKnowledgeHandoff)+ 类型收口(MarketBindPrecheckResult.sourceVersion、CreateHandoffInput
.authorizationSummaryId 对齐后端 Long,均 openapi 手写类型此前漏标的 drift)。
- mock handlers(market bind-precheck/handoffs/status + knowledge bindings/prechecks),支撑 dev 模式跑通闭环。
验证:tsc/eslint 绿;vitest 89→93(+KnowledgeHandoffLanding 4:就绪渲染/完整闭环/后端核验拒绝负路/会话失效)。
红线真生效(拒伪造/过期 token + 核销 + DB)待真后端 e2e(handoff-knowledge.spec)端到端覆盖。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 09:42:04 -07:00 |
|
lili
|
e5d2b52f20
|
feat(handoff): P1 后端 knowledge 兑现侧接入 Market token 核验/核销
P1(首条端到端 knowledge):knowledge-server 依赖 market-api,createKnowledgeBindingPrecheck
的 market_kb 来源在 precheck 阶段(token 明文仅此阶段持有、createBinding 的 BindReqVO 无 token)
调 MarketHandoffTokenApi.verify 服务端核验(属主/过期/一次性/owner-action),通过则 consume 核销
(消费换 session),替代此前"只存 hash 不验真"假安全。沿用 precheck @Transactional 事务保
verify/consume/落库原子。
注:执行版原写"createBinding 调 consume",自审修正为 precheck 阶段(token 明文仅此可得)。
验证:knowledge-server 编译(-am 连带刷新 meta-api 等)+ BcBoundaryArchTest 绿(knowledge→
market-api 合规、边界放行 -api)。端到端真实行为(拒伪造/过期 token + 核销 + DB)随 P1 前端 +
handoff-knowledge.spec 真后端 e2e 覆盖。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 09:09:26 -07:00 |
|
lili
|
a3b45ae6b5
|
feat(handoff): P0 统一基座——Market token 核验/核销端口 + 前端 HandoffStore/落地路由
handoff 跨空间统一接入执行版 P0(基座,前后端共享):
- 后端 market-api 新增 MarketHandoffTokenApi(verify 只读核验 + consume CAS 核销)+ market-server
实现:复用现有 selectByTokenHash/effectiveStatus/updateLifecycleByExpectedStatus + cancel 同款
envelope 幂等;consume 沿用调用方事务保原子(绿地:completed 状态此前无生产写入路径)。出参脱敏不回 token。
- 前端:openapi 导出 Handoff 类型;HandoffStore(Zustand,token 一次性用完即弃 + precheck 会话态);
通用 hooks(create/status/cancel);落地路由 /handoff/land/:targetOwner(红线:解析 token→
replaceState 清 URL→存 store,防刷新重复消费)。
验证:market 编译+install+BcBoundaryArchTest 绿;前端 tsc/eslint 绿、vitest 82→89(+handoffStore 5
+HandoffLandingPage 2)。verify/consume 真实行为(拒伪造/过期/跨属主 token + CAS 核销 + DB)随 P1
knowledge 端到端真后端 e2e 覆盖。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 09:02:52 -07:00 |
|
lili
|
5ae48383d6
|
docs(agent-specs): handoff 执行版 + 自审补强 targetPage 透传契约
执行版按拍板(三 owner 全补 + Market consume 端口)给出:统一前端基座(HandoffStore/
hooks/落地路由/类型收口)+ market-api verify/consume 端口 + 三 owner 兑现侧 token 回验
+ 分 P0-P3 按 owner 独立验证 + 边界/失败路径/验收/回滚。
自审补 §四.0:targetPage 是后端意图描述(非前端路由、不带 token)、token 由前端持有
附加进落地路由、authorizationSummaryId/returnUrl 透传链、刷新风险。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 08:43:33 -07:00 |
|
lili
|
9f0d581f38
|
docs(agent-specs): handoff 评审版记录拍板(三 owner 全补 + Market consume 端点)
用户走查拍板:① 范围=一次补全 knowledge+agent+content 三 owner 兑现侧(非 MVP 单条);
② token 核销=Market 新增显式 consume 端点(核销 authority 留签发方)。据此将出执行版。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 08:32:13 -07:00 |
|
lili
|
cb14b40223
|
docs(agent-specs): handoff 跨空间统一接入评审版(B 类头号架构缺口)
三方并行调研(后端契约/design-docs SSOT/studio 现状)证实 handoff 红线五域零落地、
后端兑现侧断链(token 不验真、Market 无 consume、agent/content 无兑现入口)。评审版定性
B+C 混合(前端四环统一层 + 后端兑现侧 token 核验),MVP 纵切市场→知识库,分 P1-P4 演进。
含拍板点表/Mermaid 数据流(标注前端缺/后端断链)/blast radius/验收/Open Items。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 08:25:28 -07:00 |
|
lili
|
f3967da5f3
|
docs(进度总账): A 类第三切片治理影响接入(全量 e2e 47/0,A 类告一段落)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 07:50:30 -07:00 |
|
lili
|
ab83735f6f
|
feat(studio): 资产详情页治理影响接入真后端(A 类:消费者治理 C14 读端)
A 类(后端就绪、前端 0 消费):02F GET /marketplace/assets/{id}/governance-impact 就绪
(curl code:0 + 真实 governanceResult:resultType/reason/操作限制 + affectedAuthorizations/
suggestedActions),但 studio 详情页无展示(盘点 C14 消费者治理缺口)。接入:
- useGovernanceImpact hook + openapi 导出 GovernanceImpactResult
- MarketAssetDetailPage「治理影响」区:结果类型(下架/召回/吊销/可申诉)+ 操作限制(停止获取/安装/绑定/生成)+ 建议动作
- mock handler + vitest 契约 + market-governance-impact.spec.ts 真后端 e2e
- 修 spec 块注释内 affected*/ 的 */ 意外闭合(tsc 不覆盖 e2e、playwright esbuild 暴露)
验证:全量 e2e 46→47/0;vitest 81→82;tsc/eslint 绿。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 07:49:08 -07:00 |
|
lili
|
a2f2ba33fe
|
docs(进度总账): A 类第二切片 New-API 绑定摘要接入(全量 e2e 46/0)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 07:38:12 -07:00 |
|
lili
|
7408615037
|
feat(studio): 个人中心 New-API 绑定摘要接入真后端(A 类:接已就绪后端)
A 类(后端就绪、前端 0 消费):02G GET /account/new-api-binding 后端就绪(curl code:0、
未绑定时 fail-closed 返 bindingStatus=unbound),但 studio 无任何展示(盘点 02G ❌ 缺口)。接入:
- useAccountNewApiBinding hook + openapi 导出 NewApiBindingSummary
- PersonalCenter「New-API 绑定」区:bindingStatus 中文徽标(已绑定/未绑定/同步失败/同步中)+ 上次同步时间
- mock handler + vitest 契约 + account-newapi-binding.spec.ts 真后端 e2e
验证:全量 e2e 45→46/0;vitest 80→81;tsc/eslint 绿。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 07:37:22 -07:00 |
|
lili
|
bcb670ba4d
|
docs(进度总账): A 类首切片市场推荐位接入(后端就绪前端0消费,全量 e2e 45/0)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 07:30:38 -07:00 |
|
lili
|
cac3b8837f
|
feat(studio): 市场推荐位接入真后端 recommendations(A 类:接已就绪后端)
A 类(缺口盘点:后端已就绪、前端 0 消费):02F GET /marketplace/recommendations 后端就绪
(curl code:0 + 真实推荐资产 + recommendationReason),但 studio 从不调用、推荐理由仅 mock
造、UI 未渲染(盘点 C3)。接入:
- useMarketRecommendations hook(返回 MarketAssetCard[],推荐失败不阻断主列表)
- MarketBrowse「为你推荐」区:渲染推荐资产 + recommendationReason,点击进详情
- mock handler + vitest 推荐契约;market-recommendations.spec.ts 真后端 e2e
- 连带修 live-read market 断言加 .first()(推荐位与列表可同时渲染同名资产→strict mode)
验证:全量 e2e 44→45/0;vitest 79→80;tsc/eslint 绿。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 07:29:14 -07:00 |
|
lili
|
1686843e71
|
docs(进度总账): admin+studio 缺口盘点 + D 类正文保存 e2e 闭环 + AI 四重阻塞定位
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 07:05:40 -07:00 |
|
lili
|
a581fec913
|
fix(studio): 正文保存补真后端 e2e + 修 block/work revision 字段漂移(D 类反假绿)
D 类(缺口盘点最高优先):正文自动保存是写作台心脏却零 e2e、仅 MSW 掩盖。补
block-autosave.spec.ts 真打 PUT /works/{id}/blocks/{id} 暴露并修真 bug:
- block revision 漂移:WorkspacePage 裸读 activeBlock.version(真后端返 revision、无 version)
→ expectedRevision 恒为 1 → 真后端乐观锁必冲突(1041000002,curl 实证)。提 blockRevision()
到 useBlockStructure 共享、WorkspacePage 复用。
- work revision 漂移(tsc -b 增量重检暴露):WorkVO 类型无 revision、真后端 detail 返 revision,
chapter create/work delete 裸读致 TS 报错。加 workRevision() helper。
- MuseEditor saveBlock 返回 { revision }(非 openapi 标的 newVersion),L110 改 revision 优先兜底。
- market 申诉 deadline fixture 老化(纯时间推进、非代码):reviewedAt+7天过期致提交被拒
1044000027,globalSetup 刷新被驳回 request.reviewed_at 到近期。
验证:block-autosave + block-structure/chapter/work 回归 4/4 绿;全量 e2e 44/0;tsc/eslint/vitest 79/79。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 07:02:13 -07:00 |
|
lili
|
d59fdab9b2
|
docs(进度总账): V27 验证结论——13 业务键 uk 当前无删除入口、不触发,V27 不做 + 潜伏 checklist
Explore 全量 + 抽验确认 meta/ai/knowledge 这 13 表当前无删除 service/controller 入口,
软删 uk 漏 deleted 仅在"删除→重建同 key"时触发,无删除即不触发。区别于 content
chapter/block(有软删、必触发、已 V26 修)。记潜伏 checklist:未来加删除功能须配套修 uk。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 01:19:13 -07:00 |
|
lili
|
2620d90b8f
|
docs(进度总账): V26 已应用 + chapter e2e 转正(全量 43/0 全绿,软删 uk 修复闭环)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 00:33:48 -07:00 |
|
lili
|
a752626286
|
test(content): V26 应用后 chapter-create-delete e2e 转正(全量 43/0 全绿)
V26(章节/Block order_no uk 改 partial index WHERE deleted=false)已 flyway 应用(now at v26),
curl 实证建 order=2 章节(之前撞软删行 → 500)→ code:0。chapter-create-delete.spec.ts 由 test.fixme
转回 test(),建→删配对通过;全量 e2e 43/0(原 +1 fixme 现转正、0 skipped)。
content 写路 + 软删 uk 修复完整闭环:chapter create/work delete 前端契约 + chapter/block order_no
后端 schema 双修验证通过。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-22 00:32:48 -07:00 |
|
lili
|
5c6409ea7a
|
docs(进度总账): 写命令契约盘点收口(agent/kb/market 健康,content 写路是唯一 gap 区)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-21 19:12:47 -07:00 |
|
lili
|
172261f540
|
fix(content): V26 修章节/Block 软删后 order_no uk 碰撞(partial index,待人类应用 flyway)+ 软删 uk 全仓审计
审计(用户授权):Explore 扫 177 uk,22 高危/137 中危/18 安全(yudao 软删 + ~99% uk 漏 WHERE deleted=false)。
精炼剔假阳(幂等/递增键不复用),真可复用业务键 uk = content order_no×2(确证)+ meta/ai/knowledge *_key×13。
全仓 ON CONFLICT 仅引用 command_id/id/asset/kb/validation/source,22 高危均不被引用→改 partial 安全。
V26 修 chapter+block order_no 改 partial index WHERE deleted=false(block create L294 确证同 selectCount+1 bug)。
应用需重启 48080 跑 flyway(DDL 改真 PG,auto-mode 归人类执行,未绕过)。chapter-create-delete e2e 保持
test.fixme、注释指向 V26,人类应用后转正。其余 13 业务键 uk 建议 V27 按模块逐步修(账本有清单)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-21 19:09:59 -07:00 |
|
lili
|
a30a9686ff
|
docs(进度总账): 删除作品契约字段修复 + content 写路系统性 gap 小结(59d1396,全量 42/0)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-21 14:09:27 -07:00 |
|
lili
|
59d139637a
|
fix(editor): 修删除作品缺契约字段致真后端 400(反假绿挖出,纯前端修复)
前端 useWorkDelete 此前 api.delete 不传 body,而后端 deleteWork 要 @Valid RevisionCommandReqVO
(commandId 幂等 + expectedRevision 作品乐观锁)→ 真后端删作品必 400(dev mock 不校验长期掩盖)。
又因列表 VO(GET /works)不含 revision 字段(仅 detail 有),无法直接取乐观锁版本;故 useWorkDelete
改为删除前先读 work 详情拿 revision,再带 commandId 提交删除(删除低频、额外一次 GET 可接受)。
补 work-create-delete.spec.ts(配对自清理 e2e:建作品→删作品,验 DELETE 200/code:0 + 列表无残留)。
curl 实证后端 work create→delete code:0(无 chapter 那类 order_no schema bug)。
tsc/eslint 0,vitest 79/79,全量 e2e 42/0(+1 chapter fixme)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-21 14:08:08 -07:00 |
|
lili
|
c4d3041268
|
docs(进度总账): 章节新建前端契约修复 + 后端 order_no 软删 schema bug 发现(ca33c8e,待人类定 DDL)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-21 13:56:21 -07:00 |
|
lili
|
ca33c8e006
|
fix(editor): 修新建章节缺契约字段致真后端 400(反假绿挖出)+ 标注暴露的后端 order_no 软删 bug
前端 useChapterCreate 此前只传 {title},而后端 ChapterCreateReqVO 强制 commandId(幂等)+
expectedWorkRevision(作品乐观锁),缺失被 @Valid 拦成 400——dev mock 不校验、长期掩盖,真后端建章必败。
修:useChapterCreate 补 commandId + expectedWorkRevision;ChapterPanel 经 props 接 work.revision、
WorkspacePage 传入;建章后失效 workDetail 缓存避免后续写命令复用旧 revision。
补 chapter-create-delete.spec.ts(配对自清理 e2e),暂 test.fixme:前端修复后请求合法到达后端,
又暴露独立后端 bug——createChapter orderNo=selectCountByWorkId(active)+1,章节软删后行仍在、
uk_muse_content_chapter_work_order 不含 deleted(同文件 command uk 是 partial index 却此处遗漏)
→ 删章节后再建 order_no 冲突 500。属 schema/软删语义,需人类定 DDL 修法,fixme 待修。
tsc/eslint 0,studio vitest 79/79,全量 e2e 41/0(+1 fixme)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-21 13:54:34 -07:00 |
|
lili
|
901f8e8aec
|
docs(进度总账): 个人中心 account 面真后端 e2e 全闭环(全量 41/0)
补权益配额/用量归属 e2e(1dbbfc7);account 面 profile 读写/权益配额/用量归属/
购买授权发布三件套/安全事件 ack 全覆盖。本会话 35/1→41/0。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-21 13:31:47 -07:00 |
|
lili
|
1dbbfc78b5
|
test(account): 补权益配额/用量归属真后端 e2e(UsageStats,account 面收口)
GET /account/entitlements(套餐/配额/发布能力)+ /account/usage(Token 用量/归属分布)
此前无专门 e2e(live-read 仅断言 nickname、未覆盖 UsageStats);curl 证两端 code:0 就绪。
补 account-usage.spec.ts(验 200/code:0 + 「权益与配额」/「归属分布」区块渲染)。
全量 e2e 41/0。至此个人中心 account 面真后端 e2e 全闭环(profile 读写 + 权益配额 +
用量归属 + 购买/授权/发布三件套 + 安全事件 ack)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-21 13:31:00 -07:00 |
|
lili
|
fd52b4660a
|
docs(进度总账): profile 写路 e2e + jsonb update 500 修复 + agent 污染清理(全量 39/0)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-21 13:20:38 -07:00 |
|
lili
|
3ffee3599a
|
test(e2e): global-setup 清理 agent-create 累积污染(修 live-read ai 稳定红)
agent-create.spec uniqueName=`活体智能体-e2e-${Date.now()}` 不幂等,每跑新建一个自建 agent,
累积 22 条后按 updatedAt 倒序把种子「活体测试智能体」挤出后端默认分页第一页,致 live-read
「智能体列表渲染真实 Agent」断言 timeout(随历史跑次增多从绿变稳定红)。global-setup 加第 11 节
删 e2e 前缀 agent、保留种子。全量 e2e 39/0。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
2026-06-21 13:19:34 -07:00 |
|