A request to perform several items is not permission to duplicate material until a number is reached. Shortage should be visible, and an omitted count needs a defined prepared scope. I compare the request with available material during planning instead of silently changing its meaning inside the loop.
Define one item before counting its files
A source containing the expected title file is treated as one item; otherwise its immediate subfolders form the sorted item list. Empty and oversized lists are rejected. File count is not work count: one folder groups the material for one occurrence.
A directory still does not prove that required content is present. Title, body and media conditions depend on the selected procedure. Equal folder counts can conceal very different readiness. Counting and preparing executable input require separate checks, so a numerical inventory cannot be mistaken for a declaration that every operation is ready.
Give explicit and omitted counts different meanings
A supplied count must meet the positive-integer format and bounds and cannot exceed available folders. Omission selects the prepared list. The adapter's actual representation should not be confused with a different interface that might use zero as an all-items marker.
Conflicting quantities in natural language require a deliberate external plan. Several numbers do not authorize arbitrary multiplication or selection of the largest. The intended work grouping must be understood before passing a count. Correct counting inside the loop and interpreting the human request are separate responsibilities.
Do not use the inner loop minimum as request validation
The original scheduler caps work using the minimum of requested count, pending material and its batch limit. That is an internal bound, not proof that a shortage satisfies the human request. The newer adapter rejects insufficient material before handing the batch to that loop.
This distinction is easy to miss during reuse. A functioning old loop does not establish the new input contract. Reading its existing limits helps determine which failures the outer planner must state explicitly. Reconstructing the conditions for reuse can matter more than copying the implementation itself.
Selection count can differ from inspection scope
The actual planner validates all folders, sorts rows by intended time and then trims to the requested count. A later invalid folder can therefore block planning even when only an earlier subset was requested. Processing two items does not necessarily mean only two were read.
Timed work selects from sorted intended dates, while untimed workflow rows can retain their original stable order. The visible order of folder names is insufficient to infer execution order. Inspecting the prepared item list reveals which sorting and selection rules actually apply, making the failure location and planned scope understandable.
Preventing automatic duplication is not semantic deduplication
Refusing to manufacture missing folders does not determine whether two supplied folders contain the same article. Equal material under different names still needs content review. File digests compare bytes and changes, not editorial originality.
The shared example requires zero working copies after an insufficient-count request and checks originals, selected quantity and duplicate names. Its twenty-four local file tests do not verify publication or semantic uniqueness of all material. This writing processes no original customer folders. The count contract remains a narrow, accurately stated guarantee.
Explain the shortage instead of manufacturing the number
An operator specifying a count expects that many actual items to be processed. Quietly doing fewer or multiplying the same material breaks that expectation. Showing available scope and missing material allows a deliberate revision of the request.
Invoices and reports have the same concern. Evidence for each occurrence matters more than a filled counter. Useful repetition starts with explaining how prepared material matches present intent, rather than inventing enough apparent work to make a numerical target look complete.