Skip to content

build(deps): Bump actions/checkout from 4 to 6 - #1

Closed
dependabot[bot] wants to merge 7 commits into
mainfrom
dependabot/github_actions/actions/checkout-6
Closed

dependabot[bot] wants to merge 7 commits into
mainfrom
dependabot/github_actions/actions/checkout-6

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github May 14, 2026

Copy link
Copy Markdown

Bumps actions/checkout from 4 to 6.

Release notes

Sourced from actions/checkout's releases.

v6.0.0

What's Changed

Full Changelog: actions/checkout@v5.0.0...v6.0.0

v6-beta

What's Changed

Updated persist-credentials to store the credentials under $RUNNER_TEMP instead of directly in the local git config.

This requires a minimum Actions Runner version of v2.329.0 to access the persisted credentials for Docker container action scenarios.

v5.0.1

What's Changed

Full Changelog: actions/checkout@v5...v5.0.1

v5.0.0

What's Changed

⚠️ Minimum Compatible Runner Version

v2.327.1
Release Notes

Make sure your runner is updated to this version or newer to use this release.

Full Changelog: actions/checkout@v4...v5.0.0

v4.3.1

What's Changed

Full Changelog: actions/checkout@v4...v4.3.1

v4.3.0

What's Changed

... (truncated)

Changelog

Sourced from actions/checkout's changelog.

Changelog

v6.0.2

v6.0.1

v6.0.0

v5.0.1

v5.0.0

v4.3.1

v4.3.0

v4.2.2

v4.2.1

v4.2.0

v4.1.7

v4.1.6

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

SMC17 and others added 7 commits May 13, 2026 18:26
Single-binary editor kernel built around three primitives: Janet embedded
via amalgamated C source, buffer-as-protocol as the only access path, M-x
runner with positional arg substitution.

Foundation-first gates 1–3 green on Linux x86_64 and Apple Silicon arm64
(see CHANGELOG.md). Binary size ~909 KB stripped on Linux; ~962 KB Mach-O
arm64 on Apple Silicon. Vendored Janet 1.41.x (MIT, Calvin Rose) at
vendored/janet/janet.c; AGPL-3.0-or-later for everything else.

Built-in M-x commands: pid, help, display, buffer-name, buffer-size,
stax-search, stax-dashboard, stax-hunger. Unrecognised verbs fall through
to raw Janet eval. Every session writes an append-only JSONL audit log to
\$XDG_STATE_HOME/stax/editor-sessions/<session-id>.jsonl.

Companion essay: apple-next-pixar-emacs in the public blog. Strategic
positioning vs Emacs/VS Code/Cursor in docs/STRATEGIC_POSITION.md.
Linux x86_64 and Apple Silicon arm64 jobs both:
- build with zig build -Doptimize=ReleaseSmall
- assert --version and --help dispatch
- smoke: M-x (+ 2 40) → 42 confirms Janet eval fall-through
- smoke: M-x display on a file confirms :file buffer renders

Closes the no-CI gap surfaced by the day-zero repo-hardness audit.
The Zig stdlib's std.debug.print writes to stderr by default. The
\$(...) capture in the previous workflow grabbed stdout only, leaving
OUTPUT empty and the "→ 42" grep failing despite the mast binary
actually printing the correct result (visible in the log via the
interleaved stderr stream). Adding 2>&1 makes the test assert what the
user actually sees at the terminal.
Visual quality signals at first glance: green CI, current version, AGPL,
Zig 0.16. Closes the "shipped but invisible status" gap from the
day-zero hardness pass.
### Added

- init.janet loading: on startup mast reads
  $XDG_CONFIG_HOME/mast/init.janet (default ~/.config/mast/init.janet)
  and evaluates it in the live Janet env so user-defined commands are
  available at the first M-x prompt. Closes SPEC.md §6 v0.1 deliverable #5.
- examples/init.janet — starter file demonstrating user-defined verbs +
  the bound buffer-name / buffer-size / stax-bash callables.
