Skip to content

fix: limit nesting depth for encode and decode#317

Open
ckorhonen wants to merge 1 commit into
toon-format:mainfrom
ckorhonen:fix/max-depth-limit
Open

fix: limit nesting depth for encode and decode#317
ckorhonen wants to merge 1 commit into
toon-format:mainfrom
ckorhonen:fix/max-depth-limit

Conversation

@ckorhonen

Copy link
Copy Markdown

Summary

  • add a default maxDepth limit of 1000 for encode, decode, and streaming decode
  • expose maxDepth through the TypeScript API and CLI, with Infinity as an explicit opt-out
  • enforce the limit across normalization, replacer output, encoding, decoding, and safe dotted-path expansion
  • update API/CLI docs and add regression tests for deep inputs, tabular rows, inline containers, streaming decode, and CLI forwarding

Validation

  • nvm exec 24 corepack pnpm run lint
  • nvm exec 24 corepack pnpm run test:types
  • nvm exec 24 corepack pnpm run test
  • nvm exec 24 corepack pnpm run build
  • nvm exec 24 corepack pnpm run docs:build
  • /Users/ckorhonen/.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --codex-bin /Applications/Codex.app/Contents/Resources/codex

Autoreview result: first run found one accepted P2 issue where decode counted source indentation instead of emitted container depth for tabular row objects and inline keyed containers. Fixed by tracking emitted JSON container depth and adding regressions. Final autoreview rerun was clean with no accepted/actionable findings.

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