takt 0.32.0 → 0.32.2
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/builtins/en/facets/instructions/e2e-coverage-implement.md +26 -0
- package/builtins/en/facets/instructions/e2e-coverage-plan.md +38 -0
- package/builtins/en/facets/instructions/e2e-coverage-supervise.md +21 -0
- package/builtins/en/facets/instructions/fix.md +4 -0
- package/builtins/en/facets/instructions/loop-monitor-ai-fix.md +4 -3
- package/builtins/en/facets/instructions/loop-monitor-reviewers-fix.md +4 -2
- package/builtins/en/facets/instructions/plan.md +2 -0
- package/builtins/en/facets/instructions/review-frontend.md +9 -0
- package/builtins/en/facets/instructions/security-audit-plan.md +12 -0
- package/builtins/en/facets/instructions/security-audit-review.md +22 -0
- package/builtins/en/facets/instructions/security-audit-supervise.md +20 -0
- package/builtins/en/facets/instructions/security-audit-team-leader.md +27 -0
- package/builtins/en/facets/knowledge/e2e-testing.md +89 -0
- package/builtins/en/facets/knowledge/frontend.md +46 -0
- package/builtins/en/facets/knowledge/react.md +90 -0
- package/builtins/en/facets/knowledge/unit-testing.md +108 -0
- package/builtins/en/facets/output-contracts/e2e-coverage-plan.md +33 -0
- package/builtins/en/facets/output-contracts/plan-frontend.md +41 -0
- package/builtins/en/facets/output-contracts/plan.md +8 -0
- package/builtins/en/facets/output-contracts/security-audit.md +31 -0
- package/builtins/en/facets/personas/coder.md +1 -0
- package/builtins/en/facets/personas/frontend-reviewer.md +4 -0
- package/builtins/en/facets/policies/ai-antipattern.md +43 -0
- package/builtins/en/facets/policies/coding.md +90 -1
- package/builtins/en/facets/policies/design-fidelity.md +51 -0
- package/builtins/en/facets/policies/design-planning.md +52 -0
- package/builtins/en/facets/policies/qa.md +15 -0
- package/builtins/en/facets/policies/testing.md +54 -1
- package/builtins/en/piece-categories.yaml +3 -2
- package/builtins/en/pieces/backend-cqrs.yaml +5 -0
- package/builtins/en/pieces/backend.yaml +5 -0
- package/builtins/en/pieces/default.yaml +2 -0
- package/builtins/en/pieces/dual-cqrs-mini.yaml +8 -1
- package/builtins/en/pieces/dual-cqrs.yaml +10 -2
- package/builtins/en/pieces/dual-mini.yaml +8 -1
- package/builtins/en/pieces/dual.yaml +14 -2
- package/builtins/en/pieces/{e2e-test.yaml → fill-e2e.yaml} +41 -61
- package/builtins/en/pieces/{unit-test.yaml → fill-unit.yaml} +12 -2
- package/builtins/en/pieces/frontend-mini.yaml +8 -1
- package/builtins/en/pieces/frontend.yaml +25 -3
- package/builtins/en/pieces/review-default.yaml +3 -0
- package/builtins/en/pieces/review-dual-cqrs.yaml +3 -1
- package/builtins/en/pieces/review-dual.yaml +3 -1
- package/builtins/en/pieces/review-fix-default.yaml +3 -0
- package/builtins/en/pieces/review-fix-dual-cqrs.yaml +5 -1
- package/builtins/en/pieces/review-fix-dual.yaml +5 -1
- package/builtins/en/pieces/review-fix-frontend.yaml +5 -1
- package/builtins/en/pieces/review-fix-takt-default.yaml +5 -2
- package/builtins/en/pieces/review-frontend.yaml +3 -1
- package/builtins/en/pieces/review-takt-default.yaml +3 -0
- package/builtins/en/pieces/security-audit.yaml +68 -0
- package/builtins/en/pieces/takt-default.yaml +7 -2
- package/builtins/en/pieces/terraform.yaml +0 -5
- package/builtins/ja/INSTRUCTION_STYLE_GUIDE.md +9 -10
- package/builtins/ja/KNOWLEDGE_STYLE_GUIDE.md +4 -4
- package/builtins/ja/OUTPUT_CONTRACT_STYLE_GUIDE.md +4 -4
- package/builtins/ja/PERSONA_STYLE_GUIDE.md +8 -8
- package/builtins/ja/POLICY_STYLE_GUIDE.md +5 -5
- package/builtins/ja/STYLE_GUIDE.md +8 -26
- package/builtins/ja/facets/instructions/e2e-coverage-implement.md +26 -0
- package/builtins/ja/facets/instructions/e2e-coverage-plan.md +38 -0
- package/builtins/ja/facets/instructions/e2e-coverage-supervise.md +21 -0
- package/builtins/ja/facets/instructions/fix.md +4 -0
- package/builtins/ja/facets/instructions/loop-monitor-ai-fix.md +4 -3
- package/builtins/ja/facets/instructions/loop-monitor-reviewers-fix.md +4 -2
- package/builtins/ja/facets/instructions/plan.md +2 -0
- package/builtins/ja/facets/instructions/review-frontend.md +9 -0
- package/builtins/ja/facets/instructions/security-audit-plan.md +12 -0
- package/builtins/ja/facets/instructions/security-audit-review.md +22 -0
- package/builtins/ja/facets/instructions/security-audit-supervise.md +20 -0
- package/builtins/ja/facets/instructions/security-audit-team-leader.md +27 -0
- package/builtins/ja/facets/knowledge/e2e-testing.md +89 -0
- package/builtins/ja/facets/knowledge/frontend.md +46 -0
- package/builtins/ja/facets/knowledge/react.md +90 -0
- package/builtins/ja/facets/knowledge/unit-testing.md +108 -0
- package/builtins/ja/facets/output-contracts/e2e-coverage-plan.md +33 -0
- package/builtins/ja/facets/output-contracts/plan-frontend.md +41 -0
- package/builtins/ja/facets/output-contracts/plan.md +8 -0
- package/builtins/ja/facets/output-contracts/security-audit.md +31 -0
- package/builtins/ja/facets/personas/coder.md +1 -0
- package/builtins/ja/facets/personas/frontend-reviewer.md +2 -0
- package/builtins/ja/facets/policies/ai-antipattern.md +43 -0
- package/builtins/ja/facets/policies/coding.md +90 -1
- package/builtins/ja/facets/policies/design-fidelity.md +51 -0
- package/builtins/ja/facets/policies/design-planning.md +52 -0
- package/builtins/ja/facets/policies/qa.md +15 -0
- package/builtins/ja/facets/policies/testing.md +54 -1
- package/builtins/ja/piece-categories.yaml +3 -2
- package/builtins/ja/pieces/backend-cqrs.yaml +5 -0
- package/builtins/ja/pieces/backend.yaml +5 -0
- package/builtins/ja/pieces/default.yaml +2 -0
- package/builtins/ja/pieces/dual-cqrs-mini.yaml +8 -1
- package/builtins/ja/pieces/dual-cqrs.yaml +10 -2
- package/builtins/ja/pieces/dual-mini.yaml +8 -1
- package/builtins/ja/pieces/dual.yaml +14 -2
- package/builtins/ja/pieces/{e2e-test.yaml → fill-e2e.yaml} +40 -60
- package/builtins/ja/pieces/{unit-test.yaml → fill-unit.yaml} +12 -2
- package/builtins/ja/pieces/frontend-mini.yaml +8 -1
- package/builtins/ja/pieces/frontend.yaml +25 -3
- package/builtins/ja/pieces/review-default.yaml +3 -0
- package/builtins/ja/pieces/review-dual-cqrs.yaml +3 -1
- package/builtins/ja/pieces/review-dual.yaml +3 -1
- package/builtins/ja/pieces/review-fix-default.yaml +3 -0
- package/builtins/ja/pieces/review-fix-dual-cqrs.yaml +5 -1
- package/builtins/ja/pieces/review-fix-dual.yaml +5 -1
- package/builtins/ja/pieces/review-fix-frontend.yaml +5 -1
- package/builtins/ja/pieces/review-fix-takt-default.yaml +5 -2
- package/builtins/ja/pieces/review-frontend.yaml +3 -1
- package/builtins/ja/pieces/review-takt-default.yaml +3 -0
- package/builtins/ja/pieces/security-audit.yaml +68 -0
- package/builtins/ja/pieces/takt-default.yaml +7 -2
- package/builtins/ja/pieces/terraform.yaml +0 -5
- package/dist/app/cli/routing.js +1 -1
- package/dist/app/cli/routing.js.map +1 -1
- package/dist/core/models/config-types.d.ts +4 -0
- package/dist/core/models/config-types.d.ts.map +1 -1
- package/dist/core/models/schemas.d.ts +4 -0
- package/dist/core/models/schemas.d.ts.map +1 -1
- package/dist/core/models/schemas.js +4 -0
- package/dist/core/models/schemas.js.map +1 -1
- package/dist/core/piece/engine/MovementExecutor.d.ts +1 -0
- package/dist/core/piece/engine/MovementExecutor.d.ts.map +1 -1
- package/dist/core/piece/engine/MovementExecutor.js +8 -4
- package/dist/core/piece/engine/MovementExecutor.js.map +1 -1
- package/dist/core/piece/engine/OptionsBuilder.d.ts.map +1 -1
- package/dist/core/piece/engine/OptionsBuilder.js +4 -1
- package/dist/core/piece/engine/OptionsBuilder.js.map +1 -1
- package/dist/features/config/deploySkillInternal.d.ts.map +1 -1
- package/dist/features/config/deploySkillInternal.js +2 -6
- package/dist/features/config/deploySkillInternal.js.map +1 -1
- package/dist/features/interactive/conversationLoop.d.ts.map +1 -1
- package/dist/features/interactive/conversationLoop.js +4 -15
- package/dist/features/interactive/conversationLoop.js.map +1 -1
- package/dist/features/pipeline/steps.d.ts.map +1 -1
- package/dist/features/pipeline/steps.js +5 -1
- package/dist/features/pipeline/steps.js.map +1 -1
- package/dist/features/tasks/execute/resolveTask.d.ts.map +1 -1
- package/dist/features/tasks/execute/resolveTask.js +11 -3
- package/dist/features/tasks/execute/resolveTask.js.map +1 -1
- package/dist/infra/config/global/globalConfigCore.d.ts.map +1 -1
- package/dist/infra/config/global/globalConfigCore.js +11 -8
- package/dist/infra/config/global/globalConfigCore.js.map +1 -1
- package/dist/infra/config/global/globalConfigSerializer.d.ts.map +1 -1
- package/dist/infra/config/global/globalConfigSerializer.js +6 -0
- package/dist/infra/config/global/globalConfigSerializer.js.map +1 -1
- package/dist/infra/config/pathExpansion.d.ts +3 -0
- package/dist/infra/config/pathExpansion.d.ts.map +1 -0
- package/dist/infra/config/pathExpansion.js +15 -0
- package/dist/infra/config/pathExpansion.js.map +1 -0
- package/dist/infra/config/project/projectConfig.d.ts.map +1 -1
- package/dist/infra/config/project/projectConfig.js +15 -2
- package/dist/infra/config/project/projectConfig.js.map +1 -1
- package/dist/infra/config/resolveConfigValue.d.ts.map +1 -1
- package/dist/infra/config/resolveConfigValue.js +4 -1
- package/dist/infra/config/resolveConfigValue.js.map +1 -1
- package/dist/infra/cursor/client.js +1 -1
- package/dist/infra/cursor/client.js.map +1 -1
- package/dist/infra/github/pr.d.ts.map +1 -1
- package/dist/infra/github/pr.js +36 -8
- package/dist/infra/github/pr.js.map +1 -1
- package/dist/infra/resources/index.d.ts +5 -6
- package/dist/infra/resources/index.d.ts.map +1 -1
- package/dist/infra/resources/index.js +5 -6
- package/dist/infra/resources/index.js.map +1 -1
- package/dist/infra/task/autoCommit.d.ts.map +1 -1
- package/dist/infra/task/autoCommit.js +5 -1
- package/dist/infra/task/autoCommit.js.map +1 -1
- package/dist/infra/task/clone.d.ts +2 -1
- package/dist/infra/task/clone.d.ts.map +1 -1
- package/dist/infra/task/clone.js +5 -2
- package/dist/infra/task/clone.js.map +1 -1
- package/dist/infra/task/git.d.ts +5 -1
- package/dist/infra/task/git.d.ts.map +1 -1
- package/dist/infra/task/git.js +51 -3
- package/dist/infra/task/git.js.map +1 -1
- package/dist/infra/task/index.d.ts +1 -1
- package/dist/infra/task/index.d.ts.map +1 -1
- package/dist/infra/task/index.js +1 -1
- package/dist/infra/task/index.js.map +1 -1
- package/dist/shared/utils/index.d.ts +1 -0
- package/dist/shared/utils/index.d.ts.map +1 -1
- package/dist/shared/utils/index.js +1 -0
- package/dist/shared/utils/index.js.map +1 -1
- package/dist/shared/utils/pathBoundary.d.ts +2 -0
- package/dist/shared/utils/pathBoundary.d.ts.map +1 -0
- package/dist/shared/utils/pathBoundary.js +10 -0
- package/dist/shared/utils/pathBoundary.js.map +1 -0
- package/package.json +2 -2
- package/builtins/en/facets/instructions/implement-e2e-test.md +0 -51
- package/builtins/en/facets/instructions/plan-e2e-test.md +0 -11
- package/builtins/en/templates/instructions/ai-fix.md +0 -74
- package/builtins/en/templates/instructions/ai-review-standalone.md +0 -47
- package/builtins/en/templates/instructions/arbitrate.md +0 -45
- package/builtins/en/templates/instructions/architect.md +0 -48
- package/builtins/en/templates/instructions/fix.md +0 -86
- package/builtins/en/templates/instructions/implement.md +0 -102
- package/builtins/en/templates/instructions/plan.md +0 -55
- package/builtins/en/templates/instructions/review.md +0 -101
- package/builtins/en/templates/instructions/supervise.md +0 -106
- package/builtins/en/templates/personas/character.md +0 -45
- package/builtins/en/templates/personas/expert.md +0 -68
- package/builtins/en/templates/personas/simple.md +0 -22
- package/builtins/en/templates/policies/policy.md +0 -49
- package/builtins/en/templates/reports/architecture-design.md +0 -31
- package/builtins/en/templates/reports/plan.md +0 -70
- package/builtins/en/templates/reports/review.md +0 -143
- package/builtins/en/templates/reports/security-review.md +0 -43
- package/builtins/en/templates/reports/summary.md +0 -52
- package/builtins/en/templates/reports/validation.md +0 -31
- package/builtins/ja/facets/instructions/implement-e2e-test.md +0 -51
- package/builtins/ja/facets/instructions/plan-e2e-test.md +0 -11
- package/builtins/ja/templates/instructions/ai-fix.md +0 -74
- package/builtins/ja/templates/instructions/ai-review-standalone.md +0 -47
- package/builtins/ja/templates/instructions/arbitrate.md +0 -45
- package/builtins/ja/templates/instructions/architect.md +0 -48
- package/builtins/ja/templates/instructions/fix.md +0 -86
- package/builtins/ja/templates/instructions/implement.md +0 -102
- package/builtins/ja/templates/instructions/plan.md +0 -55
- package/builtins/ja/templates/instructions/review.md +0 -101
- package/builtins/ja/templates/instructions/supervise.md +0 -106
- package/builtins/ja/templates/knowledge/knowledge.md +0 -39
- package/builtins/ja/templates/output-contracts/architecture-design.md +0 -31
- package/builtins/ja/templates/output-contracts/plan.md +0 -70
- package/builtins/ja/templates/output-contracts/review.md +0 -143
- package/builtins/ja/templates/output-contracts/security-review.md +0 -43
- package/builtins/ja/templates/output-contracts/summary.md +0 -52
- package/builtins/ja/templates/output-contracts/validation.md +0 -31
- package/builtins/ja/templates/personas/character.md +0 -43
- package/builtins/ja/templates/personas/expert.md +0 -21
- package/builtins/ja/templates/personas/simple.md +0 -22
- package/builtins/ja/templates/policies/policy.md +0 -49
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Implement missing E2E tests based on the test case list.
|
|
2
|
+
|
|
3
|
+
**Important:** Refer to the test plan report: {report:01-e2e-coverage-plan.md}
|
|
4
|
+
|
|
5
|
+
**Note:** If Previous Response exists, this is a resubmission.
|
|
6
|
+
Check which test cases were flagged as unimplemented and implement them.
|
|
7
|
+
|
|
8
|
+
**What to do:**
|
|
9
|
+
1. Review the numbered test case list from the test plan
|
|
10
|
+
2. Implement tests following existing E2E test patterns (file structure, helpers, fixtures, mock strategy)
|
|
11
|
+
3. Implement ALL cases in the test case list (do not stop after implementing just a few)
|
|
12
|
+
4. Run E2E tests and confirm all tests pass
|
|
13
|
+
5. Confirm existing E2E tests are not broken
|
|
14
|
+
|
|
15
|
+
**Implementation constraints:**
|
|
16
|
+
- Do not modify the existing E2E test framework
|
|
17
|
+
- Write one scenario per concern with clear expected results
|
|
18
|
+
- Follow existing fixture/helper/mock patterns for cases with external dependencies
|
|
19
|
+
|
|
20
|
+
**Required output (include headings)**
|
|
21
|
+
## Implemented Test Cases
|
|
22
|
+
- {Test case list number and corresponding test file/test name}
|
|
23
|
+
## Unimplemented Test Cases (if any)
|
|
24
|
+
- {Number and reason for not implementing}
|
|
25
|
+
## Test Results
|
|
26
|
+
- {Execution command and results}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Comprehensively identify all user operation routes in the application and create a list of missing E2E test cases.
|
|
2
|
+
|
|
3
|
+
**Note:** If Previous Response exists, this is a resubmission.
|
|
4
|
+
Review and revise the list based on that feedback.
|
|
5
|
+
|
|
6
|
+
**What to do:**
|
|
7
|
+
|
|
8
|
+
1. **Understand the E2E test infrastructure**
|
|
9
|
+
- Review existing E2E test directory structure, test runner, helpers, fixtures, and mock strategy
|
|
10
|
+
- Identify the test execution commands
|
|
11
|
+
|
|
12
|
+
2. **Identify user operation entry points** (read CODE, not just documentation)
|
|
13
|
+
- For CLI: extract command definitions, subcommands, and options from code
|
|
14
|
+
- For Web: extract routing definitions, page transitions, and API endpoints from code
|
|
15
|
+
- Trace each entry point's handler and processing flow, identifying branches and state transitions
|
|
16
|
+
|
|
17
|
+
3. **Deep-dive into UX variations**
|
|
18
|
+
- For each entry point, enumerate all possible routes a user can take
|
|
19
|
+
- Option/flag combinations that create different branches (e.g., `--pipeline` on/off, `--auto-pr` on/off)
|
|
20
|
+
- State-dependent branches (first run vs existing data, config present vs absent)
|
|
21
|
+
- Not just happy paths — error handling and recovery routes when things fail midway
|
|
22
|
+
- Permission/role-based routes
|
|
23
|
+
- External dependency state branches (connection success vs failure, normal vs abnormal response)
|
|
24
|
+
|
|
25
|
+
4. **Cross-reference with existing E2E tests**
|
|
26
|
+
- Analyze what existing tests cover on a per-file basis
|
|
27
|
+
- Identify which routes are already covered by existing tests
|
|
28
|
+
- List uncovered routes as "missing test cases"
|
|
29
|
+
|
|
30
|
+
5. **Create the test case list**
|
|
31
|
+
- Assign a unique number to every test case (this is the ledger supervisor uses for verification)
|
|
32
|
+
- Assign priority to each case (user impact × untested risk)
|
|
33
|
+
- **Do NOT abbreviate.** Don't stop at 1-2 cases — enumerate ALL identified routes
|
|
34
|
+
|
|
35
|
+
**Strictly prohibited:**
|
|
36
|
+
- Reading only docs/README and guessing test cases → PROHIBITED. Read the code
|
|
37
|
+
- Cutting the list short with "there might be more" → PROHIBITED. Enumerate all
|
|
38
|
+
- Including cases already covered by existing tests → PROHIBITED. Only list verified gaps
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Cross-reference the test case list from the plan with implementation results, and verify all cases have been implemented.
|
|
2
|
+
|
|
3
|
+
**Important:** Refer to the test plan report: {report:01-e2e-coverage-plan.md}
|
|
4
|
+
|
|
5
|
+
**Verification procedure:**
|
|
6
|
+
|
|
7
|
+
1. **Cross-reference with test case list (most important)**
|
|
8
|
+
- Check each numbered test case from the plan report one by one
|
|
9
|
+
- Identify the corresponding test file and test name for each case
|
|
10
|
+
- Read the test file to confirm the case is actually tested
|
|
11
|
+
- List any cases without a corresponding test as "unimplemented"
|
|
12
|
+
- REJECT if even one unimplemented case exists
|
|
13
|
+
|
|
14
|
+
2. **Test quality verification**
|
|
15
|
+
- Does each test correctly verify the intent of the test case?
|
|
16
|
+
- Are assertions appropriate (not just existence checks, but value verification)?
|
|
17
|
+
- Does the mock/fixture usage follow existing patterns?
|
|
18
|
+
|
|
19
|
+
3. **Test execution verification**
|
|
20
|
+
- Run E2E tests and confirm all tests pass
|
|
21
|
+
- Confirm existing tests are not broken
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
Use reports in the Report Directory and fix the issues raised by the reviewer.
|
|
2
2
|
|
|
3
|
+
**Fix principles:**
|
|
4
|
+
- When a finding includes a "suggested fix", follow it rather than inventing your own workaround
|
|
5
|
+
- Fix the target code directly. Do not deflect findings by adding tests or documentation instead
|
|
6
|
+
|
|
3
7
|
**Report reference policy:**
|
|
4
8
|
- Use the latest review reports in the Report Directory as primary evidence.
|
|
5
9
|
- Past iteration reports are saved as `{filename}.{timestamp}` in the same directory (e.g., `architect-review.md.20260304T123456Z`). For each report, run Glob with a `{report-name}.*` pattern, read up to 2 files in descending timestamp order, and understand persists / reopened trends before starting fixes.
|
|
@@ -7,6 +7,7 @@ is healthy (making progress) or unproductive (repeating the same issues).
|
|
|
7
7
|
- AI Review results: {report:ai-review.md}
|
|
8
8
|
|
|
9
9
|
**Judgment criteria:**
|
|
10
|
-
- Are
|
|
11
|
-
-
|
|
12
|
-
-
|
|
10
|
+
- Are the same finding_ids persisting across multiple cycles?
|
|
11
|
+
- Same finding_id repeatedly persists → unproductive (stuck)
|
|
12
|
+
- Previous findings resolved and new findings appear as new → healthy (progressing)
|
|
13
|
+
- Are fixes actually being applied to the code?
|
|
@@ -4,6 +4,8 @@ Review the latest review reports in the Report Directory and determine
|
|
|
4
4
|
whether this loop is healthy (converging) or unproductive (diverging or oscillating).
|
|
5
5
|
|
|
6
6
|
**Judgment criteria:**
|
|
7
|
-
-
|
|
8
|
-
-
|
|
7
|
+
- Are the same finding_ids persisting across multiple cycles?
|
|
8
|
+
- Same finding_id repeatedly persists → unproductive (stuck)
|
|
9
|
+
- Previous findings resolved and new findings appear as new → healthy (converging)
|
|
9
10
|
- Are fixes actually being applied to the code?
|
|
11
|
+
- Is the number of new / reopened findings decreasing overall?
|
|
@@ -19,7 +19,9 @@ For small tasks, skip the design sections in the report.
|
|
|
19
19
|
4. Determine file structure and design patterns (if needed)
|
|
20
20
|
5. Decide on the implementation approach
|
|
21
21
|
- Verify the implementation approach does not violate knowledge/policy constraints
|
|
22
|
+
- When adding or changing a user-facing feature, fix the conditions, entry points, and reachability by which users arrive at it
|
|
22
23
|
6. Include the following in coder implementation guidelines:
|
|
23
24
|
- Existing implementation patterns to reference (file:line). Always cite when similar processing already exists
|
|
24
25
|
- Impact area of changes. Especially when adding new parameters, enumerate all call sites that need wiring
|
|
25
26
|
- Anti-patterns to watch for in this specific task (if applicable)
|
|
27
|
+
- When adding or changing a user-facing feature, all affected reachability, callers, and launch conditions
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
Review the changes from a frontend development perspective.
|
|
2
2
|
|
|
3
3
|
**Review criteria:**
|
|
4
|
+
- Design fidelity (top priority when a design reference is provided)
|
|
4
5
|
- Component design (separation of concerns, granularity)
|
|
5
6
|
- State management (local vs. global decisions)
|
|
6
7
|
- Performance (re-renders, memoization)
|
|
7
8
|
- Accessibility (keyboard navigation, ARIA)
|
|
8
9
|
- Data fetching patterns
|
|
10
|
+
- Reachability wiring for user-facing features (routes, entry paths, launch conditions)
|
|
9
11
|
- TypeScript type safety
|
|
10
12
|
|
|
13
|
+
**Design fidelity check (when a design reference exists):**
|
|
14
|
+
1. Identify the design reference from the task order's referenced materials
|
|
15
|
+
2. Compare design elements (layout, wording, colors, spacing) against implementation element by element
|
|
16
|
+
3. For any discrepancy, check the decisions log to determine if it was intentional
|
|
17
|
+
4. Report unintentional discrepancies as blocking issues
|
|
18
|
+
|
|
11
19
|
**Note**: If this project does not include a frontend,
|
|
12
20
|
proceed as no issues found.
|
|
13
21
|
|
|
@@ -21,5 +29,6 @@ Review {report:coder-decisions.md} to understand the recorded design decisions.
|
|
|
21
29
|
|
|
22
30
|
1. Review the change diff and detect issues based on the frontend development criteria above
|
|
23
31
|
- Cross-check changes against REJECT criteria tables defined in knowledge
|
|
32
|
+
- When new screens or user-facing features are added, verify that entry points and caller wiring were updated as well
|
|
24
33
|
2. For each detected issue, classify as blocking/non-blocking based on Policy's scope determination table and judgment rules
|
|
25
34
|
3. If there is even one blocking issue, judge as REJECT
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Understand the overall project structure and create a complete list of files to be audited for security.
|
|
2
|
+
|
|
3
|
+
**What to do:**
|
|
4
|
+
1. Identify the project's source code directories and list all files using Glob
|
|
5
|
+
2. Understand the project's tech stack, frameworks, and major dependencies
|
|
6
|
+
3. Classify each file's role briefly (API layer, domain layer, infrastructure layer, utilities, etc.)
|
|
7
|
+
4. Identify files with high security risk (authentication, input handling, external communication, file operations, configuration, etc.)
|
|
8
|
+
|
|
9
|
+
**Important:**
|
|
10
|
+
- List ALL files without omission. Do not abbreviate
|
|
11
|
+
- Include configuration files and test files
|
|
12
|
+
- Even if the file count is large, list every single file
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Re-audit the files that were judged insufficient in the previous audit.
|
|
2
|
+
|
|
3
|
+
**Important:** Review the supervisor's verification results and understand:
|
|
4
|
+
- List of unaudited files
|
|
5
|
+
- List of files flagged as insufficiently audited
|
|
6
|
+
- Specific feedback
|
|
7
|
+
|
|
8
|
+
**What to do:**
|
|
9
|
+
1. **Read each flagged file in full using Read tool one by one**
|
|
10
|
+
2. Review each file from a security perspective
|
|
11
|
+
3. Report discovered issues with severity ratings
|
|
12
|
+
|
|
13
|
+
**Strictly prohibited:**
|
|
14
|
+
- Searching with Grep and only reviewing matching files → PROHIBITED
|
|
15
|
+
- Reading only part of a file → PROHIBITED
|
|
16
|
+
- Skipping a file because it "looks fine" → PROHIBITED
|
|
17
|
+
|
|
18
|
+
**Required output (include headings):**
|
|
19
|
+
## Re-audit Results
|
|
20
|
+
- {Audit results for each file}
|
|
21
|
+
## Detected Issues
|
|
22
|
+
- {Issue details (severity, location, remediation)}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Verify the completeness and quality of the security audit.
|
|
2
|
+
|
|
3
|
+
**Important:** Refer to the plan report: {report:01-plan.md}
|
|
4
|
+
|
|
5
|
+
**Verification procedure:**
|
|
6
|
+
|
|
7
|
+
1. **Completeness verification (most important)**
|
|
8
|
+
- Cross-reference the file list from the plan report with files mentioned in the audit results
|
|
9
|
+
- List any files not mentioned in the audit results as "unaudited files"
|
|
10
|
+
- REJECT if even one unaudited file exists
|
|
11
|
+
|
|
12
|
+
2. **Methodology verification**
|
|
13
|
+
- Check whether each file's audit result references specific code content
|
|
14
|
+
- If a file only says "no issues" without mentioning specific content checked, it may not have been actually Read → REJECT
|
|
15
|
+
- Check for signs that judgment was based solely on Grep keyword matching
|
|
16
|
+
|
|
17
|
+
3. **Quality verification**
|
|
18
|
+
- Check whether severity classifications of detected issues are appropriate
|
|
19
|
+
- Read a few high-security-risk files yourself to verify no issues were missed
|
|
20
|
+
- Check whether there are too many false positives
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Decompose the security audit task, assign files to each part, and execute in parallel.
|
|
2
|
+
|
|
3
|
+
**Important:** Refer to the plan report: {report:01-plan.md}
|
|
4
|
+
|
|
5
|
+
**What to do:**
|
|
6
|
+
|
|
7
|
+
1. Review the file list from the plan report and understand all files to be audited
|
|
8
|
+
2. Split files into 3 groups by module/layer
|
|
9
|
+
- Distribute high-security-risk files (authentication, input handling, external communication, etc.) evenly across groups
|
|
10
|
+
- Keep related files (within the same module) in the same group when possible
|
|
11
|
+
3. Assign exclusive file ownership to each part
|
|
12
|
+
|
|
13
|
+
**Each part's instruction MUST include:**
|
|
14
|
+
- **Assigned file list** (all file paths to review via Read)
|
|
15
|
+
- **Audit procedure:**
|
|
16
|
+
1. **Read each assigned file in full using Read tool one by one** (do NOT abbreviate with Grep or partial reads)
|
|
17
|
+
2. Review each file from a security perspective
|
|
18
|
+
3. Report discovered issues with severity ratings
|
|
19
|
+
- **Strictly prohibited:**
|
|
20
|
+
- Searching with Grep and only reviewing matching files → PROHIBITED. Read ALL files
|
|
21
|
+
- Reading only part of a file → PROHIBITED. Read the entire file
|
|
22
|
+
- Skipping a file because it "looks fine" → PROHIBITED. Review every file
|
|
23
|
+
- **Completion criteria:** All assigned files have been Read in full, and audit results are reported for each file
|
|
24
|
+
|
|
25
|
+
**Constraints:**
|
|
26
|
+
- Each part is read-only. Do not modify code
|
|
27
|
+
- Do not audit files outside your assignment (to prevent overlap)
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# E2E Testing Knowledge
|
|
2
|
+
|
|
3
|
+
## E2E Test Scope
|
|
4
|
+
|
|
5
|
+
E2E tests verify the entire user operation flow. Their scope differs from unit and integration tests.
|
|
6
|
+
|
|
7
|
+
| Test Type | Scope | Verification Target |
|
|
8
|
+
|-----------|-------|-------------------|
|
|
9
|
+
| Unit | Function/Class | Logic correctness |
|
|
10
|
+
| Integration | Inter-module coupling | Data flow correctness |
|
|
11
|
+
| E2E | Entire user operation flow | Behavior as seen by the user |
|
|
12
|
+
|
|
13
|
+
| Criteria | Judgment |
|
|
14
|
+
|----------|----------|
|
|
15
|
+
| Writing E2E tests for logic that unit tests can cover | Warning. Consider moving to unit tests |
|
|
16
|
+
| Verifying user operation flows | E2E test is appropriate |
|
|
17
|
+
| Scenarios spanning multiple commands/pages | E2E test is appropriate |
|
|
18
|
+
| Error message display verification | E2E test is appropriate |
|
|
19
|
+
|
|
20
|
+
## UX Route Identification
|
|
21
|
+
|
|
22
|
+
E2E test completeness depends on thorough UX route identification. Identify entry points from code, not documentation.
|
|
23
|
+
|
|
24
|
+
### Entry Point Identification
|
|
25
|
+
|
|
26
|
+
| Application Type | How to Find Entry Points |
|
|
27
|
+
|-----------------|-------------------------|
|
|
28
|
+
| CLI | Extract command definitions, subcommand registrations, option/flag definitions from code |
|
|
29
|
+
| Web | Extract routing definitions, page component lists from code |
|
|
30
|
+
| API | Extract endpoint definitions, router registrations from code |
|
|
31
|
+
|
|
32
|
+
### Branch Patterns
|
|
33
|
+
|
|
34
|
+
Exhaustively enumerate routes branching from each entry point.
|
|
35
|
+
|
|
36
|
+
| Branch Pattern | Example |
|
|
37
|
+
|---------------|---------|
|
|
38
|
+
| Option/flag combinations | `--verbose` on/off, `--format json` vs `--format table` |
|
|
39
|
+
| State-dependent branches | First run vs existing data, config present vs absent |
|
|
40
|
+
| Permission/role | Admin vs regular user, authenticated vs unauthenticated |
|
|
41
|
+
| External dependency state | Connection success vs timeout, normal vs error response |
|
|
42
|
+
| Error recovery | Retry on midway failure, rollback |
|
|
43
|
+
| Input variations | Valid input, invalid input, empty input, boundary values |
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Mock Boundary Design
|
|
47
|
+
|
|
48
|
+
In E2E tests, deciding "how far to run real code and where to start mocking" is critical.
|
|
49
|
+
|
|
50
|
+
### Mock Design Principles
|
|
51
|
+
|
|
52
|
+
- Run the application code under test as-is
|
|
53
|
+
- Insert mocks at external service boundaries
|
|
54
|
+
- Follow existing fixture/helper mock patterns
|
|
55
|
+
- Check existing mock infrastructure before introducing new mechanisms
|
|
56
|
+
|
|
57
|
+
## Flaky Test Prevention
|
|
58
|
+
|
|
59
|
+
E2E tests are prone to non-deterministic failures.
|
|
60
|
+
|
|
61
|
+
| Cause | Mitigation |
|
|
62
|
+
|-------|-----------|
|
|
63
|
+
| Timing dependency | Use explicit wait conditions (state-based waits, not fixed sleeps) |
|
|
64
|
+
| Port conflicts | Assign random ports per test |
|
|
65
|
+
| Filesystem residue | Create temp directories per test, cleanup on teardown |
|
|
66
|
+
| Process leaks | Set timeouts and force-kill |
|
|
67
|
+
| Environment dependency | Explicitly set up prerequisites for test execution |
|
|
68
|
+
| Execution order dependency | Initialize state so each test runs independently |
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// NG - fixed sleep for timing
|
|
72
|
+
await sleep(3000)
|
|
73
|
+
expect(result).toBeDefined()
|
|
74
|
+
|
|
75
|
+
// OK - condition-based wait
|
|
76
|
+
await waitFor(() => expect(result).toBeDefined(), { timeout: 5000 })
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Test Case Management
|
|
80
|
+
|
|
81
|
+
Manage test cases as a list to guarantee E2E test completeness.
|
|
82
|
+
|
|
83
|
+
| Principle | Description |
|
|
84
|
+
|-----------|-------------|
|
|
85
|
+
| Numbered list | Assign a unique number to each test case and track implementation status |
|
|
86
|
+
| Classify by entry point | Group by command/page/endpoint |
|
|
87
|
+
| Prioritize | Determine priority by user impact × untested risk |
|
|
88
|
+
| Cross-reference with existing tests | Check existing test coverage before adding new tests |
|
|
89
|
+
|
|
@@ -45,6 +45,40 @@ features/{feature-name}/
|
|
|
45
45
|
└── index.ts
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
## Routing Wiring When Adding a Page
|
|
49
|
+
|
|
50
|
+
Do not stop at creating the page component. A new page must also be wired into an actual entry path. Decide together with the implementation how the page is reached: router, menu, temporary route, or another explicit entry point.
|
|
51
|
+
|
|
52
|
+
| Criteria | Judgment |
|
|
53
|
+
|----------|----------|
|
|
54
|
+
| A new page exists but no route is registered for it | REJECT |
|
|
55
|
+
| Basename-based URL and route path mapping is not verified | REJECT |
|
|
56
|
+
| Router wiring and page entry are decided together with the page implementation | OK |
|
|
57
|
+
| A temporary development route is used and its purpose/removal plan is recorded | OK |
|
|
58
|
+
| Routes are updated but actual entry points such as menus, buttons, links, or external callers are not checked | Warning |
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
// OK - page and route are added together
|
|
62
|
+
<Route path="/contreg" element={<ContainerRegisterPage />} />
|
|
63
|
+
|
|
64
|
+
// REJECT - page exists but has no reachable route
|
|
65
|
+
// src/pages/ContainerRegisterPage.tsx exists
|
|
66
|
+
// Router has no matching route
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Reachability is broader than router configuration. Confirm the real entry path users will follow, such as menus, transition buttons, dialog actions, links from other screens, or external callers.
|
|
70
|
+
|
|
71
|
+
### Integrating third-party UI libraries
|
|
72
|
+
|
|
73
|
+
Third-party UI libraries such as data grids, date pickers, charts, and virtualized lists can fail at runtime even when types pass. This is especially common across major-version changes where prop names or state model shapes are no longer compatible, and shallow mocks do not expose the problem.
|
|
74
|
+
|
|
75
|
+
| Criteria | Judgment |
|
|
76
|
+
|----------|----------|
|
|
77
|
+
| Major UI library props are guessed without checking the version used by the project | REJECT |
|
|
78
|
+
| Tests fully mock the library and miss real mount failures | Warning |
|
|
79
|
+
| The real component is rendered with representative props and verified not to crash at screen level | OK |
|
|
80
|
+
| Prop shapes are chosen by referencing existing in-project usage patterns and the installed version | OK |
|
|
81
|
+
|
|
48
82
|
## State Management
|
|
49
83
|
|
|
50
84
|
Child components do not modify their own state. They bubble events to parent, and parent manipulates state.
|
|
@@ -78,6 +112,7 @@ Exception (OK for child to have local state):
|
|
|
78
112
|
| State changes from child to parent (reverse data flow) | REJECT |
|
|
79
113
|
| API response stored as-is in state | Consider normalization |
|
|
80
114
|
| Inappropriate useEffect dependencies | REJECT |
|
|
115
|
+
| Initial load tied to unstable Context/Provider function references | REJECT |
|
|
81
116
|
|
|
82
117
|
State Placement Guidelines:
|
|
83
118
|
|
|
@@ -88,6 +123,17 @@ State Placement Guidelines:
|
|
|
88
123
|
| Shared across multiple components | Context or state management library |
|
|
89
124
|
| Server data cache | Data fetching library (TanStack Query, etc.) |
|
|
90
125
|
|
|
126
|
+
## Initial load and refetch boundaries
|
|
127
|
+
|
|
128
|
+
Initial loading should be separated from reactive refetching. If refetching is not driven by URL, filter, paging, or explicit user action, keep it mount-only and do not tie it to unstable callback references.
|
|
129
|
+
|
|
130
|
+
| Criteria | Judgment |
|
|
131
|
+
|----------|----------|
|
|
132
|
+
| Initial load reruns because a Provider/Context callback changed identity | REJECT |
|
|
133
|
+
| Refetch conditions are explicit (URL, filter, paging, refresh action) | OK |
|
|
134
|
+
| Message display, loading toggles, or modal state cause refetching | REJECT |
|
|
135
|
+
| Initial load is mount-only and later refetches are triggered explicitly | OK |
|
|
136
|
+
|
|
91
137
|
## Data Fetching
|
|
92
138
|
|
|
93
139
|
API calls are made in root (View) components and passed to children via props.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# React Knowledge
|
|
2
|
+
|
|
3
|
+
## Effects and Re-execution
|
|
4
|
+
|
|
5
|
+
`useEffect` is a mechanism for declaring when re-execution is allowed, not a generic place to put initialization. Decide first whether a load is mount-only or should rerun on dependency changes.
|
|
6
|
+
|
|
7
|
+
| Criteria | Judgment |
|
|
8
|
+
|----------|----------|
|
|
9
|
+
| A mount-only initial load depends on recreated function references | REJECT |
|
|
10
|
+
| Context/Provider functions are used as effect dependencies without a clear refetch requirement | REJECT |
|
|
11
|
+
| Mount-only initialization is expressed with `useEffect(..., [])` and its intent is documented | OK |
|
|
12
|
+
| Refetching on dependency change is required by the feature and those dependencies are explicit | OK |
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
// REJECT - initial load can rerun because unstable function deps leak into the effect
|
|
16
|
+
const fetchList = useCallback(async () => {
|
|
17
|
+
await loadItems()
|
|
18
|
+
}, [setIsLoading, errorPage])
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
fetchList()
|
|
22
|
+
}, [fetchList])
|
|
23
|
+
|
|
24
|
+
// OK - explicitly mount-only initial load
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
void loadItemsOnMount()
|
|
27
|
+
// mount-only initial load
|
|
28
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29
|
+
}, [])
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Context and Provider Values
|
|
33
|
+
|
|
34
|
+
`value={{ ... }}` in a Provider creates a new reference on each Provider render. When functions obtained from Context are placed in effect dependencies, consumers can enter unintended refetch loops.
|
|
35
|
+
|
|
36
|
+
| Criteria | Judgment |
|
|
37
|
+
|----------|----------|
|
|
38
|
+
| Context-derived functions are placed in effect dependencies without checking reference stability | REJECT |
|
|
39
|
+
| Mount effects rely on Provider functions whose stability is not guaranteed | REJECT |
|
|
40
|
+
| Context functions are used from event handlers while initial load stays mount-only | OK |
|
|
41
|
+
| Provider values are stabilized and refetch conditions are defined explicitly | OK |
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
// REJECT - Context functions are used directly as initial-load effect deps
|
|
45
|
+
const { setIsLoading, errorPage } = useAppContext()
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
void loadInitialData(setIsLoading, errorPage)
|
|
48
|
+
}, [setIsLoading, errorPage])
|
|
49
|
+
|
|
50
|
+
// OK - initial load is mount-only, Context functions are consumed inside it
|
|
51
|
+
const { setIsLoading, errorPage } = useAppContext()
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
void loadInitialData({ setIsLoading, errorPage })
|
|
54
|
+
// mount-only initial load
|
|
55
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
56
|
+
}, [])
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Initial Page Load
|
|
60
|
+
|
|
61
|
+
Treat initial page load separately from reactive refetching. Unless refetching is required by filter, URL, pagination, or explicit user action, keep the initial fetch mount-only.
|
|
62
|
+
|
|
63
|
+
| Condition | Recommendation |
|
|
64
|
+
|-----------|----------------|
|
|
65
|
+
| List is loaded once on page entry | mount-only effect |
|
|
66
|
+
| Refetching follows filter, pagination, or URL changes | make those states explicit dependencies |
|
|
67
|
+
| Loading state updates trigger refetching | REJECT |
|
|
68
|
+
| Message display or dialog state triggers refetching | REJECT |
|
|
69
|
+
|
|
70
|
+
## Custom Hook Responsibility
|
|
71
|
+
|
|
72
|
+
A React custom hook should encapsulate state, effects, refs, or event translation. Pure calculations belong in function modules, not in a `use*` hook.
|
|
73
|
+
|
|
74
|
+
| Criteria | Judgment |
|
|
75
|
+
|----------|----------|
|
|
76
|
+
| A module is named `use*` but does not use React state/effect/ref | Warning |
|
|
77
|
+
| Pure functions are modeled as a custom hook | Warning |
|
|
78
|
+
| Stateful UI control lives in a custom hook and pure calculations live in functions | OK |
|
|
79
|
+
| A hook returns JSX | REJECT |
|
|
80
|
+
|
|
81
|
+
## Handling exhaustive-deps
|
|
82
|
+
|
|
83
|
+
`react-hooks/exhaustive-deps` is not a rule to satisfy mechanically. If adding dependencies changes a mount-only effect into a loop, keep the effect mount-only and document why the suppression exists.
|
|
84
|
+
|
|
85
|
+
| Criteria | Judgment |
|
|
86
|
+
|----------|----------|
|
|
87
|
+
| Dependencies are added only to satisfy lint and they change runtime behavior | REJECT |
|
|
88
|
+
| Lint suppression is added without explanation | Warning |
|
|
89
|
+
| Mount-only suppression is documented with intent | OK |
|
|
90
|
+
| A reactive effect that should rerun is incorrectly frozen with `[]` | REJECT |
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Unit Testing Knowledge
|
|
2
|
+
|
|
3
|
+
## Test Double Selection
|
|
4
|
+
|
|
5
|
+
Choose test doubles based on purpose. Excessive mocking reduces test reliability.
|
|
6
|
+
|
|
7
|
+
| Type | Purpose | Use Case |
|
|
8
|
+
|------|---------|----------|
|
|
9
|
+
| Stub | Return fixed values | Control output of external dependencies |
|
|
10
|
+
| Mock | Verify invocations | Confirm method calls and arguments |
|
|
11
|
+
| Spy | Record calls while preserving implementation | Verify side effects |
|
|
12
|
+
| Fake | Lightweight implementation | In-memory DB or similar lightweight substitutes |
|
|
13
|
+
|
|
14
|
+
### Mock Granularity
|
|
15
|
+
|
|
16
|
+
- Mock only direct dependencies of the test target (not indirect dependencies)
|
|
17
|
+
- "Too many mocks" suggests a design problem in the test target
|
|
18
|
+
- Pure functions have no dependencies and need no mocking
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// NG - mocking internal implementation (testing implementation, not behavior)
|
|
22
|
+
vi.spyOn(service, 'privateMethod')
|
|
23
|
+
service.execute()
|
|
24
|
+
expect(service.privateMethod).toHaveBeenCalled()
|
|
25
|
+
|
|
26
|
+
// OK - mock external dependency, verify behavior
|
|
27
|
+
const repository = { findById: vi.fn().mockResolvedValue(user) }
|
|
28
|
+
const service = new UserService(repository)
|
|
29
|
+
const result = await service.getUser('id')
|
|
30
|
+
expect(result).toEqual(user)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Boundary Value Analysis
|
|
34
|
+
|
|
35
|
+
Boundary values and equivalence partitioning are fundamental unit testing techniques.
|
|
36
|
+
|
|
37
|
+
| Technique | Description |
|
|
38
|
+
|-----------|-------------|
|
|
39
|
+
| Equivalence partitioning | Divide inputs into equivalent groups, test one from each |
|
|
40
|
+
| Boundary value analysis | Test at equivalence class boundaries (boundary, boundary±1) |
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
// NG - happy path only
|
|
44
|
+
test('validates age', () => {
|
|
45
|
+
expect(validateAge(25)).toBe(true)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
// OK - includes boundary values
|
|
49
|
+
test('validates age at boundaries', () => {
|
|
50
|
+
expect(validateAge(0)).toBe(true) // lower bound
|
|
51
|
+
expect(validateAge(-1)).toBe(false) // lower bound - 1
|
|
52
|
+
expect(validateAge(150)).toBe(true) // upper bound
|
|
53
|
+
expect(validateAge(151)).toBe(false) // upper bound + 1
|
|
54
|
+
})
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Test Fixture Design
|
|
58
|
+
|
|
59
|
+
Manage test data with factory functions.
|
|
60
|
+
|
|
61
|
+
- Generate minimal fixtures with factory functions
|
|
62
|
+
- Fill test-irrelevant fields with defaults
|
|
63
|
+
- Do not share and mutate fixtures between tests (maintain test independence)
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
// NG - defining all fields every time
|
|
67
|
+
const user = { id: '1', name: 'test', email: 'test@example.com', role: 'admin', createdAt: new Date() }
|
|
68
|
+
|
|
69
|
+
// OK - factory function with minimal overrides
|
|
70
|
+
const createUser = (overrides: Partial<User> = {}): User => ({
|
|
71
|
+
id: 'test-id',
|
|
72
|
+
name: 'test-user',
|
|
73
|
+
email: 'test@example.com',
|
|
74
|
+
role: 'user',
|
|
75
|
+
...overrides,
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
test('admin can delete', () => {
|
|
79
|
+
const admin = createUser({ role: 'admin' })
|
|
80
|
+
// only test-relevant fields are explicit
|
|
81
|
+
})
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Test Target Isolation
|
|
85
|
+
|
|
86
|
+
Testability is an indicator of design quality. Hard-to-test code has tightly coupled dependencies.
|
|
87
|
+
|
|
88
|
+
### Dependency Injection Patterns
|
|
89
|
+
|
|
90
|
+
| Pattern | Use Case |
|
|
91
|
+
|---------|----------|
|
|
92
|
+
| Constructor injection | Class-based dependency separation |
|
|
93
|
+
| Function arguments | Accept dependencies as function parameters |
|
|
94
|
+
| Module replacement | Replace entire modules during testing |
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
// NG - creates dependency directly (cannot mock in tests)
|
|
98
|
+
class OrderService {
|
|
99
|
+
private repo = new OrderRepository()
|
|
100
|
+
async create(order: Order) { return this.repo.save(order) }
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// OK - constructor injection (mockable in tests)
|
|
104
|
+
class OrderService {
|
|
105
|
+
constructor(private readonly repo: OrderRepository) {}
|
|
106
|
+
async create(order: Order) { return this.repo.save(order) }
|
|
107
|
+
}
|
|
108
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
```markdown
|
|
2
|
+
# E2E Coverage Plan
|
|
3
|
+
|
|
4
|
+
## Project Overview
|
|
5
|
+
{Tech stack, E2E test framework, test execution commands}
|
|
6
|
+
|
|
7
|
+
## User Operation Entry Points
|
|
8
|
+
| # | Entry Point | Type | Handler |
|
|
9
|
+
|---|-------------|------|---------|
|
|
10
|
+
| 1 | {command/route/endpoint} | CLI/Web/API | `src/file.ts:42` |
|
|
11
|
+
|
|
12
|
+
## UX Route Analysis
|
|
13
|
+
### {Entry Point Name}
|
|
14
|
+
| # | Route | Branch Condition | Existing Test |
|
|
15
|
+
|---|-------|-----------------|---------------|
|
|
16
|
+
| 1 | {happy path} | - | ✅ `e2e/file.test.ts` / ❌ none |
|
|
17
|
+
| 2 | {with option X} | `--flag` | ❌ none |
|
|
18
|
+
| 3 | {on error} | {condition} | ❌ none |
|
|
19
|
+
|
|
20
|
+
## Missing Test Case List
|
|
21
|
+
| # | Entry Point | Test Case | Priority | Expected Result to Verify |
|
|
22
|
+
|---|-------------|-----------|----------|--------------------------|
|
|
23
|
+
| 1 | {entry point} | {case summary} | High/Med/Low | {expected result} |
|
|
24
|
+
| 2 | {entry point} | {case summary} | High/Med/Low | {expected result} |
|
|
25
|
+
|
|
26
|
+
## Test Strategy
|
|
27
|
+
- {Mock strategy}
|
|
28
|
+
- {Fixture design}
|
|
29
|
+
- {Existing helper usage}
|
|
30
|
+
|
|
31
|
+
## Implementation Guidelines
|
|
32
|
+
- {Instructions for test implementer}
|
|
33
|
+
```
|