sourcecode 1.53.0__py3-none-any.whl → 1.54.0__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 +1 -1
- sourcecode/cli.py +79 -0
- {sourcecode-1.53.0.dist-info → sourcecode-1.54.0.dist-info}/METADATA +3 -3
- {sourcecode-1.53.0.dist-info → sourcecode-1.54.0.dist-info}/RECORD +7 -7
- {sourcecode-1.53.0.dist-info → sourcecode-1.54.0.dist-info}/WHEEL +0 -0
- {sourcecode-1.53.0.dist-info → sourcecode-1.54.0.dist-info}/entry_points.txt +0 -0
- {sourcecode-1.53.0.dist-info → sourcecode-1.54.0.dist-info}/licenses/LICENSE +0 -0
sourcecode/__init__.py
CHANGED
sourcecode/cli.py
CHANGED
|
@@ -4137,6 +4137,82 @@ def _directory_hashes(file_list: "list[str]", root: "Path") -> "dict[str, str]":
|
|
|
4137
4137
|
return out
|
|
4138
4138
|
|
|
4139
4139
|
|
|
4140
|
+
# Architectural layer directory names used to recognize a layered module
|
|
4141
|
+
# (DDD / hexagonal). The module *root* is the directory directly above the
|
|
4142
|
+
# shallowest layer dir, so symbols living in domain/application/infrastructure
|
|
4143
|
+
# subdirs all roll up to one module — a consumer counts modules, not leaf dirs.
|
|
4144
|
+
_LAYER_MARKERS: "frozenset[str]" = frozenset({
|
|
4145
|
+
"domain", "application", "infrastructure",
|
|
4146
|
+
"interfaces", "presentation", "adapters", "ports", "api",
|
|
4147
|
+
})
|
|
4148
|
+
# Core DDD layers — presence of >=2 marks a module as DDD-layered vs flat/legacy.
|
|
4149
|
+
_DDD_CORE_LAYERS: "frozenset[str]" = frozenset({
|
|
4150
|
+
"domain", "application", "infrastructure",
|
|
4151
|
+
})
|
|
4152
|
+
|
|
4153
|
+
|
|
4154
|
+
def _module_root_of(leaf_dir: "str") -> "tuple[str, str | None]":
|
|
4155
|
+
"""Map a leaf source directory to its architectural module root.
|
|
4156
|
+
|
|
4157
|
+
For a layered module ``<root>/<layer>/...`` the root is the path above the
|
|
4158
|
+
shallowest recognized layer dir, and the layer name is returned alongside.
|
|
4159
|
+
Flat directories (no layer marker) are their own root with a ``None`` layer.
|
|
4160
|
+
Pure-structural — no file reads.
|
|
4161
|
+
"""
|
|
4162
|
+
parts = leaf_dir.split("/")
|
|
4163
|
+
for i, seg in enumerate(parts):
|
|
4164
|
+
if seg.lower() in _LAYER_MARKERS:
|
|
4165
|
+
return "/".join(parts[:i]) or ".", seg.lower()
|
|
4166
|
+
return leaf_dir, None
|
|
4167
|
+
|
|
4168
|
+
|
|
4169
|
+
def _detect_module_roots(by_directory: "dict[str, list]") -> "dict":
|
|
4170
|
+
"""Roll leaf source dirs up to architectural module roots and classify them.
|
|
4171
|
+
|
|
4172
|
+
Resolves the leaf-directory-vs-module mismatch in the C4 component view: a
|
|
4173
|
+
DDD module split across ``domain/`` / ``application/`` / ``infrastructure/``
|
|
4174
|
+
subdirs is reported once, with its layers and a structural ``pattern``
|
|
4175
|
+
(``layered`` when it carries >=2 core DDD layers, else ``flat``). Gives a
|
|
4176
|
+
downstream consumer a verifiable module enumeration and a DDD-vs-legacy
|
|
4177
|
+
signal instead of forcing it to infer module boundaries from directory names.
|
|
4178
|
+
"""
|
|
4179
|
+
roots: "dict[str, dict]" = {}
|
|
4180
|
+
for leaf, symbols in by_directory.items():
|
|
4181
|
+
root, layer = _module_root_of(leaf)
|
|
4182
|
+
slot = roots.setdefault(
|
|
4183
|
+
root, {"layers": set(), "symbol_count": 0, "leaf_dirs": 0}
|
|
4184
|
+
)
|
|
4185
|
+
if layer:
|
|
4186
|
+
slot["layers"].add(layer)
|
|
4187
|
+
slot["symbol_count"] += len(symbols)
|
|
4188
|
+
slot["leaf_dirs"] += 1
|
|
4189
|
+
|
|
4190
|
+
modules: "list[dict]" = []
|
|
4191
|
+
layered = flat = 0
|
|
4192
|
+
for root in sorted(roots):
|
|
4193
|
+
s = roots[root]
|
|
4194
|
+
pattern = "layered" if len(s["layers"] & _DDD_CORE_LAYERS) >= 2 else "flat"
|
|
4195
|
+
if pattern == "layered":
|
|
4196
|
+
layered += 1
|
|
4197
|
+
else:
|
|
4198
|
+
flat += 1
|
|
4199
|
+
modules.append({
|
|
4200
|
+
"root": root,
|
|
4201
|
+
"pattern": pattern,
|
|
4202
|
+
"layers": sorted(s["layers"]),
|
|
4203
|
+
"symbol_count": s["symbol_count"],
|
|
4204
|
+
"leaf_dir_count": s["leaf_dirs"],
|
|
4205
|
+
})
|
|
4206
|
+
return {
|
|
4207
|
+
"modules": modules,
|
|
4208
|
+
"summary": {
|
|
4209
|
+
"module_count": len(modules),
|
|
4210
|
+
"layered_module_count": layered,
|
|
4211
|
+
"flat_module_count": flat,
|
|
4212
|
+
},
|
|
4213
|
+
}
|
|
4214
|
+
|
|
4215
|
+
|
|
4140
4216
|
def _build_c4_export(
|
|
4141
4217
|
root: "Path",
|
|
4142
4218
|
file_list: "list[str]",
|
|
@@ -4155,6 +4231,9 @@ def _build_c4_export(
|
|
|
4155
4231
|
"""
|
|
4156
4232
|
by_directory = _group_symbols_by_directory(nodes)
|
|
4157
4233
|
module_graph = _build_module_graph(nodes, edges)
|
|
4234
|
+
# Architectural module-root rollup + DDD/legacy classification, so a
|
|
4235
|
+
# consumer counts/classifies modules instead of inferring them from leaf dirs.
|
|
4236
|
+
module_graph["module_roots"] = _detect_module_roots(by_directory)
|
|
4158
4237
|
api_surface = _group_endpoints_by_controller(endpoints)
|
|
4159
4238
|
containers = _detect_containers(root)
|
|
4160
4239
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sourcecode
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.54.0
|
|
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,7 +40,7 @@ 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
46
|
---
|
|
@@ -404,7 +404,7 @@ Emits **structured, tool-agnostic** codebase views as plain JSON/YAML — the ki
|
|
|
404
404
|
| `--by-directory` | One group per source directory, each symbol with a `source_file:line` reference. |
|
|
405
405
|
| `--module-graph` | `{nodes, edges, summary}` — directories as modules, inter-module dependencies rolled up from class-level relation edges with hit counts + edge types. |
|
|
406
406
|
| `--integrations` | Outbound integrations (`RestTemplate`, `WebClient`, `@FeignClient`, `LdapTemplate`, `JmsTemplate`, ActiveMQ) with `file:line` evidence and a literal `target` URL/name when present. |
|
|
407
|
-
| `--c4` | Unified document: `c4.{context, containers, components, code}` + `api_surface` + a `manifest` with per-directory content hashes for **incremental** consumers (skip directories whose hash is unchanged). |
|
|
407
|
+
| `--c4` | Unified document: `c4.{context, containers, components, code}` + `api_surface` + a `manifest` with per-directory content hashes for **incremental** consumers (skip directories whose hash is unchanged). `components.module_roots` rolls leaf source dirs up to architectural module roots and classifies each `layered` (DDD: ≥2 of `domain`/`application`/`infrastructure`) vs `flat` (legacy/flat package), with a verifiable `module_count` — so a consumer enumerates real modules instead of inferring boundaries from leaf directories. |
|
|
408
408
|
|
|
409
409
|
The section flags compose (pass several for one multi-section document); `--c4` assembles the full export on its own. URLs assembled at runtime yield `target: null` (honest absence, never a guess); containers are derived from build files (Maven/Gradle) and reported as a limitation when none are found.
|
|
410
410
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
sourcecode/__init__.py,sha256=
|
|
1
|
+
sourcecode/__init__.py,sha256=LfTE9XTRZtRV8IXTdhYD92vZwvIIvz8cRORq_nAxiD4,103
|
|
2
2
|
sourcecode/adaptive_scanner.py,sha256=XffluXKzJUXrMtjEiAOnSNPZnztdIcts17T9ouHeID0,10521
|
|
3
3
|
sourcecode/architecture_analyzer.py,sha256=liCwQmLgb5vplohy8arjYxs_HOIv5C9MjLh_gY6bc5Q,44115
|
|
4
4
|
sourcecode/architecture_summary.py,sha256=z34_6v7cSwy98cof2UVciGho7SCrZ93tiqMmq5WNzRQ,20405
|
|
@@ -7,7 +7,7 @@ sourcecode/cache.py,sha256=1V3vsaODAa2UBJAC0xpvxpmRdriCezQx5Q8JCcfgziE,31892
|
|
|
7
7
|
sourcecode/canonical_ir.py,sha256=DEwucOPJguLsVtg5cV8mWXNi112l5jmBhv73KGGebVk,24849
|
|
8
8
|
sourcecode/cir_graphs.py,sha256=9G0HHj1kw2325IDyzo2OpX73BNswEckecf4MZUXB4JM,12078
|
|
9
9
|
sourcecode/classifier.py,sha256=hKzg-nQ47htqqIUzSGvYxv15cXrA3KgICTwJmdqal0o,8095
|
|
10
|
-
sourcecode/cli.py,sha256=
|
|
10
|
+
sourcecode/cli.py,sha256=PpqOLcYhNljXCJ0V_RjO9RgsgjzgtDK5jIDTqI3Hk6k,275872
|
|
11
11
|
sourcecode/code_notes_analyzer.py,sha256=EJemNCNc9Dn-1RZYu-aNbK0ELzmsyC4s6FdHi3XyNEI,9392
|
|
12
12
|
sourcecode/confidence_analyzer.py,sha256=_jckZSxksV-OU38vbkxfVNBnWCtlCq8Vwfg23x1uspA,19054
|
|
13
13
|
sourcecode/context_scorer.py,sha256=QpChSpsmaAYz91rXA4Ue5xzQmNz_ZboZN09YOHScq1U,14679
|
|
@@ -102,8 +102,8 @@ sourcecode/telemetry/consent.py,sha256=wLMvGNJeSSyZoNkQXpoUioY6mMv4Qdvuw7S9jAEWn
|
|
|
102
102
|
sourcecode/telemetry/events.py,sha256=LtzYfaX9Ilckj5PTvAcTpDa9mLqDsYPDUiDkRa58piY,2580
|
|
103
103
|
sourcecode/telemetry/filters.py,sha256=NHa5T-6DaZduQPFuC34jOqHWQgSizM-Ygq8aZ4j19ng,5834
|
|
104
104
|
sourcecode/telemetry/transport.py,sha256=4gGHsq0WeY9VywEZXA3vUxykfiYnw9uuqfjAAec7F8o,1681
|
|
105
|
-
sourcecode-1.
|
|
106
|
-
sourcecode-1.
|
|
107
|
-
sourcecode-1.
|
|
108
|
-
sourcecode-1.
|
|
109
|
-
sourcecode-1.
|
|
105
|
+
sourcecode-1.54.0.dist-info/METADATA,sha256=IKf3ufkzi2IYGswenS8AADWj8eUsW6YPFFhJl_mT6M4,37049
|
|
106
|
+
sourcecode-1.54.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
107
|
+
sourcecode-1.54.0.dist-info/entry_points.txt,sha256=ex3F9rmbXeyDIoFQHtkEqTsKSaJow8F0LrVu8XfIktQ,57
|
|
108
|
+
sourcecode-1.54.0.dist-info/licenses/LICENSE,sha256=7DdHrU9Z_3e7dSvq4ISijZNjnuHo5NIHNiHDouMQ9JU,10491
|
|
109
|
+
sourcecode-1.54.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|