- SECURITY.md — private vuln-reporting workflow via GitHub Security
  Advisories.
- CONTRIBUTING.md — PR process, scope, license commitment.
- README "Extending — init.janet" section with worked example.

### Changed

- Version bump 0.1.0 → 0.1.1 in main.zig output ("mast v0.1.1" in
  startup banner + --version flag).

Smoke verified locally on Linux x86_64:
  $ printf 'M-x (hello "world")\nM-x (square 7)\nM-x exit\n' | mast
  init.janet loaded from /home/stax/.config/mast/init.janet
  M-x   → hello, world
  M-x   → 49
  M-x (exiting)
Adds SECURITY.md, CODE_OF_CONDUCT.md, dependabot.yml, CODEOWNERS.
v1.x cycle: surface stable; breaking changes bump to v2.x.
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot @github

dependabot Bot commented on behalf of github May 14, 2026

Copy link
Copy Markdown
Author

Labels

The following labels could not be found: dependencies, github-actions. Please create them before Dependabot can add them to a pull request.

Please fix the above issues or remove invalid values from dependabot.yml.

@dependabot
dependabot Bot requested a review from SMC17 as a code owner May 14, 2026 02:11
@SMC17 SMC17 closed this May 14, 2026
@SMC17
SMC17 force-pushed the dependabot/github_actions/actions/checkout-6 branch from 99f8748 to 217a43b Compare May 14, 2026 20:33
@dependabot @github

dependabot Bot commented on behalf of github May 14, 2026

Copy link
Copy Markdown
Author

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot
dependabot Bot deleted the dependabot/github_actions/actions/checkout-6 branch May 14, 2026 20:33
SMC17 added a commit that referenced this pull request May 20, 2026
Self-applied hostile-reviewer pass (research/2026-05-19-adversarial-review.md)
found 7 net-new gaps the prior threat model missed. All addressed in
this commit (6 closed mechanically, 1 documented as intentional
residual).

#1 os/open + file/* methods (fs-sandbox bypass under STRICT mode):
   add 9 symbols (os/open, os/pipe, file/read|write|close|seek|tell|
   flush|lines) to REMOVED_BINDINGS

#2 FFI surface live, not theoretical (JANET_FFI is unconditional):
   add 15 ffi/* symbols under new DenyCategory.ffi; ffi/jitfn alone
   is strictly stronger than the removed `native`

#3 JSON injection in SessionAudit.write: new writeJsonString helper
   escapes ", \, control bytes per RFC 8259; 4 in-source tests
   including published-PoC neutralization

#4 ANSI escape injection through buf.name + buf.contents in TUI:
   sanitize_into helper replaces ESC/BEL/DEL/C0 (except tab/newline/
   CR) with `?` in render path; 3 tests cover OSC 52 clipboard-hijack
   PoC + UTF-8 passthrough + DEL

#5 process-control survivors after v0.2.1 ancillary-fs sweep:
   add 8 symbols (os/cd, os/umask, os/link, os/proc-kill, os/proc-wait,
   os/proc-close, os/sigaction, os/posix-chroot) under new
   DenyCategory.process_control

#6 bytecode constructors defeat source review:
   add asm + marshal under new DenyCategory.bytecode. compile/signal/
   debug/* intentionally retained (breaking the language is wrong fix);
   tracked as residual #19

#7 agent/wait/poll/count/alive? DoS under strict mode:
   all four agent/* introspection cfunctions now gated on exec,
   matching agent/spawn/run/kill that created the handle

REMOVED_BINDINGS grows 31 -> 65 entries. Property test iterates the
new total under 200 random cap sets x 9 probe symbols = 1800 Janet
invocations, all confirm panic regardless of grants.

Threat model §6 grows entries 13-20 documenting each finding with
strikethrough for closed items + the residual #19 honesty admission
for compile/signal/debug/*.

STATUS proof-vocabulary table grows 3 rows (adversarial-review-driven
closures, audit-log JSON escape, TUI ANSI sanitization).

CHANGELOG.md gets v1.3.4 [Unreleased] entry with per-finding writeup.

Build green: 12 + 21 + 4 + 12 = 49 in-source tests pass under load 35+.
cfunction-audit: 16 cfunctions, 3 gated, 13 benign, 0 violations.
SMC17 added a commit that referenced this pull request May 20, 2026
Second self-applied hostile-reviewer pass against post-v1.3.4+v1.3.5
state found 4 more net-new gaps + 1 doctrine update. All addressed.

Round-2 report: research/2026-05-19-adversarial-review-round2.md

#1 ev/thread re-init bypass: ev/thread / ev/thread-chan / ev/spawn-thread
   added to REMOVED_BINDINGS under new DenyCategory.threading. Janet's
   ev/thread calls janet_init() in a new OS thread creating a fresh VM
   with the FULL stdlib (every removed binding fully reachable). ev/go
   is single-thread and inherits the gated env — intentionally NOT
   removed.

#2 O_CLOEXEC on every libc.open/pipe site so spawned children don't
   inherit the audit-log fd and can't bypass writeJsonString via
   /proc/self/fd. Applied at audit.zig::init, main.zig::load_init_janet,
   and the cmd_agent_spawn pipe-read end (FD_CLOEXEC via fcntl).

#3 sanitizeNameInto helper canonicalizes buffer names at the trust
   boundary (MAST_NEWBUFFER_SENTINEL + MAST_SAVEAS_SENTINEL). Round-1
   #4 explicitly named the list-buffers print path; v1.3.4 only fixed
   tui.render_to_buf. Now: M-x save-as / new-buffer sanitize on write,
   so every consumer (TUI, REPL list-buffers, display) sees safe bytes
   regardless of which path renders them.

#4 appendByte bounded helper for audit.zig::write replaces the bare
   buf[written] = X writes that could overflow the 4096-byte stack
   array when writeJsonString succeeded at exactly out.len.

#5 Threat model §7 manifest doctrine: documented that source-scan is
   unsound (compile + parser/produce retained per residual #19 means
   code can be constructed at runtime that doesn't appear as a literal
   in init.janet). Doc-only change.

REMOVED_BINDINGS grows 65 -> 68. cfunction-audit unchanged at 16
cfunctions / 3 gated / 13 benign / 0 violations.

Threat model §6 grows entries 21-25 documenting each finding with
strikethrough for closed items + the §7 doctrine update.

Tests: 49/49 in-source still pass; quota integration 5/5 still
passes; cfunction-audit 0 violations. CHANGELOG and threat model
correspond.
SMC17 added a commit that referenced this pull request May 20, 2026
… code

Round 4 of self-applied hostile review found 2 CRITICAL bugs in the
fix code from rounds 1-3 + 1 regression + 1 doctrine inconsistency.
All closed.

Round-4 report: research/2026-05-19-adversarial-review-round4.md

#1 (CRITICAL) SIGALRM quota leaked auto_suspend.
   janet_interpreter_interrupt(vm) does atomic_inc on vm->auto_suspend.
   The matching janet_interpreter_interrupt_handled (atomic_dec) was
   NEVER called. After ONE timeout, vm->auto_suspend == 1 for the
   rest of the process; every subsequent eval interrupted at the
   first bytecode op. tests/quota_integration.sh missed it (piped
   one expression then EOFed).

   Fix: g_alarm_fires atomic counter incremented by the SIGALRM
   handler via @atomicrmw; janet_dostring_quota atomically loads +
   drains after each eval, calling janet_interpreter_interrupt_handled
   once per fire. auto_suspend goes back to 0 between evals.

   Regression test: quota_integration.sh Case 4 sends
   "(while true 1)\n(+ 2 40)\nexit\n" and asserts the second eval
   returns -> 42. Pre-fix this would silently fail.

#2 (CRITICAL) Wall-clock quota only bounded Janet bytecode, not
   blocking cfunctions. cmd_agent_wait's libc.poll(..., 500ms)
   returned EINTR on SIGALRM but silently retried.
   (agent/spawn "sleep 9999"); (agent/wait 0) blocked for full
   9999s despite MAST_EVAL_TIMEOUT_SEC=30.

   Fix: cmd_agent_wait snapshots g_alarm_fires at entry; checks it
   between poll iterations; panics with "interrupted by quota" if
   handler bumped during this call.

#3 Regression of round-2 #3: MAST_NEWBUFFER_SENTINEL +
   MAST_SAVEAS_SENTINEL echo paths printed parsed.args[0] raw.
   Same OSC 52 clipboard-hijack vector through a different stdout
   sink. Fixed: both echo lines now use the sanitized buffer.

#4 agent/spawn name sanitizer was inconsistent with sanitizeNameInto
   (stripped UTF-8 vs preserved). Converged on the looser policy
   (case-by-case switch preserving UTF-8, stripping only control bytes).

Tests: 49/49 in-source + 6/6 quota integration (was 5/5, +1 for
round-4 regression test) + 25/25 doctest + 5/5 strict-mode + fuzz clean.
SMC17 added a commit that referenced this pull request May 28, 2026
Self-applied hostile-reviewer pass
found 7 net-new gaps the prior threat model missed. All addressed in
this commit (6 closed mechanically, 1 documented as intentional
residual).

#1 os/open + file/* methods (fs-sandbox bypass under STRICT mode):
   add 9 symbols (os/open, os/pipe, file/read|write|close|seek|tell|
   flush|lines) to REMOVED_BINDINGS

#2 FFI surface live, not theoretical (JANET_FFI is unconditional):
   add 15 ffi/* symbols under new DenyCategory.ffi; ffi/jitfn alone
   is strictly stronger than the removed `native`

#3 JSON injection in SessionAudit.write: new writeJsonString helper
   escapes ", \, control bytes per RFC 8259; 4 in-source tests
   including published-PoC neutralization

#4 ANSI escape injection through buf.name + buf.contents in TUI:
   sanitize_into helper replaces ESC/BEL/DEL/C0 (except tab/newline/
   CR) with `?` in render path; 3 tests cover OSC 52 clipboard-hijack
   PoC + UTF-8 passthrough + DEL

#5 process-control survivors after v0.2.1 ancillary-fs sweep:
   add 8 symbols (os/cd, os/umask, os/link, os/proc-kill, os/proc-wait,
   os/proc-close, os/sigaction, os/posix-chroot) under new
   DenyCategory.process_control

#6 bytecode constructors defeat source review:
   add asm + marshal under new DenyCategory.bytecode. compile/signal/
   debug/* intentionally retained (breaking the language is wrong fix);
   tracked as residual #19

#7 agent/wait/poll/count/alive? DoS under strict mode:
   all four agent/* introspection cfunctions now gated on exec,
   matching agent/spawn/run/kill that created the handle

REMOVED_BINDINGS grows 31 -> 65 entries. Property test iterates the
new total under 200 random cap sets x 9 probe symbols = 1800 Janet
invocations, all confirm panic regardless of grants.

Threat model §6 grows entries 13-20 documenting each finding with
strikethrough for closed items + the residual #19 honesty admission
for compile/signal/debug/*.

STATUS proof-vocabulary table grows 3 rows (adversarial-review-driven
closures, audit-log JSON escape, TUI ANSI sanitization).

CHANGELOG.md gets v1.3.4 [Unreleased] entry with per-finding writeup.

Build green: 12 + 21 + 4 + 12 = 49 in-source tests pass under load 35+.
cfunction-audit: 16 cfunctions, 3 gated, 13 benign, 0 violations.
SMC17 added a commit that referenced this pull request May 28, 2026
Second self-applied hostile-reviewer pass against post-v1.3.4+v1.3.5
state found 4 more net-new gaps + 1 doctrine update. All addressed.

***REMOVED***

#1 ev/thread re-init bypass: ev/thread / ev/thread-chan / ev/spawn-thread
   added to REMOVED_BINDINGS under new DenyCategory.threading. Janet's
   ev/thread calls janet_init() in a new OS thread creating a fresh VM
   with the FULL stdlib (every removed binding fully reachable). ev/go
   is single-thread and inherits the gated env — intentionally NOT
   removed.

#2 O_CLOEXEC on every libc.open/pipe site so spawned children don't
   inherit the audit-log fd and can't bypass writeJsonString via
   /proc/self/fd. Applied at audit.zig::init, main.zig::load_init_janet,
   and the cmd_agent_spawn pipe-read end (FD_CLOEXEC via fcntl).

#3 sanitizeNameInto helper canonicalizes buffer names at the trust
   boundary (MAST_NEWBUFFER_SENTINEL + MAST_SAVEAS_SENTINEL). Round-1
   #4 explicitly named the list-buffers print path; v1.3.4 only fixed
   tui.render_to_buf. Now: M-x save-as / new-buffer sanitize on write,
   so every consumer (TUI, REPL list-buffers, display) sees safe bytes
   regardless of which path renders them.

#4 appendByte bounded helper for audit.zig::write replaces the bare
   buf[written] = X writes that could overflow the 4096-byte stack
   array when writeJsonString succeeded at exactly out.len.

#5 Threat model §7 manifest doctrine: documented that source-scan is
   unsound (compile + parser/produce retained per residual #19 means
   code can be constructed at runtime that doesn't appear as a literal
   in init.janet). Doc-only change.

REMOVED_BINDINGS grows 65 -> 68. cfunction-audit unchanged at 16
cfunctions / 3 gated / 13 benign / 0 violations.

Threat model §6 grows entries 21-25 documenting each finding with
strikethrough for closed items + the §7 doctrine update.

Tests: 49/49 in-source still pass; quota integration 5/5 still
passes; cfunction-audit 0 violations. CHANGELOG and threat model
correspond.
SMC17 added a commit that referenced this pull request May 28, 2026
… code

Round 4 of self-applied hostile review found 2 CRITICAL bugs in the
fix code from rounds 1-3 + 1 regression + 1 doctrine inconsistency.
All closed.

***REMOVED***

#1 (CRITICAL) SIGALRM quota leaked auto_suspend.
   janet_interpreter_interrupt(vm) does atomic_inc on vm->auto_suspend.
   The matching janet_interpreter_interrupt_handled (atomic_dec) was
   NEVER called. After ONE timeout, vm->auto_suspend == 1 for the
   rest of the process; every subsequent eval interrupted at the
   first bytecode op. tests/quota_integration.sh missed it (piped
   one expression then EOFed).

   Fix: g_alarm_fires atomic counter incremented by the SIGALRM
   handler via @atomicrmw; janet_dostring_quota atomically loads +
   drains after each eval, calling janet_interpreter_interrupt_handled
   once per fire. auto_suspend goes back to 0 between evals.

   Regression test: quota_integration.sh Case 4 sends
   "(while true 1)\n(+ 2 40)\nexit\n" and asserts the second eval
   returns -> 42. Pre-fix this would silently fail.

#2 (CRITICAL) Wall-clock quota only bounded Janet bytecode, not
   blocking cfunctions. cmd_agent_wait's libc.poll(..., 500ms)
   returned EINTR on SIGALRM but silently retried.
   (agent/spawn "sleep 9999"); (agent/wait 0) blocked for full
   9999s despite MAST_EVAL_TIMEOUT_SEC=30.

   Fix: cmd_agent_wait snapshots g_alarm_fires at entry; checks it
   between poll iterations; panics with "interrupted by quota" if
   handler bumped during this call.

#3 Regression of round-2 #3: MAST_NEWBUFFER_SENTINEL +
   MAST_SAVEAS_SENTINEL echo paths printed parsed.args[0] raw.
   Same OSC 52 clipboard-hijack vector through a different stdout
   sink. Fixed: both echo lines now use the sanitized buffer.

#4 agent/spawn name sanitizer was inconsistent with sanitizeNameInto
   (stripped UTF-8 vs preserved). Converged on the looser policy
   (case-by-case switch preserving UTF-8, stripping only control bytes).

Tests: 49/49 in-source + 6/6 quota integration (was 5/5, +1 for
round-4 regression test) + 25/25 doctest + 5/5 strict-mode + fuzz clean.
SMC17 added a commit that referenced this pull request Nov 17, 2026
Self-applied hostile-reviewer pass (research/2026-05-19-adversarial-review.md)
found 7 net-new gaps the prior threat model missed. All addressed in
this commit (6 closed mechanically, 1 documented as intentional
residual).

#1 os/open + file/* methods (fs-sandbox bypass under STRICT mode):
   add 9 symbols (os/open, os/pipe, file/read|write|close|seek|tell|
   flush|lines) to REMOVED_BINDINGS

#2 FFI surface live, not theoretical (JANET_FFI is unconditional):
   add 15 ffi/* symbols under new DenyCategory.ffi; ffi/jitfn alone
   is strictly stronger than the removed `native`

#3 JSON injection in SessionAudit.write: new writeJsonString helper
   escapes ", \, control bytes per RFC 8259; 4 in-source tests
   including published-PoC neutralization

#4 ANSI escape injection through buf.name + buf.contents in TUI:
   sanitize_into helper replaces ESC/BEL/DEL/C0 (except tab/newline/
   CR) with `?` in render path; 3 tests cover OSC 52 clipboard-hijack
   PoC + UTF-8 passthrough + DEL

#5 process-control survivors after v0.2.1 ancillary-fs sweep:
   add 8 symbols (os/cd, os/umask, os/link, os/proc-kill, os/proc-wait,
   os/proc-close, os/sigaction, os/posix-chroot) under new
   DenyCategory.process_control

#6 bytecode constructors defeat source review:
   add asm + marshal under new DenyCategory.bytecode. compile/signal/
   debug/* intentionally retained (breaking the language is wrong fix);
   tracked as residual #19

#7 agent/wait/poll/count/alive? DoS under strict mode:
   all four agent/* introspection cfunctions now gated on exec,
   matching agent/spawn/run/kill that created the handle

REMOVED_BINDINGS grows 31 -> 65 entries. Property test iterates the
new total under 200 random cap sets x 9 probe symbols = 1800 Janet
invocations, all confirm panic regardless of grants.

Threat model §6 grows entries 13-20 documenting each finding with
strikethrough for closed items + the residual #19 honesty admission
for compile/signal/debug/*.

STATUS proof-vocabulary table grows 3 rows (adversarial-review-driven
closures, audit-log JSON escape, TUI ANSI sanitization).

CHANGELOG.md gets v1.3.4 [Unreleased] entry with per-finding writeup.

Build green: 12 + 21 + 4 + 12 = 49 in-source tests pass under load 35+.
cfunction-audit: 16 cfunctions, 3 gated, 13 benign, 0 violations.
SMC17 added a commit that referenced this pull request Nov 17, 2026
Second self-applied hostile-reviewer pass against post-v1.3.4+v1.3.5
state found 4 more net-new gaps + 1 doctrine update. All addressed.

Round-2 report: research/2026-05-19-adversarial-review-round2.md

#1 ev/thread re-init bypass: ev/thread / ev/thread-chan / ev/spawn-thread
   added to REMOVED_BINDINGS under new DenyCategory.threading. Janet's
   ev/thread calls janet_init() in a new OS thread creating a fresh VM
   with the FULL stdlib (every removed binding fully reachable). ev/go
   is single-thread and inherits the gated env — intentionally NOT
   removed.

#2 O_CLOEXEC on every libc.open/pipe site so spawned children don't
   inherit the audit-log fd and can't bypass writeJsonString via
   /proc/self/fd. Applied at audit.zig::init, main.zig::load_init_janet,
   and the cmd_agent_spawn pipe-read end (FD_CLOEXEC via fcntl).

#3 sanitizeNameInto helper canonicalizes buffer names at the trust
   boundary (MAST_NEWBUFFER_SENTINEL + MAST_SAVEAS_SENTINEL). Round-1
   #4 explicitly named the list-buffers print path; v1.3.4 only fixed
   tui.render_to_buf. Now: M-x save-as / new-buffer sanitize on write,
   so every consumer (TUI, REPL list-buffers, display) sees safe bytes
   regardless of which path renders them.

#4 appendByte bounded helper for audit.zig::write replaces the bare
   buf[written] = X writes that could overflow the 4096-byte stack
   array when writeJsonString succeeded at exactly out.len.

#5 Threat model §7 manifest doctrine: documented that source-scan is
   unsound (compile + parser/produce retained per residual #19 means
   code can be constructed at runtime that doesn't appear as a literal
   in init.janet). Doc-only change.

REMOVED_BINDINGS grows 65 -> 68. cfunction-audit unchanged at 16
cfunctions / 3 gated / 13 benign / 0 violations.

Threat model §6 grows entries 21-25 documenting each finding with
strikethrough for closed items + the §7 doctrine update.

Tests: 49/49 in-source still pass; quota integration 5/5 still
passes; cfunction-audit 0 violations. CHANGELOG and threat model
correspond.
SMC17 added a commit that referenced this pull request Nov 17, 2026
… code

Round 4 of self-applied hostile review found 2 CRITICAL bugs in the
fix code from rounds 1-3 + 1 regression + 1 doctrine inconsistency.
All closed.

Round-4 report: research/2026-05-19-adversarial-review-round4.md

#1 (CRITICAL) SIGALRM quota leaked auto_suspend.
   janet_interpreter_interrupt(vm) does atomic_inc on vm->auto_suspend.
   The matching janet_interpreter_interrupt_handled (atomic_dec) was
   NEVER called. After ONE timeout, vm->auto_suspend == 1 for the
   rest of the process; every subsequent eval interrupted at the
   first bytecode op. tests/quota_integration.sh missed it (piped
   one expression then EOFed).

   Fix: g_alarm_fires atomic counter incremented by the SIGALRM
   handler via @atomicrmw; janet_dostring_quota atomically loads +
   drains after each eval, calling janet_interpreter_interrupt_handled
   once per fire. auto_suspend goes back to 0 between evals.

   Regression test: quota_integration.sh Case 4 sends
   "(while true 1)\n(+ 2 40)\nexit\n" and asserts the second eval
   returns -> 42. Pre-fix this would silently fail.

#2 (CRITICAL) Wall-clock quota only bounded Janet bytecode, not
   blocking cfunctions. cmd_agent_wait's libc.poll(..., 500ms)
   returned EINTR on SIGALRM but silently retried.
   (agent/spawn "sleep 9999"); (agent/wait 0) blocked for full
   9999s despite MAST_EVAL_TIMEOUT_SEC=30.

   Fix: cmd_agent_wait snapshots g_alarm_fires at entry; checks it
   between poll iterations; panics with "interrupted by quota" if
   handler bumped during this call.

#3 Regression of round-2 #3: MAST_NEWBUFFER_SENTINEL +
   MAST_SAVEAS_SENTINEL echo paths printed parsed.args[0] raw.
   Same OSC 52 clipboard-hijack vector through a different stdout
   sink. Fixed: both echo lines now use the sanitized buffer.

#4 agent/spawn name sanitizer was inconsistent with sanitizeNameInto
   (stripped UTF-8 vs preserved). Converged on the looser policy
   (case-by-case switch preserving UTF-8, stripping only control bytes).

Tests: 49/49 in-source + 6/6 quota integration (was 5/5, +1 for
round-4 regression test) + 25/25 doctest + 5/5 strict-mode + fuzz clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant