Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion lib/dpcli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 4 additions & 7 deletions templates/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Journal, cards, branches, docs — only via `{{cli}}` (help: `{{cli}} <command>
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 `<m>/<ID>` from `{{module_branch}}` → acceptance (see "Acceptance").
4. Gate (stop condition or a fork outside the plan): `{{cli}} decide <m> "question" --ask` → main session asks the user → `answer`.
5. User check → on approval `{{cli}} deliver <m>`: 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 <m>`: 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.
Expand Down Expand Up @@ -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 <ID> 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 <ID> --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 <ID> --here --commit <h>`, `{{cli}} event <ID> merged`, remove the copy.
4. Reviewer verdict: accept → `event accepted --note "by review"`; rework → to the executor: `{{cli}} review <ID> --show`, then `accept` again and a fresh reviewer.5. Merge the task branch into `{{module_branch}}`, `{{cli}} accept <ID> --here --commit <h>`, `{{cli}} event <ID> merged`, remove the copy.

## General rules
- Refer to decisions in plans, contracts and cards by `Q<n>` or date `YYYY-MM-DD`, not by time ("decision 12:35"): after delivery the journal with timestamps is not in the branch.
Expand All @@ -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 <name> <timeout> <cmd>` → `{{cli}} job wait <name>`. 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 <m> <section>`, `--contracts <name>`.
- Commits — only your own files: `git add <paths> && git commit -m "…" -- <paths>`, 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}}/<m>/` — 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 <m>`.
- `{{plan_dir}}/<m>/` — 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 <m>`.
- Task ID `<CODE>-<n>[letter]`; `task new <m>` without an ID takes the next number.
- Executor: `{{cli}} task show <ID>` → work → `{{cli}} accept <ID> --dry` → `{{cli}} report <ID>` (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 <m>` at the start of every step; journal commit — `git add {{plan_dir}}/<m> && git commit -m "…" -- {{plan_dir}}/<m>`.

## Documentation
- Entry — `{{docs_dir}}/INDEX.md`. Find — `{{cli}} docs find <words>`, `{{cli}} docs findings <words>`, module journals — `{{cli}} search <text>` (`--sem` — by meaning, if enabled).
- Read by section, not whole: `{{cli}} docs section <path>` — table of contents, `{{cli}} docs section <path> <number|heading start>` — a section.
- Read by section, not whole: `{{cli}} docs section <path>` — table of contents, `… <path> <number|heading start>` — a section; plans and contracts — `{{cli}} plan <m> <section>`, `--contracts <name>`.
- 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.
Expand All @@ -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/<name>.append.md` adds to a dpcli agent, `agents/<name>.md` is an own agent, `skills/<name>/`, `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`.

Expand Down
2 changes: 1 addition & 1 deletion tools/budgets.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"code_lines": 5906,
"prompt_tokens": 6898,
"prompt_max": 3236,
"prompt_max": 3142,
"duplicate_windows": 0,
"risky": {
"rm -rf": 0,
Expand Down
Loading