intentpatch 0.0.0-stage → 0.1.1
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.ko.md +470 -0
- package/README.md +436 -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 +57 -4
package/README.md
CHANGED
|
@@ -1,3 +1,437 @@
|
|
|
1
|
-
#
|
|
1
|
+
# IntentPatch
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**English** | [한국어](./README.ko.md)
|
|
4
|
+
|
|
5
|
+
[](https://github.com/xx2xxjaeil/intent-patch/actions/workflows/ci.yml)
|
|
6
|
+
|
|
7
|
+
> Evidence-based change-scope analysis for code written by AI coding agents
|
|
8
|
+
|
|
9
|
+
AI coding agents such as Codex, Claude Code, and Cursor can change many files from a short request. As the patch grows, it becomes harder to answer a few important questions:
|
|
10
|
+
|
|
11
|
+
- Did the agent change files outside the requested scope?
|
|
12
|
+
- Did it recreate logic that already existed?
|
|
13
|
+
- Did it add an unnecessary dependency or abstraction?
|
|
14
|
+
- How far can the change affect other modules?
|
|
15
|
+
- Were relevant tests changed with the production code?
|
|
16
|
+
|
|
17
|
+
IntentPatch combines **Git diff analysis, static analysis, and dependency analysis** to answer those questions. Its core analysis is deterministic and works without an LLM. Optional AI explanations can be added later without making the core tool dependent on a model provider.
|
|
18
|
+
|
|
19
|
+
## Quick start
|
|
20
|
+
|
|
21
|
+
IntentPatch requires Node.js 20 or later and Git. Until the first public npm release is approved, build and run it directly from the repository:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/xx2xxjaeil/intent-patch.git
|
|
25
|
+
cd intent-patch
|
|
26
|
+
npm ci
|
|
27
|
+
npm run build
|
|
28
|
+
node dist/presentation/cli/main.js --version
|
|
29
|
+
node dist/presentation/cli/main.js analyze --cwd /path/to/repository
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
After the npm release becomes public, run the same CLI without installing it globally:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx intentpatch analyze --cwd /path/to/repository
|
|
36
|
+
npx intentpatch analyze --format html --output intentpatch-report.html
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The core analyzer needs no API key, paid AI model, server, or database. Repository files are processed locally, and no LLM is used in the default execution path.
|
|
40
|
+
|
|
41
|
+
## GitHub Action
|
|
42
|
+
|
|
43
|
+
Use IntentPatch in pull requests to check scope and risky changes automatically. The checkout must include the full Git history so the action can compare the exact base and head commits.
|
|
44
|
+
|
|
45
|
+
```yaml
|
|
46
|
+
name: IntentPatch
|
|
47
|
+
|
|
48
|
+
on:
|
|
49
|
+
pull_request:
|
|
50
|
+
|
|
51
|
+
permissions:
|
|
52
|
+
contents: read
|
|
53
|
+
|
|
54
|
+
jobs:
|
|
55
|
+
analyze:
|
|
56
|
+
runs-on: ubuntu-latest
|
|
57
|
+
steps:
|
|
58
|
+
- uses: actions/checkout@v6
|
|
59
|
+
with:
|
|
60
|
+
fetch-depth: 0
|
|
61
|
+
|
|
62
|
+
- name: Analyze pull request
|
|
63
|
+
id: intentpatch
|
|
64
|
+
uses: xx2xxjaeil/intent-patch@main
|
|
65
|
+
with:
|
|
66
|
+
fail-on: high
|
|
67
|
+
|
|
68
|
+
- name: Upload reports
|
|
69
|
+
if: always()
|
|
70
|
+
uses: actions/upload-artifact@v4
|
|
71
|
+
with:
|
|
72
|
+
name: intentpatch-report
|
|
73
|
+
path: intentpatch-report
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The development version currently runs from `@main`. After the first stable release, pin the action to an immutable commit SHA or a major tag such as `@v1`.
|
|
77
|
+
|
|
78
|
+
The action detects the comparison range for pull request and push events and produces:
|
|
79
|
+
|
|
80
|
+
- a Markdown report in the GitHub Actions Job Summary;
|
|
81
|
+
- workflow annotations grouped by severity;
|
|
82
|
+
- JSON and HTML reports that can be uploaded as artifacts;
|
|
83
|
+
- a quality gate at the `high`, `medium`, or `low` threshold;
|
|
84
|
+
- action outputs containing finding counts and report paths.
|
|
85
|
+
|
|
86
|
+
See the [GitHub Action guide](./docs/github-action.md) for inputs, outputs, and event-specific comparison behavior.
|
|
87
|
+
|
|
88
|
+
## What the report looks like
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
IntentPatch Change Report
|
|
92
|
+
|
|
93
|
+
Target HEAD → working tree
|
|
94
|
+
Files changed 12
|
|
95
|
+
Lines +438 / -51
|
|
96
|
+
Direct dependents 2
|
|
97
|
+
Transitive impact 4
|
|
98
|
+
Tests changed 3
|
|
99
|
+
Missing test changes 1
|
|
100
|
+
New dependencies 2
|
|
101
|
+
Risky API changes 1
|
|
102
|
+
Duplicate candidates 1
|
|
103
|
+
Single implementations 1
|
|
104
|
+
|
|
105
|
+
Impacted files
|
|
106
|
+
|
|
107
|
+
→ direct src/api/delete-user.ts
|
|
108
|
+
changed: src/lib/auth.ts
|
|
109
|
+
→ transitive · 2 hops src/app.ts
|
|
110
|
+
changed: src/lib/auth.ts
|
|
111
|
+
|
|
112
|
+
Potential issues
|
|
113
|
+
|
|
114
|
+
HIGH Breaking change to a public function signature
|
|
115
|
+
MEDIUM Implementation duplicates existing authentication logic
|
|
116
|
+
MEDIUM Four files changed outside the expected scope
|
|
117
|
+
LOW New abstraction has only one implementation
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Every finding includes the relevant file, a stable rule ID, and evidence for the decision instead of only presenting an unexplained warning.
|
|
121
|
+
|
|
122
|
+
## Implemented capabilities
|
|
123
|
+
|
|
124
|
+
The current version analyzes Git changes, direct dependencies in the root `package.json`, top-level TypeScript symbols and public API changes, possible duplicate implementations, single-implementation abstractions, import-graph impact, and related test changes.
|
|
125
|
+
|
|
126
|
+
### Git and reporting
|
|
127
|
+
|
|
128
|
+
- Compare `HEAD` with the current working tree.
|
|
129
|
+
- Compare two Git references or branches from their merge base.
|
|
130
|
+
- Classify added, modified, deleted, and renamed files.
|
|
131
|
+
- Count added and deleted lines per file.
|
|
132
|
+
- Distinguish binary files.
|
|
133
|
+
- Include untracked files in working-tree analysis.
|
|
134
|
+
- Render terminal-friendly text and machine-readable JSON reports.
|
|
135
|
+
- Generate a standalone HTML report containing summary cards, findings, test signals, and an impact graph.
|
|
136
|
+
- Render the visualization with inline CSS and SVG, without a CDN or runtime JavaScript dependency.
|
|
137
|
+
- Aggregate findings by `high`, `medium`, and `low` severity.
|
|
138
|
+
- Return a CI-friendly exit code through `--fail-on`.
|
|
139
|
+
- Print the installed package version through `--version`.
|
|
140
|
+
|
|
141
|
+
### Dependencies and TypeScript structure
|
|
142
|
+
|
|
143
|
+
- Detect additions to production and development dependencies.
|
|
144
|
+
- Detect dependency removal, version changes, and section moves.
|
|
145
|
+
- Report malformed `package.json` files as evidence-backed findings instead of crashing.
|
|
146
|
+
- Extract top-level named functions, classes, interfaces, and type aliases from `.ts` and `.tsx` files.
|
|
147
|
+
- Detect symbol additions, modifications, and removals with source locations.
|
|
148
|
+
- Preserve direct exports, local export lists, and external re-exports as public-symbol evidence.
|
|
149
|
+
- Report removed public symbols and removed exports as high-severity compatibility risks.
|
|
150
|
+
- Detect removed public function call signatures and incompatible public interface changes.
|
|
151
|
+
- Exclude overloads that only gain an implementation while reporting previously available overloads that disappear.
|
|
152
|
+
- Find newly added functions whose normalized implementation matches an existing function.
|
|
153
|
+
- Report a newly added interface when exactly one class explicitly implements it.
|
|
154
|
+
- Compare symbols correctly across renamed files.
|
|
155
|
+
- Preserve syntax errors as analysis evidence instead of silently dropping a file.
|
|
156
|
+
|
|
157
|
+
### Impact, scope, and tests
|
|
158
|
+
|
|
159
|
+
- Build relative static import and re-export relationships for `.ts` and `.tsx` files.
|
|
160
|
+
- Resolve `.js`, `.jsx`, `.mjs`, and `.cjs` import specifiers to matching TypeScript sources.
|
|
161
|
+
- Calculate direct importers and transitively impacted files for changed modules.
|
|
162
|
+
- Preserve unresolved relative imports and file read or parse failures as evidence.
|
|
163
|
+
- Build the graph at the same result point as the diff: the working tree or the selected head ref.
|
|
164
|
+
- Read intent, expected paths, allowed paths, and change budgets from `.intentpatch.json`.
|
|
165
|
+
- Report each file outside expected and allowed patterns as a medium-severity finding.
|
|
166
|
+
- Report file-count and measurable-line budget overruns with numeric evidence.
|
|
167
|
+
- Classify source and test paths declared by the contract and connect related changes by basename.
|
|
168
|
+
- Report test file counts and added or deleted tests as separate facts.
|
|
169
|
+
- Report source files without a related test change as medium-severity findings.
|
|
170
|
+
- Support repository-relative `*`, `**`, and `?` path patterns.
|
|
171
|
+
|
|
172
|
+
Lockfile transitive dependency analysis, path aliases, JavaScript and method-level structure analysis, and optional AI review are not implemented yet.
|
|
173
|
+
|
|
174
|
+
## CLI usage
|
|
175
|
+
|
|
176
|
+
Analyze the current repository's working tree:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
node dist/presentation/cli/main.js analyze
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Analyze another Git repository:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
node dist/presentation/cli/main.js analyze --cwd /path/to/repository
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Compare two branches. IntentPatch analyzes their changes from the merge base:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
node dist/presentation/cli/main.js analyze \
|
|
192
|
+
--cwd /path/to/repository \
|
|
193
|
+
--base main \
|
|
194
|
+
--head feature/account-deletion
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Write JSON output:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
node dist/presentation/cli/main.js analyze --json
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Create a standalone HTML report:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
node dist/presentation/cli/main.js analyze \
|
|
207
|
+
--format html \
|
|
208
|
+
--output intentpatch-report.html
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
The HTML file contains all styles and the dependency-impact SVG, so it opens directly without a server or API key. `--output` also works with text and JSON formats. Relative output paths are resolved from the directory where IntentPatch is executed. `--json` is an alias for `--format json`.
|
|
212
|
+
|
|
213
|
+
### Check request scope with a Change Contract
|
|
214
|
+
|
|
215
|
+
Create `.intentpatch.json` in the repository being analyzed and declare the expected scope of the request:
|
|
216
|
+
|
|
217
|
+
```json
|
|
218
|
+
{
|
|
219
|
+
"intent": "Implement account deletion",
|
|
220
|
+
"scope": {
|
|
221
|
+
"include": ["src/user/**", "tests/user/**"],
|
|
222
|
+
"allow": ["package.json", "package-lock.json"],
|
|
223
|
+
"maxFiles": 8,
|
|
224
|
+
"maxLines": 300
|
|
225
|
+
},
|
|
226
|
+
"tests": {
|
|
227
|
+
"requireFor": ["src/**/*.ts", "src/**/*.tsx"],
|
|
228
|
+
"include": ["tests/**/*.test.ts", "tests/**/*.test.tsx"],
|
|
229
|
+
"exclude": ["src/**/*.d.ts"]
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
- `include`: paths expected to change for the request;
|
|
235
|
+
- `allow`: exceptional paths such as configuration or lockfiles;
|
|
236
|
+
- `maxFiles`: maximum number of changed files;
|
|
237
|
+
- `maxLines`: maximum total of measurable added and deleted lines;
|
|
238
|
+
- `tests.requireFor`: source paths that require a related test change;
|
|
239
|
+
- `tests.include`: paths classified as tests;
|
|
240
|
+
- `tests.exclude`: generated or declaration files excluded from the source check.
|
|
241
|
+
|
|
242
|
+
Test matching uses basenames for deterministic results. For example, `src/user.ts` can match changed files such as `tests/user.test.ts`, `user.spec.ts`, or `user.integration.test.ts`.
|
|
243
|
+
|
|
244
|
+
Use `--config` to select another contract. Relative paths are resolved from `--cwd`:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
node dist/presentation/cli/main.js analyze \
|
|
248
|
+
--cwd /path/to/repository \
|
|
249
|
+
--config contracts/delete-user.json
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Start with [`.intentpatch.example.json`](./.intentpatch.example.json). Without a contract, all existing analysis still runs and only the scope rules are disabled.
|
|
253
|
+
|
|
254
|
+
### Quality gates
|
|
255
|
+
|
|
256
|
+
Return exit code `1` after rendering the report when a finding meets or exceeds the selected severity:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
node dist/presentation/cli/main.js analyze --fail-on medium
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
`medium` reacts to both medium- and high-severity findings. `low` treats every finding as a quality-gate failure. Invalid CLI usage returns exit code `2`.
|
|
263
|
+
|
|
264
|
+
An evidence-rich result looks like this:
|
|
265
|
+
|
|
266
|
+
```text
|
|
267
|
+
IntentPatch Change Report
|
|
268
|
+
|
|
269
|
+
Files changed 2
|
|
270
|
+
Changed symbols 2
|
|
271
|
+
Import edges 18
|
|
272
|
+
Direct dependents 1
|
|
273
|
+
Transitive impact 2
|
|
274
|
+
Tests changed 1
|
|
275
|
+
Tests added 0
|
|
276
|
+
Missing test changes 1
|
|
277
|
+
New dependencies 1
|
|
278
|
+
Risky API changes 1
|
|
279
|
+
Duplicate candidates 1
|
|
280
|
+
Single implementations 1
|
|
281
|
+
Findings 6
|
|
282
|
+
|
|
283
|
+
Changed symbols
|
|
284
|
+
|
|
285
|
+
M Class UserService src/user/service.ts:12
|
|
286
|
+
A Function deleteUser src/user/service.ts:48
|
|
287
|
+
|
|
288
|
+
Impacted files
|
|
289
|
+
|
|
290
|
+
→ direct src/api/delete-user.ts
|
|
291
|
+
changed: src/user/service.ts
|
|
292
|
+
→ transitive · 2 hops src/app.ts
|
|
293
|
+
changed: src/user/service.ts
|
|
294
|
+
|
|
295
|
+
Potential issues
|
|
296
|
+
|
|
297
|
+
HIGH Public export removed
|
|
298
|
+
src/user/service.ts · api/export-removed
|
|
299
|
+
The function deleteUser is no longer exported.
|
|
300
|
+
|
|
301
|
+
MEDIUM New production dependency
|
|
302
|
+
package.json · dependency/new-production
|
|
303
|
+
dayjs@^1.11.0 was added to dependencies.
|
|
304
|
+
|
|
305
|
+
MEDIUM Change outside expected scope
|
|
306
|
+
src/payment/billing.ts · scope/outside-expected-path
|
|
307
|
+
src/payment/billing.ts does not match any expected or allowed path pattern.
|
|
308
|
+
|
|
309
|
+
MEDIUM Source change without matching test change
|
|
310
|
+
src/payment/billing.ts · tests/missing-related-change
|
|
311
|
+
src/payment/billing.ts changed without a changed test sharing the same basename.
|
|
312
|
+
|
|
313
|
+
MEDIUM New function duplicates existing implementation
|
|
314
|
+
src/user/service.ts · structure/duplicate-implementation
|
|
315
|
+
The new function verifySession has the same normalized implementation as authorize.
|
|
316
|
+
|
|
317
|
+
LOW New interface has one implementation
|
|
318
|
+
src/user/service.ts · structure/single-implementation-abstraction
|
|
319
|
+
The new interface DeletionStrategy is implemented only by DefaultDeletionStrategy.
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Run the TypeScript entry point directly during development:
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
npm run dev -- analyze --cwd /path/to/repository
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
## Architecture
|
|
329
|
+
|
|
330
|
+
IntentPatch applies Clean Architecture dependency direction so Git, presentation, and analysis rules do not become tightly coupled as the project grows.
|
|
331
|
+
|
|
332
|
+
```text
|
|
333
|
+
presentation ───────▶ application ───────▶ domain
|
|
334
|
+
│ ▲
|
|
335
|
+
└──▶ infrastructure ──┘
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
| Layer | Responsibility |
|
|
339
|
+
| --- | --- |
|
|
340
|
+
| `domain` | Core models for changed files, Change Contracts, findings, symbol changes, and dependency impact |
|
|
341
|
+
| `application` | Analysis use cases, rule engine, symbol and impact calculations, and ports for external data |
|
|
342
|
+
| `infrastructure` | Git commands, diff parsing, project-file access, and TypeScript AST parsing |
|
|
343
|
+
| `presentation` | CLI argument handling, dependency composition, and text, JSON, and HTML output |
|
|
344
|
+
|
|
345
|
+
Architecture tests enforce the import direction so inner layers never depend on external implementations. See the [architecture document](./docs/architecture.md) for design decisions and extension points.
|
|
346
|
+
|
|
347
|
+
## Design principles
|
|
348
|
+
|
|
349
|
+
- **Deterministic first:** the same input produces the same core analysis result.
|
|
350
|
+
- **Evidence over claims:** uncertain signals are not presented as facts.
|
|
351
|
+
- **LLM optional:** useful analysis remains available without an AI provider.
|
|
352
|
+
- **Dependency minimalism:** convenience alone does not justify another library.
|
|
353
|
+
- **Explicit boundaries:** domain logic stays separate from external details such as Git and CLI frameworks.
|
|
354
|
+
|
|
355
|
+
## Testing and quality checks
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
npm run check
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
This command runs:
|
|
362
|
+
|
|
363
|
+
- strict TypeScript type checking;
|
|
364
|
+
- Biome lint and format checks;
|
|
365
|
+
- domain and use-case unit tests;
|
|
366
|
+
- integration tests against real temporary Git repositories;
|
|
367
|
+
- a package integration test that installs the generated npm tarball in a temporary project and executes it;
|
|
368
|
+
- architecture tests that enforce dependency direction;
|
|
369
|
+
- a reproducibility check for the bundled GitHub Action.
|
|
370
|
+
|
|
371
|
+
Run only the production build with:
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
npm run build
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
Inspect the files that would be published without creating a public release:
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
npm pack --dry-run
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
## Release process
|
|
384
|
+
|
|
385
|
+
Pushing a tag such as `v0.1.0`, matching the version in `package.json`, from a commit contained in the default branch triggers the release workflow:
|
|
386
|
+
|
|
387
|
+
1. Validate the tag, package version, and default-branch ancestry.
|
|
388
|
+
2. Run the full quality suite and inspect the npm package with a dry run.
|
|
389
|
+
3. Publish through npm Trusted Publishing with OpenID Connect.
|
|
390
|
+
4. Create a GitHub Release with automatically generated notes.
|
|
391
|
+
|
|
392
|
+
No long-lived npm token is stored as a GitHub secret. Public packages published through OIDC receive npm provenance automatically. A package that does not yet exist on npm needs a one-time bootstrap before a Trusted Publisher can be configured. See the [release operations guide](./docs/releasing.md) for bootstrap and subsequent release procedures.
|
|
393
|
+
|
|
394
|
+
## Roadmap
|
|
395
|
+
|
|
396
|
+
1. ✅ Direct `package.json` dependency detection and rule engine
|
|
397
|
+
2. ✅ TypeScript AST analysis for functions, classes, interfaces, and types
|
|
398
|
+
3. ✅ Relative static import graph and change-impact calculation
|
|
399
|
+
4. ✅ Change Contract scope and change-budget analysis
|
|
400
|
+
5. ✅ Contract-based detection of missing related test changes
|
|
401
|
+
6. Package-manager adapters for lockfiles and workspaces
|
|
402
|
+
7. ✅ Detection of removed public exports
|
|
403
|
+
8. ✅ Standalone HTML dashboard and SVG dependency-impact graph
|
|
404
|
+
9. ✅ Re-export and function/interface compatibility checks plus possible code duplication
|
|
405
|
+
10. ✅ Detection of newly introduced single-implementation interfaces
|
|
406
|
+
11. ✅ GitHub Action with PR/push comparison, Job Summary, annotations, and artifacts
|
|
407
|
+
12. Codex, Claude Code, and Cursor adapters
|
|
408
|
+
13. Optional LLM explanations grounded in deterministic evidence
|
|
409
|
+
|
|
410
|
+
## Current limitations
|
|
411
|
+
|
|
412
|
+
- The target must be a Git repository with at least one commit.
|
|
413
|
+
- Untracked symbolic links are not read for safety.
|
|
414
|
+
- Line counts are skipped for untracked files larger than 10 MiB.
|
|
415
|
+
- Dependency analysis covers only `dependencies` and `devDependencies` in the root npm `package.json`.
|
|
416
|
+
- Transitive lockfile dependencies, workspace packages, and real dependency usage in source code are not analyzed yet.
|
|
417
|
+
- Symbol analysis supports named top-level functions, classes, interfaces, and type aliases in `.ts` and `.tsx` files.
|
|
418
|
+
- Public API analysis supports named top-level functions and interfaces, local `export { name }`, external `export { name } from`, and `export * from`. Package `exports`, anonymous default exports, and detailed class or type-alias contracts are not interpreted yet.
|
|
419
|
+
- Function compatibility compares explicitly written parameter and return-type text. It does not evaluate inferred return types or full TypeScript structural assignability.
|
|
420
|
+
- Duplicate candidates require a newly added top-level function and an existing top-level function to have exactly the same normalized tokens after comments and whitespace are removed, with at least 12 body tokens. Renamed identifiers, methods, and semantically equivalent implementations are not detected.
|
|
421
|
+
- A single-implementation abstraction is reported only when exactly one named class explicitly uses `implements` for a new interface. Structural implementation, factory return types, and runtime registration are not calculated.
|
|
422
|
+
- Methods, variable declarations, enums, nested declarations, and JavaScript files are not included in symbol analysis.
|
|
423
|
+
- Formatting or comment changes inside a declaration can be counted as symbol modifications.
|
|
424
|
+
- Impact analysis covers relative static `import`, side-effect imports, `export ... from`, and `import = require()` in `.ts` and `.tsx` files.
|
|
425
|
+
- External package imports, path aliases, dynamic `import()`, and ordinary `require()` are not included in the graph.
|
|
426
|
+
- The graph is built from files at the comparison result point: the working tree or head ref. Impact from historical imports that referenced a deleted module cannot be calculated yet.
|
|
427
|
+
- Source files used for impact analysis are limited to 1 MiB per file, and symbolic links are not read.
|
|
428
|
+
- IntentPatch does not infer expected paths from natural-language intent. Scope decisions use the contract's explicit `include` and `allow` patterns.
|
|
429
|
+
- Path patterns support only repository-relative `*`, `**`, and `?`; negation and brace expansion are not supported.
|
|
430
|
+
- `maxLines` sums only measurable added and deleted lines in text files. Binary or unmeasurable files are not treated as zero lines, but their size is not included in the budget.
|
|
431
|
+
- Test analysis compares only the changed paths declared in the contract; it does not execute tests or measure coverage.
|
|
432
|
+
- Related tests are matched by basename. Integration tests with different names or one test covering several source files cannot be linked automatically yet.
|
|
433
|
+
- The HTML impact graph uses a deterministic two-column layout. Interactive node movement, zooming, and filtering are not implemented yet.
|
|
434
|
+
|
|
435
|
+
## License
|
|
436
|
+
|
|
437
|
+
[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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-reference-extractor.d.ts","sourceRoot":"","sources":["../../../src/application/ports/module-reference-extractor.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,+BAA+B,GACvC,QAAQ,CAAC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC,GAC5D,QAAQ,CAAC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEtD,oDAAoD;AACpD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,+BAA+B,CAAC;CACxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-reference-extractor.js","sourceRoot":"","sources":["../../../src/application/ports/module-reference-extractor.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AnalysisTarget } from "../../domain/report.js";
|
|
2
|
+
export type ProjectFileReadResult = Readonly<{
|
|
3
|
+
kind: "success";
|
|
4
|
+
content: string;
|
|
5
|
+
}> | Readonly<{
|
|
6
|
+
kind: "missing";
|
|
7
|
+
}> | Readonly<{
|
|
8
|
+
kind: "unavailable";
|
|
9
|
+
reason: string;
|
|
10
|
+
}>;
|
|
11
|
+
/** 분석 결과점의 프로젝트 파일 목록과 텍스트를 공급하는 출력 포트다. */
|
|
12
|
+
export interface ProjectFileSource {
|
|
13
|
+
listPaths(target: AnalysisTarget): Promise<readonly string[]>;
|
|
14
|
+
read(target: AnalysisTarget, path: string): Promise<ProjectFileReadResult>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=project-file-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-file-source.d.ts","sourceRoot":"","sources":["../../../src/application/ports/project-file-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7D,MAAM,MAAM,qBAAqB,GAC7B,QAAQ,CAAC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,GAC9C,QAAQ,CAAC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,GAC7B,QAAQ,CAAC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEtD,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IAC9D,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;CAC5E"}
|