dsh-doublecheck 0.7.0 → 0.7.2
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/CHANGELOG.md +13 -4
- package/README.es.md +181 -400
- package/README.hi.md +180 -399
- package/README.md +161 -380
- package/README.pt.md +180 -399
- package/README.zh.md +180 -399
- package/lib/domain/gate.d.ts +2 -2
- package/lib/domain/projection.d.ts +4 -4
- package/lib/domain/report.d.ts +2 -2
- package/lib/domain/stages.d.ts +1 -1
- package/lib/events.d.ts +4 -4
- package/lib/grill/index.d.ts +1 -1
- package/lib/guard/command.d.ts +2 -2
- package/lib/guard/gate.d.ts +3 -3
- package/lib/guard/index.d.ts +5 -5
- package/lib/guard/index.js +4 -2
- package/lib/guard/review.d.ts +2 -2
- package/lib/index.d.ts +10 -10
- package/lib/invariant.d.ts +1 -1
- package/lib/types.d.ts +2 -2
- package/package.json +28 -23
package/README.md
CHANGED
|
@@ -1,74 +1,155 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# dsh-doublecheck
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
**The delivery quality gate for DeepSeek Harness: grill the requirements, test the implementation, prove the delivery — then gate the handoff with a deliverable/rework decision.**
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
[](https://www.npmjs.com/package/dsh-doublecheck)
|
|
7
|
-
[](https://www.npmjs.com/package/dsh-doublecheck)
|
|
8
|
-
[](LICENSE)
|
|
9
|
-
[](https://github.com/topics/dsh-plugin)
|
|
10
|
-
[](https://github.com/PerryLink/dsh-doublecheck/actions/workflows/ci.yml)
|
|
7
|
+
*Requirements get interrogated before the first edit; delivery is proven, never claimed.*
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
[](https://github.com/topics/dsh-plugin)
|
|
11
|
+
[](#)
|
|
12
|
+
[](https://github.com/PerryLink/dsh-doublecheck/actions)
|
|
13
|
+
[](https://github.com/PerryLink/dsh-doublecheck/releases)
|
|
14
|
+
[](https://www.npmjs.com/package/dsh-doublecheck)
|
|
15
|
+
[](https://www.npmjs.com/package/dsh-doublecheck)
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
[English](README.md) · [简体中文](README.zh.md) · [Español](README.es.md) · [Português](README.pt.md) · [हिन्दी](README.hi.md)
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
</div>
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
- Disciplined teams do this in humans: requirements review → failing test → passing test → self-review → delivery proof. Agents deserve the same loop, enforced by the harness, not by vibes.
|
|
20
|
-
- Shipping needs a decision, not a vibe. The delivery gate turns the loop's evidence into a single **deliverable / rework required** verdict with red items and rework suggestions — the panel an evaluation platform pastes into its PR description.
|
|
21
|
+
---
|
|
21
22
|
|
|
22
|
-
##
|
|
23
|
+
## Compatibility
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
| Surface | Status |
|
|
26
|
+
|---|---|
|
|
27
|
+
| Harness | DeepSeek Harness `0.1.0-rc.8` |
|
|
28
|
+
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
29
|
+
| Platforms | All (pure host; no native code, no direct network requests of its own) |
|
|
30
|
+
| Model | Any (the guard itself never calls a model; the critic and reviewer phases run as harness subagents) |
|
|
31
|
+
|
|
32
|
+
## What you get
|
|
33
|
+
|
|
34
|
+
`dsh-doublecheck` installs two plugin rows that read and enforce from the same durable session log:
|
|
35
|
+
|
|
36
|
+
1. **`doublecheck-grill`** — the requirements furnace: the bundled `grill-requirements` skill plus the model-facing `doublecheck_skills`, `doublecheck_spec`, and `doublecheck_report` tools and the per-dimension verification workflow.
|
|
37
|
+
2. **`doublecheck-guard`** — the discipline guard: the grill gate, the red/green evidence gates, the adversary review, the `/doublecheck` and `/gate` commands, the `doublecheck.gate` settings namespace, and the four-phase delivery gate.
|
|
38
|
+
|
|
39
|
+
Together they enforce the **discipline loop** — *grill → design → red → green → review → verify*:
|
|
40
|
+
|
|
41
|
+
```text
|
|
25
42
|
grill ──▶ design ──▶ red ──▶ green ──▶ review ──▶ verify
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
└─ requirements furnace: six dimensions, consensus gate,
|
|
30
|
-
structured spec committed to the session and the workspace
|
|
43
|
+
│
|
|
44
|
+
└─ six requirement dimensions, consensus gate,
|
|
45
|
+
structured spec committed to the session + workspace
|
|
31
46
|
```
|
|
32
47
|
|
|
33
|
-
| Stage | Meaning |
|
|
34
|
-
|
|
35
|
-
| **grill** | Interrogate the six requirement dimensions; refuse to implement until consensus. |
|
|
36
|
-
| **design** |
|
|
37
|
-
| **red** | A failing test run proves the gap
|
|
38
|
-
| **green** | A passing test run after the edits closes the loop. |
|
|
39
|
-
| **review** | A forked adversary critic audits the delivery against the spec. |
|
|
40
|
-
| **verify** | `doublecheck_report` + a per-dimension verification workflow prove the delivery. |
|
|
41
|
-
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
F -- yes --> G["VERDICT: rework required"]
|
|
54
|
-
F -- no --> H["VERDICT: deliverable"]
|
|
55
|
-
G --> I["suggest plan-mode re-check + /gate run again"]
|
|
56
|
-
H --> J["paste the report into the PR description"]
|
|
48
|
+
| Stage | Meaning |
|
|
49
|
+
|---|---|
|
|
50
|
+
| **grill** | Interrogate the six requirement dimensions; refuse to implement until consensus. |
|
|
51
|
+
| **design** | The settled spec is committed via `doublecheck_spec`. |
|
|
52
|
+
| **red** | A failing test run proves the gap before implementation edits. |
|
|
53
|
+
| **green** | A passing test run after the edits closes the loop. |
|
|
54
|
+
| **review** | A forked adversary critic audits the delivery against the spec. |
|
|
55
|
+
| **verify** | `doublecheck_report` + a per-dimension verification workflow prove the delivery. |
|
|
56
|
+
|
|
57
|
+
## Quick start
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
# 1. install the bundle into your profile
|
|
61
|
+
dsh plugin --profile web add "github:PerryLink/dsh-doublecheck#main"
|
|
62
|
+
|
|
63
|
+
# or from npm (published releases)
|
|
64
|
+
dsh plugin --profile web add dsh-doublecheck
|
|
65
|
+
|
|
66
|
+
# 2. restart and verify the row
|
|
67
|
+
dsh --profile web --dump-config | grep -E -A3 'id: doublecheck-(grill|guard)'
|
|
57
68
|
```
|
|
58
69
|
|
|
70
|
+
Both rows (`doublecheck-grill` and `doublecheck-guard`) activate automatically with the profile.
|
|
71
|
+
|
|
72
|
+
## Install & uninstall
|
|
73
|
+
|
|
74
|
+
- **git channel** (latest `main`): `dsh plugin --profile web add "github:PerryLink/dsh-doublecheck#main"` — the `prepare` script builds with production dependencies only.
|
|
75
|
+
- **npm channel** (published releases): `dsh plugin --profile web add dsh-doublecheck`.
|
|
76
|
+
- **tarball channel**: `pnpm pack` in this repo, then `dsh plugin --profile web add ./dsh-doublecheck-<version>.tgz`.
|
|
77
|
+
- **uninstall**: `dsh plugin --profile web remove dsh-doublecheck` (or remove the rows from the profile patch).
|
|
78
|
+
|
|
79
|
+
For a zero-configuration strict mode (every gate on at `block` intensity, gate coverage required), apply the shipped overlay on top of the bundle patch: `dsh --profile web --patch ./node_modules/dsh-doublecheck/strict.patch.yml`.
|
|
80
|
+
|
|
81
|
+
## Configuration
|
|
82
|
+
|
|
83
|
+
All tunables are Schemastery `Config` fields (changeable from cordis.yml). An id-targeted override replaces the whole row — restate every key you need. `cordis.patch.yml` documents each key inline; Schema defaults are the single source of tuning defaults.
|
|
84
|
+
|
|
85
|
+
| Key | Default | Meaning |
|
|
86
|
+
|---|---|---|
|
|
87
|
+
| `specFile` | `'doublecheck-spec.md'` | Workspace file for the committed spec markdown (grill row). |
|
|
88
|
+
| `reportFile` | `'doublecheck-report.md'` | Workspace file for the delivery report (grill row). |
|
|
89
|
+
| `reportVerify` | `true` | Run the verification workflow by default (grill row). |
|
|
90
|
+
| `verifyProvider` | `'fork'` | Subagent provider for the per-dimension checkers (grill row). |
|
|
91
|
+
| `verifyMode` | `'all'` | `all` = one parallel checker per dimension; `single` = one combined checker (grill row). |
|
|
92
|
+
| `intensity` | `'remind'` | Enforcement strength of the grill, red/green, and review gates (`remind` / `warn` / `block`). |
|
|
93
|
+
| `enableByDefault` | `true` | Master switch for sessions without a `/doublecheck on\|off` record. |
|
|
94
|
+
| `language` | `'en'` | Injected reminder/deny/review/gate prose language (`en` / `zh`). |
|
|
95
|
+
| `guardTools` | `['edit', 'write']` | Mutation tool names both gates watch. |
|
|
96
|
+
| `vagueTaskMaxChars` | `200` | Longer tasks are never treated as vague. |
|
|
97
|
+
| `remindOnce` | `true` | Inject each reminder at most once per session (durable across restarts). |
|
|
98
|
+
| `testToolNames` | `['bash', 'pwsh']` | Shell tool names that can run tests. |
|
|
99
|
+
| `testCommandPatterns` | *(pnpm/npm/yarn/bun test, pytest, go/cargo/make test, node --test, deno test, uv run pytest)* | Regexes a command must match to count as a test run. |
|
|
100
|
+
| `testFilePatterns` | *(test dirs, `*.test.*` / `*.spec.*`)* | Regexes identifying test files — always editable, exempt from the red gate. |
|
|
101
|
+
| `modules.grill` | `true` | Off disables the grill gate. |
|
|
102
|
+
| `modules.tdd` | `true` | On enables the red/green evidence gates. |
|
|
103
|
+
| `modules.adversary` | `false` | On enables the forked critic review at green. |
|
|
104
|
+
| `adversaryModel` | `null` | Critic model route; `null` = main model self-reviews. |
|
|
105
|
+
| `adversaryProvider` | `'fork'` | Subagent provider the critic runs on. |
|
|
106
|
+
| `adversaryMaxFindings` | `5` | Findings cap (1–20) injected into the session. |
|
|
107
|
+
| `adversaryTools` | `['read', 'glob', 'grep']` | Critic tool allowlist; keep it read-only. |
|
|
108
|
+
| `adversaryTimeoutMs` | `120000` | Hard time budget for one critic run. |
|
|
109
|
+
| `gate.enabled` | `true` | Master switch for the gate panel and the turn-boundary red notice. |
|
|
110
|
+
| `gate.planSuggestion` | `true` | Append the plan-mode re-check suggestion to red reports. |
|
|
111
|
+
| `gate.reportFile` | `'gate-report.md'` | Workspace file for the gate report. |
|
|
112
|
+
| `gate.requirements.checklist` | *(six spec-dimension questions)* | Pluggable key-question checklist: `{ id, question, specDimension, required }`. |
|
|
113
|
+
| `gate.requirements.minConfirmed` | `6` | Minimum required questions that must pass (1..required count). |
|
|
114
|
+
| `gate.requirements.interrogateTool` | `'ask_user_question'` | Tool name whose calls count as interrogation evidence. |
|
|
115
|
+
| `gate.tests.requirePassingRun` | `true` | A non-passing (or missing) latest test run is a red light. |
|
|
116
|
+
| `gate.tests.allowFailingRuns` | `0` | Failing runs after the latest green allowed before red. |
|
|
117
|
+
| `gate.tests.requireCoverage` | `false` | On requires coverage evidence in the test output. |
|
|
118
|
+
| `gate.tests.minCoveragePct` | `80` | Minimum coverage percentage (0–100). |
|
|
119
|
+
| `gate.consistency.*` | `provider: 'fork'`, `model: null`, `tools: ['read','glob','grep']`, `timeoutMs: 120000`, `maxFindings: 5` | The local consistency reviewer's knobs (`model: null` = main model). |
|
|
120
|
+
| `gate.review.engine` | `'auto'` | `auto` = dsh-auto-review verdict records when present, else the local reviewer; `local` = always local. |
|
|
121
|
+
| `gate.review.provider` | `'fork'` | The local review reviewer's provider (its `model`/`tools`/`timeoutMs`/`maxFindings` match `gate.consistency.*`). |
|
|
122
|
+
|
|
123
|
+
Misconfiguration fails loud at load: invalid regexes, empty or duplicated name lists, out-of-range thresholds, and duplicate checklist ids throw instead of silently doing nothing. `strict.patch.yml` is the all-gates-block overlay that restates the guard row at `intensity: block` with every module on and the coverage requirement enabled.
|
|
124
|
+
|
|
125
|
+
## Tools & surfaces
|
|
126
|
+
|
|
127
|
+
| Surface | Kind | Notes |
|
|
128
|
+
|---|---|---|
|
|
129
|
+
| `doublecheck_skills` | tool | Lists and loads the package's four bundled skills through the skill registry seam. |
|
|
130
|
+
| `doublecheck_spec` | tool | Commits the grilled six-dimension spec to the session log and a workspace markdown copy. |
|
|
131
|
+
| `doublecheck_report` | tool | Folds the discipline evidence into a delivery report (optional per-dimension verification workflow). |
|
|
132
|
+
| `/doublecheck status\|report\|on\|off` | command | Switch, modules, intensity, stage facts, folded report, and the durable on/off override. |
|
|
133
|
+
| `/gate status\|run\|config` | command | Live checklist progress, the settled deliverable/rework report, and the effective config. |
|
|
134
|
+
| `grill-requirements`, `red-green-tdd`, `delivery-review`, `delivery-proof` | skill | Bundled discipline skills covering all six loop stages. |
|
|
135
|
+
| `doublecheck.gate` | settings namespace | The pluggable checklist, exposed to settings-capable UIs (`expose: true`, `applies: restart`). |
|
|
136
|
+
| `strict.patch.yml` | overlay | Every gate on at `block` intensity plus the coverage requirement, in one patch layer. |
|
|
137
|
+
| `dsh-doublecheck/invariant` | companion row | Reports package-owned write-path contradictions through the host `invariants` registry. |
|
|
138
|
+
|
|
139
|
+
## Gate phases
|
|
140
|
+
|
|
141
|
+
The delivery gate aggregates the session's durable evidence into a configurable four-phase checklist and settles one **deliverable / rework required** decision. Every phase folds the session log alone (replay IS the state), so a run re-derives identically after resume or fork.
|
|
142
|
+
|
|
59
143
|
| Phase | Checks | Evidence source | Model cost |
|
|
60
144
|
|---|---|---|---|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
145
|
+
| Requirements interrogation | Key-question checklist confirmed item by item (six spec-dimension questions by default) | Committed `doublecheck_spec` + `ask_user_question` calls | none |
|
|
146
|
+
| Test evidence | Latest run color, failing runs after green, optional coverage threshold | Shell test runs in the session log (`[exit code: N]`, coverage percentages) | none |
|
|
147
|
+
| Implementation consistency | Diff ↔ requirement mapping: every edit must serve a spec dimension | Local forked reviewer (structured findings, read-only tools) | one subagent |
|
|
148
|
+
| Review conclusion | The delivery verdict; `engine: auto` consumes dsh-auto-review's durable verdict records when present, else the local reviewer | `autoReview/verdict` / `autoReview/rejection` events, or the local forked reviewer | one subagent (local) |
|
|
65
149
|
|
|
66
|
-
|
|
67
|
-
- **Warnings and skips never flip the decision**: a skipped review keeps the report honest ("not reviewed") without inventing a red light — fail-closed for claims, never for evidence.
|
|
68
|
-
- **Plan mode & approvals**: a rework verdict suggests re-opening the work in plan mode (in the report banner, the `/gate status` panel, and the once-per-session turn notice). The discipline gates below keep their `warn`/`block` approval-chain enforcement; the gate itself is advisory.
|
|
69
|
-
- **Audit-safe by construction**: reports record counts, ids, and verdicts only — no file contents or session text. Model-produced finding texts pass a secret redactor (cloud keys, tokens, private-key blocks, password assignments, long hex/base64 runs) before they are stored or shown. The settled state rides the durable `doublecheck/gate` session event and the workspace `gate-report.md`.
|
|
150
|
+
Red lights are failed checks (a missing spec, a failing latest run, coverage below minimum, an unmapped edit, blocker/major findings) — each carries a rework suggestion. Warnings and skips never flip the decision. The gate integrates [dsh-auto-review](https://github.com/PerryLink/dsh-auto-review) as a weak dependency: `review.engine: auto` folds its verdict records when present and degrades to the local reviewer otherwise; the gate never synthesizes approval requests.
|
|
70
151
|
|
|
71
|
-
|
|
152
|
+
## Example report
|
|
72
153
|
|
|
73
154
|
`/gate run` returns this markdown — paste it into a PR description:
|
|
74
155
|
|
|
@@ -107,348 +188,48 @@ flowchart TD
|
|
|
107
188
|
- counts, ids, and verdicts only: no file contents or session text are embedded, and recognized secrets are redacted.
|
|
108
189
|
````
|
|
109
190
|
|
|
110
|
-
### Weak dependency on dsh-auto-review
|
|
111
|
-
|
|
112
|
-
The gate integrates with [dsh-auto-review](https://github.com/PerryLink/dsh-auto-review) as **"use the engine when it is there"**, never as a hard dependency:
|
|
113
|
-
|
|
114
|
-
- `review.engine: auto` (default) folds the engine's durable verdict records (`autoReview/verdict` / `autoReview/rejection`) from the session log — the engine's real conclusions about this session's approval-chain reviews. Rejected or high-risk calls become red items.
|
|
115
|
-
- No records (the engine is not installed, or nothing triggered it this session) → the phase degrades to the local forked reviewer and names the reason on a warning check: `dsh-auto-review is not installed` / `dsh-auto-review is installed but has no verdict records in this session`.
|
|
116
|
-
- The gate **never synthesizes approval requests**: that chain may reach a human. The engine's own records are the evidence; `engine: local` skips it entirely.
|
|
117
|
-
|
|
118
|
-
### Settings surface
|
|
119
|
-
|
|
120
|
-
The pluggable checklist is Schema-validated config (`gate.*` in the guard row) and is additionally registered as the **`doublecheck.gate` settings namespace** (`expose: true`, `applies: restart`) when the harness settings service is mounted — so settings-capable UIs can read and edit the checklist without hand-editing a profile.
|
|
121
|
-
|
|
122
|
-
## Features
|
|
123
|
-
|
|
124
|
-
- 🔥 **`grill-requirements` skill** — a bundled Agent-Skills-format skill that interrogates the task across six dimensions (**goal, scope, acceptance criteria, failure modes, priorities, non-goals**) using DSH's native `ask_user_question` UI, refuses to write code until consensus, and records the contract.
|
|
125
|
-
- 🧰 **Stage skills for the whole loop** — `red-green-tdd` (write the failing test, run red, implement, run green), `delivery-review` (adversarial self-review against the spec once green), and `delivery-proof` (consolidate the evidence into the delivery report and pass the delivery gate before claiming completion) join `grill-requirements`, so all six stages have model guidance, not just the first.
|
|
126
|
-
- 📜 **`doublecheck_spec` tool** — commits the grilled spec to the session log and writes a markdown copy to the workspace, so the contract survives the conversation. Empty or whitespace-only dimensions are rejected at the commit (v0.6): the grill must settle all six before the spec counts.
|
|
127
|
-
- 🔄 **Task-change re-grill** — a committed spec covers its own task: a new direct-user request after the latest spec commit reopens the grill gate for that follow-up instead of silently inheriting the old contract.
|
|
128
|
-
- 🛡️ **Discipline guard** — a soft gate on the tool policy pipeline. Vague task + no spec + heading for `edit`/`write` → **remind**, **hold for human approval**, or **block**, depending on `intensity`.
|
|
129
|
-
- 🟥🟩 **Red/green evidence gates** (`modules.tdd`) — hard checks over the session log: an implementation edit requires a **failing test run on record** since the last passing run (writing test files is always allowed — that is how the red step happens), and a turn that ends with edits but no passing run gets a green reminder injected. Custom guard tools work out of the box: the gates read both `file_path` and `path` argument keys, and a call that names no file at all is not treated as an implementation edit.
|
|
130
|
-
- 👁️ **Adversary review** (`modules.adversary`) — once the delivery reaches green, a forked critic subagent (DSH's native subagent seam, default `fork` provider) audits the session against the committed spec with an adversarial stance and returns structured findings, sorted blocker-first. `remind` injects the critique; `warn`/`block` additionally steer one round to make the model answer the findings. `adversaryModel` routes the critic to a separate model; the critic's tool allowlist is read-only by default. Findings ride the durable `doublecheck-review` message source. The review re-arms after the critic settles: implementation edits after the latest review record trigger another round, and cancelling the turn aborts the in-flight critic.
|
|
131
|
-
- 🚦 **Delivery quality gate** (v0.7) — the configurable four-phase checklist above: requirements interrogation (key questions confirmed item by item), test evidence (run color, failing cases, coverage threshold), implementation consistency (diff ↔ requirement mapping by a local reviewer), and the review conclusion (dsh-auto-review verdict records with an honest local degrade). One **deliverable / rework required** decision, red items with rework suggestions, a plan-mode re-check suggestion on red, a turn-boundary red notice (short, once per session), and the PR-ready markdown report.
|
|
132
|
-
- ⌨️ **`/gate` session command** — `status` renders the live checklist progress (deterministic phases fold on the spot; reviewer phases show the latest run), `run` settles the full gate and returns the report, `config` renders the effective checklist and thresholds.
|
|
133
|
-
- 🌐 **Fully localized model surface** — every model-visible string the package injects or answers with (reminders, deny/ask feedback, review steering, gate notices, switch notices, `/doublecheck` and `/gate` replies, and the reviewer task prompts) honors `language: 'en' | 'zh'`; the workspace spec/report/gate documents keep their stable English headings and audit ids.
|
|
134
|
-
- 📊 **Doublecheck report + verification workflow** (`doublecheck_report`, v0.4) — consolidates the session's discipline evidence (spec, red/green timeline, review findings, edits) into a delivery report with a derived verdict (`grill → draft → red → green → objections/verified → proven/challenged/unverified`), written to the workspace. With `verify`, per-dimension checkers run through DSH's workflow seam (`verifyMode: all` fans out one parallel checker per dimension; `single` runs one combined checker) and their verdicts fold into the report — `proven` requires a verdict for every dimension.
|
|
135
|
-
- 🚦 **Delivery gate** — at the turn boundary, a delivery that reached green with no `doublecheck_report` on record gets a report-expected reminder before completion claims; a successful report advances the stage fold to `verify`.
|
|
136
|
-
- 🔁 **Durable state** — every model-visible artifact (spec, reminders, deny feedback, review findings, gate runs, the `/doublecheck on|off` switch) lands in the session log; gate decisions derive from the log alone (`tool/call` + `tool/result`, including Code Mode sub-dispatches), so resumed and forked sessions enforce identically. `remindOnce` is durable too: a session that already received a reminder never gets it twice, even after a restart. The switch fold rides an incremental snapshot, so long sessions stay O(new events) per tool call.
|
|
137
|
-
- ⌨️ **`/doublecheck` session command** — `status` reports the effective switch, the configured modules, the enforcement intensity, the folded stage facts, and the latest gate verdict; `report` folds the delivery report on the spot; `on|off` writes the durable `doublecheck/state` override and injects a switch notice.
|
|
138
|
-
- 📚 **`doublecheck_skills` tool** — lists and loads the package's skills through the official skill registry seam.
|
|
139
|
-
- 🔒 **Strict overlay** — `strict.patch.yml` turns every gate on at `block` intensity and enables the coverage requirement (80%) in one patch layer (ships with the package).
|
|
140
|
-
- 🧩 **Standalone invariant companion** — the `dsh-doublecheck/invariant` row is a real subpath export: it reports package-owned write-path contradictions (spec/report/review/gate shape and verdict consistency) through the host `invariants` registry without loading the guard.
|
|
141
|
-
|
|
142
|
-
## Demo
|
|
143
|
-
|
|
144
|
-
A real headless run with `intensity: block` and every gate enabled, transcript recorded from the durable session log:
|
|
145
|
-
|
|
146
|
-
```sh
|
|
147
|
-
dsh --profile demo headless "把这个项目里最慢的代码直接改快,别问我任何问题,直接改文件。"
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
1. **grill** blocks the first edit — no spec on record:
|
|
151
|
-
`Error: Blocked by the dsh-doublecheck requirements guard: the task statement is vague and no doublecheck_spec exists for this session.`
|
|
152
|
-
2. The model records the spec (`doublecheck_spec`), writes a failing test (test files are always editable), and runs it — the log records `[exit code: 1]`, the red step.
|
|
153
|
-
3. Implementation edits now pass; a later run records `4 passed`, the green step.
|
|
154
|
-
4. The forked critic audits the delivery; its severity-tagged findings are injected, and `warn`/`block` steer one round so the model answers them.
|
|
155
|
-
5. `doublecheck_report` folds everything into a markdown report with a derived verdict — `proven` when every per-dimension verification check passes, `challenged` when a checker objects.
|
|
156
|
-
6. **`/gate run`** settles the four-phase checklist into the **deliverable / rework required** decision; a red verdict lists the red items with rework suggestions and suggests a plan-mode re-check.
|
|
157
|
-
|
|
158
|
-
## Install
|
|
159
|
-
|
|
160
|
-
```sh
|
|
161
|
-
dsh plugin --profile <name> add dsh-doublecheck
|
|
162
|
-
dsh --profile <name> --dump-config # expect a "# == dsh-doublecheck" layer
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Both plugin rows activate automatically with the profile. Tarball installs work too:
|
|
166
|
-
|
|
167
|
-
```sh
|
|
168
|
-
pnpm pack
|
|
169
|
-
dsh plugin --profile <name> add ./dsh-doublecheck-0.7.0.tgz
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
Git installs need no npm:
|
|
173
|
-
|
|
174
|
-
```sh
|
|
175
|
-
dsh plugin --profile <name> add "github:PerryLink/dsh-doublecheck#v0.7.0"
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
For a zero-configuration strict mode (every gate on, `block` intensity, gate coverage required), apply the shipped overlay on top of the bundle patch:
|
|
179
|
-
|
|
180
|
-
```sh
|
|
181
|
-
dsh --profile <name> --patch ./node_modules/dsh-doublecheck/strict.patch.yml
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
## Uninstall
|
|
185
|
-
|
|
186
|
-
```sh
|
|
187
|
-
dsh plugin --profile <name> remove dsh-doublecheck
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
To keep the package installed but disable one row, override it by id with `disabled: true` in the profile's `cordis.patch.yml` (`doublecheck-grill` / `doublecheck-guard`).
|
|
191
|
-
|
|
192
|
-
## Compatibility
|
|
193
|
-
|
|
194
|
-
- Verified against the `0.1.0-rc.6` peers (`@deepseek-ai/cordis ^4.0.1`); last verified 2026-08-14 on Windows with Node 22.
|
|
195
|
-
- The durable session writes (`/doublecheck on|off` → `doublecheck/state`, `/gate run` → `doublecheck/gate`) need the host's `ignorable` append surface (post-rc.6 harness): on rc.6 hosts the options bag is ignored and the event stays required-on-read, so the switch stays in-memory and the gate record lives in the command result + workspace file only, until the harness is upgraded.
|
|
196
|
-
- The `doublecheck.gate` settings namespace registers only when the harness settings service is mounted; profiles without it simply have no settings surface.
|
|
197
|
-
- The `plan mode:` line of `/gate status` reads the optional `ctx.planMode` service; profiles without it show `unknown`.
|
|
198
|
-
|
|
199
191
|
## Permissions & data
|
|
200
192
|
|
|
201
193
|
- **Reads**: the session log (`tool/call` / `tool/result` / `tool/code-dispatch`, injected `user/message` sources, and the foreign `autoReview/*` verdict records) in-process only; the optional plan-mode service state.
|
|
202
|
-
- **Writes**: `doublecheck-spec.md`, `doublecheck-report.md`, and `gate-report.md` in the session workspace (paths configurable)
|
|
203
|
-
- **Model calls**: the gate's consistency and local-review phases (one subagent each per `/gate run`), the optional adversary review
|
|
204
|
-
- **Never touched**: credentials, environment variables, or any file outside the session workspace. Gate reports
|
|
194
|
+
- **Writes**: `doublecheck-spec.md`, `doublecheck-report.md`, and `gate-report.md` in the session workspace (paths configurable) through the `ctx.fs` seam; the durable `doublecheck/state` and `doublecheck/gate` session events.
|
|
195
|
+
- **Model calls**: the gate's consistency and local-review phases (one subagent each per `/gate run`), the optional adversary review, and the `doublecheck_report` verification workflow start subagent runs; nothing else calls a model or the network.
|
|
196
|
+
- **Never touched**: credentials, environment variables, or any file outside the session workspace. The workshop manifest declares `filesystem:read` and `filesystem:write` only. Gate reports carry counts, ids, and verdicts only; recognized secrets in reviewer texts are redacted before storage or display.
|
|
205
197
|
|
|
206
|
-
##
|
|
207
|
-
|
|
208
|
-
| Symptom | Cause and fix |
|
|
209
|
-
|---|---|
|
|
210
|
-
| No `# == dsh-doublecheck` layer in `--dump-config` | The bundle patch is missing or a row is `disabled` — check the profile patch order and row ids. |
|
|
211
|
-
| The gates never react | Run `/doublecheck status`: the session switch may be off, or every `modules.*` entry is false in the guard row. |
|
|
212
|
-
| "Adversary review did not run: the subagents seam is not mounted" | This profile composition provides no subagent provider — mount one (spine compositions do) or disable `modules.adversary`. |
|
|
213
|
-
| `doublecheck_report` shows `verification: null` | The `workflowEngine` seam is missing or the run was rejected/aborted — the report states this instead of guessing. |
|
|
214
|
-
| The report says `unverified` | Verification ran but not every spec dimension returned a verdict — re-run with `verify: true`; `proven` requires all six. |
|
|
215
|
-
| `/gate run` shows `Review conclusion — WARN: dsh-auto-review is not installed` | Expected degrade: the engine row is not in this profile. Install `dsh-auto-review`, or set `gate.review.engine: local` to skip the detection. |
|
|
216
|
-
| `/gate run` shows `Implementation consistency — SKIP` | The `subagents` seam is missing (or the run timed out) — mount a subagent provider; the gate never fakes a verdict. |
|
|
217
|
-
| `/gate status` shows `plan mode: unknown` | The profile has no plan-mode service mounted; the suggestion still appears in the report and the turn notice. |
|
|
218
|
-
| The gate record is not in the session log | This rc.6 host does not stamp the `ignorable` marker — the record lives in the command result and `gate-report.md` only. |
|
|
219
|
-
|
|
220
|
-
## Configure
|
|
221
|
-
|
|
222
|
-
Override any row **by id** in the profile's `cordis.patch.yml`. A patch replaces the row's whole config — restate every key:
|
|
223
|
-
|
|
224
|
-
```yaml
|
|
225
|
-
- id: doublecheck-grill
|
|
226
|
-
config:
|
|
227
|
-
specFile: 'specs/doublecheck-spec.md' # default: 'doublecheck-spec.md'
|
|
228
|
-
reportFile: 'specs/doublecheck-report.md' # default: 'doublecheck-report.md'
|
|
229
|
-
reportVerify: true # run the verify workflow by default
|
|
230
|
-
verifyProvider: 'fork' # provider for the per-dimension checkers
|
|
231
|
-
reportTestToolNames: ['bash', 'pwsh']
|
|
232
|
-
reportTestCommandPatterns:
|
|
233
|
-
- '(?:^|[;&|]\s*)(?:(?:pnpm|npm|npx|yarn|bun)(?:\s+run)?\s+(?:test|vitest|jest|mocha)(?:\s|$))'
|
|
234
|
-
- '(?:^|[;&|]\s*)(?:(?:pytest|go\s+test|cargo\s+test|make\s+test|ctest)(?:\s|$))'
|
|
235
|
-
- '(?:^|[;&|]\s*)(?:node\s+--test(?:\s|$))'
|
|
236
|
-
- '(?:^|[;&|]\s*)(?:deno\s+test|uv\s+run\s+pytest)(?:\s|$)'
|
|
237
|
-
reportMutationTools: ['edit', 'write']
|
|
238
|
-
reportTestFilePatterns:
|
|
239
|
-
- '(^|[\\/])(tests?|__tests__|specs?)([\\/]|$)'
|
|
240
|
-
- '\\.(test|spec)\\.[A-Za-z0-9]+$'
|
|
241
|
-
|
|
242
|
-
- id: doublecheck-guard
|
|
243
|
-
config:
|
|
244
|
-
intensity: warn
|
|
245
|
-
modules:
|
|
246
|
-
grill: true
|
|
247
|
-
tdd: true # red/green evidence gates (v0.2)
|
|
248
|
-
adversary: true # forked critic review (v0.3)
|
|
249
|
-
adversaryModel: null # or e.g. 'deepseek-v4-pro' for a separate critic model
|
|
250
|
-
adversaryProvider: 'fork' # subagent provider the critic runs on
|
|
251
|
-
adversaryMaxFindings: 5 # findings cap injected into the session
|
|
252
|
-
adversaryTools: ['read', 'glob', 'grep'] # critic tool allowlist (read-only)
|
|
253
|
-
adversaryTimeoutMs: 120000 # hard budget for one critic run
|
|
254
|
-
guardTools: ['edit', 'write']
|
|
255
|
-
vagueTaskMaxChars: 200
|
|
256
|
-
remindOnce: true
|
|
257
|
-
testToolNames: ['bash', 'pwsh']
|
|
258
|
-
testCommandPatterns:
|
|
259
|
-
- '(?:^|[;&|]\s*)(?:(?:pnpm|npm|npx|yarn|bun)(?:\s+run)?\s+(?:test|vitest|jest|mocha)(?:\s|$))'
|
|
260
|
-
- '(?:^|[;&|]\s*)(?:(?:pytest|go\s+test|cargo\s+test|make\s+test|ctest)(?:\s|$))'
|
|
261
|
-
- '(?:^|[;&|]\s*)(?:node\s+--test(?:\s|$))'
|
|
262
|
-
- '(?:^|[;&|]\s*)(?:deno\s+test|uv\s+run\s+pytest)(?:\s|$)'
|
|
263
|
-
testFilePatterns:
|
|
264
|
-
- '(^|[\\/])(tests?|__tests__|specs?)([\\/]|$)'
|
|
265
|
-
- '\\.(test|spec)\\.[A-Za-z0-9]+$'
|
|
266
|
-
gate:
|
|
267
|
-
enabled: true
|
|
268
|
-
planSuggestion: true
|
|
269
|
-
reportFile: 'gate-report.md'
|
|
270
|
-
requirements:
|
|
271
|
-
enabled: true
|
|
272
|
-
checklist:
|
|
273
|
-
- { id: goal, question: 'What outcome must the delivery produce?', specDimension: goal, required: true }
|
|
274
|
-
- { id: scope, question: 'What is in scope, and what is out of scope?', specDimension: scope, required: true }
|
|
275
|
-
- { id: acceptance, question: 'Which observable checks prove the work is done?', specDimension: acceptanceCriteria, required: true }
|
|
276
|
-
- { id: failureModes, question: 'What can go wrong, and what is the correct behavior in each case?', specDimension: failureModes, required: true }
|
|
277
|
-
- { id: priorities, question: 'What is traded when goals conflict; what is optional?', specDimension: priorities, required: true }
|
|
278
|
-
- { id: nonGoals, question: 'What does the user explicitly not want?', specDimension: nonGoals, required: true }
|
|
279
|
-
minConfirmed: 6
|
|
280
|
-
interrogateTool: 'ask_user_question'
|
|
281
|
-
tests:
|
|
282
|
-
enabled: true
|
|
283
|
-
requirePassingRun: true
|
|
284
|
-
allowFailingRuns: 0
|
|
285
|
-
requireCoverage: false
|
|
286
|
-
minCoveragePct: 80
|
|
287
|
-
coveragePattern: 'coverage[^\d]{0,40}(\d+(?:\.\d+)?)\s*%'
|
|
288
|
-
consistency:
|
|
289
|
-
enabled: true
|
|
290
|
-
provider: fork
|
|
291
|
-
model: null
|
|
292
|
-
tools: ['read', 'glob', 'grep']
|
|
293
|
-
timeoutMs: 120000
|
|
294
|
-
maxFindings: 5
|
|
295
|
-
review:
|
|
296
|
-
enabled: true
|
|
297
|
-
engine: auto # auto = dsh-auto-review verdict records, else local
|
|
298
|
-
provider: fork
|
|
299
|
-
model: null
|
|
300
|
-
tools: ['read', 'glob', 'grep']
|
|
301
|
-
timeoutMs: 120000
|
|
302
|
-
maxFindings: 5
|
|
303
|
-
```
|
|
198
|
+
## Security boundaries
|
|
304
199
|
|
|
305
|
-
|
|
200
|
+
- **Model-visible ⟺ logged.** Every injected reminder, review, and gate notice rides the standard channels and lands in the session log; the durable spec/state/gate facts ride tool results or `SessionEventMap` members.
|
|
201
|
+
- **Fail closed / fail loud.** Guard and gate config are validated in `apply` (assertions throw); a reviewer or adversary seam that cannot run settles as an honest "unavailable"/skip notice instead of a fake verdict.
|
|
202
|
+
- **Audit-safe reports.** Gate and delivery reports record counts, ids, and verdicts only — no file contents or session text — and model-produced finding texts pass a secret redactor before storage or display.
|
|
203
|
+
- **No network of its own.** The plugin makes no direct network requests; the critic and reviewer subagents ride the harness subagent seam.
|
|
204
|
+
- **Weak dependency on dsh-auto-review.** It is never imported or hard-required; the gate folds its durable verdict records and degrades to the local reviewer, and never synthesizes approval requests.
|
|
306
205
|
|
|
307
|
-
|
|
206
|
+
## Known limitations
|
|
308
207
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
| `warn` | Call is held for one-time human approval via the approval seam (denies when no channel exists). |
|
|
313
|
-
| `block` | Call is denied with feedback directing the model to fix the discipline first. |
|
|
208
|
+
- **Durable writes.** `/doublecheck on\|off` → `doublecheck/state` and `/gate run` → `doublecheck/gate` ride the host's `ignorable` append surface (post-rc.6), which every supported host (≥ `0.1.0-rc.8`) provides.
|
|
209
|
+
- **Optional seams.** The `doublecheck.gate` settings namespace registers only when the settings service is mounted; the `/gate status` plan-mode line reads the optional `ctx.planMode` (shows `unknown` without it); the adversary review needs `ctx.subagents`; verification needs `workflowEngine`.
|
|
210
|
+
- **Local degrade.** `gate.review.engine: auto` degrades to the local reviewer when dsh-auto-review is absent or has no verdict records this session — the report names the reason instead of inventing a verdict.
|
|
314
211
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
| Key | Default | Meaning |
|
|
318
|
-
|---|---|---|
|
|
319
|
-
| `modules.grill` | `true` | Off disables the grill gate. The grill skill/tools switch is their row's `disabled` flag. |
|
|
320
|
-
| `modules.tdd` | `true` | On enables the red/green evidence gates (v0.2); enabled by default since v0.5. |
|
|
321
|
-
| `modules.adversary` | `false` | On enables the forked critic review at green (v0.3); uses the `ctx.subagents` seam — a missing seam settles as an "unavailable" notice. |
|
|
322
|
-
| `enableByDefault` | `true` | Master switch for sessions without a `/doublecheck on|off` record. |
|
|
323
|
-
| `language` | `'en'` | Injected reminder/deny/review/gate prose language (`en` / `zh`). |
|
|
324
|
-
| `guardTools` | `['edit', 'write']` | Mutation tool names both gates watch. |
|
|
325
|
-
| `vagueTaskMaxChars` | `200` | Longer tasks are never treated as vague. Brief tasks naming a file, path, URL, an underscore keyword, or a hyphenated keyword are concrete. |
|
|
326
|
-
| `remindOnce` | `true` | Inject each gate's reminder at most once per session — durable across restarts (folded from the log). |
|
|
327
|
-
| `testToolNames` | `['bash', 'pwsh']` | Shell tool names that can run tests. |
|
|
328
|
-
| `testCommandPatterns` | *(pnpm/npm/yarn/bun test, pytest, go/cargo/make test, node --test, deno test, uv run pytest)* | Regexes a command must match to count as a test run. |
|
|
329
|
-
| `testFilePatterns` | *(test dirs, `*.test.*` / `*.spec.*`)* | Regexes identifying test files — always editable, exempt from the red gate. |
|
|
330
|
-
| `adversaryModel` | `null` | Critic model route; `null` = main model self-reviews. |
|
|
331
|
-
| `adversaryProvider` | `'fork'` | Subagent provider name the critic runs on. |
|
|
332
|
-
| `adversaryMaxFindings` | `5` | Findings cap (1–20) injected into the session. |
|
|
333
|
-
| `adversaryTools` | `['read', 'glob', 'grep']` | Critic tool allowlist; keep it read-only. |
|
|
334
|
-
| `adversaryTimeoutMs` | `120000` | Hard time budget for one critic run. |
|
|
335
|
-
|
|
336
|
-
Misconfiguration fails loud: an invalid regex, an empty/duplicated name list, or an out-of-range findings cap throws at load instead of silently doing nothing. A critic that cannot run (seam missing, provider failure, timeout) settles as an honest "unavailable" notice in the session.
|
|
337
|
-
|
|
338
|
-
### Report knobs (grill row)
|
|
339
|
-
|
|
340
|
-
| Key | Default | Meaning |
|
|
341
|
-
|---|---|---|
|
|
342
|
-
| `reportFile` | `'doublecheck-report.md'` | Workspace file receiving the report markdown. |
|
|
343
|
-
| `reportVerify` | `true` | Default for the tool's `verify` flag. |
|
|
344
|
-
| `verifyProvider` | `'fork'` | Subagent provider the per-dimension checkers run on. |
|
|
345
|
-
| `verifyMode` | `'all'` | `all` = one parallel checker per dimension; `single` = one combined checker (one subagent, cheaper). |
|
|
346
|
-
| `reportTestToolNames` / `reportTestCommandPatterns` | *(same defaults as the guard row)* | Report-scoped test-run classification. |
|
|
347
|
-
| `reportMutationTools` / `reportTestFilePatterns` | *(same defaults as the guard row)* | Report-scoped implementation-edit classification. |
|
|
348
|
-
|
|
349
|
-
The report's classification knobs are independent of the guard's: gate enforcement and report folding can be tuned separately without one silently changing the other. Verification degrades honestly: a missing `workflowEngine` seam or a rejected run leaves `verification: null` and the markdown says so.
|
|
350
|
-
|
|
351
|
-
### Gate knobs (guard row)
|
|
352
|
-
|
|
353
|
-
| Key | Default | Meaning |
|
|
354
|
-
|---|---|---|
|
|
355
|
-
| `gate.enabled` | `true` | Master switch for the gate panel and the turn-boundary red notice. |
|
|
356
|
-
| `gate.planSuggestion` | `true` | Append the plan-mode re-check suggestion to red reports and panels. |
|
|
357
|
-
| `gate.reportFile` | `'gate-report.md'` | Workspace file receiving the gate report. |
|
|
358
|
-
| `gate.requirements.enabled` | `true` | Off skips the requirements phase. |
|
|
359
|
-
| `gate.requirements.checklist` | *(six spec-dimension questions)* | The pluggable key-question checklist: `{ id, question, specDimension, required }`. `specDimension: null` renders as a manual-confirm warning; failed optional questions are warnings, not red lights. |
|
|
360
|
-
| `gate.requirements.minConfirmed` | `6` | Minimum required questions that must pass (1..required count). |
|
|
361
|
-
| `gate.requirements.interrogateTool` | `'ask_user_question'` | Tool name whose calls count as interrogation evidence. |
|
|
362
|
-
| `gate.tests.enabled` | `true` | Off skips the test-evidence phase. |
|
|
363
|
-
| `gate.tests.requirePassingRun` | `true` | A non-passing (or missing) latest test run is a red light. |
|
|
364
|
-
| `gate.tests.allowFailingRuns` | `0` | Failing runs after the latest green allowed before red. |
|
|
365
|
-
| `gate.tests.requireCoverage` | `false` | On requires coverage evidence in the test output. |
|
|
366
|
-
| `gate.tests.minCoveragePct` | `80` | Minimum coverage percentage (0–100). |
|
|
367
|
-
| `gate.tests.coveragePattern` | `coverage…(\d+…)%` | Regex with one capture group parsing the coverage percentage (compiled case-insensitively). |
|
|
368
|
-
| `gate.consistency.enabled` | `true` | Off skips the diff ↔ requirement mapping phase. |
|
|
369
|
-
| `gate.consistency.provider` / `.model` / `.tools` / `.timeoutMs` / `.maxFindings` | `fork` / `null` / `read,glob,grep` / `120000` / `5` | The local consistency reviewer's knobs (model `null` = main model). |
|
|
370
|
-
| `gate.review.enabled` | `true` | Off skips the review conclusion. |
|
|
371
|
-
| `gate.review.engine` | `'auto'` | `auto` = dsh-auto-review verdict records when present, else the local reviewer; `local` = always the local reviewer. |
|
|
372
|
-
| `gate.review.provider` / `.model` / `.tools` / `.timeoutMs` / `.maxFindings` | *(same as consistency)* | The local review reviewer's knobs. |
|
|
373
|
-
|
|
374
|
-
Gate configuration is validated fail-loud at load (duplicate ids, unknown spec dimensions, out-of-range thresholds, invalid regexes, empty tool lists throw), and the checklist is exposed through the `doublecheck.gate` settings namespace when the settings service is mounted. The gate never synthesizes approval requests; the local reviewers are read-only by default.
|
|
375
|
-
|
|
376
|
-
## How it works (extension points)
|
|
377
|
-
|
|
378
|
-
| Contribution | DSH mechanism |
|
|
379
|
-
|---|---|
|
|
380
|
-
| Bundled skills | `ctx.skills.registerProvider()` — skill capability seam, `source: bundled` |
|
|
381
|
-
| Catalog/loader tool | `ctx.tools.register()` — `doublecheck_skills` |
|
|
382
|
-
| Spec commit + workspace file | `doublecheck_spec` tool + `ctx.fs` write (optional) |
|
|
383
|
-
| Requirements gate | `tools/pre-execute` waterfall — `allow` / `ask` (approval seam) / `deny` |
|
|
384
|
-
| Red gate | `tools/pre-execute` waterfall — hard check of failing-test evidence before implementation edits |
|
|
385
|
-
| Reminder injection | `tools/post-execute` waterfall — `additionalContexts` → logged as `user/message` |
|
|
386
|
-
| Green gate | `agent/turn-stopping` serial — injects a completion reminder when edits lack a passing run |
|
|
387
|
-
| Adversary review | `ctx.subagents.start()` — forked critic with structured findings schema, injected at green; `warn`/`block` steer one round |
|
|
388
|
-
| Delivery report | `doublecheck_report` tool — session-log fold + workspace markdown |
|
|
389
|
-
| Verification workflow | `ctx.workflowEngine.start()` — one parallel checker per spec dimension, structured checks |
|
|
390
|
-
| Gate deterministic phases | pure session-log folds — key-question checklist vs the committed spec; test-run/coverage evidence |
|
|
391
|
-
| Gate reviewer phases | `ctx.subagents.start()` — consistency mapper + local reviewer, structured findings, read-only tools |
|
|
392
|
-
| Engine review | durable `autoReview/verdict` / `autoReview/rejection` folds + `ctx.commands.list()` presence probe (weak dependency, no import) |
|
|
393
|
-
| Plan-mode suggestion | report/panel prose + once-per-session turn notice; `ctx.planMode` read for the status line (optional) |
|
|
394
|
-
| `/gate` command | `ctx.commands.register()` — `status|run|config`; `run` writes the durable `doublecheck/gate` event + `gate-report.md` |
|
|
395
|
-
| Settings surface | `ctx.settings.register('doublecheck.gate', schema, { expose: true, applies: 'restart' })` when mounted |
|
|
396
|
-
| Durable state | session log fold over `tool/call` + `tool/result` + `tool/code-dispatch` + injected structured sources + `doublecheck/state` + `doublecheck/gate`; model-visible ⟺ logged |
|
|
397
|
-
| Session command | `ctx.commands.register()` — `/doublecheck status|report|on|off`; `on|off` writes the durable `doublecheck/state` session event |
|
|
398
|
-
| Session projection | `sessionProjections` registry — `doublecheck` view now carries `gateVerdict` + `gateRedCount` (stateVersion 2) |
|
|
399
|
-
| Internal events | `doublecheck/spec`, `doublecheck/reminder`, `doublecheck/review`, `doublecheck/report`, `doublecheck/gate` (typed via declaration merging, `@mode emit`) |
|
|
400
|
-
|
|
401
|
-
No agent-loop changes. Every registration is a reversible `ctx.effect` / `ctx.on` / service `register()`.
|
|
402
|
-
|
|
403
|
-
## What the model sees
|
|
404
|
-
|
|
405
|
-
- The `grill-requirements` skill joins the session skill catalog and loads through the built-in `skill` tool (or `doublecheck_skills`).
|
|
406
|
-
- `ask_user_question` stays the native DSH way to interrogate the user; the skill only choreographs it (and degrades to prose questions in headless runs with no provider).
|
|
407
|
-
- Reminders arrive as `{kind:'plugin'}` context, so transcript UIs present them as injection metadata.
|
|
408
|
-
- The adversary critique arrives the same way after the critic settles, with severity-tagged findings; under `warn`/`block` the loop is steered one round so the model answers them.
|
|
409
|
-
- `doublecheck_report` returns the consolidated report as a tool result (spec, test timeline, review, verification, verdict), so "prove the delivery" is one call away.
|
|
410
|
-
- The gate-red turn notice arrives as `{kind:'doublecheck-gate'}` context — one short role-statement sentence plus the red count and the plan-mode suggestion.
|
|
411
|
-
- `/doublecheck` and `/gate` answer in the transcript directly: `status` shows the switch, modules, intensity, stage facts, and the latest gate verdict; `report` prints the folded report; `on|off` flips the session switch; `/gate run` returns the PR-ready gate report.
|
|
412
|
-
|
|
413
|
-
## Session commands
|
|
414
|
-
|
|
415
|
-
```
|
|
416
|
-
/doublecheck status|report|on|off
|
|
417
|
-
/gate status|run|config
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
- `/doublecheck status` — effective switch (durable override beats the config default), configured modules, enforcement intensity, the folded stage facts (spec committed, red/green color, review on record, edit count), and the latest gate verdict.
|
|
421
|
-
- `/doublecheck report` — folds the delivery report from the session log on the spot (no verification workflow; `doublecheck_report` owns that path).
|
|
422
|
-
- `/doublecheck on|off` — writes the durable `doublecheck/state` event (survives restart, resume, and fork — replay IS the state) and injects a model-visible switch notice.
|
|
423
|
-
- `/gate status` — the live checklist progress: deterministic phases fold on the spot, reviewer phases and the verdict show the latest `doublecheck/gate` run, plus the plan-mode state.
|
|
424
|
-
- `/gate run` — settles the full four-phase checklist (deterministic folds + two local reviewer forks in parallel; the engine's verdict records when present), writes the durable `doublecheck/gate` event and `gate-report.md`, and returns the report markdown.
|
|
425
|
-
- `/gate config` — renders the effective checklist, thresholds, and reviewer knobs.
|
|
426
|
-
|
|
427
|
-
All command replies honor the guard row's `language` setting; the report documents keep their stable English headings and audit ids.
|
|
428
|
-
|
|
429
|
-
## Roadmap
|
|
430
|
-
|
|
431
|
-
The discipline loop and the delivery gate both ship: **grill → design → red → green → review → verify** (v0.1 → v0.6) plus the **four-phase quality gate with the deliverable/rework decision** (v0.7). Real-transcript regression fixtures pin the durable event shapes (`tests/fixtures/`). Future work: a Web-UI settings tab and gate badge for the `doublecheck` projection, richer report formatting, and cross-session spec seeding from the workspace file.
|
|
432
|
-
|
|
433
|
-
## Develop
|
|
212
|
+
## Development
|
|
434
213
|
|
|
435
214
|
```sh
|
|
436
|
-
pnpm install
|
|
437
|
-
pnpm run
|
|
438
|
-
pnpm run
|
|
439
|
-
pnpm run test
|
|
440
|
-
pnpm run
|
|
215
|
+
pnpm install # node ^22.19 || >=24
|
|
216
|
+
pnpm run build # tsc --noEmitOnError (lib/ is committed)
|
|
217
|
+
pnpm run prepare # tsc --noEmitOnError (git-install channel)
|
|
218
|
+
pnpm run prepublishOnly # build + full test suite
|
|
219
|
+
pnpm run typecheck # tsc --noEmit + tests tsconfig
|
|
220
|
+
pnpm run lint # eslint src tests
|
|
221
|
+
pnpm test # vitest run
|
|
222
|
+
pnpm run test:coverage # vitest run --coverage
|
|
223
|
+
pnpm run pack:check # build + pack the tarball
|
|
441
224
|
```
|
|
442
225
|
|
|
443
|
-
##
|
|
226
|
+
## Topics
|
|
444
227
|
|
|
445
|
-
|
|
228
|
+
`dsh`, `dsh-plugin`, `deepseek-harness`, `engineering-discipline`, `requirements`, `guard`, `skill`, `quality-gate`, `delivery-gate`
|
|
446
229
|
|
|
447
230
|
## Contributors
|
|
448
231
|
|
|
449
|
-
- [PerryLink](https://github.com/PerryLink) —
|
|
450
|
-
|
|
451
|
-
Issues, pull requests, and Discussions are all welcome — entry points are at the top of this document.
|
|
232
|
+
- [@PerryLink](https://github.com/PerryLink) — creator and maintainer: the grill → design → red → green → review → verify discipline loop, the four-phase delivery gate, the five-language docs, and the CI/release pipeline.
|
|
452
233
|
|
|
453
234
|
## PerryLink DSH Plugin Family
|
|
454
235
|
|
|
@@ -474,4 +255,4 @@ This project is one of the [15 DeepSeek Harness plugins](https://github.com/Perr
|
|
|
474
255
|
|
|
475
256
|
## License
|
|
476
257
|
|
|
477
|
-
[Apache
|
|
258
|
+
[Apache License 2.0](LICENSE) © 2026 dsh-doublecheck contributors
|