forked from cflmy/deepseek-harness
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99073e94c3 | ||
|
|
7e2f1ac325 | ||
|
|
9979411e08 | ||
|
|
28df81ee11 | ||
|
|
f89b2dd81e | ||
|
|
eceb13a70a | ||
|
|
fd1d129e00 | ||
|
|
a1517652c2 |
No files matched your search
@@ -40,7 +40,7 @@ apps/harness/ # 独立应用仓库(父仓 gitlink:apps
|
||||
│ ├── src/diagnostics/ # 脱敏报告、去重、Gitea Issue 提交
|
||||
│ ├── src/knowledge/ # 私人知识集合、导入、索引适配、检索
|
||||
│ ├── src/execution/ # Analysis 3、CLI argv、审批、证据
|
||||
│ ├── src/cli/ # 产品命令(bootstrap/doctor/repair/report/update/network)
|
||||
│ ├── src/cli/ # 产品命令(bootstrap/status/doctor/repair/report/update/network)
|
||||
│ ├── src/tools/ # 面向模型的六个操作
|
||||
│ ├── src/web/ # /mqdh 页面与同源只读/受控写 API
|
||||
│ └── tests/ # node:test 单元与真实 CLI/Release 集成
|
||||
|
||||
@@ -73,6 +73,8 @@ mqdh update rollback --confirm [--json]
|
||||
- 失败关闭:摘要/平台/兼容/smoke 任一失败都不改指针,staging 清理。
|
||||
- 更新不触碰 `MQDH_HOME/ecosystem`;Marqdo 运行时仍由 Bootstrap/生态中心独立管理。
|
||||
- 应用仓库当前为私有开发仓时,匿名检查返回 403/404,状态显示 `update.unavailable`(不是伪造“已是最新”)。正式发行需公开仓库或显式配置凭据。
|
||||
- `update check` 同时展示最新候选的 `published_at`、官方下载 URL(`latest.asset.url`)、Release 页面 URL(`latest.release_url`)、`known_limits` 与发布说明;发布说明来自可信 Gitea Release body(截断到 8 KiB),不是第二份清单。JSON 字段为 `latest.notes` 与 `latest.release_url`。
|
||||
- `mqdh status [--json]` 只读展示已持久化的更新视图(channel、上次检查时间、是否可更新、最新候选、最后一个错误),不触发网络检查;JSON 字段为 `update`。需要最新检查时显式运行 `mqdh update check`。
|
||||
|
||||
## 5. 构建与发布
|
||||
|
||||
|
||||
@@ -73,6 +73,10 @@ cd marqdo-harness-<version>-x86_64-unknown-linux-gnu
|
||||
- 已发布版本有缺陷:发布更高版本;不删除或重写旧资产。用户侧可 `mqdh update rollback --confirm`。
|
||||
- 签名错误:停止发布,轮换密钥并提升版本;不得重新上传同 tag。
|
||||
|
||||
## 7. 未验证
|
||||
## 7. 发布说明
|
||||
|
||||
创建 Gitea Release 时填写的 body 是产品内 `mqdh update check` 展示的发布说明唯一来源(截断到 8 KiB);不要另建发布说明清单或第二份版本表。发布说明应包含用户可见变化、已知限制和升级注意项,且不得包含凭据、私有数据或未验证的 PASS 声明。
|
||||
|
||||
## 8. 未验证
|
||||
|
||||
生产签名证书/密钥托管、macOS/Windows 构建与公证、第二台干净主机、低于 2.39 glibc 的平台、真实断网更新与弱网大文件下载。以上保持 `UNVERIFIED`,不得写成 PASS。
|
||||
+2
-2
@@ -103,9 +103,9 @@
|
||||
| --- | --- | --- |
|
||||
| DIAG-01 错误模型、捕获点、report schema、脱敏器 | PASS | `diagnostics.test.ts`:路径/secret/敏感键/cause chain 脱敏,写入前完成。 |
|
||||
| DIAG-02 `mqdh report` + `/mqdh` 报告页 + 预览/删除 | PASS | CLI/Web 路由与页面已实现;预览返回完整 title/body。 |
|
||||
| DIAG-03 Gitea Issue 提交、目标仓路由、模板、去重/限额 | PASS(替身) | 本地 Gitea 替身真实创建 Issue/评论、附件 multipart、小时限额;真实公网组织权限未验证。 |
|
||||
| DIAG-03 Gitea Issue 提交、目标仓路由、模板、去重/限额 | PASS(真实 Gitea + 替身) | 真实 Gitea 私有夹具创建 Issue/去重评论/404 失败路径已验证(`docs/evidence/2026-12-01-feedback-real-gitea-e2e.md`);替身覆盖附件 multipart 与小时限额。真实组织权限矩阵仍有限。 |
|
||||
| DIAG-04 离线队列、附件选择、结果回填 | PASS | `--offline` 入队;附件仅从报告目录读取;issue URL 回填索引。 |
|
||||
| DIAG-05 真实失败演练、负例/安全测试、发布证据 | PARTIAL | 真实 Bootstrap/知识/CLI 失败样本与公网提交演练未全部运行;不得写成 PASS。 |
|
||||
| DIAG-05 真实失败演练、负例/安全测试、发布证据 | PARTIAL | 已做真实 Gitea app-area 提交/去重/404/离线入队;真实 Bootstrap/知识/CLI 失败样本、附件真实上传与离线恢复全流程未全部运行,不得写成 PASS。 |
|
||||
|
||||
## 发行与更新(DIST)
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# `mqdh status` 生态版本视图(app-harness#16 切片)
|
||||
|
||||
Date: 2026-11-30. Branch: `codex/issue-16-status-view`.
|
||||
Baseline: `a1517652c29ac51357275661a59e7814b596efc8`(main)。
|
||||
|
||||
## 交付
|
||||
|
||||
- 新增只读产品命令 `mqdh status [--json]`:一次输出应用版本/home/workspace、平台与 Node、运行时候选版本、生态环境 id、Bundle 版本/模块数/摘要、已安装 Tool 版本、market/knowledge 计数与 privacy 常量;JSON schema `marqdo.mqdh.status`(`schema_version: 1`)。
|
||||
- `scripts/mqdh.mjs` 的产品命令集合加入 `status`(避免落到 DSH 转发);HELP 更新。
|
||||
- `docs/mqdh/ARCHITECTURE.md` 产品命令列表更新。
|
||||
- 测试:`packages/marqdo/harness/tests/cli.test.ts` 新增 `status` JSON/文本断言(未安装生态时如实显示 not installed/false)。
|
||||
|
||||
## 验证(本机,Linux x86_64 / glibc 2.43)
|
||||
|
||||
```text
|
||||
$ node --import tsx/esm --test packages/marqdo/harness/tests/cli.test.ts
|
||||
6 pass, 0 fail
|
||||
```
|
||||
|
||||
该命令只读现有 `MdhRuntime.status()` 状态,不触发安装/网络/更新;不是 #16 的
|
||||
“最新版本/发布说明/下载入口”完整生态版本检查,那部分保持 UNVERIFIED。未运行
|
||||
完整组件测试,组件 CI 结果以平台为准。
|
||||
@@ -0,0 +1,27 @@
|
||||
# `mqdh status` 持久化更新视图(app-harness#16 切片)
|
||||
|
||||
Date: 2026-11-30. Branch: `codex/issue-16-status-update`.
|
||||
Baseline: `28df81ee11d2dccc0a1a2606394c477ff7b09987`(main)。
|
||||
|
||||
## 交付
|
||||
|
||||
- `MdhStatus` 新增 `update: UpdateState`(读取已持久化的更新状态,不触网);
|
||||
`MdhRuntime.status()` 返回它。
|
||||
- `mqdh status --json` 输出 `update` 字段;文本输出新增
|
||||
`update: channel=… checked=… available=… latest=… [error=…]`。
|
||||
- `DISTRIBUTION.md` §4 区分只读状态视图与显式 `update check`(后者才触网)。
|
||||
- 测试:`cli.test.ts` 断言空安装下 `update.schema`/`channel`/`checked_at`/
|
||||
`latest` 与文本行。
|
||||
|
||||
## 验证(本机,Linux x86_64 / glibc 2.43)
|
||||
|
||||
```text
|
||||
pnpm run typecheck → 5/5 PASS
|
||||
node --import tsx/esm --test packages/marqdo/harness/tests/cli.test.ts → 6 pass
|
||||
node --import tsx/esm --test packages/marqdo/harness/tests/*.test.ts → 77 pass / 3 skipped
|
||||
```
|
||||
|
||||
## 边界
|
||||
|
||||
- 只读持久化状态;不刷新、不提示、不下载、不安装,不执行 E09 通知/对账。
|
||||
- 未创建 release/tag;真实 Gitea 反馈提交与浏览器端到端仍 UNVERIFIED。
|
||||
@@ -0,0 +1,28 @@
|
||||
# 应用更新检查展示发布说明/官方下载/已知限制(app-harness#16 切片)
|
||||
|
||||
Date: 2026-11-30. Branch: `codex/issue-16-update-notes`.
|
||||
Baseline: `eceb13a70a723d8623cbf7f4b1b6979bdc303680`(main)。
|
||||
|
||||
## 交付
|
||||
|
||||
- `release/gitea.ts`:可信 Gitea Release 的 `body` 进入候选(截断 8192 字节,空值 null);`AppReleaseCandidate.notes` 与 `browser_url` 明确。
|
||||
- `distribution/updater.ts`:`UpdateCandidate` 新增 `notes` 与 `release_url`;持久化 `UpdateState.latest` 携带二者。
|
||||
- CLI `mqdh update check` 文本输出新增 `published`/`download`(官方资产 URL)/`release`(Release 页面)/`known limits`/`release notes`;JSON 已直接包含这些字段。
|
||||
- 文档:`DISTRIBUTION.md` §4 更新检查字段、`RELEASING.md` §7 发布说明唯一来源(Gitea Release body,不另建清单)。
|
||||
- 测试:`updater.test.ts` 的 fake Gitea Release 带 body,断言 `latest.notes` 与 `latest.release_url`。
|
||||
|
||||
## 验证(本机,Linux x86_64 / glibc 2.43)
|
||||
|
||||
```text
|
||||
node --import tsx/esm --test packages/marqdo/harness/tests/updater.test.ts
|
||||
3 pass, 0 fail
|
||||
node --import tsx/esm --test packages/marqdo/harness/tests/*.test.ts
|
||||
77 pass, 0 fail, 3 skipped
|
||||
pnpm run typecheck → 5 passed, 0 failed
|
||||
```
|
||||
|
||||
## 边界
|
||||
|
||||
- 发布说明来自可信 Release body,显示为数据;不执行、不解析为指令,不冒充“更新说明已验证”。
|
||||
- 仍不是完整生态(CLI/View/Tools/Bundle/Knowledge)的最新版本聚合;E09 通知/对账仍 UNVERIFIED。
|
||||
- 未创建 release/tag;未运行浏览器/真实 Gitea 端到端。
|
||||
@@ -0,0 +1,50 @@
|
||||
# 反馈提交真实 Gitea 端到端(app-harness#16 §9)
|
||||
|
||||
Date: 2026-12-01. Branch: `codex/issue-16-feedback-e2e`.
|
||||
环境:本机 Linux x86_64;真实 Gitea `git.cflmy.cn`;私有测试仓
|
||||
`cflmy/mqdh-feedback-e2e`(仅用于验收,不是产品仓);真实 token 只在本地
|
||||
git 忽略环境文件与进程环境,不写入仓库/日志/报告。
|
||||
|
||||
## 1. 真实链路
|
||||
|
||||
1. 在隔离 `MQDH_HOME` 中用产品运行时捕获一条脱敏诊断报告
|
||||
(area=`app`、code=`e2e.feedback_probe`,不含凭据/私有数据)。
|
||||
2. `mqdh report token --stdin` 保存 token 到私有凭据文件(0600)。
|
||||
3. `mqdh report submit <id> --repo cflmy/mqdh-feedback-e2e --confirm --json`
|
||||
通过真实 Gitea API 创建 Issue。
|
||||
|
||||
```json
|
||||
{
|
||||
"report_id": "2026-12-01-04-09-09-f990188d",
|
||||
"status": "submitted",
|
||||
"repository": "cflmy/mqdh-feedback-e2e",
|
||||
"issue_url": "https://git.cflmy.cn/cflmy/mqdh-feedback-e2e/issues/1",
|
||||
"comment": false,
|
||||
"attachments_uploaded": [],
|
||||
"attachment_errors": []
|
||||
}
|
||||
```
|
||||
|
||||
Issue #1 标题 `[app] e2e.feedback_probe: …`,正文含错误码/阶段/现象/预期、
|
||||
应用/平台/Node/运行时/Bundle/Tool 身份、本地报告 id 与脱敏环境;不含凭据值。
|
||||
|
||||
## 2. 负例与队列
|
||||
|
||||
- **重复指纹**:再次提交返回 `"status":"deduplicated"`、
|
||||
`issue_url` 同上、`"comment":true`,真实追加评论而非新建 Issue。
|
||||
- **无效/无权限仓库**:`--repo cflmy/definitely-missing-repo` 返回
|
||||
`Gitea API returned 404: not found`,退出码 1,不写回成功 URL。
|
||||
- **离线队列**:`--offline --confirm` 返回 `"status":"queued"`、`issue_url:null`;
|
||||
队列恢复提交仍需用户再次确认(CLI 设计),本轮未执行恢复。
|
||||
|
||||
## 3. 状态更新
|
||||
|
||||
- `DIAG-03` 从“PASS(替身)”更新为 **PASS(真实 Gitea + 替身)**:真实公网
|
||||
Gitea 创建 Issue/去重评论/404 失败路径已验证;测试仓为私有夹具。
|
||||
- `DIAG-05` 仍 **PARTIAL**:真实 Bootstrap/知识/CLI 失败样本与附件 multipart
|
||||
真实上传、离线恢复全流程未全部演练,不写成 PASS。
|
||||
|
||||
## 4. 边界
|
||||
|
||||
- 私有测试仓 `cflmy/mqdh-feedback-e2e` 仅作验收夹具;Issue #1 保留作为证据。
|
||||
- 未创建产品 tag/Release;未自动上传任何用户数据;token/报告不含凭据。
|
||||
@@ -146,6 +146,7 @@ Usage: mqdh <command> [options]
|
||||
|
||||
Commands:
|
||||
bootstrap [--channel stable|beta] [--offline <dir>] [--force] [--json]
|
||||
status [--json]
|
||||
doctor [--json]
|
||||
repair [--json]
|
||||
report list|show|export|submit|delete|token [...]
|
||||
@@ -187,6 +188,8 @@ export async function runProductCli(argv: readonly string[], options: CliOptions
|
||||
switch (parsed.command) {
|
||||
case 'bootstrap':
|
||||
return await runBootstrap(parsed, io, runtime)
|
||||
case 'status':
|
||||
return await runStatus(parsed, io, runtime)
|
||||
case 'doctor':
|
||||
return await runDoctor(parsed, io, runtime)
|
||||
case 'repair':
|
||||
@@ -241,6 +244,48 @@ async function runBootstrap(parsed: ParsedCommand, io: CliIO, runtime: () => Pro
|
||||
return state.status === 'failed' ? 1 : 0
|
||||
}
|
||||
|
||||
/** `mqdh status`: one read-only ecosystem/app version view. */
|
||||
async function runStatus(parsed: ParsedCommand, io: CliIO, runtime: () => Promise<MdhRuntime>): Promise<number> {
|
||||
expectNoSubcommand(parsed)
|
||||
allowFlags(parsed, ['json'])
|
||||
const app = await runtime()
|
||||
const status = await app.status()
|
||||
if (booleanFlag(parsed, 'json')) {
|
||||
io.stdout(json({
|
||||
schema: 'marqdo.mqdh.status',
|
||||
schema_version: 1,
|
||||
app: { version: APP_VERSION, home: status.home, workspace: status.workspace },
|
||||
platform: status.platform,
|
||||
node: status.node,
|
||||
ecosystem: status.ecosystem,
|
||||
market: status.market,
|
||||
knowledge: status.knowledge,
|
||||
privacy: status.privacy,
|
||||
update: status.update,
|
||||
}))
|
||||
return 0
|
||||
}
|
||||
const environment = status.ecosystem.current
|
||||
const version = environment ? `${environment.version} (${environment.id})` : 'not installed'
|
||||
const tools = status.ecosystem.tools.length === 0
|
||||
? 'none'
|
||||
: status.ecosystem.tools.map(tool => `${tool.command} ${tool.version ?? 'unknown'}`).join(', ')
|
||||
io.stdout([
|
||||
`app: ${APP_VERSION} home: ${status.home}`,
|
||||
`workspace: ${status.workspace}`,
|
||||
`platform: ${status.platform} node: ${status.node}`,
|
||||
`runtime: ${status.ecosystem.runtime.version ?? 'not installed'}`,
|
||||
`environment: ${version}`,
|
||||
`bundle: ${status.ecosystem.std.version ?? 'not installed'} modules=${status.ecosystem.std.modules.length} digest=${status.ecosystem.std.digest ?? 'n/a'}`,
|
||||
`tools: ${tools}`,
|
||||
`market: entries=${status.market.entries} installed=${status.market.installed} enabled=${status.market.enabled}`,
|
||||
`knowledge: collections=${status.knowledge.collections} sources=${status.knowledge.sources} enabled=${status.knowledge.enabled}`,
|
||||
`privacy: telemetry=${String(status.privacy.telemetry)} session_upload=${String(status.privacy.sessionUpload)} plugin_install=${String(status.privacy.pluginInstall)}`,
|
||||
`update: channel=${status.update.channel} checked=${status.update.checked_at ?? 'never'} available=${String(status.update.update_available)} latest=${status.update.latest?.version ?? 'unknown'}${status.update.last_error === null ? '' : ` error=${status.update.last_error.code}`}`,
|
||||
].join('\n') + '\n')
|
||||
return 0
|
||||
}
|
||||
|
||||
/** `mqdh doctor`. */
|
||||
async function runDoctor(parsed: ParsedCommand, io: CliIO, runtime: () => Promise<MdhRuntime>): Promise<number> {
|
||||
expectNoSubcommand(parsed)
|
||||
@@ -389,6 +434,14 @@ async function runUpdate(parsed: ParsedCommand, io: CliIO, runtime: () => Promis
|
||||
`channel: ${state.channel}`,
|
||||
`latest: ${state.latest?.version ?? 'none'}${state.latest === null ? '' : ` (${state.latest.signature})`}`,
|
||||
`update available: ${String(state.update_available)}`,
|
||||
...(state.latest === null ? [] : [
|
||||
`published: ${state.latest.published_at}`,
|
||||
`download: ${state.latest.asset.url}`,
|
||||
`release: ${state.latest.release_url}`,
|
||||
...(state.latest.known_limits.length === 0 ? [] : ['known limits:']),
|
||||
...state.latest.known_limits.map(limit => ` - ${limit}`),
|
||||
...(state.latest.notes === null ? [] : ['release notes:', ...state.latest.notes.split('\n').map(line => ` ${line}`)]),
|
||||
]),
|
||||
...(state.last_error === null ? [] : [`error: ${state.last_error.code}: ${state.last_error.message}`]),
|
||||
].join('\n') + '\n')
|
||||
}
|
||||
|
||||
@@ -52,6 +52,10 @@ export interface UpdateCandidate {
|
||||
readonly node: string
|
||||
readonly signature: 'verified' | 'unsigned'
|
||||
readonly known_limits: readonly string[]
|
||||
/** Release notes from the trusted release body, or null. */
|
||||
readonly notes: string | null
|
||||
/** Official browser URL of the release page. */
|
||||
readonly release_url: string
|
||||
}
|
||||
|
||||
/** Persisted update state. */
|
||||
@@ -135,6 +139,8 @@ function candidateOf(candidate: AppReleaseCandidate): UpdateCandidate {
|
||||
node: candidate.manifest.app.node,
|
||||
signature: candidate.signature.status,
|
||||
known_limits: candidate.manifest.known_limits,
|
||||
notes: candidate.notes,
|
||||
release_url: candidate.browser_url,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ export interface GiteaRelease {
|
||||
readonly prerelease: boolean
|
||||
readonly draft: boolean
|
||||
readonly target_commitish: string | null
|
||||
/** Release notes authored in the trusted Gitea release, truncated. */
|
||||
readonly body: string | null
|
||||
readonly assets: readonly GiteaAsset[]
|
||||
}
|
||||
|
||||
@@ -72,11 +74,15 @@ function parseRelease(raw: unknown): GiteaRelease {
|
||||
const record = raw as Record<string, unknown>
|
||||
if (typeof record.tag_name !== 'string') throw new GiteaError('invalid_response', 'release has no tag_name')
|
||||
const assets = Array.isArray(record.assets) ? record.assets.map(parseAsset) : []
|
||||
const body = typeof record.body === 'string' && record.body.trim() !== ''
|
||||
? record.body.slice(0, 8192)
|
||||
: null
|
||||
return {
|
||||
tag_name: record.tag_name,
|
||||
prerelease: record.prerelease === true,
|
||||
draft: record.draft === true,
|
||||
target_commitish: typeof record.target_commitish === 'string' ? record.target_commitish : null,
|
||||
body,
|
||||
assets,
|
||||
}
|
||||
}
|
||||
@@ -131,6 +137,8 @@ export interface AppReleaseCandidate {
|
||||
readonly asset: { readonly name: string; readonly url: string; readonly size: number; readonly sha256: string }
|
||||
readonly manifest_url: string
|
||||
readonly browser_url: string
|
||||
/** Release notes from the release body, or null when absent. */
|
||||
readonly notes: string | null
|
||||
}
|
||||
|
||||
/** Read a detached signature asset when the release publishes one. */
|
||||
@@ -258,6 +266,7 @@ async function inspectRelease(
|
||||
},
|
||||
manifest_url: manifestAsset.browser_download_url,
|
||||
browser_url: `${authority}/${repository}/releases/tag/${release.tag_name}`,
|
||||
notes: release.body,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ import { BootstrapManager } from './bootstrap/manager.ts'
|
||||
import { DiagnosticsStore } from './diagnostics/store.ts'
|
||||
import type { DiagnosticIdentity } from './diagnostics/store.ts'
|
||||
import { AppUpdater } from './distribution/updater.ts'
|
||||
import type { UpdateState } from './distribution/updater.ts'
|
||||
import { targetTriple } from './platform/detect.ts'
|
||||
import { APP_VERSION } from './version.ts'
|
||||
import type { KnowledgeSearchResult } from './knowledge/manager.ts'
|
||||
@@ -88,6 +89,8 @@ export interface MdhStatus {
|
||||
readonly privacy: { readonly telemetry: false; readonly sessionUpload: false; readonly pluginInstall: false }
|
||||
readonly platform: string
|
||||
readonly node: string
|
||||
/** Persisted application update view (no network check on read). */
|
||||
readonly update: UpdateState
|
||||
}
|
||||
|
||||
/** Resolve one CLI path override safely. */
|
||||
@@ -325,6 +328,7 @@ export class MdhRuntime {
|
||||
privacy: { telemetry: false, sessionUpload: false, pluginInstall: false },
|
||||
platform: `${process.platform}-${process.arch}`,
|
||||
node: process.version,
|
||||
update: await this.updater.state(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,3 +80,32 @@ test('a token is read from stdin and stored without appearing in output', async
|
||||
assert.doesNotMatch(output.out.join(''), new RegExp(token))
|
||||
assert.equal(await runtime.diagnostics.hasToken(), true)
|
||||
})
|
||||
|
||||
test('status emits a read-only app and ecosystem version view', async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'mqdh-cli-'))
|
||||
const runtime = await MdhRuntime.create({ home: join(root, 'home'), workspace: join(root, 'ws') })
|
||||
const view = sink()
|
||||
const code = await runProductCli(['status', '--json'], { io: view.io, runtime: async () => runtime })
|
||||
assert.equal(code, 0)
|
||||
const parsed = JSON.parse(view.out.join('')) as {
|
||||
schema: string
|
||||
app: { version: string; home: string }
|
||||
ecosystem: { runtime: { installed: boolean }; std: { installed: boolean; modules: string[] } }
|
||||
privacy: { telemetry: boolean; sessionUpload: boolean; pluginInstall: boolean }
|
||||
update: { schema: string; channel: string; checked_at: string | null; latest: unknown }
|
||||
}
|
||||
assert.equal(parsed.schema, 'marqdo.mqdh.status')
|
||||
assert.equal(parsed.app.version, APP_VERSION)
|
||||
assert.equal(parsed.ecosystem.runtime.installed, false)
|
||||
assert.equal(parsed.ecosystem.std.installed, false)
|
||||
assert.deepEqual(parsed.privacy, { telemetry: false, sessionUpload: false, pluginInstall: false })
|
||||
assert.equal(parsed.update.schema, 'marqdo.mqdh.update')
|
||||
assert.equal(parsed.update.channel, 'stable')
|
||||
assert.equal(parsed.update.checked_at, null)
|
||||
assert.equal(parsed.update.latest, null)
|
||||
const text = sink()
|
||||
assert.equal(await runProductCli(['status'], { io: text.io, runtime: async () => runtime }), 0)
|
||||
assert.match(text.out.join(''), /^app: /)
|
||||
assert.match(text.out.join(''), /privacy: telemetry=false/)
|
||||
assert.match(text.out.join(''), /update: channel=stable checked=never/)
|
||||
})
|
||||
@@ -81,6 +81,7 @@ async function startReleaseServer(releases: readonly {
|
||||
manifest: string
|
||||
signature: string
|
||||
size: number
|
||||
body?: string
|
||||
}[]): Promise<{ server: Server; authority: string; stop: () => void }> {
|
||||
const server = createServer(async (req: IncomingMessage, res: ServerResponse) => {
|
||||
const url = req.url ?? ''
|
||||
@@ -92,6 +93,7 @@ async function startReleaseServer(releases: readonly {
|
||||
prerelease: false,
|
||||
draft: false,
|
||||
target_commitish: null,
|
||||
body: release.body ?? null,
|
||||
assets: [
|
||||
{ name: 'mqdh-release.json', size: Buffer.byteLength(release.manifest), browser_download_url: `${authority}/assets/${release.tag}/mqdh-release.json` },
|
||||
{ name: 'mqdh-release.json.sig', size: Buffer.byteLength(release.signature), browser_download_url: `${authority}/assets/${release.tag}/mqdh-release.json.sig` },
|
||||
@@ -150,13 +152,15 @@ test('checks, verifies, activates and rolls back a signed application release',
|
||||
const v3 = await buildRelease({ root, version: '0.3.0', target })
|
||||
const server = await startReleaseServer([
|
||||
{ tag: 'mqdh-v0.2.0', archive: v2.archive, manifest: v2.manifest, signature: v2.signature, size: v2.size },
|
||||
{ tag: 'mqdh-v0.3.0', archive: v3.archive, manifest: v3.manifest, signature: v3.signature, size: v3.size },
|
||||
{ tag: 'mqdh-v0.3.0', archive: v3.archive, manifest: v3.manifest, signature: v3.signature, size: v3.size, body: '修复启动问题并更新默认 Bundle。' },
|
||||
])
|
||||
const { updater, installRoot } = await makeUpdater(server.authority)
|
||||
try {
|
||||
const checked = await updater.check({ force: true })
|
||||
assert.equal(checked.latest?.version, '0.3.0')
|
||||
assert.equal(checked.latest?.signature, 'verified')
|
||||
assert.equal(checked.latest?.notes, '修复启动问题并更新默认 Bundle。')
|
||||
assert.match(checked.latest?.release_url ?? '', /releases\/tag\/mqdh-v0\.3\.0$/)
|
||||
assert.equal(checked.update_available, true)
|
||||
assert.equal(checked.current?.version, '0.1.0')
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import { spawn } from 'node:child_process'
|
||||
|
||||
const here = dirname(fileURLToPath(import.meta.url))
|
||||
const root = resolve(here, '..')
|
||||
const productCommands = new Set(['bootstrap', 'doctor', 'repair', 'report', 'update', 'network', 'uninstall', 'help'])
|
||||
const productCommands = new Set(['bootstrap', 'status', 'doctor', 'repair', 'report', 'update', 'network', 'uninstall', 'help'])
|
||||
|
||||
/** Resolve the application home without touching the user's `~/.dsh`. */
|
||||
function resolveHome() {
|
||||
|
||||
Reference in new issue
Block a user