hyperresearch 0.3.0__tar.gz → 0.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. hyperresearch-0.7.0/.gitignore +30 -0
  2. hyperresearch-0.7.0/CHANGELOG.md +169 -0
  3. hyperresearch-0.7.0/PKG-INFO +397 -0
  4. hyperresearch-0.7.0/README.md +357 -0
  5. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/pyproject.toml +2 -2
  6. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/__init__.py +1 -1
  7. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/config_cmd.py +3 -4
  8. hyperresearch-0.7.0/src/hyperresearch/cli/fetch.py +611 -0
  9. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/graph.py +4 -2
  10. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/install.py +6 -19
  11. hyperresearch-0.7.0/src/hyperresearch/cli/lint.py +1472 -0
  12. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/main.py +2 -3
  13. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/note.py +163 -10
  14. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/repair.py +3 -2
  15. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/search.py +27 -0
  16. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/setup.py +6 -52
  17. hyperresearch-0.7.0/src/hyperresearch/core/agent_docs.py +201 -0
  18. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/core/db.py +18 -3
  19. hyperresearch-0.7.0/src/hyperresearch/core/hooks.py +2025 -0
  20. hyperresearch-0.7.0/src/hyperresearch/core/migrations.py +171 -0
  21. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/core/note.py +19 -7
  22. hyperresearch-0.7.0/src/hyperresearch/core/patterns.py +94 -0
  23. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/core/sync.py +25 -9
  24. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/core/vault.py +18 -3
  25. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/models/note.py +29 -0
  26. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/search/filters.py +10 -0
  27. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/search/fts.py +4 -1
  28. hyperresearch-0.7.0/src/hyperresearch/skills/research-collect.md +136 -0
  29. hyperresearch-0.7.0/src/hyperresearch/skills/research-compare.md +177 -0
  30. hyperresearch-0.7.0/src/hyperresearch/skills/research-forecast.md +169 -0
  31. hyperresearch-0.7.0/src/hyperresearch/skills/research-layercake.md +512 -0
  32. hyperresearch-0.7.0/src/hyperresearch/skills/research-synthesize.md +225 -0
  33. hyperresearch-0.7.0/src/hyperresearch/skills/research.md +965 -0
  34. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/web/crawl4ai_provider.py +30 -15
  35. hyperresearch-0.7.0/tests/test_cli/test_lint.py +1413 -0
  36. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/test_cli/test_note_ops.py +49 -0
  37. hyperresearch-0.7.0/tests/test_core/test_hooks.py +355 -0
  38. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/test_core/test_note.py +38 -1
  39. hyperresearch-0.7.0/tests/test_core/test_patterns.py +145 -0
  40. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/test_core/test_sync.py +27 -0
  41. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/test_core/test_vault.py +12 -5
  42. hyperresearch-0.3.0/.gitignore +0 -15
  43. hyperresearch-0.3.0/CHANGELOG.md +0 -103
  44. hyperresearch-0.3.0/PKG-INFO +0 -188
  45. hyperresearch-0.3.0/README.md +0 -148
  46. hyperresearch-0.3.0/src/hyperresearch/cli/fetch.py +0 -335
  47. hyperresearch-0.3.0/src/hyperresearch/cli/lint.py +0 -212
  48. hyperresearch-0.3.0/src/hyperresearch/core/agent_docs.py +0 -422
  49. hyperresearch-0.3.0/src/hyperresearch/core/hooks.py +0 -367
  50. hyperresearch-0.3.0/src/hyperresearch/core/migrations.py +0 -80
  51. hyperresearch-0.3.0/src/hyperresearch/core/patterns.py +0 -12
  52. hyperresearch-0.3.0/src/hyperresearch/skills/research.md +0 -252
  53. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/.github/workflows/ci.yml +0 -0
  54. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/.github/workflows/publish.yml +0 -0
  55. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/CONTRIBUTING.md +0 -0
  56. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/LICENSE +0 -0
  57. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/assets/banner.png +0 -0
  58. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/__main__.py +0 -0
  59. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/__init__.py +0 -0
  60. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/_output.py +0 -0
  61. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/assets.py +0 -0
  62. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/batch.py +0 -0
  63. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/dedup.py +0 -0
  64. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/export.py +0 -0
  65. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/fetch_batch.py +0 -0
  66. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/git_cmd.py +0 -0
  67. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/import_cmd.py +0 -0
  68. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/index.py +0 -0
  69. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/link.py +0 -0
  70. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/mcp_cmd.py +0 -0
  71. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/research.py +0 -0
  72. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/serve.py +0 -0
  73. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/sources.py +0 -0
  74. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/tag.py +0 -0
  75. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/template.py +0 -0
  76. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/topic.py +0 -0
  77. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/cli/watch.py +0 -0
  78. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/core/__init__.py +0 -0
  79. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/core/config.py +0 -0
  80. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/core/enrich.py +0 -0
  81. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/core/fetcher.py +0 -0
  82. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/core/frontmatter.py +0 -0
  83. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/core/linker.py +0 -0
  84. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/core/similarity.py +0 -0
  85. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/core/templates.py +0 -0
  86. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/export/__init__.py +0 -0
  87. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/graph/__init__.py +0 -0
  88. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/indexgen/__init__.py +0 -0
  89. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/indexgen/generator.py +0 -0
  90. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/mcp/__init__.py +0 -0
  91. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/mcp/server.py +0 -0
  92. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/models/__init__.py +0 -0
  93. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/models/graph.py +0 -0
  94. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/models/output.py +0 -0
  95. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/models/search.py +0 -0
  96. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/py.typed +0 -0
  97. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/search/__init__.py +0 -0
  98. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/serve/__init__.py +0 -0
  99. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/serve/renderer.py +0 -0
  100. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/serve/server.py +0 -0
  101. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/skills/__init__.py +0 -0
  102. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/web/__init__.py +0 -0
  103. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/web/base.py +0 -0
  104. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/src/hyperresearch/web/builtin.py +0 -0
  105. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/__init__.py +0 -0
  106. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/conftest.py +0 -0
  107. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/test_cli/__init__.py +0 -0
  108. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/test_cli/test_commands.py +0 -0
  109. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/test_core/__init__.py +0 -0
  110. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/test_core/test_frontmatter.py +0 -0
  111. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/test_graph/__init__.py +0 -0
  112. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/test_graph/test_links.py +0 -0
  113. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/test_search/__init__.py +0 -0
  114. {hyperresearch-0.3.0 → hyperresearch-0.7.0}/tests/test_search/test_fts.py +0 -0
