docs: update for new crate layout

This commit is contained in:
2026-10-25 22:58:46 +01:00
parent b76f5996da
commit 80072eb463
20 changed files with 148 additions and 106 deletions

View File

@@ -1,15 +1,7 @@
use super::*;
use crate::test_support::local_actor;
use domain::value_objects::{InstanceIdentity, SocialActor, SocialIdentity, UserId};
fn local_actor(uid: &UserId) -> SocialActor {
SocialActor {
identity: SocialIdentity::Local(uid.clone()),
handle: "@gabriel@md.example".into(),
display_name: None,
avatar_url: None,
}
}
#[test]
fn local_actor_dto_url_round_trips_back_to_the_same_identity() {
let instance = InstanceIdentity::new("https://md.example");

View File

@@ -1,14 +1,6 @@
use super::*;
use domain::value_objects::{InstanceIdentity, SocialActor, SocialIdentity, UserId};
fn local_actor(uid: &UserId) -> SocialActor {
SocialActor {
identity: SocialIdentity::Local(uid.clone()),
handle: "@gabriel@md.example".into(),
display_name: None,
avatar_url: None,
}
}
use crate::test_support::local_actor;
use domain::value_objects::{InstanceIdentity, SocialIdentity, UserId};
#[test]
fn local_blocked_dto_url_round_trips_back_to_the_same_identity() {

View File

@@ -1,14 +1,6 @@
use super::*;
use domain::value_objects::{InstanceIdentity, SocialActor, SocialIdentity, UserId};
fn local_actor(uid: &UserId) -> SocialActor {
SocialActor {
identity: SocialIdentity::Local(uid.clone()),
handle: "@gabriel@md.example".into(),
display_name: None,
avatar_url: None,
}
}
use crate::test_support::local_actor;
use domain::value_objects::{InstanceIdentity, SocialIdentity, UserId};
#[test]
fn local_template_url_round_trips_back_to_the_same_identity() {

View File

@@ -8,3 +8,5 @@ pub mod openapi;
pub mod router;
pub mod state;
mod support;
#[cfg(test)]
mod test_support;

View File

@@ -0,0 +1,12 @@
//! Fixtures shared by the in-crate mapper tests.
use domain::value_objects::{SocialActor, SocialIdentity, UserId};
pub(crate) fn local_actor(uid: &UserId) -> SocialActor {
SocialActor {
identity: SocialIdentity::Local(uid.clone()),
handle: "@gabriel@md.example".into(),
display_name: None,
avatar_url: None,
}
}

View File

@@ -150,7 +150,7 @@ pub struct WrapupGroup {
pub list_wrapups: ListWrapUpsDeps,
}
/// Every deps struct a handler can need, built once by the composition root.
/// Every deps struct a handler can need, built once by `bootstrap`.
/// Use cases still receive only their own narrow struct — nothing takes `&Deps`.
///
/// `bootstrap::build_deps` is called only from `bootstrap::build_server`.

View File

@@ -1,4 +1,4 @@
//! Absorbs `handlers/import.rs::api_apply_profile`'s three-step orchestration:
//! Absorbs `http-axum/src/api/import/sessions.rs::api_apply_profile`'s three-step orchestration:
//! apply the saved profile's field mappings onto the session, reload the
//! session to read back the mappings `apply_profile` just wrote, then run
//! `apply_mapping` to regenerate `row_results` from them. All three steps used

View File

@@ -1,4 +1,4 @@
//! Backs `handlers/import.rs::api_get_session` — a plain state query, not a
//! Backs `http-axum/src/api/import/sessions.rs::api_get_session` — a plain state query, not a
//! redirect-driving gate (the API has nothing to redirect to; a missing
//! session is just a 404).

View File

@@ -6,7 +6,7 @@ pub mod event_handler;
pub mod get_movie_profile;
pub mod get_movies;
pub mod merge_duplicates;
pub mod poster_sync;
pub mod poster_sync_handler;
pub mod queries;
pub mod reindex_search;
pub mod request_enrichment;

View File

@@ -1,5 +1,5 @@
//! The federated half of the former `get_profile` (ADR-0004's closed wart).
//! `build_federated_profile_response` (`handlers/users.rs`) calls this with a
//! `build_federated_profile_response` (`http-axum/src/api/user_profile.rs`) calls this with a
//! synthetic `user_id` that has no row in the local `users` table — a federated
//! actor's identity is built entirely from the resolved `FederatedProfile`, so
//! this type carries no `identity` field at all: the old `get_profile` computed

View File

@@ -1,10 +1,10 @@
//! Backs page-chrome data: the nav bar's email/admin state and pending-follow
//! badge. Absorbs `handlers/helpers.rs::build_page_context`'s inline user lookup
//! badge. Absorbs `html/helpers.rs::build_page_context`'s inline user lookup
//! and pending-follower count.
//!
//! **Error policy (deliberately no internal tolerance):** this function
//! propagates every error from `user` and `follow_graph` with `?`. It does not
//! itself decide to degrade — that's a presentation-layer policy
//! itself decide to degrade — that's a http-adapter policy
//! (`build_page_context` logs a warning and falls back to a zeroed `PageViewer`
//! on `Err`). Page chrome degrading is a rendering decision, not a domain one.

View File

@@ -1,4 +1,4 @@
//! Absorbs `handlers/users.rs::get_user_by_username`'s
//! Absorbs `http-axum/src/html/users.rs::get_user_by_username`'s
//! `repos.user.find_by_username()` call. `None` means "no such username" — the
//! handler turns that into a 404, same as it always has; this is not an error
//! condition.

View File

@@ -184,15 +184,17 @@ async fn assemble(
// ── Event handlers ────────────────────────────────────────────────────────
let handlers: Vec<Arc<dyn EventHandler>> = {
let poster = Arc::new(application::movies::poster_sync::PosterSyncHandler::new(
Arc::clone(&movie_command),
Arc::clone(&movie_query),
Arc::clone(&metadata),
Arc::clone(&poster_fetcher),
Arc::clone(&object_storage),
Arc::clone(&event_publisher),
3,
)) as Arc<dyn EventHandler>;
let poster = Arc::new(
application::movies::poster_sync_handler::PosterSyncHandler::new(
Arc::clone(&movie_command),
Arc::clone(&movie_query),
Arc::clone(&metadata),
Arc::clone(&poster_fetcher),
Arc::clone(&object_storage),
Arc::clone(&event_publisher),
3,
),
) as Arc<dyn EventHandler>;
let cleanup = Arc::new(object_storage::ImageCleanupHandler::new(Arc::clone(
&object_storage,