@dreb/coding-agent 2.59.2 → 2.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/mach6.md CHANGED
@@ -77,9 +77,9 @@ Run a durable, explicit, round-aware review. It always posts two comments: an **
77
77
  /skill:mach6-review 53 tests
78
78
  ```
79
79
 
80
- Rounds 1–2 run the applicable code-reviewer, error-auditor, test-reviewer, completeness-checker, and simplifier together in phase one. The independent assessor then applies factual, scope, and practical gates. Practical assessment requires a credible actor, exact reachable trigger, concrete consequence, existing safeguards, and material value from fixing the problem; missing tests are not blockers without an important uncovered regression.
80
+ Every round runs the applicable code-reviewer, error-auditor, test-reviewer, completeness-checker, and simplifier together in phase one. A specialist is retried rather than omitted if dispatch arbitration or the agent fails. In rounds 1–2, the independent assessor then applies factual, scope, and practical gates. Practical assessment requires a credible actor, exact reachable trigger, concrete consequence, existing safeguards, and material value from fixing the problem; missing tests are not blockers without an important uncovered regression.
81
81
 
82
- Round 3+ reviews only changes since the latest recorded reviewed SHA and verifies prior blockers. The four core specialists remain; simplifier runs only when explicitly requested. Phase two runs independent-assessor, developers-advocate, and devils-advocate in parallel. The developer's advocate attacks the practical value of proposed work; the devil's advocate attacks evidence that the original acceptance promises hold and supplements rather than replaces test-reviewer. A later-round item blocks merge only when the assessor and developer's advocate agree on material practical impact, with parent adjudication based on a concrete trigger-and-outcome sequence.
82
+ Round 3+ continues to review the full PR and all interactions among its changes while using changes since the latest recorded reviewed SHA as supplemental context for verifying prior blockers and identifying new work. Reviews narrow only when the user explicitly requests a targeted scope. Phase two runs independent-assessor, developers-advocate, and devils-advocate in parallel. The developer's advocate attacks the practical value of proposed work; the devil's advocate attacks evidence that the original acceptance promises hold and supplements rather than replaces test-reviewer. A later-round item blocks merge only when the assessor and developer's advocate agree on material practical impact, with parent adjudication based on a concrete trigger-and-outcome sequence.
83
83
 
84
84
  See [Review Agents](#review-agents) below.
85
85
 
@@ -132,7 +132,7 @@ Phase one uses specialists with orthogonal incentives and confidence-scored cand
132
132
  | **error-auditor** | What can fail silently at runtime? | All applicable rounds |
133
133
  | **test-reviewer** | What important behavior lacks coverage? | All applicable rounds; never replaced |
134
134
  | **completeness-checker** | Does the PR fulfill authoritative scope? | All applicable rounds |
135
- | **simplifier** | Can changed code be clearer without behavior changes? | Rounds 1–2 in parallel; round 3+ only when requested |
135
+ | **simplifier** | Can changed code be clearer without behavior changes? | Every round; retry on dispatch or agent failure |
136
136
 
137
137
  Phase two assessment agents:
138
138
 
@@ -150,7 +150,7 @@ The two advocates intentionally pull in different directions: one challenges the
150
150
 
151
151
  - **GitHub as shared memory** — Plans, reviews, assessments, and progress are posted as PR/issue comments with HTML markers (`<!-- mach6-plan -->`, `<!-- mach6-review -->`, etc.) so any future session can pick up context.
152
152
  - **Three-gate independent assessment** — Findings must be factual, authorized, and materially practical before becoming merge blockers.
153
- - **Deliberate counter-pressure** — Later rounds focus on the delta and pair practical-value skepticism with adversarial acceptance evidence to resist ceremonial review work.
153
+ - **Deliberate counter-pressure** — Every round reviews the full PR; later-round deltas supplement that view for fix verification while practical-value skepticism and adversarial acceptance evidence resist ceremonial review work.
154
154
  - **Durable accountability checkpoint** — Implementation and fixes are committed, pushed, and recorded before formal review so work cannot be lost or repeatedly rewritten while still local.
155
155
  - **User-controlled review cycles** — Only the user starts each formal review or re-review. Agents stop at the checkpoint and suggest the next command rather than autonomously chaining review and fix cycles.
156
156
  - **Focused checks remain available** — One-off reviewer/checker subagents may answer narrow correctness questions without becoming a formal mach6 review cycle.
package/docs/models.md CHANGED
@@ -207,6 +207,12 @@ Current behavior:
207
207
  - `/model` and `--list-models` list entries by model `id`.
208
208
  - The configured `name` is used for model matching and detail/status text.
209
209
 
210
+ To give one custom or built-in model persistent behavioral instructions, add an exact
211
+ `provider/model` entry under [`modelSettings`](settings.md#modelsettings) in `settings.json`.
212
+ There you can replace dreb's built-in system prompt with `systemPrompt` or preserve it and
213
+ add instructions with `appendSystemPrompt`. This stays separate from model transport and
214
+ capability metadata in `models.json`.
215
+
210
216
  ## Overriding Built-in Providers
211
217
 
212
218
  Route a built-in provider through a proxy without redefining models:
package/docs/settings.md CHANGED
@@ -21,7 +21,7 @@ Edit directly or use `/settings` for common options.
21
21
  | `hideThinkingBlock` | boolean | `false` | Hide thinking blocks in output |
22
22
  | `thinkingBudgets` | object | - | Custom token budgets per thinking level |
23
23
  | `agentModels.models` | object | - | Per-agent model fallback lists for subagents (map of agent name → ordered model IDs). See [agent-models.md](agent-models.md) |
24
- | `modelSettings` | object | - | Per-model overrides keyed by model ID (e.g. thinking display). See [modelSettings](#modelsettings) |
24
+ | `modelSettings` | object | - | Per-model thinking-display and provider/model system-prompt overrides. See [modelSettings](#modelsettings) |
25
25
 
26
26
  #### agentModels.models
27
27
 
@@ -55,9 +55,12 @@ Configurable in the TUI via `/settings` → **Agent Models**. See [agent-models.
55
55
 
56
56
  #### modelSettings
57
57
 
58
- Per-model overrides keyed by model ID. Currently supports `thinkingDisplay`, which controls
59
- whether adaptive-thinking Claude models (Opus and Sonnet 4.6–4.x, plus Claude 5 families)
60
- return thinking summaries.
58
+ `modelSettings` supports thinking-display preferences and persistent model-specific system
59
+ prompts.
60
+
61
+ `thinkingDisplay` remains keyed by bare model ID for compatibility. It controls whether
62
+ adaptive-thinking Claude models (Opus and Sonnet 4.6–4.x, plus Claude 5 families) return
63
+ thinking summaries:
61
64
 
62
65
  ```json
