imp — the terminal client over the agent engine: a REPL that parses config, runs the loop and renders events, with every other behavior upstream (ADR 0044 §3)
| Tier | tools |
| Role | unclassified (baselined) |
| Path | crates/tools/imp |
| Edition | 2021 |
| Targets | imp, cli_test |
| Public items | 0 across 0 modules |
| Tests | 187 |
What it is for
imp — thin terminal REPL over the infrastructure-agent engine (Sprint 02).
Thin-layer contract (Gate 4.5): this binary parses config, runs the REPL, and renders events. Every other behavior lives upstream in infrastructure-agent — if logic wants to live here, lift it instead.
Three modes: open (hosted model), private (local Ollama, no network) and research (local Ollama with network). Screening runs in both directions, attachments are read by local OCR before they reach a model, and the file tools are sandboxed to the launch directory plus each --add-dir.
Landed here by git subtree add from its own repository in sprint 4.46; that history is frozen under docs/archive/imp-cli.
Capabilities
No public items.
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
No public items.
No pub use re-exports: every item above is declared in this crate.
Boundary
Reaches into foundation, infrastructure, operations.
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) |
| Location | crates/tools/imp |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_tools["tools"] --> n_foundation["foundation"] n_tools["tools"] --> n_infrastructure["infrastructure"] n_tools["tools"] --> n_operations["operations"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `foundation-audit-log` | foundation | no | always |
| `foundation-bounded-io` | foundation | no | always |
| `infrastructure-agent` | infrastructure | no | always |
| `infrastructure-ai` | infrastructure | no | always |
| `infrastructure-ocr-engine` | infrastructure | no | always |
| `infrastructure-ocr-tesseract` | infrastructure | no | always |
| `operations-control-plane` | operations | no | always |
| `tools-doc-read` | tools | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
anyhow | ^1 | — | no | always |
async-trait | ^0.1 | — | no | always |
base64 | ^0.22 | — | no | always |
libc | ^0.2 | — | no | always |
serde | ^1 | derive, derive | no | always |
serde_json | ^1 | — | no | always |
sqlx | ^0.8 | runtime-tokio, postgres, chrono, uuid, json, runtime-tokio, … (11 total) | no | always |
ssh2 | ^0.9 | — | no | always |
thiserror | ^2 | — | no | always |
tokio | ^1 | full, full | no | always |
uuid | ^1 | v4, v7, serde, js, v4, serde | no | always |
Development. None.
Build. None.
Depended on by. Nothing in this workspace.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR SELF["tools-imp"] SELF -->|runtime| n_foundation_audit_log["foundation-audit-log"] SELF -->|runtime| n_foundation_bounded_io["foundation-bounded-io"] SELF -->|runtime| n_infrastructure_agent["infrastructure-agent"] SELF -->|runtime| n_infrastructure_ai["infrastructure-ai"] SELF -->|runtime| n_infrastructure_ocr_engine["infrastructure-ocr-engine"] SELF -->|runtime| n_infrastructure_ocr_tesseract["infrastructure-ocr-tesseract"] SELF -->|runtime| n_operations_control_plane["operations-control-plane"] SELF -->|runtime| n_tools_doc_read["tools-doc-read"] 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
| Kind | Name | Source |
|---|---|---|
| bin | imp | `src/main.rs` |
| test | cli_test | `tests/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
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | yes |
| database access | yes |
| network I/O | none detected |
| unsafe code | yes |
| environment variables | yes |
Unsafe code.
| Site | Source |
|---|---|
unsafe block | src/main.rs |
unsafe block | src/style.rs |
unsafe block | src/style.rs |
unsafe block | src/term.rs |
unsafe block | src/term.rs |
unsafe block | src/term.rs |
unsafe block | src/term.rs |
unsafe block | src/term.rs |
Configuration
| Variable | Read in |
|---|---|
CARGO_PKG_VERSION | src/control_plane.rs |
COLUMNS | src/style.rs |
CORPUS_SOURCECODE_APP_DB | src/control_plane.rs |
HOME | src/main.rs |
IMP_CLAUDE_ALLOW | src/main.rs |
IMP_CLAUDE_ARGS | src/main.rs |
IMP_CLAUDE_BIN | src/main.rs |
NO_COLOR | src/main.rs |
OLLAMA_ENDPOINTS | src/main.rs |
PATH | src/main.rs |
Related capabilities
No workspace crate depends on this one.
Verification
| Kind | Count |
|---|---|
| Unit tests | 167 |
| Integration tests | 20 |
| Examples | 0 |
| Doctests | 0 |
What the tests establish, by name:
assistant_text_at_max_succeeds—tests/cli_test.rsassistant_text_over_max_is_rejected—tests/cli_test.rsassistant_text_with_api_key_is_redacted—tests/cli_test.rsassistant_text_with_multiple_secrets_redacted—tests/cli_test.rsassistant_text_with_password_is_redacted—tests/cli_test.rsassistant_text_with_token_is_redacted—tests/cli_test.rsdead_child_is_loud_nonzero—tests/cli_test.rsdefault_argv_matches_claudestart_and_permissions_flag_opts_out—tests/cli_test.rslive_real_claude_one_turn—tests/cli_test.rsrepl_turn_renders_thin_over_fake_child—tests/cli_test.rsscreening_stops_a_secret_before_it_reaches_the_child—tests/cli_test.rsslash_command_expands_from_a_prompt_file—tests/cli_test.rstest_help_flag—tests/cli_test.rstest_version_flag—tests/cli_test.rsunknown_flag_exits_2_with_usage—tests/cli_test.rsunknown_slash_command_is_reported_and_not_sent—tests/cli_test.rsuser_input_clean_not_flagged—tests/cli_test.rsuser_input_entirely_secret_rejected—tests/cli_test.rsuser_input_with_password_redacted—tests/cli_test.rsuser_input_with_secret_is_redacted_before_sending—tests/cli_test.rsa_flag_after_tunnel_is_a_flag_not_a_destination—src/config.rsa_missing_import_manifest_means_no_local_only_models—src/config.rsa_missing_never_send_file_is_not_an_error—src/config.rsa_port_that_is_not_a_port_is_an_error_not_a_zero—src/config.rsadd_dir_grants_directories_beyond_the_working_one—src/config.rscolor_modes_parse_and_default_to_auto—src/config.rsdefault_engine_args_carry_the_skip_flag—src/config.rsdefaults_are_claude_cheap_model_and_skip_permissions—src/config.rsempty_env_args_falls_back_to_defaults—src/config.rsenv_args_override_is_whitespace_split—src/config.rs- _… 157 more_
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 0 | 0 |
Public modules with a //! block | 0 | 0 |
Metrics
| Metric | Value |
|---|---|
| Rust source files | 18 |
| Source lines | 6818 |
| Code lines | 5372 |
| Public API items | 0 |
| Public modules | 0 |
| Tests | 187 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 19 |
| Workspace reverse dependencies | 0 |
pie showData
title Rust source composition
"Code" : 5372
"Blank or comment" : 1446
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.