Skip to content

Add versioned prompt profiles and event-entity generation pipeline - #192

Open
Leon-Algo wants to merge 4 commits into
InternScience:mainfrom
Leon-Algo:pms/main
Open

Leon-Algo wants to merge 4 commits into
InternScience:mainfrom
Leon-Algo:pms/main

Conversation

@Leon-Algo

@Leon-Algo Leon-Algo commented Oct 10, 2026 •

Copy link
Copy Markdown

Summary

  • Add versioned prompt profiles to all 10 generators while preserving upstream templates as defaults.
  • Add deterministic output gates and bounded generator concurrency as optional GenerateService parameters.
  • Add SAG-inspired event-entity extraction, deterministic star-graph merge, and same-project event-join partitioning.
  • Add support citation parsing and partition-node closure validation; invalid citations are stripped without dropping the QA.
  • Restore bounded empty-response retry, extraction prefill retry, and optional thinking disablement for logprob calls.

Validation

  • PMS contract suite: 38 passed.
  • Real 10-record event smoke: 7 partitions and 7 anchor-compliant QAs; support references closed against partition nodes; no internal event IDs leaked into question or answer.
  • 50-record A/B: event arm 30/30 single-project partitions and 30/30 anchor-compliant QAs; 28 support-bearing QAs all passed closure validation. Baseline arm generated 168 QAs, 159 anchor-compliant; this change trades volume for project-pure, auditable multi-event questions.
  • Fork test results matched pristine upstream baseline (23 failed, 6 passed; failures were pre-existing upstream/environment issues).

Notes

  • Default behavior remains the upstream LightRAG + ECE path; event generation is opt-in via kg_method: event_entity and partition.method: event_join.
  • Existing concurrent edits in the fork checkout were not included.

🤖 Generated with Claude Code

Leon-L20 and others added 3 commits September 18, 2026 08:40
- 新增版本化 prompt profile 加载器(结构 fail-closed 校验),10 个 generate method 全部支持 config 级模板覆盖
- pms_policy.v2 内置 profile:迁移 PMS 侧 v2 出题策略模板为正本
- 输出门注册表(pms_project_anchor)与 LLM 并发封顶成为 GenerateService 一等参数
- 复位历史上随 checkout 重建丢失的三个补丁:空响应重试、空抽取 prefill、logprob 调用关思考(env 开关语义不变)
- 台账见 docs/PMS_PATCHES.md
- 事件抽取:SAG extract_document v3.1 提示词改编 + 严格响应合同 + 数字接地校验(MIT 归因)
- 星型编码进图:事件=EVENT 节点+成员边(边属性含角色),merge/SEP 血缘复用官方 LightRAG
- build_kg kg_method 分发:event_entity 与 light_rag 并存,默认行为逐字节不变
- event_join 分区器:共享实体 join + 同锚硬约束,产出官方 Community,metadata 带 event_ids
- <support> 审计链:生成端引用分区节点集合校验,失败剥离保留题面;pms_policy.v3 profile
- 台账 docs/PMS_PATCHES.md InternScience#7;fork 测试基线与上游一致(23F/6P,零回归)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- event_contract 抽为纯 stdlib 模块(rft 契约测试可按路径加载)
- builder 补回 json 导入;EVENT 节点/成员边/参与者实体确定性 SEP 合并,不再触发
  LightRAG LLM 摘要(摘要器曾把 event id 扩写成伪业务事实污染出题上下文)
- EventJoinPartitioner 继承 BasePartitioner(community2batch);models lazy export 补齐
- v3 profile support 大括号转义(str.format KeyError);分区服务移除 metadata 依赖
  (support 校验以持久化分区节点集合为准,JSONL 往返一致)
- 真实 10 记录端到端 smoke 全通:7 分区→7 题全锚点合规、cited 全部通过分区校验

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation core labels Oct 10, 2026
引入版本化事件抽取profile,将实体类型、prompt、锚点和数字接地策略从PMS专用代码解耦。event_join基于显式锚点属性隔离,生成prompt隐藏内部事件ID并把support引用映射回canonical节点。\n\n新增多项目SDK与不可变tag发布文档,修正安装包资源声明和过时的partition integration测试;保留LightRAG+ECE默认路径及PMS事件ID兼容。完成真实非PMS抽取、分区和问答生成smoke,默认生成结果未泄漏内部事件ID。\n\nCo-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the tests label Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant