• .claude/skills/jsexec/SKI

    From Rob Swindell (on Windows@VERT to Git commit to main/sbbs/m on Fri May 29 00:55:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/3302985c18d7e05422f1249d
    Modified Files:
    .claude/skills/jsexec/SKILL.md
    Log Message:
    .claude/skills/jsexec: per-user ARS check pattern + stdout buffering gotcha

    Two findings from chat-index work and regression-suite debugging:

    1. Checking access against a specific user under jsexec.
    The natural-looking accessors (sub.can_read, dir.can_download)
    evaluate against the implicit session user -- which under jsexec
    doesn't exist, so they return true for everything. Document the
    reliable pattern: instantiate User(N) and walk the ownership
    chain calling u.compare_ars() on each ARS string conjunctively.
    Also note that the global "user" lowercase = useron in C++ -- it
    is undefined under jsexec, distinct from the User constructor.

    2. stdout / stderr / stdin are global File instances. They have a
    .flush() method that fflushes the underlying FILE*. The gotcha:
    print() goes through C stdio, which block-buffers (~4KB) when
    stdout is redirected to a file or pipe. A long-running script
    looks stalled under tail -f even though it's progressing. Route
    output through stdout.writeln() + stdout.flush() to make it
    line-buffered against the redirected FD.

    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Mon Jul 27 20:26:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/ad12bd0878c9c79494e92217
    Modified Files:
    .claude/skills/jsexec/SKILL.md
    Log Message:
    jsexec skill: document how the exit status is actually set

    The skill had one line on the subject - that exit(N) sets the process
    exit status - which left the two things people actually get wrong
    undocumented: that a script's return value is ignored entirely, and that
    an uncaught exception yields status 1.

    That gap has real cost. A hatchit.js bug reported this week was
    diagnosed on IRC as "the result of hatch_file() will be the return
    value, which is true (1) upon success" - a reasonable-sounding theory
    that is not how jsexec works, and that would have sent anyone acting on
    it to the wrong line of code. The actual cause was an uncaught
    TypeError thrown after the work had already succeeded.

    Adds an Exit status section covering both real sources, a measured table showing modules that return true / 7 still exit 0, and the behavior
    around them: exit(N) unwinds from anywhere in the call stack, on_exit
    handlers run on both the exit() and exception paths, and the exception
    message goes to stderr. Closes with the consequences worth internalizing
    - chiefly that status 1 does not mean the work didn't happen, since a
    crash after the side effects leaves them in place, and that a module
    must call exit(N) to report failure at all.

    Every claim verified against a live jsexec rather than read off the
    source.

    Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Tue Sep 29 15:57:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/aa234855b658eab8aa46068b
    Modified Files:
    .claude/skills/jsexec/SKILL.md
    Log Message:
    jsexec skill: stale exec image through a CIFS mount

    Document the cfg->size != sizeof(scfg_t) error that survives a rebuild
    when exec/ is reached through a Linux CIFS/SMB mount: while any process is still running the old binary through the mount path, new execs get the
    same cached old image. Covers how to tell, how to clear it, and how to
    keep long-running services from causing it.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Wed Nov 11 21:04:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/3ba093fdc760fab893f04e11
    Modified Files:
    .claude/skills/jsexec/SKILL.md src/sbbs3/jsexec.cpp
    Log Message:
    jsexec: exit 0 when a script is stopped or recycled by a signal

    A SIGTERM/SIGINT/SIGQUIT (or Windows console control event) or a SIGHUP
    recycle aborts the running script from the operation callback, so JS_ExecuteScript() fails and jsexec reported EXIT_FAILURE. Every routine "systemctl stop" or restart of a jsexec-hosted service (e.g. the
    chat_llm IRC bot) was therefore logged by systemd as status=1/FAILURE.
    Don't treat an abort caused by a local stop or recycle as a failure; an exit_code set by the script still takes precedence, and an abort for any
    other reason still exits 1.

    Also restore the "-> Terminated Locally" notice for Ctrl-C on Windows.
    Since aba1e3e94f (hosts-11-access, 2026-09-29) moved that notice out of
    the signal handler, it was gated on terminate_signal being non-zero, but CTRL_C_EVENT is 0. terminate_signal now starts at -1.

    Document both behaviors in the jsexec skill, along with the status
    stream being discarded when stdin is not a tty (use -S to see it).

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net