Skip to content
MSO CloudDocumentation

Limits and budgets

On this page

Every numeric limit the product enforces, the file that holds it, the external standard it traces to, and whether it meets that standard. Reviewed against the expert review 2026-11-06. A limit with no standard says so; it is a measured ratchet or an engineering choice, never presented as a standard.

The last column is machine-checked by scripts/audit/limits-registry.py (in audit:all): it fails when the constant in code differs from the Value, when a constant moves out of its pattern, or when the code file lacks the limits-and-budgets.md#anchor comment.

Proposed, pending operator#

Item Today Standard says Status
Account password minimum 10 8 (NIST rev. 3, ASVS 5.0), 12 (ASVS 4.0.3), 15 (NIST rev. 4, single-factor) Unchanged; operator decision pending
/chat gzip cap 372,588 B 365,000 B Waived at its ratchet; split of the chat thread owed
/auth/signin gzip cap 186,131 B 180,000 B Waived at its ratchet; split owed
Core Web Vitals field gate none p75 field data Budgets documented, not measured in CI
Backup retention 14 in repo, 7 reported none IT to reconcile

Route bundle budgets#

Gate: pnpm run performance:budget (§76). A route fails only past 2% over its cap.

Limit Value Code Standard Verdict Date Check
Default route cap, raw JS 1,220,000 B apps/web/scripts/check-route-bundle-budget.mjs:242 measured ratchet, no standard Ratchet; the standard ceiling below binds first on gzip 2026-11-06 apps/web/scripts/check-route-bundle-budget.mjs::re:const GLOBAL = \{ raw: ([\d_]+)=1220000
Default route cap, gzip JS 336,000 B apps/web/scripts/check-route-bundle-budget.mjs:242 measured ratchet, no standard Ratchet; 8% under the standard ceiling 2026-11-06 apps/web/scripts/check-route-bundle-budget.mjs::re:const GLOBAL = \{ raw: [\d_]+, gzip: ([\d_]+)=336000
Headroom over a cap before the gate fails 2% apps/web/scripts/check-route-bundle-budget.mjs:346 No published standard; engineering tolerance (no source found); verified 2026-11-06 Engineering tolerance 2026-11-06 apps/web/scripts/check-route-bundle-budget.mjs::re:const HEADROOM = ([\d.]+);=1.02
App-wide median route cap, gzip 264,224 B apps/web/scripts/check-route-bundle-budget.mjs:257 measured ratchet, no standard Creep detector; never raised to fit one route 2026-11-06 apps/web/scripts/check-route-bundle-budget.mjs::re:medianGzip: ([\d_]+)=264224
App-wide maximum route cap, gzip 372,588 B apps/web/scripts/check-route-bundle-budget.mjs:257 measured ratchet, no standard Over the standard ceiling because of /chat; see waiver 2026-11-06 apps/web/scripts/check-route-bundle-budget.mjs::re:maxGzip: ([\d_]+)=372588
Hard ceiling, any route, gzip JS 365,000 B apps/web/scripts/check-route-bundle-budget.mjs:25 Alex Russell, The Performance Inequality Gap, 2024 (https://infrequently.org/2024/01/performance-inequality-gap-2024/): 365 KiB compressed JavaScript (JS-heavy site, 3 s first load, P75 device and network, not the global median); the 365,000 B cap is 2.4% under 365 KiB; verified 2026-11-06 Enforced on measured size; /chat waived at its ratchet 2026-11-06 apps/web/scripts/check-route-bundle-budget.mjs::re:STANDARD_MAX_GZIP = ([\d_]+)=365000
Hard ceiling, landing and auth routes (/, /auth/*; /share/* is an app route), gzip JS 180,000 B apps/web/scripts/check-route-bundle-budget.mjs:27 No published number; engineering choice of about half the 365 KiB budget of Russell 2024 (https://infrequently.org/2024/01/performance-inequality-gap-2024/) for signed-out first visits; verified 2026-11-06 Enforced on measured size; /auth/signin waived at its ratchet 2026-11-06 apps/web/scripts/check-route-bundle-budget.mjs::re:PUBLIC_ROUTE_MAX_GZIP = ([\d_]+)=180000
/chat route cap, gzip JS 260,300 B apps/web/scripts/check-route-bundle-budget.mjs:280 measured ratchet under the 365 KiB budget (Russell 2024, https://infrequently.org/2024/01/performance-inequality-gap-2024/); verified 2026-11-06 KEEP: thread split into a dynamic chunk (measured 257,700 B + 1 %) 2026-11-06 apps/web/scripts/check-route-bundle-budget.mjs::re:'/chat': \{ raw: [\d_]+, gzip: ([\d_]+)=260300
/ (landing) route cap, gzip JS 179,391 B apps/web/scripts/check-route-bundle-budget.mjs:262 measured ratchet, no standard Under the 180,000 public ceiling by 609 B 2026-11-06 apps/web/scripts/check-route-bundle-budget.mjs::re:'/': \{ raw: [\d_]+, gzip: ([\d_]+)=179391
/auth/signin route cap, gzip JS 186,131 B apps/web/scripts/check-route-bundle-budget.mjs:264 measured ratchet, no standard Over the 180,000 public ceiling; waived, split owed; proposed, pending operator 2026-11-06 apps/web/scripts/check-route-bundle-budget.mjs::re:'/auth/signin': \{ raw: [\d_]+, gzip: ([\d_]+)=186131
/dashboards/[slug] route-specific cap (first load minus / chunks), gzip JS 175,728 B apps/web/scripts/check-route-bundle-budget.mjs:285 measured ratchet, no standard Shell floor cannot hide this route's own growth 2026-11-07 apps/web/scripts/check-route-bundle-budget.mjs::re:const ROUTE_SPECIFIC = \{ '/dashboards/\[slug\]': \{ gzip: ([\d_]+)=175241

Core Web Vitals#

ADR 0059 D9 sets the budgets from web.dev field thresholds (75th percentile of page loads). They are documented budgets; no CI gate measures field data yet.

Limit Value Code Standard Verdict Date Check
Largest Contentful Paint, p75 at 1440 px 2.5 s docs/adr/0059-per-org-dashboards-at-scale.md:218 web.dev Core Web Vitals (https://web.dev/articles/vitals): LCP good <= 2.5 s at p75; page published 2020-05-04, updated 2024-10-31; verified 2026-11-06 Matches the standard; unmeasured in CI 2026-11-06 docs/adr/0059-per-org-dashboards-at-scale.md::re:\x7c LCP p75 at 1440 px +\x7c +≤ ([\d.]+) s=2.5
Interaction to Next Paint 200 ms docs/adr/0059-per-org-dashboards-at-scale.md:219 web.dev Core Web Vitals (https://web.dev/articles/vitals): INP good <= 200 ms at p75; page updated 2024-10-31; verified 2026-11-06 Matches the standard; unmeasured in CI 2026-11-06 docs/adr/0059-per-org-dashboards-at-scale.md::re:\x7c INP +\x7c +≤ (\d+) ms=200
Cumulative Layout Shift 0.1 docs/adr/0059-per-org-dashboards-at-scale.md:220 web.dev Core Web Vitals (https://web.dev/articles/vitals): CLS good <= 0.1 at p75; page published 2020-05-04; verified 2026-11-06 Matches the standard; unmeasured in CI 2026-11-06 docs/adr/0059-per-org-dashboards-at-scale.md::re:\x7c CLS +\x7c +≤ ([\d.]+)\s=0.1
Time to First Byte 0.8 s docs/adr/0059-per-org-dashboards-at-scale.md:221 web.dev TTFB (https://web.dev/articles/ttfb): good <= 0.8 s, a rough guide and not a Core Web Vital; published 2021-10-26, updated 2025-11-18; verified 2026-11-06 Matches the standard; unmeasured in CI 2026-11-06 docs/adr/0059-per-org-dashboards-at-scale.md::re:\x7c TTFB +\x7c +≤ ([\d.]+) s=0.8

Request body caps#

§138. Every cap is enforced while the body is read.

Limit Value Code Standard Verdict Date Check
Inline tRPC upload, one file decoded 8 MiB apps/web/src/server/request-body-limits.ts:7 OWASP API Security Top 10 2023, API4 Unrestricted Resource Consumption (https://api-security.owasp.org/editions/2023/en/0xa4-unrestricted-resource-consumption): "define and enforce a maximum size of data on all incoming parameters and payloads"; no number; verified 2026-11-06 Engineering limit; a number is defined, as the standard asks 2026-11-06 apps/web/src/server/request-body-limits.ts::re:INLINE_UPLOAD_MAX_BYTES = ([^;]+);=8 * MIB
Proxy body clone cap 24 MiB apps/web/src/server/request-body-limits.ts:21 OWASP API Security Top 10 2023, API4 Unrestricted Resource Consumption (https://api-security.owasp.org/editions/2023/en/0xa4-unrestricted-resource-consumption): "define and enforce a maximum size of data on all incoming parameters and payloads"; no number; verified 2026-11-06 Must exceed 2 base64 files plus the envelope; test-guarded 2026-11-06 apps/web/src/server/request-body-limits.ts::re:PROXY_BODY_MAX_BYTES = ([^;]+);=24 * MIB
Proxy cap ceiling held by the guard test 32 MiB apps/web/src/server/request-body-limits.ts:25 OWASP API Security Top 10 2023, API4 Unrestricted Resource Consumption (https://api-security.owasp.org/editions/2023/en/0xa4-unrestricted-resource-consumption): "define and enforce a maximum size of data on all incoming parameters and payloads"; no number; verified 2026-11-06 Engineering limit 2026-11-06 apps/web/src/server/request-body-limits.ts::re:PROXY_BODY_CEILING_BYTES = ([^;]+);=32 * MIB
Webhook and internal JSON body 256 KiB apps/web/src/server/capped-body.ts:3 OWASP API Security Top 10 2023, API4 Unrestricted Resource Consumption (https://api-security.owasp.org/editions/2023/en/0xa4-unrestricted-resource-consumption): "define and enforce a maximum size of data on all incoming parameters and payloads"; no number; verified 2026-11-06 Engineering limit; real vendor envelopes are a few KiB 2026-11-06 apps/web/src/server/capped-body.ts::re:MAX_WEBHOOK_BODY_BYTES = ([^;]+);=256 * 1024
Org-data archive upload, streamed 2 GiB apps/web/src/app/api/admin/org-data/upload/route.ts:25 OWASP API Security Top 10 2023, API4 Unrestricted Resource Consumption (https://api-security.owasp.org/editions/2023/en/0xa4-unrestricted-resource-consumption): "define and enforce a maximum size of data on all incoming parameters and payloads"; no number; verified 2026-11-06 Engineering limit; stream is metered, admin-only, rate-limited 10/60 s 2026-11-06 apps/web/src/app/api/admin/org-data/upload/route.ts::re:MAX_UPLOAD_BYTES = ([^;]+);=2 * 1024 * 1024 * 1024

Rate limits#

Fixed-window counters in Redis through rateLimit. Counts are requests per window in seconds.

Limit Value Code Standard Verdict Date Check
Sign-in per IP and email 10 per 300 s apps/web/src/auth/config.ts:137 NIST SP 800-63B rev. 3 s5.2.2 (https://pages.nist.gov/800-63-3/sp800-63b.html) and rev. 4 s3.2.2 (https://pages.nist.gov/800-63-4/sp800-63b/authenticators/): at most 100 consecutive failed attempts per account; ASVS 4.0.3 V2.2.1 (no more than 100 failed attempts per hour on a single account); verified 2026-11-06 Within the standard 2026-11-06 apps/web/src/auth/config.ts::re:signinRateLimitKey\(ip, email\), limit: (\d+), windowSec: (\d+)=10,300
Sign-in per account, any IP 20 per 900 s apps/web/src/auth/config.ts:139 NIST SP 800-63B rev. 3 s5.2.2 (https://pages.nist.gov/800-63-3/sp800-63b.html) and rev. 4 s3.2.2 (https://pages.nist.gov/800-63-4/sp800-63b/authenticators/): at most 100 consecutive failed attempts per account; ASVS 4.0.3 V2.2.1 (no more than 100 failed attempts per hour on a single account); verified 2026-11-06 Within the standard; throttle, not a lockout at 100 consecutive failures 2026-11-06 apps/web/src/auth/config.ts::re:signinAccountRateLimitKey\(email\), limit: (\d+), windowSec: (\d+)=20,900
Sign-in per IP, any account 30 per 300 s apps/web/src/auth/config.ts:140 No numeric standard for per-IP limits; NIST SP 800-63B s5.2.2 and the OWASP Authentication Cheat Sheet (https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html) key the failure counter to the account, not the IP; verified 2026-11-06 Within the standard 2026-11-06 apps/web/src/auth/config.ts::re:signinIpRateLimitKey\(ip\), limit: (\d+), windowSec: (\d+)=30,300
Magic-link request per IP 5 per 60 s apps/web/src/app/api/auth/magic-link/route.ts:13 No numeric standard; NIST SP 800-63B s5.2.2 (https://pages.nist.gov/800-63-3/sp800-63b.html) throttles failed authentications per account only; verified 2026-11-06 Engineering default 2026-11-06 apps/web/src/app/api/auth/magic-link/route.ts::re:magic-link:ip:\$\{ip\}[^,]*, limit: (\d+), windowSec: (\d+)=5,60
Magic-link request per email 3 per 300 s apps/web/src/app/api/auth/magic-link/route.ts:49 No numeric standard; verified 2026-11-06 Engineering default 2026-11-06 apps/web/src/app/api/auth/magic-link/route.ts::re:magic-link:email:\$\{email\}[^,]*,\s+limit: (\d+),\s+windowSec: (\d+)=3,300
MCP tools listing per IP 60 per 60 s apps/web/src/app/api/mcp/tools/route.ts:13 OWASP API Security Top 10 2023, API4 (https://api-security.owasp.org/editions/2023/en/0xa4-unrestricted-resource-consumption): "implement a limit on how often a client can interact with the API within a defined timeframe"; no number; verified 2026-11-06 Engineering default 2026-11-06 apps/web/src/app/api/mcp/tools/route.ts::re:mcp:tools:\$\{ip\}[^,]*, limit: (\d+), windowSec: (\d+)=60,60
MCP tool execution per IP 30 per 60 s apps/web/src/app/api/mcp/exec/route.ts:23 OWASP API Security Top 10 2023, API4 (https://api-security.owasp.org/editions/2023/en/0xa4-unrestricted-resource-consumption): "implement a limit on how often a client can interact with the API within a defined timeframe"; no number; verified 2026-11-06 Engineering default 2026-11-06 apps/web/src/app/api/mcp/exec/route.ts::re:mcp:exec:\$\{ip\}[^,]*, limit: (\d+), windowSec: (\d+)=30,60
Chat turn per org and user 30 per 60 s apps/web/src/app/api/chat/route.ts:136 OWASP API Security Top 10 2023, API4 (https://api-security.owasp.org/editions/2023/en/0xa4-unrestricted-resource-consumption): "implement a limit on how often a client can interact with the API within a defined timeframe"; no number; model cost bound is an engineering choice; verified 2026-11-06 Engineering default 2026-11-06 apps/web/src/app/api/chat/route.ts::re:chat:\$\{orgId\}:\$\{userId \?\? ip\}[^,]*, limit: (\d+), windowSec: (\d+)=30,60
Connector webhook per type and IP 600 per 60 s apps/web/src/app/api/ingest/webhook/[connectorType]/[connectorId]/route.ts:82 No numeric standard; vendor burst rates; verified 2026-11-06 Measured against vendor bursts 2026-11-06 apps/web/src/app/api/ingest/webhook/[connectorType]/[connectorId]/route.ts::re:ingest:webhook:\$\{connectorType\}:\$\{clientIp\(req\)\}[^,]*,\s+limit: (\d+),\s+windowSec: (\d+)=600,60
Share-link wrong password per link and viewer 10 per 300 s apps/web/src/server/routers/public-share.ts:82 NIST SP 800-63B rev. 3 s5.2.2 (https://pages.nist.gov/800-63-3/sp800-63b.html) and rev. 4 s3.2.2 (https://pages.nist.gov/800-63-4/sp800-63b/authenticators/): at most 100 consecutive failed attempts per account; ASVS 4.0.3 V2.2.1 (no more than 100 failed attempts per hour on a single account); verified 2026-11-06 Within the standard 2026-11-06 apps/web/src/server/routers/public-share.ts::re:PASSWORD_FAIL_LIMIT = (\d+);\s+const PASSWORD_FAIL_WINDOW_SEC = (\d+);=10,300
Retry-After on a procedure-level 429 with no exact wait 60 s apps/web/src/app/api/trpc/[trpc]/route.ts:12 RFC 6585 s4 (https://www.rfc-editor.org/rfc/rfc6585#section-4): a 429 MAY include Retry-After; RFC 9110 s10.2.3 (https://www.rfc-editor.org/rfc/rfc9110#section-10.2.3) defines the header and names 503 and 3xx, not 429; verified 2026-11-06 Every 429 carries Retry-After; exact limiter value where the route has it 2026-11-06 apps/web/src/app/api/trpc/[trpc]/route.ts::re:TRPC_DEFAULT_RETRY_AFTER_SEC = (\d+);=60
Redis call deadline in the limiter 500 ms apps/web/src/server/middleware/rate-limit.ts:8 No published standard; measured; verified 2026-11-06 Fails open past the deadline 2026-11-06 apps/web/src/server/middleware/rate-limit.ts::re:REDIS_CALL_DEADLINE_MS = ([\d_]+);=500

AI token budgets#

Per-org monthly allowances, metered on ai_usage_log (input + output tokens) per ICT calendar month. NULL means unlimited and not metered; 0 refuses everything. No allowance has a default: the operator sets one per org in the Admin CP org drawer. A spent chat allowance answers 429 with Retry-After at the next ICT month start.

Limit Value Code Standard Verdict Date Check
Chat assistant tokens per org per month (organizations.chat_ai_budget_tokens), settable range No default (NULL = unlimited); 0 to 2,000,000,000 apps/web/src/server/routers/admin.ts:865 OWASP API Security Top 10 2023, API4 (https://api-security.owasp.org/editions/2023/en/0xa4-unrestricted-resource-consumption): "Configure spending limits for all service providers/API integrations"; no number, so no default cap (ADR 0060 S5); the upper bound stays under the PostgreSQL integer maximum 2,147,483,647 (https://www.postgresql.org/docs/current/datatype-numeric.html); verified 2026-11-07 Mechanism meets the standard; the number is the operator's per org; no-default guarded by org-quota-no-implicit-ceiling.test.ts 2026-11-07 apps/web/src/server/routers/admin.ts::re:chatAiBudgetTokens: z\.number\(\)\.int\(\)\.min\((\d+)\)\.max\(([\d_]+)\)=0,2_000_000_000

Sessions#

Operator decision 2026-11-06: KEEP 14 days with a rolling 24 hours for all roles, no admin-specific cut. ASVS L2 would be 12 hours or 30 minutes idle; the gap is accepted.

Limit Value Code Standard Verdict Date Check
Session lifetime 14 days apps/web/src/auth/edge-config.ts:4 NIST SP 800-63B rev. 3 s4.1.3 (https://pages.nist.gov/800-63-3/sp800-63b.html): AAL1 reauthentication SHOULD repeat at least once per 30 days; rev. 4 s2.1.3 (https://pages.nist.gov/800-63-4/sp800-63b/aal/): overall timeout SHOULD be no more than 30 days at AAL1; ASVS 4.0.3 V3.3.2 (https://github.com/OWASP/ASVS/blob/v4.0.3/4.0/en/0x12-V3-Session-management.md): L1 30 days, L2 12 hours or 30 min idle (2FA optional), L3 12 hours or 15 min idle with 2FA; ASVS 5.0 V7.3.1/V7.3.2 (L2) set no number; verified 2026-11-06 KEEP (operator decision 2026-11-06): within L1 and AAL1, outside ASVS L2 2026-11-06 apps/web/src/auth/edge-config.ts::re:SESSION_MAX_AGE_SEC = ([^;]+);=14 * 24 * 60 * 60
Session rolling refresh 24 hours apps/web/src/auth/edge-config.ts:6 Same sources; no numeric rule for refresh; verified 2026-11-06 KEEP (operator decision 2026-11-06) 2026-11-06 apps/web/src/auth/edge-config.ts::re:SESSION_UPDATE_AGE_SEC = ([^;]+);=24 * 60 * 60

Passwords#

Account password minimum is unchanged (proposed, pending operator). Share-link minimum rose from 4 to 8 for new and changed passwords on 2026-11-06.

Limit Value Code Standard Verdict Date Check
Account password minimum 10 characters apps/web/src/server/routers/users.ts:220 NIST SP 800-63B rev. 3 s5.1.1.2 (https://pages.nist.gov/800-63-3/sp800-63b.html): minimum 8; rev. 4 s3.1.1.2 (https://pages.nist.gov/800-63-4/sp800-63b/authenticators/): 15 for a single-factor password, 8 when only used with MFA; ASVS 4.0.3 V2.1.1: 12; ASVS 5.0 V6.2.1 (https://github.com/OWASP/ASVS/blob/v5.0.0/5.0/en/0x15-V6-Authentication.md): 8; verified 2026-11-06 Meets NIST rev. 3 and ASVS 5.0; 2 under ASVS 4.0.3; 5 under NIST rev. 4 if the password is the only factor; proposed, pending operator 2026-11-06 apps/web/src/server/routers/users.ts::re:newPassword: z\.string\(\)\.min\((\d+)\)=10
bcrypt cost factor 10 apps/web/src/server/routers/users.ts:227 OWASP Password Storage Cheat Sheet (https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html): bcrypt work factor "a minimum of 10"; verified 2026-11-06 At the floor 2026-11-06 apps/web/src/server/routers/users.ts::re:bcrypt\.hash\(input\.newPassword, (\d+)\)=10
Share-link password minimum, new and changed 8 characters apps/web/src/lib/share-password.ts:2 NIST SP 800-63B rev. 3 s5.1.1.2 (https://pages.nist.gov/800-63-3/sp800-63b.html): minimum 8; ASVS 5.0 V6.2.1: 8; verified 2026-11-06 Meets the standard; existing shares keep opening at any length 2026-11-06 apps/web/src/lib/share-password.ts::re:SHARE_PASSWORD_MIN_LENGTH = (\d+);=8

Database#

Limit Value Code Standard Verdict Date Check
RLS transaction statement and idle timeout (RLS_TX_TIMEOUT_MS) 60 s packages/schema/src/client.ts:38 No standard; PostgreSQL statement_timeout defaults to 0, disabled (https://www.postgresql.org/docs/current/runtime-config-client.html); verified 2026-11-06 Measured against the heaviest rollup 2026-11-06 packages/schema/src/client.ts::re:function readTxTimeoutMs\(\): number \{[^}]*?: ([\d_]+);=60_000
AI failover cooldown for a candidate that failed with authentication, quota or model-not-found 60 s packages/ai/src/failover.ts:78 No numeric standard (proposal). Pattern: Azure Circuit Breaker (https://learn.microsoft.com/en-us/azure/architecture/patterns/circuit-breaker) and AWS Builders Library timeouts/retries (https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter/) give no number; nearest default is Envoy outlier detection base_ejection_time 30 s (https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/cluster/v3/outlier_detection.proto); verified 2026-11-07 KEEP as proposal: 2x the Envoy base, process-local, last candidate always tried 2026-11-07 packages/ai/src/failover.ts::re:FAILOVER_COOLDOWN_MS = ([\d_]+);=60_000
AI per-attempt first-token timeout when the caller sets none, a lone candidate included 30 s packages/ai/src/failover.ts:75 No published standard; engineering default; AWS Builders Library timeouts/retries (https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter/) gives no number; verified 2026-11-07 Engineering default; callers pass 30 s (chat, MSO summary) or 60 s (masking, worker jobs) 2026-11-07 packages/ai/src/failover.ts::re:DEFAULT_TIMEOUT_MS = ([\d_]+);=30_000
App pool size (DB_POOL_MAX) 10 packages/schema/src/client.ts:23 No standard; sized against Postgres max_connections; verified 2026-11-06 Measured 2026-11-06 packages/schema/src/client.ts::re:function readPoolMax\(\): number \{[^}]*?: ([\d_]+);=10
Auth pool size (AUTH_DB_POOL_MAX) 5 packages/schema/src/client.ts:257 No standard; verified 2026-11-06 Measured 2026-11-06 packages/schema/src/client.ts::re:function readAuthPoolMax\(\): number \{[^}]*?: ([\d_]+);=5

List caps and page size#

Limit Value Code Standard Verdict Date Check
Rows an unbounded admin list may return (§1) 500 apps/web/src/lib/admin-list-limit.ts:3 OWASP API4:2023 (https://api-security.owasp.org/editions/2023/en/0xa4-unrestricted-resource-consumption): validate the parameter that controls records returned, no number; Google AIP-158 Pagination (https://google.aip.dev/158): the API enforces its own maximum page size and coerces larger requests, no mandated number; verified 2026-11-06 A bound exists; the number is an engineering choice 2026-11-06 apps/web/src/lib/admin-list-limit.ts::re:ADMIN_LIST_LIMIT = (\d+);=500
Commerce report window, inclusive ICT calendar days 400 apps/web/src/server/routers/report-range-input.ts:6 No published numeric standard; engineering ceiling aligned with the existing 400-day creator/audience series limits. Preserves annual, leap-year and last-12-month presets while bounding daily zero padding to 400 rows per platform; larger or reversed windows are rejected before queries Engineering ceiling 2026-11-13 apps/web/src/server/routers/report-range-input.ts::re:REPORT_MAX_DAYS = (\d+);=400
Default table page size 20 packages/ui/src/components/data-table.tsx:233 Google AIP-158 Pagination (https://google.aip.dev/158): page size optional with a documented finite default, no mandated number; operator standing rule; verified 2026-11-06 Operator rule 2026-11-06 packages/ui/src/components/data-table.tsx::re:DEFAULT_TABLE_PAGE_SIZE = (\d+);=20
Rows of one trend-feed slice served in one read 5000 packages/metrics/src/shared-trends-read.ts:19 No published standard; engineering ceiling mirrored from the contract constant MAX_TREND_FEED_SLICE_ROWS (packages/platform-contract/src/api.ts, ADR 0061 D4: a slice is hundreds of rows, 446 trends held on 2026-11-12); a larger slice throws instead of truncating (§57) Engineering ceiling 2026-11-12 packages/metrics/src/shared-trends-read.ts::re:MAX_TREND_FEED_SLICE_ROWS = ([\d_]+);=5000
Rows of one trend-feed history window served in one read 30000 packages/metrics/src/shared-trends-read.ts:27 No published standard; engineering ceiling derived from the writer: the connector stores the whole usable general list per cycle (TREND_HISTORY_MAX_ROWS_PER_CYCLE = 1000, packages/connectors/core/src/trend-feed-limits.ts) and keeps 30 cycles of 24h (retention in api/settings.ts), so the largest window is 30 x 1000 = 30,000 rows; a larger window throws instead of truncating (§57) Engineering ceiling 2026-11-12 packages/metrics/src/shared-trends-read.ts::re:MAX_TREND_FEED_HISTORY_ROWS = ([\d_]+);=30000
Vendor ids per focused trend-feed history read 200 packages/metrics/src/shared-trends-read.ts:30 No published standard; the board shows 50 trends (FEED_BOARD_LIMIT), the cap leaves headroom; 200 ids x 30 cycles stays under 6,000 rows Engineering ceiling 2026-11-12 packages/metrics/src/shared-trends-read.ts::re:MAX_TREND_FEED_HISTORY_FOCUS_IDS = ([\d_]+);=200

Cache lifetimes#

Limit Value Code Standard Verdict Date Check
OIDC discovery document 24 hours apps/web/src/auth/oidc-discovery-cache.ts:17 No numeric standard; OpenID Connect Discovery 1.0 (https://openid.net/specs/openid-connect-discovery-1_0.html) does not mention caching; verified 2026-11-06 Engineering default 2026-11-06 apps/web/src/auth/oidc-discovery-cache.ts::re:[^_]CACHE_TTL_SEC = ([^;]+);=24 * 60 * 60
OIDC signing keys (JWKS) 1 hour apps/web/src/auth/oidc-discovery-cache.ts:21 No numeric standard; RFC 9111 HTTP Caching, June 2022 (https://www.rfc-editor.org/rfc/rfc9111); verified 2026-11-06 Engineering default; a rotated key is picked up within the hour 2026-11-06 apps/web/src/auth/oidc-discovery-cache.ts::re:JWKS_CACHE_TTL_SEC = ([^;]+);=60 * 60
Dashboard binding cache 60 s apps/web/src/server/binding-cache.ts:8 measured ratchet, no standard; verified 2026-11-06 Matches the deck refetch rhythm 2026-11-06 apps/web/src/server/binding-cache.ts::re:BINDING_CACHE_TTL_MS \?\? ([\d_]+)=60_000

Worker retries and backoff#

Exponential delay doubles per attempt; jitter draws each delay from [delay x (1 - j), delay]. Five attempts at 30 s span 450 s (7.5 min) before jitter.

Limit Value Code Standard Verdict Date Check
Backoff jitter share 0.5 packages/schema/src/job-outbox-contract.ts:16 Google SRE book ch. 22, Addressing Cascading Failures (https://sre.google/sre-book/addressing-cascading-failures/): "Always use randomized exponential backoff when scheduling retries"; Marc Brooker, Exponential Backoff And Jitter, AWS Architecture Blog, 2015-03-04 (https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/), whose Full Jitter draws over [0, delay], wider than this 0.5 share; no published jitter share; verified 2026-11-06 Applied to every exponential backoff in worker and outbox defaults 2026-11-06 packages/schema/src/job-outbox-contract.ts::re:BACKOFF_JITTER = ([\d.]+);=0.5
Sync job attempts and base delay 5 attempts, 30 s apps/worker/src/queues.ts:995 Same sources; attempt counts have no standard; verified 2026-11-06 Engineering default 2026-11-06 apps/worker/src/queues.ts::re:DEFAULT_SYNC_JOB_OPTS: JobsOptions = \{\s+attempts: (\d+),\s+backoff: exponentialBackoff\(([\d_]+)\)=5,30000
AI job attempts and base delay 3 attempts, 10 s apps/worker/src/queues.ts:1003 Same sources; no standard for attempts or base delay; verified 2026-11-06 Engineering default 2026-11-06 apps/worker/src/queues.ts::re:DEFAULT_AI_JOB_OPTS: JobsOptions = \{\s+attempts: (\d+),\s+backoff: exponentialBackoff\(([\d_]+)\)=3,10000
Scheduled tick attempts and base delay 3 attempts, 30 s apps/worker/src/schedules.ts:348 Same sources; no standard for attempts or base delay; verified 2026-11-06 Engineering default 2026-11-06 apps/worker/src/schedules.ts::re:attempts: (\d+),\s+backoff: exponentialBackoff\(([\d_]+)\)=3,30000

Eventbus pending recovery#

Consumer-group delivery is at least once. Set the idle threshold above normal handler duration; handlers must tolerate duplicate delivery after a slow consumer or restart.

Limit Value Code Standard Verdict Date Check
Pending event idle time before reclamation 60 s packages/eventbus/src/subscribe.ts:17 No published numeric standard; engineering recovery window. Redis XAUTOCLAIM reassigns entries idle for the caller's threshold (https://redis.io/docs/latest/commands/xautoclaim/). Bounded recovery; callers may set a positive safe-integer millisecond threshold 2026-11-13 packages/eventbus/src/subscribe.ts::re:DEFAULT_PENDING_IDLE_MS = ([\d_]+);=60000

Shared trend feed#

Platform connector for the social trend vendor (ADR 0061): one account, one session, one sync for every org.

Limit Value Code Standard Verdict Date Check
Trend vendor account calls per window 300 packages/connectors/core/src/trend-feed-limits.ts:5 Vendor probe record cited in ADR 0061 Context (one account served at 300 calls per 60 s, RateLimit-Remaining counting down from 300); no published vendor standard Matches the vendor record; one Redis window counter across worker and web 2026-11-12 packages/connectors/core/src/trend-feed-limits.ts::re:VENDOR_WINDOW_CALLS = ([\d_]+);=300
Trend vendor account window 60 s packages/connectors/core/src/trend-feed-limits.ts:7 Vendor probe record cited in ADR 0061 Context (one account served at 300 calls per 60 s, RateLimit-Remaining counting down from 300); no published vendor standard Matches the vendor record 2026-11-12 packages/connectors/core/src/trend-feed-limits.ts::re:VENDOR_WINDOW_MS = ([\d_]+);=60000
Keyword search calls per window 30 packages/connectors/core/src/trend-feed-limits.ts:10 ADR 0061 D2: a tenth of the vendor window; no external standard Engineering share; the sync keeps the rest 2026-11-12 packages/connectors/core/src/trend-feed-limits.ts::re:SEARCH_WINDOW_CALLS = ([\d_]+);=30
Keyword searches running at once 2 packages/connectors/core/src/trend-feed-limits.ts:13 ADR 0061 D2: two searches at once; no external standard Engineering limit; a slot is held until the search releases it 2026-11-12 packages/connectors/core/src/trend-feed-limits.ts::re:SEARCH_CONCURRENCY = ([\d_]+);=2
Search slot lifetime 20 s packages/connectors/core/src/trend-feed-limits.ts:16 Derived: the search timeout of 15 s (search.ts) plus 5 s, so a crashed process cannot hold a slot for long Longer than the longest search 2026-11-12 packages/connectors/core/src/trend-feed-limits.ts::re:SEARCH_SLOT_TTL_MS = ([\d_]+);=20000
Sync or auth call wait for the window 300 s packages/connectors/core/src/trend-feed-limits.ts:19 measured ratchet, no standard; five windows of 60 s Engineering limit; the run then ends RATE_FLOOR and the next check retries 2026-11-12 packages/connectors/core/src/trend-feed-limits.ts::re:BUDGET_MAX_WAIT_MS = ([\d_]+);=300000
Vendor login lock lifetime 400 s packages/connectors/core/src/trend-feed-limits.ts:22 Derived: refresh fails then login, each up to two 90 s call timeouts plus the 2 s retry (client.ts, transport.ts), so 2 x 182 s = 364 s, plus margin Longer than the longest login 2026-11-12 packages/connectors/core/src/trend-feed-limits.ts::re:LOGIN_LOCK_TTL_MS = ([\d_]+);=400000
Wait for the vendor login lock 420 s packages/connectors/core/src/trend-feed-limits.ts:25 Derived: one holder lifetime (400 s) plus 20 s A waiter outlasts a live holder 2026-11-12 packages/connectors/core/src/trend-feed-limits.ts::re:LOGIN_LOCK_WAIT_MS = ([\d_]+);=420000
Vendor login lock renewal interval 30 s packages/connectors/core/src/trend-feed-limits.ts:28 The sync heartbeat slice (HEARTBEAT_SLICE_MS, client.ts); no external standard The holder renews the lock every 30 s while it works, so a wait through Retry-After (up to 450 s) cannot outlive it 2026-11-12 packages/connectors/core/src/trend-feed-limits.ts::re:LOGIN_LOCK_HEARTBEAT_MS = ([\d_]+);=30000
Trend run heartbeat expiry 600 s apps/worker/src/lib/trend-feed/run.ts:18 Derived from client.ts: longest silence about 182 s (two 90 s timeouts plus 2 s retry), a rate-limit wait beats every 30 s and is capped at 450 s (WAIT_CAP_MS) Above every legitimate gap; a dead run is taken over by the next check 2026-11-12 apps/worker/src/lib/trend-feed/run.ts::re:STALE_RUN_MS = ([\d_]+);=600000
Trend run rows kept 90 days apps/worker/src/lib/trend-feed/run.ts:21 measured ratchet, no standard (carried from the ContentHeat connector run log) Engineering choice 2026-11-12 apps/worker/src/lib/trend-feed/run.ts::re:RUN_RETENTION_DAYS = ([\d_]+);=90
Unchanged trend check rows kept 7 days apps/worker/src/lib/trend-feed/run.ts:24 measured ratchet, no standard (carried from the ContentHeat connector run log) Engineering choice 2026-11-12 apps/worker/src/lib/trend-feed/run.ts::re:UNCHANGED_RUN_RETENTION_DAYS = ([\d_]+);=7
Platform trend job BullMQ attempts 1 apps/worker/src/queues.ts:1016 No standard; a failed run is retried by the next hourly check, never by a 45-minute rerun Engineering default 2026-11-12 apps/worker/src/queues.ts::re:PLATFORM_TREND_JOB_ATTEMPTS = (\d+);=1
Keyword search cache lifetime 6 h apps/web/src/server/platform/trend-search.ts:22 ADR 0061 D4 (cached 6 h); no external standard Per the ADR 2026-11-12 apps/web/src/server/platform/trend-search.ts::re:TREND_SEARCH_CACHE_TTL_SEC = ([\d_]+);=21600
Keyword searches per org per window that miss the cache 10 apps/web/src/server/platform/trend-search.ts:24 Proposal, operator-reviewable: no source; a tenth of the 30-call account search window (ADR 0061 D2) split over a handful of orgs Proposed, pending operator 2026-11-12 apps/web/src/server/platform/trend-search.ts::re:TREND_SEARCH_ORG_LIMIT = ([\d_]+);=10
Keyword search per-org window 60 s apps/web/src/server/platform/trend-search.ts:26 Proposal, operator-reviewable: same window as the vendor account budget (60 s) Proposed, pending operator 2026-11-12 apps/web/src/server/platform/trend-search.ts::re:TREND_SEARCH_ORG_WINDOW_SEC = ([\d_]+);=60
Vendor ids per review-decision lookup 1000 packages/metrics/src/shared-trends-read.ts:732 measured ratchet, no standard; a keyword search answers far fewer hits (records of 2026-10-13) Engineering ceiling 2026-11-12 packages/metrics/src/shared-trends-read.ts::re:MAX_TREND_DECISION_LOOKUP_IDS = ([\d_]+);=1000
Runs listed on the shared trend feed page 20 apps/web/src/server/routers/platform-connectors.ts:54 Task brief of ADR 0061 M7 (last 20 runs); no external standard Engineering choice 2026-11-12 apps/web/src/server/routers/platform-connectors.ts::re:TREND_ADMIN_RUNS_LIMIT = ([\d_]+);=20
Held trends listed per state on the shared trend feed page 200 apps/web/src/server/routers/platform-connectors.ts:56 Proposal, operator-reviewable: no source; the spam screen held few rows in the ContentHeat history (0 review decisions on 446 trends); the page says when more exist Proposed, pending operator 2026-11-12 apps/web/src/server/routers/platform-connectors.ts::re:TREND_ADMIN_HELD_LIMIT = ([\d_]+);=200
Orgs read per keyset page when listing the feed holders 200 apps/web/src/server/routers/platform-connectors.ts:58 measured ratchet, no standard; the worker pages orgs by the same 200 (apps/worker/src/lib/trend-feed/orgs.ts) Matches the worker 2026-11-12 apps/web/src/server/routers/platform-connectors.ts::re:TREND_ADMIN_ORG_PAGE = ([\d_]+);=200
Shared trend feed admin writes per window per admin 30 apps/web/src/server/routers/platform-connectors.ts:60 Proposal, operator-reviewable: no source; the console default of 30 writes a minute (rateLimitedOrgProcedure) Proposed, pending operator 2026-11-12 apps/web/src/server/routers/platform-connectors.ts::re:TREND_ADMIN_MUTATION_LIMIT = ([\d_]+);=30
Shared trend feed admin write window 60 s apps/web/src/server/routers/platform-connectors.ts:62 Proposal, operator-reviewable: no source; one minute like the console default Proposed, pending operator 2026-11-12 apps/web/src/server/routers/platform-connectors.ts::re:TREND_ADMIN_MUTATION_WINDOW_SEC = ([\d_]+);=60
Source account connection test time cap 20 s apps/web/src/server/routers/platform-connectors.ts:65 Proposal, operator-reviewable: no source; one login and one list call behind a click, under the 90 s per-call vendor timeout Proposed, pending operator 2026-11-12 apps/web/src/server/routers/platform-connectors.ts::re:TREND_ADMIN_TEST_TIMEOUT_MS = ([\d_]+);=20000

Decision engine#

Limit Value Code Standard Verdict Date Check
Approved MSO decisions withheld as the control arm 1000 bp (10 %) packages/metrics/src/offtake.ts:697 No published standard; the 10 % the MSO approve payload already declared (holdout.fraction: 0.1, before ADR 0060 S2), kept as written by ADR 0060 S2 (docs/adr/0060-self-learning-seams.md); verified 2026-11-07 Engineering default; operator-accepted ADR 2026-11-07 packages/metrics/src/offtake.ts::re:MSO_DECISION_HOLDOUT_BP = (\d+);=1000

Backups#

Owned by IT. The repository default is 14; the expert review reported 7 on a host. No 7 exists in the repository, so the host value must be read and reconciled by IT.

Limit Value Code Standard Verdict Date Check
Daily dumps kept (BACKUP_KEEP_DAILY), script default 14 scripts/ops/backup-postgres.sh:69 No standard; recovery objectives are a business decision; verified 2026-11-06 Reconcile with the host value (7 vs 14); owned by IT 2026-11-06 scripts/ops/backup-postgres.sh::re:KEEP_DAILY="\$\{BACKUP_KEEP_DAILY:-(\d+)\}"=14
Daily dumps kept, compose default 14 docker-compose.backup.yml.example:53 No standard; verified 2026-11-06 Matches the script default 2026-11-06 docker-compose.backup.yml.example::re:BACKUP_KEEP_DAILY: \$\{BACKUP_KEEP_DAILY:-(\d+)\}=14