refactor(opencode): удалены устаревшие профили safe-build/safe-plan
Профили дублировали работу permission-reviewer статическими списками: их deny обходили ревьюер и давали отказы без причины (git push). Теперь решения об ask принимает плагин; статикой оставлены только deny на чтение секретов - детерминированная гарантия, LLM-ревьюеру не доверяем. - opencode.json: default_agent -> build, убраны статические списки и deny на git push (решение за ревьюером) - permission-reviewer.jsonc: actorProfiles переключены на встроенные build/plan - install.sh: блок линковки agents заменён чисткой старого симлинка; добавлено копирование permission-reviewer.jsonc в ~/.config/opencode (плагин читает его только оттуда - раньше тюнинг не применялся) - тесты: проверка чистки симлинка и копирования конфига ревьюера
This commit is contained in:
1 parent
c3efe60a00
commit
32cd7097e6
6 files changed
+34
-212
No files matched your search
@@ -1,91 +0,0 @@
|
||||
---
|
||||
description: Build agent with guarded shell access and no silent git mutations
|
||||
mode: primary
|
||||
|
||||
tools:
|
||||
write: true
|
||||
edit: true
|
||||
patch: true
|
||||
bash: true
|
||||
|
||||
permission:
|
||||
write: allow
|
||||
edit: allow
|
||||
patch: allow
|
||||
webfetch: ask
|
||||
|
||||
task:
|
||||
"*": deny
|
||||
"explore": allow
|
||||
|
||||
bash:
|
||||
"*": ask
|
||||
|
||||
# безопасное чтение
|
||||
"pwd": allow
|
||||
"ls": allow
|
||||
"ls *": allow
|
||||
"cat": allow
|
||||
"cat *": allow
|
||||
"head": allow
|
||||
"head *": allow
|
||||
"tail": allow
|
||||
"tail *": allow
|
||||
"wc -l": allow
|
||||
"wc -l *": allow
|
||||
|
||||
# read-only git
|
||||
"git status": allow
|
||||
"git status *": allow
|
||||
"git diff": allow
|
||||
"git diff *": allow
|
||||
"git log": allow
|
||||
"git log *": allow
|
||||
"git show": allow
|
||||
"git show *": allow
|
||||
"git blame": allow
|
||||
"git blame *": allow
|
||||
"git rev-parse": allow
|
||||
"git rev-parse *": allow
|
||||
"git branch --show-current": allow
|
||||
"git branch --list*": allow
|
||||
"git tag --list*": allow
|
||||
|
||||
# опасные git-операции — только с подтверждением
|
||||
"git add*": ask
|
||||
"git commit*": ask
|
||||
"git switch*": ask
|
||||
"git checkout*": ask
|
||||
"git restore*": ask
|
||||
"git reset*": ask
|
||||
"git clean*": ask
|
||||
"git merge*": ask
|
||||
"git rebase*": ask
|
||||
"git stash*": ask
|
||||
"git fetch*": ask
|
||||
"git pull*": ask
|
||||
|
||||
# push вообще запрещаем
|
||||
"git push*": deny
|
||||
|
||||
# ключи и секреты не читаем даже по прямой просьбе
|
||||
"*/.ssh/*": deny
|
||||
"*id_rsa*": deny
|
||||
"*id_ed25519*": deny
|
||||
"*.pem": deny
|
||||
"*shadow*": deny
|
||||
"*.env": deny
|
||||
"*.env.*": deny
|
||||
"*.secrets*": deny
|
||||
"*.netrc*": deny
|
||||
# а примеры env-файлов читать можно
|
||||
"*.env.example": allow
|
||||
---
|
||||
|
||||
You are a build agent.
|
||||
|
||||
Default to making code changes through native file-editing tools.
|
||||
Use bash when it is the clearest path, but avoid unnecessary shell usage.
|
||||
|
||||
Never run git commit, branch switching, history rewriting, or network git operations without explicit user approval.
|
||||
Prefer built-in tools for reading files and searching code.
|
||||
@@ -1,112 +0,0 @@
|
||||
---
|
||||
description: Safe planning and repository analysis with read-only focus
|
||||
mode: primary
|
||||
|
||||
tools:
|
||||
write: false
|
||||
edit: false
|
||||
patch: false
|
||||
bash: true
|
||||
|
||||
permission:
|
||||
webfetch: ask
|
||||
|
||||
task:
|
||||
"*": deny
|
||||
"explore": allow
|
||||
|
||||
bash:
|
||||
"*": ask
|
||||
|
||||
"pwd": allow
|
||||
|
||||
"ls": allow
|
||||
"ls *": allow
|
||||
|
||||
"find": allow
|
||||
"find *": allow
|
||||
|
||||
"cat": allow
|
||||
"cat *": allow
|
||||
"head": allow
|
||||
"head *": allow
|
||||
"tail": allow
|
||||
"tail *": allow
|
||||
"wc -l": allow
|
||||
"wc -l *": allow
|
||||
|
||||
"rg": allow
|
||||
"rg *": allow
|
||||
|
||||
"git status": allow
|
||||
"git status *": allow
|
||||
"git diff": allow
|
||||
"git diff *": allow
|
||||
"git log": allow
|
||||
"git log *": allow
|
||||
"git show": allow
|
||||
"git show *": allow
|
||||
"git blame": allow
|
||||
"git blame *": allow
|
||||
"git remote -v": allow
|
||||
|
||||
# жёсткий запрет на мутации
|
||||
"git add*": deny
|
||||
"git commit*": deny
|
||||
"git switch*": deny
|
||||
"git checkout*": deny
|
||||
"git restore*": deny
|
||||
"git reset*": deny
|
||||
"git clean*": deny
|
||||
"git merge*": deny
|
||||
"git rebase*": deny
|
||||
"git stash*": deny
|
||||
"git push*": deny
|
||||
|
||||
# ключи и секреты не читаем даже по прямой просьбе
|
||||
"*/.ssh/*": deny
|
||||
"*id_rsa*": deny
|
||||
"*id_ed25519*": deny
|
||||
"*.pem": deny
|
||||
"*shadow*": deny
|
||||
"*.env": deny
|
||||
"*.env.*": deny
|
||||
"*.secrets*": deny
|
||||
"*.netrc*": deny
|
||||
# а примеры env-файлов читать можно
|
||||
"*.env.example": allow
|
||||
"git pull*": deny
|
||||
"git fetch*": deny
|
||||
|
||||
"rm *": deny
|
||||
"mv *": deny
|
||||
"cp *": deny
|
||||
"tee *": deny
|
||||
"chmod *": deny
|
||||
"chown *": deny
|
||||
"sed -i*": deny
|
||||
"perl -pi*": deny
|
||||
"python*": deny
|
||||
"node*": deny
|
||||
"sh -c*": deny
|
||||
"bash -c*": deny
|
||||
"npm *": deny
|
||||
"pnpm *": deny
|
||||
"yarn *": deny
|
||||
"bun *": deny
|
||||
---
|
||||
|
||||
You are a planning and analysis agent.
|
||||
|
||||
For repository briefing:
|
||||
1. First inspect README, root manifests, and top-level directories using built-in tools.
|
||||
2. Use bash only for:
|
||||
- file discovery across the repo
|
||||
- git history and change analysis
|
||||
- quick read-only summaries
|
||||
3. Never use bash for edits or execution of interpreters.
|
||||
|
||||
Prefer:
|
||||
- read/list/glob/grep for content inspection
|
||||
- git log/show/diff/blame for history
|
||||
- find/rg only when built-in tools are inconvenient
|
||||
@@ -6,7 +6,7 @@
|
||||
"options": {}
|
||||
}
|
||||
],
|
||||
"default_agent": "safe-plan",
|
||||
"default_agent": "build",
|
||||
"permission": {
|
||||
"write": "ask",
|
||||
"edit": "ask",
|
||||
@@ -15,8 +15,16 @@
|
||||
"task": "ask",
|
||||
"bash": {
|
||||
"*": "ask",
|
||||
"git push": "deny",
|
||||
"git push *": "deny"
|
||||
"*/.ssh/*": "deny",
|
||||
"*id_rsa*": "deny",
|
||||
"*id_ed25519*": "deny",
|
||||
"*.pem": "deny",
|
||||
"*shadow*": "deny",
|
||||
"*.env": "deny",
|
||||
"*.env.*": "deny",
|
||||
"*.secrets*": "deny",
|
||||
"*.netrc*": "deny",
|
||||
"*.env.example": "allow"
|
||||
}
|
||||
},
|
||||
"mcp": {
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
"variant": "none",
|
||||
"outputFormat": "json_schema"
|
||||
},
|
||||
// Профили наших агентов: снимает "actor identity partial" у ревьюера
|
||||
// Профили встроенных агентов: снимает "actor identity partial" у ревьюера
|
||||
"actorProfiles": {
|
||||
"safe-build": "workspace",
|
||||
"safe-plan": "read-only"
|
||||
"build": "workspace",
|
||||
"plan": "read-only"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user