From 768bc4633905c2939da830b20450f98624c11ff2 Mon Sep 17 00:00:00 2001 From: Andrey Epifancev Date: Sat, 24 Oct 2026 18:13:28 +0400 Subject: [PATCH] =?UTF-8?q?fix(dsh):=20install.sh=20--roles=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=BF=D0=B8=D1=81=D1=8B=D0=B2=D0=B0=D0=B5=D1=82=20DSH-=D0=B7?= =?UTF-8?q?=D0=B0=D0=BC=D0=B5=D1=82=D0=BA=D1=83=20=D0=B2=20dev.md=20(#53)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Установленная копия роли теперь воспроизводима: после копирования roles/ install.sh вставляет в ~/.dsh/roles/dev.md пункт «в DSH исполнение плана — skill sdd» (после «Режим по умолчанию», с откатом в конец файла, если якоря нет). Вставка идемпотентна: каждая установка ролей перекопирует файл и добавляет ровно одну заметку. Общий roles/dev.md не меняется — в Claude Code строка не действует. --check сообщает ok/WARN про заметку; тест проверяет наличие, отсутствие дубля после второго запуска и строку в --check. PORT.md §6 объясняет. Co-Authored-By: DeepSeek Harness --- dsh/PORT.md | 6 +++++ dsh/install.sh | 45 ++++++++++++++++++++++++++++++++++++++ dsh/tests/install.test.mjs | 16 ++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/dsh/PORT.md b/dsh/PORT.md index 859705a..70d9909 100644 --- a/dsh/PORT.md +++ b/dsh/PORT.md @@ -224,6 +224,12 @@ bash dsh/install.sh --global --skills --roles # mcp__codegraph__codegraph_explore. ``` +`--roles` also appends the DSH SDD note to `~/.dsh/roles/dev.md` (the bullet that +points `dev` at the `sdd` skill). The note lives only in the installed copy: the +shared `roles/dev.md` stays Claude Code-compatible, so a Claude session never +sees DSH-only instructions. The insertion is idempotent — every `--roles` run +recopies the role from the repository and re-inserts exactly one note. + Live checks: 1. New session: ask "what skills do you have?" — superpowers skills and the diff --git a/dsh/install.sh b/dsh/install.sh index 8ce501d..53f1b7a 100755 --- a/dsh/install.sh +++ b/dsh/install.sh @@ -141,6 +141,11 @@ check() { else echo "WARN: roles not found; /role will fail until --roles is run" >&2 fi + if [ -f "$DSH_HOME/roles/dev.md" ] && grep -q 'В DSH-сессии исполнение плана' "$DSH_HOME/roles/dev.md"; then + echo "ok: role dsh notes" + else + echo "WARN: role has no DSH SDD notes; run --roles" >&2 + fi echo "DSH_HOME=$DSH_HOME" return "$failed" } @@ -224,6 +229,45 @@ install_roles() { echo "installed $count roles into $DSH_HOME/roles" } +# The DSH SDD note belongs to the installed role, not to the shared roles/ layer: +# in Claude Code the note does not apply, so it is written here, after the copy, +# and is idempotent (the source file is overwritten on every --roles run). +install_role_dsh_notes() { + local role="$DSH_HOME/roles/dev.md" + [ -f "$role" ] || return 0 + python3 - "$role" <<'PY' +import sys +from pathlib import Path + +path = Path(sys.argv[1]) +text = path.read_text(encoding="utf-8") +marker = "В DSH-сессии исполнение плана" +if marker in text: + print("ok: role dsh notes already present") + raise SystemExit(0) +note = ( + "- В DSH-сессии исполнение плана идёт по skill `sdd`, а не " + "`subagent-driven-development`: асинхронный `subagent` (бриф и отчёт файлами, " + "ожидание завершением хода и уведомлением, ledger " + "`.superpowers/sdd//progress.md` с `## Findings`, fix-loop до 5 раундов). " + "Режим контроллера — по числу параллельных планов: один план — главная сессия, " + "несколько — фоновый контроллер (нужен `maxDepth: 2` из " + "`dsh/subagent-models.yml`). В Claude Code строка не действует: там исходный " + "`subagent-driven-development`." +) +anchor = "- Режим по умолчанию: subagent-driven-development." +lines = text.splitlines(keepends=True) +for i, line in enumerate(lines): + if line.startswith(anchor): + lines.insert(i + 1, note + "\n") + break +else: + lines.append((("" if text.endswith("\n") else "\n") + note + "\n")) +path.write_text("".join(lines), encoding="utf-8") +print("ok: role dsh notes inserted") +PY +} + print_bundle_step() { cat <