feat(formats): implement author attribution service and propagate spec tests

Book metadata extraction previously handled author parsing naively by taking only the first raw dc:creator string, ignoring MARC relator roles, multi-creator ordering, deduplication, and structured author fallbacks.

Define the formal author attribution model in specs/book-author-parsing.allium and propagate the specification into a comprehensive test suite (AuthorAttributionTest) covering all 23 obligations across value equality, lifecycle state transitions, contract invariants, and surface exposure.

Implement AuthorAttribution, AuthorAttributionService, and BookMetadataSurface to fulfill:
- Dublin Core precedence over structured author elements
- MARC role code resolution (aut -> Author, edt -> Editor, trl -> Translator, ill -> Illustrator, custom capitalized)
- Grouping creators by resolved role in order of appearance with deduplication
- Fallback formatting for structured author fields (first, middle, last, nickname)
- Complete status lifecycle enforcement (unparsed to parsed)

Register AuthorAttributionTest in CMakeLists.txt and update AGENTS.md documentation.
This commit is contained in:
Agel committed 2026-10-29 15:21:06 +01:00
1 parent 306d4cac5c
commit bde4e310b5
6 files changed
+1005

No files matched your search

+4
View File
@@ -296,6 +296,10 @@ add_asteria_test(WebImageProviderTest tests/formats/WebImageProviderTest.cpp
target_link_libraries(WebImageProviderTest PRIVATE Qt6::Quick Qt6::Gui Qt6::Network)
set_tests_properties(WebImageProviderTest PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=offscreen")
add_asteria_test(AuthorAttributionTest tests/formats/AuthorAttributionTest.cpp
src/backend/formats/AuthorAttribution.cpp)
set_tests_properties(AuthorAttributionTest PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=offscreen")
add_asteria_test(EpubReaderTest tests/formats/EpubReaderTest.cpp
src/backend/formats/AsyncImageResponse.cpp
src/backend/formats/ImageUrl.cpp