Skip to content

Incremental infrastructure#559

Open
thomasmarshall wants to merge 2 commits intomainfrom
incremental-infrastructure
Open

Incremental infrastructure#559
thomasmarshall wants to merge 2 commits intomainfrom
incremental-infrastructure

Conversation

@thomasmarshall
Copy link
Contributor

This PR sets up the basic infrastructure and API for incremental updates:

result = graph.index_all(file_paths)
graph.resolve(result)

For now we can continue using:

graph.index_all(file_paths)
graph.resolve

…because graph.resolve(nil) will resolve everything, but we might want to switch to making the parameter required.

@vinistock suggested that we should be returning a list of units, but by returning a result struct containing two sets of IDs, it's easier to reuse the existing infrastructure for sorting and processing the units. I'm not sure I fully understood the benefit to constructing the units at index time rather than during resolution, but I'm happy to revisit if you think that would be preferable?

As of this PR, incremental updates don't work—we should continue using graph.resolve(nil) for now.

Feedback

I'm not confident in the FFI C side of things, particularly when the result will be freed (whether we pass it into #resolve or not). Claude Code helped me with this and I sense-checked to the best of my current abilities. Any feedback on this would be much appreciated!

@thomasmarshall thomasmarshall requested a review from a team as a code owner February 4, 2026 20:40
The `#index_all` method does not return an error, it raises one. In the
next commit we want to add a non-error return value, so we need to fix
this first.
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