feat(apps): line editor for in-guest source authoring (refs #769) - #779
Merged
Merged
Conversation
Adds /apps/edit, a minimal line-oriented editor so a user can create, inspect, change, save, and cancel a small C program from the ordinary guest console without host assistance (DEMO-05 slice). - user/apps/edit/main.c: freestanding app; commands o/p/a/c/d/w/q/?; verbatim line input (spaces, quotes, backslashes preserved), explicit oversize rejection (EDIT:ERR:LINE_LONG, no silent truncation), dirty quit performs no write, denied saves leave storage untouched, and all observable results emit deterministic EDIT:* markers. - Staged + signed like binfs: build.sh, build_disk_image.sh app mapping. - run_qemu kernel_edit gate: two editor sessions on the booted image with per-prompt consent driving (create/append/print/save/change/ delete/save/deny-save/quit, then reopen + append + save), a cat of the persisted file, and marker assertions including byte-exact EDIT:BUF/EDIT:CHANGE lines. - test.sh dispatcher kernel_edit (90s window) + validate_bundle wiring (TEST_TARGETS, artifact copy, aliases, meta list, serialLogs). - dev/building.txt documents the actual in-guest commands. Ad-hoc host verification (stubbed-bridge harness, 17/17 checks): open new/existing, append fidelity with quotes+backslashes, print, save, change, delete, denied-save no-mutation, oversize line rejection, and quit discard/clean paths. Refs #769
dev/building.txt gained the in-guest editor usage section; update the pinned /apps/dev/building.txt sha256 in tools/disk_image_apps_dev_sha.json (new=9d4db296798c15d0b8dbcb5ae49d530120831c296eee328d7cf9d49e6bc06f0f). Refs #769
1 task
rwrife
added a commit
that referenced
this pull request
Sep 19, 2026
… gate (#780) The #769 editor shipped with the oversize-input bullet implemented in the app (EDIT:ERR:LINE_LONG, host-harness-proven in #779) but not driven through the booted gate. Close that final gap: - run_qemu kernel_edit session 2 now appends a 70-char line after the reopen print: the editor must reject it with EDIT:ERR:LINE_LONG, end append mode, drain the remainder to the terminator, and the following print must show the buffer byte-unchanged at the pre-append line count (new expected markers EDIT:ERR:LINE_LONG + EDIT:PRINT:3). No consent-prompt count change; the existing 90s window covers the two extra steps. - dev/building.txt documents the visible limit for users; repin the /apps/dev/building.txt sha256 in tools/disk_image_apps_dev_sha.json. App source unchanged. Ad-hoc host verification (stubbed-bridge scripted-key harness replaying the exact new session-2 flow, 12/12 checks PASS): open-existing, print(3), 70-char append -> ERR, second print still 3 byte-exact lines, exactly one write for the whole session (the later legitimate save), append/save/quit proceed after the error. Closes #769 Co-authored-by: Ryan Rife <1685329+rwrife@users.noreply.github.com>
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.
Summary
user/apps/edit/main.c: a minimal line-oriented editor (commandso p a c d w q ?) staged as the signed app/apps/edit.bin, so a user can create, view, change, delete, save, and cancel a small C program from the ordinary guest console (DEMO-05 / DEMO-05: Add minimal multiline source creation and editing inside SecureOS #769).EDIT:ERR:LINE_LONG, no silent truncation); quitting with unsaved changes writes nothing; a denied save leaves persistent content untouched.run_qemu --test kernel_edit(wired throughtest.sh,validate_bundle.sh, build scripts): session 1 createsdemo.c(4-line C source with quotes/escapes), edits, saves twice, has a save denied and quits discarding the dirty buffer;cat demo.cthen proves the persisted bytes match the last saved version; session 2 reopens (EDIT:OPEN:EXISTING) and prints the exact stored lines before a final append+save+clean quit. Consent prompts are keyed individually (6 allow + 1 deny).dev/building.txtdocuments the actual on-device commands (with its pinned/apps/devsha256 updated).Verification
QEMU_PASS:kernel_edit— the ordinary booted image ran both editor sessions with byte-exactEDIT:BUF:*readback includingos_console_write("hi");andos_console_write("bye");, denied-save no-mutation (EDIT:SAVE:DENIED+catproving unchanged storage), cancel (EDIT:QUIT:DISCARD), and clean quit (EDIT:QUIT:CLEAN).cc -std=c11 -Wall -Wextra -Werror -ffreestanding -nostdinc) passes.os_*bridge + scripted key queue) exercised open-new/open-existing/append/print/change/delete/save/denied-save/oversize-line/quit-discard/quit-clean paths: 17/17 assertions PASS.lint.shgreen; heredoc Python and all fivevalidate_bundle.shsurfaces parse-checked.Remaining acceptance gap (why refs, not closes)
The oversize-input acceptance bullet is implemented in the app (explicit
EDIT:ERR:LINE_LONG, no silent truncation; harness-proven) but is not yet driven through the scripted boot gate — a 64+ byte typed console line may hit the kernel console line buffer before reaching the app, which needs its own investigation. Leaving #769 open for the user to decide on that final bullet.