Files
OpenMAIC/lib/persistence
wyucandClaude Fable 5 5a3e81c4d9 feat(document): ingest uploaded sources into the asset pool and extract by id (#1153 part 0) (#1154)
* feat(document): declare a version on every extractor provider (#1153 part 0)

* feat(api): accept asset-id input in the extract-document route (#1153 part 0)

* feat(upload): ingest selected course materials into the asset pool (#1153 part 0)

* fix(document): harden asset-id extraction inputs and close upload ingest leaks (#1153 part 0)

* fix(document): scope extraction fallback and harden the asset-id path (#1153 part 0)

- G1: byte fallback only on pre-extraction failures; PARSE_FAILED
  (422/500) is surfaced without re-running the paid extractor
- G2: freeze the course-material set for the duration of generate-prep
  (guarded add/remove + disabled toolbar affordances, session built
  from the click-time snapshot, belt-and-braces drain)
- G3: bound the pre-generation ingest await (~15s); timed-out ingests
  go byte-path and their late-resolving ids are released
- G4: reject non-object JSON bodies (null/array/string/number) as 400
- G5: JSON-path provider pre-validation with generic messages, generic
  JSON-path PARSE_FAILED/422 responses, control-char-free log values
- G6: size cap enforced via identify() before resolve() materializes
  bytes; too_large maps to the existing 413

* fix(document): mirror provider-hint semantics on the asset-id form and freeze prep-time controls (#1153 part 0)

* fix(document): keep the asset-id form's responses free of caller input (#1153 part 0)

Address review findings: answer the extractor-selection failure with a
generic static message on the asset-id form (the registry's interpolated
message carries the caller's MIME type; multipart keeps it verbatim, both
sides now pinned by tests), dedupe same-batch material additions by content
fingerprint inside the pure updater, document the network-error retry
exception in shouldRetryWithByteUpload's docstring, and fix a test name
asserting 500 but named 400.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-24 11:45:31 +08:00
..