Skip to content

Add AST call handoff and LSP graph enrichment pipeline#809

Open
slbug wants to merge 9 commits into
safishamsi:v7from
slbug:ast_fixes_lsp_plugins_arch
Open

Add AST call handoff and LSP graph enrichment pipeline#809
slbug wants to merge 9 commits into
safishamsi:v7from
slbug:ast_fixes_lsp_plugins_arch

Conversation

@slbug
Copy link
Copy Markdown

@slbug slbug commented May 11, 2026

AST finds unresolved calls, optional LSP hooks try to resolve them, and only boringly safe evidence gets promoted back into the graph. No more turning every first, map, or id into a fake god node. Hooks are opt-in, cached, documented, and wired.

@slbug slbug force-pushed the ast_fixes_lsp_plugins_arch branch from a42afa8 to a31b60a Compare May 11, 2026 19:57
@safishamsi
Copy link
Copy Markdown
Owner

This is a well-engineered addition — the two-stage architecture (AST records unresolved_calls, optional LSP hooks promote them to INFERRED edges) is clean, the conservative promotion policy is correct, and the 1133-line test file is thorough. Three fixes needed before we merge:

1. LSP failure should degrade gracefully (must fix)
In watch.py around the LSP enrichment call, a hook failure raises an exception that causes the entire watch rebuild to return False. Since hooks are opt-in enrichment (not core), a failure should log a warning and continue with the pre-enrichment graph — not abort the rebuild. Please wrap the LSP enrichment call in a try/except that logs and continues.

2. Zombie processes on LSP client shutdown (must fix)
In lsp_definition_hook.py, the close() method calls proc.terminate() on timeout but never follows it with proc.wait(). This leaves zombie processes. Please add proc.wait(timeout=5) (with a kill() fallback) after terminate().

3. required default is asymmetric with docs (should fix)
The code defaults required=True for omitted hook config fields, but every example in docs/lsp-hooks.md sets "required": false. A user following the docs verbatim gets optional hooks, but one who omits the field gets required hooks — surprising. Please either flip the default to False or update the docs examples to omit the field.

Once these three are addressed we'll merge. Great work on this one.

@slbug
Copy link
Copy Markdown
Author

slbug commented May 14, 2026

@safishamsi done

@slbug
Copy link
Copy Markdown
Author

slbug commented May 17, 2026

@safishamsi any more changes required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants