Compare commits

..
Author SHA1 Message Date
cflmy 99073e94c3 test: record a real Gitea feedback submission acceptance
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
Capture one redacted app-area diagnostic in an isolated MQDH_HOME, store a real
token through the private credential file, and submit it to the private
cflmy/mqdh-feedback-e2e fixture. Record the created issue URL, duplicate
fingerprint comment path, invalid-repository 404 failure and offline queue
result. STATUS moves DIAG-03 to PASS (real Gitea + stand-in) and keeps DIAG-05
PARTIAL because the full failure-sample/attachment/offline-recovery matrix is
not run.

Token/report content are not committed; the fixture repo is private.
2026-12-01 12:09:54 +08:00
cflmy 7e2f1ac325 Merge pull request #21 from codex/issue-16-status-update
ci/woodpecker/push/ci Pipeline was successful
feat: persisted update view in mqdh status (#16)
2026-12-01 09:43:48 +08:00
cflmy 9979411e08 feat: show the persisted update view in mqdh status
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
Continue app-harness#16: MdhStatus carries the persisted UpdateState and
mqdh status [--json] shows channel, last check time, availability, latest
candidate and the last update error without triggering a network check.
DISTRIBUTION distinguishes this read-only view from the explicit update check;
the CLI test asserts the empty-install values and text line.

Verified locally: typecheck 5/5, cli test 6 pass, all downstream node tests
77 pass/3 skipped. No release/tag; E09 notification/reconciliation and real
Gitea feedback E2E remain UNVERIFIED.
2026-12-01 09:24:55 +08:00
cflmy 28df81ee11 Merge pull request #20 from codex/issue-16-update-notes
ci/woodpecker/push/ci Pipeline was successful
feat: update check shows release notes and download (#16)
2026-11-30 22:21:47 +08:00
7 changed files with 92 additions and 2 deletions

No files matched your search

+1
View File
@@ -74,6 +74,7 @@ mqdh update rollback --confirm [--json]
- 更新不触碰 `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. 构建与发布
+2 -2
View File
@@ -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,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,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/报告不含凭据。
+2
View File
@@ -261,6 +261,7 @@ async function runStatus(parsed: ParsedCommand, io: CliIO, runtime: () => Promis
market: status.market,
knowledge: status.knowledge,
privacy: status.privacy,
update: status.update,
}))
return 0
}
@@ -280,6 +281,7 @@ async function runStatus(parsed: ParsedCommand, io: CliIO, runtime: () => Promis
`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
}
+4
View File
@@ -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(),
}
}
@@ -92,14 +92,20 @@ test('status emits a read-only app and ecosystem version view', async () => {
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/)
})