dsh-github-copilot 0.4.0-alpha.87 → 0.4.0-alpha.88

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/AGENTS.md CHANGED
@@ -68,6 +68,7 @@ Alpha.25 admits native `subagent/descriptor` v3, already v3 in the retained rc.1
68
68
  - `src/responses-reasoning.ts`, `src/responses-reasoning-text.ts`: selected-model effort mapping and public summary assembly.
69
69
  - `src/tool-schema-compat.ts`: Copilot-only prompt-assembly filter for unusable escalation arguments and action-specific Goal update schemas.
70
70
  - `src/plan.ts`: Copilot-only, fail-closed hosted-search candidate lifecycle.
71
+ - `src/auto-assessment-evidence.ts`: bounded request-local semantic classifier milestones copied into strict ephemeral turn evidence; no prompts, replay, credentials or error bodies. Total includes preparation; adapter start and first text are not HTTP dispatch/byte timings. Keep one 8s deadline and 128-token compact output. Request reasoning-off only when supplier and public prepared-model effort agree; unsupported native controls stay unchanged. No guessed latency ranking, adaptive timeout, cooldown or cross-turn cache without reviewed observations.
71
72
  - `src/probe.ts`: bounded native-search capability proof.
72
73
  - `src/wire.ts`, `src/wire-anthropic.ts`: inline hosted-search streaming.
73
74
  - `src/traditional-search.ts`: `github-copilot-hosted` `ctx.web` provider.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0-alpha.88 (prepared)
4
+
5
+ - Capture bounded classifier model, total elapsed/budget, adapter-start, first-text, native finish and validation milestones in immutable ephemeral Auto turn evidence (#272). No prompts, raw outputs, credentials, replay or usage are recorded.
6
+ - Reduce auxiliary classification to 128 output tokens with compact demand/fixed-signal JSON. Request off reasoning only when supplier metadata and the published prepared-model capabilities agree; unsupported controls retain native policy.
7
+ - Explain semantic timeout as unknown-demand preference fallback and expose auxiliary milestones inside the existing bilingual disclosure. Preserve the 8s end-to-end deadline, cancellation/revocation, omitted-context guards and single attempt; no longer timeout, retries, guessed model-health ranking or measured improvement claim.
8
+
3
9
  ## 0.4.0-alpha.87 (prepared)
4
10
 
5
11
  - Remove managed terminal-zero usage filtering so native failure/cancellation samples remain available to Core's shared turn and cumulative accounting (#270).
package/README.md CHANGED
@@ -109,7 +109,7 @@ The Host reads GitHub's internal quota endpoint using the existing canonical OAu
109
109
 
110
110
  ## Install and sign in
111
111
 
112
- The commands below target the package version `0.4.0-alpha.87`. Versioned URLs describe the intended release artifacts, not proof that publication or local activation has completed; use them only once that Release and its checksums are available. Install into the profile you use (replace `web` when targeting another profile):
112
+ The commands below target the package version `0.4.0-alpha.88`. Versioned URLs describe the intended release artifacts, not proof that publication or local activation has completed; use them only once that Release and its checksums are available. Install into the profile you use (replace `web` when targeting another profile):
113
113
 
114
114
  Before installing/updating, unpack the **checksum-verified** archive into a temporary directory and run its read-only composition preflight (replace all paths with absolute paths for the intended profile):
115
115
 
@@ -122,10 +122,10 @@ Include any launcher patch files with repeated `--patch /absolute/file` argument
122
122
  For a standalone named profile only, the supported CLI command is:
123
123
 
124
124
  ```sh
125
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.87/dsh-github-copilot-0.4.0-alpha.87.tgz
125
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.88/dsh-github-copilot-0.4.0-alpha.88.tgz
126
126
  ```
127
127
 
128
- For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.87` after the same preflight and only when registry access is permitted. Desktop reserves its `desktop` profile from CLI management. If registry access is blocked or unavailable, stop; the documented [controlled offline CLI procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles) is not a Desktop workaround.
128
+ For Desktop profiles, use Desktop's native package manager with `dsh-github-copilot@0.4.0-alpha.88` after the same preflight and only when registry access is permitted. Desktop reserves its `desktop` profile from CLI management. If registry access is blocked or unavailable, stop; the documented [controlled offline CLI procedure](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles) is not a Desktop workaround.
129
129
 
130
130
  Then open the Models UI listed above, find **GitHub Copilot**, select **Sign in**, and complete the GitHub device-code flow. Plugin installation changes the selected profile; activation follows that profile's normal reload/restart policy.
131
131
 
@@ -149,6 +149,8 @@ Local rules also recognize isolated fenced JSON/CSV conversions and line sorting
149
149
 
150
150
  Semantic assessment is **enabled by default**, using one bounded auxiliary model call **only when local demand is unknown**. Set `github-copilot.autoSemanticAssessment: false` to opt out; existing explicit false settings remain respected and are not migrated. Its bounded input prioritizes current and preceding user requests without dismissing omitted context. It adds latency and supplier charges not included in native chat Usage. Failure or omitted assessment context never means the task is simple; it retains conservative local evidence. This user-authorized rollout is not labeled-corpus calibration or GitHub's private Auto service.
151
151
 
152
+ Auto's auxiliary semantic assessment uses a single 8-second deadline and 128-token compact JSON output budget. Its existing selection disclosure can show the classifier ID, total elapsed/budget, adapter-start and first-text milestones, native finish and result validation. A timeout leaves task demand unknown and uses the preference-policy fallback; it is not a main-answer timeout or evidence the task is complex. These content-free, ephemeral observations are not HTTP timings or native Usage, and do not yet prove a speed improvement. Reasoning-off is requested only when current supplier metadata and the public prepared model both support it; otherwise native policy stays intact. See [assessment boundaries](docs/auto-task-routing.md#auxiliary-latency-evidence-and-bounded-output-272).
153
+
152
154
  Completed Copilot replies show **Auto (preference)** and an expandable recorded reason after native Usage/time, or **Manual** only with captured explicit fixed-selection evidence. A successful read with no retained evidence shows **Selection unknown**, never a guess from today's picker. Failed reads instead show **Selection unavailable → Retry**; retry only reads the same turn's record, not another model request. Explicit Session/turn arguments remain stable inside a session-bound Chat, avoiding the former native gateway argument-count failure on fresh master/lead replies. There is no repeated model name or separate Model details button: actual model display stays in native Usage, whose missing-route behavior is unchanged. New selection records are bounded and Host-local; restart, disposal or eviction loses them. Compatible historical Auto records remain readable. The public assistant-actions slot supports internal wrapping only, not changing the native fixed-height row.
153
155
 
154
156
  The information button explains this turn's captured task/category choice, fallback and continuity/tie-breaking. Supporting assessment facts sit in a disclosure; older records without details explicitly say that the reason was not retained.
@@ -186,7 +188,7 @@ Agents should treat the browser authorization as a human handoff, not as a token
186
188
  5. Confirm **Signed in** and inspect the automatic discovery result before asking the user to choose a model. Already-signed-in Models opening ensures missing/stale metadata automatically; fresh ready cache makes no request. Use visible **Retry** for errors or **Manage → Refresh models** for an intentional forced update, not routine setup. Status alone does not discover, and login, metadata and successful model calls remain separate evidence.
187
189
  6. Use **Sign out** only when the user explicitly asks to disconnect the account. It deletes the Copilot credential record but preserves route settings.
188
190
 
189
- GitHub Releases and npm are the default distribution channels for each new version, using the same verified tarball. Pin the version and verify the evidence for the channel used: Release `SHA256SUMS`, and npm `dist.integrity` when installing from npm. Install into Desktop profiles only through Desktop's native package manager; the reserved `desktop` profile is not managed by the DSH CLI. After npm publication is verified, the native manager accepts `dsh-github-copilot@0.4.0-alpha.87`, not a URL or file. Controlled offline CLI maintenance is documented for standalone named profiles only, never Desktop-managed profiles. Follow the mandatory search-composition preflight, backup, single-writer and post-install checks; do not bypass a corporate registry ban, disable TLS verification or restart without separate approval. See [distribution and publication requirements](./docs/npm-distribution.md).
191
+ GitHub Releases and npm are the default distribution channels for each new version, using the same verified tarball. Pin the version and verify the evidence for the channel used: Release `SHA256SUMS`, and npm `dist.integrity` when installing from npm. Install into Desktop profiles only through Desktop's native package manager; the reserved `desktop` profile is not managed by the DSH CLI. After npm publication is verified, the native manager accepts `dsh-github-copilot@0.4.0-alpha.88`, not a URL or file. Controlled offline CLI maintenance is documented for standalone named profiles only, never Desktop-managed profiles. Follow the mandatory search-composition preflight, backup, single-writer and post-install checks; do not bypass a corporate registry ban, disable TLS verification or restart without separate approval. See [distribution and publication requirements](./docs/npm-distribution.md).
190
192
 
191
193
  **Desktop package-update and Web-lifecycle boundaries:** the native manager's `restart-required` result for an in-place installed-package upgrade is authoritative and distinct from plugin-bundle removal/re-add behavior. Any disable, removal, or upgrade involving service recomposition (`cordis.patch.yml`, such as the isolated routed web search layer) may leave dependent entries pending until Desktop is fully exited and cold-restarted. If the native manager reports only entries such as `pending (waiting for service: web)` while this plugin already shows **Off**, the requested disabled state has been persisted; cold-restart Desktop instead of repeatedly toggling or reinstalling the plugin. Other errors are not covered by this guidance and must still be investigated.
192
194
 
@@ -468,8 +470,8 @@ Report the published Release URL, version, tag/commit and verified asset SHA-256
468
470
  `package.json` declares public npm distribution. A release tag must equal `v${package.json.version}`. Versions use standard SemVer prerelease labels (`alpha`, `beta`, or `rc`), each with its matching npm dist-tag; only stable versions use `latest`. The Release workflow performs the frozen install and complete verification gate, packs once (or recovers the original archive on retry), verifies `SHA256SUMS`, publishes the immutable GitHub Release and then publishes those same bytes to npm through OIDC. Either channel failing means delivery is incomplete. First package creation needs an authorized maintainer; staging requires an existing package and is not a first-package bootstrap. Historical releases are not republished.
469
471
 
470
472
  ```sh
471
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.87/dsh-github-copilot-0.4.0-alpha.87.tgz
472
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.87/SHA256SUMS
473
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.88/dsh-github-copilot-0.4.0-alpha.88.tgz
474
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.88/SHA256SUMS
473
475
  sha256sum --check SHA256SUMS
474
476
  ```
475
477
 
@@ -477,7 +479,7 @@ PowerShell can verify the same two downloaded files with:
477
479
 
478
480
  ```powershell
479
481
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
480
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.87.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
482
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.88.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
481
483
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
482
484
  ```
483
485
 
package/README.zh.md CHANGED
@@ -27,7 +27,7 @@ Core 管理。详见[图片兼容性与限制](./docs/image-input-compatibility.
27
27
 
28
28
  截图来自当前构建 Client 的隔离浏览器 fixture,使用合成 Provider。它只证明已发布配置界面的形态,不证明真实凭据、账号权限、搜索成功或当前 Desktop 已加载。
29
29
 
30
- > 当前文档与安装命令对应版本 `0.4.0-alpha.87`。源码、发布制品、已安装版本和实际加载运行时需分别确认;本地升级和中断会话的重启仍需用户批准。
30
+ > 当前文档与安装命令对应版本 `0.4.0-alpha.88`。源码、发布制品、已安装版本和实际加载运行时需分别确认;本地升级和中断会话的重启仍需用户批准。
31
31
 
32
32
  Web search 路由现在优先显示在插件详情页;宿主不支持详情页插槽时才回退到 **设置 → 模型**或独立 Web search section。搜索子 Fiber 仍独立等待 Remote,不影响账号控件和既有搜索安全检查。
33
33
 
@@ -124,10 +124,10 @@ node package/scripts/check-search-composition.mjs --profile-dir /absolute/profil
124
124
  仅对独立的具名 profile,获准且网络可用时,可通过受支持的 CLI 命令安装:
125
125
 
126
126
  ```sh
127
- dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.87/dsh-github-copilot-0.4.0-alpha.87.tgz
127
+ dsh plugin --profile web add https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.88/dsh-github-copilot-0.4.0-alpha.88.tgz
128
128
  ```
129
129
 
130
- Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.87`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
130
+ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理器安装 `dsh-github-copilot@0.4.0-alpha.88`。Desktop 保留 `desktop` profile,CLI 不负责管理。若 registry 被公司封禁或不可用,不要更换网络绕行或使用离线 CLI;请停止。[受控离线 CLI 流程](./docs/npm-distribution.md#controlled-offline-cli-maintenance-for-standalone-profiles)仅适用于独立具名 profile,不适用于 Desktop。
131
131
 
132
132
  随后打开上表对应的 Models UI,找到 **GitHub Copilot**,点击 **Sign in** 并完成 GitHub device-code 流程。安装会修改指定 profile;是否立即激活取决于该 profile 的常规 reload/restart 策略。
133
133
 
@@ -151,6 +151,8 @@ Desktop profile 请在完成同样的预检后,使用 Desktop 原生包管理
151
151
 
152
152
  语义判断**默认开启**,**仅在本地需求未知时**通过一次有界的辅助模型请求判断上下文任务。可设置 `github-copilot.autoSemanticAssessment: false` 关闭;已有的显式 false 配置会保留,不自动迁移。有界输入优先保留当前和前一条用户请求,但不会忽略上下文省略。它会增加延迟和供应方费用,不计入原生 Chat Usage。失败或判断上下文不完整不会被当作简单任务,而是保留保守本地依据。这次默认开启由用户明确授权,不代表已完成标注语料校准,也不是 GitHub 的私有 Auto 服务。
153
153
 
154
+ Auto 辅助语义判断保留单次 **8 秒**总期限,改用 **128 tokens** 的紧凑 JSON 输出预算。现有选模说明的折叠详情可显示分类模型 ID、总耗时/预算、适配器开始/首次文本、原生结束和结果校验。超时后需求仍未知,再按偏好策略兜底;它不表示正式回答超时,也不证明任务复杂。这些不含内容的临时记录不是 HTTP 时序或原生 Usage,也尚未证明实际提速。仅当账号元数据和公开 prepared model 都支持时才请求关闭 reasoning,否则保留原生策略。详见[判断边界](docs/auto-task-routing.md#auxiliary-latency-evidence-and-bounded-output-272)。
155
+
154
156
  已完成的 Copilot 回复在原生 Usage/时间后显示 **Auto(偏好)**,点信息按钮查看本轮记录的选择原因;只有捕获到明确固定选择才显示**手动**。成功读取但没有保留记录时显示**选择方式未知**,不借当前 picker 推断历史。读取失败则显示**选择记录读取失败 → 重试**;重试只重新读取同一轮记录,不重新调用模型。显式会话 ID/轮次参数不再被 Chat 的自动会话绑定缩减,修复新 master/lead 回复遭遇原生网关参数数量错误的问题。不重复模型名、不另设 Model details 按钮:实际模型仍由原生 Usage 显示,其缺失归属行为未改变。新选择记录仅限当前 Host 内存且有容量上限,重启、释放 Agent 或淘汰后会丢失;兼容历史 Auto 记录仍可读取。公开 assistant-actions slot 只允许插件内部换行,不能改变原生固定高度尾栏。
155
157
 
156
158
  信息按钮展示本轮实际捕获的任务/分类依据、回退和保持原模型/同类分配原因;辅助判断信息收纳在折叠区。旧记录没有详细依据时明确说明未保留原因,不用今天的设置反推。
@@ -188,7 +190,7 @@ Agent 应把浏览器授权视为需要用户完成的 handoff,而不是自行
188
190
  5. 确认 **Signed in** 并检查自动发现结果,再请用户选择模型。已登录时打开 Models 会自动确保缺失/过期元数据,新鲜 ready 缓存不发请求。错误可使用 **Retry**,有意强制更新时使用 **Manage → Refresh models**,不作为常规设置步骤。状态读取本身不发现;登录、元数据与真实调用成功是独立证据。
189
191
  6. 只有用户明确要求断开账号时才使用 **Sign out**;它会删除 Copilot credential record,但保留 route settings。
190
192
 
191
- 每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.87`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
193
+ 每个新版本默认同时分发到 GitHub Releases 和 npm,两个渠道使用同一份已验证 tarball。应固定版本并核对所用渠道的证据:Release 的 `SHA256SUMS`;从 npm 安装时另核对 `dist.integrity`。Desktop profile 只能通过原生 Desktop 包管理器安装;获准且 registry 可用时输入 `dsh-github-copilot@0.4.0-alpha.88`,不是 URL 或本地文件。Desktop 保留 `desktop` profile,不能通过 DSH CLI 管理。受控离线 CLI 维护仅适用于独立具名 profile,不得作为 Desktop 安装绕行方案。[双渠道发布与 OIDC 要求](./docs/npm-distribution.md)保持不变。
192
194
 
193
195
  **Desktop package 更新与 Web 生命周期边界:**原生 manager 对已安装 package 原位升级返回的 `restart-required` 是权威结果,与移除/重加 plugin bundle 的行为是两个不同问题。涉及服务重编排补丁(`cordis.patch.yml`,如本插件所采用的隔离路由 Web 搜索层)的停用、移除或升级,可能让依赖条目保持 pending,直到完全退出并冷重启 Desktop。若原生 manager 只报告类似 `pending (waiting for service: web)` 的条目,同时本插件已经显示 **Off**,说明请求的停用状态已经落盘;请冷重启 Desktop,不要反复切换或重装插件。其它错误不属于此提示范围,仍需单独排查。
194
196
 
@@ -479,8 +481,8 @@ node scripts/agent.mjs attribution "DeepSeek Harness (DSH)"
479
481
  `package.json` 声明公开 npm 分发。Release tag 必须严格等于 `v${package.json.version}`。预发布使用 `alpha`、`beta` 或 `rc` 及对应 npm dist-tag,只有稳定版使用 `latest`。Release workflow 执行 frozen install 和完整门禁,只打包一次(重试恢复原始归档),验证 `SHA256SUMS`,发布不可变 GitHub Release,再通过 OIDC 将同一份字节发布到 npm。任一渠道失败都表示交付未完成。首次建包须由获准环境中的维护者完成;staging 要求包已存在,不能代替首次建包。不会批量补发历史版本。
480
482
 
481
483
  ```sh
482
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.87/dsh-github-copilot-0.4.0-alpha.87.tgz
483
- curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.87/SHA256SUMS
484
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.88/dsh-github-copilot-0.4.0-alpha.88.tgz
485
+ curl -LO https://github.com/cloga/dsh-github-copilot/releases/download/v0.4.0-alpha.88/SHA256SUMS
484
486
  sha256sum --check SHA256SUMS
485
487
  ```
486
488
 
@@ -488,7 +490,7 @@ PowerShell 可以对已下载的同一组文件执行:
488
490
 
489
491
  ```powershell
490
492
  $expected = (Get-Content .\SHA256SUMS).Split()[0]
491
- $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.87.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
493
+ $actual = (Get-FileHash .\dsh-github-copilot-0.4.0-alpha.88.tgz -Algorithm SHA256).Hash.ToLowerInvariant()
492
494
  if ($actual -cne $expected) { throw 'Release checksum mismatch' }
493
495
  ```
494
496
 
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "package": {
10
10
  "name": "dsh-github-copilot",
11
- "version": "0.4.0-alpha.87"
11
+ "version": "0.4.0-alpha.88"
12
12
  },
13
13
  "evidence": {
14
14
  "kind": "source-and-synthetic-test-inventory",
@@ -578,6 +578,7 @@
578
578
  {"file": "src/model-exclusions.ts", "marker": "class ModelExclusionTurns"},
579
579
  {"file": "src/remote.ts", "marker": "githubCopilot.setModelExcluded"},
580
580
  {"file": "src/preview-provider.ts", "marker": "native.streamSimple"},
581
+ {"file": "src/auto-assessment-evidence.ts", "marker": "SemanticAssessmentEvidenceSchema"},
581
582
  {"file": "src/request-body-timeout-marker.ts", "marker": "COPILOT_REQUEST_BODY_TIMEOUT"},
582
583
  {"file": "src/request-body-evidence.ts", "marker": "REQUEST_BODY_EVIDENCE_LIMITS"},
583
584
  {"file": "src/copilot-stream-liveness.ts", "marker": "COPILOT_STREAM_IDLE_TIMEOUT"},
@@ -599,6 +600,8 @@
599
600
  {"file": "tests/preview-route.spec.ts", "name": "enriches only a verified 408 while preserving native failure classification and retry ownership"},
600
601
  {"file": "tests/preview-provider.spec.ts", "name": "observes verified %s timeout without changing bytes, Response, native retries or credential ownership"},
601
602
  {"file": "tests/request-body-timeout.spec.ts", "name": "bounds stalled response observation and gives cancellation priority"},
603
+ {"file": "tests/auto-task-assessment.spec.ts", "name": "captures bounded phase evidence for a timed-out partial result without treating it as a validated task"},
604
+ {"file": "tests/auto-task-evidence.spec.ts", "name": "captures monotonic auxiliary phases without text, accounting or late mutation"},
602
605
  {"file": "tests/request-body-evidence.spec.ts", "name": "measures a nine MiB native-style inline image without exposing or decoding it"},
603
606
  {"file": "tests/preview-provider.spec.ts", "name": "captures final %s callback bytes and dispatch-local header time before clone observation"},
604
607
  {"file": "tests/copilot-stream-liveness.spec.ts", "name": "does not count consumer think time as provider idle"},
@@ -80,6 +80,48 @@ charges and latency, separate from native chat Usage and without inferred cost.
80
80
 
81
81
  ## Category policy and continuity
82
82
 
83
+ ### Auxiliary latency evidence and bounded output (#272)
84
+
85
+ The assessment still has one **8-second end-to-end deadline**, including account
86
+ discovery/preparation and the native call. It does not retry on timeout or try a
87
+ second classifier. The response budget is now 128 output tokens, with compact
88
+ demand JSON and at most three fixed signals requested. The strict decoder
89
+ retains its seven-signal compatibility bound; raw explanation, confidence
90
+ percentages and reasoning are not requested. Truncation remains failure, never
91
+ accepted partial JSON.
92
+
93
+ Request `off` reasoning only when both current supplier metadata advertises it
94
+ and the public prepared model lists an `off` effort. Supplier metadata alone
95
+ does not establish native support: current managed reasoning maps can decline
96
+ `off` even when advertised. In that case retain native policy, do not change
97
+ shared model maps, guess a wire value or patch Core. No claim that reasoning is
98
+ disabled for all classifiers is made.
99
+
100
+ Captured Host-lifetime selection evidence now includes a bounded public
101
+ classifier ID, configured waiting budget, total monotonic assessment elapsed
102
+ time, adapter-invocation start, first nonempty text time, native stop/non-stop
103
+ finish observation and strict result-validation status. Preparation is included
104
+ in total time; adapter start is **not HTTP dispatch**, first text is **not first
105
+ network byte**, and these milestones cannot distinguish connection, supplier
106
+ queueing or computation. Absence says no milestone was observed before
107
+ settlement, not that the provider never emitted data. Counts are characters,
108
+ not tokens/credits; no prompt, text, replay, credential, error body or hash is
109
+ captured. Late callbacks cannot rewrite a settled decision.
110
+
111
+ The existing strict explicit-Session/turn Remote carries this optional evidence;
112
+ old explanations remain decodable without it. Numeric/model evidence is copied
113
+ and frozen in the bounded store and routing decision, not durably appended or
114
+ reconstructed after restart. The footer says assessment timed out, demand
115
+ remained unknown, and preference policy selected the category as a fallback.
116
+ Progressive details show milestones separately from native answer Usage.
117
+
118
+ This is instrumentation and bounded output optimization, not a measured latency
119
+ improvement or classifier calibration. No latency-ranked classifier pool,
120
+ cross-turn assessment cache, cooldown, adaptive deadline or extra probe is
121
+ introduced without reviewing real observations. Existing local evidence,
122
+ omitted-context downshift protection, cancellation, account/proof revocation,
123
+ same-turn single-flight, eligibility and category policy remain unchanged.
124
+
83
125
  | Task demand | Efficiency | Balance | Intelligence |
84
126
  | --- | --- | --- | --- |
85
127
  | Proven simple | Lightweight | Lightweight | Lightweight |
package/lib/client.js CHANGED
@@ -5645,6 +5645,44 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5645
5645
  }))
5646
5646
  };
5647
5647
  //#endregion
5648
+ //#region lib/types/auto-assessment-evidence.js
5649
+ const milliseconds = number().int().min(0).max(Number.MAX_SAFE_INTEGER);
5650
+ const SemanticAssessmentEvidenceSchema = object({
5651
+ modelId: string().min(1).max(200).regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]*$/u).optional(),
5652
+ budgetMs: milliseconds.refine((value) => value > 0),
5653
+ elapsedMs: milliseconds,
5654
+ stage: _enum([
5655
+ "preparing",
5656
+ "model-selected",
5657
+ "adapter-started",
5658
+ "text-received",
5659
+ "finished"
5660
+ ]),
5661
+ adapterStartedMs: milliseconds.optional(),
5662
+ firstTextMs: milliseconds.optional(),
5663
+ nativeFinish: _enum(["stop", "non-stop"]).optional(),
5664
+ outputCharacters: number().int().min(0).max(2049),
5665
+ validation: _enum([
5666
+ "not-validated",
5667
+ "valid",
5668
+ "invalid",
5669
+ "context-omitted"
5670
+ ])
5671
+ }).strict().superRefine((value, ctx) => {
5672
+ if (value.adapterStartedMs !== void 0 && value.adapterStartedMs > value.elapsedMs || value.firstTextMs !== void 0 && (value.adapterStartedMs === void 0 || value.firstTextMs < value.adapterStartedMs || value.firstTextMs > value.elapsedMs)) ctx.addIssue({
5673
+ code: "custom",
5674
+ message: "Inconsistent assessment timing"
5675
+ });
5676
+ if (value.stage === "model-selected" && value.modelId === void 0 || [
5677
+ "adapter-started",
5678
+ "text-received",
5679
+ "finished"
5680
+ ].includes(value.stage) && value.adapterStartedMs === void 0 || value.stage === "text-received" && value.firstTextMs === void 0 || value.stage === "finished" && value.nativeFinish === void 0 || value.nativeFinish !== void 0 && value.stage !== "finished" || value.outputCharacters > 0 && value.firstTextMs === void 0 || value.firstTextMs !== void 0 && value.outputCharacters === 0) ctx.addIssue({
5681
+ code: "custom",
5682
+ message: "Inconsistent assessment phase"
5683
+ });
5684
+ });
5685
+ //#endregion
5648
5686
  //#region lib/types/turn-selection.js
5649
5687
  const ExplanationSchema = object({
5650
5688
  assessment: object({
@@ -5672,7 +5710,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5672
5710
  "timeout",
5673
5711
  "failed",
5674
5712
  "context-omitted"
5675
- ]).optional()
5713
+ ]).optional(),
5714
+ semantic: SemanticAssessmentEvidenceSchema.optional()
5676
5715
  }).strict(),
5677
5716
  targetCategory: _enum([
5678
5717
  "powerful",
@@ -6332,22 +6371,37 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6332
6371
  "context-omitted": zh ? "判断上下文不完整" : "incomplete assessment context",
6333
6372
  "insufficient-evidence": zh ? "本地规则尚不能确定任务需求" : "local rules cannot establish task demand"
6334
6373
  };
6374
+ const conclusion = explanation.method === "no-fit" ? zh ? "没有候选能直接容纳估算输入;选中输入预算最大的模型,保留原生压缩或失败处理。" : "No candidate fits the estimated input. Selected the largest input budget for native recovery or failure." : explanation.fallback ? zh ? `目标分类 ${category[explanation.targetCategory]} 没有合格的可容纳候选,回退到 ${category[explanation.selectedCategory]}。` : `No eligible fitting ${category[explanation.targetCategory]} candidate; fell back to ${category[explanation.selectedCategory]}.` : explanation.assessment.diagnostic === "timeout" && explanation.assessment.demand === "unknown" ? zh ? `任务难度判断超时,需求仍不确定;按当前偏好兜底选择 ${category[explanation.selectedCategory]}。` : `Task assessment timed out; demand remains uncertain. The preference policy selected ${category[explanation.selectedCategory]} as a fallback.` : zh ? `本轮判断为${demand[explanation.assessment.demand]};按当前偏好选择 ${category[explanation.selectedCategory]} 类模型。` : `This task was assessed as ${demand[explanation.assessment.demand]}; the preference policy selected ${category[explanation.selectedCategory]}.`;
6375
+ const choice = explanation.method === "continuity" ? zh ? "上一轮模型仍满足本轮分类和输入要求,因此保持它。" : "Kept the previous model because it still meets this turn’s category and input requirements." : explanation.method === "only-candidate" ? zh ? "该分类只有一个可容纳的合格候选。" : "Only one eligible fitting candidate remains in this category." : explanation.method === "equal-distribution" ? zh ? `该分类有 ${explanation.categoryCandidateCount} 个可容纳候选;按本轮稳定等权规则选中,不代表质量排名。` : `Selected among ${explanation.categoryCandidateCount} fitting category candidates by stable equal-weight allocation, not a quality ranking.` : zh ? "所有候选均不适配;这不是成功的偏好匹配。" : "All candidates are oversized; this is not a successful preference match.";
6376
+ const diagnostic = explanation.assessment.diagnostic === void 0 ? void 0 : explanation.assessment.diagnostic === "disabled" ? zh ? "语义判断实验未开启;这是本地规则的判断边界,不代表会话没有上下文。" : "Semantic assessment is disabled; this is a limit of local rules, not proof that the conversation lacks context." : explanation.assessment.diagnostic === "timeout" ? zh ? "辅助判断未在等待预算内完成,不代表正式回答超时或任务简单;本轮保留需求不确定,再按偏好策略选模。" : "The auxiliary assessment did not complete within its waiting budget. This is not a timeout of the main answer or evidence of simplicity; selection used the unknown-demand preference policy." : zh ? `语义判断未提供完整可用依据(${{
6377
+ unavailable: "没有可用分类模型",
6378
+ "invalid-result": "结果无效",
6379
+ timeout: "超时",
6380
+ failed: "请求失败",
6381
+ "context-omitted": "上下文不完整"
6382
+ }[explanation.assessment.diagnostic]});未将失败当作简单任务。` : `Semantic assessment did not provide complete usable evidence (${{
6383
+ unavailable: "no classifier available",
6384
+ "invalid-result": "invalid result",
6385
+ timeout: "timeout",
6386
+ failed: "request failed",
6387
+ "context-omitted": "incomplete context"
6388
+ }[explanation.assessment.diagnostic]}); failure was not treated as simplicity.`;
6389
+ const evidence = explanation.assessment.semantic;
6335
6390
  return {
6336
- conclusion: explanation.method === "no-fit" ? zh ? "没有候选能直接容纳估算输入;选中输入预算最大的模型,保留原生压缩或失败处理。" : "No candidate fits the estimated input. Selected the largest input budget for native recovery or failure." : explanation.fallback ? zh ? `目标分类 ${category[explanation.targetCategory]} 没有合格的可容纳候选,回退到 ${category[explanation.selectedCategory]}。` : `No eligible fitting ${category[explanation.targetCategory]} candidate; fell back to ${category[explanation.selectedCategory]}.` : zh ? `本轮判断为${demand[explanation.assessment.demand]};按当前偏好选择 ${category[explanation.selectedCategory]} 类模型。` : `This task was assessed as ${demand[explanation.assessment.demand]}; the preference policy selected ${category[explanation.selectedCategory]}.`,
6337
- choice: explanation.method === "continuity" ? zh ? "上一轮模型仍满足本轮分类和输入要求,因此保持它。" : "Kept the previous model because it still meets this turn’s category and input requirements." : explanation.method === "only-candidate" ? zh ? "该分类只有一个可容纳的合格候选。" : "Only one eligible fitting candidate remains in this category." : explanation.method === "equal-distribution" ? zh ? `该分类有 ${explanation.categoryCandidateCount} 个可容纳候选;按本轮稳定等权规则选中,不代表质量排名。` : `Selected among ${explanation.categoryCandidateCount} fitting category candidates by stable equal-weight allocation, not a quality ranking.` : zh ? "所有候选均不适配;这不是成功的偏好匹配。" : "All candidates are oversized; this is not a successful preference match.",
6338
- diagnostic: explanation.assessment.diagnostic === void 0 ? void 0 : explanation.assessment.diagnostic === "disabled" ? zh ? "语义判断实验未开启;这是本地规则的判断边界,不代表会话没有上下文。" : "Semantic assessment is disabled; this is a limit of local rules, not proof that the conversation lacks context." : zh ? `语义判断未提供完整可用依据(${{
6339
- unavailable: "没有可用分类模型",
6340
- "invalid-result": "结果无效",
6341
- timeout: "超时",
6342
- failed: "请求失败",
6343
- "context-omitted": "上下文不完整"
6344
- }[explanation.assessment.diagnostic]});未将失败当作简单任务。` : `Semantic assessment did not provide complete usable evidence (${{
6345
- unavailable: "no classifier available",
6346
- "invalid-result": "invalid result",
6347
- timeout: "timeout",
6348
- failed: "request failed",
6349
- "context-omitted": "incomplete context"
6350
- }[explanation.assessment.diagnostic]}); failure was not treated as simplicity.`,
6391
+ conclusion,
6392
+ choice,
6393
+ diagnostic,
6394
+ semantic: evidence === void 0 ? void 0 : zh ? `辅助分类模型:${evidence.modelId ?? "未选定"}。判断总耗时 ${evidence.elapsedMs} ms,等待预算 ${evidence.budgetMs} ms。${evidence.adapterStartedMs === void 0 ? "尚未开始适配器调用。" : `适配器调用始于 ${evidence.adapterStartedMs} ms。`}${evidence.firstTextMs === void 0 ? "未观察到文本输出。" : `首次文本输出于 ${evidence.firstTextMs} ms。`}${evidence.nativeFinish === void 0 ? "未观察到原生结束。" : evidence.nativeFinish === "stop" ? "观察到原生正常结束。" : "观察到原生非正常结束。"}结果校验:${{
6395
+ "not-validated": "未完成",
6396
+ valid: "通过",
6397
+ invalid: "无效",
6398
+ "context-omitted": "通过格式校验,但上下文省略阻止降级"
6399
+ }[evidence.validation]}。这些是辅助判断阶段,不证明网络或模型慢的具体原因,也不是正式回答的 Usage。` : `Auxiliary classifier: ${evidence.modelId ?? "not selected"}. Assessment total ${evidence.elapsedMs} ms; budget ${evidence.budgetMs} ms. ${evidence.adapterStartedMs === void 0 ? "Adapter call not started." : `Adapter call started at ${evidence.adapterStartedMs} ms.`} ${evidence.firstTextMs === void 0 ? "No text output observed." : `First text at ${evidence.firstTextMs} ms.`} ${evidence.nativeFinish === void 0 ? "No native finish observed." : evidence.nativeFinish === "stop" ? "Native stop observed." : "Native non-stop finish observed."} Result validation: ${{
6400
+ "not-validated": "not completed",
6401
+ valid: "passed",
6402
+ invalid: "invalid",
6403
+ "context-omitted": "format passed; omitted context prevented downshift"
6404
+ }[evidence.validation]}. These auxiliary milestones do not prove a network/model latency cause and are not main-answer Usage.`,
6351
6405
  assessment: `${zh ? "判断来源:" : "Assessment: "}${explanation.assessment.source === "semantic" ? zh ? "语义分类" : "semantic classification" : zh ? "本地规则" : "local rules"}${explanation.assessment.signals.length ? ` — ${explanation.assessment.signals.map((signal) => signals[signal]).join(zh ? "、" : ", ")}` : ""}`
6352
6406
  };
6353
6407
  }
@@ -6470,7 +6524,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6470
6524
  color: "var(--dsw-alias-label-primary, CanvasText)",
6471
6525
  lineHeight: 1.6
6472
6526
  }
6473
- }, (0, react.createElement)("strong", null, zh ? "为什么本轮选择这个模型" : "Why this model was selected"), selection.mode === "auto" ? explanation === void 0 ? (0, react.createElement)("p", null, zh ? "本轮未保留详细选模原因;不使用当前设置反推历史。" : "Detailed selection reasons were not retained for this turn; today’s settings cannot reconstruct them.") : (0, react.createElement)("div", null, (0, react.createElement)("p", null, explanation.conclusion), (0, react.createElement)("p", null, explanation.choice), (0, react.createElement)("details", null, (0, react.createElement)("summary", null, zh ? "查看判断依据" : "Assessment details"), (0, react.createElement)("p", null, explanation.assessment), (0, react.createElement)("p", null, zh ? `${selection.candidateCount} 个合格候选;${selection.fittingCandidateCount ?? "未知"} 个可容纳估算输入。` : `${selection.candidateCount} eligible candidates; ${selection.fittingCandidateCount ?? "unknown"} fit the estimated input.`), explanation.diagnostic ? (0, react.createElement)("p", null, explanation.diagnostic) : null, (0, react.createElement)("p", null, zh ? "分类来自供应方;不保证实际速度、费用或任务质量。" : "Supplier categories do not guarantee actual speed, cost or task quality."))) : null, incomplete ? (0, react.createElement)("p", null, zh ? "模型归属不完整:部分尝试或历史未记录模型。原生 Usage 保持不变。" : "Model attribution is incomplete: some attempts or history have no recorded model. Native Usage is unchanged.") : null, (0, react.createElement)("p", null, zh ? "此记录说明选择方式,不证明执行;实际模型以原生 Usage 为准。" : "Selection evidence is not execution proof; see native Usage for recorded models."), (0, react.createElement)("button", {
6527
+ }, (0, react.createElement)("strong", null, zh ? "为什么本轮选择这个模型" : "Why this model was selected"), selection.mode === "auto" ? explanation === void 0 ? (0, react.createElement)("p", null, zh ? "本轮未保留详细选模原因;不使用当前设置反推历史。" : "Detailed selection reasons were not retained for this turn; today’s settings cannot reconstruct them.") : (0, react.createElement)("div", null, (0, react.createElement)("p", null, explanation.conclusion), (0, react.createElement)("p", null, explanation.choice), (0, react.createElement)("details", null, (0, react.createElement)("summary", null, zh ? "查看判断依据" : "Assessment details"), (0, react.createElement)("p", null, explanation.assessment), (0, react.createElement)("p", null, zh ? `${selection.candidateCount} 个合格候选;${selection.fittingCandidateCount ?? "未知"} 个可容纳估算输入。` : `${selection.candidateCount} eligible candidates; ${selection.fittingCandidateCount ?? "unknown"} fit the estimated input.`), explanation.diagnostic ? (0, react.createElement)("p", null, explanation.diagnostic) : null, explanation.semantic ? (0, react.createElement)("p", null, explanation.semantic) : null, (0, react.createElement)("p", null, zh ? "分类来自供应方;不保证实际速度、费用或任务质量。" : "Supplier categories do not guarantee actual speed, cost or task quality."))) : null, incomplete ? (0, react.createElement)("p", null, zh ? "模型归属不完整:部分尝试或历史未记录模型。原生 Usage 保持不变。" : "Model attribution is incomplete: some attempts or history have no recorded model. Native Usage is unchanged.") : null, (0, react.createElement)("p", null, zh ? "此记录说明选择方式,不证明执行;实际模型以原生 Usage 为准。" : "Selection evidence is not execution proof; see native Usage for recorded models."), (0, react.createElement)("button", {
6474
6528
  ref: close,
6475
6529
  type: "button",
6476
6530
  style: button,