-
Notifications
You must be signed in to change notification settings - Fork 0
feat(oracle): scip-python backend — Python compiler-grade resolution (B6) #176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -463,6 +463,27 @@ pub fn latest_run_tool_version( | |
| store::latest_run_tool_version(conn, tool, commit_sha, worktree_id) | ||
| } | ||
|
|
||
| /// Every oracle tool that has at least one run in this checkout, paired with its latest | ||
| /// `tool_version`. The multi-language surfacing seam (#176): the graph read paths | ||
| /// (`enrich_hops_with_oracle`, `compare_graph_to_scip`) iterate THIS rather than hardcoding | ||
| /// `RustAnalyzer`, so a repo indexed in several languages surfaces each backend's verdicts on its | ||
| /// own edges. An edge belongs to one language, so at most one tool ever has a verdict for it — the | ||
| /// per-tool verdict sets are disjoint and merge cleanly. Tools with no run in scope are skipped. | ||
| pub fn latest_runs_in_scope( | ||
| conn: &Connection, | ||
| commit_sha: &str, | ||
| worktree_id: &str, | ||
| ) -> anyhow::Result<Vec<(OracleTool, String)>> { | ||
| let mut runs = Vec::new(); | ||
| for &tool in OracleTool::ALL { | ||
| if let Some(version) = store::latest_run_tool_version(conn, tool, commit_sha, worktree_id)? | ||
| { | ||
| runs.push((tool, version)); | ||
| } | ||
| } | ||
| Ok(runs) | ||
| } | ||
|
|
||
| /// The `started_at` (Unix-epoch ms) of the most recent run for `tool` in the active checkout, or | ||
| /// `None` when no run exists — the staleness clock the background auto-fresh oracle compares | ||
| /// against the index's `indexed_at_ms`. See [`auto_run_decision`]. | ||
|
|
@@ -499,24 +520,30 @@ pub enum OracleTool { | |
| /// database rather than a source root, and is the SCIP emitter directly (no `scip` | ||
| /// subcommand), so its probe + invocation differ from rust-analyzer's — see `ToolManifest`. | ||
| ScipClang, | ||
| /// `scip-python index` — Python (#164 B6). Resolves imports against the project's INSTALLED | ||
| /// dependencies, so the corpus must install them (a venv) first; an unresolved environment | ||
| /// shows up as a near-zero moniker count the report's health gate catches. | ||
| ScipPython, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When users run Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Enabling Useful? React with 👍 / 👎. |
||
| } | ||
|
|
||
| impl OracleTool { | ||
| /// Every known oracle tool, for "report on all tools" surfaces (`oracle status` with no | ||
| /// `--tool`). Later language backends (#72 Kotlin) extend this alongside the enum. | ||
| pub const ALL: &[OracleTool] = &[Self::RustAnalyzer, Self::ScipClang]; | ||
| pub const ALL: &[OracleTool] = &[Self::RustAnalyzer, Self::ScipClang, Self::ScipPython]; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Adding Useful? React with 👍 / 👎. |
||
|
|
||
| pub fn as_db_str(self) -> &'static str { | ||
| match self { | ||
| Self::RustAnalyzer => "rust-analyzer", | ||
| Self::ScipClang => "scip-clang", | ||
| Self::ScipPython => "scip-python", | ||
| } | ||
| } | ||
|
|
||
| pub fn from_db_str(value: &str) -> Option<Self> { | ||
| match value { | ||
| "rust-analyzer" => Some(Self::RustAnalyzer), | ||
| "scip-clang" => Some(Self::ScipClang), | ||
| "scip-python" => Some(Self::ScipPython), | ||
| _ => None, | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This invocation never passes
--project-version, so scip-python falls back to the checkout's git revision (the new docs note this behavior). Because rag-rat stores the full SCIP symbol string inlogical_symbol_monikersand later resolves memories by exact moniker for the same tool, every commit changes all Python monikers even when symbols did not move, breaking the advertised stable memory relocation for scip-python runs. Pass a stable project version (for example the conventional_) when invoking the indexer.Useful? React with 👍 / 👎.