tools tier

tools-research-sweep

Lightweight research harness (Rule 14): manages topic prompts, runs searches through the estate's own tools, keeps every repeatable step in code (search collection, JSON validation, retries, markdown emission) so the AI call is as small as necessary. Two modes by topics file: deep thinker research and recurring idea-scout over social/media sources.

Lightweight research harness (Rule 14): manages topic prompts, runs searches through the estate's own tools, keeps every repeatable step in code (search collection, JSON validation, retries, markdown emission) so the AI call is as small as necessary. Two modes by topics file: deep thinker research and recurring idea-scout over social/media sources.

Tiertools
Roleunclassified (baselined)
Pathcrates/tools/research-sweep
Edition2021
Targetsorg-ask, tools-research-sweep, tools_research_sweep, cli_test, org_ask_cli_test
Public items37 across 0 modules
Tests30

What it is for

tools-research-sweep — lightweight research harness (Rule 14).

Code owns everything repeatable: topic/prompt assembly from TOML, search collection through the estate's own tools (tools-browser-test humanized_search), JSON-contract validation with bounded retries, markdown emission (overview + one doc per inverse-QA pair, the ingest shape tools-org-knowledge ingest-research expects), and the optional ingest hand-off. The AI call is a single small prompt per topic: preamble + topic + collected search results in, structured JSON out.

Capabilities

crate root

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub const OUTPUT_CONTRACT: & str
fn write_files(out_dir : & Path, files : & (String, String)) -> Result <()>
fn convert_bundle(raw : & str, keys : & String, source_line : & str,) -> Result <Vec <(String, String)>>
pub const ASK_DISCIPLINE: & str
fn ledger_line(date : & str, question : & str, answer : & str, routing : & serde_json::Value,) -> String

Common

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub struct Common

Config

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub struct Config

Evidence

tools-research-sweep — lightweight research harness (Rule 14).

Item
fn format_evidence(hits : & SearchHit) -> String
pub struct Evidence
fn parse_search_data(corpus : & str, raw : & str) -> Vec <Evidence>
fn ask_prompt(question : & str, evidence : & Evidence, max_chars : usize,) ->(String, Vec <String>)
fn entries_to_evidence(feed_name : & str, entries : & FeedEntry) -> Vec <Evidence>

Exec

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub enum Exec
Exec :: fn sys(timeout_secs : u64) -> Self
Exec :: fn fixture(replies : Vec <Result <String, String>>) -> Self
Exec :: async fn run(& self, program : & str, args : & String, stdin : Option <Vec <u8>>,) -> Result <String>

Feed

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub struct Feed
fn parse_feeds(text : & str) -> Result <FeedsFile>

FeedEntry

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub struct FeedEntry
fn extract_entries(xml : & str, max : usize) -> Vec <FeedEntry>

FeedsFile

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub struct FeedsFile

Finding

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub struct Finding

Findings

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub struct Findings
fn parse_findings(raw : & str) -> Result <Findings>
fn emit_overview(f : & Findings, source_line : & str) -> String
fn emit_files(key : & str, f : & Findings, source_line : & str) -> Vec <(String, String)>
fn parse_bundle(raw : & str) -> Result <Vec <Findings>>

InverseQa

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub struct InverseQa
fn emit_qa(q : & InverseQa) -> String

SearchHit

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub struct SearchHit
fn parse_search_reply(raw : & str) -> Vec <SearchHit>

SourceRef

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub struct SourceRef

Topic

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub struct Topic
fn parse_topics(text : & str) -> Result <TopicsFile>
async fn run_topic(cfg : & Config, common : & Common, topic : & Topic, exec : & Exec,) -> Result <TopicResult>

TopicResult

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub struct TopicResult

TopicsFile

tools-research-sweep — lightweight research harness (Rule 14).

Item
pub struct TopicsFile

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

`crate root`

