tools capa

tools-parties-test-db

Provisions/tears down the ONE disposable FreeBSD jail (parties-test, 10.0.0.7) used to live-verify the identity/parties tenant-isolation fixes against a real Postgres -- never pg0 (the fleet's source-of-truth DB, explicitly flagged elsewhere in this workspace as never to be touched by experimental/adversarial writes). The jail name is a compile-time constant, not a CLI argument, specifically so this tool cannot be pointed at any other jail by mistake.

Provisions/tears down the ONE disposable FreeBSD jail (parties-test, 10.0.0.7) used to live-verify the identity/parties tenant-isolation fixes against a real Postgres -- never pg0 (the fleet's source-of-truth DB, explicitly flagged elsewhere in this workspace as never to be touched by experimental/adversarial writes). The jail name is a compile-time constant, not a CLI argument, specifically so this tool cannot be pointed at any other jail by mistake.

Tiertools
Roleunclassified (baselined)
Pathcrates/tools/parties-test-db
Edition2021
Targetstools-parties-test-db, tools_parties_test_db
Public items18 across 0 modules
Tests3

What it is for

Idempotent provision/teardown of the ONE disposable jail used to live-verify identity/parties tenant-isolation fixes against a real Postgres.

# Why a jail, and why not pg0

pg0 is this fleet's postgres jail, but it is documented elsewhere in this workspace (the inventory-shop USD module's own source comment) as the "laptop's source-of-truth," never to be touched by a module that isn't specifically provisioning it. Loading adversarial two-tenant test data into it -- even into a separate database -- is exactly the kind of use that documentation warns against. This tool creates a SEPARATE, disposable jail instead: same host (freebsd-vm, reached directly via SSH -- this is dev/test infra, not a fleet node behind the usd relay), its own IP, destroyable at any time with zero effect on anything else.

# Why the jail name is a constant, not a parameter

JAIL_NAME is baked in, not a CLI flag. teardown() runs jstop then jremove -- there is no code path in this crate that can construct that command with any other name, by construction, not by a runtime check that could be bypassed with the wrong flag.

# What this does NOT do

It does not run the identity/parties migrations or the crate's own integration tests -- those already exist (crates/identity/parties/ tests/integration_tests.rs, driven by TEST_DATABASE_URL). verify() wires provision -> port-forward -> migrate -> test -> teardown into one procedure by SHELLING OUT to sqlx-cli and cargo test (existing, established tools) rather than reimplementing migration-running or test execution here -- rule 14 is about not hand-running this ad-hoc, not about not reusing what already exists.

Capabilities

verb:constants

Idempotent provision/teardown of the ONE disposable jail used to

Item
pub const JAIL_NAME: & str
pub const JAIL_IP: & str
pub const JAIL_VER: & str
pub const DB_NAME: & str
pub const DB_ROLE: & str
pub const DB_PASSWORD: & str

verb:jail

Idempotent provision/teardown of the ONE disposable jail used to

Item
fn jail_exists() -> Result <bool>
fn jail_running() -> Result <bool>

verb:postgres

Idempotent provision/teardown of the ONE disposable jail used to

Item
fn postgres_installed() -> Result <bool>
fn postgres_initialized() -> Result <bool>
fn postgres_configured() -> Result <bool>
fn postgres_running() -> Result <bool>

verb:provision

Idempotent provision/teardown of the ONE disposable jail used to

Item
fn provision() -> Result <()>

verb:ssh

Idempotent provision/teardown of the ONE disposable jail used to

Item
fn ssh_argv(remote_cmd : & str) -> Vec <String>

verb:status

Idempotent provision/teardown of the ONE disposable jail used to

Item
fn status() -> Result <()>

verb:teardown

Idempotent provision/teardown of the ONE disposable jail used to

Item
fn teardown() -> Result <()>

verb:test

Idempotent provision/teardown of the ONE disposable jail used to

Item
fn test_db_exists() -> Result <bool>

verb:verify

Idempotent provision/teardown of the ONE disposable jail used to

Item
fn verify() -> Result <()>

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 JAIL_NAME: & str
pub const JAIL_IP: & str
pub const JAIL_VER: & str
pub const DB_NAME: & str
pub const DB_ROLE: & str
pub const DB_PASSWORD: & strNot a real secret: the role is only reachable from inside the jail bridge subnet (never exposed beyond an explicit SSH port-forward the operator runs by hand), and the whole jail is destroyable on demand.
fn ssh_argv(remote_cmd : & str) -> Vec <String>Build the ssh argv for one remote command
fn jail_exists() -> Result <bool>
fn jail_running() -> Result <bool>
fn postgres_installed() -> Result <bool>
fn postgres_initialized() -> Result <bool>
fn postgres_configured() -> Result <bool>Distinct from postgres_initialized -- initdb and "listen_addresses was appended to postgresql.conf" are two different steps that can fail independently (found live: initdb succeeded, the config-append step failed on a quoting bug, and a naive "PG_VERSION exists -> skip this whole block" check would have silently skipped the config step forever on re-run)
fn postgres_running() -> Result <bool>
fn test_db_exists() -> Result <bool>
fn provision() -> Result <()>Idempotent: every step checks before acting.
fn verify() -> Result <()>The wired procedure: provision -> port-forward -> migrate -> test -> always tear the tunnel down (jail itself is left running -- teardown is a separate, explicit step, not implied by a passing test run).
fn teardown() -> Result <()>Stop and remove the jail
fn status() -> Result <()>

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

Boundary

Depends on no other workspace tier.

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)
Locationcrates/tools/parties-test-db
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
anyhow^1noalways

Development. None.

Build. None.

Depended on by. Nothing in this workspace.

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
bintools-parties-test-db`src/main.rs`
libtools_parties_test_db`src/lib.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

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
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
CARGO_MANIFEST_DIRsrc/lib.rs

No workspace crate depends on this one.

Verification

KindCount
Unit tests3
Integration tests0
Examples0
Doctests0

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

ModuleTestsExamplesConsumers
crate root1800

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc618
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 6
    "No rustdoc detected" : 12

Metrics

MetricValue
Rust source files2
Source lines563
Code lines361
Public API items18
Public modules0
Tests3
Examples0
Cargo features0
Direct runtime dependencies1
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "constant" : 6
    "function" : 12
pie showData
    title Rust source composition
    "Code" : 361
    "Blank or comment" : 202

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.

Todas las tools · Manual