测试准入沿用 贡献指南:验证可观察行为、非平凡边界或已经修复的缺陷。优先扩展已有行为测试,让一次验证覆盖完整的数据流。
| 改动 | 现有入口 |
|---|---|
| Run、Session 连续性、目录、协作、提交 | host Agent contract tests |
| Session 分组、计数与压缩 | session_context.rs 与 Session contract tests |
| Session 历史放置与深度注入 | PromptManager 浏览器测试 |
| 宏输入捕获与请求参数 | SDK 捕获、提示词组装 |
| 文件与持久版本 | FileAgentRepository tests、文件语义闭环 |
| 模型协议与续接 | gateway tests |
| Host API | agent-api-contract.test.mjs |
| Profile、历史与 Timeline 界面 | agent-system tests |
| 应用助手历史追赶、受理边界与交互缺陷 | in-app-agent tests 与 app-use tests;主题、几何与普通表单用原生 WebView 验收 |
| Skill 文件、宏与脚本 | host 执行闭环、Skill 仓储 |
| 旧数据迁移 | Profile 导入、Run 修订 |
| Shell / JS 文件与提交 | host 集成 |
| 执行与取消边界 | JS tests、收尾 tests |
涉及文件时使用临时目录和真实仓储;涉及并发时用 channel、barrier 或受控 future 协调,断言竞争操作的结果和最终内容。不要通过取得私有锁或一次 poll 返回 Pending 来证明并发正确。
先运行受影响部分,例如:
cargo test --manifest-path src-tauri/Cargo.toml -p tauritavern contract_tests::agent_runtime
cargo test --manifest-path src-tauri/Cargo.toml -p tt-adapter-workspace-shell
node --test tests/agent-api-contract.test.mjs
pnpm run test:browser完成改动后运行仓库检查:
node scripts/check-rust-crate-boundaries.mjs
pnpm run check手动验证可从默认 Profile 开始:运行一次写作,查看文件与提交,再选择此次改动涉及的委派、交接、取消或历史场景。测试范围随实际行为变化确定。