Multi-source research runs, artifacts, and conclusions for entity valuation and enrichment
| Tier | domain |
| Role | unclassified (baselined) |
| Path | crates/domain/research |
| Edition | 2021 |
| Targets | domain_research |
| Public items | 103 across 7 modules |
| Tests | 25 |
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
- Inventory pricing: visual search + marketplace comps + AI appraisal
- Insurance: damage analysis + repair lookup + depreciation
- Vehicle valuation: VIN lookup + KBB comps + condition assessment
- Real estate: property analysis + Zillow comps + market analysis
# 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
postgres— EnablesResearchRepository(PostgreSQLvia sqlx)full— All 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
ebayerroreventsmodelsrepositorystatusstore
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`
| Item | What it is |
|---|---|
pub enum ResearchError | — |
pub type Result<T>: std::result::Result <T, ResearchError> | — |
`events`
| Item | What it is |
|---|---|
pub enum ResearchEvent | Domain events emitted by the research system |
`models`
| Item | What it is |
|---|---|
pub struct ResearchRun | A 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>,) -> RunBuilder | Create 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) -> RunStatus | Derive the aggregate run status from artifact statuses. |
pub struct RunBuilder | Builder 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 ResearchArtifact | A 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>,) -> ArtifactBuilder | Create 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) -> bool | Whether this artifact can be retried. |
pub struct ArtifactBuilder | Builder 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 ResearchConclusion | The 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) -> ConclusionBuilder | Create 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) -> bool | Whether this conclusion has been accepted. |
pub struct ConclusionBuilder | Builder 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`
| Item | What it is |
|---|---|
pub struct ResearchRepository | PostgreSQL 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`
| Item | What it is |
|---|---|
pub enum RunStatus | Status of a research run. |
RunStatus :: fn is_terminal(self) -> bool | Terminal states cannot transition further. |
RunStatus :: fn is_active(self) -> bool | Active 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 ArtifactStatus | Status 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 Confidence | Confidence 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 ConclusionType | Type 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`
| Item | What it is |
|---|---|
pub trait ResearchStore | Persistence trait for research data |
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
EbayClient | client::EbayClient |
RateLimiter | rate_limiter::RateLimiter |
ResearchEvent | events::ResearchEvent |
ResearchRepository | repository::ResearchRepository |
ResearchStore | store::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) |
| Location | crates/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.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `foundation-basemodels` | foundation | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
async-trait | ^0.1 | — | no | always |
chrono | ^0.4 | serde | no | always |
reqwest | ^0.12 | json | yes | always |
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
sqlx | ^0.8 | runtime-tokio, postgres, chrono, uuid, json | yes | always |
thiserror | ^2 | — | no | always |
tokio | ^1 | full, sync, time | yes | always |
tracing | ^0.1 | — | yes | always |
urlencoding | ^2 | — | yes | always |
uuid | ^1 | v4, v7, serde, js | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tokio | ^1 | full, macros, rt-multi-thread | no | always |
tokio-test | ^0.4 | — | no | always |
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
| Feature | Enables | On by default |
|---|---|---|
default | — | yes |
ebay | reqwest, urlencoding, tokio, tracing | no |
full | postgres, ebay | no |
postgres | dep:sqlx | no |
reqwest | dep:reqwest | no |
tokio | dep:tokio | no |
tracing | dep:tracing | no |
urlencoding | dep:urlencoding | no |
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
| Kind | Name | Source |
|---|---|---|
| lib | domain_research | `src/lib.rs` |
Error model
| Error type | Named by |
|---|---|
ResearchError | Result |
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | yes |
| async runtime | yes |
| database access | yes |
| network I/O | yes |
| 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
3 workspace crates depend on this one: application-research, domain-domain-survey, domain-research-intel.
Verification
| Kind | Count |
|---|---|
| Unit tests | 25 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 1 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
error | 2 | 0 | 3 |
events | 1 | 0 | 0 |
models | 6 | 0 | 0 |
repository | 1 | 0 | 0 |
status | 4 | 0 | 2 |
store | 1 | 0 | 0 |
What the tests establish, by name:
test_client_creation—src/ebay/client.rstest_client_shared_limiter—src/ebay/client.rstest_rate_limiter_acquire—src/ebay/rate_limiter.rstest_rate_limiter_daily_budget—src/ebay/rate_limiter.rstest_rate_limiter_unlimited—src/ebay/rate_limiter.rstest_error_display—src/ebay/types.rstest_search_filter_defaults—src/ebay/types.rstest_sold_listing_serialization—src/ebay/types.rstest_sort_order_params—src/ebay/types.rstest_artifact_lifecycle—src/lib.rstest_artifact_retry—src/lib.rstest_artifact_skip—src/lib.rstest_conclusion_accept—src/lib.rstest_create_artifact—src/lib.rstest_create_conclusion—src/lib.rstest_create_run—src/lib.rstest_derive_status_from_artifacts—src/lib.rstest_event_serialization—src/lib.rstest_run_cancel—src/lib.rstest_run_lifecycle—src/lib.rstest_run_supersede—src/lib.rstest_run_validation—src/lib.rstest_run_with_batch—src/lib.rstest_serialization_roundtrip—src/lib.rstest_status_enums—src/lib.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 40 | 103 |
Public modules with a //! block | 1 | 7 |
pie showData
title Public items with rustdoc
"Documented" : 40
"No rustdoc detected" : 63
Metrics
| Metric | Value |
|---|---|
| Rust source files | 11 |
| Source lines | 2804 |
| Code lines | 2175 |
| Public API items | 103 |
| Public modules | 7 |
| Tests | 25 |
| Examples | 0 |
| Cargo features | 8 |
| Direct runtime dependencies | 12 |
| Workspace reverse dependencies | 3 |
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.