feat/introspect: opt-in second-level subcommand discovery for wraptool_discover #89
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/introspect-second-level"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #51. A new per-tool setting introspection.discover_depth, default 1, makes wraptool_discover list second-level subcommands such as issue search when set to 2. Depth 2 probes each top-level command with the fixed help argv already used today, bounded by a strict lowercase name shape taken only from the parsed catalog, a skip-list for help and version and completion, a cap of 64 sorted groups and a 60 second budget per tool, second level only, no caller input in the argv. It is opt-in because a command that ignores -h runs for real with the tool's environment. The depth is folded into the introspection cache hash so toggling it re-introspects. The design question from the issue is settled in design/introspect/second-level-discovery.md, which also rejects default-on and an agent-steered drill-down argument. The description-loss investigation found no parser bug: fj prints bare command names without descriptions, and the parser did not recognise bare-name Commands blocks at all, so discover showed nothing for fj. The parser now reads a Commands block with optional descriptions and the urfave/cli alias form config, c, recording the primary name only. Fixtures from real fj -h, fj issue -h and jf --help output are in testdata with parser and end-to-end depth-2 tests, plus a regression test pinning every existing fixture's catalog. Reviewer pass done with argv-safety fuzzing and mutation checks. Docs in docs/configuration.qmd, CHANGELOG Added bullet, CLAUDE.md clause. 🤖 Generated with Claude Code