2025-09-09 19:34:03 +00:00
|
|
|
# Service Processing Details
|
|
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
This document describes current service behavior in the processing pipeline.
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
## Active Pipeline Services
|
2025-09-09 19:34:03 +00:00
|
|
|
|
|
|
|
|
### 1. storeEventRunner
|
2026-02-19 20:22:59 +00:00
|
|
|
**Purpose**: Entry point for upload events.
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Code locations**:
|
|
|
|
|
- `cmd/storeEventRunner/`
|
|
|
|
|
- `api/storeEventRunner/`
|
|
|
|
|
- `internal/document/store/`
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Behavior**:
|
|
|
|
|
- Consumes S3 event notifications
|
|
|
|
|
- Validates supported event/object patterns
|
|
|
|
|
- Extracts bucket/key/hash metadata
|
|
|
|
|
- Publishes to `DOCINIT`
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Output**: `{bucket, key, hash}` to `DOCINIT`.
|
2025-09-09 19:34:03 +00:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
### 2. docInitRunner
|
2026-02-19 20:22:59 +00:00
|
|
|
**Purpose**: Document registration and deduplication.
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Code locations**:
|
|
|
|
|
- `cmd/docInitRunner/`
|
|
|
|
|
- `api/docInitRunner/`
|
|
|
|
|
- `internal/document/init/`
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Behavior**:
|
|
|
|
|
- Parses upload metadata from S3 key
|
|
|
|
|
- Deduplicates by client/hash
|
|
|
|
|
- Creates document and entry records for new documents
|
|
|
|
|
- Publishes new documents to `DOCSYNC`
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Output**: `{document_id}` to `DOCSYNC` for new documents.
|
2025-09-09 19:34:03 +00:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
### 3. docSyncRunner
|
|
|
|
|
**Purpose**: Sync eligibility gate.
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Code locations**:
|
|
|
|
|
- `cmd/docSyncRunner/`
|
|
|
|
|
- `api/docSyncRunner/`
|
|
|
|
|
- `internal/document/sync/`
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Behavior**:
|
|
|
|
|
- Loads document + client state
|
|
|
|
|
- Checks client sync status
|
|
|
|
|
- Publishes eligible documents to `DOCCLEAN`
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Output**: `{document_id}` to `DOCCLEAN` when eligible.
|
2025-09-09 19:34:03 +00:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
### 4. docCleanRunner
|
|
|
|
|
**Purpose**: Document validation/cleaning stage.
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Code locations**:
|
|
|
|
|
- `cmd/docCleanRunner/`
|
|
|
|
|
- `api/docCleanRunner/`
|
|
|
|
|
- `internal/document/clean/`
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Behavior**:
|
|
|
|
|
- Idempotent clean processing
|
|
|
|
|
- Validates MIME/content constraints and S3-backed inputs
|
|
|
|
|
- Stores clean version entries
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Output**: none. The active pipeline currently ends after clean.
|
2025-09-09 19:34:03 +00:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
### 5. clientSyncRunner
|
|
|
|
|
**Purpose**: Re-queue all documents for a client.
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Code locations**:
|
|
|
|
|
- `cmd/clientSyncRunner/`
|
|
|
|
|
- `api/clientSyncRunner/`
|
|
|
|
|
- `internal/client/sync/`
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Behavior**:
|
|
|
|
|
- Consumes `CLIENTSYNC`
|
|
|
|
|
- Enumerates client documents
|
|
|
|
|
- Publishes each to `DOCSYNC`
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
**Output**: `{document_id}` to `DOCSYNC` for each client document.
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
## Deprecated Compatibility Services
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
These services are retained for deployment compatibility and are currently health-only/no-op:
|
|
|
|
|
- `cmd/docTextRunner/`
|
|
|
|
|
- `cmd/querySyncRunner/`
|
|
|
|
|
- `cmd/queryRunner/`
|
|
|
|
|
- `cmd/queryVersionSyncRunner/`
|
2025-09-09 19:34:03 +00:00
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
## Active Data Flow Summary
|
|
|
|
|
|
|
|
|
|
```text
|
2025-09-09 19:34:03 +00:00
|
|
|
S3 Upload Event
|
2026-02-19 20:22:59 +00:00
|
|
|
-> storeEventRunner
|
|
|
|
|
-> docInitRunner
|
|
|
|
|
-> docSyncRunner
|
|
|
|
|
-> docCleanRunner
|
2025-09-09 19:34:03 +00:00
|
|
|
```
|
|
|
|
|
|
2026-02-19 20:22:59 +00:00
|
|
|
```text
|
|
|
|
|
Client Sync Trigger
|
|
|
|
|
-> clientSyncRunner
|
|
|
|
|
-> docSyncRunner
|
|
|
|
|
-> docCleanRunner
|
2025-09-09 19:34:03 +00:00
|
|
|
```
|
|
|
|
|
|