@@ -0,0 +1,30 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .venv/
7
+ .idea/
8
+ *.db
9
+ .hyperresearch/
10
+ .pytest_cache/
11
+ .mypy_cache/
12
+ .ruff_cache/
13
+ *.egg
14
+ .env
15
+ bench/
16
+ codex_bench/
17
+
18
+ # Agent install outputs — generated per-user by `hyperresearch install`.
19
+ # These files contain absolute paths resolved to the installing user's
20
+ # Python environment. NEVER commit them. The authoritative versions live
21
+ # in src/hyperresearch/skills/ (skills) and src/hyperresearch/core/hooks.py
22
+ # (agent templates).
23
+ .claude/
24
+ CLAUDE.md
25
+ AGENTS.md
26
+ GEMINI.md
27
+
28
+ # Per-vault research output
29
+ research/
30
+
@@ -0,0 +1,169 @@
1
+ # Changelog
2
+
3
+ ## [0.7.0] - 2026-04-17
4
+
5
+ ### Architecture — `/research-ensemble` retired, `/research-layercake` introduced
6
+
7
+ This release replaces the three-parallel-drafts-plus-merger ensemble design with a seven-phase layered pipeline. Width is discovered first, depth loci are derived from the width corpus (not pre-assigned framings), one draft is written from the combined evidence, three adversarial critics run in parallel against it, and the draft is then modified ONLY by surgical Edit hunks — never regenerated.
8
+
9
+ ### New
10
+
11
+ - **7-phase layercake pipeline** — (1) width sweep via parallel fetchers, (2) two parallel loci-analysts identify 1–8 depth loci from the corpus, (3) one depth-investigator per locus writes an `interim-<locus>.md` note, (4) orchestrator writes ONE draft, (5) dialectic / depth / width critics return structured findings JSONs, (6) the patcher applies findings as Edit hunks, (7) the polish auditor cuts filler and strips hygiene leaks via more Edit hunks. Protocol lives at `.claude/skills/research-layercake/SKILL.md`.
12
+ - **Tool-locked patcher + polish auditor** — both agents register with tools `[Read, Edit]` ONLY. They physically cannot Write. Every hunk is capped at 500 chars of net expansion — any critic that proposes a larger patch escalates to the orchestrator instead of triggering a rewrite. This is the load-bearing invariant that enforces PATCH-NOT-REGEN at the tool level, not the prompt level.
13
+ - **`NoteType.INTERIM`** — new first-class note type for depth-investigator outputs. Persisted in the vault with `type: interim` and tagged `locus-<name>` for indexability. Added to the SQLite CHECK constraint via migration v7.
14
+ - **`locus-coverage` lint rule** — reads `research/loci.json` (Layer 2 output) and verifies every identified locus has a corresponding interim-report note. Missing interims flag as errors.
15
+ - **`patch-surgery` lint rule** — reads `research/patch-log.json` (Layer 6 output) and surfaces any critical finding the patcher skipped. The 500-char "patch too large" regeneration guard is also surfaced at warning severity.
16
+ - **`instruction-coverage` lint rule** — reads `research/prompt-decomposition.json` and verifies every atomic item (entity, required format) appears in the final report. Catches drafts that drifted from the user's explicit ask.
17
+ - **Layer 0.5 — prompt decomposition** — new orchestrator step before Layer 1 produces `research/prompt-decomposition.json`, a structured breakdown of the atomic items the user's prompt named (sub-questions, entities, required formats, required sections, time horizons, scope conditions). This becomes a first-class contract that flows through Layer 4 drafting and Layer 5 instruction-critique.
18
+ - **`hyperresearch-instruction-critic`** — fourth adversarial critic (Opus, `[Bash, Read]` only). Reads the Layer 4 draft against the prompt-decomposition and emits findings for missing / under-covered / mis-ordered / mis-formatted atomic items. Spawned in parallel with dialectic / depth / width critics in Layer 5.
19
+ - **Pipeline-awareness contract** — every subagent now receives the verbatim research_query AND an explicit pipeline-position statement in its Task prompt. The skill file documents the three-piece spawn contract (research_query / pipeline position / inputs) and provides a copy-paste template so the orchestrator applies it consistently to every Task call.
20
+ - **Schema v7 migration** — safely rebuilds the `notes` table with `'interim'` added to the type CHECK constraint on existing vaults.
21
+
22
+ ### Removed
23
+
24
+ - **`/research-ensemble` skill** — the three-parallel-sub-run ensemble protocol is gone. The slash command no longer registers.
25
+ - **Retired subagents** — `hyperresearch-analyst`, `hyperresearch-auditor`, `hyperresearch-rewriter`, `hyperresearch-subrun`, `hyperresearch-merger` are no longer installed. On reinstall, any vault that had them gets them pruned automatically by `_prune_retired_agents()`.
26
+ - **`analyst-coverage` lint rule** — superseded by `locus-coverage` (extracts were the ensemble era's per-source deep-read artifact; interim notes are the layercake equivalent scoped per locus).
27
+
28
+ ### New subagent roster (9 agents)
29
+
30
+ | Agent | Model | Tools | Role |
31
+ |---|---|---|---|
32
+ | `hyperresearch-fetcher` | Haiku | Bash, Read | URL → vault note (unchanged) |
33
+ | `hyperresearch-loci-analyst` | Sonnet | Bash, Read, Write | Returns 1–8 depth loci from width corpus |
34
+ | `hyperresearch-depth-investigator` | Sonnet | Bash, Read, Write, Task | Investigates one locus, writes one interim note |
35
+ | `hyperresearch-dialectic-critic` | Opus | Bash, Read | Finds counter-evidence gaps |
36
+ | `hyperresearch-depth-critic` | Opus | Bash, Read | Finds shallow spots |
37
+ | `hyperresearch-width-critic` | Opus | Bash, Read | Finds topical coverage gaps |
38
+ | `hyperresearch-instruction-critic` | Opus | Bash, Read | Finds atomic items the draft missed from prompt-decomposition |
39
+ | `hyperresearch-patcher` | Sonnet | **Read, Edit** | Applies critic findings as Edit hunks |
40
+ | `hyperresearch-polish-auditor` | Sonnet | **Read, Edit** | Cuts filler + strips hygiene leaks |
41
+
42
+ ### Breaking changes
43
+
44
+ - Scripts calling `hyperresearch install` on a pre-v0.7 vault will get the old agent files pruned. Pre-existing `research/audit_findings.json` and extract notes stay in the vault (no user data is deleted) but the protocol no longer references them.
45
+ - `analyst-coverage` in `hyperresearch lint --rule ...` is gone — use `locus-coverage` and `patch-surgery`.
46
+ - The `benchmark-report` lint rule is renamed to `wrapper-report`. The rule's logic is unchanged — it fires whenever `research/prompt.txt` or `research/wrapper_contract.json` is present and enforces the wrapper's contract on the final report. The rename reflects what the rule actually does (wrapper-contract enforcement) rather than the specific harness context where it was first used.
47
+
48
+ ## [0.4.0] - 2026-04-13
49
+
50
+ ### New
51
+
52
+ - **Request-type classification (Step 0)** — The research workflow now starts by classifying the user's request into one of 7 types (Canonical Knowledge Retrieval, Market / Landscape Mapping, Engineering / Technical How-To, Interpretive / Humanities Analysis, Comparative Evaluation, Emerging / Cutting-Edge Research, Forecast / Strategy / Recommendation) plus a General fallback. Classification happens before any searching and governs the rest of the workflow.
53
+ - **Type-specific parameter blocks** — Each of the 7 types specifies its own source strategy (count + primary/secondary mix), target length, opening-section shape, H2 heading count, analytical mode, and special rules. A humanities analysis wants 6–10 long thematic sections; a market landscape wants 8–14 vendor-cluster sections with a mandatory comparison matrix; a cutting-edge research request wants primary-heavy preprint reading with a "What we don't know yet" section. One workflow, seven parameterizations.
54
+ - **Primary-heavy vs. secondary-heavy source policy** — New explicit axis: Types 1/4/5/6 are primary-heavy (cite originals, engage deeply, prune irrelevant secondary coverage), Types 2/7 are secondary-heavy (triangulate across many descriptions), Type 3 is balanced. Source count is now a function of request type, not topic complexity.
55
+ - **Conceptual scaffold step (before writing)** — Agent must answer four questions in a scratch file before drafting: the hard question, the naive answer, the structural tension, and a dependency-ordered heading sketch. The final report's opening section must be a framework section, not a definition.
56
+ - **Cross-source comparison step** — Before writing the body, agent finds 3–5 places where sources actually disagree and captures short comparison blocks. Sources earn citations by being compared, not listed. These become the backbone of body sections.
57
+ - **Writing-draft hard constraints** — Target 400–600 words per H2, 12–20 H2s on a 10K-word report, never one-section-per-source, every section ends with an analytical beat, comparison tables not fact tables. Type-specific blocks override these (Type 4 Humanities targets 800–1500 words per section across 6–10 sections).
58
+ - **Frontmatter-first note triage (Step 4.5)** — Six-level protocol for reading notes efficiently. Always start with `note list -j` for summaries, use `note show --meta -j` for frontmatter-only reads, `search --include-body --max-tokens 6000 -j` for token-capped multi-note pulls, and **delegate notes with `word_count > 6000` to a fresh Sonnet subagent** with a pointed extraction prompt (~40× context savings per large note). Rely on the summary field first; read the body only when it earns its place.
59
+ - **Type-aware adversarial audit** — The structure-auditor subagent now checks whether the draft honors its declared type's parameter block: thematic sections for Humanities, mandatory comparison matrix for Comparative, "What we don't know yet" for Emerging, a position on winners for Market. Flags every type violation.
60
+
61
+ ### Changed
62
+
63
+ - **`fit_markdown` via PruningContentFilter** — crawl4ai provider now uses `DefaultMarkdownGenerator` with `PruningContentFilter` so fetched notes contain just the main content, stripping navigation, footers, and sidebar chrome. Both `AsyncWebCrawler.arun()` and the Playwright visible-browser path use the same generator for consistent output. Applied to single fetch, batch fetch, and visible browser paths.
64
+ - **Skip numeric wiki-links in note parser** — `[[100]]`-style citation markers in bibliographies and academic papers are no longer extracted as note references. Avoids thousands of spurious broken-link warnings on papers that use numbered references.
65
+ - **"Over-collect, then prune" reframed as "over-collect, then engage deeply"** — A report built from 30 sources that disagree and force you to take positions is worth more than a report built from 80 sources that each contribute one bullet of description. Collection is a means to an argument, not the goal.
66
+ - **Scaffold and comparison artifacts are ephemeral, NOT hyperresearch notes** — Both the conceptual scaffold and the cross-source comparison blocks live in `/tmp/scaffold.md` or working memory, explicitly not as notes. Protects the research base from pre-writing scratch work.
67
+
68
+ ## [0.3.0] - 2026-04-11
69
+
70
+ ### New
71
+
72
+ - **Native PDF extraction** — PDFs detected by URL pattern, downloaded directly with httpx, text extracted with pymupdf. No browser needed. arXiv `/abs/` links auto-convert to `/pdf/`.
73
+ - **Raw file storage** — PDF bytes saved to `research/raw/<note-id>.pdf`, linked from note frontmatter via `raw_file:` field. Agent can read the raw PDF directly.
74
+ - **Junk page detection** — `WebResult.looks_like_junk()` catches Cloudflare captchas, error pages, cookie walls, binary garbage, reCAPTCHA, and empty content before saving. Returns `JUNK_CONTENT` error instead of creating useless notes.
75
+ - **Gap analysis step** — after drafting the report, agent re-reads the original query word by word, identifies gaps, and does another full round of research to fill them.
76
+ - **Adversarial audit** — two subagents (comprehensiveness auditor + logic/structure auditor) review the draft in parallel. Runs up to 2 loops. Agent uses wait time productively to improve summaries and tags.
77
+ - **Source checkpoint** — agent must review collected sources before writing any draft. Checks coverage breadth, missing angles, uncited references. Expects 50-100+ sources on complex topics.
78
+ - **Scholarly API guidance** — CLAUDE.md and `/research` skill now encourage use of arXiv, Semantic Scholar, CrossRef, and PubMed APIs for academic research.
79
+ - **Date injection** — today's date injected programmatically into CLAUDE.md at install time.
80
+ - **Multi-round research emphasis** — agent docs stress multiple rounds of search → fetch → follow links, spawning 10-20 fetcher agents per round.
81
+
82
+ ### Changed
83
+
84
+ - **Agent-driven curation replaces auto-enrich** — removed the keyword-matching `enrich_note_file()` from the fetch pipeline. Fetcher subagents now read content, write real summaries, add meaningful tags, and quality-check each source (deprecating junk/off-topic notes).
85
+ - **Fetcher subagent quality gate** — subagent now checks relevance, content quality, and duplicates. Deprecates bad notes instead of leaving them as drafts.
86
+ - **`_resolve_executable()` prioritizes venv** — checks venv `Scripts/` dir before PATH, preventing system-wide installs from overriding the project's venv.
87
+ - **PDF binary detection improved** — checks for `endstream`, `endobj`, `/FlateDecode`, `%PDF-` markers and non-printable character ratios. Catches binary garbage in both single-fetch and batch-fetch paths.
88
+ - **Junk detection thresholds raised** — empty content threshold: 100→300 chars, cookie page threshold: 500→1500 chars. Added `recaptcha`, `checking your browser`, `verify you are human` to bot detection signals.
89
+ - **SSL verification disabled for PDF downloads** — academic sites often have self-signed certs. `httpx.get(verify=False)` for PDF fetches only.
90
+ - **PDF fetch logging** — `_fetch_pdf` failures now logged via `logging.getLogger("hyperresearch.pdf")` instead of silently returning None.
91
+ - **Fetcher subagent continues on failure** — no longer stops on first fetch error, tries all URLs and reports failures individually.
92
+
93
+ ### Added dependencies
94
+
95
+ - `pymupdf>=1.24` — PDF text extraction
96
+ - `httpx>=0.27` — direct HTTP downloads for PDFs (bypasses browser)
97
+
98
+ ## [0.2.0] - 2026-04-10
99
+
100
+ ### New
101
+
102
+ - **`/research` skill** — Scripted deep research workflow as a Claude Code slash command. Clarifies ambiguous requests, searches broadly, fetches aggressively, follows rabbit holes, auto-curates, synthesizes, and presents findings with hub notes
103
+ - **`hyperresearch setup`** — Interactive TUI onboarding: web provider, browser profile selection/creation, agent hooks. Auto-launches on first `install`
104
+ - **`hyperresearch fetch-batch`** — Concurrent multi-URL fetch with batched sync (O(1) syncs instead of O(n))
105
+ - **`hyperresearch link --auto`** — Holistic auto-linking: scans notes for mentions of other notes' titles and appends wiki-links
106
+ - **`hyperresearch assets list/path`** — Browse downloaded screenshots and images
107
+ - **`--save-assets` flag** — Opt-in screenshot + content image download on fetch
108
+ - **`--visible` flag** — Non-headless browser for stubborn auth sites (auto-enabled for LinkedIn, Twitter, Facebook, Instagram, TikTok)
109
+ - **`--max-tokens` on search** — Token budget truncation for context-aware agents
110
+ - **Auto-curation at fetch time** — Notes arrive with auto-generated tags and summaries
111
+ - **MCP write tools** — `fetch_url`, `create_note`, `update_note` (MCP server is now read-write)
112
+ - **MinHash+LSH dedup** — O(n) approximate dedup for large vaults (200+ notes), falls back to brute-force for small vaults
113
+ - **Hub notes auto-surfaced** after research sessions
114
+ - **Synthesis notes** saved as feedback loop (agent Q&A becomes searchable)
115
+ - **`hyperresearch-fetcher` subagent** — Haiku-powered URL fetcher installed to `.claude/agents/`
116
+ - **Login wall detection** — `AUTH_REQUIRED` error instead of saving login page junk
117
+ - **Smart SPA wait** — Polls DOM stability (2s initial + 10s ceiling) instead of fixed delays
118
+
119
+ ### Changed
120
+
121
+ - **crawl4ai is the sole browser provider** — Removed firecrawl, tavily, trafilatura
122
+ - **crawl4ai v0.8.x API** — AsyncWebCrawler, BrowserConfig, CrawlerRunConfig, arun/arun_many
123
+ - **Authenticated crawling** via crawl4ai browser profiles (`crwl profiles` or setup TUI)
124
+ - **CLI path baked into CLAUDE.md** — Works without venv activation (forward slashes for Windows bash)
125
+ - **Deep research philosophy** — Agent docs say "over-collect, then prune" and "go down rabbit holes"
126
+ - **Windows encoding fix** — `stream.reconfigure(encoding="utf-8")` at startup, no more charmap crashes
127
+ - **Note slugs capped at 80 chars** — Avoids Windows MAX_PATH issues
128
+ - **Anti-bot stealth always on** when crawl4ai is used (no setup question)
129
+ - **Config commands** now support `web.provider`, `web.profile`, `web.magic`
130
+
131
+ ### Removed
132
+
133
+ - Dead fields: `confidence`, `superseded_by`, `llm_compiled`, `llm_model`, `compile_source`
134
+ - Tag plural normalization (use explicit `tag_aliases` instead)
135
+ - `deprecated-no-successor` and `low-confidence` lint rules
136
+ - Firecrawl, Tavily, Trafilatura web providers
137
+
138
+ ## [0.1.0] - 2026-04-09
139
+
140
+ Initial release. Forked from [llm-kasten](https://github.com/jordan-gibbs/llm-kasten) and repositioned for agent-driven research workflows.
141
+
142
+ ### New
143
+
144
+ - **`hyperresearch install`** — One-step setup: init vault + inject agent docs + install PreToolUse hooks for Claude Code, Codex, Cursor, Gemini CLI
145
+ - **`hyperresearch fetch <url>`** — Fetch a URL, extract content, save as a research note with source tracking
146
+ - **`hyperresearch research <topic>`** — Deep research: web search, fetch results, follow links, save as linked notes, generate synthesis MOC
147
+ - **`hyperresearch sources list/check`** — List and query fetched web sources
148
+ - **Web provider plugin system** — Pluggable backends: builtin (stdlib), crawl4ai (local headless browser)
149
+ - **Agent hook system** — PreToolUse hooks that remind agents to check the research base before web searches
150
+ - **Sources table** — URL deduplication, domain tracking, fetch metadata
151
+ - **Extended frontmatter** — `source_domain`, `fetched_at`, `fetch_provider` fields
152
+ - **MCP server** with 10 tools including `check_source` and `list_sources`
153
+
154
+ ### From kasten (the backbone)
155
+
156
+ - SQLite FTS5 full-text search with BM25 ranking
157
+ - Markdown notes with YAML frontmatter as source of truth
158
+ - `[[wiki-link]]` tracking with backlinks
159
+ - `--json` / `-j` structured output on every command
160
+ - Note lifecycle: draft → review → evergreen → stale → deprecated → archive
161
+ - Auto-sync (mtime + SHA-256 change detection)
162
+ - Agent doc injection (CLAUDE.md, AGENTS.md, GEMINI.md, copilot-instructions.md)
163
+ - Web viewer with force-directed knowledge graph
164
+ - 70 tests
165
+
166
+ [0.4.0]: https://github.com/jordan-gibbs/hyperresearch/releases/tag/v0.4.0
167
+ [0.3.0]: https://github.com/jordan-gibbs/hyperresearch/releases/tag/v0.3.0
168
+ [0.2.0]: https://github.com/jordan-gibbs/hyperresearch/releases/tag/v0.2.0
169
+ [0.1.0]: https://github.com/jordan-gibbs/hyperresearch/releases/tag/v0.1.0
@@ -0,0 +1,397 @@
1
+ Metadata-Version: 2.4
2
+ Name: hyperresearch
3
+ Version: 0.7.0
4
+ Summary: Claude Code harness for disciplined, adversarially-audited deep research with full provenance.
5
+ Project-URL: Homepage, https://github.com/jordan-gibbs/hyperresearch
6
+ Project-URL: Repository, https://github.com/jordan-gibbs/hyperresearch
7
+ Project-URL: Issues, https://github.com/jordan-gibbs/hyperresearch/issues
8
+ Author-email: Jordan Gibbs <jordan@jordangibbs.xyz>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: agent,cli,knowledge-base,llm,markdown,research,wiki,zettelkasten
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Text Processing :: Markup :: Markdown
20
+ Requires-Python: >=3.11
21
+ Requires-Dist: crawl4ai>=0.4
22
+ Requires-Dist: httpx>=0.27
23
+ Requires-Dist: jinja2>=3.1
24
+ Requires-Dist: platformdirs>=4.0
25
+ Requires-Dist: pydantic>=2.0
26
+ Requires-Dist: pymupdf>=1.24
27
+ Requires-Dist: pyyaml>=6.0
28
+ Requires-Dist: rich>=13.0
29
+ Requires-Dist: typer>=0.9.0
30
+ Provides-Extra: all
31
+ Requires-Dist: mcp>=1.6; extra == 'all'
32
+ Provides-Extra: dev
33
+ Requires-Dist: mypy>=1.8; extra == 'dev'
34
+ Requires-Dist: pytest-cov>=4.1; extra == 'dev'
35
+ Requires-Dist: pytest>=7.4; extra == 'dev'
36
+ Requires-Dist: ruff>=0.3; extra == 'dev'
37
+ Provides-Extra: mcp
38
+ Requires-Dist: mcp>=1.6; extra == 'mcp'
39
+ Description-Content-Type: text/markdown
40
+
41
+ <p align="center">
42
+ <img src="assets/banner.png" alt="HYPERRESEARCH" width="700">
43
+ </p>
44
+
45
+ <h3 align="center">The Most Intelligent Deep Research Agent Harness</h3>
46
+
47
+ <p align="center">
48
+ <a href="https://pypi.org/project/hyperresearch/"><img src="https://img.shields.io/pypi/v/hyperresearch" alt="PyPI version"></a>
49
+ <a href="https://pypi.org/project/hyperresearch/"><img src="https://img.shields.io/pypi/pyversions/hyperresearch" alt="Python 3.11+"></a>
50
+ <a href="LICENSE"><img src="https://img.shields.io/github/license/jordan-gibbs/hyperresearch" alt="License: MIT"></a>
51
+ <a href="https://github.com/jordan-gibbs/hyperresearch"><img src="https://img.shields.io/github/stars/jordan-gibbs/hyperresearch?style=social" alt="GitHub stars"></a>
52
+ </p>
53
+
54
+ ---
55
+
56
+ **HyperResearch is a deep research harness for Claude Code. It produces adversarially-audited reports with full source provenance and creates a persistent, searchable knowledge base that compounds across sessions.**
57
+
58
+ ## Installation
59
+
60
+ ```bash
61
+ pip install hyperresearch
62
+ hyperresearch install
63
+ ```
64
+
65
+ In Claude Code, type `/research-layercake <anything>` and the full flagship protocol fires — **a 7-phase pipeline that discovers width first, derives depth loci from the width corpus, runs parallel depth investigations, drafts once, and patches the draft via adversarial critics (no regeneration).** This is the default way to use hyperresearch. If you want a faster single-pass run instead, type `/research <anything>`.
66
+
67
+ That single install command creates a v7 SQLite vault, auto-installs Chromium for headless browsing, generates `CLAUDE.md`, installs both skills (`/research-layercake` and `/research`), registers eight subagents (fetcher / loci-analyst / depth-investigator / dialectic-critic / depth-critic / width-critic / patcher / polish-auditor) into `.claude/agents/`, and wires PreToolUse hooks.
68
+
69
+ ---
70
+
71
+ ## What it actually produces
72
+
73
+ Every research session leaves three load-bearing artifacts on disk. These are real excerpts from a recent run on *"Is there a general method for solving asymmetric first-price sealed-bid auctions?"*
74
+
75
+ ### Provenance breadcrumbs in every fetched note
76
+
77
+ ```
78
+ asymmetric-auctions-with-more-than-two.md
79
+
80
+ *Suggested by [[games-and-economic-behavior-73-2011-479495]] — Hubbard on
81
+ asymmetric auctions with more than two bidders*
82
+ ```
83
+
84
+ Every fetched source carries a wiki-link breadcrumb back to whatever source recommended it. The chain forms a rooted tree from the seed fetches. The `provenance` lint rule catches disconnected components and flat-batch fetches.
85
+
86
+ ### Persisted audit findings
87
+
88
+ ```json
89
+ {
90
+ "mode": "comprehensiveness",
91
+ "status": "needs_fixes",
92
+ "criticals": [
93
+ {
94
+ "id": "C1",
95
+ "description": "Provenance lint error: 6 source notes have breadcrumbs
96
+ but are disconnected from the provenance graph...",
97
+ "fixed_at": "2026-04-15T00:23:00Z",
98
+ "notes": "Provenance ratio is 40% (above 30% threshold).
99
+ Disconnected graph is from retroactive backlinks added to existing
100
+ seeds, not fabricated provenance."
101
+ }
102
+ ],
103
+ "important": [
104
+ { "id": "I1", "description": "Zero non-academic voices...", "fixed_at": "..." }
105
+ ]
106
+ }
107
+ ```
108
+
109
+ Both audit modes (comprehensiveness + conformance, both Opus) persist their findings to `research/audit_findings.json`. The agent applies fixes and marks each finding `fixed_at: <timestamp>`.
110
+
111
+ ### Self-certification detector blocks save
112
+
113
+ The `audit-gate` lint rule extracts the keyword from each CRITICAL's description, **re-runs the underlying lint rule**, and emits this if the rule still fails:
114
+
115
+ ```
116
+ SELF-CERTIFICATION VIOLATION: CRITICAL [C1] was marked `fixed_at` in
117
+ research/audit_findings.json, but lint rule `provenance` still returns
118
+ 3 error(s). The draft's `fixed_at` marker does not match the vault's
119
+ actual state — you must fix the underlying issue (not just the
120
+ bookkeeping). Run `$HPR lint --rule provenance -j` to see what's
121
+ still broken.
122
+ ```
123
+
124
+ The save gate blocks until every CRITICAL is **genuinely** resolved. Bookkeeping fixes get caught.
125
+
126
+ ---
127
+
128
+ ## `/research-layercake` — 7 phases, one draft, patched not regenerated (the default)
129
+
130
+ The flagship research surface and the default way to use hyperresearch. Type `/research-layercake <query>` in Claude Code.
131
+
132
+ **Width before depth, then one draft patched by adversarial critics.** An Opus orchestrator walks a seven-phase pipeline: wide corpus sweep → rabbithole identification → parallel depth investigations → single draft → three adversarial readings → surgical patch pass → polish audit.
133
+
134
+ ### The 7 phases
135
+
136
+ 1. **Width sweep.** The orchestrator spawns parallel `hyperresearch-fetcher` Haiku agents to build a 30–80 source corpus covering the topic's corners. Academic APIs (Semantic Scholar, arXiv, OpenAlex, PubMed) run BEFORE web search — citation-ranked canonical papers before derivative commentary.
137
+ 2. **Loci analysis.** Two `hyperresearch-loci-analyst` Sonnet agents read the width corpus in parallel and each returns 1–8 specific "depth loci" — questions where deeper investigation would meaningfully improve the final report. The orchestrator dedupes their outputs and clamps to 6.
138
+ 3. **Depth investigation.** One `hyperresearch-depth-investigator` Sonnet agent per locus, in parallel. Each investigator can spawn its own fetchers (capped at 10 new sources), reads the existing vault, and writes ONE `interim-<locus>.md` note with dense synthesis, direct quotes, and citations. The orchestrator consumes these interim notes during Layer 4.
139
+ 4. **Draft.** The orchestrator writes `research/notes/final_report.md` ONCE, weaving the width corpus with the interim notes under the modality file's substance rules (collect / synthesize / compare / forecast).
140
+ 5. **Adversarial critique.** Three Opus critics fire in parallel: `dialectic-critic` (counter-evidence the draft missed), `depth-critic` (shallow spots the interim notes could fill), `width-critic` (topical corners the draft ignores despite the corpus supporting them). Each returns a findings JSON with structured `suggested_patch` entries — never a rewrite.
141
+ 6. **Patch pass.** `hyperresearch-patcher` (Sonnet, **tool-locked to `[Read, Edit]`**) reads all three findings files and applies them as surgical Edit hunks. Per-hunk cap: `new_string` may be at most 500 chars longer than `old_string`. The patcher physically cannot Write — it has no path to regenerate the draft.
142
+ 7. **Polish audit.** `hyperresearch-polish-auditor` (Sonnet, also `[Read, Edit]` only) strips hygiene leaks (YAML frontmatter, scaffold sections, prompt echoes), cuts filler phrases ("Importantly", "It is worth noting"), removes redundancy, and breaks long sentences — all via surgical Edits. Structural mismatches (wrong format for the prompt, missing sections) escalate to the orchestrator rather than getting force-patched.
143
+
144
+ ### Why the tool lock matters
145
+
146
+ The load-bearing invariant of layercake is: **after Layer 4 the draft is only ever modified by small Edit hunks.** This is enforced at the Claude Code tool-allowlist level — the patcher and polish auditor do not have `Write` or `Bash`. If a critic's finding cannot fit into a ≤500-char hunk, it escalates to the orchestrator as a structural issue instead of triggering a regeneration. This prevents the "just rewrite it" failure mode that plagues post-hoc review in long-running agent pipelines.
147
+
148
+ ### Opting out — faster single-pass mode
149
+
150
+ Layercake is the default because width-plus-depth-plus-adversarial-review beats a single investigator on almost every real research query. If you want a faster single-pass run — e.g., for a quick sanity-check or a prompt where one pass is plenty — type `/research <query>` instead. Single-pass fires the same modality rules on one Sonnet agent, no loci analysis, no critics, no patcher.
151
+
152
+ A rule of thumb: use `/research-layercake` for anything you would want a human researcher to take seriously. Use `/research` when you just want the vault populated and a first-pass draft in front of you quickly.
153
+
154
+ ---
155
+
156
+ ## The vault: persistent, searchable, compounding
157
+
158
+ hyperresearch is not a one-shot report generator. Every fetched source lands in a durable SQLite-indexed vault that every future research session can reuse. Knowledge compounds across sessions; the tool's value grows with the corpus.
159
+
160
+ ### What persists
161
+
162
+ - **Raw source material, not rewritten summaries.** Fetched content keeps its original formatting — headings, tables, code blocks, technical details. If the source is a PDF, pymupdf extracts the full text and the original PDF lives at `research/raw/<note-id>.pdf`. Every note carries its source URL, fetch timestamp, tier classification, and `--suggested-by` breadcrumb pointing at whichever note surfaced it.
163
+ - **Extract notes** — per-source analyst reads with direct quotes, context markers, one-line summaries, and inherited tier + content-type tags. These are the second derivative of raw content and stay in the vault as first-class, queryable notes.
164
+ - **Scaffolds, comparisons, audit findings** — every research session's planning artifacts and adversarial review trail persist alongside the sources they drew on. Past synthesis notes are discoverable next to the raw sources that justified them.
165
+ - **The knowledge graph** — `[[wiki-links]]` between notes form a queryable graph. `hyperresearch graph hubs` surfaces the most-connected notes in a domain; `hyperresearch graph backlinks <id>` shows every note that references a given source.
166
+
167
+ ### Searchability
168
+
169
+ Before any web search the vault gets queried first — the hook reminds Claude Code, and the protocol checks explicitly:
170
+
171
+ ```bash
172
+ hyperresearch search "ion-trap gate fidelity" -j # Full-text across every note
173
+ hyperresearch search "quantum" --tier ground_truth -j # Filter by epistemic tier
174
+ hyperresearch search "attention" --include-body -j # Full-body search, not just titles
175
+ hyperresearch note show <id> <id> <id> -j # Batch-read notes in one call
176
+ ```
177
+
178
+ When the vault already holds ≥10 relevant notes on a topic, `/research` tells the user so and asks whether to dig deeper, take a new angle, or synthesize from the existing corpus — instead of re-fetching what's already there. The sunk-cost of past research pays forward.
179
+
180
+ ### Markdown is truth, SQLite is cache
181
+
182
+ Notes live as plain markdown with YAML frontmatter in `research/notes/`. The SQLite index is fully rebuildable — delete it and `hyperresearch sync` reconstructs it from the markdown. The vault is inspectable in any editor, version-controllable in git, and readable without the tool installed. hyperresearch stores and indexes; it does not hide data behind the tool.
183
+
184
+ ---
185
+
186
+ ## Why it works on hard research
187
+
188
+ Your AI agent searches the web, skims sources, writes an answer that sounds good, and ships it. There's no scaffold, no audit, no source-vs-source comparison, no provenance, no way to know if it actually engaged with the strongest counter-position. Hyperresearch breaks that pattern through structural enforcement:
189
+
190
+ - **Verbatim user prompt is gospel** — pasted into the scaffold's first section, re-read at every step, machine-checked at the save gate
191
+ - **Bouncing reading loop** — fetch a seed, an analyst reads it and proposes next URLs, main agent fetches those WITH `--suggested-by` provenance, loop. Builds a rooted research graph instead of a flat batch.
192
+ - **Per-source analyst extraction** — every fetched source gets a Sonnet subagent that reads it with the research goal in hand
193
+ - **Adversarial dissent is mandatory** — Checkpoint 1 fails until at least one source explicitly contradicts the dominant view
194
+ - **Two-mode adversarial audit (Opus)** — comprehensiveness finds gaps vs the verbatim prompt; conformance checks modality rules
195
+ - **Save is blocked** until every CRITICAL is verified-resolved by the audit-gate detector
196
+
197
+ ---
198
+
199
+ ## How it works — the contextual flow
200
+
201
+ ```
202
+ ┌─────────────────────────────────────────────────────────────────────┐
203
+ │ │
204
+ │ USER PROMPT (verbatim, gospel) │
205
+ │ │ │
206
+ │ ▼ │
207
+ │ ┌─────────────────────────────────────────────────────────────┐ │
208
+ │ │ MAIN AGENT (your Claude Code session) │ │
209
+ │ │ classify → seed fetch → guided loop → audit → save │ │
210
+ │ └──────┬──────────────────┬──────────────────┬─────────────────┘ │
211
+ │ │ │ │ │
212
+ │ spawn ▼ spawn ▼ spawn ▼ │
213
+ │ ┌───────────┐ ┌───────────┐ ┌───────────┐ │
214
+ │ │ FETCHER │ │ ANALYST │ │ AUDITOR │ │
215
+ │ │ (Haiku) │ │ (Sonnet) │ │ (Opus) │ │
216
+ │ │ │ │ │ │ │ │
217
+ │ │ crawl4ai │ │ read note │ │ check vs │ │
218
+ │ │ +headless │ │ extract + │ │ verbatim │ │
219
+ │ │ Chromium │ │ next URLs │ │ prompt │ │
220
+ │ └─────┬─────┘ └─────┬─────┘ └─────┬─────┘ │
221
+ │ │ │ │ │
222
+ │ │ note + │ extract + │ findings.json │
223
+ │ │ raw.pdf │ next_targets │ │
224
+ │ ▼ ▼ ▼ │
225
+ │ ┌─────────────────────────────────────────────────────────────┐ │
226
+ │ │ VAULT (SQLite v6 + markdown) │ │
227
+ │ │ notes/*.md raw/*.pdf scaffold.md comparisons.md │ │
228
+ │ │ audit_findings.json ←── audit-gate lint blocks save │ │
229
+ │ └─────────────────────────────────────────────────────────────┘ │
230
+ │ ▲ │
231
+ │ │ analyst's next_targets re-enter FETCHER with │
232
+ │ │ --suggested-by, building a rooted provenance tree │
233
+ │ └─────────── bouncing reading loop ─────────────────────────┘
234
+ │ │
235
+ └─────────────────────────────────────────────────────────────────────┘
236
+ ```
237
+
238
+ **Subagent roster**, each picked for its job:
239
+
240
+ | Agent | Model | Role |
241
+ |---|---|---|
242
+ | `hyperresearch-fetcher` | **Haiku** | Mechanical URL fetching via crawl4ai. Cheap, fast, parallel. |
243
+ | `hyperresearch-loci-analyst` | **Sonnet** | Reads the width corpus, returns 1–8 depth loci with rationale. Spawn 2 in parallel, dedupe. |
244
+ | `hyperresearch-depth-investigator` | **Sonnet** | Investigates one locus: fetches new sources, writes one interim-report note per locus. |
245
+ | `hyperresearch-dialectic-critic` | **Opus** | Finds counter-evidence the draft missed, emits structured findings with surgical patches. |
246
+ | `hyperresearch-depth-critic` | **Opus** | Finds shallow spots where interim notes could fill specifics. |
247
+ | `hyperresearch-width-critic` | **Opus** | Finds topical corners the corpus supports but the draft ignores. |
248
+ | `hyperresearch-patcher` | **Sonnet** | Tool-locked `[Read, Edit]`. Applies critic findings as surgical Edit hunks. Cannot regenerate. |
249
+ | `hyperresearch-polish-auditor` | **Sonnet** | Tool-locked `[Read, Edit]`. Cuts filler, strips hygiene leaks, breaks long sentences. |
250
+
251
+ **Routing** — the dispatcher classifies every request by **what the output needs to do**, not what the subject is:
252
+
253
+ ```
254
+ collect → enumerative coverage with per-entity fields
255
+ synthesize → defended thesis grounded in evidence
256
+ compare → per-entity evaluation + committed recommendation
257
+ forecast → committed prediction with explicit time horizon
258
+ ```
259
+
260
+ A query about a fictional franchise can be `collect` (per-character enumeration), `synthesize` (a thesis about meaning), `compare` (this vs another), or `forecast` (will the sequel succeed). Subject doesn't decide; activity does.
261
+
262
+ ---
263
+
264
+ ## What's enforced
265
+
266
+ Nine invariants the protocol structurally prevents from breaking:
267
+
268
+ 1. **Verbatim prompt as gospel** — `scaffold-prompt` lint blocks if the scaffold doesn't open with the user's exact prompt
269
+ 2. **Rooted-tree provenance** — `--suggested-by` chain must form a real tree from at least one seed; isolated breadcrumbs flagged
270
+ 3. **Locus coverage** — every Layer 2 locus must have a Layer 3 `interim-<name>.md` note; missing interims flag as errors
271
+ 4. **Patch-only draft modification** — after Layer 4, the patcher and polish auditor are tool-locked to `[Read, Edit]`. They cannot regenerate; the ≤500-char hunk-expansion cap is a mechanical tripwire
272
+ 5. **Critical findings never silently skip** — `patch-surgery` lint surfaces any critical finding the patcher couldn't apply
273
+ 6. **Schema integrity** — `tier`, `content_type`, and `type` are SQLite CHECK-constrained vocabularies; corrupted frontmatter cannot poison the index
274
+ 7. **PDF + raw artifact persistence** — fetched PDFs land in `research/raw/` and the `raw_file` frontmatter field survives every re-serialization
275
+ 8. **Interim notes are persisted, not ephemeral** — depth-investigator outputs stay in the vault forever; future sessions can query them
276
+ 9. **Hygiene leaks caught on the way out** — scaffold sections, YAML frontmatter, and prompt echoes are stripped by the polish auditor before ship
277
+
278
+ ---
279
+
280
+ ## What hyperresearch doesn't do
281
+
282
+ - It doesn't replace your judgment on which sources matter — the agent picks, you steer
283
+ - It can't fetch what's behind a paywall you haven't logged into (but it tries: `--visible` flag bypasses many bot-detectors, and configured login profiles work transparently)
284
+ - It runs on Anthropic models — Opus + Sonnet + Haiku via the subagent triad. Costs scale with corpus size; expect $5-15 per deep research session.
285
+ - The audit gate catches **structural** failures (missing scaffold, broken provenance, unresolved CRITICALs). It cannot guarantee factual accuracy — that's still your call.
286
+ - Network fetches fail. The protocol surfaces failures explicitly and walks a fallback chain (alternative URLs → visible browser → summary fallback), but some sources won't ever be fetchable.
287
+
288
+ ---
289
+
290
+ ## Use cases
291
+
292
+ - **Deep technical research** — "What does the literature say about ion-trap quantum scaling?" → 25+ academic sources, full provenance graph, dissenting voices, primary papers quoted directly
293
+ - **Comparative evaluation** — "TigerBeetle vs Postgres vs FoundationDB for write-heavy workloads" → per-entity coverage, comparison matrix, committed pick, mandatory critical voice on the leader
294
+ - **Forecasting + strategy** — "Will US inflation stay above 3% through 2026?" → ground-truth statistics + institutional analysis + named contrarians, probability language not hedge
295
+ - **Interpretive analysis** — "What does *Blood Meridian*'s violence mean?" → primary text + critical tradition + dissenting reading, every paragraph fuses fact with interpretive claim
296
+ - **Enumerative coverage** — "For each Napoleonic marshal, cover key campaigns and fate" → every named entity gets every requested field, no silent downgrades
297
+
298
+ All of the above run under the default [`/research-layercake`](#research-layercake--7-phases-one-draft-patched-not-regenerated-the-default) mode: width sweep → loci analysis → depth investigations → one draft → three adversarial critics → surgical patch pass → polish audit. For faster turnaround when the query doesn't warrant the full pipeline, type `/research <query>` for a single-pass run.
299
+
300
+ ---
301
+
302
+ ## What `hyperresearch install` wires into Claude Code
303
+
304
+ One command sets up the full integration:
305
+
306
+ - **`.claude/settings.json`** — PreToolUse hook that nudges Claude Code to check the vault before any raw web search
307
+ - **`.claude/skills/hyperresearch/`** — `/research` skill (dispatcher + 4 modality files: collect / synthesize / compare / forecast)
308
+ - **`.claude/skills/research-layercake/`** — `/research-layercake` skill (the 7-phase pipeline)
309
+ - **`.claude/agents/`** — eight registered subagents: `hyperresearch-fetcher` (Haiku), `hyperresearch-loci-analyst` (Sonnet), `hyperresearch-depth-investigator` (Sonnet), `hyperresearch-dialectic-critic` (Opus), `hyperresearch-depth-critic` (Opus), `hyperresearch-width-critic` (Opus), `hyperresearch-patcher` (Sonnet, `[Read, Edit]`-locked), `hyperresearch-polish-auditor` (Sonnet, `[Read, Edit]`-locked)
310
+ - **`CLAUDE.md`** at the vault root — the full research workflow, automatically loaded by Claude Code on every session
311
+
312
+ hyperresearch is Claude Code-only for now. Codex, Cursor, and Gemini support was trimmed from v0.6 to focus the surface area — may return as real integrations later.
313
+
314
+ ---
315
+
316
+ ## Commands
317
+
318
+ ```bash
319
+ # Research workflow
320
+ hyperresearch fetch <url> --tag t -j # Fetch a URL into the KB
321
+ hyperresearch fetch <url> --suggested-by <id> -j # Track provenance during the guided loop
322
+ hyperresearch fetch <url> --visible -j # Bypass bot detection with a visible browser
323
+
324
+ # Search + read
325
+ hyperresearch search "query" -j # Full-text search
326
+ hyperresearch search "query" --tier ground_truth -j # Filter by epistemic tier
327
+ hyperresearch search "query" --content-type paper -j # Filter by artifact kind
328
+ hyperresearch note show <id> -j # Read a note
329
+ hyperresearch note show <id> --meta -j # Frontmatter only (cheap triage)
330
+ hyperresearch note list --status draft -j # List notes with summaries
331
+
332
+ # Knowledge graph
333
+ hyperresearch link --auto -j # Auto-link related notes
334
+ hyperresearch graph hubs -j # Most-connected notes
335
+ hyperresearch graph backlinks <id> -j # What links to this note
336
+
337
+ # Health checks
338
+ hyperresearch lint -j # Run all rules
339
+ hyperresearch lint --rule scaffold-prompt -j # Verbatim prompt gospel rule
340
+ hyperresearch lint --rule provenance -j # Rooted-tree breadcrumb chain
341
+ hyperresearch lint --rule audit-gate -j # Self-certification detector
342
+ hyperresearch lint --rule analyst-coverage -j # Extract:source ratio
343
+ hyperresearch repair -j # Fix links, rebuild indexes
344
+ ```
345
+
346
+ Every command returns `{"ok": true, "data": {...}}` with `-j`.
347
+
348
+ ---
349
+
350
+ ## Authenticated crawling
351
+
352
+ Fetch from LinkedIn, Twitter, paywalled sites — anything you can log into:
353
+
354
+ ```bash
355
+ hyperresearch setup # Browser opens. Log into your sites. Done.
356
+ ```
357
+
358
+ ```toml
359
+ # .hyperresearch/config.toml
360
+ [web]
361
+ provider = "crawl4ai"
362
+ profile = "research"
363
+ ```
364
+
365
+ LinkedIn, Twitter, Facebook, Instagram, and TikTok automatically use a visible browser to avoid session kills.
366
+
367
+ ---
368
+
369
+ ## Philosophy
370
+
371
+ - **Process is load-bearing.** A draft without a scaffold, comparisons, audit findings, and a clean provenance graph is unfinished — regardless of how good the prose reads.
372
+ - **The user's prompt is the only authority.** Activity classification, source strategy, writing constraints all serve the prompt. Substance rules never override what the user actually asked for.
373
+ - **No LLM calls inside the tool.** Hyperresearch stores, indexes, lints, and orchestrates. Your agent is the LLM.
374
+ - **Markdown is truth, SQLite is cache.** Notes are plain files. Delete the DB; `hyperresearch sync` rebuilds it.
375
+ - **Audit findings are artifacts, not just outputs.** They persist to JSON, get verified by lint rules, and gate the save. Self-certification is structurally prevented.
376
+ - **Exhaustive and deep.** v0.5.0 seeds 10-15 sources, iterates the bouncing loop 8 rounds, and typically produces drafts anchored in 40-80 fetched-and-analyst-read sources with 40+ inline citations. Depth AND breadth — not a tradeoff.
377
+
378
+ ---
379
+
380
+ ## Requirements
381
+
382
+ - Python 3.11+
383
+ - [Claude Code](https://claude.com/claude-code) with Anthropic API access
384
+ - API key with access to Opus, Sonnet, and Haiku — one key powers the full subagent triad
385
+ - Windows, macOS, Linux
386
+
387
+ ---
388
+
389
+ ## License
390
+
391
+ [MIT](LICENSE)
392
+
393
+ ---
394
+
395
+ ## Star History
396
+
397
+ [![Star History Chart](https://api.star-history.com/svg?repos=jordan-gibbs/hyperresearch&type=Date)](https://star-history.com/#jordan-gibbs/hyperresearch&Date)