Skip to main content

fakecloud_comprehend/
lib.rs

1//! Amazon Comprehend (`comprehend`) awsJson1_1 service for fakecloud.
2//!
3//! The full 85-operation Amazon Comprehend Smithy model: synchronous
4//! single-document detection (`DetectEntities` / `DetectSentiment` /
5//! `DetectSyntax` / `DetectKeyPhrases` / `DetectDominantLanguage` /
6//! `DetectPiiEntities` / `DetectTargetedSentiment` / `ContainsPiiEntities` /
7//! `DetectToxicContent` / `ClassifyDocument`), their `BatchDetect*` list
8//! variants, nine families of asynchronous analysis jobs
9//! (dominant-language / entities / key-phrases / sentiment /
10//! targeted-sentiment / PII / events / topics / document-classification), custom
11//! document classifiers and entity recognizers (with versioning), real-time
12//! endpoints, flywheels and flywheel iterations, datasets, resource policies,
13//! `ImportModel`, and ARN-keyed resource tagging.
14//!
15//! Requests carry `X-Amz-Target: Comprehend_20171127.<Operation>`; dispatch
16//! keys off `req.action`. Every operation runs model-driven input validation
17//! first (required / length / range / enum / pattern), then real,
18//! account-partitioned, persisted CRUD. Each resource is stored as its
19//! already-output-valid wire JSON object so a `Describe*` echoes exactly what
20//! its `Create*` / `Start*` persisted.
21//!
22//! The asynchronous lifecycles are modelled by advancing the stored status on
23//! the next read (and reconciled again on restart so an interrupted transition
24//! never wedges): analysis jobs settle `SUBMITTED` -> `COMPLETED`, custom
25//! classifiers and recognizers settle `SUBMITTED` -> `TRAINED`, endpoints settle
26//! `CREATING` -> `IN_SERVICE`, flywheels settle `CREATING` -> `ACTIVE`, datasets
27//! settle `CREATING` -> `COMPLETED`, and flywheel iterations settle `TRAINING`
28//! -> `COMPLETED`. A `Stop*` / `StopTraining*` on an in-flight resource settles
29//! it to `STOPPED`.
30//!
31//! Honest NLP gap: Comprehend's value is the natural-language model that turns
32//! text into entities, sentiment, syntax, key phrases, PII spans, and language
33//! probabilities. fakecloud does not run any NLP inference. The synchronous
34//! detection operations return well-formed, structurally-correct result shapes
35//! with empty analysis lists (no fabricated entities / key phrases / syntax /
36//! PII spans / languages); `DetectSentiment` returns the model's neutral default
37//! (`NEUTRAL`, `SentimentScore` weighted to neutral) rather than an invented
38//! judgement. Async jobs, classifiers, recognizers, endpoints, flywheels,
39//! datasets, policies, tags, status lifecycle, and persistence are all real.
40
41pub mod persistence;
42pub mod service;
43pub mod shared;
44pub mod state;
45mod validate;
46
47pub use service::{ComprehendService, COMPREHEND_ACTIONS};
48pub use state::{
49    ComprehendData, ComprehendSnapshot, SharedComprehendState, COMPREHEND_SNAPSHOT_SCHEMA_VERSION,
50};