domain tier

domain-research

Multi-source research runs, artifacts, and conclusions for entity valuation and enrichment

Multi-source research runs, artifacts, and conclusions for entity valuation and enrichment

Tierdomain
Roleunclassified (baselined)
Pathcrates/domain/research
Edition2021
Targetsdomain_research
Public items103 across 7 modules
Tests25

What it is for

Multi-source research runs, artifacts, and conclusions for entity valuation and enrichment.

This crate provides the persistence layer for multi-source research pipelines. A research run is scoped to any entity and produces artifacts from external sources, culminating in conclusions (valuations, descriptions, classifications).

# Use Cases

# Architecture

ResearchRun (orchestration)
└── ResearchArtifact (evidence from sources)
└── ResearchConclusion (the answers)

The crate is deliberately source-agnostic: artifact payloads are serde_json::Value, and the application layer defines typed payload structs and provider implementations.

# Features

# Example

use domain_research::{ResearchRun, ResearchArtifact, ResearchConclusion};
use domain_research::{ConclusionType, Confidence};
use foundation_basemodels::HasId;
use uuid::Uuid;

let item_id = Uuid::new_v4();

// Create a pricing research run
let run = ResearchRun::builder("catalog_item", item_id, "pricing")
.tenant(Uuid::new_v4())
.build()
.unwrap();

// Create artifacts for different sources
let lens_artifact = ResearchArtifact::builder(run.id(), "visual_search", "google_lens")
.entity("catalog_item", item_id)
.source_identifier("photo-001")
.provider("google")
.build()
.unwrap();

// Create the conclusion
let conclusion = ResearchConclusion::builder(run.id(), ConclusionType::Valuation)
.entity("catalog_item", item_id)
.value(3000, "USD") // $30.00 in minor units
.confidence(Confidence::High)
.summary("YETI Rambler 36oz in good condition, estimated $25-$35")
.derived_from(veclens_artifact.id())
.build()
.unwrap();

assert!(conclusion.confidence == Some(Confidence::High));

Capabilities

ResearchError

_No module-level documentation is present in the source._

Item
pub enum ResearchError

Result

_No module-level documentation is present in the source._

Item
pub type Result<T>: std::result::Result <T, ResearchError>

ResearchEvent

_No module-level documentation is present in the source._

Item
pub enum ResearchEvent

ArtifactBuilder

_No module-level documentation is present in the source._

Item
pub struct ArtifactBuilder
ArtifactBuilder :: fn tenant(mut self, tenant_id : Uuid) -> Self
ArtifactBuilder :: fn entity(mut self, entity_type : impl Into <String>, entity_id : Uuid) -> Self
ArtifactBuilder :: fn source_identifier(mut self, id : impl Into <String>) -> Self
ArtifactBuilder :: fn provider(mut self, name : impl Into <String>) -> Self
ArtifactBuilder :: fn build(self) -> crate::Result <ResearchArtifact>

ConclusionBuilder

_No module-level documentation is present in the source._

Item
pub struct ConclusionBuilder
ConclusionBuilder :: fn tenant(mut self, tenant_id : Uuid) -> Self
ConclusionBuilder :: fn entity(mut self, entity_type : impl Into <String>, entity_id : Uuid) -> Self
ConclusionBuilder :: fn value(mut self, amount_minor : i64, currency : impl Into <String>) -> Self
ConclusionBuilder :: fn confidence(mut self, confidence : Confidence) -> Self
ConclusionBuilder :: fn summary(mut self, summary : impl Into <String>) -> Self
ConclusionBuilder :: fn detail(mut self, detail : JsonValue) -> Self
ConclusionBuilder :: fn derived_from(mut self, artifact_ids : Vec <Uuid>) -> Self
ConclusionBuilder :: fn build(self) -> crate::Result <ResearchConclusion>

ResearchArtifact

_No module-level documentation is present in the source._

