Files
noteflow/.rag/04-application-services.md
Travis Vasceannie 1ce24cdf7b feat: reorganize Claude hooks and add RAG documentation structure with error handling policies
- Moved all hookify configuration files from `.claude/` to `.claude/hooks/` subdirectory for better organization
- Added four new blocking hooks to prevent common error handling anti-patterns:
  - `block-broad-exception-handler`: Prevents catching generic `Exception` with only logging
  - `block-datetime-now-fallback`: Blocks returning `datetime.now()` as fallback on parse failures to prevent data corruption
  - `block-default
2026-01-15 15:58:06 +00:00

4.6 KiB

NoteFlow Application Services

Location

src/noteflow/application/services/

Core Services

MeetingService (meeting/)

Meeting lifecycle, segments, annotations, summaries, state.

Files:

  • meeting_service.py — Composite class combining all mixins
  • _base.py — Core initialization and dependencies
  • _crud_mixin.py — Create, read, update, delete operations
  • _segments_mixin.py — Segment management
  • _summaries_mixin.py — Summary operations
  • _state_mixin.py — State machine transitions
  • _annotations_mixin.py — Annotation CRUD
  • _types.py — Service-specific TypedDicts

Key Methods:

  • create_meeting(title, project_id) -> Meeting
  • get_meeting(meeting_id) -> Meeting
  • list_meetings(filters) -> list[Meeting]
  • stop_meeting(meeting_id) -> Meeting
  • add_segment(meeting_id, segment_data) -> Segment
  • add_annotation(meeting_id, annotation_data) -> Annotation
  • generate_summary(meeting_id, template_id) -> Summary

IdentityService (identity/)

User/workspace context, defaults, tenancy scoping.

Files:

  • identity_service.py — Main service
  • _context_mixin.py — Request context handling
  • _workspace_mixin.py — Workspace operations
  • _defaults_mixin.py — Default user/workspace creation

Key Methods:

  • get_current_user() -> User
  • get_current_workspace() -> Workspace
  • switch_workspace(workspace_id) -> Workspace
  • ensure_defaults() -> tuple[User, Workspace]

CalendarService (calendar/)

OAuth integration, event fetching, sync management.

Files:

  • calendar_service.py — Main service
  • _connection_mixin.py — OAuth connection handling
  • _events_mixin.py — Event fetching
  • _oauth_mixin.py — OAuth flow management
  • _service_mixin.py — Provider configuration
  • _errors.py — Calendar-specific errors

Key Methods:

  • initiate_oauth(provider) -> AuthUrl
  • complete_oauth(code, state) -> Integration
  • list_events(start, end) -> list[CalendarEvent]
  • get_connection_status() -> ConnectionStatus

SummarizationService (summarization/)

Summary generation, template management, cloud consent.

Files:

  • summarization_service.py — Main service
  • template_service.py — Template CRUD
  • consent_manager.py — Cloud consent flow

Key Methods:

  • generate_summary(meeting_id, template_id) -> Summary
  • create_template(data) -> SummarizationTemplate
  • list_templates() -> list[SummarizationTemplate]
  • grant_consent() -> bool
  • revoke_consent() -> bool
  • has_consent() -> bool

ProjectService (project_service/)

Project CRUD, member management, roles, rules.

Files:

  • __init__.py — Main service export
  • crud.py — Project CRUD operations
  • members.py — Member management
  • roles.py — Role-based access
  • rules.py — Project rules configuration
  • active.py — Active project tracking
  • _types.py — Service types

Key Methods:

  • create_project(name, workspace_id) -> Project
  • add_member(project_id, user_id, role) -> ProjectMembership
  • update_member_role(project_id, user_id, role) -> ProjectMembership
  • remove_member(project_id, user_id) -> bool
  • set_active_project(project_id) -> Project

Supporting Services

NerService (ner_service.py)

Named entity extraction wrapper, model loading.

  • extract_entities(meeting_id) -> list[NamedEntity]
  • is_ready() -> bool

ExportService (export_service.py)

Transcript export (Markdown, HTML, PDF).

  • export(meeting_id, format) -> ExportResult

WebhookService (webhook_service.py)

Webhook registration, delivery, retry logic.

  • register_webhook(config) -> WebhookConfig
  • deliver_event(event) -> WebhookDelivery

AuthService (auth_service.py)

User authentication, OIDC integration.

  • initiate_login(provider) -> AuthUrl
  • complete_login(code, state) -> User
  • logout() -> bool

TriggerService (trigger_service.py)

Calendar/audio/foreground-app trigger detection.

  • check_triggers() -> list[TriggerSignal]
  • snooze_triggers(duration) -> bool

RetentionService (retention_service.py)

Automatic meeting deletion based on policy.

  • apply_retention_policy() -> int

RecoveryService (recovery/)

Data recovery (meeting, job, audio).

  • recover_meeting(meeting_id) -> Meeting
  • recover_job(job_id) -> DiarizationJob

AsrConfigService (asr_config_service.py)

ASR model configuration and state.

  • get_config() -> AsrConfig
  • update_config(config) -> AsrConfig

HfTokenService (hf_token_service.py)

Hugging Face token management.

  • set_token(token) -> bool
  • get_status() -> HfTokenStatus
  • validate_token() -> bool