agent-sandbox/slim-fedora/sandbox.md
XLion 7e60ab2ae9
All checks were successful
slim-fedora / build-and-push (push) Successful in 26m22s
slim-fedora / build (push) Successful in 0s
add sandbox hint
2026-08-22 23:53:24 +08:00

59 lines
2.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 認識你的 Sandbox
## OS
多數時候是最新的 Fedora,見 Build info
### OS pkgs
dnf `development-tools` group, nodejs, openjdk 以及多數的基礎終端機套件,詳情見 `dnf list --installed`,建議搭配 `grep`
**你不可使用 dnf 安裝任何套件,但所有唯讀查詢如 search 允許**
## Userspace package managers
你得以在不經過口頭允許的情況下,操作安裝任何屬於 userspace package managers 且來自「預設套件來源」的套件,意即,**你不可**:
* 使用 pip/uv 時手動指定 --index-url
* Add or install homebrew tap
* `curl -fsSL example.com | sh`
你得以在合理範圍安裝套件,但所有變更都將在不久後因容器重建撤銷。
### Homebrew
無特殊事項,使用標準方式使用。
### uv/pip/micromamba
`micromamba` 的語法近乎接近 `conda`,如不熟悉,以 `conda` 思路思考指令。 base env 位於: `/opt/conda`,日常臨時操作不需建新 env,除非因故需要特別舊的 python。
請盡可能的使用 `uv pip install` 取代 `pip install`,`uv` 擁有優異的併發機制,可省時間,如因故 `uv` 抓不到 base env,指令加入 `--python /opt/conda`,如 `uv pip list --python /opt/conda`。
### Nodejs
非不得已,不要操作 Node 相關的事物,除非特別要求,請以其他替代方式作業,除非不得已,請停止並徵詢使用者同意。
### 透明度
執行任何套件作業之後,你有義務將所有細節告知使用者,包括但不限於安裝、移除、更新、設定、診斷、成功、失敗、錯誤。
### 永久納入
如果你有合理的理由認為某套件應永久常駐於 Sandbox image,你必須**立即**提出,並與使用者討論,而非想著等等再說。
## Home directory & Data
Sandbox 內 username 為 `sandbox`,`$HOME` 在多數時候為 `/home/sandbox`,這不是保證,然而,此目錄**「不會持久化」**,多數時候會持久化的目錄是 `/workspace`,詳情請依您的 system prompt 判斷。
不持久化的家目錄也順帶意味著 `brew`, `uv` 之類產生的快取不會莫名的被永遠帶著走,也不用手動清理。
## 建議
無論是容器本身,或是此文件的未盡事項,請毫不吝嗇,立即提出討論。
## Security
如果你發現 Build Date 距今超過一個月,**你必須立刻提醒使用者更新**,這關乎安全。
## Build info