ItemWhat it is
pub struct TopicsFile
pub struct Common
pub struct Topic
fn parse_topics(text : & str) -> Result <TopicsFile>
pub struct Findings
pub struct Finding
pub struct SourceRef
pub struct InverseQa
pub const OUTPUT_CONTRACT: & strThe output contract appended to every prompt — the model returns ONLY this JSON object
fn parse_findings(raw : & str) -> Result <Findings>Strip an accidental markdown fence and parse the model reply.
pub struct SearchHit
fn parse_search_reply(raw : & str) -> Vec <SearchHit>Extract hits from a tools-browser-test humanized_search JSON reply, wherever the results array sits in the envelope.
fn format_evidence(hits : & SearchHit) -> String
fn emit_overview(f : & Findings, source_line : & str) -> String
fn emit_qa(q : & InverseQa) -> String
fn emit_files(key : & str, f : & Findings, source_line : & str) -> Vec <(String, String)>(relative file name, content) pairs for one topic's output.
pub enum ExecSubprocess seam: strict-argv via BoundedCommand, or a test fixture queue.
Exec :: fn sys(timeout_secs : u64) -> Self
Exec :: fn fixture(replies : Vec <Result <String, String>>) -> Self
Exec :: async fn run(& self, program : & str, args : & String, stdin : Option <Vec <u8>>,) -> Result <String>
pub struct Config
pub struct TopicResult
async fn run_topic(cfg : & Config, common : & Common, topic : & Topic, exec : & Exec,) -> Result <TopicResult>
fn write_files(out_dir : & Path, files : & (String, String)) -> Result <()>
fn parse_bundle(raw : & str) -> Result <Vec <Findings>>Extract the research array from a workflow bundle ({"result":{"research": ...}}), a bare {"research":...}, or a bare array — the shapes the agentic pipeline produced before this tool existed.
fn convert_bundle(raw : & str, keys : & String, source_line : & str,) -> Result <Vec <(String, String)>>Convert a whole bundle to markdown files
pub struct EvidenceOne retrieved chunk of evidence for an ask() call.
fn parse_search_data(corpus : & str, raw : & str) -> Vec <Evidence>Parse tools-org-knowledge --json search output ({"data":{...}}) into evidence rows for one corpus.
pub const ASK_DISCIPLINE: & strThe decision discipline the corpus itself prescribes, stated once in code so every answer is held to it.
fn ask_prompt(question : & str, evidence : & Evidence, max_chars : usize,) ->(String, Vec <String>)Assemble the single ask prompt from question + evidence
fn ledger_line(date : & str, question : & str, answer : & str, routing : & serde_json::Value,) -> StringOne ledger line per ask, so answers become scoreable claims (JSONL)
pub struct FeedsFile
pub struct Feed
fn parse_feeds(text : & str) -> Result <FeedsFile>
pub struct FeedEntry
fn extract_entries(xml : & str, max : usize) -> Vec <FeedEntry>Extract entries from an RSS (<item>) or Atom (<entry>) document
fn entries_to_evidence(feed_name : & str, entries : & FeedEntry) -> Vec <Evidence>Feed entries as ask-evidence: corpus news/<feed name>, capped summaries.

No pub use re-exports: every item above is declared in this crate.

Boundary

Reaches into foundation.

Shares tier tools with 84 other crates: tools-advisory-reach, tools-archive-guard, tools-artifact-scaffold, tools-ask-ai-core, tools-ask-ais, tools-ask-gemini, tools-book, tools-book-report, … (84 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)tools
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/tools/research-sweep
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_tools["tools"] --> n_foundation["foundation"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`foundation-bounded-io`foundationnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
anyhow^1noalways
clap^4derivenoalways
serde^1derivenoalways
serde_json^1noalways
tokio^1rt-multi-thread, macrosnoalways
toml^0.8noalways

Development, in this workspace.

CrateTierOptionalOnly on
`tools-cli-conformance`toolsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tempfile^3noalways

Build. None.

Depended on by. Nothing in this workspace.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  SELF["tools-research-sweep"]
  SELF -->|development| n_tools_cli_conformance["tools-cli-conformance"]
  SELF -->|runtime| n_foundation_bounded_io["foundation-bounded-io"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
binorg-ask`src/bin/org-ask.rs`
bintools-research-sweep`src/main.rs`
libtools_research_sweep`src/lib.rs`
testcli_test`tests/cli_test.rs`
testorg_ask_cli_test`tests/org_ask_cli_test.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfaceyes
async runtimeyes
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

No workspace crate depends on this one.

Verification

KindCount
Unit tests23
Integration tests7
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root3400

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc1437
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 14
    "No rustdoc detected" : 23

Metrics

MetricValue
Rust source files3
Source lines1533
Code lines1264
Public API items37
Public modules0
Tests30
Examples0
Cargo features0
Direct runtime dependencies7
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "constant" : 2
    "enum" : 1
    "function" : 17
    "method" : 3
    "struct" : 14
pie showData
    title Rust source composition
    "Code" : 1264
    "Blank or comment" : 269

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

All tools · Manual