Split core.rs into one file per concern
core.rs had grown into a 612-line grab-bag mixing six unrelated concerns:
CLI arg parsing, logging setup, top-level orchestration, the researcher
agent phase, chat-history reconstruction utilities, the summarizer agent
phase, and the writer agent phase — while review.rs, tools.rs, stream.rs,
and progress.rs already correctly isolated their own concerns. This
splits core.rs to match that existing pattern instead of being the one
file that doesn't follow it:
- cli.rs — Cli struct + DEFAULT_TOPIC
- observability.rs — initialize_observability
- models.rs — RESEARCHER_MODEL / WRITER_MODEL (previously duplicated
across call sites, now a single source of truth)
- history.rs — pure chat-history parsing/reconstruction helpers
(partial_findings_from_history, annotated_transcript_from_history, and
their private helpers), plus their unit tests. Also dedupes
MAX_TOOL_RESULT_CHARS, which was previously defined twice.
- researcher.rs — gather_findings + GatheredFindings (the tool-calling
research phase)
- summarizer.rs — summarize_partial_history (the max-turns recovery
agent)
- writer.rs — write_report
- research.rs — the top-level research() orchestration loop
main.rs now only does argument parsing, logging setup, and the top-level
call — no orchestration logic of its own. Unit tests stay co-located
with the code they test per Rust convention (not pulled into separate
files) rather than under "prefer new files" — that applies to
production code organization here.
No behavior changes; cargo test/clippy/fmt all clean.
2026-08-18 10:59:03 +00:00
|
|
|
use clap::Parser;
|
|
|
|
|
|
|
|
|
|
pub(crate) const DEFAULT_TOPIC: &str =
|
|
|
|
|
"What are the latest advances in running large language models locally, on consumer hardware?";
|
|
|
|
|
|
|
|
|
|
/// Deep research agentic loop over local Gemma models: a tool-calling agent
|
|
|
|
|
/// gathers and cross-checks web evidence, a reviewer agent gates it, and a
|
|
|
|
|
/// writer agent turns approved findings into a structured report.
|
|
|
|
|
#[derive(Parser)]
|
2026-08-18 12:26:50 +00:00
|
|
|
#[command(name = "doubleo7", version, about)]
|
|
|
|
|
pub(crate) struct Doubleo7 {
|
Split core.rs into one file per concern
core.rs had grown into a 612-line grab-bag mixing six unrelated concerns:
CLI arg parsing, logging setup, top-level orchestration, the researcher
agent phase, chat-history reconstruction utilities, the summarizer agent
phase, and the writer agent phase — while review.rs, tools.rs, stream.rs,
and progress.rs already correctly isolated their own concerns. This
splits core.rs to match that existing pattern instead of being the one
file that doesn't follow it:
- cli.rs — Cli struct + DEFAULT_TOPIC
- observability.rs — initialize_observability
- models.rs — RESEARCHER_MODEL / WRITER_MODEL (previously duplicated
across call sites, now a single source of truth)
- history.rs — pure chat-history parsing/reconstruction helpers
(partial_findings_from_history, annotated_transcript_from_history, and
their private helpers), plus their unit tests. Also dedupes
MAX_TOOL_RESULT_CHARS, which was previously defined twice.
- researcher.rs — gather_findings + GatheredFindings (the tool-calling
research phase)
- summarizer.rs — summarize_partial_history (the max-turns recovery
agent)
- writer.rs — write_report
- research.rs — the top-level research() orchestration loop
main.rs now only does argument parsing, logging setup, and the top-level
call — no orchestration logic of its own. Unit tests stay co-located
with the code they test per Rust convention (not pulled into separate
files) rather than under "prefer new files" — that applies to
production code organization here.
No behavior changes; cargo test/clippy/fmt all clean.
2026-08-18 10:59:03 +00:00
|
|
|
/// Research topic to investigate
|
|
|
|
|
pub(crate) topic: Option<String>,
|
|
|
|
|
|
|
|
|
|
/// Emit logs at this level (off by default; passing this also enables a
|
|
|
|
|
/// progress spinner to switch off, since the logs already show progress)
|
|
|
|
|
#[arg(short = 'l', long, value_name = "LEVEL")]
|
|
|
|
|
pub(crate) log_level: Option<tracing::Level>,
|
|
|
|
|
}
|