-
Notifications
You must be signed in to change notification settings - Fork 5
refactor: feishu and cleaning namespace, with a agents.md #40
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
7 commits
Select commit
Hold shift + click to select a range
1b4cfd8
wip: refactor feishu with history support
creeper5820 2ed158c
refactor: simplify clock and shared type naming
creeper5820 39456e9
docs: add AGENTS.md with agent development guidelines
creeper5820 8a0ac9a
chore: clean shared state and logging tests
creeper5820 d9cd95e
refactor: update feishu heartbeat/latest workflow
creeper5820 19ce0eb
chore: clean a warning and state receive handler
creeper5820 bea8adc
chore: update feishu test, remove a warning in tf test and format yam…
creeper5820 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,84 @@ | ||
| ## Agent 协作开发规范(Auto Aim) | ||
|
|
||
| 本文件用于约束 Agent 在本仓库中的行为,目标是: | ||
|
|
||
| - 保持算法开发由人类主导 | ||
| - 降低无边界代码生成带来的维护风险 | ||
| - 让 Agent 在可控范围内稳定提供辅助价值 | ||
|
|
||
| ## 1. 指令优先级与冲突处理 | ||
|
|
||
| 当多条指令冲突时,按以下优先级执行(高到低): | ||
|
|
||
| 1. System 指令 | ||
| 2. Developer 指令 | ||
| 3. 本文档(AGENTS.md) | ||
| 4. 用户普通实现请求 | ||
|
|
||
| 如发生冲突,必须遵循更高优先级指令,并在回复中简要说明原因。 | ||
|
|
||
| ## 2. 核心原则:算法开发由人类主导 | ||
|
|
||
| Agent 不应主导大规模算法功能实现。面对“完整实现大需求”时,先进行风险判断。 | ||
|
|
||
| ### 2.1 高风险判定(命中任意两条即视为高风险) | ||
|
|
||
| - 缺少充分且可执行的实现计划(Plan) | ||
| - 缺少开发者提供的明确框架/边界/修改目标 | ||
| - 缺少验收标准、测试标准或回归范围 | ||
|
|
||
| ### 2.2 高风险场景下的行为 | ||
|
|
||
| - 不直接生成大规模 Feature 代码 | ||
| - 输出结构化建议:风险点、拆解方案、最小可验证下一步 | ||
| - 将主导权交还开发者,等待进一步明确指令 | ||
|
|
||
| ## 3. 允许与禁止的工作边界 | ||
|
|
||
| ### 3.1 允许(默认可执行) | ||
|
|
||
| - 小范围修复(bug fix) | ||
| - 已有方案下的局部实现 | ||
| - 测试补充、文档整理、日志与可观测性改进 | ||
| - 不改变核心算法路径的重构 | ||
|
|
||
| ### 3.2 禁止(默认不执行) | ||
|
|
||
| - 在缺少明确方案时主导完整算法功能开发 | ||
| - 未经约束地跨模块大改 | ||
| - 以“兜底默认值”掩盖配置或调用错误 | ||
|
|
||
| ## 4. 慎重提取辅助函数 | ||
|
|
||
| 提取公共辅助函数前必须评估: | ||
|
|
||
| - 复用范围是否足够大且稳定 | ||
| - 是否能以内联或局部函数解决 | ||
| - 命名是否会增加全局命名空间噪声 | ||
|
|
||
| 若仅为单点使用或短期逻辑,优先保持局部实现。 | ||
|
|
||
| ## 5. 关于非法条件检查与失败策略 | ||
|
|
||
| 默认策略:尽早失败(fail fast),避免 silent fallback。 | ||
|
|
||
| - 构造/初始化阶段应一次性完成可验证检查 | ||
| - 配置或参数非法时应明确报错,不用默认值掩盖 | ||
| - 对已由类型系统约束的函数参数,不重复做同类防御性检查 | ||
| - 仅在越界、索引失效、外部系统不稳定等场景增加必要检查 | ||
|
|
||
| 目标是在错误发生时暴露真实原因,降低后期调试成本。 | ||
|
|
||
| ## 6. 标准响应模板(高风险请求) | ||
|
|
||
| 当判定为高风险请求时,按以下结构回复: | ||
|
|
||
| 1. 风险判断:说明命中的高风险条件 | ||
| 2. 不直接实现原因:说明可维护性/可验证性风险 | ||
| 3. 推荐最小下一步:给出 1 个可执行且可验证的下一步 | ||
|
|
||
| 示例: | ||
|
|
||
| - 风险判断:当前需求缺少明确实现边界和验收标准 | ||
| - 不直接实现原因:直接大范围生成会提高回归风险,难以定位问题 | ||
| - 推荐最小下一步:先确定模块边界与接口草案,我基于该草案实现第一阶段并附带测试 |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle_tf_not_ready中control_state = ControlState::kInvalid()实际上是死赋值。该分支在 Line 50 直接
return,并不会走到publish_control_state();下一帧 tf 就绪后,update_control_state()会把timestamp/yaw/pitch/odom_to_camera_transform/invincible_devices等字段全部覆盖。也就是说这次kInvalid()赋值不会被发送出去,也不会被下一次发送看到。如果意图是"tf 未就绪期间也要让对端收到 invalid 信号",应改为在此分支
feishu.with_write(...)一次;如果意图只是把内部状态清空,那么这一行可以直接删掉。🤖 Prompt for AI Agents