docs(context): 新增 Context Layer 上下文治理层架构方案; - #1099
Merged
ThreeFish-AI merged 1 commit intoAug 4, 2026
Merged
Conversation
对标 Snowflake Horizon Context(Collect/Enrich/Activate 三相 + Structural/Operational/Semantic/Behavioral 四信号层 + 引擎级治理不可绕过)设计 negentropy 统一上下文治理层:横向治理织物横亘 Memory/KB/KG/Tools/Skills 之上,不替代既有子系统。 核心内容: - Context Catalog 逻辑视图(PostgreSQL VIEW 非新表,SSOT 防 Split-Brain)+ 信任信号归一化公式 - 统一激活:扩展 HybridPlanner 接入 Memory 源 + ContextAssembler 接地 KB chunk + ContextGuard 兜底治理(含回退路径) - 五子系统上下文契约(Memory/KB/KG/Tools/Skills)+ context_strategy 进化杠杆(第 7 个 TargetHandler) - 三阶段演进路线(Phase1 目录+信任归一+Memory入Planner / Phase2 Router+Guard / Phase3 Universal Search+溯源) - 3 条 ADR + 风险对策 + 与 framework/self-evolving/skills 自洽性核对 同步登记 knowledge-map「系统概念与设计」段与 research/readme「认知与上下文」段。 🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
_dynamic_instruction→model_resolver→skills_injector),存在三大结构性缺口——① 存储层检索未统一(HybridPlanner覆盖 KB+KG 但不含 Memory);② 双通道割裂(ContextAssembler注入记忆+KG 摘要但不接地 KB chunks);③ 信任信号未归一且代码回退可绕过治理。framework.md/self-evolving-agents.md/skills.md。核心变更
docs/concepts/design/context-layer.md(504 行,3 张 Mermaid 图,IEEE 引用),作为「上下文层」单一权威参考。HybridPlanner接入 Memory 源 +ContextAssembler接地 KB chunk + 新增ContextGuard引擎级治理兜底(含回退路径,对标 Horizon「不可绕过」)。context_strategy(沿用既有 6 个TargetHandler状态机)+ 三阶段演进路线(全程 additive + 特性开关 + fail-soft)。knowledge-map.md(系统概念与设计段)+research/readme.md(认知与上下文段)。风险与回滚
git revert单个 commit 即可。验证证据
build_docs_pack(纯函数)秒级确认文档入 nav(entry_slug: concepts/design/context-layer,位次 10/10);全部相对链接可跳转(含代码锚点);Mermaid 结构平衡(11 subgraph / 11 end,配色对齐self-evolving-agents.md)。影响范围
context-layer.md+ 2 处索引登记。Next Best Action
HybridPlanner接入 Memory,默认关)风险最低,可作为首个实现 PR。🤖 Generated with Claude Code, CodeX, Gemini