dsh-plan-completion 0.1.0 → 0.1.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 CHANGED
@@ -1,46 +1,95 @@
1
- # Changelog
2
-
3
- All notable changes to this project are documented here.
4
- Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), versioning: SemVer.
5
-
6
- ## [0.1.0] - 2026-11-02
7
-
8
- ### Added- Implicit per-session plan with version watermark (`gen.rev`), steps, evidence and update reason.
9
- - Turn-end trigger: after every completed turn the plugin generates a Tab-completable next-message
10
- suggestion plus plan patches, using an isolated model call (never the agent loop).
11
- - Floating suggestion bar above the composer: `Tab` fills the draft (does not send), `Alt+1..3`
12
- fills alternates, `Esc` dismisses; always-on `▤ vX.Y` entry opens the plan panel.
13
- - Plan panel (card style): intent, steps with status, evidence, latest update reason, next
14
- suggestion, fill/sync actions.
15
- - Always-on fallback states: dashed hint pill when the session has no plan yet, and a floating
16
- hero entry (`▤ 计划`) when no session-bound dock is mounted (new conversation shell).
17
- - Warm backfill: opening an old session the plugin has never observed builds its plan from the
18
- durable session log (`POST /plan-completion/warm`, deduped per session).
19
- - User edit channel (`POST /plan-completion/steps`): mark a step done/doing, or rewrite the whole
20
- step list; `editedByUser` plans cannot be auto-rewritten by the model (use `/replan`).
21
- - Slash commands: `/roadmap` (read-only plan) and `/replan <direction>` (force rewrite).
22
- - Production settings from plugin config: `evidenceChars`, `maxTokensPatch`, `maxTokensRewrite`,
23
- `warmBackfill`, `enableDebugRoutes`, `debugDir`.
24
- - 78 unit tests (plan/prompt/heuristics/evidence/job/store/pipeline).
25
-
26
- ### Changed
27
- - Package renamed from `@local/dsh-plan-completion` to **`dsh-plan-completion`** for standalone
28
- GitHub distribution (install as a `link:` profile bundle). Existing installs should uninstall
29
- the old name and install the repository path; existing runtime state is preserved across the
30
- rename.
31
- - Patch-path evidence is sliced to `evidenceChars` (default 1500) and output capped at
32
- `maxTokensPatch` (400); rewrite keeps full evidence and 1200 tokens — based on two isolation
33
- test rounds (27 variants each) and 6 real auto-job samples.
34
-
35
- ### Fixed
36
- - Cold-boot ordering: routes/commands register through `ctx.inject`, so the plugin works even when
37
- it activates before `webServer` / `commands` exist.
38
- - Duplicate HTTP handlers after plugin toggle/hot reload: host state and route disposers now live in
39
- a process-wide registry, so re-applying the plugin disposes the previous handlers.
40
- - Client keeps a stale plan when the host reports none; `plan:null` now clears the cached plan so
41
- the bar falls back to its always-on state.
42
-
43
- ### Security
44
- - Debug endpoints (`theme`, `experiment`, `autojob`, `steps`, `reset`) are only registered when
45
- `enableDebugRoutes: true`; production endpoints are `state`, `debug`, `diag`, `replan`, `warm`.
46
- - No credentials are stored in the plugin; model calls use the host `llm` service.
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here.
4
+ Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), versioning: SemVer.
5
+
6
+ ## [0.1.2] - 2026-11-02
7
+
8
+ ### Added
9
+ - Plan persistence: the plan plus the last suggestion are written per session to a local file
10
+ store (`storageDir/plans/<base64url(sessionId)>.json`, atomic temp+rename). After a DSH restart,
11
+ `GET /state` hydrates the persisted plan before responding, so the previous plan/version and
12
+ suggestion are visible immediately (no model call needed).
13
+ - New config: `persistPlans` (default true) and `storageDir` (default `~/.dsh/plan-completion-data`,
14
+ `~` expanded; `DSH_PLAN_COMPLETION_STORE_DIR` also honored). `persistPlans:false` returns to
15
+ memory-only behavior.
16
+ - Persisted writes happen on every committed generation, user edit (`/steps`) and are deleted by
17
+ `/reset`; warm backfill sees the persisted plan and reports `already` instead of re-generating.
18
+ - `store.getState()` / `put(plan, {cas, suggestion})` in both memory and file stores.
19
+ - 9 new tests: store persistence semantics (memory + file, corrupt record tolerance) and a
20
+ restart-simulation integration suite (restore on mount, continue patching after restart, reset
21
+ clears disk).
22
+
23
+ ### Changed
24
+ - `npm test` now reports **120/120** tests.
25
+
26
+ ### Security
27
+ - Persisted files contain conversation-derived plan/suggestion text (plain JSON, unencrypted, no
28
+ automatic expiry); see `docs/security.md`. `persistPlans:false` disables disk persistence.
29
+
30
+ ## [0.1.1] - 2026-11-02
31
+
32
+ ### Fixed
33
+ - Preserve the shared plan/CAS store across plugin reloads, including upgrades from older in-memory state.
34
+ - Prevent canceled, superseded or disposed jobs from publishing stale plans; retain concurrent user edits and CAS winners.
35
+ - Clear Dock-owned state on unmount; reject responses from older requests or previous Dock lifetimes.
36
+ - Preserve legitimate resets and same-version suggestion updates; apply successful warm responses correctly.
37
+ - Reset also clears `handledTurns` so a reset session can regenerate on the same turn.
38
+ - Add a top-level route error guard and drop dead code (unused trigger key, no-op command disposer loop).
39
+ - Fix locale copy: suggestions are shown **above** the composer, not below.
40
+ - Sync delivery notes / phase-2 plan with the shipped warm-backfill and hero-entry work.
41
+ - Use a Windows-compatible test command and cover Ubuntu/Windows with Node 20/22 in CI.
42
+
43
+ ### Security
44
+ - Require DSH Host/Origin and peer authentication on every HTTP endpoint; fail closed when admission is unavailable.
45
+ - Keep debug/diag disabled by default and remove arbitrary credentialed CORS.
46
+ - Remove conversation/URL/config/error text from diagnostics and runtime logs.
47
+ - Use only the host's current default model route (including experimental judging); add modelCalls: false for heuristic-only operation.
48
+ - Add production-host, client lifecycle and security/privacy regressions. See docs/security.md for remaining data-flow boundaries.
49
+
50
+ ### Verified
51
+ - 111 unit tests pass; real-DSH canary: Electron-proxied client requests keep working under `connection.requestRejection`, direct unauthenticated requests return 401, debug routes absent in production config.
52
+
53
+ ## [0.1.0] - 2026-11-02
54
+
55
+ ### Added
56
+ - Implicit per-session plan with version watermark (`gen.rev`), steps, evidence and update reason.
57
+ - Turn-end trigger: after every completed turn the plugin generates a Tab-completable next-message
58
+ suggestion plus plan patches, using an isolated model call (never the agent loop).
59
+ - Floating suggestion bar above the composer: `Tab` fills the draft (does not send), `Alt+1..3`
60
+ fills alternates, `Esc` dismisses; always-on `▤ vX.Y` entry opens the plan panel.
61
+ - Plan panel (card style): intent, steps with status, evidence, latest update reason, next
62
+ suggestion, fill/sync actions.
63
+ - Always-on fallback states: dashed hint pill when the session has no plan yet, and a floating
64
+ hero entry (`▤ 计划`) when no session-bound dock is mounted (new conversation shell).
65
+ - Warm backfill: opening an old session the plugin has never observed builds its plan from the
66
+ durable session log (`POST /plan-completion/warm`, deduped per session).
67
+ - User edit channel (`POST /plan-completion/steps`): mark a step done/doing, or rewrite the whole
68
+ step list; `editedByUser` plans cannot be auto-rewritten by the model (use `/replan`).
69
+ - Slash commands: `/roadmap` (read-only plan) and `/replan <direction>` (force rewrite).
70
+ - Production settings from plugin config: `evidenceChars`, `maxTokensPatch`, `maxTokensRewrite`,
71
+ `warmBackfill`, `enableDebugRoutes`, `debugDir`.
72
+ - 78 unit tests (plan/prompt/heuristics/evidence/job/store/pipeline).
73
+
74
+ ### Changed
75
+ - Published to npm as **`dsh-plan-completion@0.1.0`** (https://www.npmjs.com/package/dsh-plan-completion); the DSH profile still installs the repo as a `link:` bundle.
76
+ - Package renamed from `@local/dsh-plan-completion` to **`dsh-plan-completion`** for standalone
77
+ GitHub distribution (install as a `link:` profile bundle). Existing installs should uninstall
78
+ the old name and install the repository path; existing runtime state is preserved across the
79
+ rename.
80
+ - Patch-path evidence is sliced to `evidenceChars` (default 1500) and output capped at
81
+ `maxTokensPatch` (400); rewrite keeps full evidence and 1200 tokens — based on two isolation
82
+ test rounds (27 variants each) and 6 real auto-job samples.
83
+
84
+ ### Fixed
85
+ - Cold-boot ordering: routes/commands register through `ctx.inject`, so the plugin works even when
86
+ it activates before `webServer` / `commands` exist.
87
+ - Duplicate HTTP handlers after plugin toggle/hot reload: host state and route disposers now live in
88
+ a process-wide registry, so re-applying the plugin disposes the previous handlers.
89
+ - Client keeps a stale plan when the host reports none; `plan:null` now clears the cached plan so
90
+ the bar falls back to its always-on state.
91
+
92
+ ### Security
93
+ - Debug endpoints (`theme`, `experiment`, `autojob`, `steps`, `reset`) are only registered when
94
+ `enableDebugRoutes: true`; production endpoints are `state`, `debug`, `diag`, `replan`, `warm`.
95
+ - No credentials are stored in the plugin; model calls use the host `llm` service.