Repository navigation
Conversation
Validate crawl parameters and index results, bound processing and save windows, and preserve replay-safe output and extraction contracts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a837848b-dfcf-4f51-962d-90514abd0c99
Independent Gemini review and verificationReviewed head: After this PR was created, an independent Gemini 4 Argon subagent reviewed the published diff for correctness, regressions, security concerns, edge cases, missing tests, and unnecessary complexity. It reported no actionable findings and no optional changes. This is an AI review result, not a substitute for required human approval or a guarantee that every possible defect has been excluded. The result was checked independently rather than accepted solely on the model's authority:
No additional implementation changes were warranted by the Gemini feedback, so no speculative refactor or review-only code churn was added. PR #3200's extraction implementation/tests and the existing save activity/bindings remain unchanged. The rollout and residual limits in the PR description still apply: drain or version active orchestrations before deployment, verify operational worker sizing, and do not treat count limits as a global rate or memory-byte ceiling. No live Azure deployment or local Functions-host test was performed. |
Summary
Why this is needed
Previously, a crawl requesting two records could process 200 if the index returned 200. With a batch size of one, it scheduled 200 processing activities before waiting, then 200 batch saves before waiting. This change rejects that excess before processing.
Similarly,
batch_size=0previously started a workflow and failed later. It now returns a useful validation error without starting any orchestration.Policy and compatibility
2 * ceil(N / B) + 2, up to 2,002The default crawl has 20 batches and at most 42 logical activity calls. These are count/scheduling limits, not measured worker-capacity figures or exactly-once execution guarantees.
Missing/empty numeric HTTP parameters retain their defaults. Direct inputs retain missing-field defaults but reject explicit invalid values. Existing successful starter status responses and output formats are unchanged. Direct orchestration validation/contract errors return an error payload; the Durable instance may therefore be Completed with
status: error, not Failed. Activity exceptions still propagate.Requests, urllib3, and warcio pins from #3200 are unchanged. Add
azure-functions-durable<2to retain this example's existingfunction.jsonprogramming model; no SDK-model migration is included.Validation
compileall,pip check, repository-pinned Prettier checks for the README/host config, andgit diff --checkpassed.Tests use mocks and recorded/synthetic data, not live Azure, Common Crawl, storage, or secrets. Azure Functions Core Tools are unavailable, so no local Functions-host or deployment test is claimed.
Rollout and limits
Changing task order changes orchestration history. Stop new starts and drain active instances on the old code before deployment; otherwise use a separately versioned deployment/task hub.
Count limits do not impose byte ceilings on initial-index lines, extracted objects, or workflow history, and they are not a global admission/rate limit. Preserve #3200's independent byte limits and verify production worker sizing. The existing logged non-200 index response still becomes an empty result; changing that legacy error/no-data behavior is outside this fix. Do not increase worker activity concurrency without reviewing the save activity's existing shared container state.