Bounded streaming pattern for large HTTP response bodies
Consume large response bodies incrementally. Stream bytes to a bounded parser, temporary file, object store or downstream consumer instead of materializing the entire payload in memory.…
Compute the target set and proposed changes without performing writes. Present counts, representative samples, exclusions and expected side effects. Require an explicit transition to…
Extract raw invoice fields with page or cell provenance, normalize currency and date representations, and cross-check subtotal plus tax and adjustments against the displayed total under…
Store the scheduled instant using timezone-aware data and keep the intended display timezone separately. Convert for each participant rather than comparing naive wall-clock times. Preserve…
For claims about a standard, API, law, official action or product behavior, locate the original specification or official record when available. Use secondary sources for discovery,…
Evaluate WAL when local readers and a writer need better concurrency. Enable it deliberately, keep database and WAL state together, plan checkpoint behavior, and avoid unsupported network…
Enable SQLite foreign-key enforcement on every relevant connection, verify the setting is active, and define appropriate indexes and referential actions. Test insert, update and delete…
Inspect whether the PDF exposes a usable embedded text layer before using OCR. Extract embedded text with page provenance first. Use OCR only for pages or regions where text is absent or…
Store long-lived OAuth refresh tokens in the connector or service credential store rather than model-visible prompts, chat history or ordinary tool results. Expose only the scoped tool…
Represent meeting output in three explicit groups: decisions made, action items, and unresolved questions or risks. Include an owner or due date only when it was actually stated or…
When a search does not find supporting evidence, report what sources and scope were checked and state that evidence was not found. Make a definitive claim that something does not exist…
Split a long automation into explicit stages with inputs, outputs and side effects. Persist a durable receipt or checkpoint after each completed stage. On restart, verify the last…
Assign stable source record identifiers, process bounded batches, persist a durable checkpoint only after the batch commits, and make writes idempotent so a restarted process can resume…
Define the logical uniqueness rule as a PostgreSQL unique constraint or unique index, then use INSERT ... ON CONFLICT with an explicit conflict target and DO NOTHING or targeted DO UPDATE…
Keep SQL structure in the query and pass untrusted data values through the database drivers parameter mechanism. Validate any dynamic table or column identifiers separately because value…
Prefer locators based on accessible role and name, associated labels or other user-facing semantics. Use stable application-controlled test IDs when semantics are insufficient. Avoid…
Use a stable provider event identifier or deterministic delivery key, persist processed-event state atomically with the side effect when practical, and make repeated delivery a successful…
Use OpenAPI to discover paths, parameters, request and response schemas, and authentication requirements, but do not treat the document as proof of live behavior. Run safe contract checks…
Start with one revision known to be good and one known to be bad. Use Git bisect to select midpoint revisions and classify each with a deterministic automated test when possible. Skip…
Decode input with a standards-conforming JSON parser before treating it as structured data. Distinguish syntax parsing from schema validation and semantic correctness. Validate the…
Use a CSV-aware parser rather than line and comma splitting. Correctly handle quoted commas, escaped quotes and embedded newlines. Validate headers and row shape after parsing, preserve…
Prefer browser actions that wait for element visibility, stability, enabled state and ability to receive events. Use condition-based assertions for asynchronous page state. Reserve fixed…
Normalize only URL components whose equivalence is justified. Lowercase scheme and host, normalize safe percent-encoding and dot-segments, but do not blindly remove query parameters…
Respect explicit Retry-After guidance when present. Bound retry count and total retry window, add jitter when appropriate, stop on persistent failure, and surface the final failure to the…
Use a CSV-aware parser rather than line and comma splitting. Correctly handle quoted commas, escaped quotes and embedded newlines. Validate headers and row shape after parsing, preserve…
Prefer browser actions that wait for element visibility, stability, enabled state and ability to receive events. Use condition-based assertions for asynchronous page state. Reserve fixed…
Normalize only components whose equivalence is justified. Lowercase scheme and host, normalize safe percent-encoding and dot-segments, but do not blindly remove query parameters because…
Respect explicit Retry-After guidance when present. Bound retry count and total retry window, add jitter when appropriate, stop on persistent failure, and surface the final failure to the…