fix: bound CSV and RTF materialization - #107
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
Trigger the temporary main-branch workflow that applies and verifies all review fixes for firecrawl#107.
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/apply-verified-rtf-fix.yml">
<violation number="1">
P1: This push-triggered job gives a write-scoped `GITHUB_TOKEN` to code compiled and executed from the triggering branch. A contributor can add a build script, test, or procedural macro that uses the checkout credentials to push arbitrary repository changes; run verification with read-only permissions and perform the final commit from a separate trusted job or reviewed ref.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
Add fixed standalone-input and materialization budgets for CSV and RTF, charge cells/text/text runs before retaining them, include generated list labels, preserve the first ResourceLimit across RTF boundaries, and add regression coverage. Verified with rustfmt, cargo test --locked, and workspace-wide Clippy with warnings denied.
4215dfd to
6096ffa
Compare
…aterialization # Conflicts: # src/formats/rtf/mod.rs
Summary
Fixes #104.
CSV and RTF bypass the archive package's decompression limits and could materialize an unbounded number of cells, copied text bytes, or separately allocated text runs. This adds a shared fixed budget for standalone frontends and returns the existing
resourceLimiterror before pathological input can grow the document model without bound.What is bounded
The limits are fixed alongside the existing archive, XML, expansion, and asset caps. CSV charges every parsed field before constructing its cell. RTF charges decoded text centrally, every emitted text run, generated ordered-list labels, and every closed table cell. Retry/recovery paths cannot swallow
ResourceLimit.Tests
Implementation was prepared with AI-assisted tooling; all listed checks ran on the submitted commit.
Summary by cubic
Bounds CSV and RTF materialization and standalone input size to prevent unbounded document growth. Previously, standalone CSV/RTF bypassed archive caps and could allocate unlimited cells, text bytes, and text runs; now both enforce fixed caps and return a ResourceLimit before the model grows.
package/materialization::MaterializationBudgetwith defaults inpackage/limitsand stable limit names: "max_standalone_input_bytes", "max_materialized_text_bytes", "max_materialized_cells", "max_materialized_text_runs".parsesignatures unchanged;parse_with_budgetis internal.Written for commit b5cf3a1. Summary will update on new commits.