feat(delegate-task): session_break authoring field [v0.2.2]

Add the authoring side of the `session_break` marker whose consumer
side shipped in using-tasks v1.2.0. At delegation time the author can
now mark a task so that, after it closes, an autonomous runner pauses
instead of chaining the next task.

- Pre-flight gate 5->6 questions: new Q (item 5, after notify) —
  "Session-break после этой задачи? (domain-switch / milestone /
  heavy infra)". Yes -> set session_break in body; no -> omit
  (default unchanged).
- Template trailer gains optional `[**session_break:** true |
  "<hint>"]` with inline comment (same lowercase frontmatter key
  using-tasks reads).
- Usage-guidance block: three set-it cases + tie to using-tasks
  Task-completion step 6 / SESSION BOUNDARY line.
- What-NOT-to-do bullet: don't set it routinely (real-boundary
  marker, not a default).
- Wiki concept page concepts/delegate-task-session-break.md
  (links using-tasks-session-break) + index + log.

PATCH bump: additive optional field + one pre-flight question, no
existing behaviour changed. Markdown policy artifact — no test
surface (TDD N/A). Closes [session-break-delegate-task].

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 16:38:52 +03:00
parent c32c67ffb7
commit 5e3c01622e
5 changed files with 68 additions and 9 deletions

View File

@@ -608,10 +608,7 @@ needs-claude
---
## 🔴 [session-break-delegate-task] — ## Goal
**Owner:** DESKTOP-NSEF0UK:claude-opus:18704
**Claim token:** 4394473c-c9de-4c70-ba35-2f246c716ff7
**Claim expires at:** 2026-06-09T13:44:31.150Z
## 🟢 [session-break-delegate-task] — ## Goal
Add `session_break` as optional field to `delegate-task` task body template v0.2.1 → v0.2.2.
## Design
@@ -646,12 +643,13 @@ Usage guidance (три случая):
## Weight
needs-claude
**Status:** ready
**Where I stopped:** (not started)
**Status:** done
**Where I stopped:** Shipped — `skills/delegate-task/SKILL.md` 0.2.1→0.2.2 (PATCH). Authoring side of the `session_break` marker (consumer = using-tasks v1.2.0). (1) Pre-flight gate 5→6 questions: new Q (item `5.`, after `4. notify`) — "Session-break после этой задачи? (domain-switch / milestone / heavy infra)"; if yes → set `session_break` in body, if no → omit (default unchanged). (2) Template trailer gains optional `[**session_break:** true | "<hint>"]` with inline comment (next to weight/notify/allow_upgrade; `session_break` = same lowercase frontmatter key using-tasks reads). (3) Usage-guidance block after the template lists the three set-it cases + ties to using-tasks Task-completion step 6 / SESSION BOUNDARY line. (4) What-NOT-to-do bullet warns against setting it routinely. Wiki: `concepts/delegate-task-session-break.md` (links [[using-tasks-session-break]]) + index + log. All 4 acceptance criteria met by inspection (markdown policy artifact — no test surface). NB on numbering: SKILL numbers pre-flight 0-indexed (04), so the task's "Q6" lands as item `5.` after the "Q5 notify" (= item `4.`).
**Weight:** needs-claude
**Next action:** Прочитать skills/delegate-task/SKILL.md, добавить Q6 в pre-flight и поле session_break в template, поднять версию до v0.2.2
**Next action:** (none — kept until merged; paired review task `session-break-delegate-task-review` unblocked)
**Branch:** n/a
<!-- created-by: OpeItcLoc03@DESKTOP-NSEF0UK / from: OpeItcLoc03/workshop / 2026-06-09T10:15:32.125Z -->
<!-- closed-by: DESKTOP-NSEF0UK:claude-opus:18704 / 2026-06-09 / 0.2.1→0.2.2 PATCH; session_break authoring field (pre-flight Q6 + optional template trailer field + 3-case usage guidance + What-NOT bullet); wiki concept page; 4/4 acceptance met by inspection (markdown policy, no test surface) -->
---

View File

