sourcecode 1.35.7__py3-none-any.whl → 1.35.9__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 CHANGED
@@ -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.9"
@@ -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,318 @@ 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, route_surface (top 50 endpoints),
762
+ subsystems (top 15), impact, analysis. Full graph nodes/edges omitted.
763
+
764
+ reverse_graph: dict[class_FQN → {"contained_in": [method_FQNs], ...}]
765
+ Top 10 most-referenced (highest in-degree) classes in the dependency graph.
766
+ Keys are fully-qualified class names. Iterate with:
767
+ for fqn, data in result["reverse_graph"].items(): ...
768
+ route_surface: list of endpoint dicts (method, path, handler, security).
769
+ subsystems: list of detected subsystem cluster dicts.
770
+ analysis: metadata — total_classes, total_edges, analysis_ms.
771
+
772
+ Output is bounded to ~100 KB for LLM safety. For full IR (can exceed 10 MB
773
+ on large repos), use the CLI: sourcecode repo-ir <path> --output ir.json
774
+ Use get_compact_context or get_agent_context for non-Java repos.
775
+
776
+ repo_path: absolute path to the Java repository (default: current working directory).
777
+ """
778
+
779
+ _IMPACT_CONTEXT_DOC = """\
780
+ Blast-radius analysis: who calls a class and what breaks if it changes? Java only.
781
+
782
+ Maps to: sourcecode impact <target> <repo_path> [--depth <depth>]
783
+ Returns: direct_callers, indirect_callers, endpoints_affected,
784
+ transactional_boundaries_touched, risk_score, risk_level, stats.
785
+
786
+ Use this when:
787
+ - Planning a refactor: understand the full call chain before changing a class
788
+ - PR review: assess blast radius of a changed service or utility class
789
+ - Incident triage: find all paths that reach a faulty component
790
+
791
+ target: class name (simple or FQN) or Java file path. Examples:
792
+ "UserService", "org.example.UserService", "UserService.java"
793
+ repo_path: absolute path to the Java repository (default: current working directory).
794
+ depth: BFS depth for indirect caller traversal (1–8, default: 4).
795
+ """
796
+
797
+ _MODERNIZE_DOC = """\
798
+ Analyzes codebase for modernization opportunities: dead zones, hotspot scores, upgrade candidates.
799
+
800
+ Maps to: sourcecode modernize <repo_path>
801
+ Returns: hotspot_candidates (high fan-in + git churn), dead_zone_candidates (isolated classes),
802
+ high_coupling_nodes, subsystem_summary, cross_module_tangles, recommendation.
803
+
804
+ Best for: refactor planning, identifying where to start, finding safe removal candidates.
805
+ Use get_compact_context or get_agent_context first for project orientation.
806
+
807
+ repo_path: absolute path to the Java repository (default: current working directory).
808
+ """
809
+
810
+ _CHECK_FRESHNESS_DOC = """\
811
+ Report RIS freshness relative to the current git HEAD.
812
+
813
+ Answers instantly: is the cached snapshot current? How many commits behind?
814
+ Use before deciding whether to call get_compact_context for a refresh.
815
+
816
+ Returns:
817
+ fresh (bool) — True when RIS HEAD == current HEAD and no uncommitted changes
818
+ current_git_head (str) — Current repo HEAD (short SHA)
819
+ ris_git_head (str|null) — HEAD stored in RIS at last build
820
+ delta_commits (int|null) — Commits between ris_git_head and HEAD (0 = in sync)
821
+ has_uncommitted_changes — Working tree has staged or unstaged changes
822
+ ris_exists (bool) — False when no RIS built yet
823
+ ris_last_updated_at (str)— ISO-8601 timestamp of last RIS write
824
+
825
+ repo_path: absolute path to the repository (default: current working directory).
826
+ """
827
+
828
+ _COLD_START_DOC = """\
829
+ Instant session bootstrap from persisted Repository Intelligence Snapshot (RIS).
830
+
831
+ PREFER start_session over this tool — it provides orchestration guidance on top
832
+ of the same RIS data. Use get_cold_start_context when you only need the raw
833
+ RIS bootstrap object without tool sequencing recommendations.
834
+
835
+ Returns cached structural context built from prior analysis runs — zero re-analysis cost.
836
+
837
+ status values:
838
+ "cold_start_ready" — RIS exists and matches the current git HEAD.
839
+ "cold_start_stale" — RIS exists but HEAD has changed since last analysis.
840
+ Data is still useful; run get_compact_context to refresh.
841
+ "no_ris" — No RIS yet for this repo; run get_compact_context first.
842
+
843
+ Returns: status, repo_id, git_head, stale (bool), last_updated_at,
844
+ summary (compact snapshot), entrypoints, endpoints, hotspots.
845
+
846
+ repo_path: absolute path to the repository (default: current working directory).
847
+ """
848
+
849
+ _GET_ENDPOINTS_DOC = """\
850
+ REST API endpoint surface extraction from Java source files. JAVA ONLY.
851
+
852
+ Do NOT call this on non-Java repositories — it will return empty results.
853
+ Use get_compact_context or get_agent_context for non-Java repos.
854
+
855
+ Maps to: sourcecode endpoints <repo_path>
856
+ Returns: endpoints list with method, path, controller, handler fields;
857
+ security dict always present (policy: roles_allowed|permit_all|deny_all|
858
+ authenticated|...|none_detected); none_detected = no auth annotation found.
859
+ total (int), no_security_signal (int), and security_model (str) fields.
860
+ no_security_signal counts endpoints where security.policy == "none_detected".
861
+ security_model values: "filter_based" (centralized Spring Security config —
862
+ high no_security_signal is expected and does NOT mean endpoints are unprotected),
863
+ "annotation_based" (per-endpoint annotations only), "mixed" (both),
864
+ "unknown" (no security signals detected).
865
+ Supports Spring MVC (@GetMapping etc.) and JAX-RS (@GET/@POST etc.).
866
+ repo_path: absolute path to the Java repository (default: current working directory).
867
+ """
868
+
869
+ _CACHE_STATUS_DOC = """\
870
+ Report cache metadata for a repository.
871
+
872
+ Maps to: sourcecode cache status <repo_path> --json
873
+ Returns: cache entries with git_head, timestamps, size info.
874
+ Use check_freshness for RIS-specific freshness checking (faster, richer).
875
+ repo_path: absolute path to the repository (default: current working directory).
876
+ """
877
+
878
+ _CACHE_WARM_DOC = """\
879
+ Warm the cache for a repository (builds compact and agent analysis snapshots).
880
+
881
+ Maps to: sourcecode cache warm <repo_path>
882
+ Builds or refreshes the Repository Intelligence Snapshot (RIS).
883
+ Use before analytical workflows to ensure fast subsequent tool calls (~8s first run,
884
+ instant after).
885
+ repo_path: absolute path to the repository (default: current working directory).
886
+ """
887
+
888
+ _CACHE_CLEAR_DOC = """\
889
+ Clear cached analysis for a repository.
890
+
891
+ Maps to: sourcecode cache clear <repo_path> [--include-ris]
892
+ Removes cached context files. After clearing, run get_compact_context or cache_warm to rebuild.
893
+ include_ris: also remove the RIS snapshot in addition to analysis cache (default: False).
894
+ repo_path: absolute path to the repository (default: current working directory).
895
+ """
896
+
633
897
  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",)),
898
+ # --- get_delta / review_pr_context: both genuinely use --since ---
899
+ _since_task_alias(
900
+ "get_delta", "delta",
901
+ "Incremental context: git-changed files since a reference commit.",
902
+ supported_targets=("repo_path", "git_ref"),
903
+ docstring_override=_GET_DELTA_DOC,
904
+ ),
905
+ _since_task_alias(
906
+ "review_pr_context", "review-pr",
907
+ "Execution paths and risk analysis for changed files in a pull request.",
908
+ supported_targets=("repo_path", "git_ref"),
909
+ docstring_override=_REVIEW_PR_DOC,
910
+ ),
911
+
912
+ # --- fix_bug_context: --symptom (not --since) ---
913
+ _alias_spec(
914
+ "fix_bug_context",
915
+ "Risk-ranked files for bug investigation, optionally focused by symptom.",
916
+ ("prepare-context",),
917
+ (
918
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
919
+ ToolParamSpec("symptom", "option", str, required=False, default=None,
920
+ option_names=("--symptom",),
921
+ help="Error message or class name to focus file ranking."),
922
+ ),
923
+ lambda inputs: (
924
+ ["prepare-context", "fix-bug", str(inputs.get("repo_path", "."))]
925
+ + (["--symptom", str(inputs["symptom"])] if inputs.get("symptom") else [])
926
+ ),
927
+ supported_targets=("repo_path", "symptom"),
928
+ unsupported_targets=("file_path",),
929
+ validator=validate_repo_path,
930
+ docstring_override=_FIX_BUG_DOC,
931
+ ),
932
+
933
+ # --- onboard / explain / refactor: no --since ---
934
+ _alias_spec(
935
+ "onboard_context",
936
+ "Onboarding context: structured overview for new contributors.",
937
+ ("prepare-context",),
938
+ (
939
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
940
+ ),
941
+ lambda inputs: ["prepare-context", "onboard", str(inputs.get("repo_path", "."))],
942
+ supported_targets=("repo_path",),
943
+ unsupported_targets=("file_path",),
944
+ validator=validate_repo_path,
945
+ docstring_override=_ONBOARD_DOC,
946
+ ),
947
+ _alias_spec(
948
+ "explain_context",
949
+ "Architecture and entry-point explanation for a repository.",
950
+ ("prepare-context",),
951
+ (
952
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
953
+ ),
954
+ lambda inputs: ["prepare-context", "explain", str(inputs.get("repo_path", "."))],
955
+ supported_targets=("repo_path",),
956
+ unsupported_targets=("file_path",),
957
+ validator=validate_repo_path,
958
+ docstring_override=_EXPLAIN_DOC,
959
+ ),
960
+ _alias_spec(
961
+ "refactor_context",
962
+ "Structural issues and refactor opportunities for a repository.",
963
+ ("prepare-context",),
964
+ (
965
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
966
+ ),
967
+ lambda inputs: ["prepare-context", "refactor", str(inputs.get("repo_path", "."))],
968
+ supported_targets=("repo_path",),
969
+ unsupported_targets=("file_path",),
970
+ validator=validate_repo_path,
971
+ docstring_override=_REFACTOR_DOC,
972
+ ),
973
+
974
+ # --- other prepare-context aliases ---
640
975
  _alias_spec(
641
976
  "generate_tests_context",
642
- "Test gap analysis from prepare-context.",
977
+ "Untested source files and test gap analysis for a repository.",
643
978
  ("prepare-context",),
644
979
  (
645
980
  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),
981
+ ToolParamSpec("include_all", "option", bool, required=False, default=False,
982
+ option_names=("--all",), is_flag=True),
983
+ ),
984
+ lambda inputs: (
985
+ ["prepare-context", "generate-tests", str(inputs.get("repo_path", "."))]
986
+ + (["--all"] if bool(inputs.get("include_all")) else [])
647
987
  ),
648
- lambda inputs: ["prepare-context", "generate-tests", str(inputs.get("repo_path", "."))] + (["--all"] if bool(inputs.get("include_all")) else []),
649
988
  supported_targets=("repo_path",),
650
989
  unsupported_targets=("file_path",),
651
990
  validator=validate_repo_path,
991
+ docstring_override=_GENERATE_TESTS_DOC,
652
992
  ),
993
+
994
+ # --- Java analysis aliases ---
653
995
  _alias_spec(
654
996
  "get_ir_summary",
655
- "Summary-mode Java IR context from repo-ir.",
997
+ "Deterministic symbol-level IR summary for Java repositories. Java only.",
656
998
  ("repo-ir",),
657
999
  (
658
1000
  ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
@@ -661,10 +1003,11 @@ def _prepare_context_aliases() -> list[ToolSpec]:
661
1003
  supported_targets=("repo_path",),
662
1004
  unsupported_targets=("file_path",),
663
1005
  validator=validate_repo_path,
1006
+ docstring_override=_IR_SUMMARY_DOC,
664
1007
  ),
665
1008
  _alias_spec(
666
1009
  "get_impact_context",
667
- "Blast-radius analysis from impact.",
1010
+ "Blast-radius analysis: who calls a class and what breaks if it changes? Java only.",
668
1011
  ("impact",),
669
1012
  (
670
1013
  ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
@@ -681,10 +1024,11 @@ def _prepare_context_aliases() -> list[ToolSpec]:
681
1024
  supported_targets=("repo_path", "class_name"),
682
1025
  unsupported_targets=("file_path",),
683
1026
  validator=validate_repo_path,
1027
+ docstring_override=_IMPACT_CONTEXT_DOC,
684
1028
  ),
685
1029
  _alias_spec(
686
1030
  "modernize_context",
687
- "Modernization analysis from modernize.",
1031
+ "Modernization analysis: dead zones, hotspot scores, upgrade candidates.",
688
1032
  ("modernize",),
689
1033
  (
690
1034
  ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
@@ -693,10 +1037,13 @@ def _prepare_context_aliases() -> list[ToolSpec]:
693
1037
  supported_targets=("repo_path",),
694
1038
  unsupported_targets=("file_path",),
695
1039
  validator=validate_repo_path,
1040
+ docstring_override=_MODERNIZE_DOC,
696
1041
  ),
1042
+
1043
+ # --- cache / freshness aliases ---
697
1044
  _alias_spec(
698
1045
  "check_freshness",
699
- "Cache freshness check derived from cache freshness.",
1046
+ "Report RIS freshness relative to the current git HEAD.",
700
1047
  ("cache", "freshness"),
701
1048
  (
702
1049
  ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
@@ -705,10 +1052,11 @@ def _prepare_context_aliases() -> list[ToolSpec]:
705
1052
  supported_targets=("repo_path",),
706
1053
  unsupported_targets=("file_path",),
707
1054
  validator=validate_repo_path,
1055
+ docstring_override=_CHECK_FRESHNESS_DOC,
708
1056
  ),
709
1057
  _alias_spec(
710
1058
  "get_cold_start_context",
711
- "Cold-start snapshot from the cold-start CLI command.",
1059
+ "Instant session bootstrap from persisted Repository Intelligence Snapshot (RIS).",
712
1060
  ("cold-start",),
713
1061
  (
714
1062
  ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
@@ -717,6 +1065,69 @@ def _prepare_context_aliases() -> list[ToolSpec]:
717
1065
  supported_targets=("repo_path",),
718
1066
  unsupported_targets=("file_path",),
719
1067
  validator=validate_repo_path,
1068
+ docstring_override=_COLD_START_DOC,
1069
+ ),
1070
+
1071
+ # --- get_endpoints: clean alias replacing raw canonical with 7 CLI params ---
1072
+ _alias_spec(
1073
+ "get_endpoints",
1074
+ "REST API endpoint surface extraction from Java source files. JAVA ONLY.",
1075
+ ("endpoints",),
1076
+ (
1077
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
1078
+ ),
1079
+ lambda inputs: ["endpoints", str(inputs.get("repo_path", "."))],
1080
+ supported_targets=("repo_path",),
1081
+ unsupported_targets=("file_path",),
1082
+ validator=validate_repo_path,
1083
+ docstring_override=_GET_ENDPOINTS_DOC,
1084
+ ),
1085
+
1086
+ # --- cache management: curated aliases stripping CLI noise params ---
1087
+ _alias_spec(
1088
+ "cache_status",
1089
+ "Report cache metadata for a repository.",
1090
+ ("cache", "status"),
1091
+ (
1092
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
1093
+ ),
1094
+ lambda inputs: ["cache", "status", str(inputs.get("repo_path", ".")), "--json"],
1095
+ supported_targets=("repo_path",),
1096
+ unsupported_targets=("file_path",),
1097
+ validator=validate_repo_path,
1098
+ docstring_override=_CACHE_STATUS_DOC,
1099
+ ),
1100
+ _alias_spec(
1101
+ "cache_warm",
1102
+ "Warm the cache for a repository (builds compact and agent analysis snapshots).",
1103
+ ("cache", "warm"),
1104
+ (
1105
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
1106
+ ),
1107
+ lambda inputs: ["cache", "warm", str(inputs.get("repo_path", "."))],
1108
+ supported_targets=("repo_path",),
1109
+ unsupported_targets=("file_path",),
1110
+ validator=validate_repo_path,
1111
+ docstring_override=_CACHE_WARM_DOC,
1112
+ ),
1113
+ _alias_spec(
1114
+ "cache_clear",
1115
+ "Clear cached analysis for a repository.",
1116
+ ("cache", "clear"),
1117
+ (
1118
+ ToolParamSpec("repo_path", "argument", str, required=False, default=".", is_path=True),
1119
+ ToolParamSpec("include_ris", "option", bool, required=False, default=False,
1120
+ option_names=("--include-ris",), is_flag=True,
1121
+ help="Also remove RIS snapshot (default: False)."),
1122
+ ),
1123
+ lambda inputs: (
1124
+ ["cache", "clear", str(inputs.get("repo_path", ".")), "--yes"]
1125
+ + (["--include-ris"] if bool(inputs.get("include_ris")) else [])
1126
+ ),
1127
+ supported_targets=("repo_path",),
1128
+ unsupported_targets=("file_path",),
1129
+ validator=validate_repo_path,
1130
+ docstring_override=_CACHE_CLEAR_DOC,
720
1131
  ),
721
1132
  ]
722
1133
 
@@ -812,6 +1223,11 @@ _MCP_HIDDEN_CANONICAL_TOOLS: frozenset[str] = frozenset({
812
1223
  "cold_start", # duplicate of get_cold_start_context
813
1224
  "cache_freshness", # duplicate of check_freshness
814
1225
  "modernize", # duplicate of modernize_context
1226
+ # Raw CLI tools with output-format/noise params — clean alias with only repo_path exists
1227
+ "endpoints", # 7 CLI params (output_path/format/copy/etc.); use get_endpoints
1228
+ "cache_status", # path + json_output flag; curated alias strips json_output, renames path→repo_path
1229
+ "cache_warm", # path + compact/agent output flags; curated alias keeps only repo_path
1230
+ "cache_clear", # path + yes/all_ destructive flags; curated alias keeps repo_path + include_ris only
815
1231
  # Curated overrides — canonical CLI spec replaced by cleaner alias with same name.
816
1232
  # Listed here so validate_registry() skips CLI param-drift checks on the alias.
817
1233
  "spring_audit", # curated: repo_path + scope + min_severity only (strips output_path/format/copy)
@@ -826,6 +1242,9 @@ _MCP_HIDDEN_CANONICAL_TOOLS: frozenset[str] = frozenset({
826
1242
  "telemetry_status",
827
1243
  "telemetry_enable",
828
1244
  "telemetry_disable",
1245
+ # Human admin actions — not agent actions
1246
+ "activate", # Pro license key activation; human admin only, not an agent operation
1247
+ "config", # returns plain-text config dump (not JSON); version via `version`, telemetry via `telemetry`
829
1248
  })
830
1249
 
831
1250
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sourcecode
3
- Version: 1.35.7
3
+ Version: 1.35.9
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
@@ -1,4 +1,4 @@
1
- sourcecode/__init__.py,sha256=YB4S9jo7LKaihLW3yz-L5Iz_CCvBXd4y36fMz4uaCAM,103
1
+ sourcecode/__init__.py,sha256=jYgzp9kVJSRMgtoeZrqppqoxaCZsi_g-Dcvz9yL1UTM,103
2
2
  sourcecode/adaptive_scanner.py,sha256=XffluXKzJUXrMtjEiAOnSNPZnztdIcts17T9ouHeID0,10521
3
3
  sourcecode/architecture_analyzer.py,sha256=qh749a7ykPtGmQI1MR9y6j8TtL_jBdVYFx9YRsLqOMw,44121
4
4
  sourcecode/architecture_summary.py,sha256=z34_6v7cSwy98cof2UVciGho7SCrZ93tiqMmq5WNzRQ,20405
@@ -76,7 +76,7 @@ sourcecode/detectors/terraform.py,sha256=cxORPR_zVLOJpHlh4e9JnFpkQsn_UnqMMom5yG6
76
76
  sourcecode/detectors/tooling.py,sha256=8CKbtxwQoABP-WyBRNmdAmHDOvAH57AR1cF4UKuWEdQ,2074
77
77
  sourcecode/mcp/__init__.py,sha256=XU4HfRGbdid8wdUA0x_4f7uKZD1z3mv_XUY_WU_T9Mw,179
78
78
  sourcecode/mcp/orchestrator.py,sha256=BMi1D6liJHI3DXiaC8yeBLLP0wXajpCP3-vnRGqrvnw,26850
79
- sourcecode/mcp/registry.py,sha256=MPMhxI7nx8HC48Zo2IXfOexKWW1e6J9Ex1OjW8lGCcg,41819
79
+ sourcecode/mcp/registry.py,sha256=Z-deZiVowoYbYhi39ScBIgJ2y4mpQintmjifBr9hk4M,60897
80
80
  sourcecode/mcp/runner.py,sha256=-Dp2qPGRkfNTVen6bKh7WtzQqpcEtsrXoiuajvshlKk,2866
81
81
  sourcecode/mcp/server.py,sha256=lBSQCw3yFe8rZHp2GGVcfua0EJUYZmsIUbvA4GIJv9s,52210
82
82
  sourcecode/mcp/onboarding/__init__.py,sha256=sj2PWqEBmMc4zBNkomg89WtL0M6S7A9yb7_wAuSWNP4,66
@@ -90,8 +90,8 @@ sourcecode/telemetry/consent.py,sha256=wLMvGNJeSSyZoNkQXpoUioY6mMv4Qdvuw7S9jAEWn
90
90
  sourcecode/telemetry/events.py,sha256=oEvvulfsv5GIDWG2174gSS6tNB95w38AIYiYeifGKlE,2294
91
91
  sourcecode/telemetry/filters.py,sha256=Asa71oRl7q3Wt_FMwuufIZJFzSYdgRNKS8LHCIyFeYE,4805
92
92
  sourcecode/telemetry/transport.py,sha256=KJeIPCPWMdmbCP3ySGs2iUlia34U6vWne2dZsUezesw,1560
93
- sourcecode-1.35.7.dist-info/METADATA,sha256=nMUv3kkN_jZJ-dII8704TjO4B_m3en9qjH3D4qjEuJk,21263
94
- sourcecode-1.35.7.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
95
- sourcecode-1.35.7.dist-info/entry_points.txt,sha256=ex3F9rmbXeyDIoFQHtkEqTsKSaJow8F0LrVu8XfIktQ,57
96
- sourcecode-1.35.7.dist-info/licenses/LICENSE,sha256=7DdHrU9Z_3e7dSvq4ISijZNjnuHo5NIHNiHDouMQ9JU,10491
97
- sourcecode-1.35.7.dist-info/RECORD,,
93
+ sourcecode-1.35.9.dist-info/METADATA,sha256=27WvW2cnKec3v3JSCzmM194zt9WBSIcekcEdrdsXYAk,21263
94
+ sourcecode-1.35.9.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
95
+ sourcecode-1.35.9.dist-info/entry_points.txt,sha256=ex3F9rmbXeyDIoFQHtkEqTsKSaJow8F0LrVu8XfIktQ,57
96
+ sourcecode-1.35.9.dist-info/licenses/LICENSE,sha256=7DdHrU9Z_3e7dSvq4ISijZNjnuHo5NIHNiHDouMQ9JU,10491
97
+ sourcecode-1.35.9.dist-info/RECORD,,