Console prompt: identity/machine both sides once redirected off Hera

sk_console_user_prefix() (repl.c) previously always returned "zuse"
(or the WIREBIND-attached username) as the left side of the bracket
prefix, regardless of which VM the console was actually pointed at --
"[zuse@rajames]" after USE rajames, always showing the authenticating
superuser rather than the active identity.

Changed on Captain Bob's direct instruction: once the console is
redirected into a WIREBIND identity's own console VM
(console_get_vm_name() != "Hera"), show that same name on both sides
-- "[rajames@rajames]" -- since WIREBIND births the console VM
literally named after the identity, so the identity IS that VM, not a
separate label. At the top level (still on Hera, nothing has
redirected yet), the original zuse_session/WIREBIND-username logic is
unchanged.

An earlier, more ambitious attempt (separate identity/machine tracked
state across every console_set_vm_name() call site) regressed live to
a wrong [zuse@Artemis] prompt and was fully reverted before reaching
any acceptance run -- the landed fix needed none of that new state,
just this one function.

Verified live on all three architectures: [zuse@Hera] at the top
level and after a live WIREBIND attach (before USE), [rajames@rajames]
after USE rajames, with task 3.9's Stage D relay still firing
correctly on top of it. Zero UNKNOWN WORD, dict_hash unaffected
(display-only change).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Robert Allan James
2026-09-22 13:50:40 -04:00
co-authored by Claude Sonnet 5
parent 3975dc61cd
commit 21734b1a52
8 changed files with 28002 additions and 5 deletions
+25 -5
View File
@@ -81,12 +81,32 @@ static void sk_print_prompt(void) {
console_puts(SK_PROMPT_TEXT);
}
/* console_user_prefix_fn provider (console.h) -- same zuse_session/
* WIREBIND-username logic sk_print_prompt() used to compute inline
* before this moved into the shared line prefix. Registered once at
* boot (sk_repl_run()'s own init, see below); NULL until then, which
* console.c's emit_prefix() already treats as "no provider yet." */
/* console_user_prefix_fn provider (console.h). 2026-09-22, Captain
* Bob's own instruction, restated precisely across several corrections
* this session: once a WIREBIND identity's own console is active (the
* physical console has been `USE`'d into it), the bracket must show
* that SAME name on both sides -- "[rajames@rajames]", not
* "[zuse@rajames]" -- because the identity console_get_vm_name()
* already tracks (WIREBIND births the console VM literally named after
* the human, mama_forth_words.c's capsule_console_birth()) IS her own
* VM, not a separate "who's driving" label layered on top of it.
* "R.A. James is also a VM" was the exact reasoning given.
*
* Below the top level (console_get_vm_name() != "Hera", i.e. USE or a
* BIRTH/RUN/CONNECT-* redirect has pointed the console somewhere else),
* that target's own name already answers "who/what is this" -- return
* it directly, and emit_prefix() ends up printing it on both sides
* (this function's return @ console_get_vm_name(), unchanged). At the
* top level (still on Hera, nothing has redirected the console yet),
* her own name doesn't say WHO is driving her, so this keeps the
* original zuse_session/WIREBIND-username logic for that one case --
* unchanged from before this fix, still correct: a live WIREBIND
* attach announces itself before USE is ever typed
* ("WIREBIND: <name> attached and ready -- USE it to begin"), and the
* prompt should already reflect that. */
static const char *sk_console_user_prefix(void) {
const char *vn = console_get_vm_name();
if (vn && strcmp(vn, "Hera") != 0) return vn;
VM *mama_vm = (VM *)sk_get_mama_vm();
if (mama_vm && mama_vm->zuse_session) return "zuse";
return capsule_wirebind_attached_username();