@educa-corp/sdd-framework 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/build.js +113 -19
- package/bin/gate-trace.js +487 -0
- package/bin/index.js +445 -146
- package/bin/lint-trace.js +643 -0
- package/bin/self-check.js +804 -2
- package/bin/trace-schema.json +621 -10
- package/core/FRAMEWORK_VERSION +1 -1
- package/core/README.md +20 -0
- package/core/commands/amend-prd.md +518 -0
- package/core/commands/debug.md +123 -511
- package/core/commands/define-product.md +86 -510
- package/core/commands/dev-gen-test.md +86 -510
- package/core/commands/dev-run-test.md +133 -519
- package/core/commands/dev-smoke-test.md +86 -510
- package/core/commands/extend-prd.md +128 -522
- package/core/commands/fix-bug.md +118 -509
- package/core/commands/generate-architecture.md +94 -515
- package/core/commands/generate-bdd.md +128 -513
- package/core/commands/generate-code.md +119 -510
- package/core/commands/generate-design-spec.md +86 -510
- package/core/commands/generate-prd.md +89 -510
- package/core/commands/generate-spec-manifest.md +86 -510
- package/core/commands/generate-tech-docs.md +120 -512
- package/core/commands/learn.md +172 -496
- package/core/commands/map-testids.md +86 -510
- package/core/commands/propose-scenario.md +86 -510
- package/core/commands/qc-analyze.md +86 -510
- package/core/commands/qc-design-test.md +86 -510
- package/core/commands/qc-plan.md +86 -510
- package/core/commands/qc-report.md +86 -510
- package/core/commands/qc-review.md +86 -510
- package/core/commands/qc-run-test.md +115 -513
- package/core/commands/refine-prd.md +112 -522
- package/core/commands/report-bug.md +86 -510
- package/core/commands/review-code.md +123 -511
- package/core/commands/review-context.md +136 -522
- package/core/commands/review-tech-docs.md +90 -511
- package/core/commands/setup-ai-first.md +166 -138
- package/core/commands/sync.md +155 -107
- package/core/commands/update-framework.md +16 -103
- package/core/commands/validate-traces.md +426 -511
- package/core/hooks/data-guard.js +174 -83
- package/core/hooks/settings.json +2 -1
- package/core/rules/workflow.md +64 -4
- package/core/steps/capture-lesson.md +34 -1
- package/core/steps/context-loader.md +50 -8
- package/core/steps/gate.md +92 -35
- package/core/steps/report-footer.md +23 -0
- package/core/templates/README.md +24 -1
- package/core/templates/ci/trace-gate.yml +146 -0
- package/core/templates/feature.template +1 -1
- package/core/templates/hooks/pre-push +61 -0
- package/docs/02-concepts/architecture.md +61 -6
- package/docs/02-concepts/traceability.md +57 -0
- package/docs/03-guides/architect.md +63 -0
- package/docs/04-reference/commands.md +148 -134
- package/docs/04-reference/model-selection.md +32 -19
- package/docs/04-reference/trace-schema.md +39 -0
- package/docs/explain/02b-extend-prd.md +1 -1
- package/docs/explain/02c-amend-prd.md +152 -0
- package/docs/explain/21-validate-traces.md +2 -1
- package/docs/explain/27-learn.md +5 -3
- package/docs/explain/28-sync.md +25 -0
- package/docs/explain/README.md +136 -135
- package/package.json +5 -9
- package/commands/debug.md +0 -917
- package/commands/debug.tmpl +0 -257
- package/commands/define-product.md +0 -862
- package/commands/define-product.tmpl +0 -225
- package/commands/dev-gen-test.md +0 -1124
- package/commands/dev-gen-test.tmpl +0 -490
- package/commands/dev-run-test.md +0 -859
- package/commands/dev-run-test.tmpl +0 -225
- package/commands/dev-smoke-test.md +0 -798
- package/commands/dev-smoke-test.tmpl +0 -217
- package/commands/extend-prd.md +0 -907
- package/commands/extend-prd.tmpl +0 -270
- package/commands/fix-bug.md +0 -910
- package/commands/fix-bug.tmpl +0 -197
- package/commands/generate-architecture.md +0 -775
- package/commands/generate-architecture.tmpl +0 -194
- package/commands/generate-bdd.md +0 -1347
- package/commands/generate-bdd.tmpl +0 -590
- package/commands/generate-code.md +0 -1283
- package/commands/generate-code.tmpl +0 -649
- package/commands/generate-design-spec.md +0 -1161
- package/commands/generate-design-spec.tmpl +0 -524
- package/commands/generate-prd.md +0 -1143
- package/commands/generate-prd.tmpl +0 -223
- package/commands/generate-spec-manifest.md +0 -745
- package/commands/generate-spec-manifest.tmpl +0 -164
- package/commands/generate-tech-docs.md +0 -1344
- package/commands/generate-tech-docs.tmpl +0 -273
- package/commands/learn.md +0 -723
- package/commands/learn.tmpl +0 -63
- package/commands/map-testids.md +0 -662
- package/commands/map-testids.tmpl +0 -81
- package/commands/propose-scenario.md +0 -783
- package/commands/propose-scenario.tmpl +0 -202
- package/commands/qc-analyze.md +0 -693
- package/commands/qc-analyze.tmpl +0 -112
- package/commands/qc-design-test.md +0 -650
- package/commands/qc-design-test.tmpl +0 -69
- package/commands/qc-plan.md +0 -630
- package/commands/qc-plan.tmpl +0 -49
- package/commands/qc-report.md +0 -641
- package/commands/qc-report.tmpl +0 -60
- package/commands/qc-review.md +0 -634
- package/commands/qc-review.tmpl +0 -53
- package/commands/qc-run-test.md +0 -750
- package/commands/qc-run-test.tmpl +0 -116
- package/commands/refine-prd.md +0 -1074
- package/commands/refine-prd.tmpl +0 -278
- package/commands/report-bug.md +0 -729
- package/commands/report-bug.tmpl +0 -148
- package/commands/review-code.md +0 -803
- package/commands/review-code.tmpl +0 -143
- package/commands/review-context.md +0 -1323
- package/commands/review-context.tmpl +0 -527
- package/commands/review-tech-docs.md +0 -982
- package/commands/review-tech-docs.tmpl +0 -401
- package/commands/setup-ai-first.md +0 -574
- package/commands/setup-ai-first.tmpl +0 -378
- package/commands/sync.md +0 -486
- package/commands/sync.tmpl +0 -384
- package/commands/update-framework.md +0 -290
- package/commands/update-framework.tmpl +0 -188
- package/commands/validate-traces.md +0 -1435
- package/commands/validate-traces.tmpl +0 -854
- package/hooks/data-guard.js +0 -141
- package/hooks/settings.json +0 -18
- package/modules/android-compose/module.yaml +0 -13
- package/modules/android-compose/stack-profile.yaml +0 -57
- package/modules/angular/architecture-snippets/component-patterns.md +0 -187
- package/modules/angular/module.yaml +0 -6
- package/modules/angular/stack-profile.yaml +0 -38
- package/modules/context-engineering/architecture-snippets/context-design.md +0 -119
- package/modules/context-engineering/module.yaml +0 -9
- package/modules/context-engineering/stack-profile.yaml +0 -61
- package/modules/dotnet/architecture-snippets/clean-arch.md +0 -160
- package/modules/dotnet/module.yaml +0 -6
- package/modules/dotnet/stack-profile.yaml +0 -50
- package/modules/flutter/module.yaml +0 -14
- package/modules/flutter/stack-profile.yaml +0 -59
- package/modules/golang/architecture-snippets/domain-layout.md +0 -283
- package/modules/golang/module.yaml +0 -6
- package/modules/golang/stack-profile.yaml +0 -40
- package/modules/ios-swiftui/module.yaml +0 -13
- package/modules/ios-swiftui/stack-profile.yaml +0 -55
- package/modules/java-spring/architecture-snippets/layered-arch.md +0 -201
- package/modules/java-spring/module.yaml +0 -15
- package/modules/java-spring/stack-profile.yaml +0 -28
- package/modules/nextjs/architecture-snippets/app-router-patterns.md +0 -269
- package/modules/nextjs/module.yaml +0 -14
- package/modules/nextjs/stack-profile.yaml +0 -74
- package/modules/nuxt/module.yaml +0 -14
- package/modules/nuxt/stack-profile.yaml +0 -58
- package/modules/phaser-game/architecture-snippets/phaser-scene-patterns.md +0 -646
- package/modules/phaser-game/module.yaml +0 -15
- package/modules/phaser-game/stack-profile.yaml +0 -90
- package/modules/php-laravel/architecture-snippets/service-repository.md +0 -302
- package/modules/php-laravel/module.yaml +0 -15
- package/modules/php-laravel/stack-profile.yaml +0 -56
- package/modules/qc-playwright/stack-profile.yaml +0 -66
- package/modules/react/architecture-snippets/hooks-query-patterns.md +0 -254
- package/modules/react/module.yaml +0 -14
- package/modules/react/stack-profile.yaml +0 -63
- package/modules/react-native/module.yaml +0 -14
- package/modules/react-native/stack-profile.yaml +0 -56
- package/modules/vue/module.yaml +0 -14
- package/modules/vue/stack-profile.yaml +0 -65
- package/rules/data-protection.md +0 -80
- package/rules/workflow.md +0 -73
- package/scripts/init.sh +0 -49
- package/scripts/upgrade.sh +0 -94
- package/skills/code/SKILL.md +0 -19
- package/skills/code/SKILL.tmpl +0 -19
- package/skills/debug/SKILL.md +0 -19
- package/skills/debug/SKILL.tmpl +0 -19
- package/skills/design-spec/SKILL.md +0 -11
- package/skills/design-spec/SKILL.tmpl +0 -11
- package/skills/discovery/SKILL.md +0 -14
- package/skills/discovery/SKILL.tmpl +0 -14
- package/skills/prd/SKILL.md +0 -19
- package/skills/prd/SKILL.tmpl +0 -19
- package/skills/qc/qa-analyst/DOC_GAPS.template.md +0 -63
- package/skills/qc/qa-analyst/acceptance-criteria.md +0 -60
- package/skills/qc/qa-analyst/business-rules.md +0 -59
- package/skills/qc/qa-analyst/data-flow.md +0 -64
- package/skills/qc/qa-analyst/spec-breakdown.md +0 -61
- package/skills/qc/qa-designer/e2e/journey.md +0 -41
- package/skills/qc/qa-designer/exploratory/charter.md +0 -68
- package/skills/qc/qa-designer/exploratory/explore-to-functional.md +0 -43
- package/skills/qc/qa-designer/functional/api.md +0 -45
- package/skills/qc/qa-designer/functional/gui-feature.md +0 -46
- package/skills/qc/qa-designer/functional/gui-screen.md +0 -52
- package/skills/qc/qa-designer/integration/api.md +0 -42
- package/skills/qc/qa-designer/integration/db.md +0 -39
- package/skills/qc/qa-designer/integration/gui.md +0 -40
- package/skills/qc/qa-designer/integration/kafka.md +0 -40
- package/skills/qc/qa-designer/non-functional.md +0 -40
- package/skills/qc/qa-planner/test-plan.md +0 -120
- package/skills/qc/qa-reviewer/script/e2e.md +0 -87
- package/skills/qc/qa-reviewer/script/exploratory.md +0 -45
- package/skills/qc/qa-reviewer/script/functional.md +0 -101
- package/skills/qc/qa-reviewer/script/integration.md +0 -91
- package/skills/qc/qa-reviewer/script/non-functional.md +0 -126
- package/skills/qc/qa-reviewer/test-case/e2e.md +0 -73
- package/skills/qc/qa-reviewer/test-case/exploratory.md +0 -43
- package/skills/qc/qa-reviewer/test-case/functional.md +0 -76
- package/skills/qc/qa-reviewer/test-case/integration.md +0 -69
- package/skills/qc/qa-reviewer/test-case/non-functional.md +0 -73
- package/skills/qc/qa-runner/e2e.md +0 -49
- package/skills/qc/qa-runner/exploratory/session.md +0 -36
- package/skills/qc/qa-runner/functional/api.md +0 -35
- package/skills/qc/qa-runner/functional/gui-feature.md +0 -51
- package/skills/qc/qa-runner/functional/gui-screen.md +0 -55
- package/skills/qc/qa-runner/integration.md +0 -47
- package/skills/qc/qa-runner/non-functional.md +0 -49
- package/skills/qc/qa-runner/report/report.md +0 -37
- package/skills/setup-ai-first/SKILL.md +0 -19
- package/skills/setup-ai-first/SKILL.tmpl +0 -19
- package/skills/spec/SKILL.md +0 -19
- package/skills/spec/SKILL.tmpl +0 -19
- package/skills/test/SKILL.md +0 -18
- package/skills/test/SKILL.tmpl +0 -18
- package/steps/business-language.md +0 -56
- package/steps/capture-lesson.md +0 -79
- package/steps/context-loader.md +0 -385
- package/steps/gate.md +0 -94
- package/steps/report-footer.md +0 -102
- package/steps/review-fanout.md +0 -159
- package/steps/spawn-agent.md +0 -129
- package/steps/trace-mirror.md +0 -53
- package/templates/README.md +0 -47
- package/templates/architecture.template.md +0 -394
- package/templates/design-spec.template.md +0 -217
- package/templates/feature.template +0 -123
- package/templates/platform-guide.template.md +0 -145
- package/templates/prd.template.md +0 -283
- package/templates/product-definition.template.md +0 -188
- package/templates/project-context.yaml +0 -212
- package/templates/tech-design.template.md +0 -490
package/commands/fix-bug.tmpl
DELETED
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
# /fix-bug — Workflow Fix Bug đầy đủ
|
|
2
|
-
|
|
3
|
-
## Gate
|
|
4
|
-
{{include:steps/gate.md}}
|
|
5
|
-
|
|
6
|
-
*Lưu ý: Với lệnh này, target ở Bước 1 là một ticket ID (vd `PROJ-123`), một **bug đã file `{BUG-ID}`** (một `{paths.bug_reports_dir}/{BUG-ID}.md` từ `/report-bug` — vd một QC product-gap), hoặc một mô tả bug từ `$ARGUMENTS`. Nếu cho `{BUG-ID}`, phân giải & đọc report đó để lấy spec context; ngược lại tiếp tục sang context loading.*
|
|
7
|
-
|
|
8
|
-
## Context
|
|
9
|
-
{{include:steps/context-loader.md}}
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## Phase 1 — Gather Info
|
|
14
|
-
Nếu cho `{BUG-ID}`: đọc `{paths.bug_reports_dir}/{BUG-ID}.md` để lấy spec context, AC bị vi phạm, expected-vs-actual, và layer gợi ý — dùng làm chi tiết bug (không cần hỏi lại).
|
|
15
|
-
Nếu ticket: fetch chi tiết (hoặc nhờ user dán).
|
|
16
|
-
Nếu không có ticket / BUG-ID — CHECKPOINT:
|
|
17
|
-
1. Bug xảy ra ở đâu? (module, endpoint, flow)
|
|
18
|
-
2. Các bước tái hiện?
|
|
19
|
-
3. Expected vs Actual?
|
|
20
|
-
4. Error log / stack trace?
|
|
21
|
-
|
|
22
|
-
## Phase 2 — Root Cause Analysis
|
|
23
|
-
|
|
24
|
-
Dùng `active_module` từ context để chọn bảng liên quan.
|
|
25
|
-
|
|
26
|
-
### Nếu `platform_type = backend`
|
|
27
|
-
|
|
28
|
-
#### java-spring / golang / dotnet / php-laravel
|
|
29
|
-
|
|
30
|
-
| Bug Type | Vị trí thường gặp | Cách kiểm tra |
|
|
31
|
-
|----------|----------------|--------------|
|
|
32
|
-
| Wrong response data | Mapping layer | Kiểm tra field mapping, DTO conversion |
|
|
33
|
-
| 400 Bad Request | Input validation | Kiểm tra DTO constraint / validator |
|
|
34
|
-
| 401 Unauthorized | Auth filter | Kiểm tra token config, thứ tự filter |
|
|
35
|
-
| 403 Forbidden | Auth config | Kiểm tra rule role-based access |
|
|
36
|
-
| 404 Not Found | Repository query | Kiểm tra find method, kiểu ID |
|
|
37
|
-
| N+1 Query | Data access | Kiểm tra thiếu JOIN FETCH / eager load |
|
|
38
|
-
| Null Pointer | Optional chưa xử lý | Kiểm tra Optional.orElseThrow, null guard |
|
|
39
|
-
| Transaction rollback | Thiếu @Transactional | Kiểm tra transaction scope, propagation |
|
|
40
|
-
| Stale cache | Thiếu eviction | Kiểm tra trigger cache invalidation |
|
|
41
|
-
| Type mismatch | Filter / specification | Kiểm tra kiểu field trong predicate |
|
|
42
|
-
|
|
43
|
-
#### context-engineering (AI/LLM pipelines)
|
|
44
|
-
|
|
45
|
-
| Bug Type | Vị trí thường gặp | Cách kiểm tra |
|
|
46
|
-
|----------|----------------|--------------|
|
|
47
|
-
| Wrong pipeline output | Prompt template | Kiểm tra nội dung prompt; verify biến được substitute đúng |
|
|
48
|
-
| Missing context in output | Context assembly | Verify mọi context block bắt buộc có mặt và không rỗng |
|
|
49
|
-
| Schema validation failure | Output parser | So raw LLM output vs schema kỳ vọng; thêm output instruction chặt hơn |
|
|
50
|
-
| Flaky / non-deterministic results | LLM temperature | Kiểm tra temperature; dùng fixed seed/mock trong test |
|
|
51
|
-
| API rate limit errors | LLM client | Implement backoff; kiểm tra quota trên dashboard provider |
|
|
52
|
-
| Token limit exceeded | Prompt assembly | Giảm kích thước context; thêm chiến lược chunking |
|
|
53
|
-
|
|
54
|
-
### Nếu `platform_type = web-frontend`
|
|
55
|
-
|
|
56
|
-
| Bug Type | Vị trí thường gặp | Cách kiểm tra |
|
|
57
|
-
|----------|----------------|--------------|
|
|
58
|
-
| Wrong data displayed | State / store | Kiểm tra logic update state, selector |
|
|
59
|
-
| UI not re-rendering | Thiếu reactive dep | Kiểm tra deps array, state immutability |
|
|
60
|
-
| API data not loading | HTTP client / hook | Kiểm tra network tab, error handler |
|
|
61
|
-
| 401 on API call | Auth token | Kiểm tra token refresh, header injection |
|
|
62
|
-
| Form not submitting | Validation / handler | Kiểm tra form state, field bắt buộc, error |
|
|
63
|
-
| Route not found | Router config | Kiểm tra route definition, lazy import |
|
|
64
|
-
| Build / type error | TypeScript types | So type definition vs shape API thực tế |
|
|
65
|
-
|
|
66
|
-
### Nếu `platform_type = mobile`
|
|
67
|
-
|
|
68
|
-
| Bug Type | Vị trí thường gặp | Cách kiểm tra |
|
|
69
|
-
|----------|----------------|--------------|
|
|
70
|
-
| Screen shows stale data | State / BLoC / ViewModel | Kiểm tra event dispatch, state emit đúng |
|
|
71
|
-
| Crash on navigation | Thiếu route param | Kiểm tra param truyền, null safety |
|
|
72
|
-
| API call not firing | Repository / service layer | Thêm log trong repo method, kiểm tra network |
|
|
73
|
-
| UI not reflecting state | Widget không observe stream | Kiểm tra setup `BlocBuilder` / `StateObserver` |
|
|
74
|
-
| Crash on app resume | Lifecycle handler | Kiểm tra logic `onResume` / `viewDidAppear` |
|
|
75
|
-
| Auth token expired | Token refresh logic | Kiểm tra refresh flow, token storage |
|
|
76
|
-
| Permission denied | OS permission | Kiểm tra code request runtime permission |
|
|
77
|
-
|
|
78
|
-
CHECKPOINT — Root Cause Report:
|
|
79
|
-
```
|
|
80
|
-
Bug: {description} | Module: {name}
|
|
81
|
-
Root cause: {analysis}
|
|
82
|
-
Affected files: {list}
|
|
83
|
-
Proposed fix: {what to change}
|
|
84
|
-
Regression risk: Low / Medium / High
|
|
85
|
-
Proceed? (Y/N)
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## Phase 3 — Fix
|
|
89
|
-
|
|
90
|
-
*Umbrella mode: code lỗi sống trong **service submodule** phân giải ở context-loader Bước 1.6 — tạo branch và chạy mọi bước git/build từ **trong** `{service_root}`. Single-service: bỏ `cd`.*
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
cd {service_root} # umbrella: the service submodule; single-service: omit
|
|
94
|
-
git checkout -b fix/{TICKET_ID}-{description}
|
|
95
|
-
```
|
|
96
|
-
Áp dụng fix. Thêm trace annotation nếu file có `@trace.implements`:
|
|
97
|
-
```
|
|
98
|
-
@trace.fixes={BUG-ID nếu fix từ một bug report đã file · else TICKET_ID}
|
|
99
|
-
@trace.root_cause={brief description}
|
|
100
|
-
```
|
|
101
|
-
*(Ưu tiên `{BUG-ID}`: khi fix bắt nguồn từ `/report-bug` thì thường **không có** ticket ID nào, và `{BUG-ID}` mới là thứ trace ngược được về spec context + AC bị vi phạm.)*
|
|
102
|
-
|
|
103
|
-
## Phase 4 — Regression Test
|
|
104
|
-
```
|
|
105
|
-
// @trace.verifies={UC-ID}
|
|
106
|
-
// @trace.regression={TICKET_ID}
|
|
107
|
-
Test: "Regression {TICKET_ID}: {bug description}"
|
|
108
|
-
```
|
|
109
|
-
Chạy test. Nếu fail → debug và fix (tối đa 3 vòng).
|
|
110
|
-
|
|
111
|
-
## Phase 4.5 — Cập nhật sổ trace
|
|
112
|
-
|
|
113
|
-
*Bỏ qua nếu fix không chạm SC nào có row trace (vd fix hạ tầng/config).*
|
|
114
|
-
|
|
115
|
-
Đây là lệnh **duy nhất** sinh test mà trước đây không ghi sổ — hệ quả: `test_count` under-report vĩnh viễn (SC đứng `GAP` dù vừa có regression test, rồi `/validate-traces` khuyên `/dev-gen-test` → dev sinh test trùng), và `dev_selftest` giữ `pass` cũ **trên code đã đổi**.
|
|
116
|
-
|
|
117
|
-
Định vị sổ platform `{paths.trace_dir}/{domain}/{prd-slug}/{UC-ID}-{platform}.tsv` — `{platform}` = platform của code vừa fix; không rõ → glob `{UC-ID}-*.tsv` tìm sổ nào chứa `sc_id` đó, khớp nhiều sổ → **hỏi** (cùng luật với `/report-bug` Step 5.5).
|
|
118
|
-
|
|
119
|
-
Với mỗi SC mà regression test phủ (theo `@trace.verifies` của test vừa viết):
|
|
120
|
-
|
|
121
|
-
| Cột | Giá trị |
|
|
122
|
-
|---|---|
|
|
123
|
-
| `test_count` | **+=** số test method regression vừa thêm (cộng dồn, không ghi đè) |
|
|
124
|
-
| `test_classes` | **append** tên test class/describe mới, giữ nguyên tên cũ |
|
|
125
|
-
| `dev_selftest` | `not_run` — code vừa đổi nên tín hiệu self-test cũ hết hiệu lực |
|
|
126
|
-
| `dev_selftest_at` | `—` |
|
|
127
|
-
| `last_updated` | hôm nay `YYYY-MM-DD` |
|
|
128
|
-
|
|
129
|
-
Giữ nguyên mọi cột khác. Đặc biệt:
|
|
130
|
-
- **KHÔNG** đụng `qc_status`/`qc_run_at`/`qc_owner`/`qc_blocked_by` — QC sở hữu; `/qc-run-test` sẽ flip khi re-verify (và chính nó đóng `{BUG-ID}` → `🟢 Closed`).
|
|
131
|
-
- **KHÔNG** đụng `spec_ver`/`gen_ver` — fix bug **không** đổi spec, nên không được tạo tín hiệu DRIFT giả.
|
|
132
|
-
|
|
133
|
-
Rồi làm mới panel mirror:
|
|
134
|
-
{{include:steps/trace-mirror.md}}
|
|
135
|
-
```bash
|
|
136
|
-
{conventions.build_command} # tối đa 3 retry — chạy trong {service_root} ở umbrella mode
|
|
137
|
-
# Tầng 1 — push fix branch trong service submodule (nơi code sống):
|
|
138
|
-
git add {files}
|
|
139
|
-
git commit -m "fix({TICKET_ID}): {description}"
|
|
140
|
-
git push -u origin fix/{TICKET_ID}-{slug} # rồi mở PR vào branch được track của service
|
|
141
|
-
```
|
|
142
|
-
> **Umbrella mode — Tầng 2 (bump umbrella pointer):** umbrella ghi một *commit* của service
|
|
143
|
-
> submodule, không phải branch. Sau khi PR fix-branch **merge** vào branch được track của service, bump
|
|
144
|
-
> pointer để đồng đội pull umbrella không gặp "commit not found":
|
|
145
|
-
> ```bash
|
|
146
|
-
> cd - # back to umbrella root
|
|
147
|
-
> git add {service_root} && git commit -m "chore: bump {service_root} pointer (fix {TICKET_ID})"
|
|
148
|
-
> git push
|
|
149
|
-
> ```
|
|
150
|
-
> Single-service mode: không có umbrella pointer — Tầng 1 là toàn bộ push. Quy tắc đầy đủ: Sync & Update §4.4 (commit 2 tầng).
|
|
151
|
-
|
|
152
|
-
## Phase 5.5 — Đóng bug report (nếu fix một `{BUG-ID}` đã file)
|
|
153
|
-
|
|
154
|
-
*Bỏ qua nếu target là ticket/mô tả thường (không có file `{BUG-ID}`).*
|
|
155
|
-
|
|
156
|
-
Sau khi fix được commit, cập nhật `{paths.bug_reports_dir}/{BUG-ID}.md`:
|
|
157
|
-
- Set `State` → `🟡 Fixed` và thêm một **Resolution** ngắn (root cause + link commit/PR).
|
|
158
|
-
- Nó **chưa** `Closed` — QC sở hữu verification: khi `/qc-run-test` chạy lại và `qc_status`
|
|
159
|
-
của SC liên kết flip thành `pass`, nó thành `🟢 Closed` (và `qc_owner`/`qc_blocked_by` clear).
|
|
160
|
-
- Commit report đã cập nhật vào spec repo (cùng push 2 tầng như `/report-bug`) để view
|
|
161
|
-
"waiting-on" của PO/PM phản ánh nó trên `/sync`.
|
|
162
|
-
|
|
163
|
-
Đây là lần ghi duy nhất `/fix-bug` làm tới khu feedback — nó vẫn chỉ fix **code**,
|
|
164
|
-
không bao giờ sửa PRD/BDD (thay đổi spec là việc PO/Dev theo BUG_FLOW Case 2–4).
|
|
165
|
-
|
|
166
|
-
## Phase 6 — Đề xuất ghi Lesson (tuỳ chọn)
|
|
167
|
-
|
|
168
|
-
Nếu root cause là một **lỗi AI gây ra khi sinh và có thể lặp lại**
|
|
169
|
-
(vd nó sinh code skip layer, thiếu null guard, dùng sai pattern —
|
|
170
|
-
KHÔNG phải nguyên nhân bên ngoài như outage third-party hay input data sai), hỏi:
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
Root cause này trông như một lỗi AI lặp lại.
|
|
174
|
-
Ghi nó thành project lesson để không bị sinh lại? (Y/N)
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
Nếu `Y` → chạy quy trình capture bên dưới với `source=/fix-bug {TICKET_ID}`, một
|
|
178
|
-
`category` phù hợp (thường `code-gen`), và `scope` = domain hoặc file glob bị ảnh hưởng.
|
|
179
|
-
|
|
180
|
-
{{include:steps/capture-lesson.md}}
|
|
181
|
-
|
|
182
|
-
## Output
|
|
183
|
-
|
|
184
|
-
{{include:steps/report-footer.md}}
|
|
185
|
-
|
|
186
|
-
```
|
|
187
|
-
/fix-bug Hoàn tất — {TICKET_ID}
|
|
188
|
-
Root Cause: {analysis}
|
|
189
|
-
Changes: {list}
|
|
190
|
-
✅ Regression test added | ✅ Build: SUCCESS
|
|
191
|
-
{Trace: {UC-ID}-{platform}.tsv updated — test_count +{n}, dev_selftest → not_run | nếu có chạm row trace}
|
|
192
|
-
{🐞 BUG-{id} → State: Fixed (pushed) — Closed sau khi /qc-run-test re-verify pass | nếu fix một bug đã file}
|
|
193
|
-
{📝 Lesson L-NNN recorded (nếu đã capture)}
|
|
194
|
-
Branch: fix/{TICKET_ID}-{slug}
|
|
195
|
-
Next: /dev-run-test {UC-ID} ← dev_selftest vừa bị reset về not_run, chạy để lấy lại tín hiệu xanh
|
|
196
|
-
Rồi tạo PR và link tới ticket. {QC: chạy lại /qc-run-test {UC-ID} để verify + đóng bug | nếu áp dụng}
|
|
197
|
-
```
|