Skip to content

Feat/augment tool aliases#14

Open
pablo-lamtenzan wants to merge 2 commits into
tintinweb:masterfrom
pablo-lamtenzan:feat/augment-tool-aliases
Open

Feat/augment tool aliases#14
pablo-lamtenzan wants to merge 2 commits into
tintinweb:masterfrom
pablo-lamtenzan:feat/augment-tool-aliases

Conversation

@pablo-lamtenzan
Copy link
Copy Markdown

Summary

  • add configurable mapping from physical Pi tool names to
    logical GitNexus augment kinds
  • preserve existing behavior when no env vars are set
  • add optional pi-lean-ctx preset for ctx_read,
    ctx_grep, ctx_find, and ctx_shell
  • document alias configuration and recommended pi-lean-ctx
    coexistence

Problem

Auto-augment currently matches only fixed built-in Pi tool
names such as:

  • read
  • read_many
  • grep
  • find
  • bash

That makes wrapper tools work inconsistently in additive
integrations like pi-lean-ctx, where calls may use:

  • ctx_read
  • ctx_grep
  • ctx_find
  • ctx_shell

Explicit gitnexus_* tools already work, but auto-augment
did not recognize these wrapper tool names.

Solution

Introduce small abstraction from physical tool name to
logical augment kind.

Logical kinds:

  • read
  • read_many
  • grep
  • find
  • bash

Default aliases remain unchanged:

  • read -> ["read"]
  • read_many -> ["read_many"]
  • grep -> ["grep"]
  • find -> ["find"]
  • bash -> ["bash"]

Add shell-friendly CSV env overrides:

  • GITNEXUS_AUGMENT_READ_TOOLS
  • GITNEXUS_AUGMENT_READ_MANY_TOOLS
  • GITNEXUS_AUGMENT_GREP_TOOLS
  • GITNEXUS_AUGMENT_FIND_TOOLS
  • GITNEXUS_AUGMENT_BASH_TOOLS

Add optional preset:

  • GITNEXUS_AUGMENT_PRESET=pi-lean-ctx

Preset expands to:

  • read -> ["read", "ctx_read"]
  • read_many -> ["read_many"]
  • grep -> ["grep", "ctx_grep"]
  • find -> ["find", "ctx_find"]
  • bash -> ["bash", "ctx_shell"]

If preset and explicit env var both exist, explicit env
var replaces preset for that logical kind.

Implementation notes

  • auto-augment hook now classifies tool names by logical
    kind before matching
  • extraction still uses tool input arguments rather than
    parsing wrapper output formats
  • unknown tools remain ignored
  • explicit gitnexus_* tools unchanged
  • patch kept intentionally small and focused

Documentation

Added README section:

  • Configuring auto-augment tool aliases

Includes:

  • per-kind env examples
  • pi-lean-ctx preset
  • override behavior
  • recommended coexistence config:
    • LEAN_CTX_PI_MODE=additive
    • LEAN_CTX_PI_ENABLE_MCP=0
    • GITNEXUS_AUGMENT_PRESET=pi-lean-ctx

Testing

  • npm ci
  • npm run lint
  • npm run typecheck
  • npm test
  • npm run build

Additional test coverage includes:

  • default classification behavior
  • CSV env overrides
  • preset behavior
  • explicit env override over preset
  • hook-level alias behavior for ctx_grep and ctx_read

Notes

  • built-in read was already documented and covered by
    existing code/tests
  • this PR focuses on generic alias support rather than
    broadening scope beyond that

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.

1 participant