sourcecode 1.35.7__tar.gz → 1.35.8__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.
Files changed (103) hide show
  1. {sourcecode-1.35.7 → sourcecode-1.35.8}/PKG-INFO +1 -1
  2. {sourcecode-1.35.7 → sourcecode-1.35.8}/pyproject.toml +1 -1
  3. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/__init__.py +1 -1
  4. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/mcp/registry.py +430 -22
  5. {sourcecode-1.35.7 → sourcecode-1.35.8}/.github/workflows/build-windows.yml +0 -0
  6. {sourcecode-1.35.7 → sourcecode-1.35.8}/.gitignore +0 -0
  7. {sourcecode-1.35.7 → sourcecode-1.35.8}/.ruff.toml +0 -0
  8. {sourcecode-1.35.7 → sourcecode-1.35.8}/CHANGELOG.md +0 -0
  9. {sourcecode-1.35.7 → sourcecode-1.35.8}/CONTRIBUTING.md +0 -0
  10. {sourcecode-1.35.7 → sourcecode-1.35.8}/LICENSE +0 -0
  11. {sourcecode-1.35.7 → sourcecode-1.35.8}/README.md +0 -0
  12. {sourcecode-1.35.7 → sourcecode-1.35.8}/SECURITY.md +0 -0
  13. {sourcecode-1.35.7 → sourcecode-1.35.8}/raw +0 -0
  14. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/adaptive_scanner.py +0 -0
  15. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/architecture_analyzer.py +0 -0
  16. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/architecture_summary.py +0 -0
  17. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/ast_extractor.py +0 -0
  18. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/cache.py +0 -0
  19. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/canonical_ir.py +0 -0
  20. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/cir_graphs.py +0 -0
  21. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/classifier.py +0 -0
  22. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/cli.py +0 -0
  23. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/code_notes_analyzer.py +0 -0
  24. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/confidence_analyzer.py +0 -0
  25. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/context_scorer.py +0 -0
  26. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/context_summarizer.py +0 -0
  27. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/contract_model.py +0 -0
  28. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/contract_pipeline.py +0 -0
  29. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/coverage_parser.py +0 -0
  30. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/dependency_analyzer.py +0 -0
  31. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/__init__.py +0 -0
  32. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/base.py +0 -0
  33. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/csproj_parser.py +0 -0
  34. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/dart.py +0 -0
  35. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/dotnet.py +0 -0
  36. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/elixir.py +0 -0
  37. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/go.py +0 -0
  38. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/heuristic.py +0 -0
  39. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/hybrid.py +0 -0
  40. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/java.py +0 -0
  41. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/jvm_ext.py +0 -0
  42. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/nodejs.py +0 -0
  43. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/parsers.py +0 -0
  44. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/php.py +0 -0
  45. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/project.py +0 -0
  46. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/python.py +0 -0
  47. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/ruby.py +0 -0
  48. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/rust.py +0 -0
  49. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/systems.py +0 -0
  50. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/terraform.py +0 -0
  51. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/detectors/tooling.py +0 -0
  52. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/doc_analyzer.py +0 -0
  53. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/entrypoint_classifier.py +0 -0
  54. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/env_analyzer.py +0 -0
  55. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/error_schema.py +0 -0
  56. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/file_classifier.py +0 -0
  57. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/flow_analyzer.py +0 -0
  58. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/git_analyzer.py +0 -0
  59. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/graph_analyzer.py +0 -0
  60. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/license.py +0 -0
  61. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/mcp/__init__.py +0 -0
  62. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/mcp/onboarding/__init__.py +0 -0
  63. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/mcp/onboarding/applier.py +0 -0
  64. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/mcp/onboarding/backup.py +0 -0
  65. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/mcp/onboarding/detector.py +0 -0
  66. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/mcp/onboarding/planner.py +0 -0
  67. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/mcp/orchestrator.py +0 -0
  68. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/mcp/runner.py +0 -0
  69. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/mcp/server.py +0 -0
  70. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/mcp_nudge.py +0 -0
  71. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/metrics_analyzer.py +0 -0
  72. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/output_budget.py +0 -0
  73. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/path_filters.py +0 -0
  74. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/pr_comment_renderer.py +0 -0
  75. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/prepare_context.py +0 -0
  76. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/progress.py +0 -0
  77. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/ranking_engine.py +0 -0
  78. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/redactor.py +0 -0
  79. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/relevance_scorer.py +0 -0
  80. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/repo_classifier.py +0 -0
  81. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/repository_ir.py +0 -0
  82. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/ris.py +0 -0
  83. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/runtime_classifier.py +0 -0
  84. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/scanner.py +0 -0
  85. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/schema.py +0 -0
  86. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/semantic_analyzer.py +0 -0
  87. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/serializer.py +0 -0
  88. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/spring_event_topology.py +0 -0
  89. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/spring_findings.py +0 -0
  90. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/spring_impact.py +0 -0
  91. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/spring_model.py +0 -0
  92. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/spring_security_audit.py +0 -0
  93. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/spring_semantic.py +0 -0
  94. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/spring_tx_analyzer.py +0 -0
  95. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/summarizer.py +0 -0
  96. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/telemetry/__init__.py +0 -0
  97. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/telemetry/config.py +0 -0
  98. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/telemetry/consent.py +0 -0
  99. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/telemetry/events.py +0 -0
  100. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/telemetry/filters.py +0 -0
  101. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/telemetry/transport.py +0 -0
  102. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/tree_utils.py +0 -0
  103. {sourcecode-1.35.7 → sourcecode-1.35.8}/src/sourcecode/workspace.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sourcecode
3
- Version: 1.35.7
3
+ Version: 1.35.8
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
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "sourcecode"
7
- version = "1.35.7"
7
+ version = "1.35.8"
8
8
  description = "Persistent structural context and ultra-fast repeated analysis for AI coding agents"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -1,3 +1,3 @@
1
1
  """sourcecode — Deterministic codebase context maps for AI coding agents."""
2
2
 
3
- __version__ = "1.35.7"
3
+ __version__ = "1.35.8"
@@ -544,41 +544,86 @@ def _root_aliases() -> list[ToolSpec]:
544
544
  module = str(inputs["module"]).strip("/")
545
545
  return [f"{repo_path}/{module}", "--compact"]
546
546
 
547
+ _GET_COMPACT_DOC = """\
548
+ Compact human/LLM summary of a repository (~1000-3000 tokens). USE THIS FIRST.
549
+
550
+ Best for: quick project orientation, first-time context, token-budget constrained tasks.
551
+ Returns: stacks, entry points, dependency summary, architecture summary, confidence, gaps.
552
+ Includes security_surface, mybatis, and transactional_boundaries for Java/Spring projects.
553
+ For richer machine-oriented detail (deeper signals, more sections), use get_agent_context.
554
+
555
+ Maps to: sourcecode <repo_path> --compact [--git-context]
556
+ repo_path: absolute path to the repository (default: current working directory).
557
+ git_context: include git log and branch context in the analysis.
558
+ """
559
+
560
+ _GET_AGENT_DOC = """\
561
+ Full structured agent context with extended machine-oriented signals (~5000-15000 tokens).
562
+
563
+ Best for: deep analysis, bug investigation, code review, or when get_compact_context
564
+ lacks sufficient detail. Includes all compact fields plus: env_map, code_notes,
565
+ architecture layers, security surface, transactional boundaries, module graph summary.
566
+ Prefer get_compact_context for quick orientation or token-constrained workflows.
567
+
568
+ Maps to: sourcecode <repo_path> --agent [--git-context]
569
+ repo_path: absolute path to the repository (default: current working directory).
570
+ git_context: include git log and branch context in the analysis.
571
+ """
572
+
573
+ _GET_MODULE_DOC = """\
574
+ Compact analysis of a specific module or subdirectory within a repository.
575
+
576
+ Maps to: sourcecode <repo_path>/<module> --compact
577
+ repo_path: absolute path to the repository root.
578
+ module: subdirectory name relative to repo_path (e.g. 'src/auth', 'api', 'core').
579
+ Returns: same fields as get_compact_context but scoped to the module subtree.
580
+ """
581
+
582
+ _TELEMETRY_DOC = """\
583
+ Manage telemetry settings.
584
+
585
+ Maps to: sourcecode telemetry <action>
586
+ action: one of "status" (show current state), "enable" (opt in), "disable" (opt out).
587
+ Valid values: "status" | "enable" | "disable"
588
+ """
589
+
547
590
  return [
548
591
  _alias_spec(
549
592
  "get_compact_context",
550
- "Compact repository summary derived from the root CLI command. "
551
- "Use get_agent_context for richer detail.",
593
+ "Compact human/LLM summary of a repository (~1000-3000 tokens). USE THIS FIRST.",
552
594
  ("sourcecode",),
553
595
  params_compact,
554
596
  compact_argv,
555
597
  supported_targets=("repo_path",),
556
598
  unsupported_targets=("file_path",),
557
599
  validator=validate_repo_path,
600
+ docstring_override=_GET_COMPACT_DOC,
558
601
  ),
559
602
  _alias_spec(
560
603
  "get_agent_context",
561
- "Extended repository context derived from the root CLI command.",
604
+ "Full structured agent context with extended machine-oriented signals (~5000-15000 tokens).",
562
605
  ("sourcecode",),
563
606
  params_compact,
564
607
  agent_argv,
565
608
  supported_targets=("repo_path",),
566
609
  unsupported_targets=("file_path",),
567
610
  validator=validate_repo_path,
611
+ docstring_override=_GET_AGENT_DOC,
568
612
  ),
569
613
  _alias_spec(
570
614
  "get_module_context",
571
- "Compact context for a specific module path derived from the root CLI command.",
615
+ "Compact analysis of a specific module or subdirectory within a repository.",
572
616
  ("sourcecode",),
573
617
  params_module,
574
618
  module_argv,
575
619
  supported_targets=("repo_path", "module_path"),
576
620
  unsupported_targets=("file_path",),
577
621
  validator=validate_repo_path,
622
+ docstring_override=_GET_MODULE_DOC,
578
623
  ),
579
624
  _alias_spec(
580
625
  "telemetry",
581
- "Telemetry action helper alias that dispatches to the telemetry CLI group.",
626
+ "Manage telemetry settings: status | enable | disable.",
582
627
  ("telemetry",),
583
628
  (
584
629
  ToolParamSpec(
@@ -591,6 +636,7 @@ def _root_aliases() -> list[ToolSpec]:
591
636
  ),
592
637
  lambda inputs: ["telemetry", str(inputs["action"])],
593
638
  supported_targets=("action",),
639
+ docstring_override=_TELEMETRY_DOC,
594
640
  ),
595
641
  ]
596
642
 
@@ -598,10 +644,20 @@ def _root_aliases() -> list[ToolSpec]:
598
644
  def _prepare_context_aliases() -> list[ToolSpec]:
599
645
  validate_repo_path = _repo_path_validator()
600
646
 
601
- def task_alias(name: str, task: str, description: str, *, supported_targets: tuple[str, ...]) -> ToolSpec:
647
+ # Only used for prepare-context tasks that genuinely accept --since (delta, review-pr).
648
+ def _since_task_alias(
649
+ name: str,
650
+ task: str,
651
+ description: str,
652
+ *,
653
+ supported_targets: tuple[str, ...],
654
+ docstring_override: str | None = None,
655
+ ) -> ToolSpec:
602
656
  params = (
603
657
  ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
604
- ToolParamSpec("since", "argument", str, required=False, default=""),
658
+ ToolParamSpec("since", "option", str, required=False, default="",
659
+ option_names=("--since",),
660
+ help="Git ref to diff against (e.g. HEAD~3, origin/main)."),
605
661
  )
606
662
 
607
663
  def argv_builder(inputs: Mapping[str, Any]) -> list[str]:
@@ -611,7 +667,6 @@ def _prepare_context_aliases() -> list[ToolSpec]:
611
667
  if not value and name == "get_delta":
612
668
  try:
613
669
  from sourcecode.mcp.server import _auto_since as _resolve_since
614
-
615
670
  value = _resolve_since(repo_path)
616
671
  except Exception:
617
672
  value = "HEAD~1"
@@ -628,31 +683,310 @@ def _prepare_context_aliases() -> list[ToolSpec]:
628
683
  supported_targets=supported_targets,
629
684
  unsupported_targets=("file_path",),
630
685
  validator=validate_repo_path,
686
+ docstring_override=docstring_override,
631
687
  )
