You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Q2-4: ingest and library nits (streaming, title unescape, JPEG modes, raise from, payload guard)
RED-FIRST: three acceptance tests were written and shown failing on
origin/dev before any production code was changed.
RED run (4 tests, 0 fixes applied):
```
FAILED tests/test_knowledge_ingest.py::test_download_article_unescapes_title_entities
FAILED tests/test_library.py::TestImageProcessor::test_process_pa_mode_image
FAILED tests/test_library.py::TestImageProcessor::test_process_la_mode_image
FAILED tests/test_agent_registry_store.py::TestTokenMinting::test_verify_non_dict_payload_raises
4 failed in 1.13s
```
GREEN run (after fixes):
```
4 passed in 0.84s
```
Changes (audit pass-2 card Q2-4, section 4.4):
- library_pipeline.py TextProcessor: stream file read/write in a single
pass instead of loading the entire file into a str (avoids the 100 MB str
copy); char_count, line_count, preview, and auto-title are computed
incrementally while streaming.
- library_pipeline.py ImageProcessor: JPEG thumbnail conversion now handles
LA, PA, I;16 and other non-RGB/L/CMYK Pillow modes instead of only RGBA/P.
- knowledge_ingest.py _download_article: unescape HTML entities in the
title extracted from the <title> tag, matching library_pipeline.WebProcessor.
- x.py XWatchStore.create_watch: chain sqlite3.IntegrityError via
raise from e.
- agent_registry_store.py verify_registry_token: isinstance payload dict
guard with a clear ValueError when the JWT payload is not a JSON object.
Already fixed by prior commit (verified, no change needed):
- youtube.py / x.py: --dump-single-json (was --dump-json)
- youtube.py / x.py: asyncio.wait_for timeout on subprocess communicate()
- x.py fetch_tweet_ytdlp: raise from exc
Docs-Reviewed: no routes/, desktop app, or catalog manifest changes; these are internal library pipeline fixes with no agent-facing API surface
- TextProcessor now streams file reads instead of loading the entire file into a single `str`, eliminating the 100 MB `str` copy on large text files.
4
+
- Article title extraction in `knowledge_ingest._download_article` now unescapes HTML entities (e.g. `&` becomes `&`), matching the behaviour already present in `library_pipeline.WebProcessor`.
5
+
- ImageProcessor JPEG thumbnail conversion now handles `LA`, `PA`, `I;16` and other non-RGB/L/CMYK Pillow modes instead of raising on them.
6
+
-`x.py``create_watch` now chains the `sqlite3.IntegrityError` via `raise ... from e`.
7
+
-`verify_registry_token` now raises `ValueError` with a clear message when the JWT payload is not a JSON object (dict).
0 commit comments