63
66
  {
@@ -73,12 +76,50 @@ return thinking summaries.
73
76
 
74
77
  Anthropic's API defaults Opus 4.7+ to `"omitted"`, so dreb sends `"summarized"` by default
75
78
  on adaptive models to keep thinking visible. Set `"omitted"` here to opt into the
76
- lower-latency behavior. The setting is **keyed by model ID**, so it is honored identically
77
- by the main session and by any subagent that uses the same model. Non-adaptive models
78
- ignore the setting.
79
+ lower-latency behavior. The setting is honored identically by the main session and by any
80
+ subagent that uses the same model. Non-adaptive models ignore it. It is configurable in the
81
+ TUI via `/settings` → **Show thinking summaries** (shown only when the current model supports
82
+ adaptive thinking).
83
+
84
+ System-prompt settings require an exact canonical `provider/model` key. Use `systemPrompt`
85
+ to replace dreb's built-in prompt, or `appendSystemPrompt` to preserve the selected base
86
+ prompt and append model-specific instructions:
87
+
88
+ ```json
89
+ {
90
+ "modelSettings": {
91
+ "openai-codex/gpt-5.6-sol": {
92
+ "appendSystemPrompt": "When implementing a mach6 plan, stop when the work is ready to commit and push."
93
+ },
94
+ "ollama/qwen2.5-coder:7b": {
95
+ "systemPrompt": "You are a coding assistant for this local model. Verify external facts against authoritative sources before answering."
96
+ }
97
+ }
98
+ }
99
+ ```
79
100
 
80
- Configurable in the TUI via `/settings` → **Show thinking summaries** (shown only when the
81
- current model supports adaptive thinking).
101
+ Prompt behavior:
102
+
103
+ - The key is matched as one exact string. Model IDs may themselves contain `/`, so
104
+ `openrouter/anthropic/claude-sonnet-4` means provider `openrouter` and model ID
105
+ `anthropic/claude-sonnet-4`.
106
+ - Bare model-ID keys never apply prompt instructions; this prevents instructions from
107
+ leaking to another provider exposing the same ID.
108
+ - Configure exactly one of `systemPrompt` and `appendSystemPrompt` for a canonical model.
109
+ Defining both, or using an empty/non-string value, fails loudly when dreb builds that
110
+ model's prompt.
111
+ - An explicit session replacement from `--system-prompt`, `SYSTEM.md`, or an SDK resource
112
+ loader takes precedence over `systemPrompt`. `appendSystemPrompt` still appends after
113
+ existing session append sources such as `--append-system-prompt`, `APPEND_SYSTEM.md`, and
114
+ subagent-definition instructions.
115
+ - Switching or cycling models rebuilds the prompt immediately: instructions from the old
116
+ model are removed and instructions for the new model are applied. `/reload` picks up
117
+ external `settings.json` edits.
118
+ - Global and project entries follow the existing per-property merge. A project value wins
119
+ for the same field; a merged entry that supplies both prompt modes is rejected rather
120
+ than choosing one silently.
121
+ - Built-in and custom models use the same lookup. Register a local model in `models.json`,
122
+ then use its exact `provider/id` here.
82
123
 
83
124
  ### UI & Display
84
125
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreb/coding-agent",
3
- "version": "2.59.2",
3
+ "version": "2.60.0",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "drebConfig": {
@@ -26,7 +26,7 @@ Track prepare, phase-one review, findings comment, phase-two assessment, assessm
26
26
 
27
27
  Extract the required PR number and optional aspects: `code`, `errors`, `tests`, `completeness`, `simplify`.
28
28
 
29
- ## Step 3: Prepare, determine the round, and establish the delta
29
+ ## Step 3: Prepare, determine the round, and establish the review context
30
30
 
31
31
  Before checkout, run `git status --porcelain`. If non-empty, stop and use `suggest_next` to offer `/skill:mach6-push`.
32
32
 
@@ -51,21 +51,23 @@ PRIOR_ROUNDS="$(printf '%s' "$PR_CONTEXT" | jq '[.comments[] | select(.body | st
51
51
  REVIEW_ROUND="$((PRIOR_ROUNDS + 1))"
52
52
  ```
53
53
 
54
- For round 3+, extract the most recent parseable full SHA after `Reviewed commit:` in the latest review comment. If found, use `git log <sha>..HEAD` and `git diff <sha>..HEAD`; this delta and its interactions are the review target. Also extract previous merge blockers and verify that each is fixed. Reject unchanged-code findings unless a delta change makes the issue newly reachable. If no legacy SHA is parseable, review the full PR diff but retain all round-3+ rules.
54
+ Use `gh pr diff <pr-number>` in every round. The full PR and the interactions among all of its changes are the review target unless the user explicitly requests a narrower review.
55
55
 
56
- For rounds 1–2, use `gh pr diff <pr-number>`. Mark the PR ready only after all checks pass: `gh pr ready <pr-number>`.
56
+ For round 3+, also extract the most recent parseable full SHA after `Reviewed commit:` in the latest review comment. If found, use `git log <sha>..HEAD` and `git diff <sha>..HEAD` as supplemental context for identifying new changes and verifying prior fixes, never as a replacement for the full PR diff. Extract previous merge blockers and verify that each is fixed. Do not reject a finding merely because the relevant lines are unchanged since the previous round.
57
+
58
+ Mark the PR ready only after all checks pass: `gh pr ready <pr-number>`.
57
59
 
58
60
  ## Step 4: Phase one — specialist candidates
59
61
 
60
62
  Agent mapping: `code` → `code-reviewer`; `errors` → `error-auditor`; `tests` → `test-reviewer`; `completeness` → `completeness-checker`; `simplify` → `simplifier`.
61
63
 
62
- Without targeted aspects:
63
- - Rounds 1–2: run `code-reviewer`, applicable `error-auditor`, applicable `test-reviewer`, applicable `completeness-checker`, and `simplifier` together in one parallel `subagent` `tasks` call.
64
- - Round 3+: run the same four core specialists together on the delta. `test-reviewer` remains present when testable code changed. Skip `simplifier` unless `simplify` was explicitly requested.
64
+ Without targeted aspects, run `code-reviewer`, applicable `error-auditor`, applicable `test-reviewer`, applicable `completeness-checker`, and `simplifier` together in one parallel `subagent` `tasks` call in every round. `test-reviewer` remains present whenever the PR contains testable code changes.
65
+
66
+ With targeted aspects, run only mapped agents while still reviewing the full PR unless the user explicitly requests a narrower target.
65
67
 
66
- With targeted aspects, run only mapped agents, while preserving round-3+ delta constraints. Never run simplifier serially after the others.
68
+ If dispatch arbitration or a specialist agent fails, retry that specialist. A retry may run separately after the original parallel batch; do not omit a required or requested specialist because its first attempt failed.
67
69
 
68
- Give every agent changed paths, full PR context, authoritative scope, actual files, and confidence scoring (0–100; report only candidates at least 80). In round 3+, explicitly provide the base SHA, delta, previous blockers, and unchanged-code rejection rule. Verify previous blockers independently even if no agent reports them.
70
+ Give every agent changed paths, the full PR diff and context, authoritative scope, actual files, and confidence scoring (0–100; report only candidates at least 80). In round 3+, also provide the prior reviewed SHA, supplemental delta, and previous blockers so agents can verify fixes without narrowing the review target. Verify previous blockers independently even if no agent reports them.
69
71
 
70
72
  ## Step 5: Post unverified candidates
71
73
 
@@ -99,7 +101,7 @@ Post with a unique temp file and `gh pr comment <pr-number> --body-file "$GH_BOD
99
101
 
100
102
  ## Step 6: Phase two — assess with counter-pressure
101
103
 
102
- All assessors receive identical candidate findings, actual code, full PR/issue context, verbatim original quoted requests, acceptance criteria, approved scope changes, review round, and delta context.
104
+ All assessors receive identical candidate findings, actual code, the full PR diff and PR/issue context, verbatim original quoted requests, acceptance criteria, approved scope changes, and the review round. For round 3+, also provide the latest delta as supplemental fix-verification context without narrowing assessment of the full PR.
103
105
 
104
106
  Apply three gates:
105
107
  1. **Factual:** current code contains the problem.