比较提交

..

5 提交

作者 SHA1 备注 提交日期
1a18a8ac85 docs(acceptance): record r1/r2 gate closure and pending hardware steps
一些检测仍在等待运行
ci / Portable quality checks (push) Waiting to run
ci / Windows Tauri build (push) Waiting to run
The R1 and R2 batches were recorded as gate-verified, but the Tauri
release build and the Playwright suite had never been run against them.
Both were executed here and pass, together with the rest of the stage
gate. Record the measured numbers rather than the previously estimated
ones, and name every step that still needs a live AstrBot container.

F-04 is now verified at the packaging level: the production CSP
containing blob: is present in the release binary. Dev builds do not
inject the CSP, so this was the only automated evidence available for
it; rendering an actual attachment remains a manual step.

Also record two things this run surfaced. Prettier reports 25 files
repo-wide, not the 20 previously written down, and the Playwright 680px
case passes only because that viewport sits exactly on the second CSS
breakpoint, leaving the 681px to 900px icon-only band untested and
without accessible nav labels. The latter is tracked as F-62.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 00:06:17 +08:00
25f41ff50f docs(reports): assign f-ids to five untracked audit findings
The 2026-07-26 audit records 68 findings, but five of them never
received an F-id and belonged to no batch: P2-6 (download_attachment
buffers the whole body before checking the 16 MiB cap), P2-7 (health()
omits the bearer that SSE sends), P2-8 (the reconnect backoff resets to
100ms on a graceful close, giving a hot loop), P2-29 (JWT exp is
checked with no clock skew margin), and P3-7 (the operations switch
guard has no production writer).

Assign F-70 to F-73 into R5, which already owns gateway_client.rs and
astrbot_client.rs through F-26 and F-30, so the queue's own
same-file-same-batch rule holds and R4 and R5 do not contend for one
file. Assign F-74 into R8 with a note that R3's F-19 extends only the
guard's read side. F-69 stays permanently unassigned because it was
retracted.

Also correct the Rust test count. The queue said 67 to 73 and the
status summary said 67 to 76; a real cargo test --workspace run gives
76 unit tests in astrbot-desktop and 96 passed with 2 ignored across
the workspace, so 73 was stale.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 00:05:00 +08:00
566744a025 docs(changelog): repair keep-a-changelog structure
Commit 3d1d962 inserted an unreleased heading between the H1 and the
preamble without a blank line, so Markdown absorbed the "all notable
changes" preamble as a lazy continuation of a list item, and it also
prepended a UTF-8 BOM. Commit ceb7512 then inserted the 0.1.0-alpha.2
section directly under the H1, which is why the file began
mid-document, and indented the preamble to cement it inside the
bullet.

Restore the canonical order (title, preamble, single [Unreleased] with
one Added/Changed/Fixed/Security group, then the released section),
strip the BOM, and move the duplicate-optimistic-messages entry from
Changed to Fixed. Entry text is otherwise unchanged; the R1 and R2
Fixed groups were verified to be disjoint before merging. The file now
passes prettier --check.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 00:02:51 +08:00
8646a064dd chore(prettier): ignore machine-local claude settings
`.claude/settings.local.json` is untracked but still scanned by
`prettier --check .`, so `check:frontend` fails for any developer who
has local Claude Code settings.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 00:00:48 +08:00
5ecfaa433b fix(pet): restore prettier formatting in the sprite error branch
Commit 41592e2 shortened the localized fallback string but left the
ternary wrapped across three lines, which prettier now collapses. This
file passed `prettier --check` at 785f125 and failed afterwards, so it
is the only formatting regression introduced by the R1/R2 batch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-27 00:00:33 +08:00
共有 7 个文件被更改,包括 200 次插入 和 63 次删除

查看文件

