Measures the sighting archive: conversation closure, profile churn, presence density, photo reuse across profiles, and self-description field completeness. Every statistic is computed by a pure function over rows, so the arithmetic is tested without a database and the numbers are reproducible from the corpus rather than estimated.
| Tier | tools |
| Role | tooling |
| Path | crates/tools/sighting-measure |
| Edition | 2021 |
| Targets | tools-sighting-measure, tools_sighting_measure |
| Public items | 17 across 0 modules |
| Tests | 14 |
What it is for
Measures the sighting archive and reports numbers a product document can cite as a baseline.
Five measurements, each a pure function over rows that the binary reads from Postgres: conversation closure, profile churn, presence density, photo reuse across profiles, and self-description field completeness. The arithmetic lives here so it is tested against fixture rows with no database attached; the binary supplies real rows and prints the same structs.
Every result carries the corpus it was computed over. A statistic without its denominator is not a baseline, and the store grows while the tap runs — so a number is only meaningful with the row count and the as-of instant beside it.
Capabilities
crate root
Measures the sighting archive and reports numbers a product document can cite as a baseline.
| Item |
|---|
fn closure_stats(msgs : & Message, observer : & str, as_of : DateTime <Utc>, silent_after : Duration,) -> ClosureStats |
fn churn_stats(lives : & ProfileLife, as_of : DateTime <Utc>, dark_after : Duration,) -> ChurnStats |
fn density_stats(rows : & Position) -> DensityStats |
fn reuse_stats(rows : & MediaRow) -> ReuseStats |
ChurnStats
Measures the sighting archive and reports numbers a product document can cite as a baseline.
| Item |
|---|
pub struct ChurnStats |
ClosureStats
Measures the sighting archive and reports numbers a product document can cite as a baseline.
| Item |
|---|
pub struct ClosureStats |
DensityStats
Measures the sighting archive and reports numbers a product document can cite as a baseline.
| Item |
|---|
pub struct DensityStats |
Ending
Measures the sighting archive and reports numbers a product document can cite as a baseline.
| Item |
|---|
pub enum Ending |
fn ending_of(msgs : & Message, observer : & str, as_of : DateTime <Utc>, silent_after : Duration,) -> Ending |
FieldFill
Measures the sighting archive and reports numbers a product document can cite as a baseline.
| Item |
|---|
pub struct FieldFill |
fn facet_fill(pairs : & (& str, usize), total : usize) -> Vec <FieldFill> |
MediaRow
Measures the sighting archive and reports numbers a product document can cite as a baseline.
| Item |
|---|
pub struct MediaRow |
Message
Measures the sighting archive and reports numbers a product document can cite as a baseline.
| Item |
|---|
pub struct Message |
Position
Measures the sighting archive and reports numbers a product document can cite as a baseline.
| Item |
|---|
pub struct Position |
ProfileLife
Measures the sighting archive and reports numbers a product document can cite as a baseline.
| Item |
|---|
pub struct ProfileLife |
ProfileLife :: fn reobserved(& self) -> bool |
ReuseStats
Measures the sighting archive and reports numbers a product document can cite as a baseline.
| Item |
|---|
pub struct ReuseStats |
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`
| Item | What it is |
|---|---|
pub struct Message | One message, reduced to what closure depends on. |
pub enum Ending | How a conversation ended, from the observer's side. |
pub struct ClosureStats | — |
fn ending_of(msgs : & Message, observer : & str, as_of : DateTime <Utc>, silent_after : Duration,) -> Ending | Classify one conversation |
fn closure_stats(msgs : & Message, observer : & str, as_of : DateTime <Utc>, silent_after : Duration,) -> ClosureStats | Group messages by conversation and classify every one. |
pub struct ProfileLife | One profile's life, reduced to what churn depends on |
ProfileLife :: fn reobserved(& self) -> bool | Was this profile ever captured a second time? Only then could an edit have been seen |
pub struct ChurnStats | — |
fn churn_stats(lives : & ProfileLife, as_of : DateTime <Utc>, dark_after : Duration,) -> ChurnStats | — |
pub struct Position | — |
pub struct DensityStats | — |
fn density_stats(rows : & Position) -> DensityStats | — |
pub struct MediaRow | — |
pub struct ReuseStats | — |
fn reuse_stats(rows : & MediaRow) -> ReuseStats | — |
pub struct FieldFill | One field's fill rate |
fn facet_fill(pairs : & (& str, usize), total : usize) -> Vec <FieldFill> | Build fill rates from (field, filled) pairs against a shared row total. |
No pub use re-exports: every item above is declared in this crate.
Boundary
Reaches into identity.
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) | tooling |
| Location | crates/tools/sighting-measure |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_tools["tools"] --> n_identity["identity"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `identity-tenant` | identity | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
anyhow | ^1 | — | no | always |
chrono | ^0.4 | serde | no | always |
clap | ^4 | derive, env | no | always |
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
sqlx | ^0.8 | runtime-tokio, postgres, chrono, uuid, json | no | always |
tokio | ^1 | full | no | always |
Development, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `tools-cli-conformance` | tools | no | always |
Build. None.
Depended on by. Nothing in this workspace.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR SELF["tools-sighting-measure"] SELF -->|development| n_tools_cli_conformance["tools-cli-conformance"] SELF -->|runtime| n_identity_tenant["identity-tenant"] 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 | tools-sighting-measure | `src/main.rs` |
| lib | tools_sighting_measure | `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
| Property | Evidence |
|---|---|
| async public surface | none detected |
| async runtime | yes |
| database access | yes |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
No workspace crate depends on this one.
Verification
| Kind | Count |
|---|---|
| Unit tests | 14 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 16 | 0 | 0 |
What the tests establish, by name:
a_conversation_inside_the_reply_window_is_not_yet_abandoned—src/lib.rsa_corpus_shorter_than_the_window_reports_no_dark_rate_rather_than_zero—src/lib.rsa_missing_hash_never_counts_as_a_match—src/lib.rsa_profile_standing_still_is_not_counted_as_having_moved—src/lib.rsan_empty_corpus_reports_zero_rather_than_dividing_by_zero—src/lib.rsan_image_under_one_profile_is_not_reuse—src/lib.rschurn_counts_only_profiles_seen_more_than_once_as_able_to_change—src/lib.rsclosure_rate_excludes_the_still_open_from_the_numerator_only—src/lib.rsfill_rates_sort_by_how_often_people_actually_answer—src/lib.rsmessage_order_does_not_depend_on_row_order—src/lib.rsone_far_away_observation_does_not_stretch_the_box_across_a_continent—src/lib.rsone_side_talking_is_never_counted_as_an_ending—src/lib.rsthe_side_that_spoke_last_is_not_the_side_that_went_silent—src/lib.rscli_definition_conforms—src/main.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 8 | 17 |
Public modules with a //! block | 0 | 0 |
pie showData
title Public items with rustdoc
"Documented" : 8
"No rustdoc detected" : 9
Metrics
| Metric | Value |
|---|---|
| Rust source files | 2 |
| Source lines | 1154 |
| Code lines | 932 |
| Public API items | 17 |
| Public modules | 0 |
| Tests | 14 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 8 |
| Workspace reverse dependencies | 0 |
pie showData
title Public API by kind
"enum" : 1
"function" : 6
"method" : 1
"struct" : 9
pie showData
title Rust source composition
"Code" : 932
"Blank or comment" : 222
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.