@@ -0,0 +1,46 @@
---
title: delegate-task session_break field
type: concept
tags: [delegate-task, using-tasks, autonomous-runner, session-boundary]
updated: 2026-06-09
---
# delegate-task `session_break` field
`delegate-task` v0.2.2 adds an optional `session_break` field to the task-body template, plus
a sixth pre-flight question. This is the **authoring** side of the marker whose **consumer**
side lives in `using-tasks` — see [[using-tasks-session-break]].
## Problem
`using-tasks` v1.2.0 can stop an autonomous runner after a task closes (instead of chaining
`tasks_claim_next`) **iff** the closed task carries a `session_break` marker. But nothing in the
delegation flow prompted the author to set it — so the capability sat unused unless someone
hand-edited the task body. The marker has to be *placed at delegation time* to be useful.
## Design
- **Pre-flight Q6** (after Q5 `notify`): *"Session-break после этой задачи? — нужен ли разрыв
сессии после её закрытия (domain-switch, milestone, heavy infra)?"* If yes → set
`session_break` in the task body; if no → omit it (default unchanged).
- **Template field** (optional, in the trailer next to `weight` / `notify` / `allow_upgrade`):
`session_break: true | "<следующий трек / hint>"` with an inline comment pointing at the
`using-tasks` stop behaviour. `session_break` (lowercase, underscore) is the same frontmatter
key `using-tasks` reads.
- **Value:** `true` (next track = "см. STATUS.md") or a hint string naming the next track.
## When to set it (three cases)
1. **Смена домена / репо** — the task ends one track before an unrelated one begins.
2. **Milestone-задача** — the last sub-task in a feature's group.
3. **Тяжёлая инфра-задача** — shared checkout, migrations, deploy — where it's sane to stop and
inspect state before continuing.
Not a default: setting it routinely would make `using-tasks` tear the session after every
close. It is a marker of a *real* boundary, an authoring choice — same rationale as the
consumer-side "marker not heuristic" argument in [[using-tasks-session-break]].
## Versioning
PATCH bump (0.2.1 → 0.2.2): additive optional field + one extra pre-flight question, no existing
behaviour changed. (The version target was fixed by the delegating task.)

View File

@@ -42,6 +42,7 @@ Catalog of all wiki pages. One line per page, organized by type. Updated on ever
- [interns-grep-audit-design](concepts/interns-grep-audit-design.md) — interns-grep-audit-design
- [session-handoff-skill-design.md](concepts/session-handoff-skill-design.md) — design rationale for the `session-handoff` skill (sliding overwrite into `.tasks/NEXT_SESSION.md`, phrase whitelist + substantive-commit heuristic, optional PostToolUse hook for harness-side determinism, orient+ask default, project scope, cluster 7/7 closure)
- [using-tasks-session-break.md](concepts/using-tasks-session-break.md) — `using-tasks` v1.2.0 `session_break` marker: task-author-set boolean/string flag; after a task closes 🟢, before `tasks_claim_next`, an autonomous agent prints the verbatim SESSION BOUNDARY line and stops instead of chaining the next task. Absent → unchanged
- [delegate-task-session-break.md](concepts/delegate-task-session-break.md) — `delegate-task` v0.2.2 — authoring side of the `session_break` marker (consumer = [[using-tasks-session-break]]): pre-flight Q6 + optional template field `session_break: true | "<hint>"`; three set-it cases (domain-switch / milestone / heavy infra); not a default
- [delegate-task-negative-trigger-fp.md](concepts/delegate-task-negative-trigger-fp.md) — `delegate-task` v0.2.1 FP fix: «создать задачу себе» stem-matched the «создать задачу на агента» positive trigger; abstract "does NOT apply when doing the work yourself" carve-out loses to literal stem-match under the 1%-rule → made the negative literal + routed (→ using-tasks). Verified pos 5/5, neg 4/5 (was 0/5)
## Packages

View File

@@ -67,4 +67,5 @@ Parseable: `grep "^## \[" .wiki/log.md | tail -20`.
## [2026-05-25] decision | install-cross-platform extended to build scripts — `build.{ps1,sh}` get the symmetric `--prune` / `-Prune` flag (removes `dist/<name>.skill` where `<name>` is not in `skills/`). Bash delegation to `powershell.exe -File build.ps1` does NOT forward the flag — bash runs prune itself against the shared `dist/`. Both paths smoke-tested with fake stale .skill files against real dist/. Closes `[install-ps1-build-prune-followup]`.
## [2026-06-09] decision | delegate-task-negative-trigger-fp — `delegate-task` 0.2.0→0.2.1 (PATCH): fixed 5/5-consistent false-positive on «создать задачу себе». Root cause: self-task phrase shares stem «создать задачу» with the «создать задачу на агента» positive trigger; the abstract "Does NOT apply when doing the work yourself" carve-out can't beat a literal stem-match under the 1%-rule. Fix: made the negative literal + routed («создать задачу себе» / «task for myself» / «поставить себе задачу» → using-tasks) in description + body disambiguator («на агента»/«агенту» = delegate; «себе» = own board). Re-verified via fresh-context subagent trigger run: positives 5/5 (no regression), negative 4/5 → using-tasks (was 0/5); the 1 residual miss was an eval-harness artifact (forced skill-name-before-reasoning), not description ambiguity. Concept page written; reusable principle = put the exact colliding negative phrase with an explicit →sibling route, literal beats abstract.
## [2026-06-09] decision | delegate-task-session-break — `delegate-task` 0.2.1→0.2.2 (PATCH): authoring side of the `session_break` marker (consumer = using-tasks v1.2.0). Added pre-flight Q6 (after notify): "Session-break после этой задачи? (domain-switch / milestone / heavy infra)"; if yes → set optional template field `session_break: true | "<hint>"` (trailer, next to weight/notify/allow_upgrade; same lowercase frontmatter key using-tasks reads). Usage guidance lists three set-it cases; What-NOT-to-do bullet warns against setting it routinely (it's a real-boundary marker, not a default). Wiki concept page concepts/delegate-task-session-break.md + index. Pairs with using-tasks-session-break.
## [2026-06-09] decision | using-tasks-session-break — `using-tasks` 1.1.0→1.2.0 (MINOR): added the `session_break` marker. Task author sets `session_break: true | "<hint>"` in task frontmatter (mirrored as `**Session break:**` on the local board); after the task closes 🟢, before `tasks_claim_next`, an autonomous agent prints the verbatim line `🔚 SESSION BOUNDARY — [slug] закрыта. Рекомендую завершить текущую сессию. Следующий трек: [value | "см. STATUS.md"]` and stops instead of chaining the next task. Absent → behaviour unchanged. Enforced in Task completion step 6 + Rules bullet + format docs. Marker not heuristic: the stop-point is an authoring choice, not a runner guess.

