Research: Local Document Router W-9 index-miss — critique, patch, and tests
We are building a private local Document Router for my own Mac and business files. I need you to help solve one specific engineering problem, not redesign the whole system.
Current architecture:
ChatGPT = command center / reasoning
Hermes + local agent = persistent local execution
Mac local search scope =
~/Desktop,~/Downloads,~/DocumentsDainty business identities:
- legal entity:
DAINTY SOLUTIONS GROUP LLC- DBA:
Dainty Touch Estate SolutionsProblem: A local indexed search returned zero results for a W-9 that definitely existed in Downloads. Direct directory inspection found:
IRS_Form_W-9_Rev_December_2014.pdfIRS_Form_W-9_Rev_December_2014 (1).pdfVendorLinkFile.xlsxVendorLinkZipFile.zipThe correct system behavior should be:
- Search Desktop → Downloads → Documents.
- Never treat a single indexed-search miss as authoritative when workflow context strongly suggests the document exists.
- Expand the search using filename variants, canonical form/document language, legal entity/DBA names, workflow terms, vendor/platform names, related artifacts, timestamps, and co-location.
- Fall back to direct directory enumeration when the index misses.
- Inspect candidate content safely.
- Rank candidates by entity match, workflow fit, populated-vs-template indicators, recency, and nearby related files.
- Never expose or log SSN/EIN/TIN values.
I already have a rough Node.js inspector prototype using
fs,path, andpdf-parse.Your job:
Critique the architecture and prototype only where technically necessary.
Identify concrete failure modes or bugs.
Recommend the smallest production-ready implementation.
Give exact code changes or a replacement implementation where needed.
Include tests for:
- indexed search miss
- fallback direct enumeration
- W-9 candidate near VendorLink artifacts
completed business form ranking above blank/template
no sensitive tax values in logs/output
symlink/path traversal protection
fair searching of all three roots so Desktop cannot consume the entire candidate cap
Do not suggest public GitHub issues, cloud architecture, or unrelated redesigns.
Return only:
- Critical defects
- Recommended implementation
- Code/patch
- Acceptance tests
- Anything that would block production use
Bring me what it gives you. I’ll extract the useful engineering pieces, reject anything that doesn’t fit our architecture, and turn the result into the next implementation step.
Source: openai/skills