Kernel K1: move anim, save, autosave into kernel/ (pure code motion) - #36
Merged
Conversation
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.
This was referenced Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ONLYdoc fields kernel modules may read; save/autosave retyped to it (type-only)
docContentKeystays slides-side (in the autosave facade): "what counts ascontent" is a per-app model question
Design choices (from the planning audit)
workspace buys nothing yet — while a root-lockfile move would break three CI
steps and every existing worktree's node_modules symlink.
kernel/is plainTS source with its own tsconfig; convert to a workspace later in one sweep
if a shared dep ever appears.
slides/src/anim.tsetc. re-export kernel):zero consumer-file churn,
window.bentountouched by construction, andrelative-
.tsimports work identically in vite, tsc (bundler resolution),and Node type-stripping — the repo's existing pattern (test-sync.ts).
server.fs.allow: ['..']so vite dev serves../kernel.Verification
bento-rtruntime blob is byte-identical (incl. the#bento-docblock);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.tsc -b, both clean.git diff main -- slides/src/syncis empty).writes recovery snapshots to IndexedDB,
Object.keys(window.bento)unchanged, zero console errors.
Next up: K2 (update/i18n/charts with the
configureApp/registerI18nseams),K3 (compress-script parameterization), K4 (spaces/ scaffold proving the seam).