Skip to content

feat(limits): size & shape limits#14

Open
pinodeca wants to merge 1 commit into
mainfrom
pinodeca/size-limits
Open

feat(limits): size & shape limits#14
pinodeca wants to merge 1 commit into
mainfrom
pinodeca/size-limits

Conversation

@pinodeca

@pinodeca pinodeca commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the three-tier size & shape limits described in docs/proposals/size-limits.md.

New constants (src/runtime/limits.rs):

  • MAX_HISTORY_BYTES = 5 MiB — aggregate history cap per execution
  • MAX_PAYLOAD_BYTES = 3 MiB — activity/orch inputs & outputs
  • MAX_SMALL_VALUE_BYTES = 64 KiB — names, identifiers, error strings

Enforcement is opt-in via two new RuntimeOptions toggles (both default false):

  • enforce_size_limits — gates all three enforcement tiers
  • emit_limit_exceeded_errors — switches error shape to ConfigErrorKind::LimitExceeded

Always-on (independent of toggles): history_size_bytes(), history_pressure(), and four new metrics (duroxide_history_bytes, duroxide_payload_bytes, duroxide_limit_violations_total, duroxide_history_terminated_oversize_total).

Checklist

  • Tests added/updated (tests/scenarios/limits.rs, 16 new scenario tests)
  • cargo nt passes locally (1092/1092)
  • Docs updated
    • docs/ORCHESTRATION-GUIDE.md — new Size Limits section
    • docs/continue-as-new.md — new Anticipating the History Limit section
    • docs/proposals/core-improvements-roadmap.md — §8 marked superseded

Links / Design notes

Full design: docs/proposals/size-limits.md
Implementation progress: docs/proposals-impl/PROGRESS-size-limits.md

@pinodeca pinodeca force-pushed the pinodeca/size-limits branch 6 times, most recently from f07c0fb to 0713605 Compare April 29, 2026 20:27
@pinodeca pinodeca force-pushed the pinodeca/size-limits branch 3 times, most recently from 45b95ae to fe5525b Compare May 5, 2026 21:11
Add MAX_HISTORY_BYTES (5 MiB), MAX_PAYLOAD_BYTES (3 MiB), and
MAX_SMALL_VALUE_BYTES (64 KiB). Enforcement is opt-in via two new
RuntimeOptions toggles (enforce_size_limits, emit_limit_exceeded_errors),
both defaulting false so upgrades preserve existing behavior.

- Tier-1/2/3 checks at client, orchestration turn, and worker
- Always-on: history_size_bytes(), history_pressure(), metrics
- 16 new scenario tests; docs updated
@pinodeca pinodeca force-pushed the pinodeca/size-limits branch from fe5525b to 7377a04 Compare May 6, 2026 19:20
@pinodeca pinodeca marked this pull request as ready for review May 6, 2026 19:28
@pinodeca pinodeca changed the title Size limits proposal and plan feat(limits): size & shape limits May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant