Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Preserve count semantics across data providers
Ensure cache and fallback totals use the same filters and cursor scope; do not reuse an aggregation that ignores filters applied on the cached path.
Bad example
| 1 | return { items: filtered, total: allItems.length }; |
Explanation (EN)
Ensure cache and fallback totals use the same filters and cursor scope; do not reuse an aggregation that ignores filters applied on the cached path.
Objašnjenje (HR)
Ensure cache and fallback totals use the same filters and cursor scope; do not reuse an aggregation that ignores filters applied on the cached path.
Good example
| 1 | return { items: filtered.slice(0, limit), total: filtered.length }; |
Explanation (EN)
Preserve count semantics across data providers
Objašnjenje (HR)
Preserve count semantics across data providers
Notes (EN)
Ensure cache and fallback totals use the same filters and cursor scope; do not reuse an aggregation that ignores filters applied on the cached path.
Bilješke (HR)
Primijeniti pri promjenama cachea, fallbacka i obrade skupova podataka.
Exceptions / Tradeoffs (EN)
Different totals may be intentional for distinct documented endpoints; scope changes to the affected contract.
Iznimke / Tradeoffi (HR)
Different totals may be intentional for distinct documented endpoints; scope changes to the affected contract.