java-codebase-rag 0.11.2__py3-none-any.whl → 0.12.1__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 (73) hide show
  1. java_codebase_rag-0.12.1.dist-info/METADATA +35 -0
  2. java_codebase_rag-0.12.1.dist-info/RECORD +4 -0
  3. {java_codebase_rag-0.11.2.dist-info → java_codebase_rag-0.12.1.dist-info}/WHEEL +1 -1
  4. java_codebase_rag/_fdlimit.py +0 -56
  5. java_codebase_rag/_stdio.py +0 -32
  6. java_codebase_rag/_version.py +0 -35
  7. java_codebase_rag/absence/__init__.py +0 -0
  8. java_codebase_rag/absence/absence_diagnosis.py +0 -700
  9. java_codebase_rag/absence/absence_types.py +0 -124
  10. java_codebase_rag/absence/absence_vocab.py +0 -460
  11. java_codebase_rag/analysis/__init__.py +0 -0
  12. java_codebase_rag/analysis/pr_analysis.py +0 -563
  13. java_codebase_rag/analysis/resolve_service.py +0 -740
  14. java_codebase_rag/ast/__init__.py +0 -0
  15. java_codebase_rag/ast/ast_java.py +0 -2825
  16. java_codebase_rag/ast/brownfield_events.py +0 -58
  17. java_codebase_rag/ast/chunk_heuristics.py +0 -62
  18. java_codebase_rag/cli.py +0 -1215
  19. java_codebase_rag/cli_format.py +0 -85
  20. java_codebase_rag/cli_progress.py +0 -94
  21. java_codebase_rag/config.py +0 -833
  22. java_codebase_rag/eval/__init__.py +0 -1
  23. java_codebase_rag/eval/ground_truth.py +0 -100
  24. java_codebase_rag/eval/metrics.py +0 -107
  25. java_codebase_rag/eval/runner.py +0 -556
  26. java_codebase_rag/graph/__init__.py +0 -0
  27. java_codebase_rag/graph/build_ast_graph.py +0 -4471
  28. java_codebase_rag/graph/graph_enrich.py +0 -1937
  29. java_codebase_rag/graph/graph_types.py +0 -224
  30. java_codebase_rag/graph/java_ontology.py +0 -465
  31. java_codebase_rag/graph/ladybug_queries.py +0 -2213
  32. java_codebase_rag/graph/path_filtering.py +0 -477
  33. java_codebase_rag/index/__init__.py +0 -0
  34. java_codebase_rag/index/java_index_flow_lancedb.py +0 -734
  35. java_codebase_rag/index/java_index_v1_common.py +0 -33
  36. java_codebase_rag/install_data/__init__.py +0 -0
  37. java_codebase_rag/install_data/agents/explorer-rag-cli.md +0 -108
  38. java_codebase_rag/install_data/agents/explorer-rag-enhanced.md +0 -152
  39. java_codebase_rag/install_data/skills/explore-codebase/SKILL.md +0 -165
  40. java_codebase_rag/install_data/skills/explore-codebase-cli/SKILL.md +0 -107
  41. java_codebase_rag/installer.py +0 -2188
  42. java_codebase_rag/jrag.py +0 -4531
  43. java_codebase_rag/jrag_envelope.py +0 -1107
  44. java_codebase_rag/jrag_hints.py +0 -204
  45. java_codebase_rag/jrag_render.py +0 -926
  46. java_codebase_rag/lance_optimize.py +0 -264
  47. java_codebase_rag/mcp/__init__.py +0 -0
  48. java_codebase_rag/mcp/mcp_hints.py +0 -932
  49. java_codebase_rag/mcp/mcp_v2.py +0 -1916
  50. java_codebase_rag/mcp/server.py +0 -884
  51. java_codebase_rag/pipeline.py +0 -531
  52. java_codebase_rag/progress.py +0 -570
  53. java_codebase_rag/read_payloads.py +0 -781
  54. java_codebase_rag/search/__init__.py +0 -0
  55. java_codebase_rag/search/index_common.py +0 -10
  56. java_codebase_rag/search/search_lancedb.py +0 -1296
  57. java_codebase_rag/search/search_lexical.py +0 -449
  58. java_codebase_rag/search/search_scoring.py +0 -523
  59. java_codebase_rag/watch/__init__.py +0 -0
  60. java_codebase_rag/watch/client.py +0 -230
  61. java_codebase_rag/watch/daemon.py +0 -396
  62. java_codebase_rag/watch/lock.py +0 -201
  63. java_codebase_rag/watch/paths.py +0 -76
  64. java_codebase_rag/watch/protocol.py +0 -122
  65. java_codebase_rag/watch/server.py +0 -273
  66. java_codebase_rag/watch/warm.py +0 -105
  67. java_codebase_rag/watch/watcher.py +0 -370
  68. java_codebase_rag-0.11.2.dist-info/METADATA +0 -331
  69. java_codebase_rag-0.11.2.dist-info/RECORD +0 -71
  70. java_codebase_rag-0.11.2.dist-info/entry_points.txt +0 -4
  71. java_codebase_rag-0.11.2.dist-info/licenses/LICENSE +0 -21
  72. java_codebase_rag-0.11.2.dist-info/top_level.txt +0 -1
  73. /java_codebase_rag/__init__.py → /java_codebase_rag-0.12.1.dist-info/top_level.txt +0 -0
