intentpatch 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +452 -2
- package/dist/application/ports/analysis-rule.d.ts +23 -0
- package/dist/application/ports/analysis-rule.d.ts.map +1 -0
- package/dist/application/ports/analysis-rule.js +2 -0
- package/dist/application/ports/analysis-rule.js.map +1 -0
- package/dist/application/ports/change-impact-analyzer.d.ts +6 -0
- package/dist/application/ports/change-impact-analyzer.d.ts.map +1 -0
- package/dist/application/ports/change-impact-analyzer.js +2 -0
- package/dist/application/ports/change-impact-analyzer.js.map +1 -0
- package/dist/application/ports/change-source.d.ts +10 -0
- package/dist/application/ports/change-source.d.ts.map +1 -0
- package/dist/application/ports/change-source.js +2 -0
- package/dist/application/ports/change-source.js.map +1 -0
- package/dist/application/ports/code-structure-analyzer.d.ts +6 -0
- package/dist/application/ports/code-structure-analyzer.d.ts.map +1 -0
- package/dist/application/ports/code-structure-analyzer.js +2 -0
- package/dist/application/ports/code-structure-analyzer.js.map +1 -0
- package/dist/application/ports/code-structure-extractor.d.ts +33 -0
- package/dist/application/ports/code-structure-extractor.d.ts.map +1 -0
- package/dist/application/ports/code-structure-extractor.js +2 -0
- package/dist/application/ports/code-structure-extractor.js.map +1 -0
- package/dist/application/ports/file-snapshot-source.d.ts +10 -0
- package/dist/application/ports/file-snapshot-source.d.ts.map +1 -0
- package/dist/application/ports/file-snapshot-source.js +2 -0
- package/dist/application/ports/file-snapshot-source.js.map +1 -0
- package/dist/application/ports/module-reference-extractor.d.ts +13 -0
- package/dist/application/ports/module-reference-extractor.d.ts.map +1 -0
- package/dist/application/ports/module-reference-extractor.js +2 -0
- package/dist/application/ports/module-reference-extractor.js.map +1 -0
- package/dist/application/ports/project-file-source.d.ts +16 -0
- package/dist/application/ports/project-file-source.d.ts.map +1 -0
- package/dist/application/ports/project-file-source.js +2 -0
- package/dist/application/ports/project-file-source.js.map +1 -0
- package/dist/application/ports/source-symbol-extractor.d.ts +14 -0
- package/dist/application/ports/source-symbol-extractor.d.ts.map +1 -0
- package/dist/application/ports/source-symbol-extractor.js +2 -0
- package/dist/application/ports/source-symbol-extractor.js.map +1 -0
- package/dist/application/ports/symbol-change-analyzer.d.ts +6 -0
- package/dist/application/ports/symbol-change-analyzer.d.ts.map +1 -0
- package/dist/application/ports/symbol-change-analyzer.js +2 -0
- package/dist/application/ports/symbol-change-analyzer.js.map +1 -0
- package/dist/application/ports/test-change-analyzer.d.ts +6 -0
- package/dist/application/ports/test-change-analyzer.d.ts.map +1 -0
- package/dist/application/ports/test-change-analyzer.js +2 -0
- package/dist/application/ports/test-change-analyzer.js.map +1 -0
- package/dist/application/rules/change-budget-rule.d.ts +7 -0
- package/dist/application/rules/change-budget-rule.d.ts.map +1 -0
- package/dist/application/rules/change-budget-rule.js +42 -0
- package/dist/application/rules/change-budget-rule.js.map +1 -0
- package/dist/application/rules/duplicate-implementation-rule.d.ts +7 -0
- package/dist/application/rules/duplicate-implementation-rule.d.ts.map +1 -0
- package/dist/application/rules/duplicate-implementation-rule.js +20 -0
- package/dist/application/rules/duplicate-implementation-rule.js.map +1 -0
- package/dist/application/rules/expected-scope-rule.d.ts +7 -0
- package/dist/application/rules/expected-scope-rule.d.ts.map +1 -0
- package/dist/application/rules/expected-scope-rule.js +27 -0
- package/dist/application/rules/expected-scope-rule.js.map +1 -0
- package/dist/application/rules/missing-test-change-rule.d.ts +7 -0
- package/dist/application/rules/missing-test-change-rule.d.ts.map +1 -0
- package/dist/application/rules/missing-test-change-rule.js +25 -0
- package/dist/application/rules/missing-test-change-rule.js.map +1 -0
- package/dist/application/rules/package-dependency-rule.d.ts +13 -0
- package/dist/application/rules/package-dependency-rule.d.ts.map +1 -0
- package/dist/application/rules/package-dependency-rule.js +174 -0
- package/dist/application/rules/package-dependency-rule.js.map +1 -0
- package/dist/application/rules/public-api-compatibility-rule.d.ts +7 -0
- package/dist/application/rules/public-api-compatibility-rule.d.ts.map +1 -0
- package/dist/application/rules/public-api-compatibility-rule.js +92 -0
- package/dist/application/rules/public-api-compatibility-rule.js.map +1 -0
- package/dist/application/rules/public-api-removal-rule.d.ts +7 -0
- package/dist/application/rules/public-api-removal-rule.d.ts.map +1 -0
- package/dist/application/rules/public-api-removal-rule.js +45 -0
- package/dist/application/rules/public-api-removal-rule.js.map +1 -0
- package/dist/application/rules/single-implementation-abstraction-rule.d.ts +7 -0
- package/dist/application/rules/single-implementation-abstraction-rule.d.ts.map +1 -0
- package/dist/application/rules/single-implementation-abstraction-rule.js +20 -0
- package/dist/application/rules/single-implementation-abstraction-rule.js.map +1 -0
- package/dist/application/services/analyze-code-structure.d.ts +14 -0
- package/dist/application/services/analyze-code-structure.d.ts.map +1 -0
- package/dist/application/services/analyze-code-structure.js +113 -0
- package/dist/application/services/analyze-code-structure.js.map +1 -0
- package/dist/application/services/analyze-import-impact.d.ts +14 -0
- package/dist/application/services/analyze-import-impact.d.ts.map +1 -0
- package/dist/application/services/analyze-import-impact.js +142 -0
- package/dist/application/services/analyze-import-impact.js.map +1 -0
- package/dist/application/services/analyze-test-changes.d.ts +8 -0
- package/dist/application/services/analyze-test-changes.d.ts.map +1 -0
- package/dist/application/services/analyze-test-changes.js +41 -0
- package/dist/application/services/analyze-test-changes.js.map +1 -0
- package/dist/application/services/compare-source-symbols.d.ts +13 -0
- package/dist/application/services/compare-source-symbols.d.ts.map +1 -0
- package/dist/application/services/compare-source-symbols.js +103 -0
- package/dist/application/services/compare-source-symbols.js.map +1 -0
- package/dist/application/services/path-pattern.d.ts +3 -0
- package/dist/application/services/path-pattern.d.ts.map +1 -0
- package/dist/application/services/path-pattern.js +34 -0
- package/dist/application/services/path-pattern.js.map +1 -0
- package/dist/application/services/rule-engine.d.ts +9 -0
- package/dist/application/services/rule-engine.d.ts.map +1 -0
- package/dist/application/services/rule-engine.js +13 -0
- package/dist/application/services/rule-engine.js.map +1 -0
- package/dist/application/use-cases/analyze-changes.d.ts +28 -0
- package/dist/application/use-cases/analyze-changes.d.ts.map +1 -0
- package/dist/application/use-cases/analyze-changes.js +88 -0
- package/dist/application/use-cases/analyze-changes.js.map +1 -0
- package/dist/domain/change-contract.d.ts +33 -0
- package/dist/domain/change-contract.d.ts.map +1 -0
- package/dist/domain/change-contract.js +76 -0
- package/dist/domain/change-contract.js.map +1 -0
- package/dist/domain/change.d.ts +37 -0
- package/dist/domain/change.d.ts.map +1 -0
- package/dist/domain/change.js +61 -0
- package/dist/domain/change.js.map +1 -0
- package/dist/domain/code-structure.d.ts +38 -0
- package/dist/domain/code-structure.d.ts.map +1 -0
- package/dist/domain/code-structure.js +63 -0
- package/dist/domain/code-structure.js.map +1 -0
- package/dist/domain/finding.d.ts +24 -0
- package/dist/domain/finding.d.ts.map +1 -0
- package/dist/domain/finding.js +30 -0
- package/dist/domain/finding.js.map +1 -0
- package/dist/domain/impact.d.ts +45 -0
- package/dist/domain/impact.d.ts.map +1 -0
- package/dist/domain/impact.js +60 -0
- package/dist/domain/impact.js.map +1 -0
- package/dist/domain/report.d.ts +22 -0
- package/dist/domain/report.d.ts.map +1 -0
- package/dist/domain/report.js +2 -0
- package/dist/domain/report.js.map +1 -0
- package/dist/domain/symbol-change.d.ts +60 -0
- package/dist/domain/symbol-change.d.ts.map +1 -0
- package/dist/domain/symbol-change.js +79 -0
- package/dist/domain/symbol-change.js.map +1 -0
- package/dist/domain/test-change.d.ts +29 -0
- package/dist/domain/test-change.d.ts.map +1 -0
- package/dist/domain/test-change.js +35 -0
- package/dist/domain/test-change.js.map +1 -0
- package/dist/infrastructure/config/json-change-contract-loader.d.ts +6 -0
- package/dist/infrastructure/config/json-change-contract-loader.d.ts.map +1 -0
- package/dist/infrastructure/config/json-change-contract-loader.js +130 -0
- package/dist/infrastructure/config/json-change-contract-loader.js.map +1 -0
- package/dist/infrastructure/filesystem/repository-path.d.ts +3 -0
- package/dist/infrastructure/filesystem/repository-path.d.ts.map +1 -0
- package/dist/infrastructure/filesystem/repository-path.js +11 -0
- package/dist/infrastructure/filesystem/repository-path.js.map +1 -0
- package/dist/infrastructure/git/diff-parser.d.ts +3 -0
- package/dist/infrastructure/git/diff-parser.d.ts.map +1 -0
- package/dist/infrastructure/git/diff-parser.js +124 -0
- package/dist/infrastructure/git/diff-parser.js.map +1 -0
- package/dist/infrastructure/git/git-change-source.d.ts +13 -0
- package/dist/infrastructure/git/git-change-source.d.ts.map +1 -0
- package/dist/infrastructure/git/git-change-source.js +43 -0
- package/dist/infrastructure/git/git-change-source.js.map +1 -0
- package/dist/infrastructure/git/git-file-snapshot-source.d.ts +14 -0
- package/dist/infrastructure/git/git-file-snapshot-source.d.ts.map +1 -0
- package/dist/infrastructure/git/git-file-snapshot-source.js +87 -0
- package/dist/infrastructure/git/git-file-snapshot-source.js.map +1 -0
- package/dist/infrastructure/git/git-project-file-source.d.ts +16 -0
- package/dist/infrastructure/git/git-project-file-source.d.ts.map +1 -0
- package/dist/infrastructure/git/git-project-file-source.js +113 -0
- package/dist/infrastructure/git/git-project-file-source.js.map +1 -0
- package/dist/infrastructure/git/untracked-file-collector.d.ts +4 -0
- package/dist/infrastructure/git/untracked-file-collector.d.ts.map +1 -0
- package/dist/infrastructure/git/untracked-file-collector.js +52 -0
- package/dist/infrastructure/git/untracked-file-collector.js.map +1 -0
- package/dist/infrastructure/process/command-runner.d.ts +17 -0
- package/dist/infrastructure/process/command-runner.d.ts.map +1 -0
- package/dist/infrastructure/process/command-runner.js +35 -0
- package/dist/infrastructure/process/command-runner.js.map +1 -0
- package/dist/infrastructure/typescript/parse-typescript-source.d.ts +11 -0
- package/dist/infrastructure/typescript/parse-typescript-source.d.ts.map +1 -0
- package/dist/infrastructure/typescript/parse-typescript-source.js +31 -0
- package/dist/infrastructure/typescript/parse-typescript-source.js.map +1 -0
- package/dist/infrastructure/typescript/typescript-code-structure-extractor.d.ts +7 -0
- package/dist/infrastructure/typescript/typescript-code-structure-extractor.d.ts.map +1 -0
- package/dist/infrastructure/typescript/typescript-code-structure-extractor.js +80 -0
- package/dist/infrastructure/typescript/typescript-code-structure-extractor.js.map +1 -0
- package/dist/infrastructure/typescript/typescript-module-reference-extractor.d.ts +7 -0
- package/dist/infrastructure/typescript/typescript-module-reference-extractor.d.ts.map +1 -0
- package/dist/infrastructure/typescript/typescript-module-reference-extractor.js +37 -0
- package/dist/infrastructure/typescript/typescript-module-reference-extractor.js.map +1 -0
- package/dist/infrastructure/typescript/typescript-symbol-extractor.d.ts +7 -0
- package/dist/infrastructure/typescript/typescript-symbol-extractor.d.ts.map +1 -0
- package/dist/infrastructure/typescript/typescript-symbol-extractor.js +206 -0
- package/dist/infrastructure/typescript/typescript-symbol-extractor.js.map +1 -0
- package/dist/presentation/analyze-repository.d.ts +10 -0
- package/dist/presentation/analyze-repository.d.ts.map +1 -0
- package/dist/presentation/analyze-repository.js +55 -0
- package/dist/presentation/analyze-repository.js.map +1 -0
- package/dist/presentation/cli/arguments.d.ts +26 -0
- package/dist/presentation/cli/arguments.d.ts.map +1 -0
- package/dist/presentation/cli/arguments.js +120 -0
- package/dist/presentation/cli/arguments.js.map +1 -0
- package/dist/presentation/cli/failure-policy.d.ts +3 -0
- package/dist/presentation/cli/failure-policy.d.ts.map +1 -0
- package/dist/presentation/cli/failure-policy.js +5 -0
- package/dist/presentation/cli/failure-policy.js.map +1 -0
- package/dist/presentation/cli/main.d.ts +3 -0
- package/dist/presentation/cli/main.d.ts.map +1 -0
- package/dist/presentation/cli/main.js +71 -0
- package/dist/presentation/cli/main.js.map +1 -0
- package/dist/presentation/cli/report-file-writer.d.ts +3 -0
- package/dist/presentation/cli/report-file-writer.d.ts.map +1 -0
- package/dist/presentation/cli/report-file-writer.js +9 -0
- package/dist/presentation/cli/report-file-writer.js.map +1 -0
- package/dist/presentation/cli/report-formatter.d.ts +5 -0
- package/dist/presentation/cli/report-formatter.d.ts.map +1 -0
- package/dist/presentation/cli/report-formatter.js +14 -0
- package/dist/presentation/cli/report-formatter.js.map +1 -0
- package/dist/presentation/cli/text-report.d.ts +3 -0
- package/dist/presentation/cli/text-report.d.ts.map +1 -0
- package/dist/presentation/cli/text-report.js +151 -0
- package/dist/presentation/cli/text-report.js.map +1 -0
- package/dist/presentation/github/action-inputs.d.ts +14 -0
- package/dist/presentation/github/action-inputs.d.ts.map +1 -0
- package/dist/presentation/github/action-inputs.js +24 -0
- package/dist/presentation/github/action-inputs.js.map +1 -0
- package/dist/presentation/github/action-main.d.ts +3 -0
- package/dist/presentation/github/action-main.d.ts.map +1 -0
- package/dist/presentation/github/action-main.js +20 -0
- package/dist/presentation/github/action-main.js.map +1 -0
- package/dist/presentation/github/action-runtime.d.ts +22 -0
- package/dist/presentation/github/action-runtime.d.ts.map +1 -0
- package/dist/presentation/github/action-runtime.js +58 -0
- package/dist/presentation/github/action-runtime.js.map +1 -0
- package/dist/presentation/github/comparison.d.ts +11 -0
- package/dist/presentation/github/comparison.d.ts.map +1 -0
- package/dist/presentation/github/comparison.js +35 -0
- package/dist/presentation/github/comparison.js.map +1 -0
- package/dist/presentation/github/markdown-summary.d.ts +4 -0
- package/dist/presentation/github/markdown-summary.d.ts.map +1 -0
- package/dist/presentation/github/markdown-summary.js +47 -0
- package/dist/presentation/github/markdown-summary.js.map +1 -0
- package/dist/presentation/github/run-action.d.ts +7 -0
- package/dist/presentation/github/run-action.d.ts.map +1 -0
- package/dist/presentation/github/run-action.js +81 -0
- package/dist/presentation/github/run-action.js.map +1 -0
- package/dist/presentation/html/html-report.d.ts +4 -0
- package/dist/presentation/html/html-report.d.ts.map +1 -0
- package/dist/presentation/html/html-report.js +362 -0
- package/dist/presentation/html/html-report.js.map +1 -0
- package/package.json +52 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 IntentPatch contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,453 @@
|
|
|
1
|
-
#
|
|
1
|
+
# IntentPatch
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/xx2xxjaeil/intent-patch/actions/workflows/ci.yml)
|
|
4
|
+
|
|
5
|
+
> AI 코딩 에이전트가 만든 변경을 근거 중심으로 분석하는 오픈소스 도구
|
|
6
|
+
|
|
7
|
+
Codex, Claude Code, Cursor 같은 AI 코딩 에이전트는 짧은 요청만으로 여러 파일을 빠르게
|
|
8
|
+
수정합니다. 하지만 변경된 파일이 많아질수록 다음 질문에 답하기 어려워집니다.
|
|
9
|
+
|
|
10
|
+
- 요청한 범위보다 많은 파일을 수정하지 않았는가?
|
|
11
|
+
- 기존 코드를 재사용하지 않고 비슷한 로직을 새로 만들지 않았는가?
|
|
12
|
+
- 불필요한 라이브러리나 추상화를 추가하지 않았는가?
|
|
13
|
+
- 이번 변경이 다른 모듈에 어디까지 영향을 주는가?
|
|
14
|
+
- 중요한 동작에 대한 테스트가 함께 추가되었는가?
|
|
15
|
+
|
|
16
|
+
IntentPatch는 이러한 질문에 답하기 위해 **Git diff, 정적 분석, 의존 관계 분석**을 결합합니다.
|
|
17
|
+
LLM 없이도 재현 가능한 분석을 제공하고, AI 설명 기능은 선택적으로 결합하는 것을 목표로
|
|
18
|
+
합니다.
|
|
19
|
+
|
|
20
|
+
## 빠른 시작
|
|
21
|
+
|
|
22
|
+
Node.js 20 이상과 Git이 설치되어 있어야 합니다. 현재 npm 공개 전에는 저장소를 빌드해 바로
|
|
23
|
+
실행할 수 있습니다.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
git clone https://github.com/xx2xxjaeil/intent-patch.git
|
|
27
|
+
cd intent-patch
|
|
28
|
+
npm ci
|
|
29
|
+
npm run build
|
|
30
|
+
node dist/presentation/cli/main.js --version
|
|
31
|
+
node dist/presentation/cli/main.js analyze --cwd /path/to/repository
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
npm 릴리스가 공개된 뒤에는 설치 없이 같은 CLI를 실행할 수 있습니다.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx intentpatch analyze --cwd /path/to/repository
|
|
38
|
+
npx intentpatch analyze --format html --output intentpatch-report.html
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
핵심 분석에는 API key, 유료 AI 모델, 서버 또는 데이터베이스가 필요하지 않습니다. 분석할 Git
|
|
42
|
+
저장소의 파일은 로컬에서 처리하며 LLM 연결은 현재 기본 실행 경로에 포함되지 않습니다.
|
|
43
|
+
|
|
44
|
+
## GitHub Action
|
|
45
|
+
|
|
46
|
+
Pull Request에서 요청 범위와 위험 변경을 자동 검사할 수 있습니다. 정확한 base·head commit을
|
|
47
|
+
사용하도록 checkout의 전체 히스토리를 가져와야 합니다.
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
name: IntentPatch
|
|
51
|
+
|
|
52
|
+
on:
|
|
53
|
+
pull_request:
|
|
54
|
+
|
|
55
|
+
permissions:
|
|
56
|
+
contents: read
|
|
57
|
+
|
|
58
|
+
jobs:
|
|
59
|
+
analyze:
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
steps:
|
|
62
|
+
- uses: actions/checkout@v6
|
|
63
|
+
with:
|
|
64
|
+
fetch-depth: 0
|
|
65
|
+
|
|
66
|
+
- name: Analyze pull request
|
|
67
|
+
id: intentpatch
|
|
68
|
+
uses: xx2xxjaeil/intent-patch@main
|
|
69
|
+
with:
|
|
70
|
+
fail-on: high
|
|
71
|
+
|
|
72
|
+
- name: Upload reports
|
|
73
|
+
if: always()
|
|
74
|
+
uses: actions/upload-artifact@v4
|
|
75
|
+
with:
|
|
76
|
+
name: intentpatch-report
|
|
77
|
+
path: intentpatch-report
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
현재 개발 버전은 `@main`으로 실행합니다. 첫 번째 정식 릴리스 후에는 불변 SHA 또는 `@v1`
|
|
81
|
+
태그로 고정하는 방식을 권장합니다. Action은 PR·push 이벤트의 commit 범위를 자동으로
|
|
82
|
+
선택하고 다음 결과를 남깁니다.
|
|
83
|
+
|
|
84
|
+
- GitHub Actions Job Summary의 Markdown 보고서
|
|
85
|
+
- 심각도별 workflow annotation
|
|
86
|
+
- artifact 업로드에 사용할 JSON·HTML 보고서
|
|
87
|
+
- `high`, `medium`, `low` 기준의 품질 게이트
|
|
88
|
+
- finding 수와 보고서 경로 Action output
|
|
89
|
+
|
|
90
|
+
입력·출력과 이벤트별 비교 기준은 [GitHub Action 사용 문서](./docs/github-action.md)에서
|
|
91
|
+
확인할 수 있습니다.
|
|
92
|
+
|
|
93
|
+
## 프로젝트가 지향하는 결과
|
|
94
|
+
|
|
95
|
+
```text
|
|
96
|
+
IntentPatch Change Report
|
|
97
|
+
|
|
98
|
+
Target HEAD → working tree
|
|
99
|
+
Files changed 12
|
|
100
|
+
Lines +438 / -51
|
|
101
|
+
Direct dependents 2
|
|
102
|
+
Transitive impact 4
|
|
103
|
+
Tests changed 3
|
|
104
|
+
Missing test changes 1
|
|
105
|
+
New dependencies 2
|
|
106
|
+
Risky API changes 1
|
|
107
|
+
Duplicate candidates 1
|
|
108
|
+
Single implementations 1
|
|
109
|
+
|
|
110
|
+
Impacted files
|
|
111
|
+
|
|
112
|
+
→ direct src/api/delete-user.ts
|
|
113
|
+
changed: src/lib/auth.ts
|
|
114
|
+
→ transitive · 2 hops src/app.ts
|
|
115
|
+
changed: src/lib/auth.ts
|
|
116
|
+
|
|
117
|
+
Potential issues
|
|
118
|
+
|
|
119
|
+
HIGH 공개 함수 시그니처 호환성 파괴
|
|
120
|
+
MEDIUM 기존 인증 로직과 동일한 구현 발견
|
|
121
|
+
MEDIUM 요청과 관련성이 낮아 보이는 파일 4개 변경
|
|
122
|
+
LOW 구현체가 하나뿐인 추상화 추가
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
분석 결과는 단순한 경고 문구가 아니라 관련 파일, 규칙 ID, 판단 근거와 함께 제공하는 것을
|
|
126
|
+
원칙으로 합니다.
|
|
127
|
+
|
|
128
|
+
## 현재 구현된 기능
|
|
129
|
+
|
|
130
|
+
현재 버전은 Git 변경사항 수집, 루트 `package.json`의 직접 dependency 분석, TypeScript
|
|
131
|
+
최상위 심볼과 공개 API 변경 분석, 기존 구현 중복·단일 구현 추상화 신호, import graph 기반
|
|
132
|
+
영향 범위와 테스트 동반 변경 분석을 제공합니다.
|
|
133
|
+
|
|
134
|
+
- `HEAD`와 현재 working tree 비교
|
|
135
|
+
- 두 Git reference 또는 브랜치 비교
|
|
136
|
+
- 추가, 수정, 삭제, 이름 변경 등 파일 상태 분류
|
|
137
|
+
- 파일별 추가·삭제 라인 수 계산
|
|
138
|
+
- binary 파일 구분
|
|
139
|
+
- working tree 분석 시 untracked 파일 포함
|
|
140
|
+
- 터미널용 텍스트 보고서
|
|
141
|
+
- 후속 도구 연동을 위한 JSON 보고서
|
|
142
|
+
- 요약 카드, finding, 테스트 신호와 영향 그래프를 담은 단일 HTML 보고서
|
|
143
|
+
- 외부 CDN이나 JavaScript dependency가 필요 없는 인라인 CSS·SVG 시각화
|
|
144
|
+
- production·development dependency 추가 탐지
|
|
145
|
+
- dependency 삭제, 버전 변경, 섹션 이동 탐지
|
|
146
|
+
- 잘못된 `package.json`을 예외 대신 근거가 포함된 finding으로 보고
|
|
147
|
+
- finding 심각도(`high`, `medium`, `low`) 집계
|
|
148
|
+
- CI 품질 게이트를 위한 `--fail-on` 종료 코드
|
|
149
|
+
- 설치된 패키지 버전을 확인하는 `--version` 명령
|
|
150
|
+
- `.ts`·`.tsx` 파일의 최상위 함수·클래스·인터페이스·타입 별칭 추출
|
|
151
|
+
- 심볼 추가·수정·삭제 탐지와 소스 위치 표시
|
|
152
|
+
- 직접 `export`된 선언, 로컬 export 목록과 외부 re-export를 공개 심볼 근거에 보존
|
|
153
|
+
- 공개 심볼 삭제와 `export` 해제를 호환성 위험 `high` finding으로 탐지
|
|
154
|
+
- 공개 함수의 기존 호출 시그니처 제거와 공개 인터페이스의 호환성 파괴를 `high` finding으로 탐지
|
|
155
|
+
- 구현이 추가된 기존 overload는 제외하고 기존 overload가 사라진 경우만 함수 계약 변경으로 판정
|
|
156
|
+
- 공백과 주석을 제외한 구현 토큰이 같은 신규 함수와 기존 함수를 재사용 후보 `medium` finding으로 탐지
|
|
157
|
+
- 신규 인터페이스를 명시적으로 구현하는 클래스가 하나뿐이면 추상화 검토 `low` finding으로 탐지
|
|
158
|
+
- rename 전후 파일 경로를 사용한 심볼 비교
|
|
159
|
+
- 구문 오류가 있는 파일을 누락시키지 않고 분석 불가 근거로 보고
|
|
160
|
+
- `.ts`·`.tsx` 파일의 상대 경로 정적 import와 re-export 관계 수집
|
|
161
|
+
- `.js`·`.jsx`·`.mjs`·`.cjs` specifier를 대응하는 TypeScript 소스로 해석
|
|
162
|
+
- 변경 모듈을 import하는 직접 의존자와 여러 단계를 거친 간접 영향 파일 계산
|
|
163
|
+
- 해결하지 못한 상대 import와 읽기·파싱 실패를 분석 근거로 보존
|
|
164
|
+
- working tree의 tracked·untracked 파일 또는 지정한 head ref를 동일한 결과점에서 분석
|
|
165
|
+
- `.intentpatch.json`에 요청 의도, 예상 경로, 허용 경로와 변경량 예산 선언
|
|
166
|
+
- 예상·허용 패턴을 벗어난 변경 파일을 파일별 `medium` finding으로 탐지
|
|
167
|
+
- 변경 파일 수와 측정 라인 예산 초과를 수치 근거가 있는 `low` finding으로 탐지
|
|
168
|
+
- Contract가 지정한 소스·테스트 경로를 분류하고 파일명 기준으로 관련 변경 연결
|
|
169
|
+
- 테스트 변경 수와 추가·삭제 수를 별도의 분석 사실로 집계
|
|
170
|
+
- 관련 테스트 변경이 없는 소스 파일을 `medium` finding으로 탐지
|
|
171
|
+
- `*`, `**`, `?` 기반의 저장소 상대 경로 패턴 지원
|
|
172
|
+
- Pull Request·push commit 범위를 자동 판별하는 GitHub Action
|
|
173
|
+
- GitHub Job Summary, workflow annotation, JSON·HTML artifact용 보고서 생성
|
|
174
|
+
|
|
175
|
+
아직 lockfile의 전이 dependency 분석, path alias 해석, JavaScript·메서드 구조 분석과 AI 리뷰
|
|
176
|
+
기능은 구현되지 않았습니다.
|
|
177
|
+
|
|
178
|
+
## 상세 사용법
|
|
179
|
+
|
|
180
|
+
현재 저장소의 working tree를 분석합니다.
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
node dist/presentation/cli/main.js analyze
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
다른 Git 저장소를 분석할 수도 있습니다.
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
node dist/presentation/cli/main.js analyze --cwd /path/to/repository
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
두 브랜치를 비교합니다. 내부적으로 merge base 기준의 변경사항을 분석합니다.
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
node dist/presentation/cli/main.js analyze \
|
|
196
|
+
--cwd /path/to/repository \
|
|
197
|
+
--base main \
|
|
198
|
+
--head feature/account-deletion
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
JSON으로 출력합니다.
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
node dist/presentation/cli/main.js analyze --json
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
브라우저에서 볼 수 있는 HTML 보고서를 파일로 생성합니다.
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
node dist/presentation/cli/main.js analyze \
|
|
211
|
+
--format html \
|
|
212
|
+
--output intentpatch-report.html
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
HTML 파일에는 스타일과 dependency 영향 SVG 그래프가 모두 포함되므로 별도 서버나 API key 없이
|
|
216
|
+
바로 열 수 있습니다. `--output`은 텍스트와 JSON 형식에도 사용할 수 있으며 상대 경로는
|
|
217
|
+
IntentPatch를 실행한 현재 디렉터리를 기준으로 해석합니다. 기존 `--json`은
|
|
218
|
+
`--format json`의 단축 옵션입니다.
|
|
219
|
+
|
|
220
|
+
### Change Contract로 요청 범위 검사
|
|
221
|
+
|
|
222
|
+
분석할 저장소의 `.intentpatch.json`에 이번 요청의 기대 범위를 선언할 수 있습니다.
|
|
223
|
+
|
|
224
|
+
```json
|
|
225
|
+
{
|
|
226
|
+
"intent": "회원 탈퇴 기능 구현",
|
|
227
|
+
"scope": {
|
|
228
|
+
"include": ["src/user/**", "tests/user/**"],
|
|
229
|
+
"allow": ["package.json", "package-lock.json"],
|
|
230
|
+
"maxFiles": 8,
|
|
231
|
+
"maxLines": 300
|
|
232
|
+
},
|
|
233
|
+
"tests": {
|
|
234
|
+
"requireFor": ["src/**/*.ts", "src/**/*.tsx"],
|
|
235
|
+
"include": ["tests/**/*.test.ts", "tests/**/*.test.tsx"],
|
|
236
|
+
"exclude": ["src/**/*.d.ts"]
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
- `include`: 요청 수행 중 변경될 것으로 예상한 경로
|
|
242
|
+
- `allow`: 설정이나 lockfile처럼 함께 변경되어도 허용하는 예외 경로
|
|
243
|
+
- `maxFiles`: 변경 파일 수의 상한
|
|
244
|
+
- `maxLines`: 측정 가능한 추가·삭제 라인 합의 상한
|
|
245
|
+
- `tests.requireFor`: 테스트 동반 변경을 확인할 소스 경로
|
|
246
|
+
- `tests.include`: 테스트 파일로 분류할 경로
|
|
247
|
+
- `tests.exclude`: 생성 파일이나 선언 파일처럼 검사에서 제외할 소스 경로
|
|
248
|
+
|
|
249
|
+
테스트 연결은 결정적인 결과를 위해 파일명을 사용합니다. 예를 들어 `src/user.ts`는
|
|
250
|
+
`tests/user.test.ts`, `user.spec.ts`, `user.integration.test.ts` 같은 변경과 연결됩니다.
|
|
251
|
+
|
|
252
|
+
기본 파일 대신 별도 계약을 사용하려면 `--config`를 지정합니다. 상대 경로는 `--cwd`를 기준으로
|
|
253
|
+
해석합니다.
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
node dist/presentation/cli/main.js analyze \
|
|
257
|
+
--cwd /path/to/repository \
|
|
258
|
+
--config contracts/delete-user.json
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
복사해서 시작할 수 있는 설정은 [`.intentpatch.example.json`](./.intentpatch.example.json)에
|
|
262
|
+
있습니다. Contract가 없으면 기존 분석은 그대로 실행되고 scope 규칙만 비활성화됩니다.
|
|
263
|
+
|
|
264
|
+
지정한 심각도 이상의 finding이 있으면 보고서를 출력한 뒤 종료 코드 `1`을 반환합니다.
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
node dist/presentation/cli/main.js analyze --fail-on medium
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
`medium`은 `medium`과 `high` finding에 반응하며, `low`를 지정하면 모든 finding을 품질
|
|
271
|
+
게이트 대상으로 취급합니다. 잘못된 CLI 사용은 종료 코드 `2`를 반환합니다.
|
|
272
|
+
|
|
273
|
+
dependency 변경과 코드 영향 범위를 다음과 같이 근거와 함께 출력합니다.
|
|
274
|
+
|
|
275
|
+
```text
|
|
276
|
+
IntentPatch Change Report
|
|
277
|
+
|
|
278
|
+
Files changed 2
|
|
279
|
+
Changed symbols 2
|
|
280
|
+
Import edges 18
|
|
281
|
+
Direct dependents 1
|
|
282
|
+
Transitive impact 2
|
|
283
|
+
Tests changed 1
|
|
284
|
+
Tests added 0
|
|
285
|
+
Missing test changes 1
|
|
286
|
+
New dependencies 1
|
|
287
|
+
Risky API changes 1
|
|
288
|
+
Duplicate candidates 1
|
|
289
|
+
Single implementations 1
|
|
290
|
+
Findings 6
|
|
291
|
+
|
|
292
|
+
Changed symbols
|
|
293
|
+
|
|
294
|
+
M Class UserService src/user/service.ts:12
|
|
295
|
+
A Function deleteUser src/user/service.ts:48
|
|
296
|
+
|
|
297
|
+
Impacted files
|
|
298
|
+
|
|
299
|
+
→ direct src/api/delete-user.ts
|
|
300
|
+
changed: src/user/service.ts
|
|
301
|
+
→ transitive · 2 hops src/app.ts
|
|
302
|
+
changed: src/user/service.ts
|
|
303
|
+
|
|
304
|
+
Potential issues
|
|
305
|
+
|
|
306
|
+
HIGH Public export removed
|
|
307
|
+
src/user/service.ts · api/export-removed
|
|
308
|
+
The function deleteUser is no longer exported.
|
|
309
|
+
|
|
310
|
+
MEDIUM New production dependency
|
|
311
|
+
package.json · dependency/new-production
|
|
312
|
+
dayjs@^1.11.0 was added to dependencies.
|
|
313
|
+
|
|
314
|
+
MEDIUM Change outside expected scope
|
|
315
|
+
src/payment/billing.ts · scope/outside-expected-path
|
|
316
|
+
src/payment/billing.ts does not match any expected or allowed path pattern.
|
|
317
|
+
|
|
318
|
+
MEDIUM Source change without matching test change
|
|
319
|
+
src/payment/billing.ts · tests/missing-related-change
|
|
320
|
+
src/payment/billing.ts changed without a changed test sharing the same basename.
|
|
321
|
+
|
|
322
|
+
MEDIUM New function duplicates existing implementation
|
|
323
|
+
src/user/service.ts · structure/duplicate-implementation
|
|
324
|
+
The new function verifySession has the same normalized implementation as authorize.
|
|
325
|
+
|
|
326
|
+
LOW New interface has one implementation
|
|
327
|
+
src/user/service.ts · structure/single-implementation-abstraction
|
|
328
|
+
The new interface DeletionStrategy is implemented only by DefaultDeletionStrategy.
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
개발 중에는 빌드 없이 실행할 수 있습니다.
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
npm run dev -- analyze --cwd /path/to/repository
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## 아키텍처
|
|
338
|
+
|
|
339
|
+
기능이 늘어나도 Git, UI, 분석 규칙이 서로 강하게 결합되지 않도록 클린 아키텍처의 의존성
|
|
340
|
+
방향을 적용했습니다.
|
|
341
|
+
|
|
342
|
+
```text
|
|
343
|
+
presentation ───────▶ application ───────▶ domain
|
|
344
|
+
│ ▲
|
|
345
|
+
└──▶ infrastructure ──┘
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
| 계층 | 책임 |
|
|
349
|
+
| --- | --- |
|
|
350
|
+
| `domain` | 변경 파일, Change Contract, finding, 심볼 변경, dependency 영향 등 핵심 모델 |
|
|
351
|
+
| `application` | 분석 유스케이스, 규칙 엔진, 심볼·영향 계산과 외부 데이터 포트 |
|
|
352
|
+
| `infrastructure` | Git 명령·diff 파싱·프로젝트 파일 공급·TypeScript AST 파싱 |
|
|
353
|
+
| `presentation` | CLI 인자 처리, 의존성 조립, 텍스트·JSON·HTML 출력 |
|
|
354
|
+
|
|
355
|
+
하위 계층이 외부 구현을 참조하지 않도록 아키텍처 테스트가 import 방향을 검사합니다.
|
|
356
|
+
구현상의 주요 판단과 확장 지점은 [상세 아키텍처 문서](./docs/architecture.md)에서 설명합니다.
|
|
357
|
+
|
|
358
|
+
## 설계 원칙
|
|
359
|
+
|
|
360
|
+
- **Deterministic first:** 핵심 분석은 동일한 입력에 동일한 결과를 반환합니다.
|
|
361
|
+
- **Evidence over claims:** 확실하지 않은 판단을 사실처럼 단정하지 않습니다.
|
|
362
|
+
- **LLM optional:** AI 연결 없이도 기본 분석 기능을 사용할 수 있어야 합니다.
|
|
363
|
+
- **Dependency minimalism:** 편의를 위한 라이브러리를 무분별하게 추가하지 않습니다.
|
|
364
|
+
- **Explicit boundaries:** 도메인 로직과 Git·CLI 같은 외부 기술을 분리합니다.
|
|
365
|
+
|
|
366
|
+
## 테스트와 품질 검사
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
npm run check
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
위 명령은 다음 검사를 순서대로 실행합니다.
|
|
373
|
+
|
|
374
|
+
- 엄격한 TypeScript 타입 검사
|
|
375
|
+
- Biome 린트 및 포맷 검사
|
|
376
|
+
- 도메인과 유스케이스 단위 테스트
|
|
377
|
+
- 실제 임시 Git 저장소를 사용하는 통합 테스트
|
|
378
|
+
- 생성한 npm tarball을 임시 프로젝트에 설치하고 실행하는 패키지 통합 테스트
|
|
379
|
+
- 계층 간 의존 방향을 검증하는 아키텍처 테스트
|
|
380
|
+
|
|
381
|
+
프로덕션 빌드만 확인하려면 다음 명령을 사용합니다.
|
|
382
|
+
|
|
383
|
+
```bash
|
|
384
|
+
npm run build
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
npm에 포함될 파일과 패키지 생성을 확인하려면 실제 공개 없이 dry-run을 실행합니다.
|
|
388
|
+
|
|
389
|
+
```bash
|
|
390
|
+
npm pack --dry-run
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
## 로드맵
|
|
394
|
+
|
|
395
|
+
1. ✅ `package.json` 직접 dependency 변경 탐지와 규칙 엔진
|
|
396
|
+
2. ✅ TypeScript AST 기반 함수·클래스·인터페이스·타입 변경 분석
|
|
397
|
+
3. ✅ 상대 경로 정적 import graph 기반 변경 영향 범위 계산
|
|
398
|
+
4. ✅ Change Contract 기반 예상 범위 이탈과 변경량 예산 탐지
|
|
399
|
+
5. ✅ Contract 기반 관련 테스트 변경 누락 탐지
|
|
400
|
+
6. lockfile과 workspace를 고려한 package manager adapter
|
|
401
|
+
7. ✅ 직접 export된 공개 심볼 삭제와 export 해제 탐지
|
|
402
|
+
8. ✅ 단일 HTML 대시보드와 SVG 기반 dependency 영향 그래프
|
|
403
|
+
9. ✅ re-export·함수/인터페이스 호환성과 기존 코드 중복 가능성 탐지
|
|
404
|
+
10. ✅ 구현체가 하나뿐인 신규 인터페이스 탐지
|
|
405
|
+
11. ✅ PR·push 비교, Job Summary와 artifact 출력을 제공하는 GitHub Action
|
|
406
|
+
12. Codex·Claude Code·Cursor adapter
|
|
407
|
+
13. 근거 기반 결과에 대한 선택적 LLM 설명
|
|
408
|
+
|
|
409
|
+
## 현재 제한사항
|
|
410
|
+
|
|
411
|
+
- 분석 대상은 최소 한 번 이상 커밋된 Git 저장소여야 합니다.
|
|
412
|
+
- untracked symbolic link는 안전을 위해 내용을 읽지 않습니다.
|
|
413
|
+
- 10 MiB를 초과하는 untracked 파일은 라인 수를 측정하지 않습니다.
|
|
414
|
+
- dependency 분석은 저장소 루트의 npm `package.json`에 선언된 `dependencies`와
|
|
415
|
+
`devDependencies`를 대상으로 합니다.
|
|
416
|
+
- lockfile의 전이 dependency, workspace package, 코드에서의 실제 사용 여부는 아직 분석하지 않습니다.
|
|
417
|
+
- 심볼 분석은 `.ts`와 `.tsx`의 이름이 있는 최상위 함수, 클래스, 인터페이스, 타입
|
|
418
|
+
별칭만 지원합니다.
|
|
419
|
+
- 공개 API 분석은 이름이 있는 최상위 함수·인터페이스, 로컬 `export { name }`, 외부
|
|
420
|
+
`export { name } from`, `export * from`을 지원합니다. package `exports`, 익명 default export,
|
|
421
|
+
클래스·타입 별칭의 세부 계약은 아직 해석하지 않습니다.
|
|
422
|
+
- 함수 호환성은 명시된 파라미터·반환 타입 텍스트를 비교합니다. 추론된 반환 타입 변화나
|
|
423
|
+
TypeScript의 구조적 타입 할당 가능성까지 판정하지 않습니다.
|
|
424
|
+
- 중복 구현 후보는 새로 추가된 최상위 함수와 기존 최상위 함수의 토큰이 공백·주석을 제외하고
|
|
425
|
+
완전히 같으며 본문이 12토큰 이상일 때만 보고합니다. 식별자 이름이 바뀐 유사 코드, 메서드,
|
|
426
|
+
의미적으로만 같은 구현은 탐지하지 않습니다.
|
|
427
|
+
- 단일 구현 추상화는 새 인터페이스를 `implements`로 명시한 이름 있는 클래스가 정확히 하나일 때만
|
|
428
|
+
보고합니다. TypeScript의 구조적 구현, factory 반환 타입과 런타임 등록은 계산하지 않습니다.
|
|
429
|
+
- 메서드, 변수 선언, enum, 중첩 선언, JavaScript 파일은 아직 심볼 분석 대상이 아닙니다.
|
|
430
|
+
- 선언 내부의 포맷이나 주석 변경도 심볼 수정으로 집계될 수 있습니다.
|
|
431
|
+
- 영향 분석은 `.ts`·`.tsx` 파일의 상대 경로 정적 `import`, side-effect import,
|
|
432
|
+
`export ... from`, `import = require()`를 대상으로 합니다.
|
|
433
|
+
- 외부 package import는 그래프에서 제외하며 path alias, dynamic `import()`, 일반 `require()`는
|
|
434
|
+
아직 해석하지 않습니다.
|
|
435
|
+
- 영향 그래프는 비교 결과점(working tree 또는 head ref)의 파일을 기준으로 만듭니다. 따라서
|
|
436
|
+
삭제된 모듈을 가리키던 과거 import의 영향은 현재 단계에서 계산할 수 없습니다.
|
|
437
|
+
- 영향 분석용 소스 파일은 파일당 1 MiB로 제한하며, symbolic link는 읽지 않습니다.
|
|
438
|
+
- IntentPatch는 자연어 intent만으로 예상 경로를 추측하지 않습니다. 범위 판단은 Contract에 명시한
|
|
439
|
+
`include`와 `allow`를 기준으로 수행합니다.
|
|
440
|
+
- 경로 패턴은 저장소 상대 경로와 `*`, `**`, `?`만 지원합니다. 부정 패턴과 brace 확장은 아직
|
|
441
|
+
지원하지 않습니다.
|
|
442
|
+
- `maxLines`는 측정 가능한 텍스트 파일의 추가·삭제 라인만 합산합니다. Binary와 측정 불가 파일을
|
|
443
|
+
0줄이라고 간주하지 않지만, 해당 파일의 크기를 라인 예산에 포함하지도 않습니다.
|
|
444
|
+
- 테스트 분석은 실행 결과나 코드 커버리지를 측정하지 않고 Contract에 지정된 변경 파일만
|
|
445
|
+
비교합니다.
|
|
446
|
+
- 관련 테스트는 현재 소스와 테스트의 파일명이 같은지로 판단하므로 이름이 다른 통합 테스트나
|
|
447
|
+
하나의 테스트가 여러 소스를 검증하는 관계는 자동으로 연결하지 못합니다.
|
|
448
|
+
- HTML 영향 그래프는 변경 모듈과 영향 파일을 결정적인 두 열 레이아웃으로 표시합니다. 노드 이동,
|
|
449
|
+
확대·축소와 필터링을 제공하는 대화형 웹 UI는 아직 구현하지 않았습니다.
|
|
450
|
+
|
|
451
|
+
## 라이선스
|
|
452
|
+
|
|
453
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ChangeSet } from "../../domain/change.js";
|
|
2
|
+
import type { ChangeContract } from "../../domain/change-contract.js";
|
|
3
|
+
import type { CodeStructureAnalysis } from "../../domain/code-structure.js";
|
|
4
|
+
import type { Finding } from "../../domain/finding.js";
|
|
5
|
+
import type { AnalysisTarget } from "../../domain/report.js";
|
|
6
|
+
import type { SymbolChangeSet } from "../../domain/symbol-change.js";
|
|
7
|
+
import type { TestChangeAnalysis } from "../../domain/test-change.js";
|
|
8
|
+
export interface AnalysisContext {
|
|
9
|
+
readonly target: AnalysisTarget;
|
|
10
|
+
readonly changes: ChangeSet;
|
|
11
|
+
readonly contract?: ChangeContract;
|
|
12
|
+
readonly testChanges?: TestChangeAnalysis;
|
|
13
|
+
readonly symbolChanges?: SymbolChangeSet;
|
|
14
|
+
readonly codeStructure?: CodeStructureAnalysis;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 하나의 분석 관점을 캡슐화하는 규칙이다.
|
|
18
|
+
* 규칙은 외부 기술을 직접 호출하지 않고 필요한 포트를 생성자로 주입받는다.
|
|
19
|
+
*/
|
|
20
|
+
export interface AnalysisRule {
|
|
21
|
+
analyze(context: AnalysisContext): Promise<readonly Finding[]>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=analysis-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analysis-rule.d.ts","sourceRoot":"","sources":["../../../src/application/ports/analysis-rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IAC1C,QAAQ,CAAC,aAAa,CAAC,EAAE,eAAe,CAAC;IACzC,QAAQ,CAAC,aAAa,CAAC,EAAE,qBAAqB,CAAC;CAChD;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;CAChE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analysis-rule.js","sourceRoot":"","sources":["../../../src/application/ports/analysis-rule.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ImpactAnalysis } from "../../domain/impact.js";
|
|
2
|
+
import type { AnalysisContext } from "./analysis-rule.js";
|
|
3
|
+
export interface ChangeImpactAnalyzer {
|
|
4
|
+
analyze(context: AnalysisContext): Promise<ImpactAnalysis>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=change-impact-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-impact-analyzer.d.ts","sourceRoot":"","sources":["../../../src/application/ports/change-impact-analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-impact-analyzer.js","sourceRoot":"","sources":["../../../src/application/ports/change-impact-analyzer.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ChangeSet } from "../../domain/change.js";
|
|
2
|
+
import type { AnalysisTarget } from "../../domain/report.js";
|
|
3
|
+
/**
|
|
4
|
+
* 변경사항을 가져오는 출력 포트다.
|
|
5
|
+
* 애플리케이션 계층은 이 인터페이스만 알기 때문에 Git 외의 데이터 소스도 교체할 수 있다.
|
|
6
|
+
*/
|
|
7
|
+
export interface ChangeSource {
|
|
8
|
+
collect(target: AnalysisTarget): Promise<ChangeSet>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=change-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-source.d.ts","sourceRoot":"","sources":["../../../src/application/ports/change-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-source.js","sourceRoot":"","sources":["../../../src/application/ports/change-source.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CodeStructureAnalysis } from "../../domain/code-structure.js";
|
|
2
|
+
import type { AnalysisContext } from "./analysis-rule.js";
|
|
3
|
+
export interface CodeStructureAnalyzer {
|
|
4
|
+
analyze(context: AnalysisContext): Promise<CodeStructureAnalysis>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=code-structure-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-structure-analyzer.d.ts","sourceRoot":"","sources":["../../../src/application/ports/code-structure-analyzer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CACnE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-structure-analyzer.js","sourceRoot":"","sources":["../../../src/application/ports/code-structure-analyzer.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface FunctionImplementationFact {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
readonly line: number;
|
|
4
|
+
readonly implementationFingerprint: string;
|
|
5
|
+
readonly tokenCount: number;
|
|
6
|
+
}
|
|
7
|
+
export interface InterfaceDeclarationFact {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly line: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ClassImplementationFact {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly line: number;
|
|
14
|
+
readonly implementedTypes: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
export interface CodeStructureFacts {
|
|
17
|
+
readonly functions: readonly FunctionImplementationFact[];
|
|
18
|
+
readonly interfaces: readonly InterfaceDeclarationFact[];
|
|
19
|
+
readonly classes: readonly ClassImplementationFact[];
|
|
20
|
+
}
|
|
21
|
+
export type CodeStructureExtractionResult = Readonly<{
|
|
22
|
+
kind: "success";
|
|
23
|
+
facts: CodeStructureFacts;
|
|
24
|
+
}> | Readonly<{
|
|
25
|
+
kind: "unavailable";
|
|
26
|
+
reason: string;
|
|
27
|
+
}>;
|
|
28
|
+
/** 언어별 소스에서 구조 신호에 필요한 최소 사실만 추출하는 입력 포트다. */
|
|
29
|
+
export interface CodeStructureExtractor {
|
|
30
|
+
supports(path: string): boolean;
|
|
31
|
+
extract(path: string, source: string): CodeStructureExtractionResult;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=code-structure-extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-structure-extractor.d.ts","sourceRoot":"","sources":["../../../src/application/ports/code-structure-extractor.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,yBAAyB,EAAE,MAAM,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,SAAS,0BAA0B,EAAE,CAAC;IAC1D,QAAQ,CAAC,UAAU,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACzD,QAAQ,CAAC,OAAO,EAAE,SAAS,uBAAuB,EAAE,CAAC;CACtD;AAED,MAAM,MAAM,6BAA6B,GACrC,QAAQ,CAAC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,kBAAkB,CAAA;CAAE,CAAC,GACxD,QAAQ,CAAC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEtD,8CAA8C;AAC9C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,6BAA6B,CAAC;CACtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-structure-extractor.js","sourceRoot":"","sources":["../../../src/application/ports/code-structure-extractor.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AnalysisTarget } from "../../domain/report.js";
|
|
2
|
+
export interface TextFileSnapshot {
|
|
3
|
+
readonly before?: string;
|
|
4
|
+
readonly after?: string;
|
|
5
|
+
}
|
|
6
|
+
/** 분석 기준점과 결과점에서 동일한 텍스트 파일을 읽는 출력 포트다. */
|
|
7
|
+
export interface FileSnapshotSource {
|
|
8
|
+
read(target: AnalysisTarget, path: string, basePath?: string): Promise<TextFileSnapshot>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=file-snapshot-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-snapshot-source.d.ts","sourceRoot":"","sources":["../../../src/application/ports/file-snapshot-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC1F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-snapshot-source.js","sourceRoot":"","sources":["../../../src/application/ports/file-snapshot-source.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ModuleReferenceExtractionResult = Readonly<{
|
|
2
|
+
kind: "success";
|
|
3
|
+
specifiers: readonly string[];
|
|
4
|
+
}> | Readonly<{
|
|
5
|
+
kind: "unavailable";
|
|
6
|
+
reason: string;
|
|
7
|
+
}>;
|
|
8
|
+
/** 소스 파일에서 정적 module specifier를 추출하는 언어별 출력 포트다. */
|
|
9
|
+
export interface ModuleReferenceExtractor {
|
|
10
|
+
supports(path: string): boolean;
|
|
11
|
+
extract(path: string, source: string): ModuleReferenceExtractionResult;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=module-reference-extractor.d.ts.map
|