Rakuish — AUDIT-FIXES-0.72.0

0.72.0 交付记录

  • 日期:2026-11-12

  • 对象:main @ 0.72.0

  • 能力:PTY 捕获层 + Agent pty_exec

新增 API

sys.pty-exec('python', '-c', 'print("hi")',
             :timeout-ms(5_000), :cols(100), :rows(30));
pty-exec(...);   # DSL 导出
  • 使用 Proc::Async.new(:pty(:cols,:rows));

  • 捕获 stdout,stderr 按 PTY 语义合流;

  • 默认剥离 ANSI / OSC / 非换行控制字符;

  • timeout-ms 到点 kill,code=124;

  • max-bytes 按 UTF-8 安全截断;

  • 返回值标记 pty/tty/timed-out/truncated/cols/rows。

Agent op

{"op":"pty_exec","argv":["python","-c","print('hi')"],"timeout_ms":5000}
  • 默认关闭;

  • 必须同时 --allow-exec --allow-pty,并过同一命令白名单;

  • cwd 过 root,env 只允许安全键;

  • 请求的超时/输出/尺寸只能调小;

  • 审计沿用 Agent 的 op/argv/结果规则。

明确边界

  • 没有 PTY stdin 写入:Rakudo 的 Proc::Async :pty 没有可靠 stdin 通道;pty-exec 不是完整交互会话;

  • pty_exec 不是 tty_exec:Agent 仍不开放实时接管终端的 op;

  • 超时 kill 直接子进程;不承诺杀孙进程(进程组/Job Object 是后续项)。

验证

prove6 -Ilib t
bash tools/run-all.sh
zef install . --force-install

新增 t/28-pty-exec.t(18 断言:捕获、TTY 可见、控制序列剥离、超时、 max-bytes、Agent 默认 403、双开关成功)。

Rakuish v0.161.4

Raku 原生的命令与脚本环境(API v3):Raku 表达式 + `!` argv、会话级 Sys 文件 / 进程 API、DSL 短命令、可扩展 Command 注册表、无 magic 的 REPL、全权限本地执行与统一审计。v2 的 bash 子集 / %magic / 独立 shell 引擎已于 0.34.0 整体删除,只剩一套语义。

Authors

  • zef:skyter10086

License

MIT

Dependencies

JSON::FastTerminal::LineEditorTerminal::APIArrow::IPC:ver<0.1.0+>

Test Dependencies

Provides

  • Rakuish::Audit
  • Rakuish::CLI
  • Rakuish::Command
  • Rakuish::DSL
  • Rakuish::Data
  • Rakuish::Data::Arrow
  • Rakuish::Data::CsvOptions
  • Rakuish::Data::Cursor
  • Rakuish::Data::Duck
  • Rakuish::Data::Engine
  • Rakuish::Data::Engine::DuckDB
  • Rakuish::Data::Engine::SQLite
  • Rakuish::Data::Pager
  • Rakuish::Data::Stream
  • Rakuish::Data::Table
  • Rakuish::Display
  • Rakuish::Eval
  • Rakuish::Eval::Protocol
  • Rakuish::Eval::Proxy
  • Rakuish::Eval::Server
  • Rakuish::Incomplete
  • Rakuish::Kernel
  • Rakuish::Kernel::Factory
  • Rakuish::Kernel::Notebook
  • Rakuish::Py
  • Rakuish::REPL::Chrome
  • Rakuish::REPL::Complete
  • Rakuish::REPL::Highlight
  • Rakuish::REPL::Hints
  • Rakuish::REPL::Introspect
  • Rakuish::REPL::Keymap
  • Rakuish::REPL::Methods
  • Rakuish::REPL::Plugins
  • Rakuish::REPL::Session
  • Rakuish::REPL::Session::Cells
  • Rakuish::REPL::Session::Commands
  • Rakuish::REPL::Session::Completion
  • Rakuish::REPL::Session::Config
  • Rakuish::REPL::Session::Diagnostics
  • Rakuish::REPL::Session::Exec
  • Rakuish::REPL::Session::Persistence
  • Rakuish::REPL::Session::Replay
  • Rakuish::REPL::Shell
  • Rakuish::REPL::SqlComplete
  • Rakuish::Result
  • Rakuish::Result::Renderer
  • Rakuish::Snapshot
  • Rakuish::Store
  • Rakuish::Sys
  • Rakuish::Sys::Console
  • Rakuish::Sys::FS
  • Rakuish::Sys::JobTable
  • Rakuish::Sys::PosixSpawn
  • Rakuish::Sys::Proc
  • Rakuish::Sys::Term
  • Rakuish::Sys::WinJob

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.