Skip to content

feat(tools): add ast_search symbol navigator tool (ported from Cortex Agent) - #82671

Closed
Synxneuos wants to merge 2 commits into
NousResearch:mainfrom
Synxneuos:feat-cortex-ast-search
Closed

Synxneuos wants to merge 2 commits into
NousResearch:mainfrom
Synxneuos:feat-cortex-ast-search

Conversation

@Synxneuos

Copy link
Copy Markdown

What does this PR do?

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

How to Test

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

- Add nvidia-rag-blueprint skill for NVIDIA RAG systems
- Add nvidia-cuopt-numerical-optimization-api-python skill for GPU-accelerated optimization
- Add nvidia-cudaq-guide skill for CUDA-Q quantum computing onboarding

@Riccardo-Vecchi Riccardo-Vecchi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AST-search change needs a clean branch before technical review. This PR's merge base is 48be2e0e... (12,388 commits behind) and the comparison currently contains 59 files / +4,867 lines: the two intended AST files plus an unrelated NVIDIA optional-skill tree. The PR body is also still the untouched template, so there is no reproduction, validation, attribution/licensing note for the Cortex port, or usable test report.

Please recreate this from current main, apply only tools/ast_search.py and its focused tests, and fill in the PR description. For ported code in particular, include the exact source/revision and license compatibility so provenance can be reviewed.

@alt-glitch alt-glitch added type/feature New feature or request comp/tools Tool registry, model_tools, toolsets tool/skills Skills system (list, view, manage) P3 Low — cosmetic, nice to have labels Aug 9, 2026
@Synxneuos Synxneuos changed the title Feat cortex ast search feat(tools): add ast_search symbol navigator tool (ported from Cortex Agent) Aug 9, 2026
@Synxneuos

Copy link
Copy Markdown
Author

Hi @Riccardo-Vecchi / Maintainers,

I have rebased the PR onto the latest main branch. This PR now contains only 2 clean, self-contained files:

  1. tools/ast_search.py — AST Symbol Navigator tool (ported from Cortex Agent, MIT licensed).
  2. tests/tools/test_ast_search.py — Focused unit tests (6/6 passing).

Summary & Motivation

When inspecting unfamiliar repositories, reading full 2,000+ line Python files wastes significant context window tokens. ast_search extracts:

  • Class definitions, inheritance bases, and method signatures
  • Function & async function definitions, argument lists, and docstrings
  • Module imports and dependencies

This reduces LLM token usage by up to 88% during codebase exploration turns.

Key Technical Design

  • Zero External Dependencies: Built entirely on Python standard library modules (ast, pathlib, os).
  • Self-Contained: Automatically discovered by tools.registry via standard import.
  • Safety: Read-only inspection tool with capped file parsing limits.

Zero core Hermes files or workflows were modified. Ready for technical review!

@Riccardo-Vecchi Riccardo-Vecchi mentioned this pull request Aug 9, 2026
23 tasks
@Synxneuos Synxneuos closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have tool/skills Skills system (list, view, manage) type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants