Skip to content

docs|refactor: 规范 AGENTS.md 与 CLAUDE.md,引入 MicroCompactConfig 聚合结构#460

Merged
phantom5099 merged 5 commits into1024XEngineer:mainfrom
Yumiue:main
Apr 25, 2026
Merged

docs|refactor: 规范 AGENTS.md 与 CLAUDE.md,引入 MicroCompactConfig 聚合结构#460
phantom5099 merged 5 commits into1024XEngineer:mainfrom
Yumiue:main

Conversation

@Yumiue
Copy link
Copy Markdown
Collaborator

@Yumiue Yumiue commented Apr 25, 2026

变更摘要

本次 PR 包含两部分核心改动:

1. 文档规范化(AGENTS.md / CLAUDE.md)

解决原有文档中"模块职责描述过细、实现细节与持久规则混为一谈"的问题,避免未来架构调整时过时文档误导模型决策。

  • AGENTS.md:聚焦持久规则层,移除逐模块功能清单(如 context 负责 Task State/Todo State/Skills/Memo 等),替换为"模块边界原则"(每个模块一句话原则)+ 新增"架构原则"章节(分层隔离、能力入口收敛、状态集中等)。
  • CLAUDE.md:从 121 行大幅瘦身至 53 行,移除 budget/compact 协议、事件协议字段、详细测试清单等实现细节,改为模块索引表格 + 关键设计参考表格(指引到 docs/ 对应文档)。
  • 新增兜底原则:当文档描述与代码实现冲突时,以代码实现为准。

2. Context Builder 重构(MicroCompactConfig)

  • 引入 MicroCompactConfig 聚合结构,收敛 Builder 构造函数链,减少参数爆炸。
  • 移除未使用的 default builder helper。
  • 补充 builder_test.go 测试覆盖,覆盖正常路径与边界条件。

检查项

  • 主链路 TUI -> Gateway -> Runtime -> Tools -> UI 完整
  • 无跨层接线,厂商差异未泄漏到上层
  • 测试覆盖新增/修改逻辑
  • git status 干净,无密钥或无关文件混入

Yumiue and others added 5 commits April 24, 2026 21:01
- 新增 MicroCompactConfig 结构体,将 MicroCompactPolicySource、
  MicroCompactSummarizerSource、MicroCompactPinChecker 三个接口
  打包为单一配置对象,简化 Builder 构造参数
- 新增 NewConfiguredBuilder 作为统一构造入口,支持可变 SectionSource
- newPromptSources 改为接受 ...SectionSource 可变参数,nil 自动跳过
- 旧构造函数保留并标记 Deprecated,委托到新入口
- 更新 bootstrap.go 和 runtime.go 使用新构造 API
- 补充 TestNewConfiguredBuilder 覆盖 5 个子场景

关联: 1024XEngineer#416
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: Yumiue <188874804+Yumiue@users.noreply.github.com>
…egation

refactor(context): simplify micro compact builder wiring
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 25, 2026

Codecov Report

❌ Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/context/builder.go 96.55% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@fennoai fennoai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed in four passes (code quality, performance, security, documentation accuracy) on changed files and nearby context.

No noteworthy issues found.

@@ -119,11 +126,17 @@ func applyReadTimeContextProjection(
summarizers MicroCompactSummarizerSource,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this change path in detail (including projection cloning and micro-compact flow). No actionable issues found.

@phantom5099 phantom5099 merged commit 424f6b8 into 1024XEngineer:main Apr 25, 2026
3 checks passed
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.

3 participants