Commit 7886fee
fix(resp): eliminate declaration-driven aggregate allocation (#406)
* docs(planning): define RESP allocation guardrails
Record the approved parser resource-limit design, TDD execution steps, and the transition from merged PR #388 to the RESP-LIMITS-001 implementation card.
Constraint: This commit changes planning and recovery-facing documentation only; runtime behavior remains unchanged.
Confidence: High; the scope follows exact main source inspection and Redis 8.8.1 parser evidence.
Scope-risk: Low; only task-specific design, plan, STATE, and KANBAN files are included.
Tested: git diff --cached --check; placeholder scan; Requirement and task identifier scan.
Not-tested: Runtime tests are deferred to the implementation commit.
Co-authored-by: OmX <omx@oh-my-codex.dev>
* fix(resp): bound aggregate parser allocations
Reject aggregate declarations above the Redis 8.8.1 INT_MAX boundary and cap initial Array, Map, Set, and Push capacity at 1024 entries so unauthenticated input cannot directly request an unbounded Vec allocation.
Add regression coverage for exact boundary overflow, i64 capacity overflow, and the maximum accepted declaration without changing existing null or incomplete-frame semantics.
Constraint: This commit changes only the RESP parser and its in-file tests; bulk payload and connection buffer limits remain separate work.
Confidence: High; the original test failed with capacity overflow and passed after the shared capacity guard was applied.
Scope-risk: Low; normal aggregate parsing is unchanged and all four allocation sites use one private helper.
Tested: Windows and WSL cargo test -p resp; Windows and WSL target Clippy; cargo fmt --all -- --check; git diff --check.
Not-tested: Full workspace and process-level network suites were not rerun because no network, storage, Cargo, or server code changed.
Co-authored-by: OmX <omx@oh-my-codex.dev>
* fix(resp): bound aggregate nesting depth
Reject aggregate nesting beyond 128 levels before entering Array, Map, Set, or Push parsing so capped per-layer allocations and the recursive call stack cannot still grow without bound.
Add deterministic coverage for the 1024-entry capacity policy and the 128/129 nesting boundary, and correct the implementation plan exact-test commands and validation record.
Constraint: Bulk payload limits and total per-connection parser buffer limits remain separate work; no network, authentication, Cargo, storage, or command behavior is changed.
Confidence: High; the new nesting regression failed on the previous PR Head, passed after the shared depth guard, and an independent second review found no remaining finding.
Scope-risk: Low; the depth is threaded only through the four existing recursive aggregate parsers and the guard returns through the existing protocol-error path.
Tested: Windows and WSL cargo test -p resp (65 unit, 20 integration); Windows and WSL target Clippy; cargo fmt --all -- --check; git diff --check.
Not-tested: Full workspace and process-level network suites were not rerun because no network, storage, Cargo, server, or authentication code changed.
Co-authored-by: OmX <omx@oh-my-codex.dev>
* fix(resp): avoid declaration-driven aggregate allocation
Start aggregate containers empty so incomplete untrusted declarations cannot reserve element storage. Keep the Redis INT_MAX length check and the 128-level nesting guard, and measure parser-phase allocations in regression tests.
Constraint: Scope remains limited to Issue #395 B1 and the five authorized RESP task paths.
Confidence: High; the allocation regressions failed on the previous Head and pass with zero parser-phase allocation on Windows and WSL.
Scope-risk: Actual payload size and total connection-buffer limits remain separate follow-up work.
Tested: Windows and WSL cargo test -p resp; Windows and WSL cargo clippy -p resp --all-targets -- -D warnings -D clippy::unwrap_used; cargo fmt --all -- --check; git diff --check.
Not-tested: Full workspace and native RocksDB suites because this change is confined to the resp crate.
Co-authored-by: OmX <omx@oh-my-codex.dev>
* docs(planning): record independent RESP allocation PR
Update the active branch, PR number, publication history, and final-state instructions after the narrow verified fix moved to PR #406 instead of overwriting externally updated PR #404.
Constraint: This commit changes only STATE and KANBAN publication records.
Confidence: High; PR #406 and its initial Head were queried directly from GitHub.
Scope-risk: None for runtime behavior; the two overlapping PRs still require maintainer reconciliation.
Tested: cargo fmt --all -- --check; git diff --check; gh pr view 406.
Not-tested: Runtime suites were not rerun because this commit changes planning documents only.
Co-authored-by: OmX <omx@oh-my-codex.dev>
---------
Co-authored-by: OmX <omx@oh-my-codex.dev>1 parent cbc2895 commit 7886fee
5 files changed
Lines changed: 533 additions & 50 deletions
File tree
- .planning
- docs/superpowers
- plans
- specs
- src/resp/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | | - | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | | - | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
106 | 120 | | |
107 | 121 | | |
108 | 122 | | |
109 | 123 | | |
110 | 124 | | |
111 | 125 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
117 | 133 | | |
118 | 134 | | |
119 | 135 | | |
| |||
127 | 143 | | |
128 | 144 | | |
129 | 145 | | |
130 | | - | |
| 146 | + | |
131 | 147 | | |
132 | 148 | | |
133 | 149 | | |
0 commit comments