sourcecode 2.0.0__py3-none-any.whl → 2.0.1__py3-none-any.whl
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.
- sourcecode/__init__.py +2 -6
- sourcecode/cli.py +196 -199
- sourcecode/license.py +13 -31
- sourcecode/mcp/onboarding/applier.py +6 -14
- sourcecode/mcp/registry.py +22 -22
- sourcecode/mcp/runner.py +2 -2
- sourcecode/mcp/server.py +24 -24
- sourcecode/mcp_nudge.py +1 -1
- sourcecode/migrate_check.py +64 -0
- sourcecode/repository_ir.py +1 -1
- sourcecode/ris.py +1 -1
- sourcecode/serializer.py +1 -1
- sourcecode/summarizer.py +33 -2
- sourcecode/telemetry/consent.py +1 -1
- {sourcecode-2.0.0.dist-info → sourcecode-2.0.1.dist-info}/METADATA +114 -117
- {sourcecode-2.0.0.dist-info → sourcecode-2.0.1.dist-info}/RECORD +19 -19
- {sourcecode-2.0.0.dist-info → sourcecode-2.0.1.dist-info}/entry_points.txt +0 -1
- {sourcecode-2.0.0.dist-info → sourcecode-2.0.1.dist-info}/WHEEL +0 -0
- {sourcecode-2.0.0.dist-info → sourcecode-2.0.1.dist-info}/licenses/LICENSE +0 -0
sourcecode/repository_ir.py
CHANGED
|
@@ -5648,7 +5648,7 @@ def compute_blast_radius(
|
|
|
5648
5648
|
"message": (
|
|
5649
5649
|
f"No symbol matching {target!r} found in IR. "
|
|
5650
5650
|
"Verify the class name or FQN. "
|
|
5651
|
-
"Run `
|
|
5651
|
+
"Run `sourcecode repo-ir <repo> --output ir.json` to inspect available symbols."
|
|
5652
5652
|
),
|
|
5653
5653
|
"direct_callers": [],
|
|
5654
5654
|
"indirect_callers": [],
|
sourcecode/ris.py
CHANGED
|
@@ -506,7 +506,7 @@ def get_cold_start_context(repo_root: Path) -> dict:
|
|
|
506
506
|
if not endpoints and _is_java:
|
|
507
507
|
result["endpoints_hint"] = (
|
|
508
508
|
"Java repo detected but no endpoint index found. "
|
|
509
|
-
"Call get_endpoints (or:
|
|
509
|
+
"Call get_endpoints (or: sourcecode endpoints <path>) to populate."
|
|
510
510
|
)
|
|
511
511
|
return result
|
|
512
512
|
except Exception:
|
sourcecode/serializer.py
CHANGED
|
@@ -753,7 +753,7 @@ def _bootstrap_structured(eps: list) -> "Optional[dict[str, Any]]":
|
|
|
753
753
|
|
|
754
754
|
_ctrl_note = (
|
|
755
755
|
f"{controller_classes} controller classes detected"
|
|
756
|
-
f" (use '
|
|
756
|
+
f" (use 'sourcecode endpoints' for per-method HTTP surface)"
|
|
757
757
|
)
|
|
758
758
|
if len(module_names) > 30:
|
|
759
759
|
# Group by first path segment under ddd/ (inferred domain area)
|
sourcecode/summarizer.py
CHANGED
|
@@ -259,7 +259,15 @@ class ProjectSummarizer:
|
|
|
259
259
|
paragraphs.append(" ".join(current_lines).strip())
|
|
260
260
|
current_lines = []
|
|
261
261
|
continue
|
|
262
|
-
|
|
262
|
+
# Treat HTML-markup-only lines (<img .../>, <p align=...>, <a><img></a>)
|
|
263
|
+
# as paragraph breaks, like badges/links — otherwise a README whose first
|
|
264
|
+
# block is a centered logo leaks raw markup into the project summary.
|
|
265
|
+
_html_stripped = _re.sub(r"<[^>]+>", "", line).strip()
|
|
266
|
+
if (
|
|
267
|
+
_BADGE_RE.match(line)
|
|
268
|
+
or _LINK_ONLY_RE.match(line)
|
|
269
|
+
or ("<" in line and ">" in line and not _html_stripped)
|
|
270
|
+
):
|
|
263
271
|
if current_lines:
|
|
264
272
|
paragraphs.append(" ".join(current_lines).strip())
|
|
265
273
|
current_lines = []
|
|
@@ -290,9 +298,32 @@ class ProjectSummarizer:
|
|
|
290
298
|
_link_count = len(_MD_LINK_RE.findall(paragraph))
|
|
291
299
|
if _link_count > 2 and _link_count * 30 > len(paragraph):
|
|
292
300
|
continue
|
|
293
|
-
|
|
301
|
+
# Render to clean prose: unwrap inline markdown links, drop images,
|
|
302
|
+
# strip residual inline HTML tags and emphasis markers. A paragraph that
|
|
303
|
+
# collapses below the usefulness floor after cleaning is skipped.
|
|
304
|
+
cleaned = self._clean_inline_markup(paragraph)
|
|
305
|
+
if len(cleaned) < 30:
|
|
306
|
+
continue
|
|
307
|
+
return cleaned
|
|
294
308
|
return None
|
|
295
309
|
|
|
310
|
+
@staticmethod
|
|
311
|
+
def _clean_inline_markup(text: str) -> str:
|
|
312
|
+
"""Reduce README markdown/HTML to plain prose (presentation-only).
|
|
313
|
+
|
|
314
|
+
Removes inline images, unwraps `[label](url)` to `label`, strips residual
|
|
315
|
+
inline HTML tags and bold/italic/code markers, and collapses whitespace.
|
|
316
|
+
Does not touch underscores (they occur inside identifiers)."""
|
|
317
|
+
import re as _re
|
|
318
|
+
text = _re.sub(r"!\[[^\]]*\]\([^)]*\)", "", text) #  images
|
|
319
|
+
text = _re.sub(r"\[([^\]]+)\]\([^)]*\)", r"\1", text) # [label](url) -> label
|
|
320
|
+
text = _re.sub(r"<[^>]+>", "", text) # residual inline HTML
|
|
321
|
+
text = _re.sub(r"\*\*(.+?)\*\*", r"\1", text) # **bold** -> bold
|
|
322
|
+
text = _re.sub(r"\*(.+?)\*", r"\1", text) # *italic* -> italic
|
|
323
|
+
text = text.replace("`", "") # `code` -> code
|
|
324
|
+
text = _re.sub(r"\s+", " ", text).strip()
|
|
325
|
+
return text
|
|
326
|
+
|
|
296
327
|
_TYPE_LABELS: dict[str, str] = {
|
|
297
328
|
"cli": "CLI",
|
|
298
329
|
"api": "API",
|
sourcecode/telemetry/consent.py
CHANGED
|
@@ -26,7 +26,7 @@ _NOTICE = """\
|
|
|
26
26
|
tokens, environment variables, or any repository content.
|
|
27
27
|
|
|
28
28
|
Disable at any time:
|
|
29
|
-
|
|
29
|
+
sourcecode telemetry disable
|
|
30
30
|
export SOURCECODE_TELEMETRY=0 (or DO_NOT_TRACK=1)
|
|
31
31
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\033[0m
|
|
32
32
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sourcecode
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.1
|
|
4
4
|
Summary: Persistent structural context and ultra-fast repeated analysis for AI coding agents
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Keywords: agents,ai,codebase,context,developer-tools,llm
|
|
@@ -40,14 +40,12 @@ Description-Content-Type: text/markdown
|
|
|
40
40
|
|
|
41
41
|
**Persistent structural context and ultra-fast repeated analysis for AI coding agents.**
|
|
42
42
|
|
|
43
|
-

|
|
44
44
|

|
|
45
45
|
|
|
46
|
-
> **ASK Engine** is the product. The CLI
|
|
47
|
-
>
|
|
48
|
-
>
|
|
49
|
-
> for now. The authoritative version is whatever `ask version` reports. See
|
|
50
|
-
> [docs/PRODUCT_IDENTITY.md](docs/PRODUCT_IDENTITY.md).
|
|
46
|
+
> **ASK Engine** is the product. The CLI you install and run is **`sourcecode`** (the
|
|
47
|
+
> executable and Python package). The authoritative version is whatever
|
|
48
|
+
> `sourcecode version` reports.
|
|
51
49
|
|
|
52
50
|
---
|
|
53
51
|
|
|
@@ -83,19 +81,19 @@ Cache keyed on content hashes — invalidated only when source changes. On repea
|
|
|
83
81
|
|
|
84
82
|
## What changes at 0.3s vs 2.7s
|
|
85
83
|
|
|
86
|
-
At 2.7s per call, you use
|
|
84
|
+
At 2.7s per call, you use sourcecode to occasionally inspect a repo.
|
|
87
85
|
|
|
88
|
-
At 0.3s per call, you use
|
|
86
|
+
At 0.3s per call, you use sourcecode as **constant infrastructure** inside agent loops:
|
|
89
87
|
|
|
90
88
|
```
|
|
91
89
|
agent loop iteration:
|
|
92
|
-
1.
|
|
93
|
-
2.
|
|
90
|
+
1. sourcecode . --compact # 0.3s — instant structural context
|
|
91
|
+
2. sourcecode impact PaymentService . --depth 1 # 0.4s — blast radius check
|
|
94
92
|
3. agent makes targeted change
|
|
95
93
|
4. repeat
|
|
96
94
|
```
|
|
97
95
|
|
|
98
|
-
Sub-second context retrieval changes the cost model for agent workflows. You can call
|
|
96
|
+
Sub-second context retrieval changes the cost model for agent workflows. You can call sourcecode before every edit, before every PR review, before every test run — without batching or caching calls manually.
|
|
99
97
|
|
|
100
98
|
---
|
|
101
99
|
|
|
@@ -116,20 +114,11 @@ pip install sourcecode
|
|
|
116
114
|
pipx install sourcecode
|
|
117
115
|
```
|
|
118
116
|
|
|
119
|
-
> **Package vs. command.** The install package is still named `sourcecode` this
|
|
120
|
-
> release (renaming the PyPI/Homebrew distribution is a separate, breaking change).
|
|
121
|
-
> Installing it gives you the canonical **`ask`** command plus the deprecated
|
|
122
|
-
> **`sourcecode`** alias. A future release will publish `ask-engine` and drop the
|
|
123
|
-
> alias.
|
|
124
|
-
|
|
125
117
|
### Verify
|
|
126
118
|
|
|
127
119
|
```bash
|
|
128
|
-
ask version
|
|
129
|
-
# ask 2.0.0
|
|
130
|
-
|
|
131
|
-
# the deprecated alias still works (prints a one-line notice to stderr):
|
|
132
120
|
sourcecode version
|
|
121
|
+
# sourcecode 2.0.1
|
|
133
122
|
```
|
|
134
123
|
|
|
135
124
|
---
|
|
@@ -138,45 +127,45 @@ sourcecode version
|
|
|
138
127
|
|
|
139
128
|
```bash
|
|
140
129
|
# High-signal summary — warm cache: ~0.3s, cold: 2–10s depending on repo size
|
|
141
|
-
|
|
130
|
+
sourcecode --compact
|
|
142
131
|
|
|
143
132
|
# Add git hotspots and uncommitted file count
|
|
144
|
-
|
|
133
|
+
sourcecode --compact --git-context
|
|
145
134
|
|
|
146
135
|
# Structured output for AI agents — bounded, noise-free, ready to inject
|
|
147
|
-
|
|
136
|
+
sourcecode --agent
|
|
148
137
|
|
|
149
138
|
# Blast radius: what breaks if this class changes?
|
|
150
|
-
|
|
139
|
+
sourcecode impact OrderService /path/to/repo
|
|
151
140
|
|
|
152
141
|
# Spring Boot 2→3 migration readiness: javax→jakarta blockers, removed APIs
|
|
153
|
-
|
|
142
|
+
sourcecode migrate-check /path/to/repo
|
|
154
143
|
|
|
155
144
|
# Spring semantic audit: TX anomalies + security surface (free)
|
|
156
|
-
|
|
145
|
+
sourcecode spring-audit /path/to/repo
|
|
157
146
|
|
|
158
147
|
# Impact chain: systemic blast radius with TX/SEC enrichment (free)
|
|
159
|
-
|
|
148
|
+
sourcecode impact-chain OrderService /path/to/repo
|
|
160
149
|
|
|
161
150
|
# Event topology: publisher → event → consumer graph (free)
|
|
162
|
-
|
|
151
|
+
sourcecode impact-chain OrderPlacedEvent /path/to/repo --type events
|
|
163
152
|
|
|
164
153
|
# REST endpoint surface
|
|
165
|
-
|
|
154
|
+
sourcecode endpoints /path/to/repo
|
|
166
155
|
|
|
167
156
|
# Request-body validation per endpoint: constraints + custom validators (free)
|
|
168
157
|
# Recovers constraints from the OpenAPI spec, or directly from Java DTO
|
|
169
158
|
# bean-validation annotations when no spec is present.
|
|
170
|
-
|
|
159
|
+
sourcecode validation /path/to/repo
|
|
171
160
|
|
|
172
161
|
# Onboard to an unfamiliar codebase
|
|
173
|
-
|
|
162
|
+
sourcecode onboard /path/to/repo
|
|
174
163
|
|
|
175
164
|
# PR review: risk, test gaps, changed modules
|
|
176
|
-
|
|
165
|
+
sourcecode review-pr /path/to/repo --since main
|
|
177
166
|
|
|
178
167
|
# Bug triage: risk-ranked files by symptom
|
|
179
|
-
|
|
168
|
+
sourcecode fix-bug /path/to/repo --symptom "NullPointerException in checkout"
|
|
180
169
|
```
|
|
181
170
|
|
|
182
171
|
---
|
|
@@ -194,21 +183,21 @@ ASK Engine maintains a persistent cache at `.sourcecode-cache/` inside each repo
|
|
|
194
183
|
|
|
195
184
|
```bash
|
|
196
185
|
# Inspect cache state
|
|
197
|
-
|
|
186
|
+
sourcecode cache status
|
|
198
187
|
|
|
199
188
|
# Warm the cache ahead of an agent session
|
|
200
|
-
|
|
189
|
+
sourcecode cache warm
|
|
201
190
|
|
|
202
191
|
# Clear cache
|
|
203
|
-
|
|
192
|
+
sourcecode cache clear
|
|
204
193
|
|
|
205
194
|
# Check RIS freshness relative to current git HEAD
|
|
206
|
-
|
|
195
|
+
sourcecode cache freshness
|
|
207
196
|
```
|
|
208
197
|
|
|
209
198
|
**`--no-cache`** bypasses both layers and forces a fresh scan. Use in CI or when you need to verify a fresh result.
|
|
210
199
|
|
|
211
|
-
**Visibility:** Cache hits are silent. Use `
|
|
200
|
+
**Visibility:** Cache hits are silent. Use `sourcecode cache status` to see cache size, hit keys, and last-warmed timestamp.
|
|
212
201
|
|
|
213
202
|
---
|
|
214
203
|
|
|
@@ -218,66 +207,66 @@ ask cache freshness
|
|
|
218
207
|
|
|
219
208
|
```bash
|
|
220
209
|
# Inject as first message to agent (bounded, deterministic)
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
210
|
+
sourcecode /repo --compact # ~2,500–4,000 tokens
|
|
211
|
+
sourcecode /repo --agent # ~4,500–5,500 tokens — more detail
|
|
212
|
+
sourcecode onboard /repo # task-structured: entry points, key files, gaps
|
|
224
213
|
```
|
|
225
214
|
|
|
226
215
|
### Before every change — blast radius + TX/SEC check
|
|
227
216
|
|
|
228
217
|
```bash
|
|
229
218
|
# Always target the INTERFACE in Spring projects, not the implementation:
|
|
230
|
-
|
|
231
|
-
|
|
219
|
+
sourcecode impact OrderService /repo # ✓ 30 callers, 11 endpoints
|
|
220
|
+
sourcecode impact OrderServiceImpl /repo # ✗ 0 callers (Spring DI blindness)
|
|
232
221
|
|
|
233
222
|
# Impact chain: blast radius enriched with TX boundary and security surfaces
|
|
234
|
-
|
|
223
|
+
sourcecode impact-chain OrderService /repo
|
|
235
224
|
|
|
236
225
|
# Event topology: who publishes/consumes this event, and in what TX phase?
|
|
237
|
-
|
|
226
|
+
sourcecode impact-chain OrderPlacedEvent /repo --type events
|
|
238
227
|
|
|
239
228
|
# Spring audit: catch TX anomalies before they hit production
|
|
240
|
-
|
|
229
|
+
sourcecode spring-audit /repo --scope tx
|
|
241
230
|
```
|
|
242
231
|
|
|
243
232
|
### Continuous agent loop — delta context
|
|
244
233
|
|
|
245
234
|
```bash
|
|
246
235
|
# Only changed files + their transitive importers — minimal token cost:
|
|
247
|
-
|
|
248
|
-
|
|
236
|
+
sourcecode prepare-context delta /repo --since HEAD~1
|
|
237
|
+
sourcecode . --changed-only --git-context
|
|
249
238
|
```
|
|
250
239
|
|
|
251
240
|
### PR review — structured risk signal
|
|
252
241
|
|
|
253
242
|
```bash
|
|
254
243
|
# JSON for programmatic use:
|
|
255
|
-
|
|
244
|
+
sourcecode review-pr /repo --since main --output review.json
|
|
256
245
|
jq '.ci_decision' review.json # "analysis_success" | "git_ref_error"
|
|
257
246
|
|
|
258
247
|
# Markdown for GitHub comment:
|
|
259
|
-
|
|
248
|
+
sourcecode review-pr /repo --since main --format github-comment
|
|
260
249
|
```
|
|
261
250
|
|
|
262
251
|
### Bug triage — symptom-driven
|
|
263
252
|
|
|
264
253
|
```bash
|
|
265
254
|
# Specific symptoms produce the best signal:
|
|
266
|
-
|
|
267
|
-
|
|
255
|
+
sourcecode fix-bug /repo --symptom "OIDC token refresh fails after realm update"
|
|
256
|
+
sourcecode fix-bug /repo --symptom "NullPointerException in OrderService during checkout"
|
|
268
257
|
|
|
269
258
|
# Generic symptoms produce noisy output — be specific.
|
|
270
|
-
|
|
259
|
+
sourcecode fix-bug /repo --symptom "payment timeout" --output triage.json
|
|
271
260
|
```
|
|
272
261
|
|
|
273
262
|
### In CI — cached, deterministic, fast
|
|
274
263
|
|
|
275
264
|
```bash
|
|
276
265
|
# Content-hash cached — safe to run on every commit; cold only when code changes
|
|
277
|
-
|
|
266
|
+
sourcecode /repo --compact --output context.json
|
|
278
267
|
|
|
279
268
|
# PR gate
|
|
280
|
-
|
|
269
|
+
sourcecode review-pr /repo --since $BASE_REF --output review.json
|
|
281
270
|
DECISION=$(jq -r '.ci_decision' review.json)
|
|
282
271
|
if [ "$DECISION" != "analysis_success" ]; then echo "Review failed: $DECISION"; fi
|
|
283
272
|
```
|
|
@@ -335,7 +324,7 @@ when the work gets bigger or automated.
|
|
|
335
324
|
files only, by design. ASK Engine monetises enterprise Java monoliths.
|
|
336
325
|
|
|
337
326
|
```bash
|
|
338
|
-
|
|
327
|
+
sourcecode activate <key> # activate a license key
|
|
339
328
|
```
|
|
340
329
|
|
|
341
330
|
Full breakdown: [docs/PRODUCT_TIERS.md](docs/PRODUCT_TIERS.md).
|
|
@@ -356,9 +345,9 @@ Core flags. Feed directly to AI agents as first-message context.
|
|
|
356
345
|
### `impact` — blast-radius analysis [free ≤500 Java files · Pro above]
|
|
357
346
|
|
|
358
347
|
```bash
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
348
|
+
sourcecode impact ClassName /path/to/repo
|
|
349
|
+
sourcecode impact org.example.OrderService /path/to/repo # FQN also accepted
|
|
350
|
+
sourcecode impact OrderService . --depth 2 # limit BFS depth
|
|
362
351
|
```
|
|
363
352
|
|
|
364
353
|
| Field | Description |
|
|
@@ -383,9 +372,9 @@ ask impact OrderService . --depth 2 # limit BFS depth
|
|
|
383
372
|
### `endpoints` — REST API surface
|
|
384
373
|
|
|
385
374
|
```bash
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
375
|
+
sourcecode endpoints /path/to/repo
|
|
376
|
+
sourcecode endpoints /path/to/repo --output endpoints.json
|
|
377
|
+
sourcecode endpoints /path/to/repo --by-controller
|
|
389
378
|
```
|
|
390
379
|
|
|
391
380
|
Extracts all Spring MVC (`@GetMapping`, `@PostMapping`, `@RequestMapping`, etc.) and JAX-RS (`@GET`, `@POST`, `@Path`) endpoint methods. Returns HTTP method, path, controller class, and handler method. Each endpoint also carries its `return_type`. `--by-controller` groups the surface per controller (`{by_controller, controller_count, total}`) for an API-surface view.
|
|
@@ -414,10 +403,10 @@ Matching endpoints then report `policy: "custom"` with `annotation`, `resourceNa
|
|
|
414
403
|
### `export` — architecture views for downstream tooling
|
|
415
404
|
|
|
416
405
|
```bash
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
406
|
+
sourcecode export /path/to/repo --by-directory # code map, path:line refs
|
|
407
|
+
sourcecode export /path/to/repo --module-graph # module→module dependencies
|
|
408
|
+
sourcecode export /path/to/repo --integrations # outbound HTTP/LDAP/JMS clients
|
|
409
|
+
sourcecode export /path/to/repo --c4 # unified architecture + manifest
|
|
421
410
|
```
|
|
422
411
|
|
|
423
412
|
Emits **structured, tool-agnostic** codebase views as plain JSON/YAML — the kind of input an architecture-doc generator, diagram renderer, or code-search agent can consume directly instead of walking the tree file by file. Section labels map to the open [C4 model](https://c4model.com) (an open architecture notation, not a product); the schema is vendor-neutral.
|
|
@@ -434,15 +423,15 @@ The section flags compose (pass several for one multi-section document); `--c4`
|
|
|
434
423
|
### `spring-audit` — Spring semantic audit [free]
|
|
435
424
|
|
|
436
425
|
```bash
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
426
|
+
sourcecode spring-audit /path/to/repo
|
|
427
|
+
sourcecode spring-audit /path/to/repo --scope tx # TX anomalies only
|
|
428
|
+
sourcecode spring-audit /path/to/repo --scope security # security surface only
|
|
429
|
+
sourcecode spring-audit /path/to/repo --min-severity high
|
|
441
430
|
|
|
442
431
|
# CI/CD gate: exit 1 on any finding
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
432
|
+
sourcecode spring-audit . --ci
|
|
433
|
+
sourcecode spring-audit . --ci --min-severity high # exit 1 only on high/critical
|
|
434
|
+
sourcecode spring-audit . --ci --format github-comment # Markdown output + exit 1
|
|
446
435
|
```
|
|
447
436
|
|
|
448
437
|
Detects structural Spring anomalies that survive code review and tests, but cause production failures:
|
|
@@ -465,9 +454,9 @@ Endpoints guarded by a project-specific authorization annotation are treated as
|
|
|
465
454
|
### `impact-chain` — systemic blast radius with TX/SEC enrichment [free]
|
|
466
455
|
|
|
467
456
|
```bash
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
457
|
+
sourcecode impact-chain OrderService /path/to/repo
|
|
458
|
+
sourcecode impact-chain com.example.OrderService#placeOrder /path/to/repo
|
|
459
|
+
sourcecode impact-chain PaymentService . --depth 6
|
|
471
460
|
```
|
|
472
461
|
|
|
473
462
|
Unlike `impact` (which traces the caller graph), `impact-chain` builds on the SpringSemanticModel to enrich every step of the blast cone with transaction and security context:
|
|
@@ -494,7 +483,7 @@ Unlike `impact` (which traces the caller graph), `impact-chain` builds on the Sp
|
|
|
494
483
|
**Event topology** — query the publisher/consumer graph for a Spring event class:
|
|
495
484
|
|
|
496
485
|
```bash
|
|
497
|
-
|
|
486
|
+
sourcecode impact-chain OrderPlacedEvent /path/to/repo --type events
|
|
498
487
|
```
|
|
499
488
|
|
|
500
489
|
| Field | Description |
|
|
@@ -514,8 +503,8 @@ ask impact-chain OrderPlacedEvent /path/to/repo --type events
|
|
|
514
503
|
### `cold-start` — RIS bootstrap context
|
|
515
504
|
|
|
516
505
|
```bash
|
|
517
|
-
|
|
518
|
-
|
|
506
|
+
sourcecode cold-start /path/to/repo
|
|
507
|
+
sourcecode cold-start /path/to/repo --compact # ~10K token subset
|
|
519
508
|
```
|
|
520
509
|
|
|
521
510
|
Returns the Repository Intelligence Snapshot (RIS) instantly — zero re-analysis. The RIS is built by a prior warm cache pass and includes stacks, entry points, endpoint surface, and Spring semantic signals. Status field: `cold_start_ready` | `cold_start_stale` | `no_ris`.
|
|
@@ -525,12 +514,12 @@ Use `--compact` to get a ~10K token subset safe for direct LLM injection. Full s
|
|
|
525
514
|
### `repo-ir` — symbol-level IR
|
|
526
515
|
|
|
527
516
|
```bash
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
517
|
+
sourcecode repo-ir /path/to/repo --summary-only # ~20K tokens
|
|
518
|
+
sourcecode repo-ir /path/to/repo --since HEAD~1 # symbol-level diff
|
|
519
|
+
sourcecode repo-ir /path/to/repo --files src/.../OrderService.java
|
|
520
|
+
sourcecode repo-ir /path/to/repo --max-nodes 200 --max-edges 500 # limit graph size
|
|
521
|
+
sourcecode repo-ir /path/to/repo --output ir.json.gz --gzip # compressed output (~70-80% smaller)
|
|
522
|
+
sourcecode repo-ir /path/to/repo --include-tests # include test files
|
|
534
523
|
```
|
|
535
524
|
|
|
536
525
|
Builds a deterministic symbol graph: classes, methods, import/injection edges, Spring roles, subsystems.
|
|
@@ -551,9 +540,9 @@ Builds a deterministic symbol graph: classes, methods, import/injection edges, S
|
|
|
551
540
|
### `explain` — architectural summary for a class
|
|
552
541
|
|
|
553
542
|
```bash
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
543
|
+
sourcecode explain UserService
|
|
544
|
+
sourcecode explain OrderController /path/to/repo
|
|
545
|
+
sourcecode explain UserService --format json
|
|
557
546
|
```
|
|
558
547
|
|
|
559
548
|
Human-readable architectural summary derived entirely from static analysis: Spring stereotype, public methods, incoming callers, outgoing dependencies, events published/consumed, `@Transactional` boundaries, security constraints, and related REST endpoints. JAVA/SPRING ONLY.
|
|
@@ -561,8 +550,8 @@ Human-readable architectural summary derived entirely from static analysis: Spri
|
|
|
561
550
|
### `pr-impact` — PR blast-radius report
|
|
562
551
|
|
|
563
552
|
```bash
|
|
564
|
-
|
|
565
|
-
|
|
553
|
+
sourcecode pr-impact --files changed_files.txt
|
|
554
|
+
sourcecode pr-impact /path/to/repo --files diff.txt --format json
|
|
566
555
|
```
|
|
567
556
|
|
|
568
557
|
Takes a file listing changed Java files (one path per line) and produces a consolidated report: modified classes, affected REST endpoints reachable through the call chain, direct callers of each changed class, event publishers/consumers triggered, `@Transactional` methods in changed classes, and a consolidated risk level (`CRITICAL` / `HIGH` / `MEDIUM` / `LOW`). JAVA/SPRING ONLY.
|
|
@@ -570,13 +559,13 @@ Takes a file listing changed Java files (one path per line) and produces a conso
|
|
|
570
559
|
```bash
|
|
571
560
|
# Typical CI usage: pipe git diff to a file, then run
|
|
572
561
|
git diff --name-only main | grep '\.java$' > changed.txt
|
|
573
|
-
|
|
562
|
+
sourcecode pr-impact . --files changed.txt --format json
|
|
574
563
|
```
|
|
575
564
|
|
|
576
565
|
### `onboard` — codebase orientation
|
|
577
566
|
|
|
578
567
|
```bash
|
|
579
|
-
|
|
568
|
+
sourcecode onboard /path/to/repo
|
|
580
569
|
```
|
|
581
570
|
|
|
582
571
|
Entry points, architecture summary, key files, confidence level, and gaps. Designed to be injected as agent context at the start of a session.
|
|
@@ -584,8 +573,8 @@ Entry points, architecture summary, key files, confidence level, and gaps. Desig
|
|
|
584
573
|
### `review-pr` — PR review context [free ≤500 Java files · Pro above]
|
|
585
574
|
|
|
586
575
|
```bash
|
|
587
|
-
|
|
588
|
-
|
|
576
|
+
sourcecode review-pr /path/to/repo --since main
|
|
577
|
+
sourcecode review-pr /path/to/repo --since HEAD~3
|
|
589
578
|
```
|
|
590
579
|
|
|
591
580
|
Changed files, risk ranking, test coverage gaps, affected modules, and blast radius of changed classes. Returns a `ci_decision` field for CI/CD integration.
|
|
@@ -593,7 +582,7 @@ Changed files, risk ranking, test coverage gaps, affected modules, and blast rad
|
|
|
593
582
|
### `fix-bug` — Bug triage context [free ≤500 Java files · Pro above]
|
|
594
583
|
|
|
595
584
|
```bash
|
|
596
|
-
|
|
585
|
+
sourcecode fix-bug /path/to/repo --symptom "NullPointerException in checkout"
|
|
597
586
|
```
|
|
598
587
|
|
|
599
588
|
Risk-ranked file list correlated to the symptom: keyword extraction, path matching, content matching, git commit correlation.
|
|
@@ -601,7 +590,7 @@ Risk-ranked file list correlated to the symptom: keyword extraction, path matchi
|
|
|
601
590
|
### `modernize` — Modernization planning [free ≤500 Java files · Pro above]
|
|
602
591
|
|
|
603
592
|
```bash
|
|
604
|
-
|
|
593
|
+
sourcecode modernize /path/to/repo
|
|
605
594
|
```
|
|
606
595
|
|
|
607
596
|
High-coupling nodes (high fan-in = risky to change), dead zone candidates (isolated symbols), subsystem tangles.
|
|
@@ -609,12 +598,20 @@ High-coupling nodes (high fan-in = risky to change), dead zone candidates (isola
|
|
|
609
598
|
### `migrate-check` — Spring Boot 2→3 migration readiness
|
|
610
599
|
|
|
611
600
|
```bash
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
601
|
+
sourcecode migrate-check /path/to/repo
|
|
602
|
+
sourcecode migrate-check . --compact # bounded decision summary (score, blocker, effort, top items)
|
|
603
|
+
sourcecode migrate-check . --min-severity high
|
|
604
|
+
sourcecode migrate-check . --format text
|
|
605
|
+
sourcecode migrate-check . --output migration.json
|
|
616
606
|
```
|
|
617
607
|
|
|
608
|
+
`--compact` returns the decision-grade envelope — readiness scores, headline blocker,
|
|
609
|
+
blocking count, estimated effort, executive summary, Hibernate classification and
|
|
610
|
+
aggregate counts — with each large collection capped to its top items (`+N more`). On
|
|
611
|
+
large monoliths this is ~97% smaller than the full report (e.g. 1.2 MB → 32 KB), so an
|
|
612
|
+
agent or reviewer gets the verdict without the full leaf-level firehose. The complete
|
|
613
|
+
report remains the default.
|
|
614
|
+
|
|
618
615
|
Detects migration blockers across Java source files, Spring XML config files, and Maven/Gradle build files. 27 rules organized by target:
|
|
619
616
|
|
|
620
617
|
**Jakarta namespace (MIG-001..009) — javax→jakarta**
|
|
@@ -789,19 +786,19 @@ evidence. `migrate-check` enforces:
|
|
|
789
786
|
|
|
790
787
|
```bash
|
|
791
788
|
# inspect only the Hibernate rewrite targets
|
|
792
|
-
|
|
789
|
+
sourcecode migrate-check . --format json | jq '.hibernate.rewrite_targets[]'
|
|
793
790
|
|
|
794
791
|
# product blockers only (excludes test/fixtures + hygiene)
|
|
795
|
-
|
|
792
|
+
sourcecode migrate-check . --format json | jq '.blocking_count, .non_blocking, .hygiene_findings'
|
|
796
793
|
```
|
|
797
794
|
|
|
798
795
|
### `rename-class` — Java class rename
|
|
799
796
|
|
|
800
797
|
```bash
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
798
|
+
sourcecode rename-class . --from ServiceA --to ServiceB
|
|
799
|
+
sourcecode rename-class /path/to/repo --from OrderManager --to OrderService
|
|
800
|
+
sourcecode rename-class . --from OldName --to NewName --dry-run
|
|
801
|
+
sourcecode rename-class . --from OldName --to NewName --no-tests # src/main only
|
|
805
802
|
```
|
|
806
803
|
|
|
807
804
|
Renames a Java class safely throughout the repository: declaration, constructor, all import statements, type references (fields, params, return types), `extends`/`implements`, generics, casts, and Spring `@Qualifier` names. Renames the physical `.java` file. Emits a structured change audit trail (`file`, `before_lines`, `after_lines`, `intent`, `diff`).
|
|
@@ -811,10 +808,10 @@ Use `--dry-run` to preview changes without writing to disk.
|
|
|
811
808
|
### `chunk-file` — split large Java files for agent consumption
|
|
812
809
|
|
|
813
810
|
```bash
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
811
|
+
sourcecode chunk-file BigService.java
|
|
812
|
+
sourcecode chunk-file BigService.java --max-lines 300
|
|
813
|
+
sourcecode chunk-file BigService.java --chunk 5 # read chunk 5 only
|
|
814
|
+
sourcecode chunk-file BigService.java --metadata-only # boundaries only, no content
|
|
818
815
|
```
|
|
819
816
|
|
|
820
817
|
Splits a large Java file at method/class boundaries so AI agents can read files with 10K–25K+ lines in context-sized pieces. Each chunk includes `chunk_id`, `start_line`, `end_line`, `chunk_type`, symbol name, a `context_header` (package + class + imports summary), and `content`. A `size_warning` flag marks methods that exceed `--max-lines` and cannot be split further.
|
|
@@ -824,7 +821,7 @@ Splits a large Java file at method/class boundaries so AI agents can read files
|
|
|
824
821
|
Low-level access to all tasks with full options:
|
|
825
822
|
|
|
826
823
|
```bash
|
|
827
|
-
|
|
824
|
+
sourcecode prepare-context TASK [PATH] [OPTIONS]
|
|
828
825
|
```
|
|
829
826
|
|
|
830
827
|
| Task | What it surfaces |
|
|
@@ -883,9 +880,9 @@ All outputs include:
|
|
|
883
880
|
Anonymous, **on by default (opt-out)**. Collects: version, OS, commands, flags, duration, repo size range, errors. No source code, paths, secrets, or output content. A one-time notice is shown on first interactive run.
|
|
884
881
|
|
|
885
882
|
```bash
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
883
|
+
sourcecode telemetry status
|
|
884
|
+
sourcecode telemetry enable
|
|
885
|
+
sourcecode telemetry disable
|
|
889
886
|
```
|
|
890
887
|
|
|
891
888
|
Disable any time: `export SOURCECODE_TELEMETRY=0` (or `DO_NOT_TRACK=1`)
|
|
@@ -895,7 +892,7 @@ Disable any time: `export SOURCECODE_TELEMETRY=0` (or `DO_NOT_TRACK=1`)
|
|
|
895
892
|
## Configuration
|
|
896
893
|
|
|
897
894
|
```bash
|
|
898
|
-
|
|
895
|
+
sourcecode config # show version, config file path, telemetry status
|
|
899
896
|
```
|
|
900
897
|
|
|
901
898
|
### `sourcecode.config.json` (repo root)
|