forked from cflmy/deepseek-harness
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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,7 @@ 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`。
|
||||
|
||||
## 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。
|
||||
@@ -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,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 端到端。
|
||||
@@ -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,46 @@ 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,
|
||||
}))
|
||||
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)}`,
|
||||
].join('\n') + '\n')
|
||||
return 0
|
||||
}
|
||||
|
||||
/** `mqdh doctor`. */
|
||||
async function runDoctor(parsed: ParsedCommand, io: CliIO, runtime: () => Promise<MdhRuntime>): Promise<number> {
|
||||
expectNoSubcommand(parsed)
|
||||
@@ -389,6 +432,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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -80,3 +80,26 @@ 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 }
|
||||
}
|
||||
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 })
|
||||
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/)
|
||||
})
|
||||
@@ -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