@kangyishuai/dsh-next-step 0.4.2 → 0.5.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/README.md +37 -30
- package/README.zh-CN.md +38 -31
- package/lib/client.js +462 -34
- package/lib/events.js +1 -1
- package/lib/followup.js +205 -0
- package/lib/gates.js +14 -1
- package/lib/generate-status.js +107 -0
- package/lib/inflight.js +141 -0
- package/lib/prompt.js +268 -9
- package/lib/report.js +122 -10
- package/lib/scheme.js +1 -1
- package/lib/service.js +422 -143
- package/lib/session-records.js +53 -0
- package/lib/settings.js +28 -10
- package/lib/turn-dispatch.js +49 -0
- package/lib/write-plan.js +25 -0
- package/locale/en.json +13 -0
- package/locale/zh.json +13 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> A next-step decision card for DeepSeek Harness: after a completed answer that looks worth continuing, a compact card shows where the conversation stands, the question you need to settle, and 1–2 mutually exclusive proposals. Click one and that pill's text — exactly as written on it — is sent as your user message. **How often cards appear is a switch you own** (strict / balanced / eager); when one is withheld, a one-click button reveals the candidate the plugin already computed, with no second model call. It also keeps a **local review log** so the thresholds, the wording and the buttons can be tuned against evidence instead of vibes. Optionally — off by default — a grey ghost hint in the empty composer offers the next prompt, accepted with `Tab` or `→`.
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@kangyishuai/dsh-next-step) [](https://www.npmjs.com/package/@kangyishuai/dsh-next-step) [](#compatibility) [](./LICENSE)
|
|
6
6
|
|
|
7
7
|
[中文](./README.zh-CN.md)
|
|
8
8
|
|
|
@@ -17,19 +17,19 @@ Unofficial plugin for [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/de
|
|
|
17
17
|
- **A card when there is something to continue — as often as _you_ want.** When a turn ends normally, the plugin makes one extra model call that asks the model to grade the turn on a three-level scale (`must` / `could` / `no`, with "when in doubt say `could`" written into the prompt). A setting decides which levels are shown: **Strict** (`must` only), **Balanced** (default: `must` + `could`) or **Eager** (everything, including `no` — an experimental calibration mode). The card itself is always computed; the tier only decides whether it is displayed. When it is shown, a decision card is appended below the answer: a one-to-three sentence **summary** of the conversation state (folded to two lines, with an expand/collapse control when it is longer), one **question** that names the decision you have to make, and **1–2 pills** for mutually exclusive directions (one is fine when the next step is obvious — no padding). Each pill carries the exact sentence that will be sent when you click it: **2–20 characters, verb-first, and it must name a concrete object from the conversation** (file, command, flag, version, PR number). Generic pills like “check whether the definition is accurate” are dropped — if none survive, no card is shown at all.
|
|
18
18
|
- **One click is one user message.** Clicking a pill puts that pill's own text into the composer and submits it through the same path as pressing Enter yourself — not by faking a session event. An idle session sends immediately; if a turn is already running, the text is queued exactly like a typed message.
|
|
19
19
|
- **It stays.** Cards and decisions are appended to the session log as plugin records and folded by a session projection, which is the only source of truth. A page reload, a session switch or an app restart brings them back; the client keeps no separate state.
|
|
20
|
-
- **Resolved, not removed.** After you click, the card stays in the transcript but becomes read-only: summary and question remain, the pills are replaced by the one you picked in a selected state (✓ plus its text), followed by a grey “sent” line. Cards from earlier turns
|
|
20
|
+
- **Resolved, not removed — and not noise.** After you click, the card stays in the transcript but becomes read-only: summary and question remain, the pills are replaced by the one you picked in a selected state (✓ plus its text), followed by a grey “sent” line. **Cards from earlier turns that were never decided default to a single folded line** (“Earlier turn · first sentence of the summary”); the full summary stays in the hover title and in the session log. In the real usage data 82% of shown cards were never decided, so leaving every old card expanded meant the only way to stop the noise was to turn the feature off (audit AUD-NS-02). At most one card is interactive at a time. The ✕ in a card's corner dismisses it without sending anything.
|
|
21
21
|
- **Ghost hint in the composer (off by default).** The same model call also produces one next prompt. With the ghost face enabled, an empty idle composer shows it as grey, placeholder-style text. `Tab` or `→` accepts it into the draft (undoable with `Ctrl+Z`), `Esc` clears the current suggestion, typing makes it disappear, and it stays hidden while the composer holds a draft, an attachment, an `@` reference or a slash command. The ghost is not draft content, so pressing Enter on an otherwise empty composer sends nothing.
|
|
22
22
|
- **Two faces, one call.** Card and ghost are produced together by a single model call — turning the ghost on costs no additional requests.
|
|
23
23
|
- **Withheld cards are one click away, and free.** A turn whose card the tier withheld still gets the small “Generate a next-step card” button under the answer. Clicking it **reveals the candidate that was already computed** — no second model call, no 20-second wait. Only a turn that never produced a candidate (the call failed or timed out) actually calls the model again. Clicking that button is also the strongest evidence that the tier withheld something you wanted.
|
|
24
|
-
- **A local review log, so tuning has evidence.** Every eligible turn appends one line to `<dataRoot>/next-step/events.jsonl`: which gate decided, the three-level grade, latency, token usage, what you did with the card afterwards (clicked / dismissed / ignored / typed your own message / revealed it), and whether the card ever entered the viewport. Nothing is uploaded, and your message text is never written — only lengths, delays and how many concrete objects overlapped with a pill. From the settings section you can generate a Markdown report (kept: the latest 20) whose verdict sentences only appear once there are enough data points (80 turns / 25 cards).
|
|
24
|
+
- **A local review log, so tuning has evidence.** Every eligible turn appends one line to `<dataRoot>/next-step/events.jsonl`: which gate decided, the three-level grade, latency, token usage, what you did with the card afterwards (clicked / dismissed / ignored / typed your own message / revealed it / **walked away — no message for 15 minutes, recorded as `typed:false`**), and whether the card ever entered the viewport. Nothing is uploaded, and your message text is never written — only lengths, delays and how many concrete objects overlapped with a pill. **One exception: the pill labels the model generated are recorded verbatim** (the review has to look at the button wording; they are concrete objects lifted from the conversation, not your prose). From the settings section you can generate a Markdown report (kept: the latest 20) whose verdict sentences only appear once there are enough data points (80 turns / 25 cards).
|
|
25
25
|
- **Switches that actually stop requests.** `card` (default on) and `ghost` (default off) are separate switches; the global `enabled` switch off means no generation request at all, not just a hidden UI. A pause and a per-session card budget (`maxCardsPerSession`) stop new cards too. Cards already in the log stay readable.
|
|
26
26
|
|
|
27
27
|
## Cost & model calls
|
|
28
28
|
|
|
29
29
|
- One extra model call per trigger, on the model the session's agent is currently using (falling back to the default model selection), billed to your own provider quota.
|
|
30
|
-
- The call times out after 20 s. Other failures, rate limits and malformed JSON are silent:
|
|
30
|
+
- The call times out after 20 s. Other failures, rate limits and malformed JSON never write a card, but they are **no longer silent in the UI**: the generate button turns into “Try again” with a one-line reason, and “Details” expands the technical cause (`json:empty`, a host error, the timeout seconds). This also covers failures of the **automatic** generation — including after a page reload — because the host reports the last attempt for that turn (`nextStep/generateState`), and a generation that is still running shows a waiting state instead of a permanent “generating” note. The client waits for the server's own timeout plus a margin (30 s by default, at most 60 s); if the RPC itself hangs past that, the client **cancels the server-side generation** and says “Generation timed out. Try again”, so the UI never gives up while the call keeps running. Diagnostics still keep the counters and the raw “Last skipped” / last-error rows. **One recovery attempt is allowed, and it always carries the same conversation**: if the model returns an _empty_ answer the request is simply resent (an empty string is not a formatting problem — asking the model to "repair" nothing is how content-free cards used to get written); if it returns something malformed but non-empty, the repair request repeats the transcript and asks only for the format. A card that cannot point at anything in the conversation is dropped and counted as `ungrounded`. A **timeout or cancellation** is counted separately (the `aborted` counter plus a "Last skipped" reason such as `generation timeout after 20s`), and the generate button shows that reason with a “Try again” action — so this class stays diagnosable afterwards. **Sending your next message no longer aborts an in-flight generation**: that call runs to completion and is stored as a hidden candidate (`shown:false`), so no stale card is pushed into the transcript; it shows up as `superseded` in “Last skipped” and in the report's gate distribution (audit AUD-NS-01). **Be clear about what this buys:** it does **not** save tokens — aborting billed only what had already streamed, while running to completion bills the full output, so these calls now cost **more**; the gain is that a nearly-finished call is no longer thrown away and that cancellations become explainable in diagnostics and review. Such candidates do **not** count against `maxCardsPerSession`, never report an impression, and **cannot be revealed** (the generate button only works for the latest normally completed turn). Malformed output is dropped without writing a record.
|
|
31
31
|
- When the model grades the turn `no` (or `could`, and your tier is Strict), the candidate is stored but not shown — **the call still happens**: the tier saves UI noise, not tokens. Revealing a withheld candidate later costs nothing (no second call).
|
|
32
|
-
- The review log is a local append-only file that rotates at 2 MB (`events.jsonl` + one `.1` history). It contains no message text; it is on by default and can be switched off in the settings ("Local usage data").
|
|
32
|
+
- The review log is a local append-only file that rotates at 2 MB (`events.jsonl` + one `.1` history). It contains no message text, but it does record the generated pill labels verbatim (the review needs the button wording); it is on by default and can be switched off in the settings ("Local usage data").
|
|
33
33
|
- No other network access, no telemetry.
|
|
34
34
|
|
|
35
35
|
## Side effects & risks
|
|
@@ -41,7 +41,7 @@ Unofficial plugin for [DeepSeek Harness (DSH)](https://github.com/deepseek-ai/de
|
|
|
41
41
|
- **Private host seams.** The card renders through `conversation.chat.turnTail`; state comes from a host session projection read via `useProjection`; click-to-send uses the composer shell (`setDraft` / `submit`, waiting for the draft to settle before submitting); the ghost uses `conversation.input.overlay` and the host's placeholder DOM. These are internal, untyped and unversioned: a DSH upgrade can make the card, the send path or the ghost stop working **silently**. The plugin degrades instead of breaking a session, but after an upgrade run `pnpm probe:runtime` and the smoke suites, and check diagnostics.
|
|
42
42
|
- **The ghost is coupled to the host placeholder DOM**, which is why it ships off by default; if that DOM changes, the hint can simply disappear.
|
|
43
43
|
- **Silent failure is by design.** “No card appeared” is not an error dialog; look at the diagnostics counters before filing a bug. Timeouts and cancellations are the one exception worth knowing: they are labelled rather than lumped into a generic failure, because an unlabelled abort is what made one “no card” incident undiagnosable.
|
|
44
|
-
- **Writes two things under the data root.** (a) The existing session log gets one card record per generated card — including withheld candidates, so `shown` grows by at most one small record per eligible turn; (b) `<dataRoot>/next-step/events.jsonl` (review log, 2 MB rotation) plus `report-*.md` when you ask for one (the newest 20 are kept, older ones are deleted inside that plugin directory only). **No message text is ever written to the log
|
|
44
|
+
- **Writes two things under the data root.** (a) The existing session log gets one card record per generated card — including withheld candidates, so `shown` grows by at most one small record per eligible turn; (b) `<dataRoot>/next-step/events.jsonl` (review log, 2 MB rotation) plus `report-*.md` when you ask for one (the newest 20 are kept, older ones are deleted inside that plugin directory only). **No message text is ever written to the log** (pill labels are recorded verbatim — see above), and nothing leaves the machine.
|
|
45
45
|
- **Subagent sessions never get cards**, and only normally completed turns are eligible.
|
|
46
46
|
|
|
47
47
|
## Install
|
|
@@ -62,11 +62,11 @@ Re-run `pnpm pack` + `add` after changing the code. The plugin has a host half,
|
|
|
62
62
|
|
|
63
63
|
## Usage
|
|
64
64
|
|
|
65
|
-
**The card.** It appears under the last answer once that turn has completed, and it never steals focus. Each pill carries the exact sentence it will send; click it to send that sentence. If the summary is folded, use the small expand button to read it all. ✕ dismisses the card; earlier cards
|
|
65
|
+
**The card.** It appears under the last answer once that turn has completed, and it never steals focus. Each pill carries the exact sentence it will send; click it to send that sentence. If the summary is folded, use the small expand button to read it all. ✕ dismisses the card; earlier cards default to a single folded line (“Earlier turn · first sentence of the summary”) with the full summary on hover.
|
|
66
66
|
|
|
67
67
|
**Keyboard.** While the card is interactive, the composer is empty and the session is idle, `⌘↵` / `Ctrl+↵` sends the primary pill (same path as a click). When the composer holds a draft, an attachment, an open `@`/`/` menu, or a turn is running, the combination keeps its host Queue/Steer meaning — the plugin does not steal it.
|
|
68
68
|
|
|
69
|
-
**When no card appears.** A turn can end up without a visible card for two different reasons: the model graded it `no` (or `could` while your tier is Strict), in which case the card **already exists but is withheld**; or generation was skipped/failed (paused, messages queued, budget, timeout, bad output), in which case there is no candidate at all. In both cases a small “Generate a next-step card” button appears under the latest answer. For a withheld card, clicking it **reveals the stored candidate — instantly, with no second model call**; only when there is no candidate does it actually call the model again. So when you think a card should have appeared: check “Last skipped” in the settings diagnostics, and click that button.
|
|
69
|
+
**When no card appears.** A turn can end up without a visible card for two different reasons: the model graded it `no` (or `could` while your tier is Strict), in which case the card **already exists but is withheld**; or generation was skipped/failed (paused, messages queued, budget, timeout, bad output), in which case there is no candidate at all. In both cases a small “Generate a next-step card” button appears under the latest answer. For a withheld card, clicking it **reveals the stored candidate — instantly, with no second model call**; only when there is no candidate does it actually call the model again. If the last attempt failed (automatic or manual), the button reads **“Try again”** and shows a one-line reason with a “Details” toggle; a generation that is still running in the background shows “Still generating in the background…” and resolves to either the card or that failure — an `inflight` reply is never left as a permanent “generating” note. So when you think a card should have appeared: check “Last skipped” in the settings diagnostics, and click that button.
|
|
70
70
|
|
|
71
71
|
**The ghost hint.** Turn the ghost face on in the plugin settings. With an empty, idle composer you see the latest card's next prompt in grey, aligned with the host placeholder. `Tab` or `→` accepts it — the text lands in the draft and stays undoable. `Esc` clears it for this suggestion, and the first typed character hides it. It only ever edits the draft: it does not send, and it does not bind Enter.
|
|
72
72
|
|
|
@@ -81,9 +81,9 @@ The section opens with **three rows** — enable, **card frequency** (strict / b
|
|
|
81
81
|
- **Local usage data** — the review log switch (default on).
|
|
82
82
|
- **Ghost hint in the composer** — the second face's switch (default off).
|
|
83
83
|
- **Cadence** — “Pause for 1 hour” / “Resume”.
|
|
84
|
-
- **Per session, at most N cards** — the budget (`maxCardsPerSession`, clamped to 0–1000, default
|
|
84
|
+
- **Per session, at most N cards** — the budget (`maxCardsPerSession`, clamped to 0–1000, default **60**). It only counts cards that were _shown_; withheld candidates do not consume it. The default dropped from 120 to 60 because real usage peaked at 80 cards in a session and the 120 limit was never hit (the budget gate never fired); an existing settings file whose value is **exactly 120** follows the new default on upgrade, while any other value you chose is left alone.
|
|
85
85
|
- **Review** — the four numbers that matter (card rate / click-through / ignore rate / misses), a one-line verdict when the sample is big enough, and a **“Generate report”** button that writes `report-YYYYMMDD-HHmmss.md` next to the log.
|
|
86
|
-
- **Diagnostics** — generated (with how many were withheld) / failed / aborted / skipped / in-flight counters, the **reason the last card was skipped** (model judged unnecessary / queued / paused / budget / failure / timeout / cancelled, with the model's own sentence), the last error, the runtime **version + build hash**, and a Refresh button. `nextStep/diagnostics` returns the same `version` / `buildHash` / `buildFiles` / `packagePath`, so a running build can be matched against `dsh plugin list` or the npm tarball without digging through startup logs. Caveat: `buildHash` covers `package.json`, and pnpm rewrites it during a `file:` install — in that case compare against the installed copy, not the repo (see [docs/testing §4.5](../../docs/testing/next-step.md)).
|
|
86
|
+
- **Diagnostics** — generated (with how many were withheld) / failed / aborted / skipped / in-flight counters, the **reason the last card was skipped** (model judged unnecessary / queued / paused / budget / failure / timeout / cancelled / you already started the next turn, with the model's own sentence), the last error, the runtime **version + build hash**, and a Refresh button. `nextStep/diagnostics` returns the same `version` / `buildHash` / `buildFiles` / `packagePath`, so a running build can be matched against `dsh plugin list` or the npm tarball without digging through startup logs. Caveat: `buildHash` covers `package.json`, and pnpm rewrites it during a `file:` install — in that case compare against the installed copy, not the repo (see [docs/testing §4.5](../../docs/testing/next-step.md)).
|
|
87
87
|
|
|
88
88
|
Turning the global switch off **hides every dependent row** (card / ghost / pause / budget / diagnostics) and leaves just the switch plus one line of explanation — off means off, nothing looks like it still runs, and re-enabling restores the previous switch values.
|
|
89
89
|
|
|
@@ -91,19 +91,21 @@ The row writes the same `$DSH_HOME/next-step.settings.json` that the host re-rea
|
|
|
91
91
|
|
|
92
92
|
## When no card appears
|
|
93
93
|
|
|
94
|
-
| Situation | What happens
|
|
95
|
-
| ------------------------------------------------------------------------------------------------- |
|
|
96
|
-
| The turn was stopped, errored, or produced no text | No card: only normally completed turns are eligible.
|
|
97
|
-
| Subagent session | No card, by design.
|
|
98
|
-
| Global switch off | No request is made at all; existing cards remain in the transcript.
|
|
99
|
-
| Paused, or the session's card budget (`maxCardsPerSession`) used up | No new card; existing cards stay.
|
|
100
|
-
| A card or a decision already exists for that turn | One card per turn; no duplicates.
|
|
101
|
-
| The model grades the turn `no`, or grades it `could` while your tier is Strict (`shown: false`) | The candidate is stored but hidden; the generate button **reveals it for free**. “Last skipped” shows the model's reason.
|
|
102
|
-
| Model call failed, was rate-limited, bad JSON
|
|
103
|
-
|
|
|
104
|
-
| The
|
|
105
|
-
| The
|
|
106
|
-
|
|
|
94
|
+
| Situation | What happens |
|
|
95
|
+
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
96
|
+
| The turn was stopped, errored, or produced no text | No card: only normally completed turns are eligible. |
|
|
97
|
+
| Subagent session | No card, by design. |
|
|
98
|
+
| Global switch off | No request is made at all; existing cards remain in the transcript. |
|
|
99
|
+
| Paused, or the session's card budget (`maxCardsPerSession`) used up | No new card; existing cards stay. |
|
|
100
|
+
| A card or a decision already exists for that turn | One card per turn; no duplicates. |
|
|
101
|
+
| The model grades the turn `no`, or grades it `could` while your tier is Strict (`shown: false`) | The candidate is stored but hidden; the generate button **reveals it for free**. “Last skipped” shows the model's reason. |
|
|
102
|
+
| Model call failed, was rate-limited, bad JSON, or the card did not refer to this conversation | No card is written. The generate button turns into “Try again” with a one-line reason (`schema` / `ungrounded` / LLM error) and a “Details” toggle holding the technical cause; failures of the automatic generation are shown the same way, including after a reload. |
|
|
103
|
+
| No conversation content to work from (host seam moved / empty session) | No request at all: `no-context` in “Last skipped”. A card from nothing would be a card about nothing. |
|
|
104
|
+
| The generation **timed out (20 s) or was cancelled** | Counted in `aborted`; “Last skipped” says which. The button shows the reason with “Try again”. If the RPC itself hangs, the client-side fallback (30–60 s) cancels the server-side call and shows “Generation timed out. Try again”. No dialog. |
|
|
105
|
+
| The generation was still running when you sent your next message (a new turn started) | **No longer cancelled**: the call finishes and is stored as a `shown:false` candidate (**not a saving** — finishing bills more output tokens than aborting did; the candidate never enters the transcript, never counts against the budget, never reports an impression and cannot be revealed); “Last skipped” shows `superseded`. If you press generate while such a stale call is still running, that call is cancelled first, so the button generates for the latest turn instead of returning `inflight`; if a generation for the **same** turn is still running, the button shows a waiting state and then either the card or a retryable reason. |
|
|
106
|
+
| The reply is still streaming | Nothing is rendered for the turn until it ends. |
|
|
107
|
+
| The composer already has a draft | The card is visible but the pills are disabled until the draft is cleared. |
|
|
108
|
+
| Ghost face on, but the composer is not plain (draft, attachment, `@`, `/`, or a non-idle session) | The hint stays hidden. |
|
|
107
109
|
|
|
108
110
|
## Known limitations
|
|
109
111
|
|
|
@@ -111,9 +113,12 @@ The row writes the same `$DSH_HOME/next-step.settings.json` that the host re-rea
|
|
|
111
113
|
- **No card while messages are queued.** If you already have 2+ messages waiting to be sent, the plugin skips generation for that turn (the official action cards use the same limit); nothing is queued or sent by the plugin itself.
|
|
112
114
|
- **One or two proposals.** Options must point in different (mutually exclusive) directions; a one-option card means the next step is obvious, not that the card is incomplete.
|
|
113
115
|
- **`⌘↵` / `Ctrl+↵` is only taken over when the composer is clean, the session is idle and a card is interactive.** Otherwise the combination keeps its host Queue/Steer complementary-send meaning; the plugin never steals it.
|
|
116
|
+
- **“Walked away” is recorded up to 15 minutes late.** The host has no “session switched away” event, so when a card was neither clicked nor dismissed and you never typed, the negative feedback is settled by a TTL (15 minutes) as `typed:false`; if you quit the app before that, the record is never written. At most 32 sessions are tracked at once — the oldest is settled first instead of growing without bound.
|
|
117
|
+
- **Superseded candidates are not shown in the UI, and they do not save tokens.** A candidate that finished after the next turn had already started is stored with `shown:false`, never rendered, never fed to the ghost hint, never counted against `maxCardsPerSession`, never reported as an impression, and not revealable from the generate button (that button only works for the latest normally completed turn). Its purpose is to keep a nearly-finished call from being thrown away and to make this case explainable in review — the cost is that those calls **run to completion and bill more output tokens**, so this is not a token-saving change, and it does not backfill cards for old turns.
|
|
114
118
|
- **No cross-device sync.** Cards and decisions live in the local session log of the machine that generated them.
|
|
115
119
|
- **No cards in subagent sessions**, and none for interrupted or empty turns.
|
|
116
120
|
- **The ghost only offers the latest card's next prompt**, and only when the composer is empty and idle.
|
|
121
|
+
- **A card must be anchored in the conversation.** Besides the shape checks, the plugin mechanically verifies that the card is _about_ the material the model was given — either it names a concrete object that appears verbatim (file, command, version, PR number, identifier), or it shares at least two four-character Chinese phrases with it (so a paraphrasing card on a one-sentence answer still counts). Otherwise the card is discarded. Known gap: text that only ever appeared inside a tool result is not counted, because the check reads user/assistant text. See [ADR 0023](../../docs/adr/0023-next-step-grounded-cards.md).
|
|
117
122
|
- **The card text is model output.** The plugin validates the shape (1–2 options, distinct stances, a 2–20 character label that names a concrete object from the conversation) and drops only the individual options that fail; it never rewrites the wording.
|
|
118
123
|
- **A click sends exactly the pill's text** — there is no hidden “short label, long instruction behind it” layer. A `text` field left over in card records written by older versions is ignored.
|
|
119
124
|
|
|
@@ -121,13 +126,15 @@ The row writes the same `$DSH_HOME/next-step.settings.json` that the host re-rea
|
|
|
121
126
|
|
|
122
127
|
## Compatibility
|
|
123
128
|
|
|
124
|
-
| DSH version | Status
|
|
125
|
-
| ----------- |
|
|
126
|
-
| 0.2.2-rc.
|
|
127
|
-
| 0.2.2-rc.
|
|
128
|
-
| 0.2.2-rc.3 | **0.
|
|
129
|
-
| 0.2.2-rc.
|
|
130
|
-
| 0.2.2-rc.
|
|
129
|
+
| DSH version | Status |
|
|
130
|
+
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
131
|
+
| 0.2.2-rc.5 | **0.4.3** (2026-11-21): a card can no longer be written from nothing. The repair call used to resend only the previous raw output plus the schema error, with **no transcript** — so when the first call returned an empty string, the model could only turn that error into a card ("this turn had no conversation content; paste it in?"). 95 cards in the local session logs traced back to that path, while the referenced turn actually had 1393 characters of answer text. Now the repair request carries the same transcript, an empty answer is re-sent as the same request instead of being "repaired", a card must be anchored in the conversation (a concrete object verbatim, or at least two shared four-character Chinese phrases; otherwise it is dropped and counted `ungrounded`), and a turn with no conversation content does not call the model at all (`no-context`). Prompt v4 forbids describing the generation process or asking the user to paste the conversation; an over-long label now gets its actual length in the repair request. Verified: 194 unit tests + `pnpm probe:runtime` 72/72 + `pnpm gate:next-step --deep --workspace <dir>` **PASS in 5 steps** (web `smoke:next-step` 73/73, desktop read-only 20 PASS / 2 SKIP / 0 FAIL, desktop `--deep` 33 PASS / 3 SKIP / 0 FAIL), and live on the published build: turns with `cand.parse:"retried"` produced real cards and no "no conversation content" card appeared after the restart ([ADR 0023](../../docs/adr/0023-next-step-grounded-cards.md)). Review metric: the report splits `schema` failures into **empty model output** (`json:empty`) and non-empty format failures — only the latter feed `schemaShare`, a new `emptyShare` states how much of the schema errors were empty output, and a new `empty-generations` verdict says that case is a provider/output-length issue rather than “loosen the parser” (re-sending the same request rescued only 2 of 81 empty outputs). |
|
|
132
|
+
| 0.2.2-rc.5 | **0.4.2** (2026-11-19): no code change needed for this DSH build. Verified: unit tests + `pnpm probe:runtime` 72/72 + web `pnpm smoke:next-step` **73/73** (real host, real model call; now includes the ✕-dismiss write path) + desktop read-only regression **21 PASS + 1 SKIP** (22 assertions; the SKIP is a data-dependent branch — that card has no expand button; the read-only pass no longer clicks ✕ because a decision is a permanent write, and it accepts the plugin's 1–2 pill contract). The new host surfaces this release (`CONTENT_REFUSED`, search-provider default routing) are not used here ([runtime rc.5](../../docs/runtime/0.2.2-rc.5.md)). |
|
|
133
|
+
| 0.2.2-rc.3 | **0.4.1** (2026-11-14): fixes a silent failure. The card is **delivered late by the projection** (the turn tail mounts and `status` becomes `interactive` first, the card arrives a moment later), while the effect that registers `⌘↵` only depended on `[sessionId, status]` — so a late card was never registered: it looked clickable and clicking the pill still worked, but `⌘↵` did nothing (it only worked when the tail remounted with the card already in the projection, hence "sometimes"). Fixed by adding card visibility / option count to the effect deps. Verified by `test/client-card-shortcut.test.js` (a mini hook runtime driving the real client source: late card, one/two pills, non-empty draft, unrevealed candidate, already decided; it fails without the fix) and on the real host: a late (≈2.3 s) two-pill card sent its primary pill with `⌘↵` and turned `sent`, while on 0.4.0 a late **one-pill** card also did nothing. Also fixes the header/delimiter order of the compatibility table in both READMEs. |
|
|
134
|
+
| 0.2.2-rc.3 | **0.4.0** (2026-11-14): the card face becomes tunable and measurable. The model grades a turn on three levels (`must` / `could` / `no`) instead of a boolean, and a setting picks which levels are shown (**strict / balanced (default) / eager**). A withheld card still stores its candidate and one click **reveals** it — no second model call; only a turn without any candidate regenerates. Parsing is tolerant (over-long text is clipped, a bad single option is dropped) with one repair call, so one over-long field can no longer delete a whole card. Every eligible turn appends one line to `<dataRoot>/next-step/events.jsonl` (gate, grade, latency, usage, what you did with the card, whether it entered the viewport; never your message text, local only, can be switched off), and the settings section writes a Markdown report with Wilson 95% intervals that refuses to give verdicts below 80 turns / 25 cards. Three deterministic losses are gone: the budget (30 → 120) only counts _shown_ cards, the short-answer gate now requires "few chars **and** no tool calls", and a bad field no longer voids the card. Settings moved to a 3-row first screen plus a "More settings" disclosure; the settings file is v2 (`schemaVersion` / `cardThreshold` / `telemetry`) and only migrates values equal to the old default. Verified: 170 unit tests + `pnpm probe:runtime` + web `pnpm smoke:next-step` **71/71** (real host, real model calls, including the withheld→reveal path and the event log) + desktop read-only regression. |
|
|
135
|
+
| 0.2.2-rc.3 | **0.3.1** (2026-11-14): makes an aborted generation diagnosable. A 20 s timeout or a cancellation used to leave **no trace at all** — no counter, no “Last skipped” entry, no session record — so a “no card appeared” incident was impossible to attribute after the fact. Now aborts increment a separate `aborted` counter (shown in the settings row as “已中止 N”), write a labelled “Last skipped” reason (`generation timeout after 20s` / `cancelled`), stay out of `failed` / `lastError`, and the generate button says “生成超时或被取消,请重试” instead of the generic failure text. Verified: 103 unit tests (4 new) + `pnpm probe:runtime` 72/72 + web `pnpm smoke:next-step` **59/59** (real host + real model call, re-run after the change) + desktop read-only regression **10 PASS + 2 SKIP**; `smoke:next-step` also gained the ability to print the plugin-reported reason and to keep its throwaway `DSH_HOME` when an assertion fails. |
|
|
136
|
+
| 0.2.2-rc.2 | **0.3.0** (2026-11-14): pill labels tightened to 2–20 characters and must name a concrete object (generic pills are dropped), 1–2 options instead of exactly 2, summaries must state checkable facts, two new cheap gates (previous turn errored / answer under 80 characters), ghost hint capped at 150 characters and degraded when it disagrees with the recommended pill; settings moved to their own "Settings → Next-step suggestions" section. Verified: 58 unit tests (50 prompt + 8 gates) + `pnpm probe:runtime` 72/72 + web `pnpm smoke:next-step` **59/59** (real host, real model call). The settings section was also checked on a live desktop build via read-only CDP; the desktop read-only regression reports **10 PASS + 2 SKIP** (the SKIPs are "no card in this session" and "read-only mode does not create cards"); `--deep` card interaction reports **23 PASS + 2 SKIP** (real model call — the one-sentence fixture is blocked by the new "answer under 80 characters" gate, so the run exercises the generate-now fallback, which also verifies that gate). |
|
|
137
|
+
| 0.2.2-rc.1 | Full regression green on 2026-11-11: web composition end-to-end (`pnpm smoke:next-step`: 59 assertions passing, 0 skipped; real host + real model calls, covering WYSIWYG sending, the picked-option echo, the `needed` gate and the force-generate button, and the progressive settings), desktop real-machine `pnpm smoke:next-step-desktop --require --deep` (32 passing + 3 skipped + 0 failing on the pre-release tarball, build `1ba08e8b`; the published 0.2.0 self-reports `version 0.2.0, build ce72c9dd` — the hash covers `package.json`, so the version bump changes it; every skip is a data-dependent branch), 83 unit tests, runtime probe 60/60, and `pnpm gate next-step` green across all four steps. Other DSH versions are not verified. |
|
|
131
138
|
|
|
132
139
|
The plugin declares no `engines.dsh` and no `@deepseek-ai/*` peer range: DSH is pre-release and semver ranges over prereleases are unreliable (see [ADR 0005](../../docs/adr/0005-dsh-version-compatibility.md)). Treat the table as the compatibility statement. After a DSH upgrade run `pnpm probe:runtime`, `pnpm smoke:next-step` and `pnpm smoke:next-step-desktop`, then check the plugin's diagnostics.
|
|
133
140
|
|
package/README.zh-CN.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> DeepSeek Harness 的「下一步决策卡」:一轮值得继续的回答之后,给一张小卡片,写清对话现状、需要你拍板的问题,以及 1–2 条互斥的下一步建议;点哪一句,就把那句**原样**作为用户消息发出(所见即所发)。**出卡频率由你选**(严格 / 平衡 / 积极);被档位拦下时,最新回答下方有一键按钮可以**揭示已经算好的候选**,不额外调一次模型。它还会在本地记一份**复盘日志**,让阈值、措辞和按钮可以按证据调,而不是凭手感。可选(默认关)在空输入框里给一条灰色幽灵提示,`Tab` / `→` 接受。
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@kangyishuai/dsh-next-step) [](https://www.npmjs.com/package/@kangyishuai/dsh-next-step) [](#兼容性) [](./LICENSE)
|
|
6
6
|
|
|
7
7
|
[English](./README.md)
|
|
8
8
|
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
- **有得继续就出卡——多频繁由你定。** 一轮正常结束后,插件额外调用一次模型,让模型把这一轮打成三档(`must` / `could` / `no`,提示词里明写「拿不准一律判 `could`」)。设置里的**出卡频率**决定显示哪几档:**严格**(只出 `must`)、**平衡**(默认,`must` + `could`)、**积极**(三档全出,含 `no`,校准用实验档)。卡片内容总是会算出来,档位只决定要不要显示;值得时在回答下方追加一张决策卡——一到三句**现状摘要**(超过两行折叠,带「展开 / 收起」小按钮)、一句点名要你拍板的**提问**,以及 **1–2 粒互斥方向**的胶囊(下一步很明确时就只给一粒,不凑数)。胶囊上就是点击后**原样发出**的那句话:**2–20 字、动词开头、必须含对话里的具体对象**(文件名 / 命令 / 参数 / 版本号 / PR 号)——「检查定义是否准确」这类放到哪一轮都成立的按钮会被直接丢掉,一条都不剩就整卡不出。
|
|
18
18
|
- **点一下就是一条用户消息。** 点胶囊会把它自己那行文本填入输入框,并走和手动回车**同一条提交链**发出——不是伪造会话事件。空闲会话立即发送;如果已有回合在跑,就和你打字一样排进队列。
|
|
19
19
|
- **刷新也不丢。** 卡片和决策以插件记录的形式追加进会话日志,由宿主的 session projection 折叠,这是唯一的数据来源。刷新页面、切换会话、重开应用都还在;客户端不另存状态。
|
|
20
|
-
-
|
|
20
|
+
- **只读保留,但不是噪音。** 点过之后卡片仍留在对话里,但变成只读:摘要和提问保留,两粒胶囊换成**你点的那一粒的选中态**(✓ + 那句话),后面跟一行灰字「已发出」。**更早轮次、还没被决策过的卡默认折叠成一行**(「更早的一轮 · 摘要首句」),完整摘要留在悬停提示与会话日志里——真实数据里 82% 的卡从来没有任何决策,旧卡全铺开就只能靠关掉功能来止损(本批审计 AUD-NS-02)。任何时刻最多一张卡可交互。卡片右上角的 ✕ 可以收掉这张卡,不发送任何东西。
|
|
21
21
|
- **输入框幽灵提示(默认关)。** 同一次模型调用还会产出一条「下一句提示」。打开 ghost 面后,空且空闲的输入框里会以灰色、和宿主 placeholder 同字号同基线的样子显示它。`Tab` / `→` 接受进草稿(`Ctrl+Z` 可撤销),`Esc` 清除本次建议,开始打字就消失;输入框里有草稿、附件、`@` 引用或斜杠命令时隐藏。幽灵提示**不是草稿内容**,所以空框按 Enter 仍然什么都不会发。
|
|
22
22
|
- **两个面,一次调用。** 卡片和幽灵提示由同一次模型调用一起产出,打开 ghost 不会多花请求。
|
|
23
23
|
- **被拦下的卡一键可得,而且免费。** 被档位拦下的回合照样有「生成下一步建议」按钮;点它**揭示已经算好的候选**——不再调第二次模型、不用等 20 秒。只有这一轮压根没生成过候选(调用失败或超时)时才会真的再调一次。点这个按钮本身也是「档位拦掉了用户想要的卡」最硬的证据。
|
|
24
|
-
- **本地复盘日志,让调参有证据。** 每个合格回合往 `<dataRoot>/next-step/events.jsonl` 追加一行:哪道闸决定的、三档判定、耗时、token、你后来对这张卡做了什么(点了 / 关了 / 无视 / 自己打了下一条 /
|
|
24
|
+
- **本地复盘日志,让调参有证据。** 每个合格回合往 `<dataRoot>/next-step/events.jsonl` 追加一行:哪道闸决定的、三档判定、耗时、token、你后来对这张卡做了什么(点了 / 关了 / 无视 / 自己打了下一条 / 揭示了它 / **看完就走了——15 分钟没再说话,记一条 `typed:false`**),以及卡片有没有真的进过视口。不上传,**也从不写你的消息原文**——只留长度、延迟,以及跟胶囊重合了几个具体对象。**例外:生成的胶囊文案会原样记录**(复盘按钮文案必须看它;它是从对话里抽出来的具体对象,不是你的整段原文)。设置页可以生成一份 Markdown 报告(保留最新 20 份),样本不够时报告只列计数、不给结论(门槛:80 个回合 / 25 张卡)。
|
|
25
25
|
- **开关是真的能停。** `card`(默认开)与 `ghost`(默认关)是分开的两个开关;全局开关关闭后**不再发起生成请求**,不是只把 UI 藏起来。另有暂停和每会话卡片预算(`maxCardsPerSession`)限制新卡。已经写进日志的卡仍然可读。
|
|
26
26
|
|
|
27
27
|
## 成本
|
|
28
28
|
|
|
29
29
|
- 每次触发多一次模型调用,用会话所在智能体当前的模型(取不到时回退到默认模型选择),**占用你自己的 provider 额度**。
|
|
30
|
-
- 这次调用 20 秒超时。其它失败、限流、JSON
|
|
30
|
+
- 这次调用 20 秒超时。其它失败、限流、JSON 不合法都不写卡,但**界面不再静默**:补生成按钮会变成「重试」并给出一行原因,「查看详情」展开技术原因(`json:empty`、宿主错误、超时秒数)。**自动生成**失败也一样(刷新页面后仍然生效)——宿主通过 `nextStep/generateState` 报出该回合最近一次尝试;后台还在跑时按钮显示等待态,而不是一句永远的「正在生成」。客户端会在服务端超时之后多等一段(默认 30 秒、最多 60 秒);如果 RPC 自己挂住超过这个时间,客户端会**取消服务端在途生成**并显示「生成超时,可重试」——不会出现「界面放弃了、调用还在跑」。诊断里的计数与「最近跳过」/最近错误仍然保留。**恢复只允许一次,而且一定带着同一段对话**:模型返回**空**输出时,把同一个请求原样再发一次(空字符串不是格式问题——拿「空」去修格式,正是「没有对话内容的空卡」被写出来的机制);有内容但格式不对时,修复请求会重贴这段对话,只要求修格式。卡片里找不到任何对话中的对象时直接丢弃,计 `ungrounded`。**超时 / 被取消**单独计数(`aborted`,并在「最近跳过」写明 `generation timeout after 20s`),补生成按钮会显示对应原因并给出「重试」,所以这一类事后可诊断、也能当场补救。**你发下一条消息时不再取消在途生成**:那次调用会跑完并把结果存成不显示的候选(`shown:false`),不会在对话里多出一张过期卡;诊断「最近跳过」与报表的闸门分布里显示为 `superseded`(本批审计 AUD-NS-01)。**收益口径要说清**:这**不省 token**——中止只结算已经生成的部分,跑完要付全额输出 token,所以这批调用的花费是**增加**的;换来的是「接近完成的那次调用不再被丢弃」与「取消在诊断/复盘里可解释」。这类候选**不占 `maxCardsPerSession`、不进曝光、也不可揭示**(补生成按钮只对最近一个正常结束的回合生效)。不合法输出直接丢弃,不写记录。
|
|
31
31
|
- 模型判成 `no`(或判 `could` 而你选的是严格档)时不显示卡,但**这次调用已经发生**:档位省的是界面噪音,不是 token。事后揭示也不会再花一次调用。想看模型给出的理由,去设置页诊断里的「最近跳过」。
|
|
32
|
-
- 复盘日志是本机 append-only 文件,2 MB 滚动(`events.jsonl` + 一份 `.1`
|
|
32
|
+
- 复盘日志是本机 append-only 文件,2 MB 滚动(`events.jsonl` + 一份 `.1` 历史)。里面没有消息原文,但会原样记录生成的胶囊文案(复盘按钮文案必须看它);默认开启,可在设置里关掉(「本地采集与复盘数据」)。
|
|
33
33
|
- 除此之外不联网,不上报。
|
|
34
34
|
|
|
35
35
|
## 副作用与风险
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
- **发出去的就是普通用户消息。** 它进入模型上下文、出现在对话里,和你自己打字完全一样。
|
|
41
41
|
- **依赖宿主私有 seam。** 卡片渲染走 `conversation.chat.turnTail`;状态来自宿主 session projection(客户端用 `useProjection` 读);点击发送走 composer shell 的 `setDraft` / `submit`(提交前等草稿落定);幽灵提示走 `conversation.input.overlay` 和宿主 placeholder 的 DOM。这些都没有类型、没有版本契约:DSH 升级可能让卡片、发送链或幽灵提示**静默失效**。插件会降级而不是弄坏会话,但升级后请跑 `pnpm probe:runtime`、两个冒烟套件,并看诊断。
|
|
42
42
|
- **幽灵提示和宿主 placeholder DOM 绑在一起**,这也是它默认关的原因;宿主改了那块 DOM,它就只是不显示了。
|
|
43
|
-
-
|
|
44
|
-
- **会在数据根下写两样东西。**(a)现有会话日志里每张生成的卡多一条记录——被抑制的候选也会记(`shown: false`),所以每个合格回合最多多一条小记录;(b)`<dataRoot>/next-step/events.jsonl`(复盘日志,2 MB 滚动),以及你点「生成报告」时的 `report-*.md`(保留最新 20
|
|
43
|
+
- **失败不再静默,但也不是错误弹窗。**「没出卡」时补生成按钮会标成「重试」+ 一行原因(技术细节在「查看详情」里),诊断计数与「最近跳过」仍保留。超时与取消是单独的原因(不混进笼统失败),由服务端/客户端两边各自标注——客户端兜底超时会在结束 waiting 前取消服务端在途生成。
|
|
44
|
+
- **会在数据根下写两样东西。**(a)现有会话日志里每张生成的卡多一条记录——被抑制的候选也会记(`shown: false`),所以每个合格回合最多多一条小记录;(b)`<dataRoot>/next-step/events.jsonl`(复盘日志,2 MB 滚动),以及你点「生成报告」时的 `report-*.md`(保留最新 20 份,更早的在**这个插件目录内**删除)。**日志里不写消息原文**(胶囊文案会原样记录,理由见上),也不会有任何东西离开本机。
|
|
45
45
|
- **子代理会话不出卡**,被停止、报错或没有文本的回合同样不出卡。
|
|
46
46
|
|
|
47
47
|
## 安装
|
|
@@ -62,11 +62,11 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-next-step-*.tgz
|
|
|
62
62
|
|
|
63
63
|
## 用法
|
|
64
64
|
|
|
65
|
-
**卡片。** 这一轮正常结束后出现在最后一条回答下方,不抢焦点。胶囊上就是点击后原样发出去的那句话;摘要折叠时用小小的展开按钮看全文。✕
|
|
65
|
+
**卡片。** 这一轮正常结束后出现在最后一条回答下方,不抢焦点。胶囊上就是点击后原样发出去的那句话;摘要折叠时用小小的展开按钮看全文。✕ 收掉卡片;更早的卡默认折叠成一行(「更早的一轮 · 摘要首句」),悬停看完整摘要。
|
|
66
66
|
|
|
67
67
|
**键盘。** 卡片可交互、输入框为空、会话空闲时,按 `⌘↵` / `Ctrl+↵` 直接发送 primary 胶囊(和鼠标点击走同一条链)。输入框里有草稿、附件、`@`/`/` 菜单开着或已有回合在跑时,这个键仍归宿主的 Queue/Steer 语义,插件不抢。
|
|
68
68
|
|
|
69
|
-
**没出卡怎么办。** 没出卡有两种不同的原因:一种是被档位拦下(模型判 `no`,或判 `could`
|
|
69
|
+
**没出卡怎么办。** 没出卡有两种不同的原因:一种是被档位拦下(模型判 `no`,或判 `could` 而你选的是严格档)——这时卡片**已经算好了,只是没显示**;另一种是压根没生成(暂停、排队、预算、超时、输出不合法)——这时没有任何候选。两种情况下最新回答下方都会出现一行「生成下一步建议」:被档位拦下的,点它就是**揭示已有候选,瞬时出卡、不再调模型**;只有没有候选时才会真的重新调一次模型。上一次尝试失败时(自动或手动),按钮直接写**「重试」**并给出一行原因,「查看详情」可展开技术细节;后台还有生成在跑时按钮显示「后台正在生成,请稍候…」,结束后要么出卡、要么变成可重试的错误——一次 `inflight` 回执不会留下一句永久的「正在生成」。所以「我觉得该出卡却没出」时:先看设置页诊断的「最近跳过」;想立刻要一张,直接点那个按钮。
|
|
70
70
|
|
|
71
71
|
**幽灵提示。** 在 设置 → **下一步建议** 里打开 ghost 面。输入框空且空闲时,最新一张卡的「下一句提示」以灰色出现,和宿主 placeholder 对齐。`Tab` 或 `→` 接受——文本进入草稿,仍可撤销。`Esc` 清除本次建议,输入第一个字符也会让它消失。它只改草稿:不发送,也不抢 Enter。
|
|
72
72
|
|
|
@@ -81,9 +81,9 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-next-step-*.tgz
|
|
|
81
81
|
- **本地采集与复盘数据** —— 复盘日志开关(默认开)。
|
|
82
82
|
- **输入框里的幽灵提示** —— 第二个面的开关(默认关)。
|
|
83
83
|
- **生成节奏** —— 「暂停 1 小时」/「恢复生成」。
|
|
84
|
-
- **每会话最多 N 张卡** —— 预算(`maxCardsPerSession`,夹在 0–1000,默认 120
|
|
84
|
+
- **每会话最多 N 张卡** —— 预算(`maxCardsPerSession`,夹在 0–1000,默认 **60**)。只统计**出过**的卡,被抑制的候选不占预算。默认值从 120 降到 60 是因为真实数据里单会话峰值 80 张、120 这个上限从来没被碰到(budget 闸 0 命中);旧设置文件里**恰好等于 120** 的值会在升级时跟着迁移,你自己设的其它数字不动。
|
|
85
85
|
- **回顾** —— 四个关键数字(出卡率 / 点击率 / 忽略率 / 漏判)+ 样本够时的一句话判读 + **「生成报告」**按钮,报告写在日志旁边。
|
|
86
|
-
- **诊断** —— 已生成(含未显示数)/ 失败 / 已中止 / 跳过 / 在途计数、**最近一次没出卡的原因**(模型判断不需要 / 排队 / 暂停 / 预算 / 失败 / 超时 /
|
|
86
|
+
- **诊断** —— 已生成(含未显示数)/ 失败 / 已中止 / 跳过 / 在途计数、**最近一次没出卡的原因**(模型判断不需要 / 排队 / 暂停 / 预算 / 失败 / 超时 / 取消 / 你已经开始下一轮,附模型给的理由)、最近错误、**运行时版本 + 构建哈希**、刷新按钮。`nextStep/diagnostics` 同样返回 `version` / `buildHash` / `buildFiles` / `packagePath` 与 `lastSkip`,所以运行中的构建可以和 `dsh plugin list` 或 npm 上的 tarball 对照,不需要翻启动日志。注意:`buildHash` 覆盖 `package.json`,而 pnpm 在 `file:` 安装时会重写它——那种情况要和 **profile 里已安装的那一份**比,别拿仓库的哈希去对(详见 [docs/testing §4.5](../../docs/testing/next-step.md))。
|
|
87
87
|
|
|
88
88
|
关闭总开关后,卡片 / 幽灵 / 暂停 / 预算 / 诊断这些依赖项会**整段隐藏**,只留总开关和一行说明——关掉就是关掉,不会让人以为还有东西在跑;重新启用时这些开关的取值都还在。
|
|
89
89
|
|
|
@@ -91,19 +91,21 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-next-step-*.tgz
|
|
|
91
91
|
|
|
92
92
|
## 什么情况下不出卡
|
|
93
93
|
|
|
94
|
-
| 情况 | 表现
|
|
95
|
-
| ------------------------------------------------------------ |
|
|
96
|
-
| 回合被停止、报错,或没有文本 | 不出卡:只有正常结束的回合才有资格。
|
|
97
|
-
| 子代理会话 | 按设计不出卡。
|
|
98
|
-
| 全局开关关闭 | 完全不发请求;已有卡片仍然留在对话里。
|
|
99
|
-
| 已暂停,或用完该会话的卡片预算(`maxCardsPerSession`) | 不出新卡;已有卡片保留。
|
|
100
|
-
| 该轮已经有 card 或 decision 记录 | 一轮最多一张卡,不重复。
|
|
101
|
-
| 模型判 `no`,或判 `could` 而你选的是严格档(`shown: false`) | 候选已落库但不显示;点补生成按钮**免费揭示**。诊断里「最近跳过」写明理由。
|
|
102
|
-
| 模型调用失败、限流、JSON
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
94
|
+
| 情况 | 表现 |
|
|
95
|
+
| ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
96
|
+
| 回合被停止、报错,或没有文本 | 不出卡:只有正常结束的回合才有资格。 |
|
|
97
|
+
| 子代理会话 | 按设计不出卡。 |
|
|
98
|
+
| 全局开关关闭 | 完全不发请求;已有卡片仍然留在对话里。 |
|
|
99
|
+
| 已暂停,或用完该会话的卡片预算(`maxCardsPerSession`) | 不出新卡;已有卡片保留。 |
|
|
100
|
+
| 该轮已经有 card 或 decision 记录 | 一轮最多一张卡,不重复。 |
|
|
101
|
+
| 模型判 `no`,或判 `could` 而你选的是严格档(`shown: false`) | 候选已落库但不显示;点补生成按钮**免费揭示**。诊断里「最近跳过」写明理由。 |
|
|
102
|
+
| 模型调用失败、限流、JSON 不合法,或卡片没讲到这段对话 | 不写卡。补生成按钮变成「重试」+ 一行原因(`schema` / `ungrounded` / 模型调用失败),「查看详情」给技术原因;**自动生成**失败同样显示,刷新后也还在。 |
|
|
103
|
+
| 拿不到任何对话内容(宿主 seam 变了 / 空会话) | **完全不发请求**:诊断「最近跳过」显示 `no-context`。没有原料的卡只会是一张空卡。 |
|
|
104
|
+
| 生成**超时(20 秒)或被取消** | 计入 `aborted`;「最近跳过」写明是哪一种。按钮显示原因并提供「重试」;若 RPC 自身挂住,客户端兜底(30–60 秒)会先取消服务端调用,再显示「生成超时,可重试」。不弹框。 |
|
|
105
|
+
| 生成还没跑完,你就发了下一条消息(开始了新一轮) | **不再取消**:那次调用跑完并写成 `shown:false` 候选(**不是省钱**:跑完会比中止多付输出 token;候选不进对话流、不占预算、不进曝光、不可揭示);「最近跳过」显示 `superseded`。点「补生成」时若这类旧调用仍在途,会先取消它——按钮为最新回合生成,不再误报 `inflight`;若是**同一回合**的生成仍在途,按钮显示等待态,结束后要么出卡、要么给出可重试的原因。 |
|
|
106
|
+
| 回答还在流式输出 | 该轮结束前槽位不渲染。 |
|
|
107
|
+
| 输入框里已有草稿 | 卡片照常显示,但胶囊禁用,直到清空草稿。 |
|
|
108
|
+
| ghost 开着,但草稿、附件、`@`、`/` 或输入状态不满足条件 | 提示隐藏。 |
|
|
107
109
|
|
|
108
110
|
## 已知限制
|
|
109
111
|
|
|
@@ -111,9 +113,12 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-next-step-*.tgz
|
|
|
111
113
|
- **有排队消息时不出卡。** 如果你已经排了 2 条以上待发送消息,这一轮就跳过生成(官方 action cards 用同一条规则);插件本身不会排队或代发任何东西。
|
|
112
114
|
- **建议 1–2 条。** 方向必须互斥;下一步很明确时只给一条,不凑数。
|
|
113
115
|
- **`⌘↵` / `Ctrl+↵` 只在「输入框干净 + 会话空闲 + 卡片可交互」时接管。** 其它时候这个组合仍是宿主的 Queue/Steer 互补发送;插件不抢占。
|
|
116
|
+
- **「看完就走了」最多晚 15 分钟才落盘。** 宿主没有「会话切走」事件,所以「卡没被点/关,用户也没再说话」这条负反馈靠 TTL(15 分钟)兜底结算成 `typed:false`;这期间直接关掉应用,这一条就不会写。追踪表最多同时盯 32 个会话,超出时最旧的那条先结算,不会无限增长。
|
|
117
|
+
- **被 `superseded` 的候选不在界面里,也不省钱。** 「下一轮已经开始才生成完」的候选以 `shown:false` 落库、不渲染、不喂 ghost、不进曝光、不占 `maxCardsPerSession`、也不在补生成按钮里揭示(那个按钮只对最近一个正常结束的回合生效)。它的用途是让接近完成的调用不被丢弃、并让这类情况在复盘里可解释——代价是这些调用**会跑完、多花输出 token**,所以它不是省钱改动,也不是给历史回合补卡。
|
|
114
118
|
- **不做跨设备同步。** 卡片和决策只存在生成它的那台机器的本地会话日志里。
|
|
115
119
|
- **子代理会话不出卡**,被中断或没有文本的回合也不出。
|
|
116
120
|
- **幽灵提示只给最新一张卡的下一句**,且只在输入框为空、会话空闲时出现。
|
|
121
|
+
- **卡片必须落在对话上。** 除了形状校验,插件还会机械核对卡片是不是在讲**模型看到的那段对话**:要么它引用的某个具体对象(文件、命令、版本号、PR 号、标识符)在对话里原样出现,要么它与对话共享至少 2 条中文 4 字片段(一句话回答里「改写说法」的卡片也算数),否则丢弃。已知缺口:只出现在工具结果里的内容不计入判据(校验只读 user / assistant 文本)。见 [ADR 0023](../../docs/adr/0023-next-step-grounded-cards.md)。
|
|
117
122
|
- **卡片文字来自模型。** 插件会校验形状(1–2 条选项、方向互斥、label 2–20 字且含具体对象),超长/空话的单条会被丢掉(必要时先让模型修一次格式),但不改写措辞。
|
|
118
123
|
- **复盘要等样本。** 少于 80 个合格回合或 25 张卡时,报告只列计数并明写「样本不足」——一两天几十条数据得出的结论只会是噪声。
|
|
119
124
|
- **点击发出去的就是按钮文本**,不再有「按钮短、背后另有一段长指令」的隐藏层:旧版本卡片记录里残留的 `text` 字段会被忽略。
|
|
@@ -122,13 +127,15 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-next-step-*.tgz
|
|
|
122
127
|
|
|
123
128
|
## 兼容性
|
|
124
129
|
|
|
125
|
-
| DSH 版本 | 状态
|
|
126
|
-
| ---------- |
|
|
127
|
-
| 0.2.2-rc.
|
|
128
|
-
| 0.2.2-rc.
|
|
129
|
-
| 0.2.2-rc.3 | **0.
|
|
130
|
-
| 0.2.2-rc.
|
|
131
|
-
| 0.2.2-rc.
|
|
130
|
+
| DSH 版本 | 状态 |
|
|
131
|
+
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
132
|
+
| 0.2.2-rc.5 | **0.4.3**(2026-11-21):卡片不再可能「凭空写出来」。过去的「修复」调用只回贴上次输出与格式报错、**不带对话**——首次输出为空时,模型只能把这条报错写成卡片(「这一轮没有拿到任何对话内容……把对话贴进来?」);本机会话日志里 95 条这种卡全部来自这条路径,而被引用的那一轮实际有 1393 字正文。现在:修复请求带同一段对话;空输出改为**重发原请求**而不是「修格式」;卡片必须落在对话上(原样出现的具体对象,或共享 ≥2 条中文 4 字片段),否则丢弃并计 `ungrounded`;完全没有对话内容时不调模型(`no-context`);提示词 v4 禁止自述生成过程与要求用户补对话,label 超长时修复请求会带上实际字数。已验证:单测 194 + `pnpm probe:runtime` 72/72 + `pnpm gate:next-step --deep --workspace <目录>` **5 步全绿**(web 冒烟 73/73、桌面只读 20 PASS / 2 SKIP / 0 FAIL、桌面 `--deep` 33 PASS / 3 SKIP / 0 FAIL),并在已发布构建上实测:`cand.parse:"retried"` 的回合产出了正常卡片,重启后没有再出现「没有拿到对话内容」的卡片(见 [ADR 0023](../../docs/adr/0023-next-step-grounded-cards.md))。复盘口径:报告把 `schema` 失败拆成「模型返回空文本」(`json:empty`)与「非空格式失败」——`schemaShare` 只算后者,新增 `emptyShare` 表示空输出占 schema 失败的比例,并新增 `empty-generations` 判读:这类情况属 provider / 输出长度问题,不是「解析要放宽」(同一请求重发实测只救回 2/81 次空输出)。 |
|
|
133
|
+
| 0.2.2-rc.5 | **0.4.2**(2026-11-19):这一版 DSH 不需要改代码。已验证:单测 + `pnpm probe:runtime` 72/72 + web `pnpm smoke:next-step` **73/73**(真实宿主 + 真实模型调用,含点 ✕ 的写路径)+ 桌面只读回归 **21 PASS + 1 SKIP**(22 项;SKIP 是数据相关分支「该卡没有展开按钮」;只读回归不再点 ✕——decision 是永久写入,且胶囊按插件契约 1–2 粒断言)。本版宿主新增的 `CONTENT_REFUSED` 与搜索提供方默认路由都与本插件无关([runtime rc.5](../../docs/runtime/0.2.2-rc.5.md))。 |
|
|
134
|
+
| 0.2.2-rc.3 | **0.4.1**(2026-11-14):修一个静默失效。卡片是**投影晚到**的(回合尾部先挂载、`status` 先变 `interactive`,卡片随后才从投影进来),而登记 `⌘↵` 的 effect 只依赖 `[sessionId, status]`,于是晚到的卡片永远登记不上:卡片看着可点、点胶囊也正常,`⌘↵` 却什么都不做(只在「重挂载那一刻卡片已在投影里」时能用,所以时灵时不灵)。修法是把「卡片可见 / 有候选」纳入 effect 依赖。验证:新增 `test/client-card-shortcut.test.js`(迷你 hooks 运行时驱动真实 client 源码,覆盖晚到卡、一粒 / 两粒、草稿非空、未揭示、已决策),去掉修复即红;真机上「晚到约 2.3s 的两粒卡」按 `⌘↵` 成功发出 primary 胶囊并转 `sent`;0.4.0 上同样条件下晚到的**一粒**卡同样不接管。顺带修了两份 README 兼容性表的表头/分隔行错位。 |
|
|
135
|
+
| 0.2.2-rc.3 | **0.4.0**(2026-11-14):卡片这一面变成**可调**且**可度量**。模型不再用一个 boolean,而是把回合打成三档(`must` / `could` / `no`),设置里选出卡频率(**严格 / 平衡(默认)/ 积极**)。被档位拦下的卡仍会存下候选,点一下**揭示**它——不再第二次调模型;只有压根没有候选的回合才真的重新生成。解析变宽容(超长文本截断、单条不合格只丢这一条)+ 一次修复调用,一个字段超长不再让整张卡消失。每个合格回合往 `<dataRoot>/next-step/events.jsonl` 追加一行(闸门、三档判定、耗时、token、你后来对卡做了什么、有没有进过视口;不写消息原文、只在本机、可关),设置页还能生成带 Wilson 95% 区间的 Markdown 报告,样本少于 80 回合 / 25 张卡时拒绝给判读。三处确定性丢失也修了:预算(30 → 120)只统计**出过**的卡、短答闸改成「字数少**且**没有工具调用」、单个字段超长不再废掉整张卡。设置页收敛成首屏 3 行 +「更多设置」折叠;设置文件升级到 v2(`schemaVersion` / `cardThreshold` / `telemetry`),只迁移等于旧默认值的字段。验证:单测 170 项 + `pnpm probe:runtime` + web `pnpm smoke:next-step` **71/71**(真实宿主、真实模型调用,含「抑制 → 揭示」链路与事件文件)+ 桌面只读回归。 |
|
|
136
|
+
| 0.2.2-rc.3 | **0.3.1**(2026-11-14):让被中止的生成可诊断。此前 20 秒超时或被取消**完全无痕**——不计数、不写「最近跳过」、也不落会话日志——所以一次「卡片没出来」事后无法归因。现在中止会计入独立的 `aborted` 计数(设置页显示「已中止 N」)、写带标签的「最近跳过」原因(`generation timeout after 20s` / `cancelled`)、不再混进 `failed` / `lastError`,补生成按钮的文案也从笼统的失败文案改为「生成超时或被取消,请重试」。已验证:103 项单测(新增 4)+ `pnpm probe:runtime` 72/72 + web `pnpm smoke:next-step` **59/59**(真实宿主 + 真实模型调用,改动后重跑)+ 桌面只读回归 **10 PASS + 2 SKIP**;`smoke:next-step` 同时补了「打印插件自报原因」与「断言失败自动保留临时 `DSH_HOME`」。 |
|
|
137
|
+
| 0.2.2-rc.2 | **0.3.0**(2026-11-14):胶囊文案收紧到 2–20 字且必须含具体对象(泛化按钮直接丢弃)、选项 1–2 条、摘要要求写事实、新增「上轮报错 / 回答 < 80 字」两道便宜闸、幽灵提示 150 字上限 + 与推荐项一致性退化;设置搬到「设置 → 下一步建议」分节。已验证:单测 58(prompt 50 + gates 8)+ `pnpm probe:runtime` 72/72 + web `pnpm smoke:next-step` **59/59**(真实宿主 + 真实模型调用)。设置分节另有真机只读 CDP 核验;桌面只读回归 **10 PASS + 2 SKIP**(SKIP 是「当前会话没有决策卡」与「只读模式不造卡」);`--deep` 造卡交互 **23 PASS + 2 SKIP**(真实模型调用;一句话提示词会被「回答 < 80 字」闸挡住,走的是补生成按钮那条兜底,顺带验证了闸)。 |
|
|
138
|
+
| 0.2.2-rc.1 | 2026-11-11 全量回归通过:web 组合端到端(`pnpm smoke:next-step`:59 项断言全部通过 + 0 SKIP;真实宿主 + 真实模型调用,覆盖 WYSIWYG 发送、点后回显、`needed` 门控与补生成按钮、设置渐进披露)、桌面真机 `pnpm smoke:next-step-desktop --require --deep`(32 PASS + 3 SKIP + 0 FAIL,发版前 tarball 构建 `1ba08e8b`;发布后 0.2.0 只读自证 20 PASS + 2 SKIP,诊断 `版本 0.2.0 · 构建 ce72c9dd`,哈希含 `package.json` 版本故与发版前不同)、单测 83 项、宿主探针 60/60、`pnpm gate next-step` 四步全绿。其他 DSH 版本未验证。 |
|
|
132
139
|
|
|
133
140
|
插件不声明 `engines.dsh`,也不声明 `@deepseek-ai/*` 的 peer 范围:DSH 还在预发布阶段,预发布版本的 semver 范围不可靠(见 [ADR 0005](../../docs/adr/0005-dsh-version-compatibility.md))。以这张表为准。DSH 升级后跑 `pnpm probe:runtime`、`pnpm smoke:next-step`、`pnpm smoke:next-step-desktop`,并看插件诊断。
|
|
134
141
|
|