@pmaddire/gcie 0.1.2
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.
- package/AGENT.md +256 -0
- package/AGENT_USAGE.md +231 -0
- package/ARCHITECTURE.md +151 -0
- package/CLAUDE.md +69 -0
- package/DEBUGGING_PLAYBOOK.md +160 -0
- package/KNOWLEDGE_INDEX.md +154 -0
- package/POTENTIAL_UPDATES +130 -0
- package/PROJECT.md +141 -0
- package/README.md +371 -0
- package/REPO_DIGITAL_TWIN.md +98 -0
- package/ROADMAP.md +301 -0
- package/SETUP_ANY_REPO.md +85 -0
- package/bin/gcie-init.js +20 -0
- package/bin/gcie.js +45 -0
- package/cli/__init__.py +1 -0
- package/cli/app.py +163 -0
- package/cli/commands/__init__.py +1 -0
- package/cli/commands/cache.py +35 -0
- package/cli/commands/context.py +2426 -0
- package/cli/commands/context_slices.py +617 -0
- package/cli/commands/debug.py +24 -0
- package/cli/commands/index.py +17 -0
- package/cli/commands/query.py +20 -0
- package/cli/commands/setup.py +73 -0
- package/config/__init__.py +1 -0
- package/config/scanner_config.py +82 -0
- package/context/__init__.py +1 -0
- package/context/architecture_bootstrap.py +170 -0
- package/context/architecture_index.py +185 -0
- package/context/architecture_parser.py +170 -0
- package/context/architecture_slicer.py +308 -0
- package/context/context_router.py +70 -0
- package/context/fallback_evaluator.py +21 -0
- package/coverage_integration/__init__.py +1 -0
- package/coverage_integration/coverage_loader.py +55 -0
- package/debugging/__init__.py +12 -0
- package/debugging/bug_localizer.py +81 -0
- package/debugging/execution_path_analyzer.py +42 -0
- package/embeddings/__init__.py +6 -0
- package/embeddings/encoder.py +45 -0
- package/embeddings/faiss_index.py +72 -0
- package/git_integration/__init__.py +1 -0
- package/git_integration/git_miner.py +78 -0
- package/graphs/__init__.py +17 -0
- package/graphs/call_graph.py +70 -0
- package/graphs/code_graph.py +81 -0
- package/graphs/execution_graph.py +35 -0
- package/graphs/git_graph.py +43 -0
- package/graphs/graph_store.py +25 -0
- package/graphs/node_factory.py +21 -0
- package/graphs/test_graph.py +65 -0
- package/graphs/validators.py +28 -0
- package/graphs/variable_graph.py +51 -0
- package/knowledge_index/__init__.py +1 -0
- package/knowledge_index/index_builder.py +60 -0
- package/knowledge_index/models.py +35 -0
- package/knowledge_index/query_api.py +38 -0
- package/knowledge_index/store.py +23 -0
- package/llm_context/__init__.py +6 -0
- package/llm_context/context_builder.py +67 -0
- package/llm_context/snippet_selector.py +57 -0
- package/package.json +14 -0
- package/parser/__init__.py +18 -0
- package/parser/ast_parser.py +216 -0
- package/parser/call_resolver.py +52 -0
- package/parser/models.py +75 -0
- package/parser/tree_sitter_adapter.py +56 -0
- package/parser/variable_extractor.py +31 -0
- package/retrieval/__init__.py +17 -0
- package/retrieval/cache.py +22 -0
- package/retrieval/hybrid_retriever.py +249 -0
- package/retrieval/query_parser.py +38 -0
- package/retrieval/ranking.py +43 -0
- package/retrieval/semantic_retriever.py +39 -0
- package/retrieval/symbolic_retriever.py +80 -0
- package/scanner/__init__.py +5 -0
- package/scanner/file_filters.py +37 -0
- package/scanner/models.py +44 -0
- package/scanner/repository_scanner.py +55 -0
- package/scripts/bootstrap_from_github.ps1 +41 -0
- package/tracing/__init__.py +1 -0
- package/tracing/runtime_tracer.py +60 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[string]$TargetRepoPath = (Get-Location).Path,
|
|
3
|
+
[string]$GcieRepoUrl = "https://github.com/pmaddire/GBCRSS.git",
|
|
4
|
+
[string]$Branch = "main"
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
$ErrorActionPreference = "Stop"
|
|
8
|
+
|
|
9
|
+
function New-GcieVenv {
|
|
10
|
+
param([string]$RepoPath)
|
|
11
|
+
|
|
12
|
+
if (Get-Command py -ErrorAction SilentlyContinue) {
|
|
13
|
+
& py -3 -m venv (Join-Path $RepoPath ".venv")
|
|
14
|
+
return
|
|
15
|
+
}
|
|
16
|
+
if (Get-Command python -ErrorAction SilentlyContinue) {
|
|
17
|
+
& python -m venv (Join-Path $RepoPath ".venv")
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
throw "Python 3.11+ is required. Install Python and retry."
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
$target = (Resolve-Path -LiteralPath $TargetRepoPath).Path
|
|
24
|
+
$tempRoot = Join-Path $env:TEMP ("gcie_bootstrap_" + [guid]::NewGuid().ToString("N"))
|
|
25
|
+
|
|
26
|
+
Write-Host "[GCIE] Cloning from $GcieRepoUrl ..."
|
|
27
|
+
git clone --depth 1 --branch $Branch $GcieRepoUrl $tempRoot | Out-Null
|
|
28
|
+
|
|
29
|
+
Write-Host "[GCIE] Creating virtual environment ..."
|
|
30
|
+
New-GcieVenv -RepoPath $tempRoot
|
|
31
|
+
|
|
32
|
+
$venvPython = Join-Path $tempRoot ".venv\Scripts\python.exe"
|
|
33
|
+
|
|
34
|
+
Write-Host "[GCIE] Installing minimal dependencies ..."
|
|
35
|
+
& $venvPython -m pip install --disable-pip-version-check --quiet networkx GitPython typer
|
|
36
|
+
|
|
37
|
+
Write-Host "[GCIE] Running setup in target repo: $target"
|
|
38
|
+
& $venvPython -m cli.app setup $target
|
|
39
|
+
|
|
40
|
+
Write-Host "[GCIE] Done. You can now run in your repo:"
|
|
41
|
+
Write-Host " gcie.cmd context . \"<task>\" --intent edit --budget auto"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Runtime tracing package."""
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"""Runtime tracing via sys.settrace for execution graph input."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import inspect
|
|
6
|
+
import sys
|
|
7
|
+
import time
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from types import FrameType
|
|
10
|
+
from typing import Any, Callable
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(frozen=True, slots=True)
|
|
14
|
+
class TraceEvent:
|
|
15
|
+
"""Single runtime trace event."""
|
|
16
|
+
|
|
17
|
+
event: str
|
|
18
|
+
function_name: str
|
|
19
|
+
file_path: str
|
|
20
|
+
line_no: int
|
|
21
|
+
timestamp: float
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def capture_trace_events(func: Callable[..., Any], *args: Any, **kwargs: Any) -> tuple[tuple[TraceEvent, ...], Any, BaseException | None]:
|
|
25
|
+
"""Capture call/return/exception events while executing a function."""
|
|
26
|
+
events: list[TraceEvent] = []
|
|
27
|
+
|
|
28
|
+
target_code_ids: set[int] = set()
|
|
29
|
+
for _, candidate in inspect.getmembers(sys.modules.get(func.__module__, None), inspect.isfunction):
|
|
30
|
+
if candidate.__module__ == func.__module__:
|
|
31
|
+
target_code_ids.add(id(candidate.__code__))
|
|
32
|
+
target_code_ids.add(id(func.__code__))
|
|
33
|
+
target_file = func.__code__.co_filename
|
|
34
|
+
|
|
35
|
+
def tracer(frame: FrameType, event: str, arg: Any):
|
|
36
|
+
in_scope = id(frame.f_code) in target_code_ids or frame.f_code.co_filename == target_file
|
|
37
|
+
if in_scope and event in {"call", "return", "exception"}:
|
|
38
|
+
events.append(
|
|
39
|
+
TraceEvent(
|
|
40
|
+
event=event,
|
|
41
|
+
function_name=frame.f_code.co_name,
|
|
42
|
+
file_path=frame.f_code.co_filename,
|
|
43
|
+
line_no=frame.f_lineno,
|
|
44
|
+
timestamp=time.time(),
|
|
45
|
+
)
|
|
46
|
+
)
|
|
47
|
+
return tracer
|
|
48
|
+
|
|
49
|
+
previous = sys.gettrace()
|
|
50
|
+
result: Any = None
|
|
51
|
+
caught_error: BaseException | None = None
|
|
52
|
+
sys.settrace(tracer)
|
|
53
|
+
try:
|
|
54
|
+
result = func(*args, **kwargs)
|
|
55
|
+
except BaseException as exc: # noqa: BLE001
|
|
56
|
+
caught_error = exc
|
|
57
|
+
finally:
|
|
58
|
+
sys.settrace(previous)
|
|
59
|
+
|
|
60
|
+
return tuple(events), result, caught_error
|