Item
pub struct ResearchArtifact
ResearchArtifact :: fn id(& self) -> Uuid
ResearchArtifact :: fn created_at(& self) -> DateTime <Utc>
ResearchArtifact :: fn updated_at(& self) -> DateTime <Utc>
ResearchArtifact :: fn builder(run_id : Uuid, artifact_type : impl Into <String>, source_type : impl Into <String>,) -> ArtifactBuilder
ResearchArtifact :: fn start(& mut self) -> crate::Result <()>
ResearchArtifact :: fn complete(& mut self, payload : JsonValue) -> crate::Result <()>
ResearchArtifact :: fn fail(& mut self, error : impl Into <String>, max_attempts : i32)
ResearchArtifact :: fn skip(& mut self, reason : impl Into <String>)
ResearchArtifact :: fn cancel(& mut self)
ResearchArtifact :: fn can_retry(& self, max_attempts : i32) -> bool

ResearchConclusion

_No module-level documentation is present in the source._

Item
pub struct ResearchConclusion
ResearchConclusion :: fn id(& self) -> Uuid
ResearchConclusion :: fn created_at(& self) -> DateTime <Utc>
ResearchConclusion :: fn updated_at(& self) -> DateTime <Utc>
ResearchConclusion :: fn builder(run_id : Uuid, conclusion_type : ConclusionType) -> ConclusionBuilder
ResearchConclusion :: fn accept(& mut self, accepted_by : Option <Uuid>)
ResearchConclusion :: fn is_accepted(& self) -> bool

ResearchRun:ResearchRun

_No module-level documentation is present in the source._

Item
pub struct ResearchRun

ResearchRun:builder

_No module-level documentation is present in the source._

Item
ResearchRun :: fn builder(entity_type : impl Into <String>, entity_id : Uuid, run_type : impl Into <String>,) -> RunBuilder

ResearchRun:cancel

_No module-level documentation is present in the source._

Item
ResearchRun :: fn cancel(& mut self) -> crate::Result <()>

ResearchRun:complete

_No module-level documentation is present in the source._

Item
ResearchRun :: fn complete(& mut self) -> crate::Result <()>

ResearchRun:created

_No module-level documentation is present in the source._

Item
ResearchRun :: fn created_at(& self) -> DateTime <Utc>

ResearchRun:deleted

_No module-level documentation is present in the source._

Item
ResearchRun :: fn deleted_at(& self) -> Option <DateTime <Utc>>

ResearchRun:derive

_No module-level documentation is present in the source._

Item
ResearchRun :: fn derive_status_from_artifacts(artifacts : & ResearchArtifact) -> RunStatus

ResearchRun:fail

_No module-level documentation is present in the source._

Item
ResearchRun :: fn fail(& mut self) -> crate::Result <()>

ResearchRun:id

_No module-level documentation is present in the source._

Item
ResearchRun :: fn id(& self) -> Uuid

ResearchRun:mark

_No module-level documentation is present in the source._

Item
ResearchRun :: fn mark_partial(& mut self) -> crate::Result <()>

ResearchRun:start

_No module-level documentation is present in the source._

Item
ResearchRun :: fn start(& mut self) -> crate::Result <()>

ResearchRun:supersede

_No module-level documentation is present in the source._

Item
ResearchRun :: fn supersede(& mut self) -> crate::Result <()>

ResearchRun:updated

_No module-level documentation is present in the source._

Item
ResearchRun :: fn updated_at(& self) -> DateTime <Utc>

RunBuilder

_No module-level documentation is present in the source._

Item
pub struct RunBuilder
RunBuilder :: fn tenant(mut self, tenant_id : Uuid) -> Self
RunBuilder :: fn batch(mut self, batch_id : Uuid) -> Self
RunBuilder :: fn config(mut self, config : JsonValue) -> Self
RunBuilder :: fn input_snapshot(mut self, snapshot : JsonValue) -> Self
RunBuilder :: fn build(self) -> crate::Result <ResearchRun>

ResearchArtifact

_No module-level documentation is present in the source._

Item
ResearchArtifact :: fn try_from(row : ArtifactRow) -> Result <Self>

ResearchConclusion

_No module-level documentation is present in the source._

Item
ResearchConclusion :: fn try_from(row : ConclusionRow) -> Result <Self>

ResearchRepository:ResearchRepository

_No module-level documentation is present in the source._

Item
pub struct ResearchRepository

ResearchRepository:cancel