View File

@@ -1,6 +1,6 @@
---
name: delegate-task
version: 0.2.1
version: 0.2.2
description: >
Use when delegating a task to another agent or project via
mcp__projects-meta__tasks_create. Triggers: «делегировать таску»,
@@ -37,7 +37,7 @@ description: >
## Steps
### 1. Pre-flight gate (5 вопросов пользователю)
### 1. Pre-flight gate (6 вопросов пользователю)
Спросить **до** составления тела задачи:
@@ -48,6 +48,9 @@ description: >
2. **Автопуш — разрешён?** (да/нет, per задача)
3. **Контекстные скилы сверх дефолтов?** — предложить по содержанию задачи (например `claude-api` для работы с Anthropic SDK, `frontend-design` для UI, `using-interns` если интерны разрешены), пользователь утверждает.
4. **notify — кому докладывать о завершении/затыке?** (slug проекта; обычно `.workshop` или `OpeItcLoc03/workshop`)
5. **Session-break после этой задачи?** — нужен ли разрыв сессии после её закрытия (domain-switch, milestone, heavy infra)?
- Если **да** → проставить `session_break` в теле задачи (см. шаблон): `true` или строка-hint с названием следующего трека. `using-tasks` остановится после close и предложит завершить сессию, не клеймя следующую задачу.
- Если **нет** → поле не добавлять (дефолт — агент продолжает `claim-next`).
### 2. Составить тело задачи по шаблону
@@ -70,8 +73,17 @@ description: >
**weight:** cheap-ok | needs-claude | needs-human
**notify:** <commissioning-project-slug>
[**allow_upgrade:** true/false]
[**session_break:** true | "<следующий трек / hint>"] # optional — using-tasks остановится после close, не клеймит следующую задачу
```
**Когда ставить `session_break`** (опционально; по умолчанию НЕ ставить — это маркер реальной границы, не дефолт). Три случая:
1. **Смена домена / репо** — задача завершает один трек перед переходом на несвязанный.
2. **Milestone-задача** — последняя в группе sub-tasks одной фичи.
3. **Тяжёлая инфра-задача** — shared checkout, migrations, deploy — где разумно остановиться и проверить состояние.
Значение: `true` (следующий трек = «см. STATUS.md») либо строка-hint с названием следующего трека. Потребитель — `using-tasks` v1.2.0+ (Task completion step 6): после close печатает `🔚 SESSION BOUNDARY …` и останавливается, не клеймя следующую задачу. Дизайн: `.wiki/concepts/delegate-task-session-break.md`.
**Почему `invoke` а не триггер-фраза:** CLAUDE.md ненадёжен (уплывает при compression, слабые модели игнорируют). Тело задачи читается активно — императив `invoke` это прямая команда, не пассивный матчинг.
### 3. Dry-run preview
@@ -108,3 +120,4 @@ description: >
- Не создавать review-таску для pointers/ops/research задач — только для impl.
- Не назначать `weight: cheap-ok` для задач где дисциплина критична (review, security, schema migration) — слабые модели могут игнорировать invoke-инструкции.
- Не назначать `weight: needs-claude` или `cheap-ok` задачам, меняющим критическую инфраструктуру (поллер, MCP серверы, deploy, CI/CD) — только `needs-human`.
- Не ставить `session_break` рутинно на каждую задачу — это маркер реальной границы (domain-switch / milestone / heavy infra), не дефолт; иначе `using-tasks` рвёт сессию после каждого close.