9cd8536455
Regression: a Tier 2 session was denied access to
C:\\projects\\manual_slop_tier2\\scripts\\run_tests_batched.py
with 'Allowed base directories are: gencpp, manual_slop'. The
tier2-autonomous agent had a correct permission.read allowlist, but
the top-level permission block (inherited from the main repo's
opencode.json via 'git clone') had no read/write keys, and OpenCode
uses the top-level for the default agent path. The agent's
permission.read was merged but apparently not enforced for the
default-agent access check.
Fix:
1. Add a top-level 'permission' block to
conductor/tier2/opencode.json.fragment with:
- permission.edit: 'deny' (default agents locked down)
- permission.read: deny *, allow sandbox clone + app-data dirs
- permission.write: same
- permission.bash: deny *, allowlist of read-only git commands +
uv run python scripts/{run_tests_batched.py,tier2/*} + basic
shell commands. git push/checkout/restore/reset remain denied.
2. Update setup_tier2_clone.ps1 to also patch the top-level
'permission' block (was only merging the tier2-autonomous agent
block). The script preserves the user's mcp, model, instructions,
watcher, and plugin settings from the inherited opencode.json.
3. Update test_tier2_slash_command_spec.py:
- Rename test_command_fetches_origin_main -> ..._master (we
changed the slash command on 2026-06-17).
- Add test_config_fragment_has_top_level_permission to assert
the new top-level permission block has the right deny-all +
allowlist shape.
The tier2-autonomous agent's permission block is unchanged; it
overrides the top-level for that agent's tool calls.
80 lines
2.4 KiB
Plaintext
80 lines
2.4 KiB
Plaintext
{
|
|
"$schema": "https://opencode.ai/config.json",
|
|
"default_agent": "tier2-autonomous",
|
|
"permission": {
|
|
"edit": "deny",
|
|
"read": {
|
|
"*": "deny",
|
|
"C:\\projects\\manual_slop_tier2\\**": "allow",
|
|
"C:\\Users\\Ed\\AppData\\Local\\manual_slop\\tier2\\**": "allow",
|
|
"C:\\Users\\Ed\\AppData\\Local\\manual_slop\\tier2_failures\\**": "allow"
|
|
},
|
|
"write": {
|
|
"*": "deny",
|
|
"C:\\projects\\manual_slop_tier2\\**": "allow",
|
|
"C:\\Users\\Ed\\AppData\\Local\\manual_slop\\tier2\\**": "allow",
|
|
"C:\\Users\\Ed\\AppData\\Local\\manual_slop\\tier2_failures\\**": "allow"
|
|
},
|
|
"bash": {
|
|
"*": "deny",
|
|
"git status*": "allow",
|
|
"git diff*": "allow",
|
|
"git log*": "allow",
|
|
"git add*": "allow",
|
|
"git commit*": "allow",
|
|
"git switch*": "allow",
|
|
"git branch*": "allow",
|
|
"git fetch*": "allow",
|
|
"git remote*": "allow",
|
|
"git rev-parse*": "allow",
|
|
"git show*": "allow",
|
|
"git config --get*": "allow",
|
|
"ls*": "allow",
|
|
"cat*": "allow",
|
|
"head*": "allow",
|
|
"tail*": "allow",
|
|
"find*": "allow",
|
|
"echo*": "allow",
|
|
"mkdir*": "allow",
|
|
"cp*": "allow",
|
|
"mv*": "allow",
|
|
"rm*": "allow",
|
|
"uv run python scripts/run_tests_batched.py*": "allow",
|
|
"uv run python scripts/tier2/*": "allow",
|
|
"pwsh -File scripts/tier2/*": "allow",
|
|
"git push*": "deny",
|
|
"git checkout*": "deny",
|
|
"git restore*": "deny",
|
|
"git reset*": "deny"
|
|
}
|
|
},
|
|
"agent": {
|
|
"tier2-autonomous": {
|
|
"model": "minimax-coding-plan/MiniMax-M3",
|
|
"temperature": 0.4,
|
|
"permission": {
|
|
"edit": "allow",
|
|
"read": {
|
|
"*": "deny",
|
|
"C:\\projects\\manual_slop_tier2\\**": "allow",
|
|
"C:\\Users\\Ed\\AppData\\Local\\manual_slop\\tier2\\**": "allow",
|
|
"C:\\Users\\Ed\\AppData\\Local\\manual_slop\\tier2_failures\\**": "allow"
|
|
},
|
|
"write": {
|
|
"*": "deny",
|
|
"C:\\projects\\manual_slop_tier2\\**": "allow",
|
|
"C:\\Users\\Ed\\AppData\\Local\\manual_slop\\tier2\\**": "allow",
|
|
"C:\\Users\\Ed\\AppData\\Local\\manual_slop\\tier2_failures\\**": "allow"
|
|
},
|
|
"bash": {
|
|
"*": "allow",
|
|
"git push*": "deny",
|
|
"git checkout*": "deny",
|
|
"git restore*": "deny",
|
|
"git reset*": "deny"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|