_No module-level documentation is present in the source._

Item
ResearchRepository :: async fn cancel_run(& self, id : Uuid) -> Result <ResearchRun>

ResearchRepository:claim

_No module-level documentation is present in the source._

Item
ResearchRepository :: async fn claim_next_pending_artifact(& self, run_id : Uuid, artifact_types : & & str,) -> Result <Option <ResearchArtifact>>

ResearchRepository:count

_No module-level documentation is present in the source._

Item
ResearchRepository :: async fn count_runs_by_status(& self, tenant_id : Option <Uuid>, run_type : Option <& str>,) -> Result <HashMap <RunStatus, i64>>
ResearchRepository :: async fn count_artifacts_by_status(& self, run_id : Uuid,) -> Result <HashMap <ArtifactStatus, i64>>

ResearchRepository:create

_No module-level documentation is present in the source._

Item
ResearchRepository :: async fn create_run(& self, run : ResearchRun) -> Result <ResearchRun>
ResearchRepository :: async fn create_artifact(& self, artifact : ResearchArtifact) -> Result <ResearchArtifact>
ResearchRepository :: async fn create_conclusion(& self, conclusion : ResearchConclusion,) -> Result <ResearchConclusion>

ResearchRepository:get

_No module-level documentation is present in the source._

Item
ResearchRepository :: async fn get_run(& self, id : Uuid) -> Result <ResearchRun>
ResearchRepository :: async fn get_active_run_for_entity(& self, tenant_id : Option <Uuid>, entity_type : & str, entity_id : Uuid,) -> Result <Option <ResearchRun>>
ResearchRepository :: async fn get_artifact(& self, id : Uuid) -> Result <ResearchArtifact>
ResearchRepository :: async fn get_artifact_by_type(& self, run_id : Uuid, artifact_type : & str,) -> Result <Option <ResearchArtifact>>
ResearchRepository :: async fn get_conclusion(& self, id : Uuid) -> Result <ResearchConclusion>
ResearchRepository :: async fn get_conclusion_by_type(& self, run_id : Uuid, conclusion_type : ConclusionType,) -> Result <Option <ResearchConclusion>>

ResearchRepository:list

_No module-level documentation is present in the source._

Item
ResearchRepository :: async fn list_runs_for_entity(& self, tenant_id : Option <Uuid>, entity_type : & str, entity_id : Uuid,) -> Result <Vec <ResearchRun>>
ResearchRepository :: async fn list_runs_by_batch(& self, tenant_id : Option <Uuid>, batch_id : Uuid,) -> Result <Vec <ResearchRun>>
ResearchRepository :: async fn list_artifacts_for_run(& self, run_id : Uuid) -> Result <Vec <ResearchArtifact>>
ResearchRepository :: async fn list_conclusions_for_run(& self, run_id : Uuid) -> Result <Vec <ResearchConclusion>>

ResearchRepository:new

_No module-level documentation is present in the source._

Item
ResearchRepository :: fn new(pool : PgPool) -> Self

ResearchRepository:pool

_No module-level documentation is present in the source._

Item
ResearchRepository :: fn pool(& self) -> & PgPool

ResearchRepository:supersede

_No module-level documentation is present in the source._

Item
ResearchRepository :: async fn supersede_active_runs_for_entity(& self, tenant_id : Option <Uuid>, entity_type : & str, entity_id : Uuid,) -> Result <u64>

ResearchRepository:update

_No module-level documentation is present in the source._

Item
ResearchRepository :: async fn update_run(& self, run : & ResearchRun) -> Result <()>
ResearchRepository :: async fn update_artifact(& self, artifact : & ResearchArtifact) -> Result <()>
ResearchRepository :: async fn update_conclusion(& self, conclusion : & ResearchConclusion) -> Result <()>

ResearchRun

_No module-level documentation is present in the source._

Item
ResearchRun :: fn try_from(row : RunRow) -> Result <Self>

ArtifactStatus

_No module-level documentation is present in the source._

Item
pub enum ArtifactStatus
ArtifactStatus :: fn is_terminal(self) -> bool
ArtifactStatus :: fn is_active(self) -> bool
ArtifactStatus :: fn as_str(self) -> & 'static str
ArtifactStatus :: fn parse(s : & str) -> Result <Self, crate::ResearchError>
ArtifactStatus :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result

ConclusionType

_No module-level documentation is present in the source._

Item
pub enum ConclusionType
ConclusionType :: fn as_str(self) -> & 'static str
ConclusionType :: fn parse(s : & str) -> Result <Self, crate::ResearchError>
ConclusionType :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result

Confidence

_No module-level documentation is present in the source._

Item
pub enum Confidence
Confidence :: fn as_str(self) -> & 'static str
Confidence :: fn parse(s : & str) -> Result <Self, crate::ResearchError>
Confidence :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result

RunStatus

_No module-level documentation is present in the source._

Item
pub enum RunStatus
RunStatus :: fn is_terminal(self) -> bool
RunStatus :: fn is_active(self) -> bool
RunStatus :: fn as_str(self) -> & 'static str
RunStatus :: fn parse(s : & str) -> Result <Self, crate::ResearchError>
RunStatus :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result

ResearchStore

_No module-level documentation is present in the source._

Item
pub trait ResearchStore

How to use it

From this crate's own rustdoc:


The crate is deliberately source-agnostic: artifact payloads are `serde_json::Value`,
and the application layer defines typed payload structs and provider implementations.

# Features

- `postgres` — Enables `ResearchRepository` (`PostgreSQL` via sqlx)
- `full` — All features

# Example

Module structure

domain_research

flowchart TD
  n_domain_research["domain_research"]
  n_domain_research --> n_ebay["ebay"]
  n_domain_research --> n_error["error"]
  n_domain_research --> n_events["events"]
  n_domain_research --> n_models["models"]
  n_domain_research --> n_repository["repository"]
  n_domain_research --> n_status["status"]
  n_domain_research --> n_store["store"]

Public surface

`error`

ItemWhat it is
pub enum ResearchError
pub type Result<T>: std::result::Result <T, ResearchError>

`events`

ItemWhat it is
pub enum ResearchEventDomain events emitted by the research system

`models`

