Loading...
Loading...
Compare original and translation side by side
Core Principle: Documentation first, code follows, tests verify, documentation closes. All features must follow the documentation-driven development cycle.
stories/docs/design/docs/CHANGELOG.mdROADMAP.mdsolana-sdk-zigzig-0.15zig-memory核心原则:文档先行,代码随后,测试验证,文档收尾。 所有功能必须遵循文档驱动的开发周期。
stories/docs/design/docs/CHANGELOG.mdROADMAP.mdsolana-sdk-zigzig-0.15zig-memoryDetailed templates and examples:
| Document | Path | Content |
|---|---|---|
| CHANGELOG Template | | Session entry format, version release format |
详细模板与示例:
| 文档 | 路径 | 内容 |
|---|---|---|
| CHANGELOG模板 | | 开发会话记录格式、版本发布格式 |
┌─────────────────────────────────────────────────────────────────┐
│ 1. Documentation Preparation │
│ ├── Update/create design docs (docs/design/) │
│ ├── Update ROADMAP.md (if new feature) │
│ └── Create/Update Story file (stories/) │
├─────────────────────────────────────────────────────────────────┤
│ 2. Coding Phase │
│ ├── Implement feature code │
│ ├── Add code comments with Rust source references │
│ ├── Sync update docs/ (REQUIRED!) │
│ └── Update Story checkboxes as features complete │
├─────────────────────────────────────────────────────────────────┤
│ 3. Testing Phase │
│ ├── Unit tests (zig test src/xxx.zig) │
│ ├── Integration tests (zig build test) │
│ └── All tests MUST pass before proceeding │
├─────────────────────────────────────────────────────────────────┤
│ 4. Documentation Finalization │
│ ├── Update CHANGELOG.md with session entry │
│ ├── Update Story status (⏳ → ✅) if ALL complete │
│ └── Update README.md (if user-visible changes) │
└─────────────────────────────────────────────────────────────────┘┌─────────────────────────────────────────────────────────────────┐
│ 1. 文档准备阶段 │
│ ├── 更新/创建设计文档(docs/design/) │
│ ├── 更新ROADMAP.md(若为新功能) │
│ └── 创建/更新Story文件(stories/) │
├─────────────────────────────────────────────────────────────────┤
│ 2. 编码阶段 │
│ ├── 实现功能代码 │
│ ├── 添加带有Rust源码参考的代码注释 │
│ ├── 同步更新docs/(强制要求!) │
│ └── 随着功能完成更新Story复选框 │
├─────────────────────────────────────────────────────────────────┤
│ 3. 测试阶段 │
│ ├── 单元测试(zig test src/xxx.zig) │
│ ├── 集成测试(zig build test) │
│ └── 所有测试必须通过后才能继续 │
├─────────────────────────────────────────────────────────────────┤
│ 4. 文档收尾阶段 │
│ ├── 在CHANGELOG.md中添加开发会话记录 │
│ ├── 更新Story状态(⏳ → ✅)当所有任务完成时 │
│ └── 更新README.md(若有面向用户的变更) │
└─────────────────────────────────────────────────────────────────┘stories/
├── v0.1.0-core-types.md
├── v0.2.0-serialization.md
├── v0.29.0-program-sdk-completion.md
├── v1.0.0-sdk-restructure.md
├── v2.0.0-spl-token.md
└── v2.2.0-stake-program.mdstories/
├── v0.1.0-core-types.md
├── v0.2.0-serialization.md
├── v0.29.0-program-sdk-completion.md
├── v1.0.0-sdk-restructure.md
├── v2.0.0-spl-token.md
└── v2.2.0-stake-program.mdundefinedundefinedBrief description (one sentence)
简短描述(一句话)
undefinedundefined| Marker | Location | Meaning | When to Use |
|---|---|---|---|
| ROADMAP, stories, docs | Pending/In Progress | Feature started but not complete |
| ROADMAP, stories | Currently Working | Active development this session |
| ROADMAP, stories | Completed | ALL checkboxes are |
| stories, docs | Unchecked task | Task not yet done |
| stories, docs | Completed task | Task finished and verified |
| Code comments | To implement | Future work |
| Code comments | To fix | Known issue |
| Code comments | Attention needed | Needs review |
| 标记 | 位置 | 含义 | 使用场景 |
|---|---|---|---|
| ROADMAP、stories、docs | 待处理/进行中 | 功能已启动但未完成 |
| ROADMAP、stories | 当前开发中 | 本次会话正在开发的功能 |
| ROADMAP、stories | 已完成 | 所有复选框均为 |
| stories、docs | 未完成任务 | 任务尚未开始 |
| stories、docs | 已完成任务 | 任务已完成并验证 |
| 代码注释 | 待实现 | 未来需完成的工作 |
| 代码注释 | 待修复 | 已知问题 |
| 代码注释 | 需要关注 | 需要评审 |
| Timing | Required Action |
|---|---|
| Start new version | Create Story file, list ALL acceptance criteria |
| Complete single feature | Change |
| Complete entire version | ONLY update status to ✅ when ALL |
| Add new feature | Add acceptance criteria to Story |
| Before version release | Ensure all |
| 时机 | 要求操作 |
|---|---|
| 启动新版本 | 创建Story文件,列出所有验收标准 |
| 完成单个功能 | 将该功能的 |
| 完成整个版本 | 仅当所有 |
| 添加新功能 | 在Story中添加验收标准 |
| 版本发布前 | 确保所有 |
undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined| Criterion | Verification |
|---|---|
| Core functionality 100% | All |
| All tests passing | |
| No memory leaks | Testing allocator reports no leaks |
| Documentation synced | CHANGELOG updated, Story status correct |
| Issues documented | Any deferred items noted |
| 标准 | 验证方式 |
|---|---|
| 核心功能100%完成 | Story中所有 |
| 所有测试通过 | |
| 无内存泄漏 | 测试分配器报告无泄漏 |
| 文档已同步 | CHANGELOG已更新,Story状态正确 |
| 问题已记录 | 所有延期项均已标注 |
Phase 1: Refactor Existing Code
├── Move/reorganize file structure
├── Update import paths and dependencies
├── Run tests: zig build test
└── Ensure all existing tests 100% pass
└── Commit: "refactor: reorganize project structure"
Phase 2: Verify Refactoring Complete
├── Compilation passes, no errors
├── All original tests pass
├── Functionality unchanged from before
└── DO NOT proceed until 100% verified
Phase 3: Add New Features (ONLY after Phase 2)
├── Add new modules/files
├── Implement new features
├── Add tests for new features
└── Commit: "feat: add new feature"阶段1:重构现有代码
├── 移动/重组文件结构
├── 更新导入路径与依赖
├── 运行测试: zig build test
└── 确保所有现有测试100%通过
└── 提交: "refactor: reorganize project structure"
阶段2:验证重构完成
├── 编译通过,无错误
├── 所有原有测试通过
├── 功能与重构前一致
└── 未100%验证完成前不得继续
阶段3:添加新功能(仅在阶段2完成后)
├── 添加新模块/文件
├── 实现新功能
├── 为新功能添加测试
└── 提交: "feat: add new feature"| Behavior | Status |
|---|---|
| Mix refactoring + new features in one commit | ❌ PROHIBITED |
| Start new features before refactoring tests pass | ❌ PROHIBITED |
| Skip test verification between phases | ❌ PROHIBITED |
| Combine Phase 1 and Phase 3 in same commit | ❌ PROHIBITED |
| 行为 | 状态 |
|---|---|
| 单次提交中混合重构与新功能 | ❌ 禁止 |
| 重构测试通过前启动新功能 | ❌ 禁止 |
| 跳过阶段间的测试验证 | ❌ 禁止 |
| 阶段1与阶段3合并到同一提交 | ❌ 禁止 |
See:for complete templates.references/changelog-template.md
参考: 完整模板请查看。references/changelog-template.md
undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined| Situation | Action |
|---|---|
| Test fails | Fix immediately, do NOT commit |
| Cannot fix quickly | Revert changes, investigate |
| Need help | Ask before committing broken code |
zig build testgit commit| 场景 | 操作 |
|---|---|
| 测试失败 | 立即修复,禁止提交 |
| 无法快速修复 | 回滚变更,排查问题 |
| 需要协助 | 提交有问题的代码前先咨询他人 |
zig build testgit commit| Error | Cause | Fix |
|---|---|---|
Story says ✅ but has | Premature completion | Uncheck ✅, complete remaining items |
| ROADMAP and Story disagree | Sync issue | Run validation commands, align status |
| Code complete, Story unchanged | Forgot to update | Update Story checkboxes immediately |
| Tests fail after "complete" | Incomplete verification | Never mark complete without test pass |
| 错误 | 原因 | 修复方案 |
|---|---|---|
Story显示✅但仍有 | 过早标记完成 | 取消✅标记,完成剩余项 |
| ROADMAP与Story状态不一致 | 同步问题 | 运行验证命令,统一状态 |
| 代码已完成但Story未更新 | 忘记更新Story | 立即更新Story复选框 |
| 标记“完成”后测试失败 | 验证不完整 | 未通过测试绝不标记完成 |
grep -rn "\[ \]" stories/vX.Y.Z-*.mdzig build testgrep -rn "\[ \]" stories/vX.Y.Z-*.mdzig build test[ ][ ]