sandbox-runtime
implementation worker用の独立sandboxを作成・検証し、macOS / WSL/Linux / remote provider差を吸収する時に使用する。
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- sandbox-runtime
- description
- implementation worker用の独立sandboxを作成・検証し、macOS / WSL/Linux / remote provider差を吸収する時に使用する。
03 SKILL.md 正文
Sandbox Runtime
Layer: Practice
このSkillは主にConstitutionの Mutable Ownership Safety と Organizational Continuity をruntime boundaryへmaterializeするcurrent Practiceである。
特定sandbox/provider自体を要求するのではなく、taskに必要なfilesystem/process/network/credential/service-state separationのguaranteeを要求する。
実装用mutable workspaceとverification環境を同一視しない。ADR-0020のVerification Executorは、sourceをauthoringしない限りimplementation worker用worktree/sandbox topologyを要求せず、検証対象artifact identityとenvironment ownershipを別contractで扱う。
Current practice guarantees
- 1 implementation worker = 1 isolated workspace/runtime。
- mutable runtime stateはworker間で共有しない。
- 同一内部portは使用してよい。host公開port / preview routeはruntime側で一意化する。
- host Docker socket、root-equivalent host capability、master credentialをworkerへ渡さない。
- immutable/cacheable stateのみ共有する。
- provider差はadapterへ閉じ込め、project semanticsを変えない。
- Worktrunkはworkspace/worktree lifecycle adapterであり、sandbox/runtime isolation boundaryとして扱わない。
security-auditがtarget-controlled codeを実行する場合も本Skillのnetwork / environment / writable state / resource isolationを満たす。必要controlをenforceできない環境ではhost executionへfallbackせずneeds_validationとする。
Isolate
最低限:
- repository checkout
- process boundary
- network / port mapping
- writable filesystem
- DB / Redis / queue
- application local state
- test artifacts
- mutable build output
macOS
- Apple Silicon
arm64を第一級targetとして扱う。 - binary / dependency / container imageのarm64対応を確認する。
- x86_64 emulationを暗黙前提にしない。
- portable Web/backend taskは原則Linux sandboxで実行する。
- Apple-native toolingが必要なtaskだけmacOS-native workerを許可する。
- Docker Desktopを必須にしない。
Windows + WSL2
- Linux-oriented repoはWSL Linux filesystemを優先する。
/mnt/c等を高頻度build/watchの標準workspaceにしない。- WSL自体をworker isolationとみなさない。
- permission / symlink / executable bit / line ending差を検証する。
- port forwardingはSupervisor/runtime側で抽象化する。
- WSL/Linuxでlocal worktreeを複数扱う場合は
worktree-workflowSkillを適用し、worktree pathはLinux filesystemを優先する。
Worktrunk integration
WSL/Linuxのlocal workspace materializationではWorktrunkをpreferred frontendとしてよい。
- shared project hookはproject-local
.config/wt.tomlへ置く。 - shared hostへ公開するdev serverは、実際のframework/runtimeが許すport overrideへ
{{ branch | hash_port }}を接続してdeterministically割り当てる。hash_port自体をuniqueness proofとせず、startup時のbind conflictを検出する。 - long-running local processは適切なら
wt step tether -- <command>でworktree lifecycleへ結び付ける。 - container/sandbox内部portは同一値のままでよく、
hash_portは必要なhost-published portへ適用する。 - DB / Redis / queue / socket / container name等のmutable stateは別途runtime adapterで一意化する。必要ならWorktrunkのdeterministic template valueをidentifierへ利用してよい。
wt merge main等をGitHub delivery policyの代替integration pathとして使わない。
詳細な操作は worktree-workflow Skillに置き、このSkillではisolation semanticsをcanonicalに保つ。
Verification-only native environments
Windows native / macOS native / GUI application / physical device / installed application / CI等でworktreeを作れない、または作ることが検証対象を歪める場合は、verification-only executorとして扱える。
優先materialization:
- immutable package / installed artifact / image digest / deployment revision
- clean dedicated checkout
- disposable clone / snapshot
- unavoidable場合のみexclusive leaseを取ったsingleton checkout
verification executorは最低限、candidate identity、environment identity、procedure、result、evidence artifact、source mutation有無を記録する。
singleton environmentはparallelizeを要求しない。exclusive lease / serialization / queue等でMutable Ownership Safetyを満たす。
unexpectedなtracked source/config mutationが生じた場合、そのままcurrent candidateのverification evidenceとして採用しない。expected behaviorとしてmutation自体を検証する場合を除き、clean candidateで再実行する。
verification中にfix実装へ移る場合は、新しいmutable Worker attemptとして切り替える。
Portability
Apple Silicon localとx86_64 CI/remoteが混在する場合、architecture-sensitive dependency install/build/testを検証する。
Reproducibility target
clone
-> bootstrap
-> sandbox create
-> dependency install
-> migrate / seed
-> app/test start
-> validation
Refinement criteria
別runtime/provider/native agent environmentへ置換する場合、変更surfaceに必要な次のguaranteeを比較する。
- writable mutable state isolation
- process/service namespace safety
- network policy
- credential boundary
- resource/lifecycle cleanup
- durable result extraction / recovery
- snapshotの永続性、suspend / resume、provider喪失時の復旧、remote artifactの耐久性(create / destroyの費用だけで比べない)
同等以上ならprovider implementationは自由に置換できる。単なるworktree分離をruntime isolationのproofとして扱わない。
04 同仓库更多 Skills
worktree-workflow
current release-driven profileでWorktrunkをWSL/Linux workspace lifecycle Practiceとして使い、Rust/Cargo worktreeのbuild-output isolation・cache reuse・cleanupを含め、同等以上のguaranteeを持つalternativeへのrefinementも判断する時に使用する。
skill-selection
projectの初期化や再整備で、どのAgent Skillを導入するかを決める時に使用する。必要な能力を判定し、project-initの能力一覧と候補記録、さらに外部の探索から候補を評価して、能力ごとに担当を決め、project-localに導入してlockと採否を記録する。
security-maintenance
framework/runtime/dependencyの脆弱性情報を収集し、projectへの実影響と優先度を判定してticket/releaseへ反映する時に使用する。
security-audit
source codeから未知のsecurity invariant failureを能動的に探索し、coverageを明示しながら独立検証されたfindingへ変換する時に使用する。
secrets-management
application / serviceのenvironment secretをInfisical中心で設計・初期化・移行・検証する時に使用する。CLI-first、repository-controlled schema、Machine Identity、GitHub OIDC、agent least-privilege、secret-safe evidenceを扱う。
quality-gate
project固有のstack・framework・runtimeに合わせてquality gateと動作確認レベルを設計・実行・更新する時に使用する。