From 71f41ef9050dd38a9c3f499e5cf67769ca98b1b9 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Sun, 1 Nov 2026 10:34:28 +0000 Subject: [PATCH] nightly: shorten templates/workflow.md by ~120 tokens Co-Authored-By: Claude Sonnet 5.5 --- CHANGELOG.md | 3 +++ lib/dpcli/__init__.py | 2 +- templates/workflow.md | 11 ++++------- tools/budgets.json | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c80c062..3a132a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 37 +- Nightly: `templates/workflow.md` shorter by ~120 tokens (repeated deliver/journal details and a duplicate "read by section" rule removed). + ## 36 - `gc --remove` removes copies with a submodule (git refused without `--force`) and copies whose status shows changes but content equals HEAD (a hook restored the files); a change, a stash or a commit on no remote inside a submodule still blocks removal, and so does a failed submodule check. diff --git a/lib/dpcli/__init__.py b/lib/dpcli/__init__.py index 2118742..2f29e3e 100644 --- a/lib/dpcli/__init__.py +++ b/lib/dpcli/__init__.py @@ -6,4 +6,4 @@ else in the current copy. Exit codes: 0 ok, 1 error/check failed, 2 arguments. """ -VERSION = 36 # bump on every change: older copies re-exec from the main copy (reexec.maybe_reexec) +VERSION = 37 # bump on every change: older copies re-exec from the main copy (reexec.maybe_reexec) diff --git a/templates/workflow.md b/templates/workflow.md index eba5837..418fd45 100644 --- a/templates/workflow.md +++ b/templates/workflow.md @@ -16,7 +16,7 @@ Journal, cards, branches, docs — only via `{{cli}}` (help: `{{cli}} 2. Branch `{{module_branch}}` **from the module base** — the feature branch the main session is on (`module new` takes the current branch; another — `--from`); copy, coordinator; contracts before the first executor. Several modules of one feature — each its own branch from the same feature branch. 3. Waves: ≤ 4 executors at once; task → card → copy and branch `/` from `{{module_branch}}` → acceptance (see "Acceptance"). 4. Gate (stop condition or a fork outside the plan): `{{cli}} decide "question" --ask` → main session asks the user → `answer`. -5. User check → on approval `{{cli}} deliver `: one squash commit into the module base (`--into` — another branch); of the journal only `decisions.md` and `summary.md` go there; the full journal stays in `{{module_branch}}` (and under an archive tag if `deliver.archive_tag` is set); plan and contracts get `status: closed`, `INDEX.md` is rebuilt. Don't develop the module branch after delivery. Feature branch into `{{main_branch}}` — only by the user's decision (usually an MR merged by a human); `deliver`/`merge` into `{{main_branch}}` — only with explicit `--into`. +5. User check → on approval `{{cli}} deliver `: one squash commit into the module base (`--into` — another branch); of the journal only `decisions.md` and `summary.md` go there. Don't develop the module branch after delivery. Feature branch into `{{main_branch}}` — only by the user's decision (usually an MR merged by a human); `deliver`/`merge` into `{{main_branch}}` — only with explicit `--into`. ## Message protocol Agents send only these formats. @@ -59,8 +59,7 @@ The coordinator does not read the task's code, diffs or logs. Allowed: `status`, 3. PASS, `dpcli_review: true` → `checked`, then by risk: - by default — by the report (`report --show`: checks, `uncertain`) → `{{cli}} event accepted --note "by report"`; - a fresh `dp-reviewer` — complex domain logic, numerical schemes, parallel/GPU computing, a contract interface, second rework, serious `uncertain`. -4. Reviewer verdict: accept → `event accepted --note "by review"`; rework → to the executor: `{{cli}} review --show`, then `accept` again and a fresh reviewer. Disputed points — a question to the reviewer/executor. -5. Merge the task branch into `{{module_branch}}`, `{{cli}} accept --here --commit `, `{{cli}} event merged`, remove the copy. +4. Reviewer verdict: accept → `event accepted --note "by review"`; rework → to the executor: `{{cli}} review --show`, then `accept` again and a fresh reviewer.5. Merge the task branch into `{{module_branch}}`, `{{cli}} accept --here --commit `, `{{cli}} event merged`, remove the copy. ## General rules - Refer to decisions in plans, contracts and cards by `Q` or date `YYYY-MM-DD`, not by time ("decision 12:35"): after delivery the journal with timestamps is not in the branch. @@ -72,19 +71,18 @@ The coordinator does not read the task's code, diffs or logs. Allowed: `status`, - Long runs (> 1–2 min) — `run_in_background` or `{{cli}} job start ` → `{{cli}} job wait `. No `pgrep -f`/`pkill -f`; other processes — only by PID after `readlink /proc/PID/cwd`. - Batches of runs — one script, one background run, results as a table. - Don't open images unless appearance is the subject of the task; verify with numbers. Artifacts — in `artifacts_dir`, a subfolder per task. -- Read plans and contracts by section: `{{cli}} plan
`, `--contracts `. - Commits — only your own files: `git add && git commit -m "…" -- `, with a `Claude-Session` line; no push. Never `git stash`: the stash is shared by all worktrees. - Don't change `.claude/` or CLAUDE.md unless that is the task. ## Journal -- `{{plan_dir}}//` — cards, reports, `events.jsonl`, `decisions.jsonl`; append-only via commands, never edit by hand. It is the module branch's working journal: commit it there freely, it does not go into the target branch — `deliver` folds it into `decisions.md` (decisions, questions with answers) and `summary.md` (task results, not done, doubts). Full view for the coordinator — `{{cli}} render `. +- `{{plan_dir}}//` — cards, reports, `events.jsonl`, `decisions.jsonl`; append-only via commands, never edit by hand. Commit it freely in the module branch; `deliver` folds it into `decisions.md` and `summary.md`. Full view for the coordinator — `{{cli}} render `. - Task ID `-[letter]`; `task new ` without an ID takes the next number. - Executor: `{{cli}} task show ` → work → `{{cli}} accept --dry` → `{{cli}} report ` (per-task file; schema `report --template`; `uncertain` — doubts and what was checked; `dp_feedback`). `report` is the only write into the module copy. - Coordinator: `{{cli}} inbox ` at the start of every step; journal commit — `git add {{plan_dir}}/ && git commit -m "…" -- {{plan_dir}}/`. ## Documentation - Entry — `{{docs_dir}}/INDEX.md`. Find — `{{cli}} docs find `, `{{cli}} docs findings `, module journals — `{{cli}} search ` (`--sem` — by meaning, if enabled). -- Read by section, not whole: `{{cli}} docs section ` — table of contents, `{{cli}} docs section ` — a section. +- Read by section, not whole: `{{cli}} docs section ` — table of contents, `… ` — a section; plans and contracts — `{{cli}} plan
`, `--contracts `. - Every md has frontmatter (`type`, `status`, `module`, `updated`, `summary`, `related`); new — `{{cli}} docs init`; `summary` — the conclusion/purpose in one line ≤ 140 chars (not TODO). - Document size ≤ `docs.max_kb` (40 KB): larger — split into section files or move data out; before commit — `{{cli}} docs check`, registries — `{{cli}} docs index`. - Finished work — one line in `registry/findings.md` (module section): the conclusion with numbers and a `path#section` link. @@ -105,7 +103,6 @@ Opus only if the design cannot be moved into the plan or a contract. On failure ## Agent setup - dpcli agents — `.dpcli/agents/*.md` (Claude Code format + `dpcli_role: coordinator|executor|reviewer|status`, `dpcli_review: true|false`); `{{cli}} init` puts them into `.claude/agents/`. - Project changes live in the project layer `.dpcli-local/` (see its README), never in `.dpcli/` — the distribution is replaced on update: `agents/.append.md` adds to a dpcli agent, `agents/.md` is an own agent, `skills//`, `workflow.md` (project rules), `claude-md.md`. Then `{{cli}} init`. -- `init` does not touch files it did not create: same-named files in `.claude/agents/` are skipped. - Attach your own agent to a role — `roles` in `dpcli.yml` (`name: {role: executor, review: true}`) or `dpcli_role` in its frontmatter; then it is valid in `task new --type`. - Role registry — `{{cli}} agents`. diff --git a/tools/budgets.json b/tools/budgets.json index f5604e8..a799420 100644 --- a/tools/budgets.json +++ b/tools/budgets.json @@ -1,7 +1,7 @@ { "code_lines": 5906, "prompt_tokens": 6898, - "prompt_max": 3236, + "prompt_max": 3142, "duplicate_windows": 0, "risky": { "rm -rf": 0,