Skip to content

toolbox: the dossier template; search categories; resolved_url and publisher_host - #172

Merged
ymote merged 4 commits into
mainfrom
feat/toolbox-dossier-template
Sep 29, 2026
Merged

ymote merged 4 commits into
mainfrom
feat/toolbox-dossier-template

Conversation

@ymote

@ymote ymote commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Adds the dossier workflow template to the system toolbox library (ADR 0002 §6): a long-report research procedure. It was written for the DHH/Omarchy deep-research validation, and it's the first step of moving deep research onto OctoScript workflow templates.

The template (templates/dossier/, 1.1.0): for each question it searches, reads sources, and keeps each quote with its source's resolved_url and publisher_host. It assembles the report as data, so sources and quotes are carried through, never retyped by a model. Two recorded fixtures: two-questions, and failed-read-and-empty-question.

mod.research additions it needs:

  • Search categories: news (default), general, it, science, social, mapped to the octos metasearch categories. general is general web search: DuckDuckGo, Bing, Brave, Google, Wikipedia (octos#2610). An app may use only the categories in its research grant (scope::narrow_search_in), so this adds no new access.
  • resolved_url / publisher_host on every article read: the page a read actually ended on, e.g. the publisher behind a Google News link. Also carried in run provenance. This fixes the citation mix-ups found in the DHH validation, where claims were re-attached to the wrong article.
  • The research.search tool for app peers (peer.rs, toolbox-peers: offer the system toolbox to app agents (ADR 0002 §6, ADR 0004 §12, behind a feature) #151) takes an optional category.

Tests:

  • New:
    • an ungranted category is denied, and the backend sees no query;
    • a granted category reaches the backend;
    • a redirected read reports its resolved URL and publisher (in the article and in provenance);
    • the dossier fixtures replay.
  • Existing fixtures replay unchanged: the new article fields are additive.

Checks (local, after merging current main):

  • cargo test --locked -p octosense-toolbox: 80 passed; --features live: 94 (4 ignored); --features octos-engine: 102 (4 ignored).
  • cargo test --locked -p octosense-ai-host --features toolbox-peers: 39 passed.
  • clippy -D warnings (plain and live,octos-engine) and cargo fmt --check are clean.

How it was made: by an OctoLoop peer agent (octoscode on octos, GLM 5.3 on the GLM Coding Plan), supervised by Claude through a review board in two stages. Claude reproduced every check before opening this PR. The port is from a local branch; examples/toolbox_run.rs (a CLI to run a template against the live octos engine) is left for a follow-up.

🤖 Generated with Claude Code

…her_host

Port the dossier template work from local/research-peer (3cdb777,
2bfbf02, f966c1e) onto current main:

- templates/dossier: the template (long-report research: questions with
  per-question sub-queries over categories, pooled round-robin reads,
  in-flight reuse across questions, per-question digests) with its two
  blessed fixtures, plus its library.lock.json entry (digest recomputed;
  other templates stay at their main versions);
- mod.research search categories: SearchQuery.category, narrowed through
  scope::narrow_search_in (grant-checked, default news), wired through
  the octos engine backend, the peer's toolbox.search tool (adapted to
  main's #151 peer.rs catalog code) and the module spec;
- resolved_url / publisher_host: the backend's final read URL recorded
  as resolved_url (null while on an aggregator), the publisher's host in
  provenance and every template's sources[], runner provenance matching
  on resolved_url too;
- tests updated for the new fields (final_url in test backends,
  provenance match on resolved_url, dossier in the tool-surface list).

Left out of this port: examples/toolbox_run.rs, the toolbox_run example
Cargo.toml entry, the version bumps and fixture regenerations for the
other templates (briefing, compare, market-brief, news-digest,
topic-brief, weather-plan); the new fields are additive and those
templates keep their main fixture output. peer.rs keeps main's #151
shape; only the category plumbing was added to it.
…ed reads

- peer.rs SEARCH decl: since octos#2610 the metasearch's general category
  also searches the web (DuckDuckGo, Bing, Brave, Google), so the stale
  'Wikipedia, Wikidata' wording is replaced; the dossier manifest names
  categories only and needed no change.
- runner.rs: a Probe backend (records SearchQuery, serves a Google News
  item whose read ends on the publisher's page) backs three tests: a
  search in a category the app was not granted is denied with the grant
  reason and never reaches the backend; a granted category is passed
  through to the backend as SearchQuery.category; a redirected read
  reports resolved_url and publisher_host in both the article output and
  the run's provenance.
- templates.rs: the dossier template's two fixtures replay green in a
  named test.
- rustfmt over the port's long call chains.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant