Surgical context extraction #9

Open
opened 2026-04-07 20:22:04 +00:00 by austin · 0 comments
Owner

Implement precise code extraction from the AST index.

  • Given a symbol name, extract its full definition (body + decorator + type hints + docstring)
  • Include the minimal necessary surrounding context: class definition line if it's a method, relevant imports
  • Support extracting a specific line range with AST-aware boundaries (expand to the enclosing function/class)
  • Return extracted code with enough context to be self-contained but as small as possible

This is what makes the harness smarter than grep + read the whole file. We need to fit code into a 3B model's context window — every token counts.

Implement precise code extraction from the AST index. - Given a symbol name, extract its full definition (body + decorator + type hints + docstring) - Include the minimal necessary surrounding context: class definition line if it's a method, relevant imports - Support extracting a specific line range with AST-aware boundaries (expand to the enclosing function/class) - Return extracted code with enough context to be self-contained but as small as possible This is what makes the harness smarter than `grep + read the whole file`. We need to fit code into a 3B model's context window — every token counts.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
austin/localcode#9
No description provided.