Skip to content

feat: add sqry structural code analysis as add-in#862

Open
mr-k-man wants to merge 8 commits intogarrytan:mainfrom
mr-k-man:feat/sqry-add-in
Open

feat: add sqry structural code analysis as add-in#862
mr-k-man wants to merge 8 commits intogarrytan:mainfrom
mr-k-man:feat/sqry-add-in

Conversation

@mr-k-man
Copy link
Copy Markdown
Contributor

@mr-k-man mr-k-man commented Apr 6, 2026

Summary

  • Adds sqry (AST-based semantic code search) as an optional add-in following the contrib/add-tool/ pattern
  • 6 skills gain contextual structural analysis: /investigate, /cso, /review, /retro, /plan-eng-review, /ship
  • Follows sqry v8's resource delegation architecture: gstack owns WHEN (tool routing per skill phase), sqry owns HOW (parameter limits, tiering via live MCP resources)
  • Token-optimized resolver output using techniques from TOKEN_OPTIMIZATION_GUIDE (33→22 lines per skill, ~24% char reduction)
  • Design spec reviewed by Gemini 3 Pro + OpenAI Codex gpt-5.4 (4 rounds, unconditional approval)

Architecture: WHEN vs HOW

tools.json defines which sqry tools to use at which skill phase — that's gstack's value-add. Parameter guidance (max_depth, max_results, scoping, cost tiering) is delegated to sqry's live MCP resources (sqry://docs/capability-map, sqry://docs/tool-guide), which always match the user's installed version and update automatically. No hardcoded limits that can drift.

Review history

Round Issues Resolution
2 3 BLOCKs, 4 WARNs Version gate, TOML format, invalid tool constraints, taint overclaim, placement prose, MCP prefix, missing test
3 1 BLOCK, 1 WARN TOML subtable orphaning, prior art prose inconsistency
4 1 WARN Stale placement rule in shared contrib/add-tool/README.md
5 UNCONDITIONAL APPROVAL All issues resolved, no new findings

Eval results

Two full runs. Zero failures from this PR — all failures are environmental (missing browse binary, codex API unreachable).

Suite Result Notes
e2e-browse 5/5 PASS (browse-basic/snapshot skipped — no compiled binary)
e2e-deploy 6/6 PASS
e2e-workflow 4/4 PASS (codex-review skipped — codex API unreachable)
e2e-qa-workflow 4/4 PASS (qa-fix-loop passed on run 2)
e2e-review-army 7/7 PASS
e2e-cso 3/3 PASS
e2e-learnings 1/1 PASS
e2e-plan 11/11 PASS
e2e-routing 10/10 PASS
e2e-session-intelligence 2/2 PASS

Test plan

  • bun test — 155 pass, 0 fail (sqry resolver tests)
  • bun run test:evals — all non-environmental tests pass across 10 suites
  • 6 integrated skills have "Structural Code Analysis (sqry)" section
  • Zero unresolved {{SQRY_CONTEXT}} placeholders
  • Non-integrated skills have no sqry content
  • Golden baselines updated
  • All hosts regenerated (--host all)

Routing contract (tools.json), detection fragment, install/uninstall
scripts, and README for the sqry structural code analysis add-in.

Follows the established contrib/add-tool pattern from llm-gateway.
Parameter guidance is delegated to sqry's live MCP resources
(sqry://docs/capability-map, sqry://docs/tool-guide) per the v8
resource delegation architecture.
TypeScript resolver reads contrib/add-tool/sqry/tools.json and generates
conditional markdown per skill. Delegates parameter guidance to sqry's
live MCP resources instead of hardcoding limits.
Inlines detection.sh bash fragment into preamble. Outputs SQRY,
SQRY_VERSION, SQRY_INDEXED, and SQRY_STALE variables. Uses sqry's
own index --status --json API (<1ms) for staleness detection.
Place after {{LEARNINGS_SEARCH}} in investigate, cso, review, retro,
plan-eng-review, and ship templates.
Generated from templates with new {{SQRY_CONTEXT}} placeholder.
Golden ship baselines updated for all three hosts.
Mirrors the llm-gateway-resolver test structure. Validates schema,
tool names, MCP resource delegation, manifest health check, preamble
detection, and generated SKILL.md content.
Design spec approved by Gemini 3 Pro + OpenAI Codex (4 review rounds).
Includes initial implementation DAG and v8 alignment restructure DAG.
@mr-k-man mr-k-man closed this Apr 6, 2026
…riptions

Apply techniques from TOKEN_OPTIMIZATION_GUIDE: remove filler phrases,
terse descriptions, arrow notation for conditionals, consolidate
repeated prose. Resolver output reduced from 33 to 22 lines per skill.
tools.json when-clauses shortened (remove articles, leading verbs).
@mr-k-man mr-k-man reopened this Apr 6, 2026
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