Commit a2de105
committed
harness: address PR review (per-dataDir cache, archive edit deny)
resolveHarnessDir cached extraction with a single module-level promise
keyed by nothing, so a second call with a different dataDir returned
the first call's path. In production opencode passes a singleton
Global.Path.data so this never bit, but tests and any future
multi-instance scenario would silently get cross-dataDir contamination.
Switch to a Map<dataDir, Promise<path>> — same dataDir still
deduplicates, distinct dataDirs each get their own extraction.
harness-archive/ was whitelisted in external_directory:allow, which
let edit/write/apply_patch silently mutate snapshots that are intended
to be read-only history. Keep the dir-level whitelist (so reads stay
silent — the agent is supposed to browse the archive when migrating
helpers across upgrades), but add an edit:deny rule keyed on
'*/harness-archive/*'. The leading * absorbs the worktree-relative
prefix that edit/write/apply_patch produce; the dir name is the anchor.
All three edit-class tools route through permission='edit' so one rule
covers them. Bash-level mutations (rm -rf) are still possible, but the
agent has no prompt-driven path to them and the user can deny bash
explicitly via config if desired.1 parent 95cbc63 commit a2de105
2 files changed
Lines changed: 26 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
140 | | - | |
141 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
99 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
100 | 111 | | |
101 | 112 | | |
102 | 113 | | |
| |||
113 | 124 | | |
114 | 125 | | |
115 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
116 | 130 | | |
117 | 131 | | |
118 | 132 | | |
| |||
0 commit comments