632
688
 
689
+ _GET_DELTA_DOC = """\
690
+ Incremental context: git-changed files since a reference commit.
691
+
692
+ Maps to: sourcecode prepare-context delta <repo_path> --since <since>
693
+ repo_path: absolute path to the repository (default: current working directory).
694
+ since: git ref to diff against (e.g. HEAD~3, main, origin/main).
695
+ If empty or omitted, auto-detects merge-base with origin/main (or
696
+ origin/master). Falls back to HEAD~1 if no remote branch found.
697
+ Pass "HEAD~1" explicitly to force single-commit diff.
698
+ """
699
+
700
+ _REVIEW_PR_DOC = """\
701
+ Execution paths and risk analysis for changed files in a pull request.
702
+
703
+ Maps to: sourcecode prepare-context review-pr <repo_path> [--since <since>]
704
+ Returns: compact_base + execution_paths (diff-scoped) + hotspots for changed files.
705
+ repo_path: absolute path to the repository (default: current working directory).
706
+ since: git ref to diff against (e.g. HEAD~3, main, origin/main).
707
+ If omitted, diffs against uncommitted changes or HEAD~1 fallback.
708
+ """
709
+
710
+ _FIX_BUG_DOC = """\
711
+ Risk-ranked files for bug investigation, optionally focused by symptom.
712
+
713
+ Maps to: sourcecode prepare-context fix-bug <repo_path> [--symptom <symptom>]
714
+ Includes compact_base: security_surface, transactional_boundaries, spring_profiles.
715
+ repo_path: absolute path to the repository (default: current working directory).
716
+ symptom: optional error message or class name to focus the file ranking
717
+ (e.g. "NullPointerException in UserService.findById").
718
+ Without symptom, ranking is generic (by churn/complexity). With symptom,
719
+ the matching class and its callers are ranked first.
720
+ """
721
+
722
+ _ONBOARD_DOC = """\
723
+ Onboarding context: structured overview for new contributors.
724
+
725
+ Maps to: sourcecode prepare-context onboard <repo_path>
726
+ Returns: project structure, key entry points, architectural patterns, getting-started guide.
727
+ repo_path: absolute path to the repository (default: current working directory).
728
+ """
729
+
730
+ _EXPLAIN_DOC = """\
731
+ Architecture and entry-point explanation for a repository.
732
+
733
+ Maps to: sourcecode prepare-context explain <repo_path>
734
+ Returns: project summary, architecture overview, entry points, key dependencies.
735
+ repo_path: absolute path to the repository (default: current working directory).
736
+ """
737
+
738
+ _REFACTOR_DOC = """\
739
+ Structural issues and refactor opportunities for a repository.
740
+
741
+ Maps to: sourcecode prepare-context refactor <repo_path>
742
+ Returns: structural issues, coupling hotspots, high-churn files, improvement opportunities.
743
+ repo_path: absolute path to the repository (default: current working directory).
744
+ """
745
+
746
+ _GENERATE_TESTS_DOC = """\
747
+ Untested source files and test gap analysis for a repository.
748
+
749
+ Maps to: sourcecode prepare-context generate-tests <repo_path> [--all]
750
+ Returns: test_gaps list of untested files ranked by risk.
751
+ On large repos (>2000 classes) analysis is bounded by SOURCECODE_TESTS_TIMEOUT_MS
752
+ (default: 15000 ms). If timeout elapses, returns truncated=true with partial results.
753
+ repo_path: absolute path to the repository (default: current working directory).
754
+ include_all: return full test_gaps list without truncating to top 20.
755
+ """
756
+
757
+ _IR_SUMMARY_DOC = """\
758
+ Deterministic symbol-level IR summary for Java repositories. Java only.
759
+
760
+ Maps to: sourcecode repo-ir <repo_path> --summary-only
761
+ Returns: reverse_graph (top 10 hubs), route_surface (top 50 endpoints),
762
+ subsystems (top 15), impact, analysis. Full graph nodes/edges omitted.
763
+
764
+ Output is bounded to ~100 KB for LLM safety. For full IR (can exceed 10 MB
765
+ on large repos), use the CLI: sourcecode repo-ir <path> --output ir.json
766
+ Use get_compact_context or get_agent_context for non-Java repos.
767
+
768
+ repo_path: absolute path to the Java repository (default: current working directory).
769
+ """
770
+
771
+ _IMPACT_CONTEXT_DOC = """\
772
+ Blast-radius analysis: who calls a class and what breaks if it changes? Java only.
773
+
774
+ Maps to: sourcecode impact <target> <repo_path> [--depth <depth>]
775
+ Returns: direct_callers, indirect_callers, endpoints_affected,
776
+ transactional_boundaries_touched, risk_score, risk_level, stats.
777
+
778
+ Use this when:
779
+ - Planning a refactor: understand the full call chain before changing a class
780
+ - PR review: assess blast radius of a changed service or utility class
781
+ - Incident triage: find all paths that reach a faulty component
782
+
783
+ target: class name (simple or FQN) or Java file path. Examples:
784
+ "UserService", "org.example.UserService", "UserService.java"
785
+ repo_path: absolute path to the Java repository (default: current working directory).
786
+ depth: BFS depth for indirect caller traversal (1–8, default: 4).
787
+ """
788
+
789
+ _MODERNIZE_DOC = """\
790
+ Analyzes codebase for modernization opportunities: dead zones, hotspot scores, upgrade candidates.
791
+
792
+ Maps to: sourcecode modernize <repo_path>
793
+ Returns: hotspot_candidates (high fan-in + git churn), dead_zone_candidates (isolated classes),
794
+ high_coupling_nodes, subsystem_summary, cross_module_tangles, recommendation.
795
+
796
+ Best for: refactor planning, identifying where to start, finding safe removal candidates.
797
+ Use get_compact_context or get_agent_context first for project orientation.
798
+
799
+ repo_path: absolute path to the Java repository (default: current working directory).
800
+ """
801
+
802
+ _CHECK_FRESHNESS_DOC = """\
803
+ Report RIS freshness relative to the current git HEAD.
804
+
805
+ Answers instantly: is the cached snapshot current? How many commits behind?
806
+ Use before deciding whether to call get_compact_context for a refresh.
807
+
808
+ Returns:
809
+ fresh (bool) — True when RIS HEAD == current HEAD and no uncommitted changes
810
+ current_git_head (str) — Current repo HEAD (short SHA)
811
+ ris_git_head (str|null) — HEAD stored in RIS at last build
812
+ delta_commits (int|null) — Commits between ris_git_head and HEAD (0 = in sync)
813
+ has_uncommitted_changes — Working tree has staged or unstaged changes
814
+ ris_exists (bool) — False when no RIS built yet
815
+ ris_last_updated_at (str)— ISO-8601 timestamp of last RIS write
816
+
817
+ repo_path: absolute path to the repository (default: current working directory).
818
+ """
819
+
820
+ _COLD_START_DOC = """\
821
+ Instant session bootstrap from persisted Repository Intelligence Snapshot (RIS).
822
+
823
+ PREFER start_session over this tool — it provides orchestration guidance on top
824
+ of the same RIS data. Use get_cold_start_context when you only need the raw
825
+ RIS bootstrap object without tool sequencing recommendations.
826
+
827
+ Returns cached structural context built from prior analysis runs — zero re-analysis cost.
828
+
829
+ status values:
830
+ "cold_start_ready" — RIS exists and matches the current git HEAD.
831
+ "cold_start_stale" — RIS exists but HEAD has changed since last analysis.
832
+ Data is still useful; run get_compact_context to refresh.
833
+ "no_ris" — No RIS yet for this repo; run get_compact_context first.
834
+
835
+ Returns: status, repo_id, git_head, stale (bool), last_updated_at,
836
+ summary (compact snapshot), entrypoints, endpoints, hotspots.
837
+
838
+ repo_path: absolute path to the repository (default: current working directory).
839
+ """
840
+
841
+ _GET_ENDPOINTS_DOC = """\
842
+ REST API endpoint surface extraction from Java source files. JAVA ONLY.
843
+
844
+ Do NOT call this on non-Java repositories — it will return empty results.
845
+ Use get_compact_context or get_agent_context for non-Java repos.
846
+
847
+ Maps to: sourcecode endpoints <repo_path>
848
+ Returns: endpoints list with method, path, controller, handler fields;
849
+ security dict always present (policy: roles_allowed|permit_all|deny_all|
850
+ authenticated|...|none_detected); none_detected = no auth annotation found.
851
+ total (int), no_security_signal (int), and security_model (str) fields.
852
+ no_security_signal counts endpoints where security.policy == "none_detected".
853
+ security_model values: "filter_based" (centralized Spring Security config —
854
+ high no_security_signal is expected and does NOT mean endpoints are unprotected),
855
+ "annotation_based" (per-endpoint annotations only), "mixed" (both),
856
+ "unknown" (no security signals detected).
857
+ Supports Spring MVC (@GetMapping etc.) and JAX-RS (@GET/@POST etc.).
858
+ repo_path: absolute path to the Java repository (default: current working directory).
859
+ """
860
+
861
+ _CACHE_STATUS_DOC = """\
862
+ Report cache metadata for a repository.
863
+
864
+ Maps to: sourcecode cache status <repo_path> --json
865
+ Returns: cache entries with git_head, timestamps, size info.
866
+ Use check_freshness for RIS-specific freshness checking (faster, richer).
867
+ repo_path: absolute path to the repository (default: current working directory).
868
+ """
869
+
870
+ _CACHE_WARM_DOC = """\
871
+ Warm the cache for a repository (builds compact and agent analysis snapshots).
872
+
873
+ Maps to: sourcecode cache warm <repo_path>
874
+ Builds or refreshes the Repository Intelligence Snapshot (RIS).
875
+ Use before analytical workflows to ensure fast subsequent tool calls (~8s first run,
876
+ instant after).
877
+ repo_path: absolute path to the repository (default: current working directory).
878
+ """
879
+
880
+ _CACHE_CLEAR_DOC = """\
881
+ Clear cached analysis for a repository.
882
+
883
+ Maps to: sourcecode cache clear <repo_path> [--include-ris]
884
+ Removes cached context files. After clearing, run get_compact_context or cache_warm to rebuild.
885
+ include_ris: also remove the RIS snapshot in addition to analysis cache (default: False).
886
+ repo_path: absolute path to the repository (default: current working directory).
887
+ """
888
+
633
889
  return [
634
- task_alias("get_delta", "delta", "Incremental delta context from prepare-context.", supported_targets=("repo_path", "git_ref")),
635
- task_alias("fix_bug_context", "fix-bug", "Bug investigation context from prepare-context.", supported_targets=("repo_path", "symptom")),
636
- task_alias("review_pr_context", "review-pr", "Pull-request review context from prepare-context.", supported_targets=("repo_path", "git_ref")),
637
- task_alias("onboard_context", "onboard", "Onboarding context from prepare-context.", supported_targets=("repo_path",)),
638
- task_alias("explain_context", "explain", "Architecture explanation from prepare-context.", supported_targets=("repo_path",)),
639
- task_alias("refactor_context", "refactor", "Refactor context from prepare-context.", supported_targets=("repo_path",)),
890
+ # --- get_delta / review_pr_context: both genuinely use --since ---
891
+ _since_task_alias(
892
+ "get_delta", "delta",
893
+ "Incremental context: git-changed files since a reference commit.",
894
+ supported_targets=("repo_path", "git_ref"),
895
+ docstring_override=_GET_DELTA_DOC,
896
+ ),
897
+ _since_task_alias(
898
+ "review_pr_context", "review-pr",
899
+ "Execution paths and risk analysis for changed files in a pull request.",
900
+ supported_targets=("repo_path", "git_ref"),
901
+ docstring_override=_REVIEW_PR_DOC,
902
+ ),
903
+
904
+ # --- fix_bug_context: --symptom (not --since) ---
905
+ _alias_spec(
906
+ "fix_bug_context",
907
+ "Risk-ranked files for bug investigation, optionally focused by symptom.",
908
+ ("prepare-context",),
909
+ (
910
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
911
+ ToolParamSpec("symptom", "option", str, required=False, default=None,
912
+ option_names=("--symptom",),
913
+ help="Error message or class name to focus file ranking."),
914
+ ),
915
+ lambda inputs: (
916
+ ["prepare-context", "fix-bug", str(inputs.get("repo_path", "."))]
917
+ + (["--symptom", str(inputs["symptom"])] if inputs.get("symptom") else [])
918
+ ),
919
+ supported_targets=("repo_path", "symptom"),
920
+ unsupported_targets=("file_path",),
921
+ validator=validate_repo_path,
922
+ docstring_override=_FIX_BUG_DOC,
923
+ ),
924
+
925
+ # --- onboard / explain / refactor: no --since ---
926
+ _alias_spec(
927
+ "onboard_context",
928
+ "Onboarding context: structured overview for new contributors.",
929
+ ("prepare-context",),
930
+ (
931
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
932
+ ),
933
+ lambda inputs: ["prepare-context", "onboard", str(inputs.get("repo_path", "."))],
934
+ supported_targets=("repo_path",),
935
+ unsupported_targets=("file_path",),
936
+ validator=validate_repo_path,
937
+ docstring_override=_ONBOARD_DOC,
938
+ ),
939
+ _alias_spec(
940
+ "explain_context",
941
+ "Architecture and entry-point explanation for a repository.",
942
+ ("prepare-context",),
943
+ (
944
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
945
+ ),
946
+ lambda inputs: ["prepare-context", "explain", str(inputs.get("repo_path", "."))],
947
+ supported_targets=("repo_path",),
948
+ unsupported_targets=("file_path",),
949
+ validator=validate_repo_path,
950
+ docstring_override=_EXPLAIN_DOC,
951
+ ),
952
+ _alias_spec(
953
+ "refactor_context",
954
+ "Structural issues and refactor opportunities for a repository.",
955
+ ("prepare-context",),
956
+ (
957
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
958
+ ),
959
+ lambda inputs: ["prepare-context", "refactor", str(inputs.get("repo_path", "."))],
960
+ supported_targets=("repo_path",),
961
+ unsupported_targets=("file_path",),
962
+ validator=validate_repo_path,
963
+ docstring_override=_REFACTOR_DOC,
964
+ ),
965
+
966
+ # --- other prepare-context aliases ---
640
967
  _alias_spec(
641
968
  "generate_tests_context",
642
- "Test gap analysis from prepare-context.",
969
+ "Untested source files and test gap analysis for a repository.",
643
970
  ("prepare-context",),
644
971
  (
645
972
  ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
646
- ToolParamSpec("include_all", "argument", bool, required=False, default=False, option_names=("--all",), is_flag=True),
973
+ ToolParamSpec("include_all", "option", bool, required=False, default=False,
974
+ option_names=("--all",), is_flag=True),
975
+ ),
976
+ lambda inputs: (
977
+ ["prepare-context", "generate-tests", str(inputs.get("repo_path", "."))]
978
+ + (["--all"] if bool(inputs.get("include_all")) else [])
647
979
  ),
648
- lambda inputs: ["prepare-context", "generate-tests", str(inputs.get("repo_path", "."))] + (["--all"] if bool(inputs.get("include_all")) else []),
649
980
  supported_targets=("repo_path",),
650
981
  unsupported_targets=("file_path",),
651
982
  validator=validate_repo_path,
983
+ docstring_override=_GENERATE_TESTS_DOC,
652
984
  ),
985
+
986
+ # --- Java analysis aliases ---
653
987
  _alias_spec(
654
988
  "get_ir_summary",
655
- "Summary-mode Java IR context from repo-ir.",
989
+ "Deterministic symbol-level IR summary for Java repositories. Java only.",
656
990
  ("repo-ir",),
657
991
  (
658
992
  ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
@@ -661,10 +995,11 @@ def _prepare_context_aliases() -> list[ToolSpec]:
661
995
  supported_targets=("repo_path",),
662
996
  unsupported_targets=("file_path",),
663
997
  validator=validate_repo_path,
998
+ docstring_override=_IR_SUMMARY_DOC,
664
999
  ),
665
1000
  _alias_spec(
666
1001
  "get_impact_context",
667
- "Blast-radius analysis from impact.",
1002
+ "Blast-radius analysis: who calls a class and what breaks if it changes? Java only.",
668
1003
  ("impact",),
669
1004
  (
670
1005
  ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
@@ -681,10 +1016,11 @@ def _prepare_context_aliases() -> list[ToolSpec]:
681
1016
  supported_targets=("repo_path", "class_name"),
682
1017
  unsupported_targets=("file_path",),
683
1018
  validator=validate_repo_path,
1019
+ docstring_override=_IMPACT_CONTEXT_DOC,
684
1020
  ),
685
1021
  _alias_spec(
686
1022
  "modernize_context",
687
- "Modernization analysis from modernize.",
1023
+ "Modernization analysis: dead zones, hotspot scores, upgrade candidates.",
688
1024
  ("modernize",),
689
1025
  (
690
1026
  ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
@@ -693,10 +1029,13 @@ def _prepare_context_aliases() -> list[ToolSpec]:
693
1029
  supported_targets=("repo_path",),
694
1030
  unsupported_targets=("file_path",),
695
1031
  validator=validate_repo_path,
1032
+ docstring_override=_MODERNIZE_DOC,
696
1033
  ),
1034
+
1035
+ # --- cache / freshness aliases ---
697
1036
  _alias_spec(
698
1037
  "check_freshness",
699
- "Cache freshness check derived from cache freshness.",
1038
+ "Report RIS freshness relative to the current git HEAD.",
700
1039
  ("cache", "freshness"),
701
1040
  (
702
1041
  ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
@@ -705,10 +1044,11 @@ def _prepare_context_aliases() -> list[ToolSpec]:
705
1044
  supported_targets=("repo_path",),
706
1045
  unsupported_targets=("file_path",),
707
1046
  validator=validate_repo_path,
1047
+ docstring_override=_CHECK_FRESHNESS_DOC,
708
1048
  ),
709
1049
  _alias_spec(
710
1050
  "get_cold_start_context",
711
- "Cold-start snapshot from the cold-start CLI command.",
1051
+ "Instant session bootstrap from persisted Repository Intelligence Snapshot (RIS).",
712
1052
  ("cold-start",),
713
1053
  (
714
1054
  ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
@@ -717,6 +1057,69 @@ def _prepare_context_aliases() -> list[ToolSpec]:
717
1057
  supported_targets=("repo_path",),
718
1058
  unsupported_targets=("file_path",),
719
1059
  validator=validate_repo_path,
1060
+ docstring_override=_COLD_START_DOC,
1061
+ ),
1062
+
1063
+ # --- get_endpoints: clean alias replacing raw canonical with 7 CLI params ---
1064
+ _alias_spec(
1065
+ "get_endpoints",
1066
+ "REST API endpoint surface extraction from Java source files. JAVA ONLY.",
1067
+ ("endpoints",),
1068
+ (
1069
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
1070
+ ),
1071
+ lambda inputs: ["endpoints", str(inputs.get("repo_path", "."))],
1072
+ supported_targets=("repo_path",),
1073
+ unsupported_targets=("file_path",),
1074
+ validator=validate_repo_path,
1075
+ docstring_override=_GET_ENDPOINTS_DOC,
1076
+ ),
1077
+
1078
+ # --- cache management: curated aliases stripping CLI noise params ---
1079
+ _alias_spec(
1080
+ "cache_status",
1081
+ "Report cache metadata for a repository.",
1082
+ ("cache", "status"),
1083
+ (
1084
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
1085
+ ),
1086
+ lambda inputs: ["cache", "status", str(inputs.get("repo_path", ".")), "--json"],
1087
+ supported_targets=("repo_path",),
1088
+ unsupported_targets=("file_path",),
1089
+ validator=validate_repo_path,
1090
+ docstring_override=_CACHE_STATUS_DOC,
1091
+ ),
1092
+ _alias_spec(
1093
+ "cache_warm",
1094
+ "Warm the cache for a repository (builds compact and agent analysis snapshots).",
1095
+ ("cache", "warm"),
1096
+ (
1097
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
1098
+ ),
1099
+ lambda inputs: ["cache", "warm", str(inputs.get("repo_path", "."))],
1100
+ supported_targets=("repo_path",),
1101
+ unsupported_targets=("file_path",),
1102
+ validator=validate_repo_path,
1103
+ docstring_override=_CACHE_WARM_DOC,
1104
+ ),
1105
+ _alias_spec(
1106
+ "cache_clear",
1107
+ "Clear cached analysis for a repository.",
1108
+ ("cache", "clear"),
1109
+ (
1110
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
1111
+ ToolParamSpec("include_ris", "option", bool, required=False, default=False,
1112
+ option_names=("--include-ris",), is_flag=True,
1113
+ help="Also remove RIS snapshot (default: False)."),
1114
+ ),
1115
+ lambda inputs: (
1116
+ ["cache", "clear", str(inputs.get("repo_path", ".")), "--yes"]
1117
+ + (["--include-ris"] if bool(inputs.get("include_ris")) else [])
1118
+ ),
1119
+ supported_targets=("repo_path",),
1120
+ unsupported_targets=("file_path",),
1121
+ validator=validate_repo_path,
1122
+ docstring_override=_CACHE_CLEAR_DOC,
720
1123
  ),
721
1124
  ]
722
1125
 
@@ -812,6 +1215,11 @@ _MCP_HIDDEN_CANONICAL_TOOLS: frozenset[str] = frozenset({
812
1215
  "cold_start", # duplicate of get_cold_start_context
813
1216
  "cache_freshness", # duplicate of check_freshness
814
1217
  "modernize", # duplicate of modernize_context
1218
+ # Raw CLI tools with output-format/noise params — clean alias with only repo_path exists
1219
+ "endpoints", # 7 CLI params (output_path/format/copy/etc.); use get_endpoints
1220
+ "cache_status", # path + json_output flag; curated alias strips json_output, renames path→repo_path
1221
+ "cache_warm", # path + compact/agent output flags; curated alias keeps only repo_path
1222
+ "cache_clear", # path + yes/all_ destructive flags; curated alias keeps repo_path + include_ris only
815
1223
  # Curated overrides — canonical CLI spec replaced by cleaner alias with same name.
816
1224
  # Listed here so validate_registry() skips CLI param-drift checks on the alias.
817
1225
  "spring_audit", # curated: repo_path + scope + min_severity only (strips output_path/format/copy)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes