Skip to content

Notebooks 2/4: notebook save safety and kernel lifecycle #211

Closed

Description

@tannerpolley

Part of #208, after 1/4. Design doc: ~/.local/share/t3-fork-notes/notebook-execution-design.md, sections 2, 5 and 7 (PR 2).

Cover:

  • revisioned saves, with a hash check under the notebook write lock and temporary-file-plus-rename, so a conflict keeps the draft;
  • the limits: 8 MiB, 500 cells and a truncation marker;
  • viewer and agent leases, and idle shutdown;
  • crash and reconnect behavior;
  • project environment validation.

Tests use Deferred and TestClock, with no sleeps.

Activity

  1. tannerpolley commented on Oct 28, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code status: Unavailable

    Issue: #211 Notebooks 2/4: notebook save safety and kernel lifecycle

    Thread: thread:delegated-task:command%3Amcp%3A3431d214-908d-4cc4-995e-02bcea9a397c%3Adelegate-task%3Anotebooks-208-211-implement-20261028

    Model: gpt-6.1-sol

    Branch: issue-211-notebooks-2-4-notebook-save-safety-and

    Updated: 2026-11-13T05:08:10.475Z

  2. tannerpolley commented on Oct 28, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code closeout: done

    Issue: #211 Notebooks 2/4: notebook save safety and kernel lifecycle
    Thread: thread:delegated-task:command%3Amcp%3A3431d214-908d-4cc4-995e-02bcea9a397c%3Adelegate-task%3Anotebooks-208-211-implement-20261028
    Model: gpt-6.1-sol
    Branch: issue-211-notebooks-2-4-notebook-save-safety-and
    Completed: 2026-10-28T21:16:33.461Z

    Implemented #211 and committed locally as 87fbba61f787a3d6aaf358cd83058d99784160c5.

    Branch: issue-211-notebooks-2-4-notebook-save-safety-and
    Worktree: /home/tnnrpolley21/Workspaces/Applications/t3code/.worktrees/issue-211-notebooks-2-4-notebook-save-safety-and
    Working tree is clean. No push, PR, or merge.

    Acceptance Delivered
    Safe saves Revision and disk-hash checks under the canonical session lock; same-directory temporary rename; conflicts retain drafts.
    Document bounds Create/edit/save enforce existing 8 MiB and 500-cell limits. Existing output admission and visible truncation safeguards remain intact.
    Lifecycle Viewer lease acquisition/release, reconnect ownership fencing, 60-second disconnect/headless grace, and 15-minute viewed idle shutdown. Active runs are protected from idle cleanup.
    Recovery Existing epoch and unknown-outcome behavior retained; persistent ownership journal reconciles known kernels without adopting unrelated kernels or replaying execution.
    Trusted configuration Server-local project profiles reference ServerSecretStore; literal loopback endpoints, authenticated kernelspec probes, interpreter/cwd/import verification, explicit availability, and no kernel creation on open.
    Later #213 seams Shared service create/edit/save and bounded output-read operations; no MCP toolkit or UI phase implemented.

    Configuration and recovery procedures are in notebook-execution.md.

    Validation:

    • vp run typecheck from server and contracts: passed. Server log, contracts log.
    • Focused vp test run across notebook service, configuration, transport, reducer, and RPC authorization: 58 passed. Test log.
    • vp lint on changed TypeScript files: passed. Lint log.
    • vp run check:changed: format, lint, GraphQL generation, and 54 selected tests passed. The overall gate remains blocked by the established three mobile type errors and unrelated Knip findings—3 unused files and 74 unused exports. No notebook findings. Gate log.

    The authorized local Jupyter probe verified authenticated discovery, the actual interpreter and project cwd, numpy/epcsaft imports, interpreter-mismatch rejection, owned-kernel deletion, and repeated DELETE handling after 404. The token stayed unprinted; the captured server process was stopped. Sanitized runtime transcript.

    Two limits remain explicit: external editors can still write within the final hash-check/rename window; a hard crash between kernel creation and journaling its returned ID can leave an unrecorded orphan that cannot safely be auto-identified. Process-local unsaved drafts are lost on a T3 server crash.

    Independent Codex checker review remains the next gate. UI, MCP, mobile, browser verification, and paid evals were outside this implementation; no model-facing text changed.

  3. tannerpolley commented on Oct 28, 2026

    @tannerpolley
    OwnerAuthor

    T3 Code closeout: done

    Issue: #211 Notebooks 2/4: notebook save safety and kernel lifecycle
    Thread: thread:delegated-task:command%3Amcp%3A3431d214-908d-4cc4-995e-02bcea9a397c%3Adelegate-task%3Anotebooks-208-211-implement-20261028
    Model: gpt-6.1-sol
    Branch: issue-211-notebooks-2-4-notebook-save-safety-and
    Completed: 2026-10-28T23:24:19.042Z

    Correction round 1 is complete at local commit 2b24524beb2b68226850f4cae62f16ef2fef1462, with a clean working tree. All six findings have fixes and regression coverage. Independent checker acceptance remains open; nothing was pushed or published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions