sourcecode 4.10.0__py3-none-any.whl → 4.10.2__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.
Potentially problematic release.
This version of sourcecode might be problematic. Click here for more details.
- sourcecode/__init__.py +1 -1
- sourcecode/migrate_check.py +1 -0
- sourcecode/provenance.py +12 -9
- sourcecode/repository_ir.py +21 -0
- sourcecode/runs.py +12 -1
- sourcecode/security_config_scan.py +12 -0
- {sourcecode-4.10.0.dist-info → sourcecode-4.10.2.dist-info}/METADATA +11 -4
- {sourcecode-4.10.0.dist-info → sourcecode-4.10.2.dist-info}/RECORD +11 -11
- {sourcecode-4.10.0.dist-info → sourcecode-4.10.2.dist-info}/WHEEL +0 -0
- {sourcecode-4.10.0.dist-info → sourcecode-4.10.2.dist-info}/entry_points.txt +0 -0
- {sourcecode-4.10.0.dist-info → sourcecode-4.10.2.dist-info}/licenses/LICENSE +0 -0
sourcecode/__init__.py
CHANGED
sourcecode/migrate_check.py
CHANGED
sourcecode/provenance.py
CHANGED
|
@@ -162,6 +162,7 @@ def build_evidence_manifest(
|
|
|
162
162
|
command: str,
|
|
163
163
|
root: Path,
|
|
164
164
|
inputs: Optional[dict[str, Any]] = None,
|
|
165
|
+
include_generated_at: bool = True,
|
|
165
166
|
) -> dict[str, Any]:
|
|
166
167
|
"""Build a machine-readable provenance index for an existing payload."""
|
|
167
168
|
root = Path(root).resolve()
|
|
@@ -173,17 +174,19 @@ def build_evidence_manifest(
|
|
|
173
174
|
for claim in claims
|
|
174
175
|
if (claim.get("source") or {}).get("path")
|
|
175
176
|
})
|
|
177
|
+
run: dict[str, Any] = {
|
|
178
|
+
"command": command,
|
|
179
|
+
"tool": "ask",
|
|
180
|
+
"tool_version": __version__,
|
|
181
|
+
"repository": str(root),
|
|
182
|
+
"git_head": _git_head(root),
|
|
183
|
+
"inputs": inputs or {},
|
|
184
|
+
}
|
|
185
|
+
if include_generated_at:
|
|
186
|
+
run["generated_at"] = datetime.now(timezone.utc).isoformat()
|
|
176
187
|
return {
|
|
177
188
|
"schema_version": PROVENANCE_SCHEMA,
|
|
178
|
-
"run":
|
|
179
|
-
"command": command,
|
|
180
|
-
"tool": "ask",
|
|
181
|
-
"tool_version": __version__,
|
|
182
|
-
"repository": str(root),
|
|
183
|
-
"git_head": _git_head(root),
|
|
184
|
-
"generated_at": datetime.now(timezone.utc).isoformat(),
|
|
185
|
-
"inputs": inputs or {},
|
|
186
|
-
},
|
|
189
|
+
"run": run,
|
|
187
190
|
"claims": claims,
|
|
188
191
|
"sources": [{"path": path} for path in sources],
|
|
189
192
|
"claims_cap": (
|
sourcecode/repository_ir.py
CHANGED
|
@@ -6975,6 +6975,27 @@ def compute_blast_radius(
|
|
|
6975
6975
|
)
|
|
6976
6976
|
except Exception:
|
|
6977
6977
|
_impl_graph = None
|
|
6978
|
+
if _impl_graph is not None:
|
|
6979
|
+
_class_fqns = {
|
|
6980
|
+
n.get("fqn") or ""
|
|
6981
|
+
for n in graph_nodes
|
|
6982
|
+
if (n.get("symbol_kind") or n.get("type"))
|
|
6983
|
+
in {"class", "interface", "enum", "record", "annotation"}
|
|
6984
|
+
}
|
|
6985
|
+
|
|
6986
|
+
def _seed_class(_sym: str) -> str:
|
|
6987
|
+
return _sym if _sym in _class_fqns else _enclosing_class(_sym)
|
|
6988
|
+
|
|
6989
|
+
_seed_set = set(matched_fqns)
|
|
6990
|
+
_expanded = set(matched_fqns)
|
|
6991
|
+
_symbols_by_class: dict[str, list[str]] = {}
|
|
6992
|
+
for _sym in reverse_graph:
|
|
6993
|
+
_symbols_by_class.setdefault(_seed_class(_sym), []).append(_sym)
|
|
6994
|
+
for _seed in sorted(_seed_set):
|
|
6995
|
+
for _subtype in getattr(_impl_graph, "all_subtypes_of")(_seed_class(_seed)):
|
|
6996
|
+
for _sym in _symbols_by_class.get(_subtype, ()):
|
|
6997
|
+
_expanded.add(_sym)
|
|
6998
|
+
matched_fqns = _expanded
|
|
6978
6999
|
for seed in matched_fqns:
|
|
6979
7000
|
_seed_callers = _all_callers_from_rg(seed, reverse_graph, _rg_index, _impl_graph)
|
|
6980
7001
|
if len(_seed_callers) > _HUB_CALLER_THRESHOLD and max_depth > 1:
|
sourcecode/runs.py
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
4
|
import json
|
|
5
|
+
import hashlib
|
|
5
6
|
import os
|
|
6
7
|
import time
|
|
7
8
|
import uuid
|
|
@@ -18,7 +19,17 @@ def _now() -> float:
|
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
def _runs_dir(root: Path) -> Path:
|
|
21
|
-
|
|
22
|
+
override = os.environ.get("ASK_RUNS_DIR", "").strip()
|
|
23
|
+
if override:
|
|
24
|
+
return Path(override).expanduser().resolve()
|
|
25
|
+
if os.environ.get("ASK_RUNS_IN_REPO", "").lower() in ("1", "true", "yes", "on"):
|
|
26
|
+
return Path(root).resolve() / ".ask" / "runs"
|
|
27
|
+
try:
|
|
28
|
+
key_source = str(Path(root).resolve())
|
|
29
|
+
except Exception:
|
|
30
|
+
key_source = str(Path(root).absolute())
|
|
31
|
+
repo_key = hashlib.sha256(key_source.encode("utf-8", errors="replace")).hexdigest()[:16]
|
|
32
|
+
return Path.home() / ".sourcecode" / "runs" / repo_key
|
|
22
33
|
|
|
23
34
|
|
|
24
35
|
@dataclass
|
|
@@ -212,6 +212,15 @@ _COMMENTED_CONFIG_CONTROLS: tuple[tuple[re.Pattern, str, str], ...] = (
|
|
|
212
212
|
),
|
|
213
213
|
)
|
|
214
214
|
|
|
215
|
+
_COMMENTED_JAVA_HINTS = (
|
|
216
|
+
"@PreAuthorize", "@PostAuthorize", "@Secured", "@RolesAllowed", "@DenyAll",
|
|
217
|
+
"@PermitAll", "FiltroSeguridad", "Security", "Authz", "Authorize",
|
|
218
|
+
"Authorized", "setSecure", "csrfTokenRepository", "csrf(",
|
|
219
|
+
)
|
|
220
|
+
_COMMENTED_XML_HINTS = (
|
|
221
|
+
"<transport-guarantee", "CONFIDENTIAL", "<security-constraint", "<intercept-url",
|
|
222
|
+
)
|
|
223
|
+
|
|
215
224
|
|
|
216
225
|
@dataclass(frozen=True)
|
|
217
226
|
class SecurityConfigObservation:
|
|
@@ -456,6 +465,9 @@ def _scan_commented_controls(
|
|
|
456
465
|
from sourcecode.source_text import commented_spans
|
|
457
466
|
|
|
458
467
|
rules = _COMMENTED_XML_CONTROLS if xml else _COMMENTED_JAVA_CONTROLS
|
|
468
|
+
hints = _COMMENTED_XML_HINTS if xml else _COMMENTED_JAVA_HINTS
|
|
469
|
+
if not any(hint in source for hint in hints):
|
|
470
|
+
return []
|
|
459
471
|
out: "list[SecurityConfigObservation]" = []
|
|
460
472
|
seen: set[tuple[str, int]] = set()
|
|
461
473
|
for start, end in commented_spans(source, xml=xml):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sourcecode
|
|
3
|
-
Version: 4.10.
|
|
3
|
+
Version: 4.10.2
|
|
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
|
|
@@ -42,7 +42,7 @@ Description-Content-Type: text/markdown
|
|
|
42
42
|
|
|
43
43
|
**Context · Impact · Migration · Architecture · Review — everything from one structural model.**
|
|
44
44
|
|
|
45
|
-

|
|
46
46
|

|
|
47
47
|
|
|
48
48
|
> **ASK Engine** is the product. The CLI command is **`ask`**. The legacy **`sourcecode`**
|
|
@@ -73,7 +73,14 @@ These numbers are cache-layer benchmarks, not a promise for every command. Per-s
|
|
|
73
73
|
|
|
74
74
|
With the right command class, ASK Engine becomes **constant infrastructure** inside agent loops — call the fast/context surfaces before edits and reserve deep compositions for the points where their evidence is worth the runtime.
|
|
75
75
|
|
|
76
|
-
**Large-repo controls.** Set `ASK_PROGRESS=1` to get line heartbeats in non-TTY
|
|
76
|
+
**Large-repo controls.** Set `ASK_PROGRESS=1` to get line heartbeats in non-TTY
|
|
77
|
+
supervised runs. Long repo-wide/deep runs also write durable records under
|
|
78
|
+
`~/.sourcecode/runs/<repo-hash>/` by default, not inside the audited repository;
|
|
79
|
+
set `ASK_RUNS_IN_REPO=1` only when repo-local `.ask/runs` records are intentional.
|
|
80
|
+
Set `ASK_MAX_ANALYSIS_SECONDS=<seconds>` to fail before starting a repo-wide/deep
|
|
81
|
+
command whose configured budget is below its safe floor. Use
|
|
82
|
+
`ask audit-report --from-risk risk.json` to package an existing risk run instead
|
|
83
|
+
of recomputing it.
|
|
77
84
|
|
|
78
85
|
**What a warm actually covers.** `ask cache warm` runs the compact analysis: it rebuilds the
|
|
79
86
|
shared structural layers (L1/L2 + the Repository Intelligence Snapshot + the shared Canonical
|
|
@@ -99,7 +106,7 @@ brew tap haroundominique/sourcecode && brew install sourcecode
|
|
|
99
106
|
# pip / pipx
|
|
100
107
|
pipx install sourcecode # or: pip install sourcecode
|
|
101
108
|
|
|
102
|
-
ask version # ask 4.10.
|
|
109
|
+
ask version # ask 4.10.2 — and, on a build that has aged,
|
|
103
110
|
# how many releases have probably shipped since
|
|
104
111
|
```
|
|
105
112
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
sourcecode/__init__.py,sha256=
|
|
1
|
+
sourcecode/__init__.py,sha256=xskHY5rRjTUnc0g0owXUqwzO6Eu4fz6BniL2gUx5fz0,309
|
|
2
2
|
sourcecode/adaptive_scanner.py,sha256=yJBKjNpkY6bpueYJ2YnRezen3sYZDecEt7WaaNWdqug,9466
|
|
3
3
|
sourcecode/archetype.py,sha256=CZvRLpkHot_D8D3JFQVorr-EHDJyh0BbS7RnSTqBigM,40499
|
|
4
4
|
sourcecode/architectural_baseline.py,sha256=agDSwGEakdkgLLh5xnd3hiD_TC6pRujWt4klnuYF1wo,18689
|
|
@@ -66,7 +66,7 @@ sourcecode/jdk_exports.py,sha256=fCrlwNAXUT9gge_joq6kMnY3zJxYB2pxqy-0w3o3MJI,874
|
|
|
66
66
|
sourcecode/license.py,sha256=vvgE1vBUWh8ozWI7USYuteh6noxntnjuzDQIPF-l4rA,27795
|
|
67
67
|
sourcecode/mcp_nudge.py,sha256=lKemOqK_wny2u7Ymcr2Idi5Kx8pXY02jCi-_nJYLGMg,2992
|
|
68
68
|
sourcecode/metrics_analyzer.py,sha256=gLoRWKygF18jLgwsqmGXSWopw-f5iO1VbM7Jjdif6ag,22809
|
|
69
|
-
sourcecode/migrate_check.py,sha256=
|
|
69
|
+
sourcecode/migrate_check.py,sha256=8KKgsiiWu21XwCXgFV1bB8AVsB-pl6KNBTmMW6NYGB8,149028
|
|
70
70
|
sourcecode/migration_blast.py,sha256=OPryWkM6-PbvcG3eJFdcWUnlpXBje41nu2BkrZnE2hg,9359
|
|
71
71
|
sourcecode/non_coverage.py,sha256=N4pLd0zKOEdkObzMz3TSMTCDRmV0dwqZtXWFFPR9gSo,12001
|
|
72
72
|
sourcecode/openapi_surface.py,sha256=BTt0K-woZbkbWTN77IkqeBm_Okag9owR0848fmot8sk,16207
|
|
@@ -82,7 +82,7 @@ sourcecode/pr_comment_renderer.py,sha256=239PmJdf95av_ZW236C7_tvq_ahECeuF9AZxrhe
|
|
|
82
82
|
sourcecode/pr_impact.py,sha256=eaFgcPMDsjaF8VZvcitFWCPCabMTi-khtGdxpK0wXTQ,22461
|
|
83
83
|
sourcecode/prepare_context.py,sha256=B8TiBQbazxUOz6D37Dt9zqbOtD5b2S_fR3MB15P9DrI,237206
|
|
84
84
|
sourcecode/progress.py,sha256=hbOPMSNMfoHYS-BL1HAH0VAQFR4u3TzWq0oJdeAPdjM,3921
|
|
85
|
-
sourcecode/provenance.py,sha256=
|
|
85
|
+
sourcecode/provenance.py,sha256=1_EGgBtJA3f8dOA_XKuENr0mQLnIJw87lXWdlkgFgqY,6661
|
|
86
86
|
sourcecode/ranking_engine.py,sha256=ZAucq_YX2KkWUuAZf4P0lhtQ_38vEFnUhuGtSZd1S0E,12970
|
|
87
87
|
sourcecode/readiness_timeline.py,sha256=qqc14vL9nj9E4qw4bVZpGhfMLaVaYr9s6Pak_VUIwt0,8008
|
|
88
88
|
sourcecode/reconciliation.py,sha256=GU-1PTcVr8zcbtC7BASfpHcZndP9AdboXPNQiBc0fzo,34251
|
|
@@ -93,17 +93,17 @@ sourcecode/relevance_scorer.py,sha256=0AgEt4KrV73nioMqBgjhGjtY7L2C7L7cSyKtj3IKcr
|
|
|
93
93
|
sourcecode/remedies.py,sha256=8lgvKkW1WuBG-QfTnA0uBhEKnwWGSvgSMWCfTjzYhEY,6516
|
|
94
94
|
sourcecode/rename_refactor.py,sha256=h6dNFlB9aZ_3q6heeHBkgXQeXaT03nvPSsYH6P8qxFg,12965
|
|
95
95
|
sourcecode/repo_classifier.py,sha256=FG1vaWKdWXsWdl-S8hjVMiTqcwgaRXkDyvK4rPcOGtQ,22681
|
|
96
|
-
sourcecode/repository_ir.py,sha256=
|
|
96
|
+
sourcecode/repository_ir.py,sha256=UdA13zDUvhgZvdUt8BIbfHOXi40OkdvqtpMJG7hYkms,358320
|
|
97
97
|
sourcecode/ris.py,sha256=SjjDNMcc9Zr9us9G8ikBVkoPXKK3BpM-dBodSGMh_g4,24783
|
|
98
98
|
sourcecode/risk.py,sha256=UgTVdMc8XBArO6D9e2Xx9I-kKqx-PW4W0hSe1Jy9qjU,54491
|
|
99
99
|
sourcecode/rule_catalog.py,sha256=xmphuULUCtg_GWTbriwY25D-N2IaeMXXvB5CNU1xSuA,4925
|
|
100
|
-
sourcecode/runs.py,sha256=
|
|
100
|
+
sourcecode/runs.py,sha256=K1G7WjSLACZFNklRupFiHjmF5SJYtoo1OWjA0h8-q7Y,4761
|
|
101
101
|
sourcecode/runtime_classifier.py,sha256=uTAD6BDCiBLUZEDRfqk718kM4RTT_vAbfkcOI2_Xx58,18432
|
|
102
102
|
sourcecode/sarif.py,sha256=3hQEegUxIZbojFdY59oB-yKsK-rnafHdTNmYsEP2--A,25984
|
|
103
103
|
sourcecode/scanner.py,sha256=z3CV0rcGunu0Y8mpNgp07wI7nxT0pxw1BkXRRtI0Rpo,9609
|
|
104
104
|
sourcecode/schema.py,sha256=aHNXDf8LGyUC8ZDE_VS9kiskC2-Oswhi_WnpdGy6HDw,24897
|
|
105
105
|
sourcecode/security_config.py,sha256=KblMEoRiEjrIE68YsPaUAFebxFp8UM7MS7lAk5CGD8U,3531
|
|
106
|
-
sourcecode/security_config_scan.py,sha256=
|
|
106
|
+
sourcecode/security_config_scan.py,sha256=aG2gqhPrjDpYwqML3Sqg-6_FtJWKmlyy9ceMBd4FHSo,26570
|
|
107
107
|
sourcecode/security_posture.py,sha256=CjJ2Qm87HhKXepnaWx1ncJLW-SxI18udCmUDIkCyAsY,50270
|
|
108
108
|
sourcecode/semantic_analyzer.py,sha256=bpgdC6m0_ftVtRf3rSdwhbhWjnZnGxRXaZVcfe4BbcQ,95414
|
|
109
109
|
sourcecode/semantic_impact_engine.py,sha256=t09IirGC3JjQDy33JZd1_WKzQVKXkoNl3-XEUr5kjis,20563
|
|
@@ -193,8 +193,8 @@ sourcecode/telemetry/consent.py,sha256=pQdl-QeLl6Gcibn0eWHSKZrm-HYSsjpVqOnjrgFp8
|
|
|
193
193
|
sourcecode/telemetry/events.py,sha256=4_yeO58U-Cwc1Qb27VB0_EjhmroY0k91n3_VGxeALB8,2776
|
|
194
194
|
sourcecode/telemetry/filters.py,sha256=RzxauTz8HliO4BllQnXEXc7zTeqdCZi5MgqGEDuW7OQ,6570
|
|
195
195
|
sourcecode/telemetry/transport.py,sha256=4gGHsq0WeY9VywEZXA3vUxykfiYnw9uuqfjAAec7F8o,1681
|
|
196
|
-
sourcecode-4.10.
|
|
197
|
-
sourcecode-4.10.
|
|
198
|
-
sourcecode-4.10.
|
|
199
|
-
sourcecode-4.10.
|
|
200
|
-
sourcecode-4.10.
|
|
196
|
+
sourcecode-4.10.2.dist-info/METADATA,sha256=LpRICJiZXofZyp2RYC7EnsTKURHjIHQLvktzU_ABEzM,36657
|
|
197
|
+
sourcecode-4.10.2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
198
|
+
sourcecode-4.10.2.dist-info/entry_points.txt,sha256=-JEAdChrK5We51kZcb7OaDcyil-dHBjBPL-NhuO-QY8,89
|
|
199
|
+
sourcecode-4.10.2.dist-info/licenses/LICENSE,sha256=7DdHrU9Z_3e7dSvq4ISijZNjnuHo5NIHNiHDouMQ9JU,10491
|
|
200
|
+
sourcecode-4.10.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|