@ -1,6 +1,7 @@
node_modules
dist
coverage
.claude
src-tauri/target
packages/*/dist
pnpm-lock.yaml

查看文件

@ -1,60 +1,15 @@
# Changelog
# Changelog
## [0.1.0-alpha.2] - 2026-07-20
### Added
- Q6-Q8 companion state, multi-monitor safe placement, read-only diagnostics, proactive-message handling, quiet hours, and Web Speech MVP.
- Q9 local session recovery marker and release validation checklist.
### Fixed
- Streaming chat history isolation and completed-message persistence across both slots.
- Tray exit, hidden-window cleanup, and release build packaging regressions.
### Notes
- This is an unsigned local Windows build. Automatic updates and code signing are not configured.
## Unreleased
### Added
- Q10-Q15 chat experience increment: lightweight Markdown rendering, message actions, generation controls, session actions, connection controls, and responsive chat layout.
- AstrBot OpenAPI adapter foundation: SSE mapper, dual-slot runtime skeleton, credential enrollment IPC, transport-aware profiles (ADR-0005).
All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow Semantic Versioning.
## [Unreleased]
### Fixed
- Long-lived event streams are no longer killed by a total request timeout. Streaming endpoints now
use a separate HTTP client with idle-based `read_timeout` detection, so a desktop-v1 connection
survives past 30 seconds and an AstrBot reply may take longer than two minutes.
- Chinese and other multi-byte text no longer turns into replacement characters when a character
straddles two network chunks; the SSE stream is now split into lines at the byte level.
- A chat message is no longer resent after AstrBot has started answering it, which previously
duplicated both the question and the answer in the remote conversation. A stream that breaks
mid-reply now reports a distinct error so it can be retried manually.
- A long reply no longer makes the rest of its slot report "not connected" while it streams, so
attachments, session lists, and capability lookups keep working during generation.
- Stopping generation, or losing the stream mid-reply, now finalizes the message. It could
previously stay marked as generating, including after a restart.
- Stopping generation no longer flickers the connection status to disconnected and back.
- Corrected a session-timestamp type and moved a link-safety helper out of a component module, both
of which broke the type and lint gates for the previous batch.
### Changed
- Synchronized the 13-item roadmap status with the actual P02 implementation state.
- Documented external prerequisites for HTTPS certificate pinning, signed updates, and dual-server soak testing.
- Fixed duplicate optimistic chat messages when switching sessions repeatedly.
### Added
- Q10-Q15 chat experience increment: lightweight Markdown rendering, message actions, generation controls, session actions, connection controls, and responsive chat layout.
- AstrBot OpenAPI adapter foundation: SSE mapper, dual-slot runtime skeleton, credential enrollment IPC, transport-aware profiles (ADR-0005).
- Authoritative architecture, implementation, and repository workflow documents.
- Repository rules, ignore rules, implementation plan, progress tracking, and decision log.
- Tauri 2, React, TypeScript, Vite, and Rust workspace skeleton with tray and single-instance lifecycle.
@ -78,6 +33,11 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
- Runtime operations switch guard that blocks operations slot changes while an operations task is active.
- Duplicate `server_instance_id` warnings without silently merging Profiles.
### Changed
- Synchronized the 13-item roadmap status with the actual P02 implementation state.
- Documented external prerequisites for HTTPS certificate pinning, signed updates, and dual-server soak testing.
### Fixed
- Scoped AstrBot stream event ids per chat request so the second and later messages on a
@ -92,6 +52,22 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
- Restricted rendered markdown links to http, https, and mailto and added `rel="noopener"`.
- Replaced `[object Object]` IPC error text with the message returned by Rust.
- Restored corrupted user-facing strings and an accessibility label in the pet view and shell.
- Long-lived event streams are no longer killed by a total request timeout. Streaming endpoints now
use a separate HTTP client with idle-based `read_timeout` detection, so a desktop-v1 connection
survives past 30 seconds and an AstrBot reply may take longer than two minutes.
- Chinese and other multi-byte text no longer turns into replacement characters when a character
straddles two network chunks; the SSE stream is now split into lines at the byte level.
- A chat message is no longer resent after AstrBot has started answering it, which previously
duplicated both the question and the answer in the remote conversation. A stream that breaks
mid-reply now reports a distinct error so it can be retried manually.
- A long reply no longer makes the rest of its slot report "not connected" while it streams, so
attachments, session lists, and capability lookups keep working during generation.
- Stopping generation, or losing the stream mid-reply, now finalizes the message. It could
previously stay marked as generating, including after a restart.
- Stopping generation no longer flickers the connection status to disconnected and back.
- Corrected a session-timestamp type and moved a link-safety helper out of a component module, both
of which broke the type and lint gates for the previous batch.
- Duplicate optimistic chat messages when switching sessions repeatedly.
### Security
@ -100,3 +76,19 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
- Kept real UNC writes, signing keys, updater keys, and release secrets outside P00.
- Rejected Token, password, API Key, URL credential, query-string credential, and unknown fields at the Profile IPC boundary.
- Required explicit approval for insecure HTTP and kept slots, connections, and credential enrollment outside P01.
## [0.1.0-alpha.2] - 2026-07-20
### Added
- Q6-Q8 companion state, multi-monitor safe placement, read-only diagnostics, proactive-message handling, quiet hours, and Web Speech MVP.
- Q9 local session recovery marker and release validation checklist.
### Fixed
- Streaming chat history isolation and completed-message persistence across both slots.
- Tray exit, hidden-window cleanup, and release build packaging regressions.
### Notes
- This is an unsigned local Windows build. Automatic updates and code signing are not configured.

查看文件

@ -468,8 +468,10 @@ was verified to genuinely fail against the previous decoding (it reproduced thre
characters in place of the leading CJK character), so it is a real regression guard rather than a
tautology.
Gate result: fmt, clippy (`-D warnings`), `cargo test --workspace` (73), typecheck, lint, Vitest
(19), and the production build all pass.
Gate result: fmt, clippy (`-D warnings`), `cargo test --workspace`, typecheck, lint, Vitest
(19), and the production build all pass. (The Rust count recorded here was originally 73; a
measured run on 2026-07-27 gives 76 unit tests in `astrbot-desktop` and 96 passed / 2 ignored
across the workspace.)
### Follow-up work pulled into R2 after review
@ -501,3 +503,53 @@ commits rewritten. Future review passes must run read-only or in an isolated wor
- Not covered by this batch, still open from P1-2's description: `commands.rs` persists the user
message row before the send is validated (F-18, batch R3), so a failed send still leaves a row.
- Next: batch R3 (isolation and state correctness).
## 2026-07-27: R1/R2 verification closure
Current stage: P02 dual connections, branch `feat/p02-dual-connections`.
The eleven R1/R2 commits had never been pushed, and two gates recorded as outstanding had never
run. Both are now closed. The branch was pushed to `origin` as a fast-forward
(`785f125..573f9f7`); no history was rewritten.
### Executed
Full gate green: `cargo fmt --all -- --check`, `cargo clippy --workspace --all-targets -D warnings`,
`cargo test --workspace` (96 passed / 2 ignored; `astrbot-desktop` unit tests 76), `npm run
typecheck`, `npm run lint`, `npm run test -- --run` (19 / 4 files), `npm run build`, plus the two
that had never been run: `npm run test:e2e` (5/5) and `npm run tauri:build` (NSIS, release profile
in 3m25s). Detailed results and artifact paths are in `docs/q9-local-acceptance.md`.
F-04 is machine-verified at the packaging level: the production CSP containing `blob:` is present
in the release binary. Rendering an actual attachment still requires the manual step.
### Defects this closure exposed
- `DesktopPetView.tsx` was the only formatting regression from the R1/R2 batch; it passed
`prettier --check` at the pre-push base and failed after. Fixed.
- `.claude/settings.local.json` is untracked yet scanned by `prettier --check .`, so
`check:frontend` failed for any developer with local Claude Code settings. Added to
`.prettierignore`.
- `CHANGELOG.md` was structurally corrupted by two earlier commits: the preamble had been absorbed
into a bullet list, the released section sat above it, and there were two unreleased headings and
a stray BOM. Repaired without changing any entry text.
- The fix queue had five audit findings with no F-id and no batch (P2-6, P2-7, P2-8, P2-29, P3-7).
Assigned F-70 to F-74.
- The Playwright suite passes, but its 680px case sits exactly on the second CSS breakpoint, so the
681px-900px icon-only band is covered by no test and has nav buttons with no accessible label.
Recorded against F-62; not fixed here.
### Test status
Rust 96 passed / 2 ignored. Frontend 19 passed / 4 files. Playwright 5 passed. Prettier reports 25
files repo-wide (20 pre-existing, 3 new report documents, 1 machine-local now ignored, 1 fixed);
a repo-wide formatting sweep stays deferred.
### Not claimed
Forgejo CI is still unverified — no runner has executed the committed workflow. Real-hardware
acceptance for F-01, F-10, F-11, F-12, F-13, and F-49 has not been performed and is listed as
pending in `docs/q9-local-acceptance.md`. Certificate pinning, signed updates, and dual-server soak
remain externally blocked.
Next: batch R3 (isolation and state correctness), F-14 through F-19.

查看文件

@ -42,6 +42,70 @@ This checklist covers the local Q9 release line only. It does not claim Windows
- Tauri release executable and unsigned NSIS installer: passed.
- Full Prettier check still reports 20 pre-existing files outside this focused fix; broad formatting was intentionally not mixed into the release increment.
## 2026-07-27 verification update (R1 + R2 closure)
The R1 and R2 batches were previously recorded as gate-verified, but the Tauri release build and
the Playwright suite had never been executed against them. Both were run here.
### Gate results
| Command | Result |
| --- | --- |
| `cargo fmt --all -- --check` | passed |
| `cargo clippy --workspace --all-targets -- -D warnings` | passed, no warnings |
| `cargo test --workspace` | 96 passed, 0 failed, 2 ignored (`astrbot-desktop` unit 76, `dual_gateway_integration` 2, `desktop-protocol` unit 9, `protocol_contract` 5, `dual_instance` 4; `windows_dialog_smoke` and `soak` ignored) |
| `npm run typecheck` | passed |
| `npm run lint` | passed (`--max-warnings 0`) |
| `npm run test -- --run` | 19 passed / 4 files |
| `npm run build` | passed |
| `npm run test:e2e` | 5 passed / 5 |
| `npm run tauri:build` | passed, release profile in 3m25s |
This settles a documented conflict: the queue recorded the Rust total as 73 and the status summary
as 76. The measured `astrbot-desktop` unit count is 76, so 73 was stale.
### Release artifact
- `target/release/bundle/nsis/AstrBot Desktop_0.1.0-alpha.2_x64-setup.exe`, 8,867,530 bytes,
built 2026-07-27 00:02:12 +0800.
- F-04 packaging is machine-verified: the production CSP string
`img-src 'self' asset: http://asset.localhost data: blob:` is present in
`target/release/astrbot-desktop.exe`. Dev builds do not inject the CSP, so this is the only
automated evidence available for F-04; that an attachment actually renders still needs the
manual step below.
### Findings from this run
- `src/features/pet/DesktopPetView.tsx` was the only formatting regression introduced by the R1/R2
commits (verified by checking the same file at the pre-push base, where it passed). Fixed.
- `prettier --check .` reports 25 files: 20 pre-existing tracked files, 3 new report documents,
1 untracked machine-local file (`.claude/settings.local.json`, now in `.prettierignore`), and the
pet view regression above. The earlier record of "20" undercounted. A repo-wide formatting sweep
remains deliberately deferred.
- The Playwright suite passes, but the 680px case passes for a reason worth recording: `styles.css`
has two breakpoints. `max-width: 900px` collapses the sidebar to icons and hides the nav label,
and `max-width: 680px` restores it as a mobile top bar. The test viewport sits exactly on the
second breakpoint, so the accessible name is intact. The **681px–900px band is icon-only and
covered by no test**, and in that band the nav buttons have no accessible label at all. That is
the substance of audit P3-11 / F-62 and is not fixed here.
### Pending, requires a live AstrBot container
Not executed, not claimed. Each item names the fix it is the acceptance evidence for.
1. Install the fresh NSIS package, send a message with an image, confirm it renders — F-04.
2. Pet event linkage, dragging, and the context menu — F-03.
3. Three consecutive messages on one connection, each reply complete — F-01.
4. Hold a connection past 30s; take one reply past 120s to completion — F-10.
5. CJK-heavy prompts with no `U+FFFD` in the rendered reply — F-11.
6. Disconnect and restore the network; confirm the **remote** conversation has no duplicated
question or answer — F-12, observable only server-side.
7. Stop generation mid-reply, restart the app, confirm nothing is still marked as generating — F-13.
8. With a long reply in flight, confirm session lists, attachments, and capability lookups still
respond — F-49.
Items 1 and 2 need only the installer, not a container.
## Explicitly pending external acceptance
- HTTPS certificate pinning requires a real HTTPS endpoint and first-trust confirmation.

查看文件

@ -1,18 +1,29 @@
# AstrBot Desktop 修复队列
基于 2026-07-26 全源码审计 · 共 68 项 · 8 个批次
基于 2026-07-26 全源码审计 · 共 73 项 · 8 个批次
> 配套审计档案:[full-source-audit-2026-07-26.md](./full-source-audit-2026-07-26.md)。
> 本文中的 `P0-1` / `P1-7` 等编号均指向该档案中的对应发现。
>
> **编号说明**:`F-69` 永久空缺——该编号系一次审查污染中被凭空注入,已于 2026-07-26 撤销
> (见 [r1-r2-status-2026-07-26.md](./r1-r2-status-2026-07-26.md) §5),不得复用。
> `F-70` – `F-74` 于 2026-07-26 补编:初版队列遗漏了审计中的 P2-6、P2-7、P2-8、P2-29、P3-7
> 五条发现,它们此前没有任何批次归属。
## 执行状态(2026-07-26 更新)
| 批次 | 状态 | 说明 |
|---|---|---|
| R1 发布阻断批 | **已完成,门槛已验证** | 9 项全部实现。2026-07-26 首次跑完整门槛,发现 2 处编译/lint 失败并修复(详见下方「R1 门槛验证结果」),补写 F-05 缺失的单测。现全绿。 |
| R2 传输层批 | **已完成,门槛已验证** | F-10 – F-13 全部实现,新增 6 条 Rust 测试(workspace 67 → 73)。顺带并入 F-56(P3-4,取消不再置 Disconnected)。全绿。 |
| R2 传输层批 | **已完成,门槛已验证** | F-10 – F-13 全部实现,新增 9 条 Rust 测试(`astrbot-desktop` 单元测试 67 → 76)。顺带并入 F-56(P3-4,取消不再置 Disconnected)。全绿。 |
| R3 – R8 | 未开始 | 下一批为 R3。依赖关系见文末批次依赖图。 |
> 计数订正(2026-07-27 实测):本表此前记为「67 → 73(+6)」,与
> `r1-r2-status-2026-07-26.md` 的「67 → 76(+9)」冲突。实跑 `cargo test --workspace` 的结果是
> `astrbot-desktop` 单元测试 **76 通过**,workspace 合计 **96 通过 / 2 忽略**
> (lib 76 + dual_gateway_integration 2 + desktop-protocol 9 + protocol_contract 5 + dual_instance 4;
> windows_dialog_smoke 与 soak 各 1 项 ignored)。故 76 为准,73 系过期数据。
### R1 门槛验证结果(2026-07-26)
首次编译暴露 2 处失败,均为 R1 自身改动的直接后果:
@ -189,6 +200,14 @@
| **F-32** | P2-17 | `astrbot.rs:381-444` | complete 后记录 per-message 完成标记,同 id 的后续 plain/complete 需显式重新开窗或忽略 | 单测覆盖"重复 complete"与"complete 后迟到 plain" |
| **F-33** | P2-18 | `astrbot.rs:336-353` | 非图片媒体输出通用占位标记;`pending_media` 改 FIFO 队列 | 单测:`record` + `attachment_saved` 产出可见标记;双图交错不丢 |
| **F-34** | P2-13 | `commands.rs:341`;`ChatPanel.tsx:916-917` | mapper 为无 `message_id` 的流合成稳定流内 id(如 `synthetic-{stream}`),前后端同步取消 event_id 回退 | 单测:省略 message_id 的多帧流合并为一条消息 |
| **F-70** | P2-6 | `astrbot_client.rs:383-388` | `download_attachment` 先查 `Content-Length`,改流式累读并在超过 16MiB 时立即中断,不再整体读入内存后才校验 | 单测:mock 返回超限 body,客户端在读满前返回超限错误且内存占用有界 |
| **F-71** | P2-7 | `gateway_client.rs:121-126` | `health()` 与 SSE 一致附带 bearer | 单测:mock 对无 bearer 的 health 返回 401,激活仍成功即失败 |
| **F-72** | P2-8 | `gateway_client.rs:237-238` | 仅在「连接存活超阈值且收到过事件」时重置退避,避免服务端接受即优雅关流时进入约 10 次/秒热重连 | 单测:mock 接受连接后立即关闭,断言重连间隔单调增长 |
| **F-73** | P2-29 | `astrbot_client.rs:554-565` | JWT `exp` 判定改 `exp <= now + 30s`;不可解析的 token 打 debug 日志 | 单测:`exp` 落在 30 秒内的 token 被判为过期 |
上列四项系 2026-07-27 补编。它们与 F-26、F-30 同处 `gateway_client.rs` / `astrbot_client.rs`,按本队列
「同文件相邻改动合并进同一批」的编排原则归入 R5;放入 R4 会让两个可并行分支争夺同一文件。
R5 因此由 9 项增至 13 项,与 R3、R4 仍无依赖关系。
* * *
@ -226,7 +245,15 @@
## R8 · 剩余 P3 与外部依赖
**可随手带入相邻批次的 P3**:`F-53` 事件 timestamp 注入真实时钟(P3-1)· `F-54` `server_instance_id` 改 sha2 派生 + 兼容映射(P3-2)· `F-55` username 逐字节百分号编码(P3-3,**放宽用户名规则前必须先修**)· `F-56` 取消消息不再置 Disconnected(P3-4)· `F-57` 生产 CSP 移除 `127.0.0.1:*`(P3-5)· `F-58` 凭据轮换改「写新→落库→删旧」(P3-6)· `F-59` 退出前 deactivate 双槽并 flush 日志(P3-8)· `F-60` session_id 对象分支取键(P3-9)· `F-61` 桌宠窗口补 Suspense 边界(P3-10)· `F-62` 导航图标 `aria-hidden` + 测试选择器改语义文本(P3-11)· `F-63` reduced-motion 停帧 + onerror 清理 + DPR(P3-12)· `F-64` 文案统一中文(P3-13)· `F-65` 死控件与标签错误四处(P3-14)· `F-66` 测试 SSE 助手容错(P3-15)· `F-67` App.test mock 补 `close_pet_window`(P3-16)· `F-68` mock 订阅重放竞态(P3-18)
**可随手带入相邻批次的 P3**:`F-53` 事件 timestamp 注入真实时钟(P3-1)· `F-54` `server_instance_id` 改 sha2 派生 + 兼容映射(P3-2)· `F-55` username 逐字节百分号编码(P3-3,**放宽用户名规则前必须先修**)· `F-56` 取消消息不再置 Disconnected(P3-4)· `F-57` 生产 CSP 移除 `127.0.0.1:*`(P3-5)· `F-58` 凭据轮换改「写新→落库→删旧」(P3-6)· `F-59` 退出前 deactivate 双槽并 flush 日志(P3-8)· `F-60` session_id 对象分支取键(P3-9)· `F-61` 桌宠窗口补 Suspense 边界(P3-10)· `F-62` 导航图标 `aria-hidden` + 测试选择器改语义文本(P3-11)· `F-63` reduced-motion 停帧 + onerror 清理 + DPR(P3-12)· `F-64` 文案统一中文(P3-13)· `F-65` 死控件与标签错误四处(P3-14)· `F-66` 测试 SSE 助手容错(P3-15)· `F-67` App.test mock 补 `close_pet_window`(P3-16)· `F-68` mock 订阅重放竞态(P3-18)· `F-74` operations 切换守卫无生产写入方(P3-7)
**F-74 补充说明**(2026-07-27 补编):该守卫的**读侧已全线接通**——`slots.rs:97,108` →
`policy.rs:18-22` → `ProfileManager.tsx:276` 会依据 `operationsSwitchLocked` 禁用运维槽控件;但
`begin_operations_task` / `end_operations_task`(`runtime_guards.rs:28,45`)的调用方只有
`#[cfg(test)]`(`slots.rs:256,285`),因此 `connection_policy_status` 把一个**永为 false 的标志**
当作已激活的守卫上报。R3 的 F-19 只是把读侧扩展到 probe/disconnect,不含写侧,因此不覆盖本项。
审计给出的近期动作是**先在状态载荷中如实标注守卫未激活**,写侧接线待工具管线落地——这与下节
「工具提案六道闸门」条目联动。
**需要真机/外部条件,不进本轮编码**:

查看文件

@ -16,12 +16,15 @@
| R2 传输层批 | 4 | 已完成 | 已通过 | **未做** |
| R3 隔离与状态正确性 | 6 | 未开始 | — | — |
| R4 数据与凭据安全 | 6 | 未开始 | — | — |
| R5 协议健壮与契约治理 | 9 | 未开始 | — | — |
| R5 协议健壮与契约治理 | 13 | 未开始 | — | — |
| R6 体验、无障碍与产品红线 | 10 | 未开始 | — | — |
| R7 性能与工程化 | 8(1 项已提前完成) | 未开始 | — | — |
| R8 剩余 P3 | 16(1 项已提前完成) | 未开始 | — | — |
| R8 剩余 P3 | 17(1 项已提前完成) | 未开始 | — | — |
**已完成 15 项,剩余 53 项。** 共 10 个提交,工作区干净。
**已完成 15 项,剩余 58 项。** 共 10 个提交,工作区干净。
> 2026-07-27 订正:R5 由 9 项增至 13 项、R8 由 16 项增至 17 项。初版队列遗漏了审计中的
> P2-6、P2-7、P2-8、P2-29、P3-7 五条发现,现补编为 F-70 – F-74(`F-69` 保持永久空缺)。
---
@ -124,7 +127,7 @@
| --- | --- |
| `cargo fmt --all -- --check` | 通过 |
| `cargo clippy --workspace --all-targets -- -D warnings` | 通过 |
| `cargo test --workspace` | 76 通过 / 0 失败 / 0 ignored |
| `cargo test --workspace` | `astrbot-desktop` 单元测试 76 通过;workspace 合计 96 通过 / 0 失败 / 2 ignored |
| `npm run typecheck` | 通过 |
| `npm run lint` | 通过 |
| `npm run test -- --run` | 19 通过 / 4 文件 |
@ -159,10 +162,10 @@ R1 的前端 7 项按 F-02…F-09 逐项拆分提交。`astrbot.rs` 与 `astrbot
| --- | --- | --- | --- |
| **R3** | F-14 … F-19(6) | R1 的 F-06(已完成,**可立即开始**) | 探测移出全局锁且可取消;`listen()` 注销竞态(StrictMode 下 delta 翻倍);附件/草稿/错误按槽隔离;`switch_slot_session` 的 generation 校验;发送先校验后入库;`probe_connection_slot` 校验槽位分配 |
| **R4** | F-20 … F-25(6) | 无,可与 R3 并行 | 长会话取最新 N 条 + 游标分页;脱敏正则补裸 `token`/JWT;YAML/INI/.env 结构化脱敏;删除 profile 时清理凭据;敏感请求结构体手写 `Debug`;`account_id` 键模型统一 |
| **R5** | F-26 … F-34(9) | 无,可与 R3/R4 并行 | 未知事件类型降级为跳过;移除只读 payload 的 `deny_unknown_fields`;schema 漂移比对进 `cargo test`;`TransportKind` 拼写统一;删除恒 false 的身份自比较;mock 网关三缺陷;mapper 重复 complete / 迟到 plain;非图片媒体占位与 FIFO;无 `message_id` 流的稳定合成 id |
| **R5** | F-26 … F-34、F-70 … F-73(13) | 无,可与 R3/R4 并行 | 未知事件类型降级为跳过;移除只读 payload 的 `deny_unknown_fields`;schema 漂移比对进 `cargo test`;`TransportKind` 拼写统一;删除恒 false 的身份自比较;mock 网关三缺陷;mapper 重复 complete / 迟到 plain;非图片媒体占位与 FIFO;无 `message_id` 流的稳定合成 id;附件下载流式限额;`health()` 补 bearer;重连退避不再热循环;JWT `exp` 加时钟裕度 |
| **R6** | F-35 … F-44(10) | R3 | **产品红线**:`alwaysOnTop` 默认改 `false`;未读三连;重试按会话过滤;取消与真错误区分;`ChatMessage` 补四元组;键盘 focus 死锁;tablist 无障碍;凭据卡明文清空;轮询退避与告警;自动滚动与语音卸载清理 |
| **R7** | F-45 … F-52 中的 7 项(F-49 已完成) | R6 | spritesheet 去 `?inline` 改 WebP(lazy chunk ~5.2 MB → ~0.6 MB);前端渲染管线 memo 化;附件走二进制 IPC 通道;事件通道改每槽独立 mpsc;`styles.css` token 合并;`tauri.conf` 改 pnpm;tsconfig/eslint/vitest 收紧 |
| **R8** | F-53 … F-68 中的 15 项(F-56 已完成) | 随批携带 | 时钟注入、`server_instance_id` 改 sha2、username 逐字节编码、生产 CSP 移除 `127.0.0.1:*`、凭据轮换顺序、退出前 flush、Suspense 边界、`aria-hidden`、reduced-motion、文案统一等 |
| **R8** | F-53 … F-68、F-74 中的 16 项(F-56 已完成) | 随批携带 | 时钟注入、`server_instance_id` 改 sha2、username 逐字节编码、生产 CSP 移除 `127.0.0.1:*`、凭据轮换顺序、退出前 flush、Suspense 边界、`aria-hidden`、reduced-motion、文案统一、operations 守卫状态如实上报等 |
**当前构建仍可观测到的 R7 症状**:`npm run build` 产出的 `DesktopPetView` chunk 为 5,230.85 kB
(gzip 3,921.56 kB),即 F-45 描述的 `?inline` 内联问题,本轮未处理。

查看文件

@ -189,9 +189,7 @@ export function DesktopPetView({ embedded = false }: { embedded?: boolean }) {
);
} catch (reason) {
setSpriteError(
reason instanceof Error
? reason.message
: "桌宠精灵图绘制失败。",
reason instanceof Error ? reason.message : "桌宠精灵图绘制失败。",
);
}
}, [frameColumn, frameRow, spriteReady]);