repl.c: unify REPL prompt to "[VM name] ok>"

Punch list §25 item 4.4a complete.
Removed the manually-built <Name>)ok>/zuse)ok> prompt suffix from
sk_repl_step()/sk_repl_run() -- console.c's console_putc() already emits a
"[VMName] " prefix at line-start, so the old code was double-printing the
name for non-Hera VMs ("[Hermes] Hermes)ok> "). Now prints only "ok> " and
lets the existing prefix supply the bracket. emergency_console/zuse_session
security semantics unchanged, display-only. Verified: all three
architectures boot live to "[Hera] ok>" (logs/20260811-073408 amd64,
logs/20260811-073448 aarch64, logs/20260811-073542 riscv64).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-08-11 07:37:13 -04:00
co-authored by Claude Sonnet 5
parent 838dcab5d2
commit f1d29e975e
13 changed files with 54874 additions and 97 deletions
+14 -21
View File
@@ -179,16 +179,15 @@ int sk_repl_step(VM *vm)
if (!vm || vm->halted) return 0;
{
/* Unified prompt (FABRIC.md 4.4a): console_putc()'s existing per-line
* "[VMName] " prefix (console.c, g_active_vm_name) already supplies the
* bracket -- print only "ok> " here, don't build a second one. The
* emergency_console bypass is a security decision, not a display one --
* it still applies only to Hera's bare prompt, per FABRIC.md 4.4. */
const char *vn = console_get_vm_name();
int is_hera = (!vn || (vn[0]=='H' && vn[1]=='e' && vn[2]=='r' && vn[3]=='a' && vn[4]=='\0'));
if (is_hera) {
vm->emergency_console = vm->zuse_session ? 0 : 1;
console_puts(vm->zuse_session ? "zuse)ok> " : "ok> ");
} else {
vm->emergency_console = 0;
console_puts(vn);
console_puts(")ok> ");
}
vm->emergency_console = is_hera ? (vm->zuse_session ? 0 : 1) : 0;
console_puts("ok> ");
}
sk_readline(input, sizeof(input));
@@ -226,22 +225,16 @@ void sk_repl_run(VM *vm)
/* USE may redirect input to a different VM each iteration */
active = g_repl_active_vm ? g_repl_active_vm : vm;
/* Named prompt: child VMs show <Name>)ok>, Hera shows zuse)ok>/ok>.
* emergency_console bypass applies only to Hera's bare ok> prompt. */
/* Unified prompt (FABRIC.md 4.4a): console_putc()'s existing per-line
* "[VMName] " prefix (console.c, g_active_vm_name) already supplies the
* bracket -- print only "ok> " here, don't build a second one. The
* emergency_console bypass is a security decision, not a display one --
* it still applies only to Hera's bare prompt, per FABRIC.md 4.4. */
{
const char *vn = console_get_vm_name();
int is_hera = (!vn || (vn[0]=='H' && vn[1]=='e' && vn[2]=='r' && vn[3]=='a' && vn[4]=='\0'));
if (is_hera) {
active->emergency_console = active->zuse_session ? 0 : 1;
if (active->zuse_session)
console_puts("zuse)ok> ");
else
console_puts("ok> ");
} else {
active->emergency_console = 0;
console_puts(vn);
console_puts(")ok> ");
}
active->emergency_console = is_hera ? (active->zuse_session ? 0 : 1) : 0;
console_puts("ok> ");
}
sk_readline(input, sizeof(input));