feat(evolve-kernel): kernel source/diff viewer in detail page - #33
Open
6eanut wants to merge 1 commit into
Open
Conversation
The detail page could open a library kernel's code, but the code was
rendered as a plain <pre> with no line numbers and no way to see what a
kernel actually changed relative to a baseline — the key question when
reviewing an evolved kernel is "what did it change, vs the original or
vs the kernel it was derived from?".
Add a diff endpoint and an inspector panel:
- _state_readers.py: read_kernel_source() resolves one library kernel by
id; read_kernel_diff() produces a unified diff against the original
reference kernel or against the kernel's parent_id. Missing kernels, a
root kernel with no parent, and an evicted parent (library caps at
MAX_LIBRARY_SIZE) return exists=false with a reason instead of raising.
- routes.py: GET /kernels/{kernel_id}/diff?base=reference|parent.
- ok-runtime-api.js: getKernelDiff() client.
- ok-detail.js: KernelInspector panel with Source / Diff vs reference /
Diff vs parent modes, a line-numbered source renderer, and a colored
unified-diff renderer with +/- stats. The parent mode is disabled when
the kernel has no parent.
- ok.css: .ok-source* / .ok-diff* styles.
- test_kernel_diff.py: 11 tests covering both readers and their
non-raising failure paths.
Co-Authored-By: deepseek/deepseek-v4-flash-0731 <deepseek-ai@claude-code-best.win>
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.
The detail page could open a library kernel's code, but the code was rendered as a plain