Drive File Search — context-aware related-file surfacing
FILE-level asks only; domain-catalog asks belong to ecosystem-data-sources.
Procedure
Extract context (full detail + worked walkthrough:
references/context-extraction.md). Signals: repo; issue title/labels; domain via keywords read live from.claude/hooks/ecosystem-domain-map.json(generated — never hand-copy its keywords here); artifact-type hints (calcs → xlsx/py/csv; CAD → dwg/ipt/step; standards → pdf; simulation → dat/sim/yml/owr).Build the query — 2–5 deduped terms (domain keyword + 1–3 title words). Pass
--domain <d>only if<d>appears in adomains:list inconfig/drive-index-registry.yml; else fold the domain word into the terms (unknown--domain= empty selection, exit 0).Run the ONE command (read-only):
uv run python scripts/data/drive-index-search/search.py "<terms>" [--domain <d>] --json --limit 20 --caller skill(
python3if uv is broken.)Branch on exit code:
0— parse the JSON envelope (covers partial and empty results — always checkcoverage_gaps).2— registry error OR zero reachable indexes: name the down indexes/drives, point toscripts/setup/canonical-drive-links.sh(PR #3341 if absent), offerecosystem-data-sourcesas fallback.- CLI missing — cite issue #3335, fall back to
ecosystem-data-sources; never run ad-hoc drive crawls (bounded reads only).
Present top 10. Per result:
canonical_path,source_index,score,rank_basis(meta.*optional;raw_pathnever shown). Show the canonical/mnt/...path; why relevant: matched terms,rank_basis, extension-vs-hint (reorder within equal scores only); source index + freshness caveat from the registry'sfreshness/built_at("freshness unknown" if absent). Quote eachcoverage_gapsreasonVERBATIM (opaque free text — never paraphrase); name the excluded drive. Offer three next actions: open one listed file (bounded read); record chosen paths under "Documents consulted" in the plan's Resource Intel section; refine terms, re-run once.
Guardrails (never violate)
- Read-only: never write to
/mnt/aceor/mnt/dde; the CLI opens indexes read-only. - De-identification (public repo): drive paths embed client names/project codes. Before quoting a surfaced path into an issue, plan, PR, or commit, scan for client tokens; if found, describe as metadata only ("a past deliverable on /mnt/ace") or redact. In-session display is fine; persisting into public artifacts is the gated act. De-id stays on lane:claude.
- Unreachable drive is normal: present partial results plus the coverage_gaps caveat; never mount, never sudo.
- Usage playbook (#3340): integration points, freshness authority, metrics, and
de-id checklist:
docs/guides/drive-file-search-playbook.md.
Related: ecosystem-data-sources (DATA/domain-catalog level).