Skip to content

discussion(desktop): define bounded next-launch evidence for hard main-process crashes #3491

Closed

Description

@M4n5ter
English

Decision to make

Maka's main-process diagnostic log is deliberately bounded and redacted, but it exists only in memory. Native diagnostic dialogs also require Electron main to remain alive. A hard main-process failure such as the V8 OOM observed in #3458, a native crash, or an external kill can therefore remove both the evidence and every live copy surface at once.

This is a child of #3463. It is a design boundary before implementation: writing more data during ordinary operation creates a new persistence and privacy owner, while a crash-time JavaScript handler cannot reliably cover OOM or native termination.

Required decision

Define the smallest supported next-launch evidence contract for hard main-process failures:

  • Which failure classes are supportable and distinguishable: JavaScript uncaught failure, V8 OOM, native crash, OS kill, or power loss.
  • Which existing platform signal can establish that a prior run ended abnormally without pretending every unclean shutdown was a Maka defect.
  • Whether the minimum evidence is a small redacted journal, a local Electron crash artifact, or a narrower platform-owned reference.
  • One owner, one bounded representation, one retention/expiry rule, and one safe deletion point.
  • How the next launch offers a user-controlled Copy Diagnostics action without automatic upload or exposing raw crash artifacts.
  • How secrets and home paths are removed before persistence, and how permissions and symlink/replacement safety are enforced.

Constraints

  • Do not implement a crash-reporting backend, telemetry, automatic upload, or indefinite log archive.
  • Do not continuously persist the current 256 KiB in-memory buffer by default without an explicit privacy, durability, and performance decision.
  • Do not claim that a last-run marker proves a crash unless the selected platform signal supports that conclusion.
  • Do not solve the root cause of Desktop main process OOM after prolonged Runtime Host connection flapping (repeated MCP capability alignment failures) #3458 here; this issue only defines evidence survivability.
  • Keep Renderer-process loss and Runtime Host exit evidence in their own owners.

Exit criteria

  • A short design record maps supported failure classes to obtainable evidence on macOS, Windows, and Linux.
  • The proposed representation has explicit byte limits, redaction timing, permissions, retention, compatibility, and corruption behavior.
  • The next-launch user flow and deletion semantics are specified.
  • The implementation is split further if different platforms require materially different owners or guarantees.

AI use

OpenAI Codex assisted with the bounded investigation and issue drafting. The human contributor remains responsible for scope and implementation decisions.

简体中文

待决策事项

Maka 的 main-process 诊断日志已经有界并经过脱敏,但只存在内存中;原生诊断弹窗也要求 Electron main 仍然存活。#3458 中观察到的 V8 OOM、原生崩溃或外部终止等 main process 硬故障,会同时移除证据和所有实时复制入口。

这是 #3463 的 child issue,先确定设计边界再实现:普通运行期间持续写入会新增持久化与隐私 owner,而 crash-time JavaScript handler 无法可靠覆盖 OOM 或原生终止。

必须明确的设计

定义 main process 硬故障在下次启动时可恢复的最小证据契约:

  • 哪些故障类型能够被支持并区分:JavaScript 未捕获异常、V8 OOM、原生崩溃、OS kill 或断电。
  • 哪个已有平台信号能够证明上一次运行异常结束,且不会把所有非正常关闭都伪装成 Maka 崩溃。
  • 最小证据应是小型脱敏 journal、本地 Electron crash artifact,还是更窄的平台 owner 引用。
  • 唯一 owner、唯一有界表示、唯一保留/过期规则和安全删除时点。
  • 下次启动如何提供由用户主动触发的 复制诊断信息,而不自动上传或暴露原始 crash artifact。
  • 敏感信息和 home path 如何在持久化前移除,以及文件权限、symlink/replacement 安全如何保证。

约束

完成标准

  • 一份简短设计记录将 macOS、Windows、Linux 上支持的故障类型映射到可获得证据。
  • 方案明确字节上限、脱敏时点、权限、保留周期、兼容和损坏处理。
  • 明确下次启动的用户流程与删除语义。
  • 如果不同平台需要实质不同的 owner 或保证,继续拆分实现任务。

AI 使用

OpenAI Codex 协助了有界调查和 issue 起草;范围与实现决策仍由贡献者本人负责。

Activity

  1. added
    enhancement
    on Aug 22, 2026
  2. self-assigned this
    on Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions