java-codebase-rag 0.12.0__py3-none-any.whl → 0.12.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. java_codebase_rag-0.12.2.dist-info/METADATA +35 -0
  2. java_codebase_rag-0.12.2.dist-info/RECORD +4 -0
  3. {java_codebase_rag-0.12.0.dist-info → java_codebase_rag-0.12.2.dist-info}/WHEEL +1 -1
  4. java_codebase_rag/_deprecation.py +0 -103
  5. java_codebase_rag/_fdlimit.py +0 -56
  6. java_codebase_rag/_stdio.py +0 -32
  7. java_codebase_rag/_version.py +0 -35
  8. java_codebase_rag/absence/__init__.py +0 -0
  9. java_codebase_rag/absence/absence_diagnosis.py +0 -700
  10. java_codebase_rag/absence/absence_types.py +0 -124
  11. java_codebase_rag/absence/absence_vocab.py +0 -460
  12. java_codebase_rag/analysis/__init__.py +0 -0
  13. java_codebase_rag/analysis/pr_analysis.py +0 -563
  14. java_codebase_rag/analysis/resolve_service.py +0 -740
  15. java_codebase_rag/ast/__init__.py +0 -0
  16. java_codebase_rag/ast/ast_java.py +0 -2847
  17. java_codebase_rag/ast/ast_kotlin.py +0 -1794
  18. java_codebase_rag/ast/brownfield_events.py +0 -58
  19. java_codebase_rag/ast/chunk_heuristics.py +0 -83
  20. java_codebase_rag/ast/language.py +0 -117
  21. java_codebase_rag/cli.py +0 -1215
  22. java_codebase_rag/cli_dispatch.py +0 -251
  23. java_codebase_rag/cli_format.py +0 -85
  24. java_codebase_rag/cli_progress.py +0 -94
  25. java_codebase_rag/config.py +0 -833
  26. java_codebase_rag/eval/__init__.py +0 -1
  27. java_codebase_rag/eval/ground_truth.py +0 -100
  28. java_codebase_rag/eval/metrics.py +0 -107
  29. java_codebase_rag/eval/runner.py +0 -556
  30. java_codebase_rag/graph/__init__.py +0 -0
  31. java_codebase_rag/graph/build_ast_graph.py +0 -4593
  32. java_codebase_rag/graph/graph_enrich.py +0 -1940
  33. java_codebase_rag/graph/graph_types.py +0 -224
  34. java_codebase_rag/graph/java_ontology.py +0 -465
  35. java_codebase_rag/graph/ladybug_queries.py +0 -2213
  36. java_codebase_rag/graph/path_filtering.py +0 -509
  37. java_codebase_rag/index/__init__.py +0 -0
  38. java_codebase_rag/index/java_index_flow_lancedb.py +0 -879
  39. java_codebase_rag/index/java_index_v1_common.py +0 -33
  40. java_codebase_rag/install_data/__init__.py +0 -0
  41. java_codebase_rag/install_data/agents/explorer-rag-cli.md +0 -110
  42. java_codebase_rag/install_data/agents/explorer-rag-enhanced.md +0 -152
  43. java_codebase_rag/install_data/skills/explore-codebase/SKILL.md +0 -165
  44. java_codebase_rag/install_data/skills/explore-codebase-cli/SKILL.md +0 -107
  45. java_codebase_rag/installer.py +0 -2188
  46. java_codebase_rag/jrag.py +0 -4545
  47. java_codebase_rag/jrag_envelope.py +0 -1107
  48. java_codebase_rag/jrag_hints.py +0 -204
  49. java_codebase_rag/jrag_render.py +0 -926
  50. java_codebase_rag/lance_optimize.py +0 -264
  51. java_codebase_rag/mcp/__init__.py +0 -0
  52. java_codebase_rag/mcp/mcp_hints.py +0 -932
  53. java_codebase_rag/mcp/mcp_v2.py +0 -1916
  54. java_codebase_rag/mcp/server.py +0 -886
  55. java_codebase_rag/pipeline.py +0 -531
  56. java_codebase_rag/progress.py +0 -570
  57. java_codebase_rag/read_payloads.py +0 -781
  58. java_codebase_rag/search/__init__.py +0 -0
  59. java_codebase_rag/search/index_common.py +0 -10
  60. java_codebase_rag/search/search_lancedb.py +0 -1296
  61. java_codebase_rag/search/search_lexical.py +0 -449
  62. java_codebase_rag/search/search_scoring.py +0 -537
  63. java_codebase_rag/watch/__init__.py +0 -0
  64. java_codebase_rag/watch/client.py +0 -230
  65. java_codebase_rag/watch/daemon.py +0 -396
  66. java_codebase_rag/watch/lock.py +0 -201
  67. java_codebase_rag/watch/paths.py +0 -76
  68. java_codebase_rag/watch/protocol.py +0 -122
  69. java_codebase_rag/watch/server.py +0 -273
  70. java_codebase_rag/watch/warm.py +0 -105
  71. java_codebase_rag/watch/watcher.py +0 -394
  72. java_codebase_rag-0.12.0.dist-info/METADATA +0 -340
  73. java_codebase_rag-0.12.0.dist-info/RECORD +0 -75
  74. java_codebase_rag-0.12.0.dist-info/entry_points.txt +0 -5
  75. java_codebase_rag-0.12.0.dist-info/licenses/LICENSE +0 -21
  76. java_codebase_rag-0.12.0.dist-info/top_level.txt +0 -1
  77. /java_codebase_rag/__init__.py → /java_codebase_rag-0.12.2.dist-info/top_level.txt +0 -0
@@ -0,0 +1,35 @@
1
+ Metadata-Version: 2.4
2
+ Name: java-codebase-rag
3
+ Version: 0.12.2
4
+ Summary: Renamed to jrag-cli; this package only depends on jrag-cli. New setups: pip install jrag-cli.
5
+ Author: HumanBean17
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/HumanBean17/jrag
8
+ Project-URL: Repository, https://github.com/HumanBean17/jrag
9
+ Project-URL: Issues, https://github.com/HumanBean17/jrag/issues
10
+ Requires-Python: >=3.11
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: jrag-cli==0.12.2
13
+
14
+ # java-codebase-rag (renamed to `jrag-cli`)
15
+
16
+ This package has been **renamed to [`jrag-cli`](https://github.com/HumanBean17/jrag)**.
17
+
18
+ `java-codebase-rag` remains on PyPI as a thin compatibility shim that depends
19
+ on `jrag-cli` and ships no code of its own. Upgrading an existing install
20
+ pulls `jrag-cli` in transparently:
21
+
22
+ ```bash
23
+ pip install -U java-codebase-rag # installs jrag-cli behind the scenes
24
+ ```
25
+
26
+ For new setups, install the canonical package directly:
27
+
28
+ ```bash
29
+ pip install jrag-cli
30
+ ```
31
+
32
+ The CLI entry points, MCP server, and module layout are unchanged — `jrag`
33
+ and `jrag-mcp` (plus the legacy `java-codebase-rag` / `java-codebase-rag-mcp`
34
+ aliases) are all provided by `jrag-cli`. See
35
+ [HumanBean17/jrag](https://github.com/HumanBean17/jrag) for documentation.
@@ -0,0 +1,4 @@
1
+ java_codebase_rag-0.12.2.dist-info/METADATA,sha256=HogOSfsVCmGYKez9Kysic8D6GZybCibC7H1rVD78zyg,1264
2
+ java_codebase_rag-0.12.2.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
3
+ java_codebase_rag-0.12.2.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
4
+ java_codebase_rag-0.12.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (83.0.0)
2
+ Generator: setuptools (84.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,103 +0,0 @@
1
- """Legacy-alias deprecation notice for the ``jrag`` rename.
2
-
3
- The tool is being renamed from ``java-codebase-rag`` to ``jrag``. The legacy
4
- command aliases (``java-codebase-rag`` and ``java-codebase-rag-mcp``) continue
5
- to work; when invoked through one of them in an interactive context, this
6
- helper emits a single-line notice pointing the operator at the new name.
7
-
8
- Suppression rule
9
- ----------------
10
- The notice is suppressed when **either** of the following holds:
11
-
12
- * ``$JRAG_NO_DEPRECATION`` is present and non-empty — any non-empty value
13
- suppresses (so ``"1"``, ``"0"``, ``"false"``, ``"yes"`` all suppress; the
14
- empty string and an unset variable do not). The simpler "present and
15
- non-empty" rule is preferred over parsing truthy values so that operators
16
- can shut the notice up with whatever value is easiest to reach for.
17
- * ``sys.stderr.isatty()`` is false (or ``sys.stderr`` lacks ``isatty``) — i.e.
18
- non-interactive contexts: piped, redirected, or captured stderr. Under real
19
- MCP use stderr is not a TTY, so the call is silent in production; it exists
20
- for the rare human-debug case.
21
-
22
- This module is stdlib-only and import-light: it runs at MCP-server startup and
23
- before ``--help``, so it must not pull in any backend (cli, search, mcp) code.
24
- """
25
- from __future__ import annotations
26
-
27
- import os
28
- import sys
29
-
30
- _LEGACY_ALIASES = frozenset({"java-codebase-rag", "java-codebase-rag-mcp"})
31
-
32
- _DEPRECATION_LINE = (
33
- "jrag: 'java-codebase-rag' is now 'jrag'; this alias continues to work. "
34
- "Set JRAG_NO_DEPRECATION=1 to silence.\n"
35
- )
36
-
37
- #: Executable suffixes appended by Windows (and packaging tools like pip) to
38
- #: console-script wrappers. All three are exactly 4 characters long (``.exe``,
39
- #: ``.bat``, ``.cmd``) so a single ``b[:-4]`` slice strips any of them. Stripping
40
- #: keeps routing decisions stable across POSIX and Windows installs:
41
- #: ``C:\\Users\\foo\\Scripts\\jrag.exe`` → ``"jrag"``;
42
- #: ``...\\java-codebase-rag.exe`` → ``"java-codebase-rag"``.
43
- _WINDOWS_EXE_SUFFIXES: tuple[str, ...] = (".exe", ".bat", ".cmd")
44
-
45
-
46
- def _invoked_program_name() -> str:
47
- """Basename of ``sys.argv[0]`` with a Windows executable suffix stripped.
48
-
49
- Returns the empty string when ``sys.argv`` is empty. Otherwise takes
50
- ``os.path.basename(sys.argv[0])`` and, if it ends (case-insensitively) with
51
- one of ``.exe`` / ``.bat`` / ``.cmd``, drops the 4-character suffix.
52
-
53
- Shared with :mod:`java_codebase_rag.cli_dispatch` for identity-default
54
- routing: both legacy-alias deprecation here and ``jrag``-vs-alias routing
55
- there rely on the same canonicalized basename. Without this, Windows builds
56
- would route ``jrag.exe --version`` through the wrong parser and never emit
57
- the deprecation notice for ``java-codebase-rag.exe``.
58
- """
59
- argv = sys.argv
60
- if not argv:
61
- return ""
62
- base = os.path.basename(argv[0])
63
- if base.lower().endswith(_WINDOWS_EXE_SUFFIXES):
64
- return base[:-4]
65
- return base
66
-
67
-
68
- def _stderr_is_tty() -> bool:
69
- """True iff ``sys.stderr`` reports itself as a TTY.
70
-
71
- Defensive against stderr replacements that omit ``isatty``.
72
- """
73
- stderr = sys.stderr
74
- return hasattr(stderr, "isatty") and stderr.isatty()
75
-
76
-
77
- def _suppressed() -> bool:
78
- """True iff the notice should be suppressed."""
79
- if os.environ.get("JRAG_NO_DEPRECATION"):
80
- return True
81
- return not _stderr_is_tty()
82
-
83
-
84
- def maybe_warn_legacy_alias(stream=None) -> None:
85
- """Emit a one-line legacy-alias deprecation notice when appropriate.
86
-
87
- Detects a legacy invocation (``sys.argv[0]`` basename is exactly
88
- ``java-codebase-rag`` or ``java-codebase-rag-mcp``) and, if not suppressed,
89
- writes a single line to ``stream`` (defaulting to ``sys.stderr``). Never
90
- raises: any error inside the write is swallowed so the rename helper can
91
- never break tool startup.
92
-
93
- See module docstring for the suppression rule.
94
- """
95
- if _invoked_program_name() not in _LEGACY_ALIASES:
96
- return
97
- if _suppressed():
98
- return
99
- target = stream if stream is not None else sys.stderr
100
- try:
101
- target.write(_DEPRECATION_LINE)
102
- except Exception: # pragma: no cover - defensive: never break startup
103
- return
@@ -1,56 +0,0 @@
1
- """Raise the process soft file-descriptor limit to avoid LanceDB EMFILE.
2
-
3
- LanceDB's merge-insert path opens many file handles concurrently; under the
4
- default OS soft ``RLIMIT_NOFILE`` (256 on macOS processes launched by GUI /
5
- launchd / IDE hosts, *not* the shell's raised limit) this exhausts file
6
- descriptors and surfaces as::
7
-
8
- RuntimeError: lance error: LanceError(IO): ... Too many open files (os error 24)
9
- lance-io-4.0.0/src/local.rs:133:24
10
-
11
- ``raise_fd_limit`` raises the process's *own* soft limit toward its hard limit.
12
- ``RLIMIT_NOFILE`` is inherited across ``fork``+``exec``, so every CocoIndex /
13
- ``cocoindex-code`` child spawned afterwards inherits the headroom. This fixes the
14
- failure regardless of launch context (shell vs IDE vs MCP host) and regardless of
15
- Lance's internal IO concurrency.
16
-
17
- Never raise to ``RLIM_INFINITY`` — that breaks ``select()``/kqueue and Python
18
- selectors on macOS; ``cap`` bounds the target to a safe value.
19
-
20
- See https://github.com/HumanBean17/java-codebase-rag/issues/306
21
- """
22
-
23
- from __future__ import annotations
24
-
25
- try:
26
- # Unix-only: the ``resource`` module does not exist on Windows. Importing it
27
- # unconditionally at module scope crashes on Windows, which (because
28
- # ``cli.py`` and ``server.py`` both import ``raise_fd_limit``) made the
29
- # entire CLI and MCP server fail to start there. Guard the import so the
30
- # module loads everywhere; the function below no-ops when it's absent.
31
- import resource
32
- except ImportError: # pragma: no cover - Windows lacks the resource module
33
- resource = None # type: ignore[assignment]
34
-
35
- # Safe ceiling well above LanceDB's appetite, comfortably below macOS libc
36
- # quirks. The hard limit caps it further if lower (locked-down servers).
37
- _DEFAULT_CAP = 65536
38
-
39
-
40
- def raise_fd_limit(cap: int = _DEFAULT_CAP) -> None:
41
- """Raise this process's soft ``RLIMIT_NOFILE`` toward its hard limit.
42
-
43
- Best-effort and silent: never raises. No-op where ``RLIMIT_NOFILE`` is
44
- unsupported (Windows) or where the soft limit already meets ``min(hard, cap)``.
45
- """
46
- if resource is None or not hasattr(resource, "RLIMIT_NOFILE"):
47
- return
48
- soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
49
- target = min(hard, cap)
50
- if soft >= target:
51
- return
52
- try:
53
- resource.setrlimit(resource.RLIMIT_NOFILE, (target, hard))
54
- except (ValueError, OSError):
55
- # Best-effort: a locked-down environment shouldn't fail the run.
56
- pass
@@ -1,32 +0,0 @@
1
- """Force stdout/stderr to UTF-8 so non-ASCII glyphs never crash the CLI.
2
-
3
- The text renderers emit Unicode glyphs — ``↑``/``↓`` (hierarchy tree headers
4
- in ``jrag_render``), ``✓`` (success markers in ``cli_format``), ``→``/``…``
5
- (listing/role lines). On Windows, ``sys.stdout``/``sys.stderr`` default to the
6
- system ANSI codepage (cp1252 on en-US Windows), which can't encode those
7
- characters, so ``print()`` raises ``UnicodeEncodeError`` and the process exits
8
- non-zero. Unix platforms already default to UTF-8, so this is a no-op there.
9
-
10
- Called from the console-script entry points (``_console_script_main``), not
11
- from in-process ``main()`` callers, so a test that drives ``main()`` directly
12
- keeps whatever stdout the host wired up.
13
- """
14
-
15
- from __future__ import annotations
16
-
17
- import sys
18
-
19
-
20
- def force_utf8_stdio() -> None:
21
- """Reconfigure ``sys.stdout``/``sys.stderr`` to UTF-8.
22
-
23
- Best-effort and silent: never raises. No-op where a stream lacks
24
- ``reconfigure`` (streams replaced by capture frameworks that don't expose
25
- it). ``errors="replace"`` is a last-resort safety net so a hostile console
26
- can never crash a run; under UTF-8 every codepoint encodes cleanly, so
27
- replacement never actually fires for the glyphs we emit.
28
- """
29
- for stream in (sys.stdout, sys.stderr):
30
- reconfigure = getattr(stream, "reconfigure", None)
31
- if reconfigure is not None:
32
- reconfigure(encoding="utf-8", errors="replace")
@@ -1,35 +0,0 @@
1
- """Version string for the CLI ``--version`` flag.
2
-
3
- The single source of truth is the installed distribution metadata
4
- (``jrag-cli`` in pyproject.toml), read via :mod:`importlib.metadata`
5
- so a pyproject bump propagates with no second hardcoded copy.
6
- :func:`version_string` appends the CPython version for the
7
- ``<prog> <version> (python <x.y.z>)`` format chosen for the ``--version`` flag.
8
-
9
- Stdlib-only on purpose: this is imported at module load by both CLIs, and
10
- ``jrag`` keeps ``build_parser()`` free of torch / sentence_transformers / mcp_v2.
11
- """
12
- from __future__ import annotations
13
-
14
- import platform
15
- from importlib.metadata import PackageNotFoundError
16
- from importlib.metadata import version as _dist_version
17
-
18
- _PACKAGE = "jrag-cli"
19
-
20
-
21
- def package_version() -> str:
22
- """Installed distribution version, or ``"unknown"`` if metadata is absent.
23
-
24
- Absent only when run from a raw checkout without ``pip install -e``; the
25
- test suite (``conftest.py``) enforces editable install, so this is defensive.
26
- """
27
- try:
28
- return _dist_version(_PACKAGE)
29
- except PackageNotFoundError: # pragma: no cover - defensive
30
- return "unknown"
31
-
32
-
33
- def version_string(prog: str) -> str:
34
- """Formatted ``--version`` output: ``<prog> <version> (python <x.y.z>)``."""
35
- return f"{prog} {package_version()} (python {platform.python_version()})"
File without changes