Skip to content

Commit 3004338

Browse files
shivasuryaclaude
andauthored
refactor: Rename sourcecode-parser to sast-engine (v1.1.0) (#414)
* refactor: Rename sourcecode-parser to sast-engine (v1.1.0) Major refactoring to rename the core directory for better clarity: - Rename sourcecode-parser → sast-engine - Update Go module path in all 174+ files - Update GitHub Actions workflows (4 files) - Update Docker configurations (2 files) - Update build.gradle, codecov.yml - Update documentation (CLAUDE.md, CONTRIBUTING.md, perf_tools/README.md) - Update playground module dependencies - Bump version to 1.1.0 Breaking change: Go module import path changed from github.com/shivasurya/code-pathfinder/sourcecode-parser to github.com/shivasurya/code-pathfinder/sast-engine No external impact (no external Go module consumers). Testing: - ✅ gradle buildGo - Binary works, version 1.1.0 - ✅ gradle testGo - All 19 packages pass - ✅ gradle lintGo - 0 issues - ✅ Docker build - Image builds and runs 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: Add DeepWiki badge to README --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 32ab395 commit 3004338

File tree

223 files changed

+267
-266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+267
-266
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- master
88
pull_request:
99
paths:
10-
- 'sourcecode-parser/**'
10+
- 'sast-engine/**'
1111
- 'playground/**'
1212
- 'pathfinder-rules/**'
1313

@@ -33,12 +33,12 @@ jobs:
3333

3434
- name: Get dependencies
3535
run: |
36-
cd sourcecode-parser
36+
cd sast-engine
3737
go mod download
3838
3939
- name: Test
4040
run: |
41-
cd sourcecode-parser
41+
cd sast-engine
4242
go test -p 2 -v ./... -coverprofile=coverage.out -covermode=atomic
4343
4444
- name: Upload coverage reports to Codecov
@@ -51,7 +51,7 @@ jobs:
5151
runs-on: ubuntu-latest
5252
defaults:
5353
run:
54-
working-directory: sourcecode-parser
54+
working-directory: sast-engine
5555
steps:
5656
- uses: actions/checkout@v4
5757
- uses: actions/setup-go@v5
@@ -61,4 +61,4 @@ jobs:
6161
uses: golangci/golangci-lint-action@v8
6262
with:
6363
version: v2.5.0
64-
working-directory: sourcecode-parser
64+
working-directory: sast-engine

.github/workflows/docker-publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Compute Version and Commit Info
3030
id: cpfinfo
3131
run: |
32-
VERSION=$(cat sourcecode-parser/VERSION)
32+
VERSION=$(cat sast-engine/VERSION)
3333
COMMIT=$(git describe --tags)
3434
echo $VERSION
3535
echo $COMMIT
@@ -40,11 +40,11 @@ jobs:
4040
id: vars
4141
run: |
4242
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
43-
VERSION=$(cat sourcecode-parser/VERSION)
43+
VERSION=$(cat sast-engine/VERSION)
4444
echo "tag1=v${VERSION}" >> $GITHUB_OUTPUT
4545
echo "tag2=stable-latest" >> $GITHUB_OUTPUT
4646
elif [ "${{ github.event_name }}" == "push" ] && [ "${{ github.ref }}" == "refs/heads/main" ]; then
47-
VERSION=$(cat sourcecode-parser/VERSION)
47+
VERSION=$(cat sast-engine/VERSION)
4848
echo "tag1=dev-${VERSION}" >> $GITHUB_OUTPUT
4949
echo "tag2=nightly-latest" >> $GITHUB_OUTPUT
5050
else

.github/workflows/release.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ jobs:
3030
GOARCH: amd64
3131
POSTHOG_WEB_ANALYTICS: ${{ secrets.POSTHOG_WEB_ANALYTICS }}
3232
run: |
33-
cd sourcecode-parser
33+
cd sast-engine
3434
gitCommit=$(git describe --tags)
3535
projectVersion=$(cat VERSION)
3636
posthogkey=$(echo $POSTHOG_WEB_ANALYTICS)
37-
go build -ldflags="-s -w -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.Version=${projectVersion} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.GitCommit=${gitCommit} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/analytics.PublicKey=${posthogkey}" -v -o pathfinder-linux-amd64 .
37+
go build -ldflags="-s -w -X github.com/shivasurya/code-pathfinder/sast-engine/cmd.Version=${projectVersion} -X github.com/shivasurya/code-pathfinder/sast-engine/cmd.GitCommit=${gitCommit} -X github.com/shivasurya/code-pathfinder/sast-engine/analytics.PublicKey=${posthogkey}" -v -o pathfinder-linux-amd64 .
3838
chmod +x pathfinder-linux-amd64
3939
4040
- name: Calculate SHA256
4141
run: |
42-
cd sourcecode-parser
42+
cd sast-engine
4343
sha256sum pathfinder-linux-amd64 > pathfinder-linux-amd64.sha256sum.txt
4444
cp pathfinder-linux-amd64 pathfinder
4545
tar -czvf pathfinder-linux-amd64.tar.gz pathfinder
@@ -49,9 +49,9 @@ jobs:
4949
with:
5050
name: pathfinder-linux-amd64
5151
path: |
52-
sourcecode-parser/pathfinder-linux-amd64
53-
sourcecode-parser/pathfinder-linux-amd64.sha256sum.txt
54-
sourcecode-parser/pathfinder-linux-amd64.tar.gz
52+
sast-engine/pathfinder-linux-amd64
53+
sast-engine/pathfinder-linux-amd64.sha256sum.txt
54+
sast-engine/pathfinder-linux-amd64.tar.gz
5555
5656
build-linux-arm64:
5757
runs-on: ubuntu-24.04-arm # Native ARM64 runner (public repos only)
@@ -73,16 +73,16 @@ jobs:
7373
CGO_ENABLED: 1 # Required for tree-sitter
7474
POSTHOG_WEB_ANALYTICS: ${{ secrets.POSTHOG_WEB_ANALYTICS }}
7575
run: |
76-
cd sourcecode-parser
76+
cd sast-engine
7777
gitCommit=$(git describe --tags)
7878
projectVersion=$(cat VERSION)
7979
posthogkey=$(echo $POSTHOG_WEB_ANALYTICS)
80-
go build -ldflags="-s -w -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.Version=${projectVersion} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.GitCommit=${gitCommit} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/analytics.PublicKey=${posthogkey}" -v -o pathfinder-linux-arm64 .
80+
go build -ldflags="-s -w -X github.com/shivasurya/code-pathfinder/sast-engine/cmd.Version=${projectVersion} -X github.com/shivasurya/code-pathfinder/sast-engine/cmd.GitCommit=${gitCommit} -X github.com/shivasurya/code-pathfinder/sast-engine/analytics.PublicKey=${posthogkey}" -v -o pathfinder-linux-arm64 .
8181
chmod +x pathfinder-linux-arm64
8282
8383
- name: Calculate SHA256
8484
run: |
85-
cd sourcecode-parser
85+
cd sast-engine
8686
sha256sum pathfinder-linux-arm64 > pathfinder-linux-arm64.sha256sum.txt
8787
cp pathfinder-linux-arm64 pathfinder
8888
tar -czvf pathfinder-linux-arm64.tar.gz pathfinder
@@ -92,9 +92,9 @@ jobs:
9292
with:
9393
name: pathfinder-linux-arm64
9494
path: |
95-
sourcecode-parser/pathfinder-linux-arm64
96-
sourcecode-parser/pathfinder-linux-arm64.sha256sum.txt
97-
sourcecode-parser/pathfinder-linux-arm64.tar.gz
95+
sast-engine/pathfinder-linux-arm64
96+
sast-engine/pathfinder-linux-arm64.sha256sum.txt
97+
sast-engine/pathfinder-linux-arm64.tar.gz
9898
9999
build-windows:
100100
runs-on: windows-latest
@@ -115,15 +115,15 @@ jobs:
115115
GOARCH: amd64
116116
POSTHOG_WEB_ANALYTICS: ${{ secrets.POSTHOG_WEB_ANALYTICS }}
117117
run: |
118-
cd sourcecode-parser
118+
cd sast-engine
119119
$gitCommit = (git describe --tags).Trim()
120120
$projectVersion = Get-Content VERSION
121121
$posthogkey=$env:POSTHOG_WEB_ANALYTICS
122-
go build -ldflags="-s -w -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.Version=${projectVersion} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.GitCommit=${gitCommit} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/analytics.PublicKey=${posthogkey}" -v -o pathfinder-windows-amd64.exe .
122+
go build -ldflags="-s -w -X github.com/shivasurya/code-pathfinder/sast-engine/cmd.Version=${projectVersion} -X github.com/shivasurya/code-pathfinder/sast-engine/cmd.GitCommit=${gitCommit} -X github.com/shivasurya/code-pathfinder/sast-engine/analytics.PublicKey=${posthogkey}" -v -o pathfinder-windows-amd64.exe .
123123
124124
- name: Calculate SHA256
125125
run: |
126-
cd sourcecode-parser
126+
cd sast-engine
127127
Get-FileHash -Algorithm SHA256 pathfinder-windows-amd64.exe | Select-Object Hash | Out-File -Encoding UTF8 pathfinder-windows-amd64.exe.sha256sum.txt
128128
Copy-Item pathfinder-windows-amd64.exe pathfinder.exe
129129
Compress-Archive -Path pathfinder.exe -DestinationPath pathfinder-windows-amd64.zip
@@ -133,9 +133,9 @@ jobs:
133133
with:
134134
name: pathfinder-windows-amd64
135135
path: |
136-
sourcecode-parser/pathfinder-windows-amd64.exe
137-
sourcecode-parser/pathfinder-windows-amd64.exe.sha256sum.txt
138-
sourcecode-parser/pathfinder-windows-amd64.zip
136+
sast-engine/pathfinder-windows-amd64.exe
137+
sast-engine/pathfinder-windows-amd64.exe.sha256sum.txt
138+
sast-engine/pathfinder-windows-amd64.zip
139139
140140
build-macos:
141141
runs-on: macos-latest
@@ -156,16 +156,16 @@ jobs:
156156
GOARCH: arm64
157157
POSTHOG_WEB_ANALYTICS: ${{ secrets.POSTHOG_WEB_ANALYTICS }}
158158
run: |
159-
cd sourcecode-parser
159+
cd sast-engine
160160
gitCommit=$(git describe --tags)
161161
projectVersion=$(cat VERSION)
162162
posthogkey=$(echo $POSTHOG_WEB_ANALYTICS)
163-
go build -ldflags="-s -w -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.Version=${projectVersion} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.GitCommit=${gitCommit} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/analytics.PublicKey=${posthogkey}" -v -o pathfinder-darwin-arm64 .
163+
go build -ldflags="-s -w -X github.com/shivasurya/code-pathfinder/sast-engine/cmd.Version=${projectVersion} -X github.com/shivasurya/code-pathfinder/sast-engine/cmd.GitCommit=${gitCommit} -X github.com/shivasurya/code-pathfinder/sast-engine/analytics.PublicKey=${posthogkey}" -v -o pathfinder-darwin-arm64 .
164164
chmod +x pathfinder-darwin-arm64
165165
166166
- name: Calculate SHA256
167167
run: |
168-
cd sourcecode-parser
168+
cd sast-engine
169169
shasum -a 256 pathfinder-darwin-arm64 > pathfinder-darwin-arm64.sha256sum.txt
170170
cp pathfinder-darwin-arm64 pathfinder
171171
tar -czvf pathfinder-darwin-arm64.tar.gz pathfinder
@@ -175,9 +175,9 @@ jobs:
175175
with:
176176
name: pathfinder-darwin-arm64
177177
path: |
178-
sourcecode-parser/pathfinder-darwin-arm64
179-
sourcecode-parser/pathfinder-darwin-arm64.sha256sum.txt
180-
sourcecode-parser/pathfinder-darwin-arm64.tar.gz
178+
sast-engine/pathfinder-darwin-arm64
179+
sast-engine/pathfinder-darwin-arm64.sha256sum.txt
180+
sast-engine/pathfinder-darwin-arm64.tar.gz
181181
182182
build-macos-intel:
183183
runs-on: macos-13 # Last Intel-based macOS runner
@@ -199,16 +199,16 @@ jobs:
199199
CGO_ENABLED: 1 # Required for tree-sitter
200200
POSTHOG_WEB_ANALYTICS: ${{ secrets.POSTHOG_WEB_ANALYTICS }}
201201
run: |
202-
cd sourcecode-parser
202+
cd sast-engine
203203
gitCommit=$(git describe --tags)
204204
projectVersion=$(cat VERSION)
205205
posthogkey=$(echo $POSTHOG_WEB_ANALYTICS)
206-
go build -ldflags="-s -w -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.Version=${projectVersion} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.GitCommit=${gitCommit} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/analytics.PublicKey=${posthogkey}" -v -o pathfinder-darwin-amd64 .
206+
go build -ldflags="-s -w -X github.com/shivasurya/code-pathfinder/sast-engine/cmd.Version=${projectVersion} -X github.com/shivasurya/code-pathfinder/sast-engine/cmd.GitCommit=${gitCommit} -X github.com/shivasurya/code-pathfinder/sast-engine/analytics.PublicKey=${posthogkey}" -v -o pathfinder-darwin-amd64 .
207207
chmod +x pathfinder-darwin-amd64
208208
209209
- name: Calculate SHA256
210210
run: |
211-
cd sourcecode-parser
211+
cd sast-engine
212212
shasum -a 256 pathfinder-darwin-amd64 > pathfinder-darwin-amd64.sha256sum.txt
213213
cp pathfinder-darwin-amd64 pathfinder
214214
tar -czvf pathfinder-darwin-amd64.tar.gz pathfinder
@@ -218,9 +218,9 @@ jobs:
218218
with:
219219
name: pathfinder-darwin-amd64
220220
path: |
221-
sourcecode-parser/pathfinder-darwin-amd64
222-
sourcecode-parser/pathfinder-darwin-amd64.sha256sum.txt
223-
sourcecode-parser/pathfinder-darwin-amd64.tar.gz
221+
sast-engine/pathfinder-darwin-amd64
222+
sast-engine/pathfinder-darwin-amd64.sha256sum.txt
223+
sast-engine/pathfinder-darwin-amd64.tar.gz
224224
225225
release:
226226
needs: [build-linux, build-linux-arm64, build-windows, build-macos, build-macos-intel]

.github/workflows/stdlib-r2-upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
5656
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
5757
run: |
58-
cd sourcecode-parser/tools
58+
cd sast-engine/tools
5959
chmod +x upload_to_r2.sh
6060
./upload_to_r2.sh
6161

CLAUDE.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66

77
### Building the Binary
88
```bash
9-
cd sourcecode-parser
9+
cd sast-engine
1010
gradle buildGo
1111
```
1212
The binary is output to `build/go/pathfinder`. The build automatically cleans previous builds first.
@@ -65,29 +65,29 @@ Output Formats (JSON, SARIF, Table)
6565

6666
### Core Packages
6767

68-
**sourcecode-parser/graph/** - Code graph construction and management
68+
**sast-engine/graph/** - Code graph construction and management
6969
- `initialize.go`: Multi-threaded file parsing with 5 workers
7070
- `parser.go`: AST traversal orchestrator (language-agnostic entry point)
7171
- `parser_java.go`: Java-specific node parsing
7272
- `parser_python.go`: Python-specific node parsing
7373
- `query.go`: Query execution engine with Cartesian product optimization
7474
- `utils.go`: SHA256-based ID generation, file operations
7575

76-
**sourcecode-parser/antlr/** - Query language parsing
76+
**sast-engine/antlr/** - Query language parsing
7777
- `Query.g4`: ANTLR grammar for PathFinder query language
7878
- `listener_impl.go`: Semantic analysis of parsed queries
7979

80-
**sourcecode-parser/cmd/** - CLI interface
80+
**sast-engine/cmd/** - CLI interface
8181
- `query.go`: Interactive/batch query execution with pagination
8282
- `ci.go`: CI/CD integration with rule loading from codepathfinder.dev
8383
- `scan.go`: Scan project against local ruleset
8484

85-
**sourcecode-parser/model/** - AST data models
85+
**sast-engine/model/** - AST data models
8686
- `stmt.go`: Statement models (if/while/for/blocks)
8787
- `expr.go`: Expression models
8888
- `location.go`: Source location tracking for lazy loading
8989

90-
**sourcecode-parser/analytics/** - Optional PostHog telemetry
90+
**sast-engine/analytics/** - Optional PostHog telemetry
9191

9292
## Critical Design Patterns
9393

@@ -398,7 +398,7 @@ This counteracts non-determinism from multi-threaded parsing.
398398
## Release and Versioning
399399

400400
### Version Management
401-
Version is stored in `sourcecode-parser/VERSION` and injected at build time:
401+
Version is stored in `sast-engine/VERSION` and injected at build time:
402402
```gradle
403403
// In build.gradle
404404
commandLine 'go', 'build', '-ldflags',

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We recommend using the following IDEs for developing with Code Pathfinder:
1212

1313
## Core Project
1414

15-
The core of Code Pathfinder is the `sourcecode-parser` project, written in Go.
15+
The core of Code Pathfinder is the `sast-engine` project, written in Go.
1616

1717
## Build System
1818

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM cgr.dev/chainguard/go:latest AS builder
22

33
WORKDIR /app
44

5-
COPY sourcecode-parser .
5+
COPY sast-engine .
66

77
ARG POSTHOG_WEB_ANALYTICS
88

@@ -16,7 +16,7 @@ RUN echo "Building version ${PROJECT_VERSION} with commit ${PROJECT_COMMIT}"
1616

1717
RUN go mod download
1818

19-
RUN go build -ldflags="-s -w -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.Version=${PROJECT_VERSION} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/cmd.GitCommit=${PROJECT_COMMIT} -X github.com/shivasurya/code-pathfinder/sourcecode-parser/analytics.PublicKey=${POSTHOG_API_KEY}" -v -o pathfinder .
19+
RUN go build -ldflags="-s -w -X github.com/shivasurya/code-pathfinder/sast-engine/cmd.Version=${PROJECT_VERSION} -X github.com/shivasurya/code-pathfinder/sast-engine/cmd.GitCommit=${PROJECT_COMMIT} -X github.com/shivasurya/code-pathfinder/sast-engine/analytics.PublicKey=${POSTHOG_API_KEY}" -v -o pathfinder .
2020

2121
FROM cgr.dev/chainguard/wolfi-base:latest
2222

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
[![npm version](https://img.shields.io/npm/v/@codepathfinder/secureflow-cli?logo=npm)](https://www.npmjs.com/package/@codepathfinder/secureflow-cli)
1010
[![Open VSX](https://img.shields.io/open-vsx/v/codepathfinder/secureflow?label=Open%20VSX&logo=vscodium)](https://open-vsx.org/extension/codepathfinder/secureflow)
1111
[![AGPL-3.0 License](https://img.shields.io/github/license/shivasurya/code-pathfinder)](https://github.com/shivasurya/code-pathfinder/blob/main/LICENSE)
12+
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/shivasurya/code-pathfinder)
1213
</div>
1314

1415
# Code Pathfinder

codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
ignore:
2-
- "sourcecode-parser/antlr/" # ignore folders and all its contents
2+
- "sast-engine/antlr/" # ignore folders and all its contents

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codepathfinder",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "Code Pathfinder, the open-source alternative to CodeQL. Designed for precise flow analysis and advanced structural search, it identifies vulnerabilities in source code.",
55
"goBinary": {
66
"name": "pathfinder",

0 commit comments

Comments
 (0)