tools tier

tools-imp-control

Administration for the imp_control database: apply its registered schema through the module migration runner, and register a repository -- the row a context switch resolves into a mirror corpus, a record corpus, a tree and an executor. The sanctioned writer for a registry that routes between repositories and therefore cannot live inside one of them.

Administration for the imp_control database: apply its registered schema through the module migration runner, and register a repository -- the row a context switch resolves into a mirror corpus, a record corpus, a tree and an executor. The sanctioned writer for a registry that routes between repositories and therefore cannot live inside one of them.

Tiertools
Roletooling
Pathcrates/tools/imp-control
Edition2021
Targetsimp-control, tools_imp_control
Public items24 across 0 modules
Tests15

What it is for

imp_control's administration: apply its schema, and register a repository.

Why a writer rather than an INSERT: tools-shell-guard refuses a hand-written statement against a live database, and it is right to. A repository row is what a context switch resolves — the corpus that holds what was read, the corpus that holds what was decided, the tree, the executor. A typo in it does not fail loudly; it silently routes work to the wrong place.

The validation here is pure, so every refusal is a unit test rather than a live-database experiment.

Capabilities

crate root

imp_control's administration: apply its schema, and register a repository.

Item
pub const MAX_SHORT_NAME: usize
fn validate(r : & Registration) -> Result <(), RegisterError>
fn weigh(tables : & (String, i64), side_of : & std::collections::BTreeMap <String, Side>,) -> Weight
fn reconcile(estate : & ConnectionRow, host : & ConnectionRow) -> Vec <Divergence>

ConnectionRow

imp_control's administration: apply its schema, and register a repository.

Item
pub struct ConnectionRow

Crossing

imp_control's administration: apply its schema, and register a repository.

Item
pub struct Crossing
Crossing :: fn is_internal(& self) -> bool
Crossing :: fn is_forward(& self) -> bool

Divergence

imp_control's administration: apply its schema, and register a repository.

Item
pub enum Divergence
fn contradicts(divergences : & Divergence) -> bool

Edges

imp_control's administration: apply its schema, and register a repository.

Item
pub struct Edges
fn classify_edges(edges : & (String, String), side_of : & std::collections::BTreeMap <String, Side>,) -> Edges

RegisterError

imp_control's administration: apply its schema, and register a repository.

Item
pub enum RegisterError
fn validate_short_name(short : & str) -> Result <(), RegisterError>

Registration

imp_control's administration: apply its schema, and register a repository.

Item
pub struct Registration

Side

imp_control's administration: apply its schema, and register a repository.

Item
pub enum Side
Side :: fn parse(s : & str) -> Option <Self>
Side :: fn as_str(self) -> & 'static str
fn parse_classification(text : & str) -> Result <Vec <(String, Side)>, String>

SiteKind

imp_control's administration: apply its schema, and register a repository.

Item
pub enum SiteKind
fn classify_line(line : & str) -> SiteKind

Weight

imp_control's administration: apply its schema, and register a repository.

Item
pub struct Weight

Wiring

imp_control's administration: apply its schema, and register a repository.

Item
pub struct Wiring
pub const WIRING: & Wiring

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 const MAX_SHORT_NAME: usizeThe longest a handle may be
pub enum RegisterError—
pub struct RegistrationWhat a repository registration says.
fn validate(r : & Registration) -> Result <(), RegisterError>Check a registration before it reaches the database
fn validate_short_name(short : & str) -> Result <(), RegisterError>The handle rule, separately so a caller can check one before asking
pub enum SideWhich of the three authorities a table belongs to
Side :: fn parse(s : & str) -> Option <Self>Parse the word the classification file uses.
Side :: fn as_str(self) -> & 'static str—
fn parse_classification(text : & str) -> Result <Vec <(String, Side)>, String>Read the classification file: table<TAB>side<TAB>rows<TAB>reason, with # comments and blank lines ignored
pub struct CrossingOne foreign key, by the sides it connects.
Crossing :: fn is_internal(& self) -> boolDoes this edge stay inside one authority?
Crossing :: fn is_forward(& self) -> boolDoes it point the way dependency is allowed to run — the specific depending on the general? record -> upstream, record -> control and upstream -> control are forward: they become stable-UUID references
pub struct WeightWhat each authority would weigh, and what nobody has classified.
fn weigh(tables : & (String, i64), side_of : & std::collections::BTreeMap <String, Side>,) -> WeightWeigh every live table against the classification.
pub struct EdgesEvery foreign key, sorted into what the cut would do to it.
fn classify_edges(edges : & (String, String), side_of : & std::collections::BTreeMap <String, Side>,) -> EdgesSort the foreign keys by what the decomposition would do to each.
pub enum SiteKindWhat one line does with a connection identifier
fn classify_line(line : & str) -> SiteKindClassify one line by what it does with the identifier
pub struct WiringA connection identifier hardcoded somewhere in the tree, and the setting that should replace it
pub const WIRING: & WiringEvery connection identifier this estate currently hardcodes
pub struct ConnectionRowOne registry's statement about how something is reached
pub enum DivergenceWhat two registries disagree about, or what only one of them knows.
fn reconcile(estate : & ConnectionRow, host : & ConnectionRow) -> Vec <Divergence>Compare the estate's datasource registry with the host's connections
fn contradicts(divergences : & Divergence) -> boolTrue when the two registries contradict each other about something both name

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

Boundary

Reaches into application, operations.

Shares tier tools with 90 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, … (90 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)tooling
Locationcrates/tools/imp-control
Vocabulary in force (lexicon)current

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

flowchart LR
  n_tools["tools"] --> n_application["application"]
  n_tools["tools"] --> n_operations["operations"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`application-core`applicationnoalways
`operations-control-plane`operationsnoalways
`tools-packet-apply`toolsnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
clap^4derivenoalways
serde_json^1—noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
thiserror^2—noalways
tokio^1full, macros, rt-multi-threadnoalways
uuid^1v4, v7, serde, js, v7noalways

Development, in this workspace.

CrateTierOptionalOnly on
`tools-cli-conformance`toolsnoalways

Build. None.

Depended on by. Nothing in this workspace.

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

flowchart LR
  SELF["tools-imp-control"]
  SELF -->|development| n_tools_cli_conformance["tools-cli-conformance"]
  SELF -->|runtime| n_application_core["application-core"]
  SELF -->|runtime| n_operations_control_plane["operations-control-plane"]
  SELF -->|runtime| n_tools_packet_apply["tools-packet-apply"]
  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
binimp-control`src/main.rs`
libtools_imp_control`src/lib.rs`

Error model

Error typeNamed by
RegisterErrorvalidate, validate_short_name

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimeyes
database accessyes
network I/Onone detected
unsafe codenone detected
environment variablesyes

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

Configuration

VariableRead in
CORPUS_HOST_DBsrc/main.rs
CORPUS_SOURCECODE_APP_DBsrc/main.rs
IMP_CONTROL_DBsrc/main.rs

No workspace crate depends on this one.

Verification

KindCount
Unit tests15
Integration tests0
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
crate root2000

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc2224
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 22
    "No rustdoc detected" : 2

Metrics

MetricValue
Rust source files2
Source lines1717
Code lines1376
Public API items24
Public modules0
Tests15
Examples0
Cargo features0
Direct runtime dependencies9
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "constant" : 2
    "enum" : 4
    "function" : 8
    "method" : 4
    "struct" : 6
pie showData
    title Rust source composition
    "Code" : 1376
    "Blank or comment" : 341

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