Skip to content

fix(setup): audit P2 batch — undo receipt, Ctrl-C note, discover themes, zh keys (#179) - #239

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/audit-p2-179
Oct 10, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/audit-p2-179

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Closes #179

审计 P2 批次逐项处置(工作树 wt82-L02 findings 复核于当前 master,部分项已被 #180/#145 等后续修复顺带改变):

fixed

  • L02-1 首装 undo 收据缺口:SetupJournal 新增 rc_created;首装(无前版 rc 可备份)的收据现在覆盖写入本身——rm ~/.niubashrc(连同守卫块)+ rm ~/.niubash/.setup-done,不再留下无法撤销的生成 rc。回归:setup_journal_records_entries_and_undo_commands(fresh-install 分支 + journal rc_created = true 断言)。
  • L02-2 undo 收据重复行:setup_undo_lines 按源 id 去重,主题与合集同名源只打印一次 niu plugin source remove <id>。回归:同测试的去重计数断言(2 → 1)。
  • L02-3 niu-git 处 Ctrl+C 静默:ask_niu_git 返回 None 时补 print_cancelled_note(),与其他问题路径一致(原 setup_wizard.rs:973 处绕过 ask! 的旁路已消除;Ctrl+C 交互路径无现成测试钩子,靠同一 ask! 契约覆盖)。
  • L05-1 discover 零主题:niu plugin discover 新增 "Themes (from trusted sources)" 段,逐条列出名称/适配器/源 + niu plugin enable <name> 提示;空态给出 add→trust 引导,与向导措辞对齐。回归:plugin_discover_is_read_only_and_lists_available_managers(空态)+ 生命周期测试(信任后列出 robbyrussell 等)。
  • L05-2 zh 键失配:zh 键对齐运行时真值——Skip - keep my current theme(连字符)、No external themes installed yet - keeping the default look.(空画廊注记);补缺失键 niu installs nothing itself — …。原单测守的死字面量(长破折号 Skip 行、旧空画廊文案)改为断言运行时真值。审计提到的"两行预览"两行(current look unchanged / keep)与 rendering preview …、(preview unavailable: 在当前 master 键值已匹配,核实无需改动。
  • L05-3(note)掏空信任源仍显示 ready:设计上 ready 表示 registry 信任态而非树内容完整性,故不改状态语义;但 niu plugin list 与 niu plugin discover 对"目录在、资产为 0"的源现在追提示 verify with niu plugin source verify <id>。回归:gutted_trusted_source_names_the_verify_verb。

wontfix(无)

(无——六项全部处置;L05-3 以"保持 ready 语义 + 补 verify 提示"方式收口。)

测试:niubash-runtime --lib 392 通过(3 个 distros apply 测试因沙箱 git clone 网络失败,master 上同样失败,非本改动引入);plugin_sources 5/5 绿;cargo fmt 已跑。

…ash#179)

- L02-1: a fresh install now journals rc_created; the finish screen's
  undo receipt covers the write itself (remove the generated rc and the
  .setup-done marker) instead of leaving an unrestorable rc.
- L02-2: deduplicate the 'niu plugin source remove <id>' undo receipt
  when the theme pick and the collection name the same source.
- L02-3: Ctrl-C at the niu-git question prints the same cancelled note
  as every other wizard question instead of exiting silently.
- L05-1: 'niu plugin discover' enumerates the theme layer (Themes from
  trusted sources, with enable hints), matching the wizard's
  'sources & themes' promise; empty state explains how themes appear.
- L05-2: realign zh keys with the runtime literals (gallery Skip row
  hyphen, empty-gallery note) and add the missing niu-git recommend
  line; the zh vocab test now guards the runtime strings.
- L05-3 (note): a gutted trusted source still reads ready, but
  'niu plugin list' and 'niu plugin discover' now name the repair verb
  (niu plugin source verify <id>) instead of silently showing no assets.

Regression tests: fresh-install undo receipt + journal rc_created,
deduped source-removal receipt, discover theme layer (empty + trusted),
gutted-source verify hint, zh runtime-literal vocabulary.
@caomengxuan666
caomengxuan666 merged commit b28e1ca into master Oct 10, 2026
3 of 9 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/audit-p2-179 branch October 10, 2026 03:03
caomengxuan666 added a commit that referenced this pull request Oct 10, 2026
…notes draft (#254)

- Version 1.3.4 -> 1.4.0 (workspace root + crates/niubash-runtime;
  Cargo.lock synced; internal niubash-runtime dep requirement aligned
  1.2.5 -> 1.4.0). The rubash engine requirement stays 1.3.4: it is
  semver-open (^1.3.4 admits the engine's 1.4.0), and the committed
  [patch] resolves it to the local ../rubash worktree, whose Cargo.toml
  still says 1.3.4 until the engine cuts its own release.
- CHANGELOG: the Unreleased section becomes [1.4.0] - 2026-10-10. Also
  repairs the committed merge damage from #243 (stray conflict marker
  and the #241 doctor-advice entry glued onto the carapace entry) and
  folds in the merged cycle: #235 #239 #246 #247 #250 #251 #252 #253
  plus a compact rubash 1.4.0 engine summary. #240's P2-batch content
  stays under [1.3.4] where the file already records it (no dup).
- docs/release-notes-1.4.0-draft.md: zh+en draft release notes
  (Added / Fixed / Performance), winuxcmd #1151/#1154-#1157 marked as
  in-flight for the coordinator, plus the local verification log:
  release build PASS (niu.exe 10.6 MB), MSIX packed unsigned with a
  placeholder identity (5.1 MB), wpm-source main carries all four
  preinstall packages, and cargo publish --dry-run chain findings
  (rubash -> niubash-runtime -> niubash, blocked on the engine's
  crates.io release).

No tag, no release workflow trigger, no in-flight PRs merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2] 审计 P2 批次:undo 收据缺口/Ctrl+C 静默/discover 零主题/zh 键失配/坏树无提示

1 participant