Skip to content

fix(jupyter-notebook): preserve stream overwrite cursors - #101

Draft
Ricardo-M-L wants to merge 1 commit into
zai-org:mainfrom
Ricardo-M-L:fix/jupyter-stream-cursor-20261016
Draft

Ricardo-M-L wants to merge 1 commit into
zai-org:mainfrom
Ricardo-M-L:fix/jupyter-stream-cursor-20261016

Conversation

@Ricardo-M-L

Copy link
Copy Markdown

Plugin type (required)

  • UI Plugin
  • Standard plugin
  • Not applicable

Affected plugin name: jupyter-notebook

What

Preserve the stream write cursor between kernel messages. The current reducer normalizes each chunk, then appends the next chunk to the normalized text, losing the cursor after a carriage return. Hello\rWo renders as Wollo in one message, but Hello\rW followed by o renders as Welloo.

  • Keep bounded, in-memory cursor and logical-line-start state separately from notebook outputs.
  • Preserve overwrite positions across stream chunks without persisting internal state in .ipynb files.
  • Reset continuation when output identity changes, outputs are cleared, a cell is rerun/reloaded, or a cell is removed.
  • Keep truncation-marker newlines out of logical cursor positioning.
  • Bump manifest, marketplace, source package and protocol versions from 0.1.0 to 0.1.1; update both README languages.

No new dependencies, permissions, network services, or changes to execution approvals. Existing Jupyter access and notebook writes are unchanged. No generated distribution files are committed.

Verification

  • Unit tests: 44 passed. Includes every split point and single-character chunks for CR/CRLF/backspace examples, output interleaving, clear_output, immutable branches, and bounded long output.
  • Real Jupyter integration: 15 passed. Explicit flushes send the regression across kernel messages; two executions validate cursor reset, and saved notebook data contains only standard stream fields.
  • Built MCP stdio smoke: passed.
  • Chrome panel through the official AppBridge + real Jupyter: passed (test:e2e). This is not a ZCode Desktop installation test.
  • Root pnpm test, pnpm typecheck, pnpm lint: passed (12 lint warnings in unrelated existing files; touched files have none).
  • python3 scripts/validate.py: all 45 plugins validated.
  • git diff --check: passed.

Outstanding / draft boundary

This is a draft pending complete repository packaging and real ZCode Desktop installation verification. pnpm build stops in the unrelated photocraft snapshot build because the pinned Rust WASM target / Trunk toolchain is missing; consequently build_dist.py correctly rejects the incomplete build. The Jupyter package itself builds and its integration/smoke/browser tests pass. No build checks were bypassed, no user plugin configuration was changed, and Desktop verification is not claimed.

Self-check

  • Existing plugin ownership retained; only this plugin and its marketplace version changed
  • Plugin type and name declared
  • Immutable installable-content version bumped consistently
  • Equivalent English / Chinese README update
  • No secrets, private endpoints, machine paths, or generated artifacts
  • Existing dependencies and side effects unchanged
  • Validator passes
  • Full root build and build_dist pass
  • Installed and exercised in ZCode Desktop

This branch has not been deployed

No deployments
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