Skip to content

docs: 2.0 error contract (0250) and untrusted-input mode tasks - #584

Merged
rmorozov merged 4 commits into
masterfrom
claude/project-thread-dzeurw
Oct 18, 2026
Merged

rmorozov merged 4 commits into
masterfrom
claude/project-thread-dzeurw

Conversation

@rmorozov

@rmorozov rmorozov commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Requested by Ruslan · project thread

Before: the public API had no written error contract, and there was no plan for hosts that render templates written by their users.

After:

  • Error contract (0250). docs/api-2.0.md §2.1 states the contract Ruslan approved on 2026-10-18:

    • Load and Render report everything through Result. Only system out-of-memory escapes as bad_alloc, plus a failure of a caller stream whose exception mask the caller enabled.
    • Every other throwing call gets a noexcept sibling.
    • New jinja2::Exception and codes 15-18.
    • ErrorInfo becomes one pointer to a shared payload that keeps the original exception.
    • std::error_code interop.
    • Render errors carry their template location.

    The plan is in docs/design/0250-error-contract-plan.md. Phases: 0253 (P1, freeze-critical), 0254 (P2), 0255 (P3).

  • Untrusted input (Ruslan's decisions S1-S8):

    • 0262 Settings::Limits with presets (freeze-critical)
    • 0263 per-operation size checks
    • 0264 bounded template cache and MemoryFileSystem const path
    • 0265 hardening by default, with invariant checks that throw instead of aborting (C++26 contracts where available)
    • 0266 ConfinedFileSystem, using descriptor/handle-based traversal
    • 0267 fuzz targets for untrusted templates
    • 0268 additive follow-ups

    0097, 0098 and 0224 link to these tasks. 0107 gains a replace('') filter divergence. 0253 also updates REVIEW.md's error-boundary rule.

How: docs only. 0250's own task file is in #573, now merged; P1 (#597) marks it done. The task index is regenerated by the merge steward.

Roles: architect (two reviews: the error contract and untrusted input). No verifier (docs only). Red pushes: none. Codex: 3 findings, 3 fixed, 0 declined (stream exception in rule 2, GetException() presence rule, symlink check/use race in 0266).

🤖 Generated with Claude Code

https://claude.ai/code/session_013xuF18HHo2XvFRnjsqpvFt

File the tasks from the untrusted-input review with Ruslan's decisions
(S1-S8): Settings::Limits, per-operation size checks, bounded template
cache, hardening by default with throwing invariant checks, a confined
filesystem loader, fuzz targets for untrusted templates, and additive
follow-ups. Link 0097, 0098 and 0224 to them; add a replace('') filter
divergence to 0107.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xuF18HHo2XvFRnjsqpvFt
@rmorozov rmorozov self-assigned this Oct 18, 2026
Ruslan approved the recommended options (2026-10-18). Write the contract
as docs/api-2.0.md section 2.1, keep the plan in docs/design, and file
P1 (public types and boundary), P2 (render locations) and P3 (engine
runtime error codes).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xuF18HHo2XvFRnjsqpvFt
@rmorozov rmorozov changed the title tasks: untrusted-input mode for 2.0 (0262-0268) docs: 2.0 error contract (0250) and untrusted-input mode tasks Oct 18, 2026
@rmorozov
rmorozov marked this pull request as ready for review October 18, 2026 12:27
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xuF18HHo2XvFRnjsqpvFt

Copy link
Copy Markdown
Member Author

@codex review


Generated by Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T18:15:29.063424Z f9bd4a7 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9bd4a7c2b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/tasks/0266-confined-filesystem.md Outdated
Comment thread docs/api-2.0.md Outdated
Comment thread docs/api-2.0.md Outdated
Rule 2 names the caller-stream exception of rule 3; GetException() is set
for exceptions thrown outside the template engine, including the public
headers' host-data conversion; 0266 validates what is opened (descriptor
or handle walk) instead of a resolved path, closing the check/use race.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xuF18HHo2XvFRnjsqpvFt
@rmorozov
rmorozov merged commit da951ff into master Oct 18, 2026
3 checks passed
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.

2 participants