ItemWhat it is
pub struct ResearchRunA research run scoped to an entity, producing artifacts from multiple sources and culminating in one or more conclusions
ResearchRun :: fn id(& self) -> Uuid
ResearchRun :: fn created_at(& self) -> DateTime <Utc>
ResearchRun :: fn updated_at(& self) -> DateTime <Utc>
ResearchRun :: fn deleted_at(& self) -> Option <DateTime <Utc>>
ResearchRun :: fn builder(entity_type : impl Into <String>, entity_id : Uuid, run_type : impl Into <String>,) -> RunBuilderCreate a new run via builder.
ResearchRun :: fn start(& mut self) -> crate::Result <()>Start the run (transition Pending -> InProgress)
ResearchRun :: fn mark_partial(& mut self) -> crate::Result <()>Mark as partial (some artifacts succeeded, some failed)
ResearchRun :: fn complete(& mut self) -> crate::Result <()>Mark as completed (all artifacts finished)
ResearchRun :: fn fail(& mut self) -> crate::Result <()>Mark as failed
ResearchRun :: fn cancel(& mut self) -> crate::Result <()>Cancel the run and propagate to artifacts
ResearchRun :: fn supersede(& mut self) -> crate::Result <()>Supersede this run (replaced by a newer run)
ResearchRun :: fn derive_status_from_artifacts(artifacts : & ResearchArtifact) -> RunStatusDerive the aggregate run status from artifact statuses.
pub struct RunBuilderBuilder for creating new research runs.
RunBuilder :: fn tenant(mut self, tenant_id : Uuid) -> Self
RunBuilder :: fn batch(mut self, batch_id : Uuid) -> Self
RunBuilder :: fn config(mut self, config : JsonValue) -> Self
RunBuilder :: fn input_snapshot(mut self, snapshot : JsonValue) -> Self
RunBuilder :: fn build(self) -> crate::Result <ResearchRun>Build the run (does not persist)
pub struct ResearchArtifactA single piece of evidence gathered from an external source during a research run
ResearchArtifact :: fn id(& self) -> Uuid
ResearchArtifact :: fn created_at(& self) -> DateTime <Utc>
ResearchArtifact :: fn updated_at(& self) -> DateTime <Utc>
ResearchArtifact :: fn builder(run_id : Uuid, artifact_type : impl Into <String>, source_type : impl Into <String>,) -> ArtifactBuilderCreate a new artifact via builder.
ResearchArtifact :: fn start(& mut self) -> crate::Result <()>Mark artifact as running (claim for processing)
ResearchArtifact :: fn complete(& mut self, payload : JsonValue) -> crate::Result <()>Mark artifact as completed with payload
ResearchArtifact :: fn fail(& mut self, error : impl Into <String>, max_attempts : i32)Mark artifact as failed
ResearchArtifact :: fn skip(& mut self, reason : impl Into <String>)Mark artifact as skipped (dependency failed or not applicable).
ResearchArtifact :: fn cancel(& mut self)Cancel the artifact.
ResearchArtifact :: fn can_retry(& self, max_attempts : i32) -> boolWhether this artifact can be retried.
pub struct ArtifactBuilderBuilder for creating new research artifacts.
ArtifactBuilder :: fn tenant(mut self, tenant_id : Uuid) -> Self
ArtifactBuilder :: fn entity(mut self, entity_type : impl Into <String>, entity_id : Uuid) -> Self
ArtifactBuilder :: fn source_identifier(mut self, id : impl Into <String>) -> Self
ArtifactBuilder :: fn provider(mut self, name : impl Into <String>) -> Self
ArtifactBuilder :: fn build(self) -> crate::Result <ResearchArtifact>Build the artifact (does not persist)
pub struct ResearchConclusionThe answer produced by a research run: a valuation, description, or classification
ResearchConclusion :: fn id(& self) -> Uuid
ResearchConclusion :: fn created_at(& self) -> DateTime <Utc>
ResearchConclusion :: fn updated_at(& self) -> DateTime <Utc>
ResearchConclusion :: fn builder(run_id : Uuid, conclusion_type : ConclusionType) -> ConclusionBuilderCreate a new conclusion via builder.
ResearchConclusion :: fn accept(& mut self, accepted_by : Option <Uuid>)Mark this conclusion as accepted by a user.
ResearchConclusion :: fn is_accepted(& self) -> boolWhether this conclusion has been accepted.
pub struct ConclusionBuilderBuilder for creating research conclusions.
ConclusionBuilder :: fn tenant(mut self, tenant_id : Uuid) -> Self
ConclusionBuilder :: fn entity(mut self, entity_type : impl Into <String>, entity_id : Uuid) -> Self
ConclusionBuilder :: fn value(mut self, amount_minor : i64, currency : impl Into <String>) -> Self
ConclusionBuilder :: fn confidence(mut self, confidence : Confidence) -> Self
ConclusionBuilder :: fn summary(mut self, summary : impl Into <String>) -> Self
ConclusionBuilder :: fn detail(mut self, detail : JsonValue) -> Self
ConclusionBuilder :: fn derived_from(mut self, artifact_ids : Vec <Uuid>) -> Self
ConclusionBuilder :: fn build(self) -> crate::Result <ResearchConclusion>Build the conclusion (does not persist)

`repository`

ItemWhat it is
pub struct ResearchRepositoryPostgreSQL implementation of ResearchStore.
ResearchRepository :: fn new(pool : PgPool) -> Self
ResearchRepository :: fn pool(& self) -> & PgPool
ResearchRun :: fn try_from(row : RunRow) -> Result <Self>
ResearchArtifact :: fn try_from(row : ArtifactRow) -> Result <Self>
ResearchConclusion :: fn try_from(row : ConclusionRow) -> Result <Self>
ResearchRepository :: async fn create_run(& self, run : ResearchRun) -> Result <ResearchRun>
ResearchRepository :: async fn get_run(& self, id : Uuid) -> Result <ResearchRun>
ResearchRepository :: async fn get_active_run_for_entity(& self, tenant_id : Option <Uuid>, entity_type : & str, entity_id : Uuid,) -> Result <Option <ResearchRun>>
ResearchRepository :: async fn list_runs_for_entity(& self, tenant_id : Option <Uuid>, entity_type : & str, entity_id : Uuid,) -> Result <Vec <ResearchRun>>
ResearchRepository :: async fn list_runs_by_batch(& self, tenant_id : Option <Uuid>, batch_id : Uuid,) -> Result <Vec <ResearchRun>>
ResearchRepository :: async fn update_run(& self, run : & ResearchRun) -> Result <()>
ResearchRepository :: async fn supersede_active_runs_for_entity(& self, tenant_id : Option <Uuid>, entity_type : & str, entity_id : Uuid,) -> Result <u64>
ResearchRepository :: async fn cancel_run(& self, id : Uuid) -> Result <ResearchRun>
ResearchRepository :: async fn count_runs_by_status(& self, tenant_id : Option <Uuid>, run_type : Option <& str>,) -> Result <HashMap <RunStatus, i64>>
ResearchRepository :: async fn create_artifact(& self, artifact : ResearchArtifact) -> Result <ResearchArtifact>
ResearchRepository :: async fn get_artifact(& self, id : Uuid) -> Result <ResearchArtifact>
ResearchRepository :: async fn list_artifacts_for_run(& self, run_id : Uuid) -> Result <Vec <ResearchArtifact>>
ResearchRepository :: async fn get_artifact_by_type(& self, run_id : Uuid, artifact_type : & str,) -> Result <Option <ResearchArtifact>>
ResearchRepository :: async fn update_artifact(& self, artifact : & ResearchArtifact) -> Result <()>
ResearchRepository :: async fn claim_next_pending_artifact(& self, run_id : Uuid, artifact_types : & & str,) -> Result <Option <ResearchArtifact>>
ResearchRepository :: async fn count_artifacts_by_status(& self, run_id : Uuid,) -> Result <HashMap <ArtifactStatus, i64>>
ResearchRepository :: async fn create_conclusion(& self, conclusion : ResearchConclusion,) -> Result <ResearchConclusion>
ResearchRepository :: async fn get_conclusion(& self, id : Uuid) -> Result <ResearchConclusion>
ResearchRepository :: async fn get_conclusion_by_type(& self, run_id : Uuid, conclusion_type : ConclusionType,) -> Result <Option <ResearchConclusion>>
ResearchRepository :: async fn list_conclusions_for_run(& self, run_id : Uuid) -> Result <Vec <ResearchConclusion>>
ResearchRepository :: async fn update_conclusion(& self, conclusion : & ResearchConclusion) -> Result <()>

`status`

ItemWhat it is
pub enum RunStatusStatus of a research run.
RunStatus :: fn is_terminal(self) -> boolTerminal states cannot transition further.
RunStatus :: fn is_active(self) -> boolActive states represent in-flight work.
RunStatus :: fn as_str(self) -> & 'static str
RunStatus :: fn parse(s : & str) -> Result <Self, crate::ResearchError>Parse from string
RunStatus :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result
pub enum ArtifactStatusStatus of an individual research artifact.
ArtifactStatus :: fn is_terminal(self) -> bool
ArtifactStatus :: fn is_active(self) -> bool
ArtifactStatus :: fn as_str(self) -> & 'static str
ArtifactStatus :: fn parse(s : & str) -> Result <Self, crate::ResearchError>Parse from string
ArtifactStatus :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result
pub enum ConfidenceConfidence level of a research conclusion.
Confidence :: fn as_str(self) -> & 'static str
Confidence :: fn parse(s : & str) -> Result <Self, crate::ResearchError>Parse from string
Confidence :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result
pub enum ConclusionTypeType of conclusion produced by research.
ConclusionType :: fn as_str(self) -> & 'static str
ConclusionType :: fn parse(s : & str) -> Result <Self, crate::ResearchError>Parse from string
ConclusionType :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result

`store`

ItemWhat it is
pub trait ResearchStorePersistence trait for research data

Re-exports. Exported here, defined elsewhere.

