dsh-github-copilot 0.4.0-alpha.129 → 0.4.0-alpha.130

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,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0-alpha.130 (prepared)
4
+
5
+ - Add explicit offline analysis for a caller-selected persisted diagnostics unit or reviewed aggregate view (#368). Bound reads, reject unsafe/changed inputs, and write strict reports only to a new explicitly selected local file.
6
+ - Keep version, Client/Host, operation, terminal outcome and duration populations distinct. Preserve overflow and collection gaps; do not infer failure rates, live pending state, root cause or improvement from unmatched or persisted-only evidence.
7
+ - Synthetic tests cover read safety and report semantics; the first descriptive report remains private local evidence. No live profile read, collection change, upload, schedule, install or restart is part of release validation.
8
+
3
9
  ## 0.4.0-alpha.129
4
10
 
5
11
  - Keep ordinary post-compaction steps and requests without a fresh usage sample quiet instead of repeatedly showing context-sampling uncertainty (#367).
package/README.md CHANGED
@@ -27,7 +27,7 @@ Visible Models and Credits resolve missing names for saved accounts without acti
27
27
 
28
28
  Adding an account now keeps the device-authorization link, selectable URL, one-time code, Copy code action and Cancel together while authorization is pending. After GitHub authorizes, identity and model verification are shown as a separate phase. Adding never changes the global default; use the existing explicit **Switch** action when ready. Technical diagnostics are secondary, and account/turn identity fallbacks never expose opaque account IDs or infer historical identity from today's settings.
29
29
 
30
- **Package version: `0.4.0-alpha.129` (prepared). Supported host: official DSH / Windows Desktop `0.2.0-rc.2`.** Earlier DSH pins are historical evidence, not supported installation targets. Publication, profile installation and the version loaded by a running Host are separate states. Verify the published Release and assets before using the versioned commands below; these instructions do not prove publication or installation.
30
+ **Package version: `0.4.0-alpha.130` (prepared). Supported host: official DSH / Windows Desktop `0.2.0-rc.2`.** Earlier DSH pins are historical evidence, not supported installation targets. Publication, profile installation and the version loaded by a running Host are separate states. Verify the published Release and assets before using the versioned commands below; these instructions do not prove publication or installation.
31
31
 
32
32
  ## What you can do
33
33
 
@@ -52,10 +52,13 @@ The [local diagnostics pilot](./docs/plugin-diagnostics.md) records bounded
52
52
  account/Checking and compaction aggregates, **default off**. After installing
53
53
  and loading the published build, open the plugin detail settings page →
54
54
  **Local diagnostics → Read status → Enable local collection**. This enables
55
- local persistence, not uploads or daily analysis. Pause preserves evidence;
56
- Clear requires separate confirmation. Client/Host populations, uncovered paths
57
- and reporting/storage gaps remain explicit. Normal use supplies future evidence,
58
- not reconstructed history or proof of an improvement.
55
+ local persistence, not uploads or scheduled analysis. The package also has an
56
+ explicit offline analyzer for a caller-selected persisted unit or reviewed
57
+ aggregate view; it writes only to a new local report file and never scans,
58
+ uploads or changes collection. Pause preserves evidence; Clear requires
59
+ separate confirmation. Client/Host populations, uncovered paths and
60
+ reporting/storage gaps remain explicit. Descriptive counts are not reconstructed
61
+ history, failure rates or proof of an improvement.
59
62
 
60
63
  | Task | Where to start |
61
64
  |---|---|
@@ -93,10 +96,10 @@ Supply any launcher patches with repeated `--patch /absolute/file`. Require `sup
93
96
  For a **standalone named profile**:
94
97
 
95
98
  ```sh
96
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.129/dsh-github-copilot-0.4.0-alpha.129.tgz
99
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.130/dsh-github-copilot-0.4.0-alpha.130.tgz
97
100
  ```
98
101
 
99
- For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.129` after publication. Official rc.2's **Desktop-bundled CLI** also supports reserved-profile plugin management; a global/generic `dsh` shim is not equivalent. Qualify the installed entry before use. See [Desktop CLI qualification](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2) and the distinct [standalone offline procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles). Neither path authorizes registry-policy bypass, peer patches or configuration deletion.
102
+ For **Desktop**, its native package manager accepts `dsh-github-copilot@0.4.0-alpha.130` after publication. Official rc.2's **Desktop-bundled CLI** also supports reserved-profile plugin management; a global/generic `dsh` shim is not equivalent. Qualify the installed entry before use. See [Desktop CLI qualification](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2) and the distinct [standalone offline procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles). Neither path authorizes registry-policy bypass, peer patches or configuration deletion.
100
103
 
101
104
  After an approved reload/restart:
102
105
 
@@ -269,14 +272,14 @@ Commit attribution uses `Assisted-by` with the actual tool, never the model prov
269
272
  GitHub Releases and npm distribute the same original verified tarball. Pin a version; verify Release SHA-256 or npm `dist.integrity`. Never repack an immutable release or move/reuse its tag.
270
273
 
271
274
  ```sh
272
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.129/dsh-github-copilot-0.4.0-alpha.129.tgz
273
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.129/SHA256SUMS
275
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.130/dsh-github-copilot-0.4.0-alpha.130.tgz
276
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.130/SHA256SUMS
274
277
  sha256sum --check SHA256SUMS
275
278
  ```
276
279
 
277
280
  ```powershell
278
281
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
279
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.129.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
282
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.130.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
280
283
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
281
284
  ```
282
285
 
package/README.zh.md CHANGED
@@ -24,7 +24,7 @@ Models 和 Chat 共用不透明、随主题适配的账号下拉层;原生菜
24
24
 
25
25
  添加账号时,设备授权链接、可选择的网址、一次性授权码、复制授权码和取消操作会同时显示。GitHub 授权完成后,会单独显示身份与可用模型验证阶段。添加账号不会更改全局默认;准备好后仍需显式执行现有的**切换**操作。技术诊断收在次级折叠区;账号/历史 turn 缺少身份时不会暴露不透明账号 ID,也不会根据当前设置推断历史身份。
26
26
 
27
- **包版本:`0.4.0-alpha.129`(准备中)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。执行下方带版本的命令前须核验正式发布与资产;这些说明不证明已发布或已安装。
27
+ **包版本:`0.4.0-alpha.130`(准备中)。支持宿主:官方 DSH / Windows Desktop `0.2.0-rc.2`。** 较早 DSH pin 仅是历史证据,不是当前安装目标。已发布、已安装到 profile、已被运行中的 Host 加载,是三个不同状态。执行下方带版本的命令前须核验正式发布与资产;这些说明不证明已发布或已安装。
28
28
 
29
29
  ## 你可以做什么
30
30
 
@@ -43,9 +43,10 @@ Models 和 Chat 共用不透明、随主题适配的账号下拉层;原生菜
43
43
  [本地诊断试点](./docs/plugin-diagnostics.md)记录有界的账号/Checking 与压缩
44
44
  汇总,**默认关闭**。安装并加载已发布版本后,进入插件详情设置页 →
45
45
  **Local diagnostics → Read status → Enable local collection**,开启本地持久化;
46
- 不上传,不启用每日分析。暂停保留证据,清除需单独确认。Client/Host 分开统计,
47
- 未覆盖路径、报告丢失与存储故障明确显示。正常使用产生后续优化所需的证据,
48
- 不会重建历史错误率,也不表示优化效果已被验证。
46
+ 不上传,不启用定时分析。包内另提供显式离线分析器,只处理调用者指定的持久化单元
47
+ 或经审阅的聚合视图,并且只新建本地报告文件;不会扫描、上传或更改采集设置。
48
+ 暂停保留证据,清除需单独确认。Client/Host 分开统计,未覆盖路径、报告丢失与存储
49
+ 故障明确显示。描述性计数不是历史重建、错误率,也不表示优化效果已被验证。
49
50
 
50
51
  | 任务 | 入口 |
51
52
  |---|---|
@@ -83,10 +84,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
83
84
  **独立具名 profile**:
84
85
 
85
86
  ```sh
86
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.129/dsh-github-copilot-0.4.0-alpha.129.tgz
87
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.130/dsh-github-copilot-0.4.0-alpha.130.tgz
87
88
  ```
88
89
 
89
- **Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.129`。官方 rc.2 **Desktop 随附的专属 CLI**也支持管理保留 profile;全局/普通 `dsh` shim 不等价。使用前核验实际安装入口,参见[Desktop CLI 核验](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2)及独立的[具名 profile 离线流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)。两种路径都不授权绕过包源政策、修改 peer 或删除配置。
90
+ **Desktop** 原生包管理器在发布后接受 `dsh-github-copilot@0.4.0-alpha.130`。官方 rc.2 **Desktop 随附的专属 CLI**也支持管理保留 profile;全局/普通 `dsh` shim 不等价。使用前核验实际安装入口,参见[Desktop CLI 核验](./docs/npm-distribution.md#desktop-bundled-cli-on-official-rc2)及独立的[具名 profile 离线流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)。两种路径都不授权绕过包源政策、修改 peer 或删除配置。
90
91
 
91
92
  经批准 reload/restart 后:
92
93
 
@@ -259,14 +260,14 @@ Agent 从 `node scripts/agent.mjs describe --json`、`doctor --json`及`plan <ta
259
260
  GitHub Releases 和 npm 分发同一原始已校验 tarball。固定版本并核验 Release SHA-256 或 npm `dist.integrity`;不重打包不可变 Release、不移动/复用 tag。
260
261
 
261
262
  ```sh
262
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.129/dsh-github-copilot-0.4.0-alpha.129.tgz
263
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.129/SHA256SUMS
263
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.130/dsh-github-copilot-0.4.0-alpha.130.tgz
264
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.130/SHA256SUMS
264
265
  sha256sum --check SHA256SUMS
265
266
  ```
266
267
 
267
268
  ```powershell
268
269
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
269
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.129.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
270
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.130.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
270
271
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
271
272
  ```
272
273
 
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.4.0-alpha.129"
11
+ "version": "0.4.0-alpha.130"
12
12
  },
13
13
  "evidence": {
14
14
  "kind": "source-and-synthetic-test-inventory",
@@ -118,6 +118,70 @@ factory in its own isolated realm, sharing the actual public Cordis identity.
118
118
  It does not substitute tagged source for published bytes or attach to a live
119
119
  Client module registry; factory qualification is not Desktop activation proof.
120
120
 
121
+ ## Explicit offline analysis (#368)
122
+
123
+ The package provides a separate, read-only analyzer for one explicitly selected
124
+ aggregate file. Build the package first, then provide an absolute input path, an
125
+ input mode, and a new local output path. The output is created exclusively and
126
+ is never printed to stdout or sent over the network:
127
+
128
+ ```sh
129
+ node scripts/analyze-diagnostics.mjs --input "ABSOLUTE_UNIT_FILE.json" --mode persisted-unit --profile-name "PROFILE_NAME" --output "NEW_LOCAL_REPORT.json"
130
+ ```
131
+
132
+ Replace the quoted placeholders before running; the input must be an absolute
133
+ path whose basename matches the profile-qualified unit filename.
134
+
135
+ For an explicitly reviewed Client/Host Remote view export, use
136
+ `--mode reviewed-view` and omit `--profile-name`. The persisted-unit mode
137
+ requires the unit basename and unit envelope to match the supplied 1–48
138
+ character ASCII DSH profile name; the name is mapped using the same public
139
+ profile-qualified storage-domain convention as the collector. The operator
140
+ must identify the file and profile. The tool never searches DSH homes,
141
+ enumerates storage units, opens a storage-domain writer or RPC, reads Settings,
142
+ credentials or history, or falls back between modes.
143
+
144
+ Both modes reuse the collector's strict Zod snapshot/view vocabulary. The
145
+ reader rejects symlinks and non-files, caps input at 8 MiB, opens only for
146
+ reading, decodes fatal UTF-8, and checks file identity, size and modification
147
+ metadata before and after reading. These checks bound and detect ordinary
148
+ concurrent changes; they do not attest the active Host's backend and cannot
149
+ eliminate every filesystem race. Errors expose fixed diagnostic codes, not
150
+ paths, rejected values or raw filesystem details. The strict versioned report
151
+ contains only validated dimensions, bounded counts and explicit gaps. An
152
+ existing output is never overwritten.
153
+
154
+ Populations stay separate by build version, Client/Host layer and operation,
155
+ including logical/physical pairs. Starts and terminal counters are reported
156
+ independently because UTC-hour aggregation and retention can censor either
157
+ side; pending-start subtraction and exact operation failure rates are never
158
+ calculated. Only terminal observations enter duration bins. Stage-age bins are
159
+ cumulative operation ages, not exclusive phase timings. Client pending samples
160
+ are repeated historical observations, not an outstanding-work gauge; persisted
161
+ Host pending rows describe the stored snapshot, not current live work.
162
+
163
+ Outcomes remain separate, including policy rejection, revocation,
164
+ environment-fault, unknown and interrupted. Safe sums that exceed JavaScript's
165
+ exact integer range become `null` with an overflow gap. Fixed semantic candidate
166
+ fingerprints contain only coverage version, layer, operation, metric and
167
+ allowlisted reason—never identity hashes. Candidates do not prove a regression,
168
+ persistent fault, unique impact or root cause. Reports do not claim calibrated
169
+ thresholds, trends, percentiles, effectiveness or live collection status from
170
+ a persisted-only file. Empty, stale, paused, dirty, saturated, dropped,
171
+ evicted, interrupted and clock-discontinuous evidence remains explicit;
172
+ missing account-switch or compaction observations are gaps, not zero failures.
173
+ A physical summary-call success is explicitly not a native checkpoint commit;
174
+ only the logical compaction population can label a matching checkpoint and end
175
+ as observed success.
176
+
177
+ The first locally qualified persisted snapshot produced a private descriptive
178
+ report outside the repository. It is not a release artifact, CI fixture, issue
179
+ attachment or proof that alpha.128 is installed, loaded, collecting now, or
180
+ representative of current behavior. Do not publish that report or its counts
181
+ without separate sharing approval. Synthetic tests never read production
182
+ storage. There is no scheduler, automatic analysis, upload, issue creation,
183
+ repair or live-profile mutation in this milestone.
184
+
121
185
  ## Archived phase-0 qualification and proposals
122
186
 
123
187
  The remaining sections preserve the reviewed phase-0 inventory. Their proposed
package/lib/client.js CHANGED
@@ -6988,7 +6988,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6988
6988
  };
6989
6989
  //#endregion
6990
6990
  //#region package.json
6991
- var version = "0.4.0-alpha.129";
6991
+ var version = "0.4.0-alpha.130";
6992
6992
  //#endregion
6993
6993
  //#region lib/types/diagnostics-client.js
6994
6994
  let owner;
@@ -0,0 +1,78 @@
1
+ import { lstat, open } from "node:fs/promises";
2
+ import { isAbsolute } from "node:path";
3
+ import { TextDecoder } from "node:util";
4
+ //#region lib/types/diagnostics-analysis-io.js
5
+ const DIAGNOSTICS_ANALYSIS_MAX_INPUT_BYTES = 8388608;
6
+ const fileSystem = {
7
+ lstat,
8
+ open
9
+ };
10
+ function failure(code) {
11
+ throw new Error(`COPILOT_DIAGNOSTICS_ANALYSIS_${code}`);
12
+ }
13
+ function sameFile(left, right) {
14
+ return left.dev === right.dev && left.ino === right.ino;
15
+ }
16
+ function sameContentState(left, right) {
17
+ return sameFile(left, right) && left.size === right.size && left.mtimeMs === right.mtimeMs;
18
+ }
19
+ async function readBoundedDiagnosticsFile(filePath, io = fileSystem) {
20
+ if (!isAbsolute(filePath)) failure("INVALID_PATH");
21
+ let pathBefore;
22
+ try {
23
+ pathBefore = await io.lstat(filePath);
24
+ } catch {
25
+ failure("FILE_READ_FAILED");
26
+ }
27
+ if (pathBefore.isSymbolicLink()) failure("SYMLINK_REJECTED");
28
+ if (!pathBefore.isFile()) failure("NOT_REGULAR_FILE");
29
+ if (pathBefore.size > 8388608) failure("INPUT_LIMIT");
30
+ let handle;
31
+ try {
32
+ handle = await io.open(filePath, "r");
33
+ } catch {
34
+ failure("FILE_READ_FAILED");
35
+ }
36
+ let text;
37
+ try {
38
+ const before = await handle.stat();
39
+ if (!before.isFile()) failure("NOT_REGULAR_FILE");
40
+ if (before.size > 8388608) failure("INPUT_LIMIT");
41
+ if (!sameContentState(pathBefore, before)) failure("FILE_CHANGED");
42
+ const bytes = Buffer.alloc(8388609);
43
+ let offset = 0;
44
+ while (offset < bytes.length) {
45
+ const { bytesRead } = await handle.read(bytes, offset, bytes.length - offset, offset);
46
+ if (bytesRead === 0) break;
47
+ offset += bytesRead;
48
+ }
49
+ const after = await handle.stat();
50
+ let pathAfter;
51
+ try {
52
+ pathAfter = await io.lstat(filePath);
53
+ } catch {
54
+ failure("FILE_CHANGED");
55
+ }
56
+ if (pathAfter.isSymbolicLink()) failure("SYMLINK_REJECTED");
57
+ if (!pathAfter.isFile() || !after.isFile()) failure("NOT_REGULAR_FILE");
58
+ if (offset > 8388608 || before.size > 8388608 || after.size > 8388608) failure("INPUT_LIMIT");
59
+ if (offset !== before.size || !sameContentState(before, after) || !sameContentState(pathBefore, pathAfter) || !sameFile(pathAfter, after)) failure("FILE_CHANGED");
60
+ try {
61
+ text = new TextDecoder("utf-8", { fatal: true }).decode(bytes.subarray(0, offset));
62
+ } catch {
63
+ failure("INVALID_UTF8");
64
+ }
65
+ } catch (error) {
66
+ if (error instanceof Error && error.message.startsWith("COPILOT_DIAGNOSTICS_ANALYSIS_")) throw error;
67
+ failure("FILE_READ_FAILED");
68
+ } finally {
69
+ try {
70
+ await handle.close();
71
+ } catch {
72
+ failure("FILE_READ_FAILED");
73
+ }
74
+ }
75
+ return text;
76
+ }
77
+ //#endregion
78
+ export { DIAGNOSTICS_ANALYSIS_MAX_INPUT_BYTES, readBoundedDiagnosticsFile };