generated from mcpplibs/templates
-
Notifications
You must be signed in to change notification settings - Fork 0
Simplify the interface and hide internal implementations that do not need to be exported #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
06acecc
docs: Update current plan directory path in copilot instructions
FrozenLemonTee ec9b072
docs: Add implementation plan for primitives module with milestones a…
FrozenLemonTee ab28749
docs: Update policy category references in traits implementation
FrozenLemonTee c9f99aa
refactor: Simplify traits implementation by introducing primitive_tra…
FrozenLemonTee 35f5211
refactor: Introduce concepts for primitive types in traits implementa…
FrozenLemonTee fb4c004
refactor: Add tests for meta traits and primitive concepts in primiti…
FrozenLemonTee 2d762fc
refactor: Replace primitive_instance concept with primitive_type in d…
FrozenLemonTee 439f074
refactor: Remove redundant namespace qualifiers for primitive types i…
FrozenLemonTee 17d3984
refactor: Replace primitive_instance concept with meta::primitive_typ…
FrozenLemonTee 570e309
refactor: Move underlying_operand concept into operations namespace
FrozenLemonTee facfac2
refactor: Improve apply_runtime_fence function parameter types and co…
FrozenLemonTee c675829
refactor: Make details not exported
FrozenLemonTee f648925
refactor: Move atomic reference utilities into details namespace
FrozenLemonTee 33d9eb9
refactor: Remove unused type aliases in operators module
FrozenLemonTee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # Primitives 下一步实现计划清单(2026-03-23) | ||
|
|
||
| ## 总体原则 | ||
|
|
||
| - [ ] 先定义稳定 API 边界,再落地实现 | ||
| - [ ] 每个能力都配套 tests + examples + docs | ||
| - [ ] 高风险转换默认禁止隐式触发,只允许显式 API | ||
|
|
||
| ## M1. C API 互操作层(双向) | ||
|
|
||
| ### 工作清单 | ||
|
|
||
| - [ ] 定义稳定 C ABI(命名规范、导出宏、版本策略) | ||
| - [ ] 设计双向能力:C 调用 primitives;primitives 适配并调用 C API | ||
| - [ ] 统一错误模型(error code + 可选 message buffer) | ||
| - [ ] 提供最小可用头文件:`include/mcpplibs/primitives/c_api.h` | ||
| - [ ] 增加 C/C++ 混合构建测试(C 编译器 + C++ 链接) | ||
| - [ ] 增加示例:`examples/c/basic.c`、`examples/cpp/use_c_api.cpp` | ||
|
|
||
| ### 验收标准 | ||
|
|
||
| - [ ] 纯 C 工程可链接并完成基础能力调用 | ||
| - [ ] C++ 对外部 C API 的适配调用行为可控、无未定义行为 | ||
|
|
||
| ## M2. Concept/Traits 体系增强与元信息 API | ||
|
|
||
| ### 工作清单 | ||
|
|
||
| - [ ] 扩展 concept 分层(category/representation/policy-capability) | ||
| - [ ] 完善 `traits<T>` 元信息(`kind`、`rep_type`、limits、policy tags) | ||
| - [ ] 提供检测类 API(可转换性/是否有损/错误模型能力) | ||
| - [ ] 统一 `constexpr` 查询入口,减少分散 traits 访问 | ||
| - [ ] 增加编译期测试矩阵(`static_assert` 覆盖) | ||
|
|
||
| ### 验收标准 | ||
|
|
||
| - [ ] 上层模块仅依赖公开 concept/traits,不依赖 `details::*` | ||
| - [ ] 元信息可支撑转换层与算法层的约束判定 | ||
|
|
||
| ## M3. 显式转换层(任意策略组适用) | ||
|
|
||
| ### 工作清单 | ||
|
|
||
| - [ ] 设计统一接口族(建议):`explicit_cast`、`try_cast`、`checked_cast` | ||
| - [ ] 支持任意策略组组合,不绑定特定策略实现 | ||
| - [ ] 风险可见化(截断/溢出/精度损失)并可程序化读取 | ||
| - [ ] 定义失败语义(错误码或 expected 风格,按策略可配置) | ||
| - [ ] 建立转换矩阵测试(同类/跨类/跨策略组) | ||
|
|
||
| ### 验收标准 | ||
|
|
||
| - [ ] 所有跨类高风险转换必须走显式 API | ||
| - [ ] 风险信息可在编译期或运行期被确定性获取 | ||
|
|
||
| ## M4. 算法层(以 max/min 为起点) | ||
|
|
||
| ### 工作清单 | ||
|
|
||
| - [ ] 实现 `max`/`min`,并预留 `clamp`/`compare` 扩展位 | ||
| - [ ] 算法统一依赖 M2+M3 的公开接口,不绕过转换层 | ||
| - [ ] 支持同类与受约束的异类输入 | ||
| - [ ] 在可行范围保持 `constexpr`/`noexcept` 特性 | ||
| - [ ] 增加边界测试(极值、NaN、有符号/无符号混合) | ||
|
|
||
| ### 验收标准 | ||
|
|
||
| - [ ] 算法行为与策略约束一致 | ||
| - [ ] 风险路径始终显式、可审计 | ||
|
|
||
| ## 建议推进顺序 | ||
|
|
||
| 1. M2(先夯实约束与元信息基础) | ||
| 2. M1(建立跨语言边界) | ||
| 3. M3(收敛转换风险) | ||
| 4. M4(复用基础能力实现算法) | ||
|
|
||
| ## 总体完成跟踪 | ||
|
|
||
| - [ ] M1 完成 | ||
| - [ ] M2 完成 | ||
| - [ ] M3 完成 | ||
| - [ ] M4 完成 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ | |
|
|
||
| ## 正在进行中的计划 | ||
|
|
||
| - 当前计划目录:`../.github/prompts/` | ||
| - 当前计划目录:`../.agents/docs/plans/` | ||
|
|
||
| ## 说明 | ||
|
|
||
|
|
||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.