Repository navigation
[FIX] Incoming cells now overwrite instead of dropping - #81
Conversation
📝 WalkthroughWalkthroughAdds a deterministic 3-way cell selection function and integrates it into resolver and UI paths to choose non-conflicting merged cells; includes regression tests and notebook fixtures to validate one-sided incoming edits and execution_count renumbering. Changes
Sequence Diagram(s)sequenceDiagram
rect rgba(200,200,255,0.5)
participant UI as MergeRow (UI)
end
rect rgba(200,255,200,0.5)
participant Resolver as Resolver
end
rect rgba(255,200,200,0.5)
participant Utils as notebookUtils
end
UI->>Resolver: request assemble row (base,current,incoming)
Resolver->>Utils: selectNonConflictMergedCell(base,current,incoming)
Utils-->>Resolver: chosenCell (incoming | current | base | undefined)
Resolver-->>UI: assembled row with chosenCell
UI->>UI: render merged row / preserve incoming edits
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@test/demo_incoming.ipynb`:
- Around line 34-51: The function grad_descent has a parameter named
learning_size but callers use learning_rate; rename the parameter in
grad_descent from learning_size to learning_rate and update all internal uses
(the multiplier where you subtract learning_size * d) so the signature and body
match the call sites (and thus the stored output). Ensure you only change the
parameter name in grad_descent and its internal references so calls that pass
learning_rate work without error.
🧹 Nitpick comments (1)
src/tests/incomingNonConflictRegression.test.ts (1)
26-36:getStep1GradientDescentSourcesearches markdown cells only by content substring — consider tightening the match.The function finds any cell whose full source includes
"## Step 1: Gradient Descent". If a code cell ever contained that string in a comment, it would match unexpectedly. This is unlikely given the fixtures, so just a minor observation.
| "source": [ | ||
| "def grad_descent(iterations: int, learning_size: float, init: int) -> float:\n", | ||
| " \"\"\"This is a summary\n", | ||
| "\n", | ||
| " Args:\n", | ||
| " iterations (int): _description_\n", | ||
| " learning_size (float): _description_\n", | ||
| " init (int): _description_\n", | ||
| "\n", | ||
| " Returns:\n", | ||
| " float: _description_\n", | ||
| " \"\"\"\n", | ||
| " minimizer = init\n", | ||
| " # Start from initial point and move towards minimum\n", | ||
| " for _ in range(iterations):\n", | ||
| " d = 2*minimizer\n", | ||
| " minimizer = minimizer - learning_size * d\n", | ||
| " return round(minimizer, 5)" |
There was a problem hiding this comment.
Parameter name mismatch between function definition and call site.
The function is defined with learning_size (Line 35) but invoked with learning_rate (Line 78). This would raise a TypeError at runtime in Python. The base notebook (demo_base.ipynb) correctly uses learning_rate in both places.
While this fixture is only used for source-text comparison in the regression test (not executed), the stored output 0.0 on Line 72 is inconsistent with this broken code — the cell couldn't have produced that output.
Suggested fix
- "def grad_descent(iterations: int, learning_size: float, init: int) -> float:\n",
+ "def grad_descent(iterations: int, learning_rate: float, init: int) -> float:\n",Also applies to: 76-78
🤖 Prompt for AI Agents
In `@test/demo_incoming.ipynb` around lines 34 - 51, The function grad_descent has
a parameter named learning_size but callers use learning_rate; rename the
parameter in grad_descent from learning_size to learning_rate and update all
internal uses (the multiplier where you subtract learning_size * d) so the
signature and body match the call sites (and thus the stored output). Ensure you
only change the parameter name in grad_descent and its internal references so
calls that pass learning_rate work without error.
Incoming cells were silently dropping when they should've been overwriting
Summary by CodeRabbit
New Features
Bug Fixes
Tests