72272b2d62
Wiki ingest runs asynchronously after the parse pipeline and was not counted in pending_subtasks_count, so a document flipped to "completed" while wiki generation was still minutes away (30s debounce + batch + retries). That hid the in-progress state and dropped the stop-parse affordance before wiki actually finished. Count wiki as a single enrichment subtask (when WikiEnabled and the doc has text chunks, matching the enqueue condition) so the row stays in "finalizing" until wiki is done. The batch worker drains the slot at the op's terminal state: once on successful map, and once when an op is dead-lettered after exhausting in-batch retries. Retract ops (deleted knowledge) are skipped. FinalizeSubtask guards both the decrement and the promote, so a wiki op enqueued before this accounting shipped is a harmless no-op on an already-completed row. A wiki op that never drains is bounded by the existing housekeeping finalizing sweep.