Skip to content

Kernel K1: move anim, save, autosave into kernel/ (pure code motion) - #36

Merged
nyblnet merged 1 commit into
mainfrom
kernel-k1-move
Jul 24, 2026
Merged

Kernel K1: move anim, save, autosave into kernel/ (pure code motion)#36
nyblnet merged 1 commit into
mainfrom
kernel-k1-move

Conversation

@nyblnet

@nyblnet nyblnet commented Jul 24, 2026

Copy link
Copy Markdown
Owner

First of four PRs extracting the shared kernel ahead of the Spaces/Dash
fan-out (per docs/PLATFORM.md §9's kernel/app boundary). This one is pure
code motion
— no behavior change, proven by byte analysis.

What moved

  • kernel/src/{anim,save,autosave}.ts (git mv — history follows)
  • kernel/src/doc.ts: KernelDoc — the envelope (docId, title), the ONLY
    doc fields kernel modules may read; save/autosave retyped to it (type-only)
  • docContentKey stays slides-side (in the autosave facade): "what counts as
    content" is a per-app model question

Design choices (from the planning audit)

  • NOT an npm workspace. The moved modules have zero npm dependencies, so a
    workspace buys nothing yet — while a root-lockfile move would break three CI
    steps and every existing worktree's node_modules symlink. kernel/ is plain
    TS source with its own tsconfig; convert to a workspace later in one sweep
    if a shared dep ever appears.
  • Facades at the old paths (slides/src/anim.ts etc. re-export kernel):
    zero consumer-file churn, window.bento untouched by construction, and
    relative-.ts imports work identically in vite, tsc (bundler resolution),
    and Node type-stripping — the repo's existing pattern (test-sync.ts).
  • Dev-only server.fs.allow: ['..'] so vite dev serves ../kernel.
  • CI gains a standalone kernel typecheck step.

Verification

  • Byte identity: built shell vs shipped v1.0.8 — everything outside the
    bento-rt runtime blob is byte-identical (incl. the #bento-doc block);
    the runtime is length-identical (1,153,874 bytes both) with exactly 6
    identifier-rename-only diff regions (minifier short-name reassignment from
    docContentKey's declaration moving). No structural change.
  • Typecheck: kernel standalone + slides tsc -b, both clean.
  • Splice conformance gate passes; CRDT rig SEEDS=100 ALL PASS (sync untouched:
    git diff main -- slides/src/sync is empty).
  • Dev-server smoke: boots through the facades, edits work, kernel autosave
    writes recovery snapshots to IndexedDB, Object.keys(window.bento)
    unchanged, zero console errors.

Next up: K2 (update/i18n/charts with the configureApp/registerI18n seams),
K3 (compress-script parameterization), K4 (spaces/ scaffold proving the seam).

First slice of the kernel extraction (docs/PLATFORM.md §9): kernel/ is a
plain TS-source directory — deliberately NOT an npm workspace (the moved
modules have zero npm dependencies, so a workspace buys nothing yet while
a lockfile move would break CI and every worktree symlink).

- kernel/src/doc.ts: KernelDoc — the envelope (docId, title), the only
  doc fields kernel modules may read.
- git mv anim.ts, save.ts, autosave.ts → kernel/src/; save+autosave
  retyped BentoDoc → KernelDoc (type-only, zero runtime delta).
- docContentKey stays slides-side (in the autosave facade): 'what counts
  as content' is a per-app model question.
- Facades at the old slides/src paths re-export the kernel modules, so
  zero consumer files change and window.bento is untouched by
  construction.
- vite server.fs.allow ['..'] (dev-only) so the dev server may serve
  ../kernel.
- CI: standalone kernel typecheck step.

Byte-analysis of the built shell vs v1.0.8: everything outside the
bento-rt runtime blob is byte-identical (including #bento-doc); the
runtime is length-identical with 6 identifier-rename-only regions from
docContentKey's declaration moving. Conformance gate + SEEDS=100 rig
pass; dev-server smoke: boots, edits, kernel autosave writes recovery
snapshots, zero console errors.
@nyblnet
nyblnet merged commit 467a657 into main Jul 24, 2026
1 check passed
@nyblnet
nyblnet deleted the kernel-k1-move branch July 24, 2026 23:41
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