sourcecode 2.5.16__tar.gz → 2.5.17__tar.gz
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-2.5.16 → sourcecode-2.5.17}/CHANGELOG.md +31 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/PKG-INFO +1 -1
- {sourcecode-2.5.16 → sourcecode-2.5.17}/pyproject.toml +1 -1
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/__init__.py +1 -1
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/adaptive_scanner.py +12 -36
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/ast_extractor.py +0 -8
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/coverage_parser.py +0 -14
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/env_analyzer.py +0 -5
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/repository_ir.py +0 -39
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/scanner.py +55 -37
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/serializer.py +0 -61
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/spring_tx_analyzer.py +0 -24
- {sourcecode-2.5.16 → sourcecode-2.5.17}/.github/workflows/build-windows.yml +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/.gitignore +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/.ruff.toml +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/CONTRIBUTING.md +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/LICENSE +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/README.md +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/SECURITY.md +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/raw +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/scripts/compare_integration_engines.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/scripts/customer_smoke_test.sh +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/scripts/generate_jdk_exports.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/scripts/perf_harness.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/archetype.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/architecture_analyzer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/architecture_summary.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/cache.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/call_surface.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/caller_metrics.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/canonical_ir.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/cir_graphs.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/classifier.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/cli.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/code_notes_analyzer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/confidence_analyzer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/context_cache.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/context_graph.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/context_scorer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/context_summarizer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/contract_model.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/contract_pipeline.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/dependency_analyzer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/__init__.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/base.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/csproj_parser.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/dart.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/dotnet.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/elixir.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/go.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/heuristic.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/hybrid.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/java.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/jvm_ext.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/nodejs.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/parsers.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/php.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/project.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/python.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/ruby.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/rust.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/systems.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/terraform.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/detectors/tooling.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/doc_analyzer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/dynamic_argument_surface.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/endpoint_literals.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/endpoint_metrics.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/entrypoint_classifier.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/error_schema.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/evidence_provider.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/explain.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/file_chunker.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/file_classifier.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/format_contract.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/fqn_utils.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/git_analyzer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/graph_analyzer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/graph_evidence.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/hibernate_strat.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/jdk_exports.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/license.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/mcp/__init__.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/mcp/onboarding/__init__.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/mcp/onboarding/applier.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/mcp/onboarding/backup.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/mcp/onboarding/detector.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/mcp/onboarding/planner.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/mcp/orchestrator.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/mcp/registry.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/mcp/runner.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/mcp/server.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/mcp_nudge.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/metrics_analyzer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/migrate_check.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/openapi_surface.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/output_budget.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/path_filters.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/perf.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/pr_comment_renderer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/pr_impact.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/prepare_context.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/progress.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/ranking_engine.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/reconciliation.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/redactor.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/relevance_scorer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/rename_refactor.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/repo_classifier.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/__init__.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/context.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/errors.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/executor.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/planner.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/query.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/request.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/resolution.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/result.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/retriever.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/runtime.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/steps.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/steps_endpoint.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/steps_graph.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/steps_impact.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/steps_intf.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/steps_struct.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/retrieval/steps_txsec.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/ris.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/runtime_classifier.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/schema.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/security_config.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/security_posture.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/semantic_analyzer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/semantic_impact_engine.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/semantic_integration_engine.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/semantic_services.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/spring_event_topology.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/spring_findings.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/spring_impact.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/spring_model.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/spring_security_audit.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/spring_semantic.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/summarizer.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/telemetry/__init__.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/telemetry/config.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/telemetry/consent.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/telemetry/events.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/telemetry/filters.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/telemetry/transport.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/tree_utils.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/type_usage_surface.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/validation_inference.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/validation_surface.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/version_check.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/src/sourcecode/workspace.py +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/supabase/functions/README.md +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/supabase/functions/get-license/index.ts +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/supabase/functions/lemonsqueezy-webhook/index.ts +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/supabase/functions/telemetry/index.ts +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/supabase/sql/license_event_ordering.sql +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/supabase/sql/licensing_schema.sql +0 -0
- {sourcecode-2.5.16 → sourcecode-2.5.17}/supabase/sql/telemetry_events.sql +0 -0
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.5.17] — 2026-07-19
|
|
4
|
+
|
|
5
|
+
**Semantic Stability cleanup: dead code removed and a scanner fork collapsed, with
|
|
6
|
+
zero behavioural change.** Per `docs/DEVELOPMENT-ROADMAP.md` the 2.5.x line is scoped
|
|
7
|
+
to documentation, cleanup, small bugs and profiling — no new inference. This release
|
|
8
|
+
is pure internal hygiene; every user-facing surface is byte-for-byte unchanged and the
|
|
9
|
+
full suite (3534 passed, 5 skipped) confirms it.
|
|
10
|
+
|
|
11
|
+
### Removed
|
|
12
|
+
|
|
13
|
+
- **8 dead module-level private helpers** (−151 lines), each verified to have zero
|
|
14
|
+
references across `src` + `tests` (call sites, string names, and dynamic lookups) and
|
|
15
|
+
confirmed long-orphaned (all last touched May 2026, superseded since):
|
|
16
|
+
`repository_ir._resolve_type`, `repository_ir._common_package_prefix`,
|
|
17
|
+
`ast_extractor._find_all`, `ast_extractor._named_children`,
|
|
18
|
+
`coverage_parser._decode_numbits`, `spring_tx_analyzer._extract_method_body`,
|
|
19
|
+
`serializer._tiered_display_score`, `env_analyzer._replace_required`.
|
|
20
|
+
Kept `perf._reset_for_tests` and `migrate_check._find_xml_config_files` — both live
|
|
21
|
+
via tests.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **Collapsed the `FileScanner` / `AdaptiveScanner` fork duplication.** AdaptiveScanner
|
|
26
|
+
was forked from FileScanner and carried three byte-identical method bodies
|
|
27
|
+
(`find_manifests`, `_get_or_create_node`, `_is_excluded_by_gitignore`) — one of which
|
|
28
|
+
documented "Identical logic to FileScanner.find_manifests()". The shared logic now
|
|
29
|
+
lives as three module-level free functions in `scanner.py`
|
|
30
|
+
(`find_manifest_paths` / `get_or_create_tree_node` / `match_gitignore`) and both
|
|
31
|
+
classes delegate. No new coupling (AdaptiveScanner already imported from `scanner`),
|
|
32
|
+
no circular import; dropped its now-unused `cast` / `MANIFEST_NAMES` imports.
|
|
33
|
+
|
|
3
34
|
## [2.5.16] — 2026-07-19
|
|
4
35
|
|
|
5
36
|
**Performance campaign close-out: one real algorithmic win, cost-per-symbol
|
|
@@ -14,12 +14,18 @@ interface, same output format (None = file, dict = directory).
|
|
|
14
14
|
|
|
15
15
|
import os
|
|
16
16
|
from pathlib import Path
|
|
17
|
-
from typing import Any, Optional
|
|
17
|
+
from typing import Any, Optional
|
|
18
18
|
|
|
19
19
|
from pathspec import GitIgnoreSpec
|
|
20
20
|
|
|
21
21
|
from sourcecode.repo_classifier import RepoTopology
|
|
22
|
-
from sourcecode.scanner import
|
|
22
|
+
from sourcecode.scanner import (
|
|
23
|
+
DEFAULT_EXCLUDES,
|
|
24
|
+
EXCLUDED_FILE_SUFFIXES,
|
|
25
|
+
find_manifest_paths,
|
|
26
|
+
get_or_create_tree_node,
|
|
27
|
+
match_gitignore,
|
|
28
|
+
)
|
|
23
29
|
|
|
24
30
|
|
|
25
31
|
class AdaptiveScanner:
|
|
@@ -100,9 +106,7 @@ class AdaptiveScanner:
|
|
|
100
106
|
return self._gitignore_spec
|
|
101
107
|
|
|
102
108
|
def _is_excluded_by_gitignore(self, rel_path: str, is_dir: bool) -> bool:
|
|
103
|
-
|
|
104
|
-
path_to_match = rel_path + "/" if is_dir else rel_path
|
|
105
|
-
return spec.match_file(path_to_match)
|
|
109
|
+
return match_gitignore(self._load_gitignore_spec(), rel_path, is_dir)
|
|
106
110
|
|
|
107
111
|
# ------------------------------------------------------------------
|
|
108
112
|
# Depth budget computation — the core of adaptive traversal
|
|
@@ -224,40 +228,12 @@ class AdaptiveScanner:
|
|
|
224
228
|
def _get_or_create_node(
|
|
225
229
|
self, tree: dict[str, Any], parts: tuple[str, ...]
|
|
226
230
|
) -> dict[str, Any]:
|
|
227
|
-
|
|
228
|
-
for part in parts:
|
|
229
|
-
if part not in node or node[part] is None:
|
|
230
|
-
node[part] = {}
|
|
231
|
-
node = cast(dict[str, Any], node[part])
|
|
232
|
-
return node
|
|
231
|
+
return get_or_create_tree_node(tree, parts)
|
|
233
232
|
|
|
234
233
|
# ------------------------------------------------------------------
|
|
235
234
|
# Manifest discovery — same interface as FileScanner
|
|
236
235
|
# ------------------------------------------------------------------
|
|
237
236
|
|
|
238
237
|
def find_manifests(self) -> list[str]:
|
|
239
|
-
"""Find manifest files at depth 0-1.
|
|
240
|
-
|
|
241
|
-
Identical logic to FileScanner.find_manifests() — depth-0 root
|
|
242
|
-
manifests plus depth-1 sub-package manifests, hidden dirs excluded.
|
|
243
|
-
"""
|
|
244
|
-
manifests: list[str] = []
|
|
245
|
-
for name in MANIFEST_NAMES:
|
|
246
|
-
candidate = self.root / name
|
|
247
|
-
if candidate.exists() and not candidate.is_symlink():
|
|
248
|
-
manifests.append(str(candidate))
|
|
249
|
-
try:
|
|
250
|
-
for child in self.root.iterdir():
|
|
251
|
-
if (
|
|
252
|
-
child.is_dir()
|
|
253
|
-
and not child.is_symlink()
|
|
254
|
-
and child.name not in self._excludes
|
|
255
|
-
and not child.name.startswith(".")
|
|
256
|
-
):
|
|
257
|
-
for name in MANIFEST_NAMES:
|
|
258
|
-
candidate = child / name
|
|
259
|
-
if candidate.exists() and not candidate.is_symlink():
|
|
260
|
-
manifests.append(str(candidate))
|
|
261
|
-
except PermissionError:
|
|
262
|
-
pass
|
|
263
|
-
return manifests
|
|
238
|
+
"""Find manifest files at depth 0-1 (delegates to the shared helper)."""
|
|
239
|
+
return find_manifest_paths(self.root, self._excludes)
|
|
@@ -176,18 +176,10 @@ def _find_child(node: Any, *types: str) -> Optional[Any]:
|
|
|
176
176
|
return None
|
|
177
177
|
|
|
178
178
|
|
|
179
|
-
def _find_all(node: Any, *types: str) -> list[Any]:
|
|
180
|
-
return [child for child in node.children if child.type in types]
|
|
181
|
-
|
|
182
|
-
|
|
183
179
|
def _text(node: Any, src: bytes) -> str:
|
|
184
180
|
return src[node.start_byte:node.end_byte].decode("utf-8", errors="replace")
|
|
185
181
|
|
|
186
182
|
|
|
187
|
-
def _named_children(node: Any) -> list[Any]:
|
|
188
|
-
return [c for c in node.children if c.is_named]
|
|
189
|
-
|
|
190
|
-
|
|
191
183
|
# ---------------------------------------------------------------------------
|
|
192
184
|
# Tree-sitter TS/JS extraction
|
|
193
185
|
# ---------------------------------------------------------------------------
|
|
@@ -39,20 +39,6 @@ def _safe_int(value: Optional[str]) -> Optional[int]:
|
|
|
39
39
|
return None
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def _decode_numbits(blob: bytes) -> list[int]:
|
|
43
|
-
"""Decodifica bitset little-endian de coverage.py .coverage SQLite.
|
|
44
|
-
|
|
45
|
-
Byte i, bit j set => linea (i*8 + j + 1) ejecutada.
|
|
46
|
-
Ejemplo: bytes([0b00000101]) => [1, 3]
|
|
47
|
-
"""
|
|
48
|
-
return [
|
|
49
|
-
i * 8 + j + 1
|
|
50
|
-
for i, byte in enumerate(blob)
|
|
51
|
-
for j in range(8)
|
|
52
|
-
if byte & (1 << j)
|
|
53
|
-
]
|
|
54
|
-
|
|
55
|
-
|
|
56
42
|
# ---------------------------------------------------------------------------
|
|
57
43
|
# CoverageParser
|
|
58
44
|
# ---------------------------------------------------------------------------
|
|
@@ -534,8 +534,3 @@ class EnvAnalyzer:
|
|
|
534
534
|
def _replace_description(record, description: str):
|
|
535
535
|
from dataclasses import replace
|
|
536
536
|
return replace(record, description=description)
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
def _replace_required(record, required: bool, default: Optional[str]):
|
|
540
|
-
from dataclasses import replace
|
|
541
|
-
return replace(record, required=required, default=default if not record.default else record.default)
|
|
@@ -807,11 +807,6 @@ def _pop_closed(class_stack: list[tuple[str, int]], depth: int) -> None:
|
|
|
807
807
|
class_stack.pop()
|
|
808
808
|
|
|
809
809
|
|
|
810
|
-
def _resolve_type(simple: str, import_map: dict[str, str]) -> Optional[str]:
|
|
811
|
-
base = re.sub(r'<.*', '', simple).strip().split('.')[-1]
|
|
812
|
-
return import_map.get(base)
|
|
813
|
-
|
|
814
|
-
|
|
815
810
|
def _resolve_types_from_text(text: str, import_map: dict[str, str]) -> list[str]:
|
|
816
811
|
resolved = []
|
|
817
812
|
for token in re.findall(r'\b([A-Z]\w*)\b', text):
|
|
@@ -3597,40 +3592,6 @@ def _build_evidence_bundles(
|
|
|
3597
3592
|
return bundles
|
|
3598
3593
|
|
|
3599
3594
|
|
|
3600
|
-
def _common_package_prefix(fqns: list[str]) -> str:
|
|
3601
|
-
"""Longest common dot-separated package prefix across a list of FQNs."""
|
|
3602
|
-
if not fqns:
|
|
3603
|
-
return ""
|
|
3604
|
-
# Strip class/method suffix — keep only package parts (lowercase segments)
|
|
3605
|
-
def pkg_parts(fqn: str) -> list[str]:
|
|
3606
|
-
parts = fqn.split(".")
|
|
3607
|
-
# Drop trailing class/method names (PascalCase or after '#')
|
|
3608
|
-
result = []
|
|
3609
|
-
for p in parts:
|
|
3610
|
-
if "#" in p:
|
|
3611
|
-
break
|
|
3612
|
-
if p and p[0].isupper():
|
|
3613
|
-
break
|
|
3614
|
-
result.append(p)
|
|
3615
|
-
return result
|
|
3616
|
-
|
|
3617
|
-
segs = [pkg_parts(f) for f in fqns if pkg_parts(f)]
|
|
3618
|
-
if not segs:
|
|
3619
|
-
return fqns[0].rsplit(".", 1)[0] if "." in fqns[0] else fqns[0]
|
|
3620
|
-
common = segs[0]
|
|
3621
|
-
for s in segs[1:]:
|
|
3622
|
-
new_common = []
|
|
3623
|
-
for a, b in zip(common, s):
|
|
3624
|
-
if a == b:
|
|
3625
|
-
new_common.append(a)
|
|
3626
|
-
else:
|
|
3627
|
-
break
|
|
3628
|
-
common = new_common
|
|
3629
|
-
if not common:
|
|
3630
|
-
break
|
|
3631
|
-
return ".".join(common) if common else fqns[0].rsplit(".", 1)[0]
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
3595
|
def _subsystem_label(package_prefix: str) -> str:
|
|
3635
3596
|
"""Derive short human label enforcing minimum meaningful depth.
|
|
3636
3597
|
|
|
@@ -115,6 +115,57 @@ def classify_manifest(manifest_path: str, root: Path) -> str:
|
|
|
115
115
|
return "auxiliary"
|
|
116
116
|
|
|
117
117
|
|
|
118
|
+
# ── Shared scan primitives (used by both FileScanner and AdaptiveScanner) ────
|
|
119
|
+
# AdaptiveScanner was forked from FileScanner and carried byte-identical copies of
|
|
120
|
+
# these three; they live here as the single source of truth, each class method a
|
|
121
|
+
# thin delegate.
|
|
122
|
+
|
|
123
|
+
def find_manifest_paths(root: Path, excludes: frozenset[str]) -> list[str]:
|
|
124
|
+
"""Manifest files at depth 0–1 (SCAN-04): root manifests plus depth-1
|
|
125
|
+
sub-package manifests, with hidden/excluded dirs and symlinks skipped."""
|
|
126
|
+
manifests: list[str] = []
|
|
127
|
+
# Depth 0: root
|
|
128
|
+
for name in MANIFEST_NAMES:
|
|
129
|
+
candidate = root / name
|
|
130
|
+
if candidate.exists() and not candidate.is_symlink():
|
|
131
|
+
manifests.append(str(candidate))
|
|
132
|
+
# Depth 1: first level (hidden dirs excluded — tooling, not project)
|
|
133
|
+
try:
|
|
134
|
+
for child in root.iterdir():
|
|
135
|
+
if (
|
|
136
|
+
child.is_dir()
|
|
137
|
+
and not child.is_symlink()
|
|
138
|
+
and child.name not in excludes
|
|
139
|
+
and not child.name.startswith(".")
|
|
140
|
+
):
|
|
141
|
+
for name in MANIFEST_NAMES:
|
|
142
|
+
candidate = child / name
|
|
143
|
+
if candidate.exists() and not candidate.is_symlink():
|
|
144
|
+
manifests.append(str(candidate))
|
|
145
|
+
except PermissionError:
|
|
146
|
+
pass
|
|
147
|
+
return manifests
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def get_or_create_tree_node(
|
|
151
|
+
tree: dict[str, Any], parts: tuple[str, ...]
|
|
152
|
+
) -> dict[str, Any]:
|
|
153
|
+
"""Navigate/create the nested-dict tree node for a path's parts."""
|
|
154
|
+
node = tree
|
|
155
|
+
for part in parts:
|
|
156
|
+
if part not in node or node[part] is None:
|
|
157
|
+
node[part] = {}
|
|
158
|
+
node = cast(dict[str, Any], node[part])
|
|
159
|
+
return node
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def match_gitignore(spec: GitIgnoreSpec, rel_path: str, is_dir: bool) -> bool:
|
|
163
|
+
"""True if a root-relative path is excluded by ``spec``. GitIgnoreSpec expects
|
|
164
|
+
a trailing '/' for directories."""
|
|
165
|
+
path_to_match = rel_path + "/" if is_dir else rel_path
|
|
166
|
+
return spec.match_file(path_to_match)
|
|
167
|
+
|
|
168
|
+
|
|
118
169
|
class FileScanner:
|
|
119
170
|
"""Escanea un directorio de proyecto y produce un arbol de ficheros filtrado.
|
|
120
171
|
|
|
@@ -148,10 +199,7 @@ class FileScanner:
|
|
|
148
199
|
|
|
149
200
|
def _is_excluded_by_gitignore(self, rel_path: str, is_dir: bool) -> bool:
|
|
150
201
|
"""Comprueba si una ruta relativa (a self.root) esta excluida por .gitignore."""
|
|
151
|
-
|
|
152
|
-
# GitIgnoreSpec espera rutas con / al final para directorios
|
|
153
|
-
path_to_match = rel_path + "/" if is_dir else rel_path
|
|
154
|
-
return spec.match_file(path_to_match)
|
|
202
|
+
return match_gitignore(self._load_gitignore_spec(), rel_path, is_dir)
|
|
155
203
|
|
|
156
204
|
def scan_tree(self) -> dict[str, Any]:
|
|
157
205
|
"""Construye el arbol JSON anidado del proyecto.
|
|
@@ -223,38 +271,8 @@ class FileScanner:
|
|
|
223
271
|
self, tree: dict[str, Any], parts: tuple[str, ...]
|
|
224
272
|
) -> dict[str, Any]:
|
|
225
273
|
"""Navega/crea el nodo del arbol para la ruta indicada."""
|
|
226
|
-
|
|
227
|
-
for part in parts:
|
|
228
|
-
if part not in node or node[part] is None:
|
|
229
|
-
node[part] = {}
|
|
230
|
-
node = cast(dict[str, Any], node[part])
|
|
231
|
-
return node
|
|
274
|
+
return get_or_create_tree_node(tree, parts)
|
|
232
275
|
|
|
233
276
|
def find_manifests(self) -> list[str]:
|
|
234
|
-
"""Encuentra ficheros de manifiesto en profundidad 0-1 (SCAN-04).
|
|
235
|
-
|
|
236
|
-
Retorna:
|
|
237
|
-
Lista de paths absolutos de manifiestos encontrados.
|
|
238
|
-
"""
|
|
239
|
-
manifests: list[str] = []
|
|
240
|
-
# Profundidad 0: raiz
|
|
241
|
-
for name in MANIFEST_NAMES:
|
|
242
|
-
candidate = self.root / name
|
|
243
|
-
if candidate.exists() and not candidate.is_symlink():
|
|
244
|
-
manifests.append(str(candidate))
|
|
245
|
-
# Profundidad 1: primer nivel (excluir directorios ocultos — son tooling, no proyecto)
|
|
246
|
-
try:
|
|
247
|
-
for child in self.root.iterdir():
|
|
248
|
-
if (
|
|
249
|
-
child.is_dir()
|
|
250
|
-
and not child.is_symlink()
|
|
251
|
-
and child.name not in self._excludes
|
|
252
|
-
and not child.name.startswith(".")
|
|
253
|
-
):
|
|
254
|
-
for name in MANIFEST_NAMES:
|
|
255
|
-
candidate = child / name
|
|
256
|
-
if candidate.exists() and not candidate.is_symlink():
|
|
257
|
-
manifests.append(str(candidate))
|
|
258
|
-
except PermissionError:
|
|
259
|
-
pass
|
|
260
|
-
return manifests
|
|
277
|
+
"""Encuentra ficheros de manifiesto en profundidad 0-1 (SCAN-04)."""
|
|
278
|
+
return find_manifest_paths(self.root, self._excludes)
|
|
@@ -913,67 +913,6 @@ def _jndi_datasources(sm: "SourceMap") -> "Optional[list[dict[str, Any]]]":
|
|
|
913
913
|
return datasources
|
|
914
914
|
|
|
915
915
|
|
|
916
|
-
def _tiered_display_score(
|
|
917
|
-
pre_bonus_combined: float,
|
|
918
|
-
file_class: Any,
|
|
919
|
-
path: str,
|
|
920
|
-
entry_paths: set,
|
|
921
|
-
has_structural_signals: bool = False,
|
|
922
|
-
) -> float:
|
|
923
|
-
"""Evidence-tiered display score [0.0, 1.0].
|
|
924
|
-
|
|
925
|
-
Tiers enforce: strong evidence > medium evidence > filesystem/path only.
|
|
926
|
-
M3 sort bonuses must NOT be included in pre_bonus_combined — they are for
|
|
927
|
-
ordering only and must not inflate the displayed score.
|
|
928
|
-
|
|
929
|
-
Tier ceilings:
|
|
930
|
-
T1 confirmed production entrypoint 0.92–1.00
|
|
931
|
-
T2 entrypoint (weaker category) 0.80–0.91
|
|
932
|
-
T3 annotation-confirmed stereotype 0.40–0.90 (table-calibrated)
|
|
933
|
-
T4 framework import evidence 0.55–0.79
|
|
934
|
-
T5 code definitions + imports 0.38–0.54
|
|
935
|
-
T6 build manifest / tooling / test 0.25–0.45
|
|
936
|
-
T7 path/filesystem signal only 0.10–0.39
|
|
937
|
-
"""
|
|
938
|
-
from sourcecode.file_classifier import JAVA_STEREOTYPE_CATEGORIES
|
|
939
|
-
|
|
940
|
-
cat = file_class.category if file_class else None
|
|
941
|
-
base_rel = file_class.relevance if file_class else 0.0
|
|
942
|
-
|
|
943
|
-
# T1: confirmed production entrypoint
|
|
944
|
-
if path in entry_paths and cat in ("runtime_core", "cli_entrypoint"):
|
|
945
|
-
return round(min(1.0, max(0.92, base_rel)), 3)
|
|
946
|
-
|
|
947
|
-
# T2: in entry_paths but weaker evidence category
|
|
948
|
-
if path in entry_paths:
|
|
949
|
-
return round(min(0.91, max(0.80, pre_bonus_combined / 2.0)), 3)
|
|
950
|
-
|
|
951
|
-
# T3: annotation-confirmed stereotype — table values are already calibrated
|
|
952
|
-
if file_class and cat in JAVA_STEREOTYPE_CATEGORIES:
|
|
953
|
-
return round(base_rel, 3)
|
|
954
|
-
|
|
955
|
-
# T4: framework import evidence (medium strength)
|
|
956
|
-
if cat in ("api_layer", "database_layer", "infrastructure"):
|
|
957
|
-
return round(min(0.79, max(0.55, pre_bonus_combined / 2.0)), 3)
|
|
958
|
-
|
|
959
|
-
# T5: code definitions with imports (medium-low)
|
|
960
|
-
if cat in ("application_logic", "domain_model"):
|
|
961
|
-
return round(min(0.54, max(0.38, pre_bonus_combined / 2.0)), 3)
|
|
962
|
-
|
|
963
|
-
# T6: build manifest / tooling / test
|
|
964
|
-
if cat == "build_system":
|
|
965
|
-
return round(min(0.45, base_rel), 3)
|
|
966
|
-
if cat in ("tests", "tooling"):
|
|
967
|
-
return round(min(0.35, base_rel), 3)
|
|
968
|
-
|
|
969
|
-
# T7: no content classification — filesystem/structural signals only
|
|
970
|
-
# has_structural_signals: fan_in, churn, export — allows up to 0.54
|
|
971
|
-
# pure path/filename only — hard cap 0.39
|
|
972
|
-
if has_structural_signals:
|
|
973
|
-
return round(min(0.54, max(0.10, pre_bonus_combined / 2.0)), 3)
|
|
974
|
-
return round(min(0.39, max(0.10, pre_bonus_combined / 2.0)), 3)
|
|
975
|
-
|
|
976
|
-
|
|
977
916
|
def _build_file_signals(
|
|
978
917
|
file_class: Any,
|
|
979
918
|
path: str,
|
|
@@ -112,30 +112,6 @@ def _caught_types(catch_header_inner: str) -> list[str]:
|
|
|
112
112
|
return types
|
|
113
113
|
|
|
114
114
|
|
|
115
|
-
def _extract_method_body(source: str, method_name: str) -> str:
|
|
116
|
-
"""Extract the first method body matching method_name using brace counting.
|
|
117
|
-
|
|
118
|
-
Returns the text from '{' to the matching '}', or empty string if not found.
|
|
119
|
-
Needed to scope TX-005 regex to the specific method instead of the whole file.
|
|
120
|
-
"""
|
|
121
|
-
pattern = re.compile(r'\b' + re.escape(method_name) + r'\s*\(')
|
|
122
|
-
for m in pattern.finditer(source):
|
|
123
|
-
brace_pos = source.find('{', m.end())
|
|
124
|
-
if brace_pos < 0:
|
|
125
|
-
continue
|
|
126
|
-
depth = 1
|
|
127
|
-
i = brace_pos + 1
|
|
128
|
-
while i < len(source) and depth > 0:
|
|
129
|
-
c = source[i]
|
|
130
|
-
if c == '{':
|
|
131
|
-
depth += 1
|
|
132
|
-
elif c == '}':
|
|
133
|
-
depth -= 1
|
|
134
|
-
i += 1
|
|
135
|
-
return source[brace_pos:i]
|
|
136
|
-
return ""
|
|
137
|
-
|
|
138
|
-
|
|
139
115
|
# ---------------------------------------------------------------------------
|
|
140
116
|
# Pattern protocol
|
|
141
117
|
# ---------------------------------------------------------------------------
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|