Repository navigation
toolbox-peers: offer the system toolbox to app agents (ADR 0002 §6, ADR 0004 §12, behind a feature) - #151
Merged
Conversation
…DR 0004 §12) Re-port of #108 onto main's octos#2567 shell side (#145), behind the `toolbox-peers` feature (off by default): - the toolbox is one more owning app (`toolbox`) in the shell's host-tool relay: its tools are declared once in the catalog (`app: "toolbox"`, shareable), each app is granted exactly what it declares AND the person granted, and `ToolboxExecutor` (crates/ai-host) runs the calls the relay routes to it; main's broker registers them after every prepare and reconnect. #108's own registration and routing are not ported; - no hard-coded exclusions: #108's "never offer octos deep_research" (its empty generic_tools) is gone; - the #120 first-use consent gates the toolbox: nothing offered (Catalog::offered) and nothing run (the relay's consent_pending) before the person allowed the app's agent; - ported from #108: crates/toolbox `peer` (plus a shared `catalog`), read_links/narrow_crawl, ModelHostClient, toolbox_folder, the 256 KiB host model input, the mock model's CALL_TOOL rule; tests against a scripted kernel through main's broker, the relay, and a real octos kernel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # crates/shell/src/host_tools/tests.rs
# Conflicts: # crates/shell/src/host_tools/relay.rs
This was referenced Sep 29, 2026
chrislearn
pushed a commit
to chrislearn/OctoSense
that referenced
this pull request
Oct 8, 2026
…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 OctoSense-org#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 OctoSense-org#151 shape; only the category plumbing was added to it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ADR 0002 §6 / ADR 0004 §12: the system toolbox offered to app agents as host-routed tools, on top of octos#2567's shell side from #145. This supersedes #108, which was written before octos#2567 was final and conflicts with main. This PR re-ports #108's toolbox parts onto main instead of rebasing it. Everything is behind the
toolbox-peersfeature, which is off by default (shell, desktop, phone andoctosense-ai-host).What changed vs #108
crates/app-peers/src/peer_tools.rs, itsbroker.rsregistration and routing, thepeer-toolsfeature andhosted::launch_with_toolsare not ported.peer/prepareand reconnect, withgeneric_toolsomitted. They come fromToolHost::declarations.crates/shell/src/host_tools/) authorizes each call and routes it.toolbox), not a second tool host.app: "toolbox"andshareable.ToolboxExecutoris installed as thetoolboxowner's executor, the same seam an in-process module uses. It runs each call with the toolbox engine.deep_research" is gone. In practice that rule was the emptygeneric_toolslist, which stripped every kernel tool from the peer. toolbox-peers: offer the system toolbox to app agents (ADR 0002 §6, behind a feature) #108'sworkflow.list/workflow.evaluatewere simply never declared, and still aren't.ToolboxGrant::new(app, declared, granted, scope).researchgrant givesworkflow.run(read),workflow.fork(act),toolbox.search(read) andtoolbox.web_read(read).crawlgrant, withmax_depth/max_pages> 0, givestoolbox.deep_crawl(read).ShellToolHost::declarationsleaves out the toolbox's tools (Catalog::offered).consent_pending), as it does for every host tool on main.grant_module, beforeoffer_with). Those capabilities are compiled in and reviewed with the shell.os.*-only rule to modules too. That rule is kept only for script-app manifests (ToolboxGrant::for_manifest), because the shells' App Hub pin (e8601b80) still does not include App Hub mobile: native-feeling frame pacing on the phone #26.Catalog::may_call). It still grants other shareable tools as before.crates/toolboxpeermodule,read_links/LinkedPage,scope::narrow_crawland its octos parity test.ModelHostClientand the 256 KiB host input limit in themodelservice.toolbox_folder/toolbox_root.CALL_TOOLrule.peer::catalog()is new;tool_declsis the catalog narrowed to the grant.deep_crawl's description no longer embeds one app's limits, since the catalog entry is shared.Overlaps G3 (home-96's
feat/adr0004-g3-app-tools)These are small seams in
crates/shell/src/host_tools/, kept separable so G3 can adopt or replace them:Catalog::set_grants(caller, owner, tools)replaces a caller's grants of one owner's tools. Main'sgrant(caller, tool)is only additive.Catalog::offered(app, dev_all, consented)isdeclarationswithout thetoolboxowner's tools until consent.relay::TOOLBOXandhost_tools::toolbox::{init, set_grant, grant_module, grant_manifest}.grant_manifesthas no caller yet: App Hub install ortools.jsonloading (G3) is where a script app's grant comes from.generic_tools; that is G3's job.Tests
Scripted kernel, via main's broker (
crates/ai-host/tests/toolbox_peers.rs, 8 tests). AToolHoststands in for the relay. The tests cover:app: "toolbox";workflow.run/fork/search/web_readexecuted by the toolbox, with results under.host;deep_crawl, refused by the relay and by the executor itself;ModelHostand the app's budget.Shell relay (
crates/shell/src/host_tools/tests.rs, +2 tests, with and without the feature):Toolbox: #108's unit tests, the crawl test (
tests/peer.rs) and the catalog test ("everything granted is offered, nothing held back").Real kernel, octos acffad3b (the pin), built locally with
cargo build --release -p octos-cli --bin octos --no-default-features --features api:crates/ai-host/tests/toolbox_real_kernel.rs(new) passes.toolbox_search,toolbox_web_read,workflow_fork,workflow_runamong the toolbox's.toolbox_searchandworkflow_run; the result lands in.host.toolbox_deep_crawlis not offered withoutcrawl.crates/app-peers/tests/real_kernel.rs: 8/8 pass.Commands run locally:
cargo test --lockedfor:live,octos-engine);octos-core,llm,toolbox-peers);octos-core,ws);phone/:cargo test --locked --features mobile-apps -p octosense-shell: 509 pass;--features mobile-apps,toolbox-peers ... host_tools: 11 pass;cargo check --locked -p octosense-home --features mobile-apps(and+toolbox-peers).-D warnings:toolbox-peers,octos-core,llm);octos-core,ws);live,octos-engine);cargo fmt -p octosense-toolbox --checkandpython3 tools/native_apps.py --check.CI:
apps.ymlnow tests and lints ai-host withtoolbox-peers.phone.ymlruns the shell'shost_toolstests withtoolbox-peers.kernel-security. That Ubuntu job does not build Makepad, which ai-host links. The test skips withoutOCTOS_APP_PEERS_TEST_KERNEL.Not done / unverified
deep_research"when declared and granted" is not testable here.apibuild and the test profile offer nodeep_researchordeep_search.generic_toolslist, which is G3's.generic_toolscan only narrow the profile's roster, never widen it.No pin moved, and no Rinx code was touched.
🤖 Generated with Claude Code