@skillre/dsh-plugin-work-dashboard 0.0.0-stage → 0.9.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.
Files changed (73) hide show
  1. package/LICENSE +21 -0
  2. package/README.en.md +259 -0
  3. package/README.md +371 -2
  4. package/UNINSTALL.md +7 -0
  5. package/compatibility.json +195 -0
  6. package/cordis.patch.yml +24 -0
  7. package/docs/DESIGN-0.3.md +122 -0
  8. package/docs/DETAIL.md +1 -0
  9. package/docs/DETAIL.zh.md +1 -0
  10. package/docs/PLAN-0.7-0.9.md +230 -0
  11. package/docs/preview.svg +254 -0
  12. package/docs/preview.zh.svg +254 -0
  13. package/icon.svg +17 -0
  14. package/lib/blockers.d.ts +45 -0
  15. package/lib/blockers.js +160 -0
  16. package/lib/client/api.d.ts +42 -0
  17. package/lib/client/api.js +45 -0
  18. package/lib/client/contracts.d.ts +94 -0
  19. package/lib/client/contracts.js +21 -0
  20. package/lib/client/css/base.d.ts +31 -0
  21. package/lib/client/css/base.js +461 -0
  22. package/lib/client/css/blockers.d.ts +18 -0
  23. package/lib/client/css/blockers.js +196 -0
  24. package/lib/client/css/charts.d.ts +14 -0
  25. package/lib/client/css/charts.js +191 -0
  26. package/lib/client/css/detail.d.ts +21 -0
  27. package/lib/client/css/detail.js +423 -0
  28. package/lib/client/css/insights.d.ts +27 -0
  29. package/lib/client/css/insights.js +660 -0
  30. package/lib/client/css/overview.d.ts +23 -0
  31. package/lib/client/css/overview.js +327 -0
  32. package/lib/client/css/summary.d.ts +13 -0
  33. package/lib/client/css/summary.js +187 -0
  34. package/lib/client/format.d.ts +57 -0
  35. package/lib/client/format.js +96 -0
  36. package/lib/client/preferences.d.ts +56 -0
  37. package/lib/client/preferences.js +118 -0
  38. package/lib/client/styles.d.ts +17 -0
  39. package/lib/client/styles.js +24 -0
  40. package/lib/client/text.d.ts +32 -0
  41. package/lib/client/text.js +1112 -0
  42. package/lib/client/view-contract.d.ts +118 -0
  43. package/lib/client/view-contract.js +28 -0
  44. package/lib/client.js +6599 -0
  45. package/lib/config.d.ts +61 -0
  46. package/lib/config.js +67 -0
  47. package/lib/form.d.ts +218 -0
  48. package/lib/form.js +1075 -0
  49. package/lib/gap.d.ts +60 -0
  50. package/lib/gap.js +227 -0
  51. package/lib/index.d.ts +40 -0
  52. package/lib/index.js +159 -0
  53. package/lib/repo.d.ts +124 -0
  54. package/lib/repo.js +407 -0
  55. package/lib/risks.d.ts +24 -0
  56. package/lib/risks.js +85 -0
  57. package/lib/skill.d.ts +94 -0
  58. package/lib/skill.js +220 -0
  59. package/lib/store.d.ts +63 -0
  60. package/lib/store.js +505 -0
  61. package/lib/timeline.d.ts +23 -0
  62. package/lib/timeline.js +93 -0
  63. package/lib/transport.d.ts +67 -0
  64. package/lib/transport.js +131 -0
  65. package/lib/types.d.ts +701 -0
  66. package/lib/types.js +78 -0
  67. package/locale/en.json +7 -0
  68. package/locale/zh.json +7 -0
  69. package/package.json +117 -4
  70. package/skills/poc-export/SKILL.md +81 -0
  71. package/skills/poc-export/scripts/export-form.mjs +654 -0
  72. package/skills/poc-ledger/SKILL.md +171 -0
  73. package/skills/poc-submit/SKILL.md +186 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 skillre
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md ADDED
@@ -0,0 +1,259 @@
1
+ # @skillre/dsh-plugin-work-dashboard
2
+
3
+ > Status: experimental · targets DSH `0.2.2-rc.2`
4
+
5
+ Adds a **Work Dashboard** entry to the DSH left sidebar: a **multi-module** operations board that puts everything in flight in one place, so you can see what is moving before deciding what to fix. Only the first module, **POC Operations**, is implemented today.
6
+
7
+ [中文](README.md)
8
+
9
+ ## Why "multi-module"
10
+
11
+ The plugin used to be called "POC console" and served one ledger. It became a *container*: the module rail at the top is a seat, POC Operations is the first module sitting in it, and later modules (customer visits, hiring, project retros) join the same Host row without a new plugin.
12
+
13
+ ```
14
+ Work Dashboard (plugin)
15
+ └── POC Operations (module 1, the only implemented one)
16
+ ├── KPI strip total / in progress / budget / blocked / G0 passed + stage chips
17
+ ├── Portfolio band stage funnel (with in-stage completion) / system-company / type mix / amount concentration / dimension coverage / gap rules
18
+ ├── Budget panel G0 passed / awaiting review / no amount, plus the system split and concentration
19
+ ├── Projects the same list, read three ways: cards · board · table
20
+ ├── Blockers five sources merged and grouped by project: gap rules / stalled / no amount / no progress / no stage date
21
+ ├── Project detail stage-aware skeleton: basic info / worklist, then the blocks the current gate needs
22
+ ├── Risk board severity swimlanes + a distribution figure
23
+ ├── Global timeline grouped by month + a monthly distribution + the silent projects
24
+ └── Export form a self-contained v3 collection form whose YAML can be committed as-is
25
+ ```
26
+
27
+ ## Three bundled skills
28
+
29
+ Installing this plugin also installs three POC skills. They are not separate
30
+ install items and they do not version separately:
31
+
32
+ | Skill | What it does | Triggered by |
33
+ |---|---|---|
34
+ | `poc-ledger` | Reads and analyses the v3 ledger: progress, stage, the twelve gap rules | "how is POC X doing", "which projects are stuck" |
35
+ | `poc-export` | Generates a self-contained HTML form for colleagues without a GitHub account | "export a form", "have someone fill in this project's progress" |
36
+ | `poc-submit` | Validates the colleague's `.json`, merges it into the v3 YAML, opens a Draft PR | "submit this file", "open a PR for me" |
37
+
38
+ **Why bundle them**: these skills describe the same fields the dashboard reads. They
39
+ used to be installed separately into the user's skill directory, and when the data
40
+ model moved from v1 to v3 the skills kept teaching the model `why_customer_test` /
41
+ `result` / `timeline` — fields that no longer exist. Shipping them in one package on
42
+ one version makes that drift impossible.
43
+
44
+ - Skill files live at `skills/<name>/SKILL.md`; the export skill also ships an
45
+ executable `skills/poc-export/scripts/export-form.mjs`.
46
+ - Registration goes through DSH's `skills` service (`ctx.skills.register`,
47
+ `source: 'bundled'`) and is bound to the plugin's own Fiber, so uninstalling
48
+ removes it.
49
+ - `skills` is an **optional** service: a profile without a skill registry still
50
+ gets the dashboard, just without the skills (a warning is logged).
51
+ - All three were rewritten: v3 field model, 8 gap rules → 12, and the export script
52
+ replaced the dead external `poc_form.py` with a bundled `export-form.mjs` (verified
53
+ in a real browser: autosave, live gap counts, focus preservation, draft persistence).
54
+
55
+ ## What the module solves
56
+
57
+ A POC ledger rots at "it feels like it worked": the project says the goal was met but there is no evidence; the evidence exists but the customer never confirmed it in writing; it genuinely worked and nothing followed. Written into one `result` field, those three collapse into "going well", and nobody notices that *it worked but nothing was banked* is the most valuable gap of all.
58
+
59
+ The module keeps them as four independent dimensions, renders them separately, and layers a hard-coded rule set on top that orders what needs fixing by severity.
60
+
61
+ ## Features
62
+
63
+ ### Data and refresh
64
+
65
+ - **Sidebar entry** in `sidebar.panellist`; clicking it swaps the centre column to the dashboard.
66
+ - **Empty state**: on a cold cache the page says "no data yet, hit Refresh", and discloses the data source and cache path.
67
+ - **Manual refresh**: `git clone` on the first pull, then `git fetch` + `git reset --hard origin/main`; shows progress and "refreshed at HH:MM".
68
+ - **Refresh settings**: off (default) / every 10 minutes / every hour / custom minutes, stored in `localStorage`, only active while the page is open.
69
+ - **Refresh failure**: a clear reason (not logged in / no access / unreachable / timeout / already running) plus a Retry button, and the board stays on screen.
70
+
71
+ ### Portfolio band
72
+
73
+ The first screen answers "where is the money and the risk" before it answers "which project is this". Six figures, each also a filter:
74
+
75
+ - **Stage distribution**: a column chart of G0→G4, tinted red where a stage carries a high-severity gap; click a column to filter that stage.
76
+ - **System / company**: horizontal bars ordered by amount; click a row to filter.
77
+ - **Project types**: a donut of `poc_type` composition, with the project count in the hole.
78
+ - **Amount concentration**: the five largest projects and their share of the total; a concentration warning when one project exceeds a third.
79
+ - **Dimension coverage**: four radial meters showing how much of the portfolio has each dimension.
80
+ - **Gap rules fired**: which rules are happening systemically, not one finding at a time.
81
+
82
+ The band collapses to its header in one click — it is context, and it must not own the screen. The project list is visible without scrolling at 1440×900.
83
+
84
+ ### Projects: one dataset, three readings
85
+
86
+ | View | Question it answers | Shape |
87
+ |---|---|---|
88
+ | **Cards** (default) | What does this project lack? | mini stage rail + amount + latest progress + four dimension marks + gap badge |
89
+ | **Board** | Where is everything piled up? | one column per stage, header carrying count and amount |
90
+ | **Table** | Show me the numbers | the spec's seven columns, sortable sticky head, amount bar behind each figure |
91
+
92
+ All three share one filtered, sorted list from the shell, so switching never changes which projects are visible. The toolbar provides search (name / id / owner / company), composable filter chips (system / stage / status / type), sort key and direction, and a live result count.
93
+
94
+ **Keyboard**: `↑/↓` moves the cursor, `Enter` opens, `Esc` returns, `/` focuses search.
95
+
96
+ ### Pending list
97
+
98
+ Grouped by **rule** rather than flattened: twelve rules across twenty-three projects is a systemic pattern, and grouping shows "everyone is missing the decision chain" at a glance. Each group carries the rule number, how many projects hit it, and a severity band.
99
+
100
+ ### Four dimensions and stages
101
+
102
+ - **Four dimensions**: goal met, evidence, customer recognition, next step — **always four separate elements**, each with its own present/absent state, each tagged *derived* or *hand-filled* so it is clear which side supplied the value.
103
+ - **Stage track**: a five-step G0→G4 rail. Completion comes from the ledger's own gate fields (`gate0.complete`, `plan.gate1.conclusion`, `plan.gate2.ready`, the newest `progress.gate3_2`, `outcome.achievement`), never inferred from the current stage position.
104
+ - **Detail page** in two panes: a sticky project file on the left (name, amount, vertical stage track, four dimensions, gaps, people, prev/next), and a scrolling reading pane on the right where each section uses the shape its data deserves:
105
+ - **Progress stream** (the core): each entry is a card on a vertical timeline with a recognition-toned node, a goal→actual pair, scope chips, evidence as real anchors, customer sync and recognition, G3-1/G3-2, a completion meter parsed from the percentage, and a next-step block that says so when there is no next step.
106
+ - **Four dimensions**: four independent cards with their origin tags.
107
+ - **G0 meter**: a five-cell completeness meter (`tech_owner` is read from the identity block), with the two narrative fields rendered as prose.
108
+ - **Plan**: a criteria table, a numbered scenario list, and severity-marked risks.
109
+ - **Outcome**: three prose blocks plus a milestone callout that renders the missing next milestone as gap R11 — a red finding, not an empty field.
110
+
111
+ ### Enhanced views
112
+
113
+ - **Risk board**: severity swimlanes (high → medium → low → unrated) with a distribution figure above them; both come from one bucketing pass, so the figure and the list cannot disagree.
114
+ - **Global timeline**: grouped by month, with a month divider and a monthly distribution per group, newest first inside each group; rounds with no evidence or no customer feedback are marked explicitly.
115
+
116
+ ### Collection form
117
+
118
+ The **Export form** button in the header generates a self-contained HTML file for the projects the current filters show: double-click to fill in, drafts autosave locally, the gap rules' counts (2–3 criteria, 3–5 scenarios, at most 3 risks) are checked live, and it downloads real YAML — one file per project. Selecting nothing produces a blank new-project form.
119
+
120
+ The generated YAML is the v3 shape and reads back through this plugin's own parser; the form only asks for v3 fields (the five G0 prerequisites, the plan, and one appended progress entry), unlike the v1 generator it replaces.
121
+
122
+ ## The twelve gap rules
123
+
124
+ | # | Rule | Trigger | Level |
125
+ |---|---|---|---|
126
+ | 1 | G0 prerequisites missing | `gate0.missing` non-empty | high |
127
+ | 2 | Large amount without G0 clearance | `amount_wan >= 300` and conclusion is not 通过 | high |
128
+ | 3 | G0 passed but no success criteria | conclusion 通过 and `plan.criteria` empty | high |
129
+ | 4 | Success criteria not focused | criteria count outside 2–3 | medium |
130
+ | 5 | Scenarios not focused | scenarios count outside 3–5 | medium |
131
+ | 6 | Too many risks | risks count above 3 | medium |
132
+ | 7 | Testing before G2 is ready | any progress and `gate2.ready` is not Ready | high |
133
+ | 8 | Progress without evidence | newest entry has `actual` but no `evidence` | high |
134
+ | 9 | Evidence without customer recognition | newest entry has evidence and recognition is 未认可/待确认 | high |
135
+ | 10 | G3-1 provable, G3-2 unconfirmed | newest entry `gate3_1=可证明` and `gate3_2!=已确认` | high |
136
+ | 11 | Achieved with no next milestone | `achievement=达成` and `business.milestone` empty | high |
137
+ | 12 | Stage stalled | `stage_since` older than the threshold (default 45 days) | medium |
138
+
139
+ Rules 4–6 skip empty lists: an unplanned project is already caught by rule 3, and firing all three on day one would bury the real findings. Rules 8–10 read only the newest progress entry. Rule 12 does not fire when `stage_since` is absent — unknown is not the same as stalled.
140
+
141
+ ## Configuration
142
+
143
+ | Key | Default | Meaning |
144
+ |---|---|---|
145
+ | `repository` | `skillre/workbranch` | `owner/name` of the ledger repository |
146
+ | `defaultBranch` | `main` | branch to track |
147
+ | `remoteUrl` | `''` (i.e. `https://github.com/<repository>.git`) | clone URL override: GitHub Enterprise, a mirror, or a local test remote |
148
+ | `cacheRoot` | `~/.dsh/cache/work-dashboard` | where the read-only clone lives |
149
+ | `cloneTimeoutMs` | `120000` | hard ceiling for one `git clone` |
150
+ | `fetchTimeoutMs` | `60000` | hard ceiling for one `git fetch` + `reset --hard` |
151
+ | `stallDays` | `45` | days in one stage before rule 12 fires |
152
+
153
+ The cache is wiped on every Host start and rebuilt by the first Refresh; the marker file means the plugin refuses to clear a directory it did not create.
154
+
155
+ ## Install
156
+
157
+ **Final installation belongs to the user.** Open **Plugins** in the DSH Desktop Client or Web UI and choose the source yourself.
158
+
159
+ ### From the plugin market
160
+
161
+ ```
162
+ https://skillre.github.io/dsh-plugin-market/index.json
163
+ ```
164
+
165
+ Add it under **Discover → Index sources**, then install **Work Dashboard** from Discover. The index pins a
166
+ specific commit (`git+https://github.com/skillre/dsh-plugin-work-dashboard#<commit>`); the repository is
167
+ self-contained (`lib/` is committed, there is no `scripts.prepare`), so installation runs no build step.
168
+
169
+ ### Update mechanism (important)
170
+
171
+ Since the DSH `0.2.2` line, the bundle detail page has a **Versions** block that can check for and install
172
+ updates in place. It covers **third-party plugins installed from the npm registry** only — four conditions
173
+ must all hold (see the fleet's `docs/update-mechanism.md`):
174
+
175
+ | Condition | This plugin |
176
+ |---|---|
177
+ | Third-party bundle (not a shipped official one) | yes |
178
+ | The profile dependency is a registry spec saved under the package's own name | see below |
179
+ | The installed manifest's `version` parses as SemVer | yes, `0.4.0` |
180
+ | The package ships no `PROTECTED_PLUGINS` management row | yes, only `skillre-work-dashboard` |
181
+
182
+ Consequences:
183
+
184
+ - **Installed from the market (Git source)**: it appears under Installed but has **no Versions block**.
185
+ Upgrading means **uninstall → reinstall from the market**. That is DSH's verdict, not this plugin's choice.
186
+ - **Installed from npm** (`@skillre/dsh-plugin-work-dashboard`): it enters the official update path, so the
187
+ detail page can check versions, show pre-releases, and update in place.
188
+
189
+ npm publication runs through `.github/workflows/release.yml` with npm Trusted Publishing / OIDC (see
190
+ `RELEASING.md`). **No version is published on the registry yet** — the local npm credential returns 401 and the
191
+ repository has neither an `npm-publish` environment nor a Trusted Publisher, so only the Git channel works today; once
192
+ it is published, switching to the npm channel is what unlocks in-place updates:
193
+
194
+ 1. remove the Git-installed bundle in Plugins;
195
+ 2. enter `@skillre/dsh-plugin-work-dashboard@0.4.0` (or newer) in the install dialog;
196
+ 3. only then does the detail page gain its Versions block.
197
+
198
+ A local tarball is likewise **outside** the official update path.
199
+
200
+ ## Development verification
201
+
202
+ ```sh
203
+ npm install
204
+ npm run check # typecheck + 172 unit tests + lib-drift check + pack check
205
+ npm pack # produces skillre-dsh-plugin-work-dashboard-0.4.0.tgz
206
+ ```
207
+
208
+ Real mount verification **only against an owned, disposable, non-Desktop profile**:
209
+
210
+ ```sh
211
+ node scripts/verify-isolated.mjs # real clone/fetch/detail/auth/restart-wipe + risks/timeline, self-cleaning
212
+ node scripts/ui-preview.mjs # boots a bounded Web instance and writes .preview-url.txt
213
+ node scripts/ui-verify.mjs # browser assertions + docs/evidence/ screenshots
214
+ node scripts/verify-market-install.mjs # LIVE index → real install → routes answer (requires a published entry)
215
+ ```
216
+
217
+ `ui-preview.mjs` stops its processes and deletes the isolated root it created; `verify-isolated.mjs` cleans up in a `finally` and verifies the root is gone. Every script points `cacheRoot` inside the isolated profile and **never touches your real `~/.dsh/cache`**.
218
+
219
+ The UI harness must rebuild and repack before it runs: the preview installs the packed artifact, so verifying without a rebuild would verify the previous build.
220
+
221
+ ## Uninstall and rollback
222
+
223
+ See [UNINSTALL.md](UNINSTALL.md). All data lives in the GitHub repository, so uninstalling loses nothing; `~/.dsh/cache/work-dashboard` can be deleted by hand and is rebuilt on the next entry.
224
+
225
+ ## Compatibility
226
+
227
+ | DSH version | Result | Verified | Notes |
228
+ |---|---|---|---|
229
+ | 0.2.2-rc.2 | passed | 2026-11-13 | packed install + bounded startup + real clone + 31 isolated checks (incl. the three skills really reaching the skill catalog) + 15 live market npm-install checks (see `compatibility.json`) |
230
+ | 0.2.2-rc.1 | passed | 2026-11-06 | same behaviour + 69 browser assertions; 0.6.0 does not touch the client bundle, so that record still holds |
231
+
232
+ Machine-readable evidence is in `compatibility.json`; screenshots and reports are in `docs/evidence/`. **Desktop Client (Electron) was not verified**: its profile is managed by the app and this CLI harness cannot drive it, so a Desktop-specific visual check is still outstanding before Desktop delivery.
233
+
234
+ ## Implementation notes
235
+
236
+ - **Charts have no dependency.** The client bundle may only externalise `react`, so every figure is hand-built SVG or flex geometry with `role="img"`/`aria-label` plus a text summary. No charting library was added.
237
+ - **Styles are split per surface**: `css/base` (frame), `charts`, `overview`, `detail`, `insights`, concatenated in a fixed order in `styles.ts`, so modules can be developed in parallel without touching each other's sheets.
238
+ - **Aggregation happens on the Host**: `snapshot.analysis` (stage/system/type/amount/dimension/rule aggregations) and `detail.gate0.checklist` (the five prerequisites, including `tech_owner` from the identity block) are computed and shipped by the Host. The Client never re-derives them, so a chart cannot contradict the list beside it.
239
+
240
+ ## Known limitations
241
+
242
+ - **The cache is wiped on every DSH restart**, so you have to hit Refresh again (a clone takes about 1.5 s, longer on a slow network). That is intended behaviour.
243
+ - **Read-only**: no import, edit, or pull-request submission. Gaps can be seen but not fixed from the board.
244
+ - **Rule 12's date source**: v3 uses `stage_since`; a project without it is not reported as stalled rather than assumed to be.
245
+ - **Scheduled refresh only runs while the page is open**; closing the page stops it — intended.
246
+ - A private repository needs a local `gh` login with read access; without one, refresh reports "gh is not logged in" explicitly.
247
+ - **Only one module**: the module rail holds one module today; later modules join the same Host row.
248
+
249
+ ## Security and permissions
250
+
251
+ - **Network**: HTTPS to `github.com` (or the configured `remoteUrl`) through the local `git` and `gh` binaries.
252
+ - **Filesystem**: writes only inside `cacheRoot`; refuses to clear a directory it did not create (marker file).
253
+ - **Credentials**: the Host never reads, stores or forwards a token. `gh`'s own credential store is used by `git`/`gh`; the plugin never persists credentials into the cache.
254
+ - **No telemetry**, no third-party requests, no external fonts or CDNs. The generated form (when re-enabled) would be fully offline.
255
+ - **Read-only**: no writes to the ledger repository in this release.
256
+
257
+ ## License
258
+
259
+ MIT