[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CYN0WGXWN9S91WY9ST93NR":3,"skill-same:01M6CYN0WGXWN9S91WY9ST93NR":119},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":50,"ownerHtmlUrl":51,"ownerBlogUrl":52,"ownerDescription":53,"updatedAt":54,"install":55,"resources":68},"01M6CYN0WGXWN9S91WY9ST93NR","frigg-first-code-search",null,"Default to Frigg MCP instead of shell rg\u002Fgrep\u002Ffind\u002Ffd\u002Fcat\u002Fsed for source-code discovery, search, navigation, and proof reads in attached repos. Scenario-first routing: pick the flow, then the tool. Shell remains correct for git, build\u002Ftest output, generated\u002Funindexed paths, explicit live-disk checks, and when Frigg is unavailable.","bnomei\u002Ffrigg","bnomei","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F3265642?v=4","01M6CYMTXEZ7ZM35CWRY9T1TZQ","Bruno Meilick","01M6CYMV1PZJA8M6DN6H3HG6JA",5,"MIT","https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg\u002Fblob\u002Fmain\u002Fskills\u002Ffrigg-first-code-search\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"frigg first code search","code","code search","search","first","disk","wed","build","default","generated","pick","tool","correct","MCP","discovery","flow","git","routing","repos","test","2026-11-10 10:12:30",false,"---\nname: frigg-first-code-search\ndescription: \"Default to Frigg MCP instead of shell rg\u002Fgrep\u002Ffind\u002Ffd\u002Fcat\u002Fsed for source-code discovery, search, navigation, and proof reads in attached repos. Scenario-first routing: pick the flow, then the tool. Shell remains correct for git, build\u002Ftest output, generated\u002Funindexed paths, explicit live-disk checks, and when Frigg is unavailable.\"\nversion: 2026-07-08\n---\n\n# Frigg First Code Search\n\nFrigg is the default for code discovery, file listing, navigation, exact code search, and bounded source reads.\n\nBefore using shell `rg`, `grep`, `find`, `fd`, `cat`, or `sed` for code exploration, use the matching Frigg MCP tool in attached or attachable code repositories.\n\nShell tools are fallback only for git state and diffs, non-code files, build\u002Ftest output, generated or unindexed files, explicit live-disk verification, or when Frigg is unavailable.\n\nDo not run parallel shell grep in the same turn as Frigg search on indexed source.\n\n**Follow the evidence, not just the shell replacement:** use `search_symbol` for a known\nidentifier and `search_batch` for independent hypotheses when callable. After selecting a hit,\ncopy its `target_ref` into navigation when relationships matter, then use `read_match` for source\nproof. A known path still warrants direct `read_file`; do not add navigation merely to use more tools.\n\n**Harness boundary (Frigg is an evidence layer, not an agent OS):**\n\n- Host tool order, Grep-first defaults, and intermittent MCP **registration\u002Finheritance** flukes are **outside** Frigg product code (**FUT-003** harness boundary — not a Frigg CI gate or ranking bug).\n- When the bridge is down or tools are unregistered, that is **harness reliability**, not ranking quality.\n- Soft PreToolUse \u002F adopt hooks are **opt-in** (not guaranteed Frigg-first). Soft only: Claude hook injects next-step context (`search_text` \u002F `search_batch` \u002F …) and **never hard-denies** Grep\u002Fshell (`permissionDecision` is not product).\n- Hard block of Grep\u002F`rg` on indexed roots is a **host experiment**, not Frigg core — do not invent `FRIGG_HOOK_STRICT` or product tool-order hacks.\n- Do **not** invent product hacks (fake Grep, hide host tools, force MCP tool order, or a “subagent bridge health” Frigg tool — Frigg cannot see the host registry when it is not registered).\n- Route indexed source through Frigg when the live tool list exposes Frigg tools; progressive disclosure on this top screen is intentional (30-second rule).\n\n**Probe-on-spawn (Task \u002F subagent \u002F new session):**\n\n```text\n1. Before claiming Frigg-first, verify Frigg is on the *live* host tool surface for THIS spawn:\n   live tools\u002Flist (or a successful Frigg CallMcpTool). Do NOT trust on-disk mcps\u002F…\u002Ftools\n   descriptors or a parent session's tool list as proof this spawn has Frigg.\n2. If Frigg is absent from live tools\u002Flist for this spawn (empty Frigg server, or\n   Tool not found when calling a known Frigg tool like search_text while the parent still has Frigg):\n   - Shell\u002FGrep\u002FRead fallback is correct for this spawn\n   - Note the gap once (harness MCP inheritance \u002F registration) — do NOT file as Frigg search\u002Franking failure\n   - Do NOT invent workspace_reindex \u002F bridge_health \u002F fake tools to \"fix\" registration\n   - (Invented names \u002F extended-only tools missing while other Frigg tools work → surface honesty,\n     not inheritance — see tool-surface rules)\n3. If the initial Frigg workspace is the wrong repository, attach the task repository with\n   workspace(path=...) before falling back to local tools.\n4. Parent session success does NOT imply child Task success — re-probe every delegation.\n5. Prefer loopback HTTP + frigg serve when multiple clients\u002Fsubagents should share one Frigg\n   *after* each spawn actually has Frigg registered; HTTP shares state when registration works —\n   it does not create child registration by itself.\n```\n\n**Partial surface (some Frigg tools work, recommended ones are missing):**\n\n- Compare the host-callable tools, the **installed** skill's `mcp.json` `includeTools` (or inline\n  `mcpServers`), and `workspace.runtime.tools_exposed` \u002F live `tools\u002Flist` when available. A stale\n  skill filter can hide symbol, batch, and navigation tools even when the server supports them.\n- Report the reduced surface once. Do not call host-unavailable tools just because the skill or\n  server lists them. Use parallel scoped searches when batch is unavailable; use bounded exact\n  identifier\u002Fimport\u002Fcall-site searches when navigation is unavailable, then read the witnesses.\n- See [runtime recovery](references\u002Fworkspace-and-runtime.md#tools-described-by-the-skill-are-missing-in-the-host)\n  before refreshing an install. Preserve its endpoint\u002Fcredentials; an expired HTTP session is not\n  evidence of a smaller server tool surface.\n\n**Output-schema failures are not zero hits:** if a tool result fails validation (for example,\n`document_symbols` missing required `metadata`), report the tool and contract error once and use\nanother proof tool. Do not blindly retry or change search parameters to repair a response schema.\nFor an input validation error, correct the named field and retry only when the correction is clear.\n\n**Transport contract (dual mode — hosts choose; Frigg does not force one):**\n\n| Mode | When | Freshness contract |\n| --- | --- | --- |\n| **Loopback HTTP** (`frigg serve`, default adopt MCP URL) | Shared \u002F long-running \u002F multi-client \u002F subagents | **Full freshness** assumes HTTP + watch leases: adoption, hot-path refresh, shared caches |\n| **Stdio** (client spawns `frigg`) | One local client that owns the process | **Valid, different contract** — default `WatchMode::Off` (not Auto); often `mode_off`; not “broken Frigg” |\n\n- Managed adopt configs emit **HTTP** (`type: http`, `http:\u002F\u002F127.0.0.1:37444\u002Fmcp`). Keep `frigg serve` running for those clients.\n- Do **not** claim full post-edit watch freshness on stdio when `runtime.watch_status.reason=mode_off` \u002F `no_lease`. Use path-scoped live-disk; wait only for a leased `debouncing` or `refreshing` refresh.\n- Do **not** blame ranking, hybrid, or search quality for staleness that is really stdio-without-watch \u002F multi-process stdio races.\n- Stdio is not second-class or deprecated; it is the right shape for a single ephemeral client. Prefer HTTP as soon as a second client or subagent shares the repo.\n\nDeep parameter encyclopedias live under [references\u002F](references\u002F) — use them after you pick a scenario. **This top screen is enough to route.**\n\n**Dual OS note:** Agents follow this **skill loop** (symbol → text → hybrid → batch → proof). Searcher ranking\u002Fpolicy depth is an **internal ranking OS** for product engineers and evals — not a second agent DSL. Prefer compact pivots and exact tools over “trust hybrid rank-1.”\n\n---\n\n## Pick your scenario first\n\n| I need to… | Start here | Do not start with |\n| --- | --- | --- |\n| Try several guesses at once | [Parallel wide net](#parallel-wide-net) | Parallel shell grep |\n| Answer “where is X?” (vague) | [Broad discovery](#broad-discovery) | Hybrid alone, or grep |\n| Find exact text \u002F regex | [Exact text search](#exact-text-search) | Hybrid |\n| I know the function\u002Ftype name | [Known symbol](#known-symbol) | Hybrid, unscoped grep |\n| See who uses \u002F calls something | [Impact](#impact) | `rg` on whole repo |\n| List files or outline a big file | [Files & outline](#files--outline) | `find` when Frigg up |\n| Read code to understand | [Proof read](#proof-read) | — |\n| Cite `start:end:path` to user | [Citation read](#citation-read) | — |\n| Wrong repo \u002F zero hits \u002F adoption | [Session gate](#session-gate) | Grep “to verify” |\n| Several repos on one Frigg | [Multi-repo](#multi-repo) | Assume cwd = default |\n| After I edited files | [Post-edit](#post-edit) | Repo-wide shell grep |\n| Trace a failure | [Bug trace](#bug-trace) | Hybrid when error text known |\n| Refactor blast radius | [Refactor impact](#refactor-impact) | Throwaway `rg` |\n| Review change \u002F subsystem risk | [Technical review](#technical-review) | Grep transcript as proof |\n| Risky pattern \u002F security sweep | [Security sweep](#security-sweep) | Parallel shell regex only |\n| Open config \u002F manifest path | Direct `read_file` | Repo-wide search first |\n\nCompact intent map (same routing, shorter):\n\n```text\nKnown string or regex -> search_text\nKnown function\u002Ftype\u002FAPI name -> search_symbol\nVague \"where is X?\" -> search_hybrid, then exact search\nSeveral guesses -> search_batch or parallel search_text\nNeed proof -> read_match, then read_file\nNeed impact -> copy a row's target_ref into impact_bundle(target) or navigation; impact_bundle(symbol) remains a legacy\u002Fad-hoc route\nWrong repo, stale index, surprising zero -> workspace\nGit\u002Fbuild\u002Fgenerated\u002Funindexed\u002FFrigg missing -> shell fallback\n```\n\n---\n\n## Full shell → Frigg card\n\nUse this table before reaching for shell on source code.\n\n| Shell habit | Frigg call |\n| --- | --- |\n| `rg -n PATTERN` | `search_text`, `query=PATTERN` (literal default) |\n| `rg -n 'a\\|b'` | `search_text`, `pattern_type=regex`, `query='a\\|b'` |\n| `rg -n PATTERN src\u002F` | `search_text`, `path_regex='^src\u002F'` (or repo runtime roots, e.g. `^crates\u002F`) |\n| `rg -l PATTERN` | `search_text`, `files_with_matches=true` |\n| `rg -c PATTERN` | `search_text`, `count_only=true` → read **`total_matches`**, not empty `matches[]` as failure |\n| `rg -g '**\u002F*.rs' PATTERN` | `search_text`, `glob='**\u002F*.rs'` (use `**` for recursion) |\n| `rg -C 3 PATTERN` | `search_text`, `context_lines=3` |\n| `rg --files -g '*.rs' path\u002F` | `list_files`, `glob='*.rs'`, `path_regex='^path\u002F'` |\n| `find path -name '*.rs'` \u002F `fd` | `list_files`, `glob='*.rs'`, `path_regex='^path\u002F'` |\n| `cat path` | `read_file`, `path=path` |\n| `sed -n '10,80p' path` | `read_file`, `start_line=10`, `end_line=80` |\n\n**Default scope:** `path_regex='^src\u002F'` or tighter (use the repo’s real runtime roots, e.g. `^crates\u002F`) unless the question is about docs, specs, or intentionally indexed research paths.\n\n**Regex trap:** `|`, `.*`, `^`, `$`, or character classes in a literal query with 0 hits → retry with `pattern_type=regex`.\n\n**Glob scope trap:** `ZERO_HIT_SCOPE_TOO_TIGHT` is not absence proof. Frigg's basename glob\n`Cargo.toml` matches root and nested manifests; `**\u002FCargo.toml` excludes the root manifest.\nFor unambiguous manifest scope, omit `glob` and use `path_regex='(^|\u002F)Cargo\\.toml$'` for all\nmanifests or `path_regex='^Cargo\\.toml$'` for root-only. Verify scope before claiming workspace-wide\nabsence, or explicitly limit the claim to manifests actually read.\n\n**Ignore truth:** Frigg follows `.gitignore`. Ignored paths (for example gitignored `\u002Fdocs\u002F`) do not appear in indexed search even if they exist on disk — use direct read or adjust ignore rules when those paths are the task.\n\n---\n\n## Hard anti-patterns\n\n```text\nBAD: hybrid -> grep\nBAD: hybrid rank-1 -> answer without exact pivot\nBAD: Frigg search + parallel shell grep on indexed source\nBAD: unscoped zero-hit conclusion\nBAD: document_symbols for a known name\nBAD: go_to_definition(path, line) without symbol on dense lines\nBAD: ignore ambiguous_location=true \u002F location_warning and edit from path+line defs\nBAD: find_declarations then go_to_definition (or both) as the default known-symbol loop\nBAD: read_match with a match_id from another result_handle\nBAD: read_match with a pre-edit result_handle after post-edit \u002F reindex without re-search\nBAD: repo-wide shell rg to \"confirm\" an explainable Frigg zero\nBAD: throwaway shell rg on indexed src when Frigg is attached\nBAD: calling tools only in a stale schema cache, not in live tools\u002Flist\nBAD: invent workspace_index \u002F workspace_reindex \u002F deep_search from source or host descriptors\nBAD: treat search_batch as one cheap multi-pattern scan \u002F expect early-exit across probes\nBAD: blame ranking\u002Fhybrid for staleness when watch is mode_off (often default stdio WatchMode::Off) without checking watch_status\u002Fprofile\nBAD: spawn multiple stdio Frigg processes against one repo and expect shared HTTP-style freshness\nBAD: invent compose_evidence_packet \u002F sealed evidence MCP tools — packets are skill-assembled\nBAD: invent review_bundle \u002F bug_trace_bundle \u002F citation-service tools — impact_bundle is the composition template\nBAD: invent product tool-order hacks or blame Frigg ranking when host Grep wins \u002F MCP bridge is flaky\nBAD: answer from hybrid rank-1 alone or treat ranking policy as a second agent skill\nBAD: treat hybrid graph neighbors \u002F graph_score as proven call edges (use incoming_calls \u002F find_references)\nBAD: claim Frigg-first in a Task\u002Fsubagent without re-probing live tools\u002Flist for that spawn\nBAD: treat parent-OK\u002Fchild-missing Frigg (or empty Frigg server on this spawn) as ranking\u002Fhybrid\u002Findex failure — that is harness registration (FUT-003)\nBAD: treat every Tool not found as inheritance — invented phantoms and extended-only names are surface honesty\nBAD: invent bridge_health \u002F subagent_mcp_status Frigg tools (cannot observe missing registration from inside Frigg)\n```\n\n---\n\n## Done criteria\n\n```text\nAfter search: read_match (or read_file) before answering or editing.\nAfter hybrid: exact search_text or search_symbol before proof.\nAfter impact query: navigation evidence before textual whole-repo grep.\nAfter surprising zero: trust zero_hit_reason \u002F recovery fields before shell.\nAfter edit: workspace freshness before reusing Frigg for touched paths; re-search before old handles.\n```\n\nMulti-hypothesis answers must cite at least one Frigg proof window with no parallel shell grep on indexed source while Frigg is healthy.\n\n## Bounded-result truth\n\nBefore concluding that a short or empty response proves absence, read its `completeness` envelope:\n\n- `unit` declares the row unit; `returned` is page-local; `total` is exact for the normalized\n  request only when present. Absent `total` means coverage is unproven, never “at least this\n  many.”\n- `complete=true` means exact and exhausted, with no continuation or omission reasons. A final\n  page can be complete even if its page-local `returned` is less than request-wide `total`.\n- `truncated=true` is an intentional bound; inspect `truncation_reasons`. `complete=false` with\n  `incomplete_reasons` signals diagnostics, ranked discovery, or navigation coverage that cannot\n  establish exhaustiveness.\n- Continue only when `completeness.continuation` is present, replaying the same normalized\n  request with that opaque v2 token in `continuation`. It is bound to tool, request, session,\n  repository scope, and snapshot. Do not combine it with legacy `resume_from`; old cursors are a\n  compatibility input, while v2 is canonical output.\n\nSearch-specific reading rules:\n\n- `search_text.total_matches` is raw occurrence cardinality; use `completeness.unit` and\n  `completeness.total` for the shaped row collection. `count_only=true` intentionally has no\n  `matches[]`. File-collapse modes count files, and `max_count_per_file` affects capped rows\n  without redefining the raw occurrence total.\n- `search_hybrid` is ranked discovery: total is absent, coverage is incomplete for\n  `ranked_discovery`, and it has no exhaustive continuation. Pivot to exact tools before proof.\n- For navigation, page completeness is independent of `mode`. `heuristic_no_precise` and\n  `unavailable_no_precise` remain weaker or unavailable semantic coverage even if a returned page\n  is otherwise complete. `find_references.total_matches` is the known pre-page active-mode total.\n- `search_batch` exposes child truth in each `probe_summary.completeness`; `impact_bundle` does\n  the same per included section. Read both child and aggregate envelopes before asserting a\n  complete investigation.\n\n---\n\n## Positive fallback boundary\n\n**Always shell or host tool:**\n\n- `git status`, `git diff`, commit and branch operations\n- build output, test output, package-manager output\n- generated or ignored directories (e.g. `target\u002F**`, `.ask\u002Fgenerated\u002F`)\n- explicit live-disk verification after a write when freshness is not proven\n- Frigg unavailable \u002F unregistered\n\n**Frigg or direct read** (depending on path and goal):\n\n- small authored manifests and config (`ask.toml`, `**\u002Fmanifest.toml`)\n- project docs and fixtures when indexed, or direct read when path is known\n- newly created files before watch confirms ingestion\n- ignored paths that exist on disk but are not in the index\n\n**Never shell as a trust patch:**\n\n- source search under indexed runtime paths when Frigg is registered\n- “confirming” a scoped Frigg zero-hit without a stale or unindexed reason\n- references or call analysis when a symbol anchor exists\n\n---\n\n## Scenario cards\n\nEach card: **Trigger \u002F Habit \u002F Frigg path \u002F Fallback \u002F Proof \u002F Done \u002F Product support**.\n\n### Parallel wide net\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Several plausible strings or symbols; would fire 3–6 greps in one turn |\n| **Habit** | Parallel `grep`\u002F`rg`\u002F`Grep` in one message |\n| **Frigg path** | Prefer `search_batch([...])`: **independent** concurrent probes, then merge\u002Fdedupe. Same-turn parallel `search_text` \u002F `search_symbol` only if batch is unavailable on the live surface. |\n| **Fallback** | Shell only if Frigg unregistered or path unindexed |\n| **Proof** | `read_match` on best merged hit |\n| **Done** | Multi-hypothesis answer cites Frigg proof; no parallel shell on indexed source |\n| **Product support** | 2–8 probes, each a full search; `probe_summary` per probe; coordinate dedupe; fixed `merge_strategy=reciprocal_rank_fusion`; per-row `evidence`, `consensus_count`, `rrf_score`, and derived `match_strength`; handles \u002F authoritative `next_actions` (with deprecated lossy `suggested_next` compatibility projection). **Not** a selectable merge, shared multi-query walk, or early-exit fusion. |\n\n```text\nPREFERRED: search_batch([\n  { id, kind: text|symbol|hybrid, query, path_regex?, glob?, path_class? },\n  ...  \u002F\u002F 2..=8 probes\n])\n\nMental model: same as parallel Frigg searches in one call — not one fused rg with many patterns.\nPrefer text+symbol probes for multi-guess; use hybrid probes sparingly (vague only); still proof via read_match.\nRead child `probe_summary[].trust` and `probe_summary[].completeness` independently, then aggregate\n`completeness`: consensus precedes equal-weight RRF, and derived strength is only a tie-breaker.\nReplay batch `continuation` only with the same normalized probes, scopes, and snapshots. The old\n`merge=\"rank_by_probe_hit_strength\"` spelling is a two-minor compatibility input only; omit\n`merge` from new requests and inspect `compatibility_note` if a legacy caller used it.\n\nELSE — only if tools\u002Flist lacks search_batch:\n  search_text(probe_1, path_regex=^src\u002F)\n  search_text(probe_2, glob=**\u002F*.{rs,toml,yaml})\n  search_symbol(guessed_name, path_class=runtime)\n→ pick best hit → read_match → answer\n```\n\nExample probe set (registration-style):\n\n```text\nsearch_text: catalog_entries      path_regex=^src\u002F\nsearch_text: query_surfaces       glob=**\u002F*.{rs,toml,yaml}\nsearch_symbol: catalog_entries    path_class=runtime\n```\n\n### Broad discovery\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | “Where is X?” — no symbol, exact string, or path |\n| **Habit** | Semantic search, guessed `rg` keywords, open top files |\n| **Frigg path** | `search_hybrid(question)` → authoritative `next_actions[]` or noun pivot → `search_symbol` \u002F `search_text` → proof read |\n| **Fallback** | Skip hybrid if a likely symbol\u002Fstring is already known. Never shell-grep as the precision layer after hybrid |\n| **Proof** | Exact search, then `read_match` \u002F `read_file` |\n| **Done** | Never answer from hybrid rank-1 alone; exact Frigg evidence present |\n| **Product support** | Compact pivots, `ranking_note`, `best_pivot_path`, and typed `next_actions`; semantic is **opt-in** (product default off) — optional accelerator only |\n\n```text\n1. search_hybrid(\"\u003Cuser question>\")\n2. Read ranking_note (always-on in compact):\n   - \"discovery_only; confirm with exact search\" → multi-channel hybrid; still never proof from rank-1\n   - \"discovery_only; lexical_only (semantic not contributing); …\" → product default \u002F semantic off \u002F\n     empty semantic channel — hybrid is still valid (lexical+graph); pivot sooner to exact tools\n3. Do NOT answer from rank #1 alone\n4. If `next_actions[]` is present, execute each named existing tool with exact `arguments`, following role\u002Forder\u002Fdependencies; otherwise extract nouns → search_symbol → scoped search_text\n5. read_match \u002F read_file for proof\n```\n\n```text\nBAD:  search_hybrid → read_file(first hit) → answer\nBAD:  ranking_note has lexical_only → abandon Frigg for shell rg\nGOOD: search_hybrid → search_symbol\u002Fsearch_text → read_match\nGOOD: lexical_only ranking_note → still Frigg exact tools; semantic is opt-in upgrade\n```\n\n**Semantic default (product):** runtime semantic is **off** unless the operator enables it. Hybrid without semantic is intentional (lexical + graph), not a broken server. Compact does **not** dump `semantic_status` \u002F long readiness warnings — the mode cliff is only the short `ranking_note` token. Full `response_mode` keeps diagnostics for operators.\n\n**Local MiniLM (`provider=local`, preset `offline-small`):** **offline smoke** \u002F zero-key general embedder — not a code-specialized model. `semantic_status: ok` means vectors ran; still pivot hybrid → exact `search_text` \u002F `search_symbol` before proof. Prefer cloud \u002F `openai_compat` when you want a stronger semantic channel; do not chase “better hybrid rank-1” under MiniLM alone.\n\n**Google Gemini (`provider=google`, preset `cloud-google`):** **credential peer** — use when `GEMINI_API_KEY` is already present. Not an unmeasured “best cloud for code” default over OpenAI. OpenAI-only sessions need not configure Google.\n\nPrefer `next_actions[].tool` and exact `next_actions[].arguments` after hybrid; do not paste the original natural-language question into `search_symbol`. `suggested_next` is deprecated and lossy for at least two minor releases. Stale or mixed proof handles require rerunning the typed origin producer and choosing a fresh `match_id`; never reuse the old match. Frigg has no generic executor or automatic chaining endpoint.\n\n### Exact text search\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Literal, regex, config key, error string, `rg`-shaped probe |\n| **Habit** | `rg -n` \u002F `-l` \u002F `-c` \u002F `-g` \u002F scoped path |\n| **Frigg path** | `search_text` with scope + shaping flags (see shell card) |\n| **Fallback** | Shell only for unindexed \u002F Frigg down \u002F live-disk. Do not shell-confirm a complete indexed zero |\n| **Proof** | `read_match` when handle present, else `read_file` |\n| **Done** | `rg` habits map to `search_text`; regex and count-only traps handled without shell |\n| **Product support** | Regex-looking literal recovery, count_only shape, scope echo, handles, `latency_class` |\n\n```text\nsearch_text(\n  query=...,\n  pattern_type=literal|regex,\n  path_regex=^src\u002F...,   # almost always\n  glob=..., files_with_matches=..., count_only=..., context_lines=...\n)\n→ read_match(handle, match_id) OR read_file(path, start_line, end_line)\n```\n\nUnscoped search may rank docs\u002Fspecs\u002Fskills before runtime — expected noise. Prefer runtime path scope for implementation questions.\n\n### Known symbol\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Known or strongly guessed function\u002Ftype\u002FAPI\u002Fclass\u002Ftrait\u002Fmodule name |\n| **Habit** | `rg -n \"fn name\"` or IDE go-to-def |\n| **Frigg path** | `search_symbol(name, path_class=runtime)` → **`go_to_definition(symbol=name)`** → proof |\n| **Fallback** | No hybrid or unscoped grep when name is known. Do **not** call `find_declarations` first (or serially by default) |\n| **Proof** | `read_match` or `read_file` (json\u002Fcitation if citing) |\n| **Done** | Starts at `search_symbol`; definition-first navigation with `symbol`, not path+line alone |\n| **Product support** | Runtime-first defaults, `column`\u002F`excerpt`, empty-`{}` rejection; both def\u002Fdecl tools kept for LSP parity; heuristic `mode` is valid |\n\n```text\nDEFAULT LOOP (stop after proof unless decl≠def is the actual question):\n1. search_symbol(name, path_class=runtime)  # prefer symbol + column from hit when present\n2. go_to_definition(symbol=name)            # body \u002F implementation anchor\n3. If path+line only was used: check ambiguous_location \u002F location_warning before editing\n4. read_match OR read_file\n5. If navigation mode is heuristic\u002Funavailable: still usable — do NOT install scip-* mid-task\n\nOPTIONAL BRANCH (not a numbered step after 2 by default):\n  find_declarations(symbol=name)\n  — only when declaration vs definition matters (headers, interfaces, re-exports, ambient decls)\n  — never run both serially as the default known-symbol loop\n\nBAD: go_to_definition + find_declarations every time and treat both rows as two anchors\nBAD: pause the agent loop to install rust-analyzer \u002F scip generators because precise is missing\nGOOD: go_to_definition(symbol=…) for body anchors; declarations only when decl≠def matters\nGOOD: treat NavigationMode heuristic as valid Frigg; precise is an upgrade when ready\n```\n\n### Impact\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Usages, callers, callees, trait impls for a known anchor |\n| **Habit** | Whole-repo `rg -n symbol`, manual dedupe |\n| **Frigg path** | Prefer `impact_bundle(target)` with a copied `target_ref`; or sequential symbol → target → refs → callers → impls |\n| **Fallback** | Scoped `search_text` may supplement tests; shell `rg` is not the main reference pass |\n| **Proof** | Read section-qualified proof targets; confirm separate `outgoing_calls` with body reads |\n| **Done** | Navigation evidence before edit or impact claim |\n| **Product support** | `sections[]` separates execution\u002Ftrust\u002Fcompleteness, plus section-qualified `proof_targets` and canonical `next_actions`; `summary` counts\u002Ftop_paths remain a compact projection. Test mentions require `include_test_mentions=true`; outgoing calls are not bundled. **Public thin composers** are `impact_bundle` (nav) and `search_batch` (multi-probe) — no further scenario bundles |\n\n```text\nPREFERRED: impact_bundle(target=\u003Ccopied target_ref>, path_class=runtime)\n  → if legacy symbol is ambiguous, select a target; no child section ran\n  → read sections[] first: execution is distinct from completeness and trust\u002Fmode\n  → follow a section proof_targets[].action_id through canonical next_actions[] + read_match\n  → include_test_mentions=true only for an exact test-path mention pass; zero is still an included section\n  \u002F\u002F full response_mode preserves the same sections\u002Factions truth\n  \u002F\u002F outgoing_calls remain separate\u002Fprovisional and require body confirmation\n\nOR sequential:\nsearch_symbol(anchor, path_class=runtime)\nfind_references(symbol, include_definition=false)\nincoming_calls(symbol)              # who calls — reliable\noutgoing_calls(symbol)              # trust=provisional (+ trust_note); confirm with read_file\nfind_implementations(symbol)        # traits\u002Finterfaces only\n```\n\n**Composition bar \u002F surface growth (EXP-when-to-grow-surface A):** a new public “bundle\u002Fservice”\ntool is justified only when orchestration **cannot** be a skill loop without shared handles and\nrecovery budgets (same class as `impact_bundle` \u002F `search_batch`). Prefer, in order:\n\n1. **Skill loop** over existing tools (symbol → text → hybrid → batch → proof)\n2. **Internal module \u002F policy \u002F ranking fix** (not agent-visible) when the miss is order\u002Fquality\n3. **Thin composer** (`impact_bundle`, `search_batch` class) when multi-primitive orchestration needs\n   shared handles\u002Frecovery the skill loop cannot share — not a substitute for fixing ranking (2)\n4. **New public tool** last; never tool-per-scenario (`review_bundle`, `bug_trace_bundle`, citation\n   services, packet MCP tools). Multi-claim review packets stay **skill-assembled**\n   (see Technical review + `frigg:\u002F\u002Fpolicy\u002Fevidence-packet.json`).\n\nDo **not** invent tools to “fix” harness registration, ranking, or host Grep order.\n\n### Files & outline\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Which files exist under a path, or outline a large file |\n| **Habit** | `find` \u002F `rg --files` \u002F scroll \u002F `rg -n \"^pub fn\"` |\n| **Frigg path** | `list_files(...)` or `document_symbols(path, top_level_only=true)` |\n| **Fallback** | Shell `find` only if Frigg down or path unindexed. Known name → `search_symbol`, not outline |\n| **Proof** | After pick, `read_file` \u002F `read_match` |\n| **Done** | No shell `find` for indexed listing when Frigg attached |\n| **Product support** | List\u002Foutline pagination, `resume_from`, top-level default |\n\n```text\nlist_files(glob='*.rs', path_regex='^src\u002Fcatalog\u002F')\ndocument_symbols(path, top_level_only=true)\n  → pick symbol line → read_match or read_file\n```\n\nPrefer anchored path filters (`^ontology\u002F`) over bare substrings (`ontology`).\n\n### Proof read\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Understand behavior after a search\u002Fnav hit (internal) |\n| **Habit** | Host Read with line prefixes |\n| **Frigg path** | Prefer `read_match(result_handle, match_id)`; else `read_file(path, start_line, end_line)` |\n| **Fallback** | Host Read acceptable only when needed outside Frigg scope |\n| **Proof** | Bounded source window from the source revision observed when the pair was issued |\n| **Done** | Internal proof stays on Frigg handles\u002Fpaths |\n| **Product support** | Revision-bound scoped handles; `STALE_HANDLE`, `MIXED_HANDLE`, and `STALE_PROOF_ANCHOR` failures |\n\n```text\nmatch_id is valid ONLY with its own result_handle from the SAME call.\nmatch_id is scoped: search:m1, symbols:m1, hybrid:m1, nav:m1 (never reuse across tools).\nhandle_scope + handle_expires=\"session\" mark the pairing lifetime.\n\nHandle lifetime (session-scoped, not a durable citation id):\n- Explicit reindex \u002F detach \u002F whole-repo cache wipe → handles for that repo drop (StaleHandle).\n- Watch refresh with a known dirty set → only anchors on **dirty paths** drop; untouched-path\n  bookmarks may still work. Known-empty success (noop refresh) does not wipe handles.\n- Unknown dirty set (notify drop, failed refresh) → whole-repo handle wipe (conservative).\n- After post-edit \u002F use_live_disk \u002F wait_for_refresh→ready for paths you care about:\n    **re-run search** before trusting an old result_handle for proof or citations.\n  Do not chain pre-edit handles across a freshness transition for those paths.\n\n`read_match` verifies the live source against the revision bound to the pair before returning\ncontent. If the source changed, was deleted, or cannot be verified, it returns\n`STALE_PROOF_ANCHOR` and no source bytes. Re-run the originating search\u002Fnavigation tool and use\nits new `result_handle` + `match_id`; do not retry the old pair. `read_file` is the explicit path\nfor current live content, not a way to refresh historical proof.\n\n`STALE_HANDLE` → the pair expired or was invalidated; re-run search.\n`MIXED_HANDLE` \u002F foreign `match_id` → use the matching handle from the same call; if the handle\nis known but the match vanished after a path-scoped watch drop, re-run search (do not treat it as\na cross-call mix-up alone).\nText mode returns raw source (no line prefixes) — fine for internal proof.\n```\n\n### Citation read\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | User-facing reply needs ` ```startLine:endLine:path``` ` |\n| **Habit** | Cursor\u002Fhost Read (`LINE\\|content`) |\n| **Frigg path** | `read_file` \u002F `read_match` with `presentation_mode=json` for `start_line`\u002F`end_line`; or `presentation_mode=citation` for `LINE\\|content` text |\n| **Fallback** | Host Read only when Frigg is unavailable |\n| **Proof** | Stable `start_line`\u002F`end_line` (json) or line-prefixed text (citation) |\n| **Done** | Citation has line metadata without abandoning Frigg for every internal read |\n| **Product support** | json + citation presentation modes, evidence packets |\n\n```text\nProof (internal): presentation_mode=text (default) — raw source, no prefixes.\nCitation (user-facing): presentation_mode=citation → \"306|pub fn catalog_entries...\"\nOr: presentation_mode=json → use start_line\u002Fend_line + path in ```start:end:path``` fences.\n```\n\n### Session gate\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Adoption, wrong repo, index health, or surprising zeros uncertain |\n| **Habit** | Assume cwd; grep when search feels wrong |\n| **Frigg path** | `workspace(path=\u003Crepo root>)` — **gate, not preamble** |\n| **Fallback** | Shell not a patch for unexplained zeros; check repo\u002Findex first |\n| **Proof** | After adoption\u002Fhealth, resume the real scenario tool |\n| **Done** | Workspace used when trust changes, not before every search |\n| **Product support** | `freshness.snapshot`, `freshness.continuous`, `freshness.post_edit`, dirty scope and per-tool\u002Fpath capabilities; legacy `recommended_action`\u002F`gate_hint`\u002F`fresh_enough_for`; `runtime.tools_exposed` |\n\n```text\nCall workspace(path=...) IF:\n  - wrong-repo paths, unexplained zeros, index errors, multi-repo ambiguity, post-edit freshness\nSkip workspace IF:\n  - first search hits expected paths and index is ready\n\nFreshness decision tree (authoritative; branch here before legacy fields):\n  1. snapshot=ready + dirty_scope=clean → use snapshot on HTTP or stdio; do not wait\n  2. ready + known dirty paths + leased continuous=debouncing|refreshing → wait_for_refresh;\n     brief wait, then re-check workspace\n  3. ready + dirty + continuous=mode_off|no_lease|retry_backoff|blocked|notify_degraded →\n     can_converge_by_waiting=false; live-disk reads for touched paths only, snapshot for untouched\n  4. snapshot=missing|uninitialized|error → run_cli_index (operator\u002FCLI)\n  5. snapshot=detached → adopt_repo; snapshot=unavailable → frigg_unavailable\u002Frecover service\n  6. Use exact canonical next_actions when returned; legacy recommended_action is compatibility only\n\n`wait_watch` is a legacy projection only of `wait_for_refresh`, never an independent wait reason.\nStdio is valid; default stdio often reports `mode_off`, so use live disk for touched paths or HTTP\nfor shared freshness. `read_match` is handle-generation-bound: after a touched edit, rerun its\nproducer and use its new pair before citation proof.\n\nrun_cli_index means index substrate not Ready:\n  - NOT a public MCP tool (tools\u002Flist has no reindex \u002F workspace_reindex)\n  - operator\u002FCLI: `frigg index` (or attach-side ensure \u002F operator lifecycle)\n  - read gate_hint when present; do not invent a write tool or shell-grep the repo \"to fix\" it\n\nTool surface honesty:\n  - Trust runtime.tools_exposed (or live tools\u002Flist) for this process\n  - Do not call names only in host schema caches, skill memory, or source #[tool] attributes\n  - tool_surface_profile is core|extended; **explore is core**; playbook tools only with `--features playbook` + extended\n  - On Task\u002Fsubagent spawn: re-probe Frigg registration before Frigg-first claims (see probe-on-spawn above)\n  - Missing Frigg on child while parent works → harness inheritance (FUT-003), not Frigg product P0\n\nPolicy progressive disclosure:\n  - Skill scenario cards are SSOT for agent routing\n  - MCP frigg:\u002F\u002Fpolicy\u002F* resources are secondary\u002Fmachine (hosts, support matrix, tool-surface)\n  - Do not treat resources as a second full skill\n\nInstall surfaces (avoid three-doc drift):\n  - **Skill** = sole scenario home (this file \u002F host skill path)\n  - **AGENTS.md** = lightweight pointer via `frigg adopt` (not a second skill)\n  - **ideas\u002Fflows** research = not production routing\n  - After monorepo skill changes: re-adopt managed blocks; reload host skill; `frigg adopt --check` in CI\n```\n\nVerify live `tools\u002Flist` \u002F `runtime.tools_exposed` before calling schema-only or extended-only tools.\n\n### Multi-repo\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | One Frigg (often HTTP) serves several repos; session default may differ |\n| **Habit** | Assume cwd; grep harder after zero |\n| **Frigg path** | `workspace(path=\u003Crepo root>)` then search\u002Fnav with `repository_id` when needed |\n| **Fallback** | Wrong-repo zero → adopt or explicit id, not shell grep |\n| **Proof** | Continue with exact\u002Fsymbol\u002Fnav after correct repo |\n| **Done** | Wrong-default searches are recoverable via workspace diagnostics |\n| **Product support** | Zero-hit names repository; multi-repo disambiguation on same-rank symbols; recovery suggests `workspace` \u002F `repository_id` |\n\n```text\nMulti-attach (common on HTTP):\n  - Prefer repository_id on impact_bundle \u002F nav when the symbol name is common across repos\n  - DISAMBIGUATION_REQUIRED + target_selection.candidates → pick repo via repository_id or path+line\n  - Do not invent federated cross-repo call graphs; one repo graph at a time\n  - Wrong-repo zero → workspace(path=...) recovery, not shell grep\n```\n\n### Post-edit\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Edited or created files; need index freshness for re-search |\n| **Habit** | Bypass index with Read or repo-wide grep |\n| **Frigg path** | `workspace()` → if ready for path, Frigg search; if stale\u002Funknown, **targeted** live read of **touched paths only** |\n| **Fallback** | Live-disk for **touched paths only** (`changed_paths_since_snapshot` \u002F known edit paths) — **never** a license for repo-wide shell grep |\n| **Proof** | Frigg after watch; else direct read of edited paths |\n| **Done** | Freshness visible; no default repo-wide shell verification |\n| **Product support** | `freshness` axes, `changed_paths_since_snapshot`, per-tool\u002Fpath capabilities, canonical `next_actions`; legacy compatibility fields |\n\n```text\n1. workspace() after edits\n2. If snapshot=ready and dirty_scope=clean → Frigg search on HTTP or stdio; never wait\n3. If post_edit=use_live_disk_for_touched_files → read_file \u002F host Read on **those paths only**\n4. If post_edit=wait_for_refresh → only leased debouncing\u002Frefreshing work can converge; wait\n   briefly, then re-check workspace. mode_off\u002Fno_lease\u002Fretry_backoff\u002Fblocked\u002Fnotify_degraded do\n   not wait: use touched-path live disk or HTTP\u002Foperator recovery.\n5. If post_edit=run_cli_index → CLI `frigg index` \u002F operator lifecycle (not an MCP tool); optional path-scoped live reads while index rebuilds\n6. **Handles after freshness:** do not `read_match` a pre-edit result_handle for touched paths.\n     Re-run the originating search_text \u002F search_symbol \u002F navigation tool after ready (or after\n     watch commits dirty paths) and use its new paired IDs. `STALE_PROOF_ANCHOR` is a\n     fail-closed proof result: it returns no historical bytes, and `read_file` is only the\n     explicit current-live-content path. Untouched-path handles may still resolve; treat that as\n     opportunistic, not guaranteed across reindex or whole-repo invalidation.\nBAD: workspace dirty → rg -n across the repo\nBAD: recommended_action=reindex → call invented MCP workspace_reindex\nBAD: mode_off \u002F no_lease → wait as if watch could converge\nBAD: post-edit → read_match(old_handle) for a file you just changed\nGOOD: workspace dirty → read_file(edited\u002Fpath.rs) or wait for hot-path watch refresh\nGOOD: wait_for_refresh only for leased debouncing\u002Frefreshing work; otherwise path-scoped live read\nGOOD: recommended_action=reindex → frigg index (CLI) or wait for operator; read gate_hint\nGOOD: after ready → new search → new result_handle → read_match\n```\n\n### Bug trace\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Test\u002Fcommand\u002Flog\u002Fstack\u002Fruntime failure |\n| **Habit** | `rg` error text + test name, then symbol grep |\n| **Frigg path** | Exact error\u002Ftest text → symbol → refs\u002Fcallers → proof |\n| **Fallback** | Hybrid only if no exact string. Shell owns build\u002Ftest **output**; source returns to Frigg |\n| **Proof** | Origin + caller\u002Freference witnesses via `read_match` |\n| **Done** | Failure text maps text → symbol → refs → proof |\n| **Product support** | Zero-hit reasons, navigation `mode` diagnostics |\n\n```text\n1. workspace(path=...) only if repo\u002Fadoption uncertain\n2. search_text(error fragment, path_regex='^(src|tests)\u002F')\n3. search_text(test_name) if test failure\n4. search_symbol(fn_from_stack, path_class=runtime)\n5. find_references \u002F incoming_calls\n6. read_match on strongest witness\n```\n\nIf navigation `mode` is unavailable\u002Fheuristic, widen with `search_text` before assuming code is absent.\nHeuristic nav is **valid product behavior** — precise SCIP is optional acceleration, not a gate on “Frigg works.”\n\n### Refactor impact\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Will change API\u002Ftype\u002Fbehavior; need blast radius before edit |\n| **Habit** | Whole-repo `rg` + manual sort |\n| **Frigg path** | Search a runtime symbol, copy its `target_ref`, then prefer `impact_bundle(target)`; or use sequential refs → impls → callers → optional test pass |\n| **Fallback** | No throwaway shell `rg` on indexed source; use scoped `search_text` for extra textual passes |\n| **Proof** | Read section-qualified proof targets, then replay their canonical `next_actions` before editing |\n| **Done** | Target-first blast radius with section-qualified source witnesses |\n| **Product support** | `sections[]` keeps execution, trust, and completeness distinct; exact test evidence is opt-in; outgoing calls stay separate\u002Fprovisional |\n\n```text\nPREFERRED:\n1. search_symbol(api, path_class=runtime)\n2. copy the selected row's target_ref unchanged\n3. impact_bundle(target=\u003Ccopied target_ref>, path_class=runtime)\n4. read sections[] for execution, trust, and completeness before summary counts\n5. use section-qualified proof_targets with canonical next_actions; add include_test_mentions=true only when test evidence is needed\nOR:\n1. search_symbol(api, path_class=runtime)\n2. find_references(symbol, include_definition=false)\n3. find_implementations if trait\u002Finterface\n4. incoming_calls for caller graph\n5. search_text(symbol, path_regex='(?:^|\u002F)(?:test|tests)\u002F') when tests matter\n6. read_match on each cluster\n```\n\n### Technical review\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Review change, PR, or subsystem for behavioral risk |\n| **Habit** | Diff skim, grep symbols, manual callers\u002Ftests |\n| **Frigg path** | Behavioral anchors + changed APIs → refs\u002Fcallers → proof clusters → tests pass |\n| **Fallback** | `git diff` and build\u002Ftest stay shell; source impact returns to Frigg |\n| **Proof** | Every finding has path\u002Fline witness; prefer skill-assembled evidence packets |\n| **Done** | Findings grounded in Frigg evidence, not shell grep transcripts |\n| **Product support** | Citation reads; skill-side evidence packet shape (+ `frigg:\u002F\u002Fpolicy\u002Fevidence-packet.json`); types `EvidencePacket*` are **not** a tool |\n\n```text\nsearch_text(behavioral anchors, path_regex='^src\u002F')\nsearch_symbol(changed APIs, path_class=runtime)\nfind_references \u002F incoming_calls\nread_match on affected clusters\nsearch_text(changed API, path_regex='^tests\u002F') when tests matter\n```\n\nTrust order for review:\n\n1. `search_text` — narrative anchors  \n2. `read_file` \u002F `read_match` + defs\u002Frefs — proof  \n3. `search_structural` — awkward AST evidence (tier-3)  \n4. `incoming_calls` — call-flow hint  \n5. `outgoing_calls` — always `trust=provisional` + `trust_note` on the wire; confirm edges with body reads (does not upgrade wire trust to verified)\n\n**Evidence packets are skill composition, not an MCP tool.** Frigg supplies witnesses\n(search\u002Fnav\u002Fread). Agents assemble multi-claim JSON for review\u002Fsecurity reports.\nThere is no `compose_evidence_packet` (or sealed server packet) on the public surface.\nMachine schema: MCP resource `frigg:\u002F\u002Fpolicy\u002Fevidence-packet.json`. Rust types\n`EvidencePacket` \u002F `EvidencePacketClaim` mirror the shape for hosts only.\n\nEvidence packet shape (multi-claim answers) — every review\u002Fsecurity finding needs path\u002Fline witnesses:\n\n```json\n{\n  \"claims\": [\n    {\n      \"claim\": \"catalog_entries registers callable operations\",\n      \"tool\": \"search_symbol\",\n      \"path\": \"src\u002Fcatalog\u002Fmod.rs\",\n      \"start_line\": 40,\n      \"end_line\": 72,\n      \"match_id\": \"symbols:m1\",\n      \"result_handle\": \"...\"\n    },\n    {\n      \"claim\": \"caller reaches catalog_entries from the HTTP surface\",\n      \"tool\": \"incoming_calls\",\n      \"path\": \"src\u002Fhttp\u002Froutes.rs\",\n      \"start_line\": 88,\n      \"end_line\": 110,\n      \"match_id\": \"nav:m2\",\n      \"result_handle\": \"...\"\n    }\n  ]\n}\n```\n\n### Security sweep\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Class of risky patterns (unsafe paths, exec, credentials, untrusted input) |\n| **Habit** | Many parallel regex `rg` probes |\n| **Frigg path** | Prefer `search_batch` of text\u002Fsymbol\u002F(optional hybrid) probes; interim parallel Frigg probes; then witnesses + refs |\n| **Fallback** | Generated\u002Fvendor\u002Fbuild artifacts may need shell when explicitly in scope; indexed source stays on Frigg |\n| **Proof** | Each candidate: source witness; sink → refs\u002Fcallers when relevant; evidence packet when reporting |\n| **Done** | Broad parallel probes without leaving Frigg for shell on indexed source |\n| **Product support** | Safe-regex diagnostics, batch summaries, path_class filters, evidence packets |\n\n```text\nsearch_batch([\n  text regex probes scoped to runtime,\n  symbol probes for known sinks,\n  optional hybrid for vague concepts\n])   # interim: parallel search_text \u002F search_symbol\n→ read_match on witnesses\n→ find_references \u002F incoming_calls for validated sinks\n```\n\n---\n\n## Structural search and explore (tier-3)\n\nDo **not** put these on the main discovery path.\n\n**Structural** — expert syntax-shape evidence only:\n\n```text\ndocument_symbols or read_file on a representative file\n  → inspect_syntax_tree(line AND column; column: 1 if unknown)\n  → search_structural from real node kinds\n```\n\n- Known name? Use `search_symbol`, not `document_symbols`.\n- Do not write Tree-sitter queries for ordinary symbol or text search.\n- Opt-in: `include_follow_up_structural=true` for replayable `search_structural` suggestions on structure-aware tools (not hybrid\u002Fsymbol search).\n\n**Explore** (core product surface, tier-3 for routing) — **anchored in-file only**:\n\n```text\nUse explore after you already have a file anchor.\nprobe\u002Frefine scan inside one file.\nzoom reads a bounded source window.\nFor cross-repo search, use search_text \u002F search_symbol \u002F search_hybrid.\n```\n\n`explore zoom` may nest content under structured `window` fields in JSON mode — prefer `read_file` \u002F `read_match` for ordinary proof.\n\n---\n\n## Default loop (compact)\n\n1. Omit `repository_id` in single-repo work unless multi-repo or wrong default.\n2. Pick scenario from the table — do not default to grep.\n3. Search tier: **symbol** (known name) → **text** (known string) → **hybrid** (vague only) → **batch\u002Fparallel** (several guesses).\n4. Compact responses first; `response_mode=full` only for ranking diagnostics. Compact and full responses carry identical executable `next_actions` data; `suggested_next` is only a deprecated lossy compatibility projection.\n5. Navigate with a copied row **`target_ref`** in `target` when one is present; use direct `symbol` or location input only for ad-hoc\u002Fcompatibility calls.\n6. Proof: `read_match` → `read_file`.\n7. Cite: json\u002Fcitation `read_file` or host Read when required.\n8. Structure\u002Fexplore only as tier-3 after anchors exist.\n\n---\n\n## Compact response rules\n\n- `result_handle` + `match_id` → `read_match` (**same call only**; scoped ids like `search:m1`).\n- Text-first `read_file` \u002F `read_match` \u002F `explore(zoom)`: no line prefixes in text mode.\n- `presentation_mode=json` when you need `start_line`, `end_line`, bytes, or machine-readable fields.\n- Hybrid compact may omit rich scores and semantic readiness dumps — still read `ranking_note`:\n  - `lexical_only (semantic not contributing)` means mode cliff (default-off or empty semantic), not “Frigg failed”\n  - `hybrid graph is ranking signal (not nav call edges)` means graph channel ≠ `incoming_calls` \u002F SCIP nav — confirm with exact tools; optional per-match `graph_mode` (`projection` \u002F `heuristic_symbol_graph` \u002F `heuristic_implementation` \u002F `unknown`)\n  - Pivot to exact tools; do not shell-grep indexed source\n- Prefer `latency_class` guidance when present (`hot` \u002F `warm` \u002F `cold`); do not use shell as a latency strategy on indexed source.\n\n---\n\n## Decision table\n\n| Situation | Tool |\n| --- | --- |\n| Git \u002F build \u002F generated \u002F unindexed \u002F Frigg down | shell |\n| Several guesses at once | `search_batch` (prefer); parallel Frigg probes only if batch missing |\n| Vague “where is X?” | `search_hybrid` → exact pivot |\n| Known identifier | `search_symbol` (`path_class=runtime`) |\n| Known string \u002F regex \u002F rg-shaped | `search_text` |\n| File listing | `list_files` |\n| File outline | `document_symbols` |\n| Proof after search | `read_match`, then `read_file` |\n| User citation | `read_file` json\u002Fcitation or host Read |\n| References \u002F callers | `find_references`, `incoming_calls` |\n| Callees | `outgoing_calls` (`trust=provisional`; confirm with read) |\n| Trait \u002F interface impls | `find_implementations` |\n| Definition \u002F body anchor | `go_to_definition(symbol=...)` (default; not path+line alone; trust `ambiguous_location`) |\n| Declaration-only need | `find_declarations` only when decl≠def matters — not a serial default with go_to_definition |\n| AST shape | `inspect_syntax_tree` + `search_structural` (tier-3) |\n| In-file zoom (core) | `explore` — not a substitute for `search_text` |\n| Repo health \u002F adoption | `workspace` gate |\n\n---\n\n## Deep references\n\nParameter exhaustiveness and extended surfaces — open only after routing:\n\n- [references\u002Fdiscovery-and-evidence.md](references\u002Fdiscovery-and-evidence.md) — `list_files`, `search_*`, `read_*`, `explore`\n- [references\u002Fnavigation-and-structure.md](references\u002Fnavigation-and-structure.md) — defs, refs, calls, outline, structural\n- [references\u002Fworkflows.md](references\u002Fworkflows.md) — extended narrative loops (aligned with scenario cards above)\n- [references\u002Fworkspace-and-runtime.md](references\u002Fworkspace-and-runtime.md) — `workspace`, adoption, runtime\n- [references\u002Fextended-tools.md](references\u002Fextended-tools.md) — only after verifying live `tools\u002Flist` \u002F `runtime.tools_exposed`\n- Live machine surface (not inventory freezes): MCP `frigg:\u002F\u002Fpolicy\u002Ftool-surface.json`\n- Evidence packet schema (skill composition only): MCP `frigg:\u002F\u002Fpolicy\u002Fevidence-packet.json`\n- Embedding model defaults \u002F pad \u002F offline facts + soft presets (`offline-small` = MiniLM **offline_smoke**; `cloud-google` = Gemini **credential_peer**; `cloud-openai` \u002F `openai-compat-selfhost`) — curated catalog (no public leaderboard); not CLI aliases: MCP `frigg:\u002F\u002Fpolicy\u002Fsemantic-models.json`\n","# Frigg First Code Search\n\nFrigg is the default for code discovery, file listing, navigation, exact code search, and bounded source reads.\n\nBefore using shell `rg`, `grep`, `find`, `fd`, `cat`, or `sed` for code exploration, use the matching Frigg MCP tool in attached or attachable code repositories.\n\nShell tools are fallback only for git state and diffs, non-code files, build\u002Ftest output, generated or unindexed files, explicit live-disk verification, or when Frigg is unavailable.\n\nDo not run parallel shell grep in the same turn as Frigg search on indexed source.\n\n**Follow the evidence, not just the shell replacement:** use `search_symbol` for a known\nidentifier and `search_batch` for independent hypotheses when callable. After selecting a hit,\ncopy its `target_ref` into navigation when relationships matter, then use `read_match` for source\nproof. A known path still warrants direct `read_file`; do not add navigation merely to use more tools.\n\n**Harness boundary (Frigg is an evidence layer, not an agent OS):**\n\n- Host tool order, Grep-first defaults, and intermittent MCP **registration\u002Finheritance** flukes are **outside** Frigg product code (**FUT-003** harness boundary — not a Frigg CI gate or ranking bug).\n- When the bridge is down or tools are unregistered, that is **harness reliability**, not ranking quality.\n- Soft PreToolUse \u002F adopt hooks are **opt-in** (not guaranteed Frigg-first). Soft only: Claude hook injects next-step context (`search_text` \u002F `search_batch` \u002F …) and **never hard-denies** Grep\u002Fshell (`permissionDecision` is not product).\n- Hard block of Grep\u002F`rg` on indexed roots is a **host experiment**, not Frigg core — do not invent `FRIGG_HOOK_STRICT` or product tool-order hacks.\n- Do **not** invent product hacks (fake Grep, hide host tools, force MCP tool order, or a “subagent bridge health” Frigg tool — Frigg cannot see the host registry when it is not registered).\n- Route indexed source through Frigg when the live tool list exposes Frigg tools; progressive disclosure on this top screen is intentional (30-second rule).\n\n**Probe-on-spawn (Task \u002F subagent \u002F new session):**\n\n```text\n1. Before claiming Frigg-first, verify Frigg is on the *live* host tool surface for THIS spawn:\n   live tools\u002Flist (or a successful Frigg CallMcpTool). Do NOT trust on-disk mcps\u002F…\u002Ftools\n   descriptors or a parent session's tool list as proof this spawn has Frigg.\n2. If Frigg is absent from live tools\u002Flist for this spawn (empty Frigg server, or\n   Tool not found when calling a known Frigg tool like search_text while the parent still has Frigg):\n   - Shell\u002FGrep\u002FRead fallback is correct for this spawn\n   - Note the gap once (harness MCP inheritance \u002F registration) — do NOT file as Frigg search\u002Franking failure\n   - Do NOT invent workspace_reindex \u002F bridge_health \u002F fake tools to \"fix\" registration\n   - (Invented names \u002F extended-only tools missing while other Frigg tools work → surface honesty,\n     not inheritance — see tool-surface rules)\n3. If the initial Frigg workspace is the wrong repository, attach the task repository with\n   workspace(path=...) before falling back to local tools.\n4. Parent session success does NOT imply child Task success — re-probe every delegation.\n5. Prefer loopback HTTP + frigg serve when multiple clients\u002Fsubagents should share one Frigg\n   *after* each spawn actually has Frigg registered; HTTP shares state when registration works —\n   it does not create child registration by itself.\n```\n\n**Partial surface (some Frigg tools work, recommended ones are missing):**\n\n- Compare the host-callable tools, the **installed** skill's `mcp.json` `includeTools` (or inline\n  `mcpServers`), and `workspace.runtime.tools_exposed` \u002F live `tools\u002Flist` when available. A stale\n  skill filter can hide symbol, batch, and navigation tools even when the server supports them.\n- Report the reduced surface once. Do not call host-unavailable tools just because the skill or\n  server lists them. Use parallel scoped searches when batch is unavailable; use bounded exact\n  identifier\u002Fimport\u002Fcall-site searches when navigation is unavailable, then read the witnesses.\n- See [runtime recovery](references\u002Fworkspace-and-runtime.md#tools-described-by-the-skill-are-missing-in-the-host)\n  before refreshing an install. Preserve its endpoint\u002Fcredentials; an expired HTTP session is not\n  evidence of a smaller server tool surface.\n\n**Output-schema failures are not zero hits:** if a tool result fails validation (for example,\n`document_symbols` missing required `metadata`), report the tool and contract error once and use\nanother proof tool. Do not blindly retry or change search parameters to repair a response schema.\nFor an input validation error, correct the named field and retry only when the correction is clear.\n\n**Transport contract (dual mode — hosts choose; Frigg does not force one):**\n\n| Mode | When | Freshness contract |\n| --- | --- | --- |\n| **Loopback HTTP** (`frigg serve`, default adopt MCP URL) | Shared \u002F long-running \u002F multi-client \u002F subagents | **Full freshness** assumes HTTP + watch leases: adoption, hot-path refresh, shared caches |\n| **Stdio** (client spawns `frigg`) | One local client that owns the process | **Valid, different contract** — default `WatchMode::Off` (not Auto); often `mode_off`; not “broken Frigg” |\n\n- Managed adopt configs emit **HTTP** (`type: http`, `http:\u002F\u002F127.0.0.1:37444\u002Fmcp`). Keep `frigg serve` running for those clients.\n- Do **not** claim full post-edit watch freshness on stdio when `runtime.watch_status.reason=mode_off` \u002F `no_lease`. Use path-scoped live-disk; wait only for a leased `debouncing` or `refreshing` refresh.\n- Do **not** blame ranking, hybrid, or search quality for staleness that is really stdio-without-watch \u002F multi-process stdio races.\n- Stdio is not second-class or deprecated; it is the right shape for a single ephemeral client. Prefer HTTP as soon as a second client or subagent shares the repo.\n\nDeep parameter encyclopedias live under [references\u002F](references\u002F) — use them after you pick a scenario. **This top screen is enough to route.**\n\n**Dual OS note:** Agents follow this **skill loop** (symbol → text → hybrid → batch → proof). Searcher ranking\u002Fpolicy depth is an **internal ranking OS** for product engineers and evals — not a second agent DSL. Prefer compact pivots and exact tools over “trust hybrid rank-1.”\n\n---\n\n## Pick your scenario first\n\n| I need to… | Start here | Do not start with |\n| --- | --- | --- |\n| Try several guesses at once | [Parallel wide net](#parallel-wide-net) | Parallel shell grep |\n| Answer “where is X?” (vague) | [Broad discovery](#broad-discovery) | Hybrid alone, or grep |\n| Find exact text \u002F regex | [Exact text search](#exact-text-search) | Hybrid |\n| I know the function\u002Ftype name | [Known symbol](#known-symbol) | Hybrid, unscoped grep |\n| See who uses \u002F calls something | [Impact](#impact) | `rg` on whole repo |\n| List files or outline a big file | [Files & outline](#files--outline) | `find` when Frigg up |\n| Read code to understand | [Proof read](#proof-read) | — |\n| Cite `start:end:path` to user | [Citation read](#citation-read) | — |\n| Wrong repo \u002F zero hits \u002F adoption | [Session gate](#session-gate) | Grep “to verify” |\n| Several repos on one Frigg | [Multi-repo](#multi-repo) | Assume cwd = default |\n| After I edited files | [Post-edit](#post-edit) | Repo-wide shell grep |\n| Trace a failure | [Bug trace](#bug-trace) | Hybrid when error text known |\n| Refactor blast radius | [Refactor impact](#refactor-impact) | Throwaway `rg` |\n| Review change \u002F subsystem risk | [Technical review](#technical-review) | Grep transcript as proof |\n| Risky pattern \u002F security sweep | [Security sweep](#security-sweep) | Parallel shell regex only |\n| Open config \u002F manifest path | Direct `read_file` | Repo-wide search first |\n\nCompact intent map (same routing, shorter):\n\n```text\nKnown string or regex -> search_text\nKnown function\u002Ftype\u002FAPI name -> search_symbol\nVague \"where is X?\" -> search_hybrid, then exact search\nSeveral guesses -> search_batch or parallel search_text\nNeed proof -> read_match, then read_file\nNeed impact -> copy a row's target_ref into impact_bundle(target) or navigation; impact_bundle(symbol) remains a legacy\u002Fad-hoc route\nWrong repo, stale index, surprising zero -> workspace\nGit\u002Fbuild\u002Fgenerated\u002Funindexed\u002FFrigg missing -> shell fallback\n```\n\n---\n\n## Full shell → Frigg card\n\nUse this table before reaching for shell on source code.\n\n| Shell habit | Frigg call |\n| --- | --- |\n| `rg -n PATTERN` | `search_text`, `query=PATTERN` (literal default) |\n| `rg -n 'a\\|b'` | `search_text`, `pattern_type=regex`, `query='a\\|b'` |\n| `rg -n PATTERN src\u002F` | `search_text`, `path_regex='^src\u002F'` (or repo runtime roots, e.g. `^crates\u002F`) |\n| `rg -l PATTERN` | `search_text`, `files_with_matches=true` |\n| `rg -c PATTERN` | `search_text`, `count_only=true` → read **`total_matches`**, not empty `matches[]` as failure |\n| `rg -g '**\u002F*.rs' PATTERN` | `search_text`, `glob='**\u002F*.rs'` (use `**` for recursion) |\n| `rg -C 3 PATTERN` | `search_text`, `context_lines=3` |\n| `rg --files -g '*.rs' path\u002F` | `list_files`, `glob='*.rs'`, `path_regex='^path\u002F'` |\n| `find path -name '*.rs'` \u002F `fd` | `list_files`, `glob='*.rs'`, `path_regex='^path\u002F'` |\n| `cat path` | `read_file`, `path=path` |\n| `sed -n '10,80p' path` | `read_file`, `start_line=10`, `end_line=80` |\n\n**Default scope:** `path_regex='^src\u002F'` or tighter (use the repo’s real runtime roots, e.g. `^crates\u002F`) unless the question is about docs, specs, or intentionally indexed research paths.\n\n**Regex trap:** `|`, `.*`, `^`, `$`, or character classes in a literal query with 0 hits → retry with `pattern_type=regex`.\n\n**Glob scope trap:** `ZERO_HIT_SCOPE_TOO_TIGHT` is not absence proof. Frigg's basename glob\n`Cargo.toml` matches root and nested manifests; `**\u002FCargo.toml` excludes the root manifest.\nFor unambiguous manifest scope, omit `glob` and use `path_regex='(^|\u002F)Cargo\\.toml$'` for all\nmanifests or `path_regex='^Cargo\\.toml$'` for root-only. Verify scope before claiming workspace-wide\nabsence, or explicitly limit the claim to manifests actually read.\n\n**Ignore truth:** Frigg follows `.gitignore`. Ignored paths (for example gitignored `\u002Fdocs\u002F`) do not appear in indexed search even if they exist on disk — use direct read or adjust ignore rules when those paths are the task.\n\n---\n\n## Hard anti-patterns\n\n```text\nBAD: hybrid -> grep\nBAD: hybrid rank-1 -> answer without exact pivot\nBAD: Frigg search + parallel shell grep on indexed source\nBAD: unscoped zero-hit conclusion\nBAD: document_symbols for a known name\nBAD: go_to_definition(path, line) without symbol on dense lines\nBAD: ignore ambiguous_location=true \u002F location_warning and edit from path+line defs\nBAD: find_declarations then go_to_definition (or both) as the default known-symbol loop\nBAD: read_match with a match_id from another result_handle\nBAD: read_match with a pre-edit result_handle after post-edit \u002F reindex without re-search\nBAD: repo-wide shell rg to \"confirm\" an explainable Frigg zero\nBAD: throwaway shell rg on indexed src when Frigg is attached\nBAD: calling tools only in a stale schema cache, not in live tools\u002Flist\nBAD: invent workspace_index \u002F workspace_reindex \u002F deep_search from source or host descriptors\nBAD: treat search_batch as one cheap multi-pattern scan \u002F expect early-exit across probes\nBAD: blame ranking\u002Fhybrid for staleness when watch is mode_off (often default stdio WatchMode::Off) without checking watch_status\u002Fprofile\nBAD: spawn multiple stdio Frigg processes against one repo and expect shared HTTP-style freshness\nBAD: invent compose_evidence_packet \u002F sealed evidence MCP tools — packets are skill-assembled\nBAD: invent review_bundle \u002F bug_trace_bundle \u002F citation-service tools — impact_bundle is the composition template\nBAD: invent product tool-order hacks or blame Frigg ranking when host Grep wins \u002F MCP bridge is flaky\nBAD: answer from hybrid rank-1 alone or treat ranking policy as a second agent skill\nBAD: treat hybrid graph neighbors \u002F graph_score as proven call edges (use incoming_calls \u002F find_references)\nBAD: claim Frigg-first in a Task\u002Fsubagent without re-probing live tools\u002Flist for that spawn\nBAD: treat parent-OK\u002Fchild-missing Frigg (or empty Frigg server on this spawn) as ranking\u002Fhybrid\u002Findex failure — that is harness registration (FUT-003)\nBAD: treat every Tool not found as inheritance — invented phantoms and extended-only names are surface honesty\nBAD: invent bridge_health \u002F subagent_mcp_status Frigg tools (cannot observe missing registration from inside Frigg)\n```\n\n---\n\n## Done criteria\n\n```text\nAfter search: read_match (or read_file) before answering or editing.\nAfter hybrid: exact search_text or search_symbol before proof.\nAfter impact query: navigation evidence before textual whole-repo grep.\nAfter surprising zero: trust zero_hit_reason \u002F recovery fields before shell.\nAfter edit: workspace freshness before reusing Frigg for touched paths; re-search before old handles.\n```\n\nMulti-hypothesis answers must cite at least one Frigg proof window with no parallel shell grep on indexed source while Frigg is healthy.\n\n## Bounded-result truth\n\nBefore concluding that a short or empty response proves absence, read its `completeness` envelope:\n\n- `unit` declares the row unit; `returned` is page-local; `total` is exact for the normalized\n  request only when present. Absent `total` means coverage is unproven, never “at least this\n  many.”\n- `complete=true` means exact and exhausted, with no continuation or omission reasons. A final\n  page can be complete even if its page-local `returned` is less than request-wide `total`.\n- `truncated=true` is an intentional bound; inspect `truncation_reasons`. `complete=false` with\n  `incomplete_reasons` signals diagnostics, ranked discovery, or navigation coverage that cannot\n  establish exhaustiveness.\n- Continue only when `completeness.continuation` is present, replaying the same normalized\n  request with that opaque v2 token in `continuation`. It is bound to tool, request, session,\n  repository scope, and snapshot. Do not combine it with legacy `resume_from`; old cursors are a\n  compatibility input, while v2 is canonical output.\n\nSearch-specific reading rules:\n\n- `search_text.total_matches` is raw occurrence cardinality; use `completeness.unit` and\n  `completeness.total` for the shaped row collection. `count_only=true` intentionally has no\n  `matches[]`. File-collapse modes count files, and `max_count_per_file` affects capped rows\n  without redefining the raw occurrence total.\n- `search_hybrid` is ranked discovery: total is absent, coverage is incomplete for\n  `ranked_discovery`, and it has no exhaustive continuation. Pivot to exact tools before proof.\n- For navigation, page completeness is independent of `mode`. `heuristic_no_precise` and\n  `unavailable_no_precise` remain weaker or unavailable semantic coverage even if a returned page\n  is otherwise complete. `find_references.total_matches` is the known pre-page active-mode total.\n- `search_batch` exposes child truth in each `probe_summary.completeness`; `impact_bundle` does\n  the same per included section. Read both child and aggregate envelopes before asserting a\n  complete investigation.\n\n---\n\n## Positive fallback boundary\n\n**Always shell or host tool:**\n\n- `git status`, `git diff`, commit and branch operations\n- build output, test output, package-manager output\n- generated or ignored directories (e.g. `target\u002F**`, `.ask\u002Fgenerated\u002F`)\n- explicit live-disk verification after a write when freshness is not proven\n- Frigg unavailable \u002F unregistered\n\n**Frigg or direct read** (depending on path and goal):\n\n- small authored manifests and config (`ask.toml`, `**\u002Fmanifest.toml`)\n- project docs and fixtures when indexed, or direct read when path is known\n- newly created files before watch confirms ingestion\n- ignored paths that exist on disk but are not in the index\n\n**Never shell as a trust patch:**\n\n- source search under indexed runtime paths when Frigg is registered\n- “confirming” a scoped Frigg zero-hit without a stale or unindexed reason\n- references or call analysis when a symbol anchor exists\n\n---\n\n## Scenario cards\n\nEach card: **Trigger \u002F Habit \u002F Frigg path \u002F Fallback \u002F Proof \u002F Done \u002F Product support**.\n\n### Parallel wide net\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Several plausible strings or symbols; would fire 3–6 greps in one turn |\n| **Habit** | Parallel `grep`\u002F`rg`\u002F`Grep` in one message |\n| **Frigg path** | Prefer `search_batch([...])`: **independent** concurrent probes, then merge\u002Fdedupe. Same-turn parallel `search_text` \u002F `search_symbol` only if batch is unavailable on the live surface. |\n| **Fallback** | Shell only if Frigg unregistered or path unindexed |\n| **Proof** | `read_match` on best merged hit |\n| **Done** | Multi-hypothesis answer cites Frigg proof; no parallel shell on indexed source |\n| **Product support** | 2–8 probes, each a full search; `probe_summary` per probe; coordinate dedupe; fixed `merge_strategy=reciprocal_rank_fusion`; per-row `evidence`, `consensus_count`, `rrf_score`, and derived `match_strength`; handles \u002F authoritative `next_actions` (with deprecated lossy `suggested_next` compatibility projection). **Not** a selectable merge, shared multi-query walk, or early-exit fusion. |\n\n```text\nPREFERRED: search_batch([\n  { id, kind: text|symbol|hybrid, query, path_regex?, glob?, path_class? },\n  ...  \u002F\u002F 2..=8 probes\n])\n\nMental model: same as parallel Frigg searches in one call — not one fused rg with many patterns.\nPrefer text+symbol probes for multi-guess; use hybrid probes sparingly (vague only); still proof via read_match.\nRead child `probe_summary[].trust` and `probe_summary[].completeness` independently, then aggregate\n`completeness`: consensus precedes equal-weight RRF, and derived strength is only a tie-breaker.\nReplay batch `continuation` only with the same normalized probes, scopes, and snapshots. The old\n`merge=\"rank_by_probe_hit_strength\"` spelling is a two-minor compatibility input only; omit\n`merge` from new requests and inspect `compatibility_note` if a legacy caller used it.\n\nELSE — only if tools\u002Flist lacks search_batch:\n  search_text(probe_1, path_regex=^src\u002F)\n  search_text(probe_2, glob=**\u002F*.{rs,toml,yaml})\n  search_symbol(guessed_name, path_class=runtime)\n→ pick best hit → read_match → answer\n```\n\nExample probe set (registration-style):\n\n```text\nsearch_text: catalog_entries      path_regex=^src\u002F\nsearch_text: query_surfaces       glob=**\u002F*.{rs,toml,yaml}\nsearch_symbol: catalog_entries    path_class=runtime\n```\n\n### Broad discovery\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | “Where is X?” — no symbol, exact string, or path |\n| **Habit** | Semantic search, guessed `rg` keywords, open top files |\n| **Frigg path** | `search_hybrid(question)` → authoritative `next_actions[]` or noun pivot → `search_symbol` \u002F `search_text` → proof read |\n| **Fallback** | Skip hybrid if a likely symbol\u002Fstring is already known. Never shell-grep as the precision layer after hybrid |\n| **Proof** | Exact search, then `read_match` \u002F `read_file` |\n| **Done** | Never answer from hybrid rank-1 alone; exact Frigg evidence present |\n| **Product support** | Compact pivots, `ranking_note`, `best_pivot_path`, and typed `next_actions`; semantic is **opt-in** (product default off) — optional accelerator only |\n\n```text\n1. search_hybrid(\"\u003Cuser question>\")\n2. Read ranking_note (always-on in compact):\n   - \"discovery_only; confirm with exact search\" → multi-channel hybrid; still never proof from rank-1\n   - \"discovery_only; lexical_only (semantic not contributing); …\" → product default \u002F semantic off \u002F\n     empty semantic channel — hybrid is still valid (lexical+graph); pivot sooner to exact tools\n3. Do NOT answer from rank #1 alone\n4. If `next_actions[]` is present, execute each named existing tool with exact `arguments`, following role\u002Forder\u002Fdependencies; otherwise extract nouns → search_symbol → scoped search_text\n5. read_match \u002F read_file for proof\n```\n\n```text\nBAD:  search_hybrid → read_file(first hit) → answer\nBAD:  ranking_note has lexical_only → abandon Frigg for shell rg\nGOOD: search_hybrid → search_symbol\u002Fsearch_text → read_match\nGOOD: lexical_only ranking_note → still Frigg exact tools; semantic is opt-in upgrade\n```\n\n**Semantic default (product):** runtime semantic is **off** unless the operator enables it. Hybrid without semantic is intentional (lexical + graph), not a broken server. Compact does **not** dump `semantic_status` \u002F long readiness warnings — the mode cliff is only the short `ranking_note` token. Full `response_mode` keeps diagnostics for operators.\n\n**Local MiniLM (`provider=local`, preset `offline-small`):** **offline smoke** \u002F zero-key general embedder — not a code-specialized model. `semantic_status: ok` means vectors ran; still pivot hybrid → exact `search_text` \u002F `search_symbol` before proof. Prefer cloud \u002F `openai_compat` when you want a stronger semantic channel; do not chase “better hybrid rank-1” under MiniLM alone.\n\n**Google Gemini (`provider=google`, preset `cloud-google`):** **credential peer** — use when `GEMINI_API_KEY` is already present. Not an unmeasured “best cloud for code” default over OpenAI. OpenAI-only sessions need not configure Google.\n\nPrefer `next_actions[].tool` and exact `next_actions[].arguments` after hybrid; do not paste the original natural-language question into `search_symbol`. `suggested_next` is deprecated and lossy for at least two minor releases. Stale or mixed proof handles require rerunning the typed origin producer and choosing a fresh `match_id`; never reuse the old match. Frigg has no generic executor or automatic chaining endpoint.\n\n### Exact text search\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Literal, regex, config key, error string, `rg`-shaped probe |\n| **Habit** | `rg -n` \u002F `-l` \u002F `-c` \u002F `-g` \u002F scoped path |\n| **Frigg path** | `search_text` with scope + shaping flags (see shell card) |\n| **Fallback** | Shell only for unindexed \u002F Frigg down \u002F live-disk. Do not shell-confirm a complete indexed zero |\n| **Proof** | `read_match` when handle present, else `read_file` |\n| **Done** | `rg` habits map to `search_text`; regex and count-only traps handled without shell |\n| **Product support** | Regex-looking literal recovery, count_only shape, scope echo, handles, `latency_class` |\n\n```text\nsearch_text(\n  query=...,\n  pattern_type=literal|regex,\n  path_regex=^src\u002F...,   # almost always\n  glob=..., files_with_matches=..., count_only=..., context_lines=...\n)\n→ read_match(handle, match_id) OR read_file(path, start_line, end_line)\n```\n\nUnscoped search may rank docs\u002Fspecs\u002Fskills before runtime — expected noise. Prefer runtime path scope for implementation questions.\n\n### Known symbol\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Known or strongly guessed function\u002Ftype\u002FAPI\u002Fclass\u002Ftrait\u002Fmodule name |\n| **Habit** | `rg -n \"fn name\"` or IDE go-to-def |\n| **Frigg path** | `search_symbol(name, path_class=runtime)` → **`go_to_definition(symbol=name)`** → proof |\n| **Fallback** | No hybrid or unscoped grep when name is known. Do **not** call `find_declarations` first (or serially by default) |\n| **Proof** | `read_match` or `read_file` (json\u002Fcitation if citing) |\n| **Done** | Starts at `search_symbol`; definition-first navigation with `symbol`, not path+line alone |\n| **Product support** | Runtime-first defaults, `column`\u002F`excerpt`, empty-`{}` rejection; both def\u002Fdecl tools kept for LSP parity; heuristic `mode` is valid |\n\n```text\nDEFAULT LOOP (stop after proof unless decl≠def is the actual question):\n1. search_symbol(name, path_class=runtime)  # prefer symbol + column from hit when present\n2. go_to_definition(symbol=name)            # body \u002F implementation anchor\n3. If path+line only was used: check ambiguous_location \u002F location_warning before editing\n4. read_match OR read_file\n5. If navigation mode is heuristic\u002Funavailable: still usable — do NOT install scip-* mid-task\n\nOPTIONAL BRANCH (not a numbered step after 2 by default):\n  find_declarations(symbol=name)\n  — only when declaration vs definition matters (headers, interfaces, re-exports, ambient decls)\n  — never run both serially as the default known-symbol loop\n\nBAD: go_to_definition + find_declarations every time and treat both rows as two anchors\nBAD: pause the agent loop to install rust-analyzer \u002F scip generators because precise is missing\nGOOD: go_to_definition(symbol=…) for body anchors; declarations only when decl≠def matters\nGOOD: treat NavigationMode heuristic as valid Frigg; precise is an upgrade when ready\n```\n\n### Impact\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Usages, callers, callees, trait impls for a known anchor |\n| **Habit** | Whole-repo `rg -n symbol`, manual dedupe |\n| **Frigg path** | Prefer `impact_bundle(target)` with a copied `target_ref`; or sequential symbol → target → refs → callers → impls |\n| **Fallback** | Scoped `search_text` may supplement tests; shell `rg` is not the main reference pass |\n| **Proof** | Read section-qualified proof targets; confirm separate `outgoing_calls` with body reads |\n| **Done** | Navigation evidence before edit or impact claim |\n| **Product support** | `sections[]` separates execution\u002Ftrust\u002Fcompleteness, plus section-qualified `proof_targets` and canonical `next_actions`; `summary` counts\u002Ftop_paths remain a compact projection. Test mentions require `include_test_mentions=true`; outgoing calls are not bundled. **Public thin composers** are `impact_bundle` (nav) and `search_batch` (multi-probe) — no further scenario bundles |\n\n```text\nPREFERRED: impact_bundle(target=\u003Ccopied target_ref>, path_class=runtime)\n  → if legacy symbol is ambiguous, select a target; no child section ran\n  → read sections[] first: execution is distinct from completeness and trust\u002Fmode\n  → follow a section proof_targets[].action_id through canonical next_actions[] + read_match\n  → include_test_mentions=true only for an exact test-path mention pass; zero is still an included section\n  \u002F\u002F full response_mode preserves the same sections\u002Factions truth\n  \u002F\u002F outgoing_calls remain separate\u002Fprovisional and require body confirmation\n\nOR sequential:\nsearch_symbol(anchor, path_class=runtime)\nfind_references(symbol, include_definition=false)\nincoming_calls(symbol)              # who calls — reliable\noutgoing_calls(symbol)              # trust=provisional (+ trust_note); confirm with read_file\nfind_implementations(symbol)        # traits\u002Finterfaces only\n```\n\n**Composition bar \u002F surface growth (EXP-when-to-grow-surface A):** a new public “bundle\u002Fservice”\ntool is justified only when orchestration **cannot** be a skill loop without shared handles and\nrecovery budgets (same class as `impact_bundle` \u002F `search_batch`). Prefer, in order:\n\n1. **Skill loop** over existing tools (symbol → text → hybrid → batch → proof)\n2. **Internal module \u002F policy \u002F ranking fix** (not agent-visible) when the miss is order\u002Fquality\n3. **Thin composer** (`impact_bundle`, `search_batch` class) when multi-primitive orchestration needs\n   shared handles\u002Frecovery the skill loop cannot share — not a substitute for fixing ranking (2)\n4. **New public tool** last; never tool-per-scenario (`review_bundle`, `bug_trace_bundle`, citation\n   services, packet MCP tools). Multi-claim review packets stay **skill-assembled**\n   (see Technical review + `frigg:\u002F\u002Fpolicy\u002Fevidence-packet.json`).\n\nDo **not** invent tools to “fix” harness registration, ranking, or host Grep order.\n\n### Files & outline\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Which files exist under a path, or outline a large file |\n| **Habit** | `find` \u002F `rg --files` \u002F scroll \u002F `rg -n \"^pub fn\"` |\n| **Frigg path** | `list_files(...)` or `document_symbols(path, top_level_only=true)` |\n| **Fallback** | Shell `find` only if Frigg down or path unindexed. Known name → `search_symbol`, not outline |\n| **Proof** | After pick, `read_file` \u002F `read_match` |\n| **Done** | No shell `find` for indexed listing when Frigg attached |\n| **Product support** | List\u002Foutline pagination, `resume_from`, top-level default |\n\n```text\nlist_files(glob='*.rs', path_regex='^src\u002Fcatalog\u002F')\ndocument_symbols(path, top_level_only=true)\n  → pick symbol line → read_match or read_file\n```\n\nPrefer anchored path filters (`^ontology\u002F`) over bare substrings (`ontology`).\n\n### Proof read\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Understand behavior after a search\u002Fnav hit (internal) |\n| **Habit** | Host Read with line prefixes |\n| **Frigg path** | Prefer `read_match(result_handle, match_id)`; else `read_file(path, start_line, end_line)` |\n| **Fallback** | Host Read acceptable only when needed outside Frigg scope |\n| **Proof** | Bounded source window from the source revision observed when the pair was issued |\n| **Done** | Internal proof stays on Frigg handles\u002Fpaths |\n| **Product support** | Revision-bound scoped handles; `STALE_HANDLE`, `MIXED_HANDLE`, and `STALE_PROOF_ANCHOR` failures |\n\n```text\nmatch_id is valid ONLY with its own result_handle from the SAME call.\nmatch_id is scoped: search:m1, symbols:m1, hybrid:m1, nav:m1 (never reuse across tools).\nhandle_scope + handle_expires=\"session\" mark the pairing lifetime.\n\nHandle lifetime (session-scoped, not a durable citation id):\n- Explicit reindex \u002F detach \u002F whole-repo cache wipe → handles for that repo drop (StaleHandle).\n- Watch refresh with a known dirty set → only anchors on **dirty paths** drop; untouched-path\n  bookmarks may still work. Known-empty success (noop refresh) does not wipe handles.\n- Unknown dirty set (notify drop, failed refresh) → whole-repo handle wipe (conservative).\n- After post-edit \u002F use_live_disk \u002F wait_for_refresh→ready for paths you care about:\n    **re-run search** before trusting an old result_handle for proof or citations.\n  Do not chain pre-edit handles across a freshness transition for those paths.\n\n`read_match` verifies the live source against the revision bound to the pair before returning\ncontent. If the source changed, was deleted, or cannot be verified, it returns\n`STALE_PROOF_ANCHOR` and no source bytes. Re-run the originating search\u002Fnavigation tool and use\nits new `result_handle` + `match_id`; do not retry the old pair. `read_file` is the explicit path\nfor current live content, not a way to refresh historical proof.\n\n`STALE_HANDLE` → the pair expired or was invalidated; re-run search.\n`MIXED_HANDLE` \u002F foreign `match_id` → use the matching handle from the same call; if the handle\nis known but the match vanished after a path-scoped watch drop, re-run search (do not treat it as\na cross-call mix-up alone).\nText mode returns raw source (no line prefixes) — fine for internal proof.\n```\n\n### Citation read\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | User-facing reply needs ` ```startLine:endLine:path``` ` |\n| **Habit** | Cursor\u002Fhost Read (`LINE\\|content`) |\n| **Frigg path** | `read_file` \u002F `read_match` with `presentation_mode=json` for `start_line`\u002F`end_line`; or `presentation_mode=citation` for `LINE\\|content` text |\n| **Fallback** | Host Read only when Frigg is unavailable |\n| **Proof** | Stable `start_line`\u002F`end_line` (json) or line-prefixed text (citation) |\n| **Done** | Citation has line metadata without abandoning Frigg for every internal read |\n| **Product support** | json + citation presentation modes, evidence packets |\n\n```text\nProof (internal): presentation_mode=text (default) — raw source, no prefixes.\nCitation (user-facing): presentation_mode=citation → \"306|pub fn catalog_entries...\"\nOr: presentation_mode=json → use start_line\u002Fend_line + path in ```start:end:path``` fences.\n```\n\n### Session gate\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Adoption, wrong repo, index health, or surprising zeros uncertain |\n| **Habit** | Assume cwd; grep when search feels wrong |\n| **Frigg path** | `workspace(path=\u003Crepo root>)` — **gate, not preamble** |\n| **Fallback** | Shell not a patch for unexplained zeros; check repo\u002Findex first |\n| **Proof** | After adoption\u002Fhealth, resume the real scenario tool |\n| **Done** | Workspace used when trust changes, not before every search |\n| **Product support** | `freshness.snapshot`, `freshness.continuous`, `freshness.post_edit`, dirty scope and per-tool\u002Fpath capabilities; legacy `recommended_action`\u002F`gate_hint`\u002F`fresh_enough_for`; `runtime.tools_exposed` |\n\n```text\nCall workspace(path=...) IF:\n  - wrong-repo paths, unexplained zeros, index errors, multi-repo ambiguity, post-edit freshness\nSkip workspace IF:\n  - first search hits expected paths and index is ready\n\nFreshness decision tree (authoritative; branch here before legacy fields):\n  1. snapshot=ready + dirty_scope=clean → use snapshot on HTTP or stdio; do not wait\n  2. ready + known dirty paths + leased continuous=debouncing|refreshing → wait_for_refresh;\n     brief wait, then re-check workspace\n  3. ready + dirty + continuous=mode_off|no_lease|retry_backoff|blocked|notify_degraded →\n     can_converge_by_waiting=false; live-disk reads for touched paths only, snapshot for untouched\n  4. snapshot=missing|uninitialized|error → run_cli_index (operator\u002FCLI)\n  5. snapshot=detached → adopt_repo; snapshot=unavailable → frigg_unavailable\u002Frecover service\n  6. Use exact canonical next_actions when returned; legacy recommended_action is compatibility only\n\n`wait_watch` is a legacy projection only of `wait_for_refresh`, never an independent wait reason.\nStdio is valid; default stdio often reports `mode_off`, so use live disk for touched paths or HTTP\nfor shared freshness. `read_match` is handle-generation-bound: after a touched edit, rerun its\nproducer and use its new pair before citation proof.\n\nrun_cli_index means index substrate not Ready:\n  - NOT a public MCP tool (tools\u002Flist has no reindex \u002F workspace_reindex)\n  - operator\u002FCLI: `frigg index` (or attach-side ensure \u002F operator lifecycle)\n  - read gate_hint when present; do not invent a write tool or shell-grep the repo \"to fix\" it\n\nTool surface honesty:\n  - Trust runtime.tools_exposed (or live tools\u002Flist) for this process\n  - Do not call names only in host schema caches, skill memory, or source #[tool] attributes\n  - tool_surface_profile is core|extended; **explore is core**; playbook tools only with `--features playbook` + extended\n  - On Task\u002Fsubagent spawn: re-probe Frigg registration before Frigg-first claims (see probe-on-spawn above)\n  - Missing Frigg on child while parent works → harness inheritance (FUT-003), not Frigg product P0\n\nPolicy progressive disclosure:\n  - Skill scenario cards are SSOT for agent routing\n  - MCP frigg:\u002F\u002Fpolicy\u002F* resources are secondary\u002Fmachine (hosts, support matrix, tool-surface)\n  - Do not treat resources as a second full skill\n\nInstall surfaces (avoid three-doc drift):\n  - **Skill** = sole scenario home (this file \u002F host skill path)\n  - **AGENTS.md** = lightweight pointer via `frigg adopt` (not a second skill)\n  - **ideas\u002Fflows** research = not production routing\n  - After monorepo skill changes: re-adopt managed blocks; reload host skill; `frigg adopt --check` in CI\n```\n\nVerify live `tools\u002Flist` \u002F `runtime.tools_exposed` before calling schema-only or extended-only tools.\n\n### Multi-repo\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | One Frigg (often HTTP) serves several repos; session default may differ |\n| **Habit** | Assume cwd; grep harder after zero |\n| **Frigg path** | `workspace(path=\u003Crepo root>)` then search\u002Fnav with `repository_id` when needed |\n| **Fallback** | Wrong-repo zero → adopt or explicit id, not shell grep |\n| **Proof** | Continue with exact\u002Fsymbol\u002Fnav after correct repo |\n| **Done** | Wrong-default searches are recoverable via workspace diagnostics |\n| **Product support** | Zero-hit names repository; multi-repo disambiguation on same-rank symbols; recovery suggests `workspace` \u002F `repository_id` |\n\n```text\nMulti-attach (common on HTTP):\n  - Prefer repository_id on impact_bundle \u002F nav when the symbol name is common across repos\n  - DISAMBIGUATION_REQUIRED + target_selection.candidates → pick repo via repository_id or path+line\n  - Do not invent federated cross-repo call graphs; one repo graph at a time\n  - Wrong-repo zero → workspace(path=...) recovery, not shell grep\n```\n\n### Post-edit\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Edited or created files; need index freshness for re-search |\n| **Habit** | Bypass index with Read or repo-wide grep |\n| **Frigg path** | `workspace()` → if ready for path, Frigg search; if stale\u002Funknown, **targeted** live read of **touched paths only** |\n| **Fallback** | Live-disk for **touched paths only** (`changed_paths_since_snapshot` \u002F known edit paths) — **never** a license for repo-wide shell grep |\n| **Proof** | Frigg after watch; else direct read of edited paths |\n| **Done** | Freshness visible; no default repo-wide shell verification |\n| **Product support** | `freshness` axes, `changed_paths_since_snapshot`, per-tool\u002Fpath capabilities, canonical `next_actions`; legacy compatibility fields |\n\n```text\n1. workspace() after edits\n2. If snapshot=ready and dirty_scope=clean → Frigg search on HTTP or stdio; never wait\n3. If post_edit=use_live_disk_for_touched_files → read_file \u002F host Read on **those paths only**\n4. If post_edit=wait_for_refresh → only leased debouncing\u002Frefreshing work can converge; wait\n   briefly, then re-check workspace. mode_off\u002Fno_lease\u002Fretry_backoff\u002Fblocked\u002Fnotify_degraded do\n   not wait: use touched-path live disk or HTTP\u002Foperator recovery.\n5. If post_edit=run_cli_index → CLI `frigg index` \u002F operator lifecycle (not an MCP tool); optional path-scoped live reads while index rebuilds\n6. **Handles after freshness:** do not `read_match` a pre-edit result_handle for touched paths.\n     Re-run the originating search_text \u002F search_symbol \u002F navigation tool after ready (or after\n     watch commits dirty paths) and use its new paired IDs. `STALE_PROOF_ANCHOR` is a\n     fail-closed proof result: it returns no historical bytes, and `read_file` is only the\n     explicit current-live-content path. Untouched-path handles may still resolve; treat that as\n     opportunistic, not guaranteed across reindex or whole-repo invalidation.\nBAD: workspace dirty → rg -n across the repo\nBAD: recommended_action=reindex → call invented MCP workspace_reindex\nBAD: mode_off \u002F no_lease → wait as if watch could converge\nBAD: post-edit → read_match(old_handle) for a file you just changed\nGOOD: workspace dirty → read_file(edited\u002Fpath.rs) or wait for hot-path watch refresh\nGOOD: wait_for_refresh only for leased debouncing\u002Frefreshing work; otherwise path-scoped live read\nGOOD: recommended_action=reindex → frigg index (CLI) or wait for operator; read gate_hint\nGOOD: after ready → new search → new result_handle → read_match\n```\n\n### Bug trace\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Test\u002Fcommand\u002Flog\u002Fstack\u002Fruntime failure |\n| **Habit** | `rg` error text + test name, then symbol grep |\n| **Frigg path** | Exact error\u002Ftest text → symbol → refs\u002Fcallers → proof |\n| **Fallback** | Hybrid only if no exact string. Shell owns build\u002Ftest **output**; source returns to Frigg |\n| **Proof** | Origin + caller\u002Freference witnesses via `read_match` |\n| **Done** | Failure text maps text → symbol → refs → proof |\n| **Product support** | Zero-hit reasons, navigation `mode` diagnostics |\n\n```text\n1. workspace(path=...) only if repo\u002Fadoption uncertain\n2. search_text(error fragment, path_regex='^(src|tests)\u002F')\n3. search_text(test_name) if test failure\n4. search_symbol(fn_from_stack, path_class=runtime)\n5. find_references \u002F incoming_calls\n6. read_match on strongest witness\n```\n\nIf navigation `mode` is unavailable\u002Fheuristic, widen with `search_text` before assuming code is absent.\nHeuristic nav is **valid product behavior** — precise SCIP is optional acceleration, not a gate on “Frigg works.”\n\n### Refactor impact\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Will change API\u002Ftype\u002Fbehavior; need blast radius before edit |\n| **Habit** | Whole-repo `rg` + manual sort |\n| **Frigg path** | Search a runtime symbol, copy its `target_ref`, then prefer `impact_bundle(target)`; or use sequential refs → impls → callers → optional test pass |\n| **Fallback** | No throwaway shell `rg` on indexed source; use scoped `search_text` for extra textual passes |\n| **Proof** | Read section-qualified proof targets, then replay their canonical `next_actions` before editing |\n| **Done** | Target-first blast radius with section-qualified source witnesses |\n| **Product support** | `sections[]` keeps execution, trust, and completeness distinct; exact test evidence is opt-in; outgoing calls stay separate\u002Fprovisional |\n\n```text\nPREFERRED:\n1. search_symbol(api, path_class=runtime)\n2. copy the selected row's target_ref unchanged\n3. impact_bundle(target=\u003Ccopied target_ref>, path_class=runtime)\n4. read sections[] for execution, trust, and completeness before summary counts\n5. use section-qualified proof_targets with canonical next_actions; add include_test_mentions=true only when test evidence is needed\nOR:\n1. search_symbol(api, path_class=runtime)\n2. find_references(symbol, include_definition=false)\n3. find_implementations if trait\u002Finterface\n4. incoming_calls for caller graph\n5. search_text(symbol, path_regex='(?:^|\u002F)(?:test|tests)\u002F') when tests matter\n6. read_match on each cluster\n```\n\n### Technical review\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Review change, PR, or subsystem for behavioral risk |\n| **Habit** | Diff skim, grep symbols, manual callers\u002Ftests |\n| **Frigg path** | Behavioral anchors + changed APIs → refs\u002Fcallers → proof clusters → tests pass |\n| **Fallback** | `git diff` and build\u002Ftest stay shell; source impact returns to Frigg |\n| **Proof** | Every finding has path\u002Fline witness; prefer skill-assembled evidence packets |\n| **Done** | Findings grounded in Frigg evidence, not shell grep transcripts |\n| **Product support** | Citation reads; skill-side evidence packet shape (+ `frigg:\u002F\u002Fpolicy\u002Fevidence-packet.json`); types `EvidencePacket*` are **not** a tool |\n\n```text\nsearch_text(behavioral anchors, path_regex='^src\u002F')\nsearch_symbol(changed APIs, path_class=runtime)\nfind_references \u002F incoming_calls\nread_match on affected clusters\nsearch_text(changed API, path_regex='^tests\u002F') when tests matter\n```\n\nTrust order for review:\n\n1. `search_text` — narrative anchors  \n2. `read_file` \u002F `read_match` + defs\u002Frefs — proof  \n3. `search_structural` — awkward AST evidence (tier-3)  \n4. `incoming_calls` — call-flow hint  \n5. `outgoing_calls` — always `trust=provisional` + `trust_note` on the wire; confirm edges with body reads (does not upgrade wire trust to verified)\n\n**Evidence packets are skill composition, not an MCP tool.** Frigg supplies witnesses\n(search\u002Fnav\u002Fread). Agents assemble multi-claim JSON for review\u002Fsecurity reports.\nThere is no `compose_evidence_packet` (or sealed server packet) on the public surface.\nMachine schema: MCP resource `frigg:\u002F\u002Fpolicy\u002Fevidence-packet.json`. Rust types\n`EvidencePacket` \u002F `EvidencePacketClaim` mirror the shape for hosts only.\n\nEvidence packet shape (multi-claim answers) — every review\u002Fsecurity finding needs path\u002Fline witnesses:\n\n```json\n{\n  \"claims\": [\n    {\n      \"claim\": \"catalog_entries registers callable operations\",\n      \"tool\": \"search_symbol\",\n      \"path\": \"src\u002Fcatalog\u002Fmod.rs\",\n      \"start_line\": 40,\n      \"end_line\": 72,\n      \"match_id\": \"symbols:m1\",\n      \"result_handle\": \"...\"\n    },\n    {\n      \"claim\": \"caller reaches catalog_entries from the HTTP surface\",\n      \"tool\": \"incoming_calls\",\n      \"path\": \"src\u002Fhttp\u002Froutes.rs\",\n      \"start_line\": 88,\n      \"end_line\": 110,\n      \"match_id\": \"nav:m2\",\n      \"result_handle\": \"...\"\n    }\n  ]\n}\n```\n\n### Security sweep\n\n| Field | Content |\n| --- | --- |\n| **Trigger** | Class of risky patterns (unsafe paths, exec, credentials, untrusted input) |\n| **Habit** | Many parallel regex `rg` probes |\n| **Frigg path** | Prefer `search_batch` of text\u002Fsymbol\u002F(optional hybrid) probes; interim parallel Frigg probes; then witnesses + refs |\n| **Fallback** | Generated\u002Fvendor\u002Fbuild artifacts may need shell when explicitly in scope; indexed source stays on Frigg |\n| **Proof** | Each candidate: source witness; sink → refs\u002Fcallers when relevant; evidence packet when reporting |\n| **Done** | Broad parallel probes without leaving Frigg for shell on indexed source |\n| **Product support** | Safe-regex diagnostics, batch summaries, path_class filters, evidence packets |\n\n```text\nsearch_batch([\n  text regex probes scoped to runtime,\n  symbol probes for known sinks,\n  optional hybrid for vague concepts\n])   # interim: parallel search_text \u002F search_symbol\n→ read_match on witnesses\n→ find_references \u002F incoming_calls for validated sinks\n```\n\n---\n\n## Structural search and explore (tier-3)\n\nDo **not** put these on the main discovery path.\n\n**Structural** — expert syntax-shape evidence only:\n\n```text\ndocument_symbols or read_file on a representative file\n  → inspect_syntax_tree(line AND column; column: 1 if unknown)\n  → search_structural from real node kinds\n```\n\n- Known name? Use `search_symbol`, not `document_symbols`.\n- Do not write Tree-sitter queries for ordinary symbol or text search.\n- Opt-in: `include_follow_up_structural=true` for replayable `search_structural` suggestions on structure-aware tools (not hybrid\u002Fsymbol search).\n\n**Explore** (core product surface, tier-3 for routing) — **anchored in-file only**:\n\n```text\nUse explore after you already have a file anchor.\nprobe\u002Frefine scan inside one file.\nzoom reads a bounded source window.\nFor cross-repo search, use search_text \u002F search_symbol \u002F search_hybrid.\n```\n\n`explore zoom` may nest content under structured `window` fields in JSON mode — prefer `read_file` \u002F `read_match` for ordinary proof.\n\n---\n\n## Default loop (compact)\n\n1. Omit `repository_id` in single-repo work unless multi-repo or wrong default.\n2. Pick scenario from the table — do not default to grep.\n3. Search tier: **symbol** (known name) → **text** (known string) → **hybrid** (vague only) → **batch\u002Fparallel** (several guesses).\n4. Compact responses first; `response_mode=full` only for ranking diagnostics. Compact and full responses carry identical executable `next_actions` data; `suggested_next` is only a deprecated lossy compatibility projection.\n5. Navigate with a copied row **`target_ref`** in `target` when one is present; use direct `symbol` or location input only for ad-hoc\u002Fcompatibility calls.\n6. Proof: `read_match` → `read_file`.\n7. Cite: json\u002Fcitation `read_file` or host Read when required.\n8. Structure\u002Fexplore only as tier-3 after anchors exist.\n\n---\n\n## Compact response rules\n\n- `result_handle` + `match_id` → `read_match` (**same call only**; scoped ids like `search:m1`).\n- Text-first `read_file` \u002F `read_match` \u002F `explore(zoom)`: no line prefixes in text mode.\n- `presentation_mode=json` when you need `start_line`, `end_line`, bytes, or machine-readable fields.\n- Hybrid compact may omit rich scores and semantic readiness dumps — still read `ranking_note`:\n  - `lexical_only (semantic not contributing)` means mode cliff (default-off or empty semantic), not “Frigg failed”\n  - `hybrid graph is ranking signal (not nav call edges)` means graph channel ≠ `incoming_calls` \u002F SCIP nav — confirm with exact tools; optional per-match `graph_mode` (`projection` \u002F `heuristic_symbol_graph` \u002F `heuristic_implementation` \u002F `unknown`)\n  - Pivot to exact tools; do not shell-grep indexed source\n- Prefer `latency_class` guidance when present (`hot` \u002F `warm` \u002F `cold`); do not use shell as a latency strategy on indexed source.\n\n---\n\n## Decision table\n\n| Situation | Tool |\n| --- | --- |\n| Git \u002F build \u002F generated \u002F unindexed \u002F Frigg down | shell |\n| Several guesses at once | `search_batch` (prefer); parallel Frigg probes only if batch missing |\n| Vague “where is X?” | `search_hybrid` → exact pivot |\n| Known identifier | `search_symbol` (`path_class=runtime`) |\n| Known string \u002F regex \u002F rg-shaped | `search_text` |\n| File listing | `list_files` |\n| File outline | `document_symbols` |\n| Proof after search | `read_match`, then `read_file` |\n| User citation | `read_file` json\u002Fcitation or host Read |\n| References \u002F callers | `find_references`, `incoming_calls` |\n| Callees | `outgoing_calls` (`trust=provisional`; confirm with read) |\n| Trait \u002F interface impls | `find_implementations` |\n| Definition \u002F body anchor | `go_to_definition(symbol=...)` (default; not path+line alone; trust `ambiguous_location`) |\n| Declaration-only need | `find_declarations` only when decl≠def matters — not a serial default with go_to_definition |\n| AST shape | `inspect_syntax_tree` + `search_structural` (tier-3) |\n| In-file zoom (core) | `explore` — not a substitute for `search_text` |\n| Repo health \u002F adoption | `workspace` gate |\n\n---\n\n## Deep references\n\nParameter exhaustiveness and extended surfaces — open only after routing:\n\n- [references\u002Fdiscovery-and-evidence.md](references\u002Fdiscovery-and-evidence.md) — `list_files`, `search_*`, `read_*`, `explore`\n- [references\u002Fnavigation-and-structure.md](references\u002Fnavigation-and-structure.md) — defs, refs, calls, outline, structural\n- [references\u002Fworkflows.md](references\u002Fworkflows.md) — extended narrative loops (aligned with scenario cards above)\n- [references\u002Fworkspace-and-runtime.md](references\u002Fworkspace-and-runtime.md) — `workspace`, adoption, runtime\n- [references\u002Fextended-tools.md](references\u002Fextended-tools.md) — only after verifying live `tools\u002Flist` \u002F `runtime.tools_exposed`\n- Live machine surface (not inventory freezes): MCP `frigg:\u002F\u002Fpolicy\u002Ftool-surface.json`\n- Evidence packet schema (skill composition only): MCP `frigg:\u002F\u002Fpolicy\u002Fevidence-packet.json`\n- Embedding model defaults \u002F pad \u002F offline facts + soft presets (`offline-small` = MiniLM **offline_smoke**; `cloud-google` = Gemini **credential_peer**; `cloud-openai` \u002F `openai-compat-selfhost`) — curated catalog (no public leaderboard); not CLI aliases: MCP `frigg:\u002F\u002Fpolicy\u002Fsemantic-models.json`\n",{"name":5,"version":44,"description":7},1783468800000,"main","af444af4922d2c204d0846744be65a19194ac3c9","skills\u002Ffrigg-first-code-search",1,"https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg","https:\u002F\u002Ffrigg.bnomei.com","https:\u002F\u002Fgithub.com\u002Fbnomei","https:\u002F\u002Fbnomei.github.io","Bachelor in Interaction Design ZHdK, Freelance Webdeveloper and Systems Builder\r\n(German\u002FEnglish)","2026-10-06 01:40:18",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add bnomei\u002Ffrigg --skill frigg-first-code-search",{"tool":61,"command":62},"bunx","bunx skills add bnomei\u002Ffrigg --skill frigg-first-code-search",{"tool":64,"command":65},"pnpm","pnpm dlx skills add bnomei\u002Ffrigg --skill frigg-first-code-search","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg\u002Fblob\u002Fmain\u002Fskills\u002Ffrigg-first-code-search\u002FSKILL.md",true,[69,75,79,83,87,91,95,99,103,107,111,115],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},".claude-plugin\u002Fplugin.json","REFERENCE","参考文档",633,"https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg\u002Fblob\u002Fmain\u002Fskills\u002Ffrigg-first-code-search\u002F.claude-plugin\u002Fplugin.json",{"path":76,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":77,"sourceHtmlUrl":78},".mcp.json",111,"https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg\u002Fblob\u002Fmain\u002Fskills\u002Ffrigg-first-code-search\u002F.mcp.json",{"path":80,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":81,"sourceHtmlUrl":82},"agents\u002Fopenai.yaml",1179,"https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg\u002Fblob\u002Fmain\u002Fskills\u002Ffrigg-first-code-search\u002Fagents\u002Fopenai.yaml",{"path":84,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":85,"sourceHtmlUrl":86},"example.html",3549,"https:\u002F\u002Fgithub.com\u002Fendman100\u002Fskill-router-nexus\u002Fblob\u002Fmain\u002FVideo-Generation\u002Fopen-design-vfx-text-cursor\u002Fexample.html",{"path":88,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":89,"sourceHtmlUrl":90},"hooks\u002Fhooks.json",262,"https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg\u002Fblob\u002Fmain\u002Fskills\u002Ffrigg-first-code-search\u002Fhooks\u002Fhooks.json",{"path":92,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":93,"sourceHtmlUrl":94},"mcp.json",534,"https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg\u002Fblob\u002Fmain\u002Fskills\u002Ffrigg-first-code-search\u002Fmcp.json",{"path":96,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":97,"sourceHtmlUrl":98},"open-design.json",5695,"https:\u002F\u002Fgithub.com\u002Fendman100\u002Fskill-router-nexus\u002Fblob\u002Fmain\u002FVideo-Generation\u002Fopen-design-vfx-text-cursor\u002Fopen-design.json",{"path":100,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":101,"sourceHtmlUrl":102},"references\u002Fdiscovery-and-evidence.md",16514,"https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg\u002Fblob\u002Fmain\u002Fskills\u002Ffrigg-first-code-search\u002Freferences\u002Fdiscovery-and-evidence.md",{"path":104,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":105,"sourceHtmlUrl":106},"references\u002Fextended-tools.md",1733,"https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg\u002Fblob\u002Fmain\u002Fskills\u002Ffrigg-first-code-search\u002Freferences\u002Fextended-tools.md",{"path":108,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":109,"sourceHtmlUrl":110},"references\u002Fnavigation-and-structure.md",11586,"https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg\u002Fblob\u002Fmain\u002Fskills\u002Ffrigg-first-code-search\u002Freferences\u002Fnavigation-and-structure.md",{"path":112,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":113,"sourceHtmlUrl":114},"references\u002Fworkflows.md",5444,"https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg\u002Fblob\u002Fmain\u002Fskills\u002Ffrigg-first-code-search\u002Freferences\u002Fworkflows.md",{"path":116,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":117,"sourceHtmlUrl":118},"references\u002Fworkspace-and-runtime.md",11293,"https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg\u002Fblob\u002Fmain\u002Fskills\u002Ffrigg-first-code-search\u002Freferences\u002Fworkspace-and-runtime.md",[120],{"skillNo":121,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":39},"01M6CYMX5CWPH432QKW1Z87CYS","https:\u002F\u002Fgithub.com\u002Fbnomei\u002Ffrigg\u002Fblob\u002Fmain\u002Fcrates\u002Fcli\u002Ftests\u002Ffixtures\u002Ffutura_dogfood\u002Fskills\u002Ffrigg-first-code-search\u002FSKILL.md",[],[20,22,23,21,19]]