@@ -1,58 +0,0 @@
1
- """Structured stderr events for brownfield extraction (PR-1 scaffolding; PR-2 wiring).
2
-
3
- Each call emits one JSON object on a single line to sys.stderr. MCP stdio servers
4
- must not use this module from tool handlers — graph build / AST paths only.
5
- """
6
- from __future__ import annotations
7
-
8
- import json
9
- import sys
10
- from typing import Any
11
-
12
- _VALID_SEVERITIES = frozenset({"INFO", "WARN"})
13
- _VALID_EVENTS = frozenset(
14
- {
15
- "brownfield-exclusivity-shadowing",
16
- "brownfield-method-string-literal",
17
- }
18
- )
19
-
20
-
21
- def emit_structured_brownfield_event(
22
- event_id: str,
23
- severity_level: str,
24
- **fields: Any,
25
- ) -> None:
26
- """Emit one JSON line to stderr with keys ``event`` and ``severity`` plus ``**fields``.
27
-
28
- Parameters are named ``event_id`` / ``severity_level`` so ``**fields`` may contain
29
- keys ``event`` or ``severity`` without a caller TypeError; those keys never override
30
- the canonical record (reserved keys are merged last).
31
- """
32
- if severity_level not in _VALID_SEVERITIES:
33
- raise ValueError(
34
- f"severity must be one of {_VALID_SEVERITIES}, got {severity_level!r}"
35
- )
36
- if event_id not in _VALID_EVENTS:
37
- raise ValueError(f"event must be one of {_VALID_EVENTS}, got {event_id!r}")
38
- # Fields first so JSON ``event`` / ``severity`` always match event_id / severity_level.
39
- payload = {**fields, "event": event_id, "severity": severity_level}
40
- print(json.dumps(payload, ensure_ascii=False), file=sys.stderr, flush=True)
41
-
42
-
43
- def emit_brownfield_exclusivity_shadowing(**fields: Any) -> None:
44
- """INFO: brownfield HTTP annotation co-present with shadowable framework annotations."""
45
- emit_structured_brownfield_event(
46
- "brownfield-exclusivity-shadowing",
47
- "INFO",
48
- **fields,
49
- )
50
-
51
-
52
- def emit_brownfield_method_string_literal(**fields: Any) -> None:
53
- """WARN: HTTP client/route `method` still a string literal (migration / misuse)."""
54
- emit_structured_brownfield_event(
55
- "brownfield-method-string-literal",
56
- "WARN",
57
- **fields,
58
- )
@@ -1,62 +0,0 @@
1
- """Lightweight, query-time hints from chunk text — no AST / re-index required."""
2
-
3
- from __future__ import annotations
4
-
5
- import re
6
- from dataclasses import dataclass
7
-
8
-
9
- @dataclass
10
- class ChunkHints:
11
- """Heuristic metadata derived from a chunk's text."""
12
-
13
- primary_type_hint: str | None = None
14
- """First top-level ``class`` / ``interface`` / ``enum`` / ``record`` name in the chunk."""
15
-
16
- import_heavy: bool = False
17
- """True when most lines are ``import`` statements (low semantic density)."""
18
-
19
-
20
- _JAVA_TYPE = re.compile(
21
- r"\b(?:public\s+|private\s+|protected\s+|sealed\s+|final\s+|abstract\s+|static\s+)*"
22
- r"(?:class|interface|enum|record)\s+([A-Za-z_][A-Za-z0-9_]*)"
23
- )
24
-
25
-
26
- def analyze_chunk(text: str | None, *, language: str, kind: str) -> ChunkHints:
27
- if not text or not text.strip():
28
- return ChunkHints()
29
-
30
- lines = text.strip().split("\n")
31
- n = len(lines)
32
- lang = (language or "").lower()
33
- is_java = kind == "java" or lang == "java"
34
-
35
- import_heavy = False
36
- if is_java and n >= 3:
37
- imp = sum(1 for L in lines if L.lstrip().startswith("import "))
38
- import_heavy = imp / n >= 0.55
39
-
40
- primary: str | None = None
41
- if is_java:
42
- head = "\n".join(lines[: min(80, n)])
43
- m = _JAVA_TYPE.search(head)
44
- if m:
45
- primary = m.group(1)
46
-
47
- return ChunkHints(
48
- primary_type_hint=primary,
49
- import_heavy=import_heavy,
50
- )
51
-
52
-
53
- def looks_like_code_identifier(query: str) -> bool:
54
- """PascalCase type name or SCREAMING_SNAKE constant — good candidates for FTS hybrid."""
55
- q = query.strip()
56
- if not q or len(q) < 2 or len(q) > 200:
57
- return False
58
- if re.fullmatch(r"[A-Z][a-zA-Z0-9_]*", q):
59
- return True
60
- if "_" in q and re.fullmatch(r"[A-Z][A-Z0-9_]*", q):
61
- return True
62
- return False