ExportDefined in
EbayClientclient::EbayClient
RateLimiterrate_limiter::RateLimiter
ResearchEventevents::ResearchEvent
ResearchRepositoryrepository::ResearchRepository
ResearchStorestore::ResearchStore
{ArtifactBuilder,ConclusionBuilder,ResearchArtifact,ResearchConclusion,ResearchRun,RunBuilder,}models::{ArtifactBuilder,ConclusionBuilder,ResearchArtifact,ResearchConclusion,ResearchRun,RunBuilder,}
{ArtifactStatus,ConclusionType,Confidence,RunStatus}status::{ArtifactStatus,ConclusionType,Confidence,RunStatus}
{EbayError,SearchFilter,SoldListing,SortOrder}types::{EbayError,SearchFilter,SoldListing,SortOrder}
{ResearchError,Result}error::{ResearchError,Result}

Boundary

Reaches into foundation.

Shares tier domain with 41 other crates: domain-agreements, domain-ai-report, domain-billing, domain-catalog, domain-classify, domain-comments, domain-competitive-intel, domain-contact, … (41 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)domain
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/domain/research
Vocabulary in force (lexicon)current

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

flowchart LR
  n_domain["domain"] --> n_foundation["foundation"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`foundation-basemodels`foundationnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-trait^0.1noalways
chrono^0.4serdenoalways
reqwest^0.12jsonyesalways
serde^1derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonyesalways
thiserror^2noalways
tokio^1full, sync, timeyesalways
tracing^0.1yesalways
urlencoding^2yesalways
uuid^1v4, v7, serde, jsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio^1full, macros, rt-multi-threadnoalways
tokio-test^0.4noalways

Build. None.

Depended on by. 3 workspace crates.

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

flowchart LR
  n_application_research["application-research"] -->|uses| SELF
  n_domain_domain_survey["domain-domain-survey"] -->|uses| SELF
  n_domain_research_intel["domain-research-intel"] -->|uses| SELF
  SELF["domain-research"]
  SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

FeatureEnablesOn by default
defaultyes
ebayreqwest, urlencoding, tokio, tracingno
fullpostgres, ebayno
postgresdep:sqlxno
reqwestdep:reqwestno
tokiodep:tokiono
tracingdep:tracingno
urlencodingdep:urlencodingno
flowchart LR
  n_default["default"]
  n_ebay["ebay"] --> n_reqwest["reqwest"]
  n_ebay["ebay"] --> n_urlencoding["urlencoding"]
  n_ebay["ebay"] --> n_tokio["tokio"]
  n_ebay["ebay"] --> n_tracing["tracing"]
  n_full["full"] --> n_postgres["postgres"]
  n_full["full"] --> n_ebay["ebay"]
  n_postgres["postgres"] --> n_dep_sqlx["dep:sqlx"]
  n_reqwest["reqwest"] --> n_dep_reqwest["dep:reqwest"]
  n_tokio["tokio"] --> n_dep_tokio["dep:tokio"]
  n_tracing["tracing"] --> n_dep_tracing["dep:tracing"]
  n_urlencoding["urlencoding"] --> n_dep_urlencoding["dep:urlencoding"]

Targets

KindNameSource
libdomain_research`src/lib.rs`

Error model

Error typeNamed by
ResearchErrorResult

Operational characteristics

PropertyEvidence
async public surfaceyes
async runtimeyes
database accessyes
network I/Oyes
unsafe codenone detected
environment variablesnone 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.

3 workspace crates depend on this one: application-research, domain-domain-survey, domain-research-intel.

Verification

KindCount
Unit tests25
Integration tests0
Examples0
Doctests1

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

ModuleTestsExamplesConsumers
error203
events100
models600
repository100
status402
store100

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc40103
Public modules with a //! block17
pie showData
    title Public items with rustdoc
    "Documented" : 40
    "No rustdoc detected" : 63

Metrics

MetricValue
Rust source files11
Source lines2804
Code lines2175
Public API items103
Public modules7
Tests25
Examples0
Cargo features8
Direct runtime dependencies12
Workspace reverse dependencies3
pie showData
    title Public API by kind
    "enum" : 6
    "method" : 88
    "struct" : 7
    "trait" : 1
    "type alias" : 1
pie showData
    title Rust source composition
    "Code" : 2175
    "Blank or comment" : 629

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 domain · Manual