Stage D batch 2: fix silent error sites in log_words.c, resolve the flagged category-iii special case (FABRIC-3.md §XXXII.6)
Build / build-amd64-iso (push) Canceled after 0s
Build / build-aarch64-iso (push) Canceled after 0s
Build / build-riscv64-img (push) Canceled after 0s

log_word_set_level(), log_do_emit(), and log_emit_string() (7 sites
total) now log a diagnostic via log_message(LOG_ERROR, ...) before
setting vm->error, matching this file's own already-correct
log_str_emit() sibling and defer_words.c's gold-standard pattern.

log_word_append_raw() (backing (LOG-APPEND-RAW), 3 sites) resolved
differently per §XXXII.3's own triage note: its doc comment forbids
log_message() here (recursion into the log ring it writes to), but the
word can also be invoked by hand at the console -- console_println()
carries no such recursion risk and matches Stage B's policy for a
manual interactive invocation. Added the console.h include this
required.

Three-arch clean qemu acceptance passed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BWpNjdwPtFLuVLaAq44L9K
This commit is contained in:
Robert Allan James
2026-09-15 16:53:18 -04:00
co-authored by Claude Sonnet 5
parent 5417ffb2bf
commit 1a8c0e4fcf
10 changed files with 27224 additions and 11 deletions
+23
View File
@@ -4544,3 +4544,26 @@ genuinely malformed message or an out-of-bounds array reference to trigger) -- t
mechanical (add a `log_message()` call, no logic change) and low-risk, matching this project's
own precedent for this class of change.
**Batch 2 -- DONE, 2026-09-15: `log_words.c` (10 silent sites + the 1 flagged category-iii
special case).** `log_word_set_level()`, `log_do_emit()` (2 sites), `log_emit_string()` (4
sites) all gained a `log_message(LOG_ERROR, ...)` diagnostic before their existing
`vm->error = 1`, matching this same file's own already-correct `log_str_emit()` sibling and
`defer_words.c`'s gold-standard pattern -- straightforward, no special handling needed.
**The category-iii special case, resolved rather than left flagged.** §XXXII.3 identified
`log_word_append_raw()` (backing `(LOG-APPEND-RAW)`) as needing a different mechanism: its own
doc comment forbids `log_message()` on this path (recursion into the log ring it writes to,
per `log_region.c`'s own doc comment), yet the word can also be invoked "by hand at the console
for a smoke test" per that same comment -- meaning a silent failure there is exactly USE's own
problem, just for a different word. Resolved: `console_println()` carries no recursion risk (a
direct console/framebuffer write, not routed through the log system at all) and correctly
matches Stage B's own policy for a manual interactive invocation. Added
`#include "starkernel/console.h"` (not previously included) and three diagnostics
(stack underflow, negative message length, address out of range) to `log_word_append_raw()`'s
three guards.
**Verified:** three-architecture `clean qemu` acceptance (amd64/aarch64/riscv64) passed, standard
regression unaffected. Not separately live-fired against any of the 11 sites' specific failure
conditions -- same reasoning as batch 1, all fixes are mechanical diagnostic additions with no
logic change.