← Back to Pull requests

fix(test): publish shell owner readiness markers atomically #6135

Open
unknown opened this pull request with 251 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 17, 2026 07:33 UTC
Author

Summary

The shell owner-death tests can read an empty readiness marker between file creation and the first JSON write, causing a JSON parse failure before they exercise owner death. Write the complete marker to a temporary file and rename it into place in both test fixtures. The existing process termination and delayed-write assertions remain unchanged; production behavior is unchanged.

Extracted from #6091 so the unrelated CI reliability fix can be reviewed independently.

Verification

  • Built @maka/core, @maka/storage, and @maka/runtime successfully.

  • Passed the complete shell-owner-death.test.js suite three consecutive times on macOS: 6 tests per run, 18 executions, no failures or skips.

  • Passed runtime typecheck and lint/format checks for the changed file.

  • Passed the staged ASF header, protocol epoch, and whitespace checks.

  • Windows execution is left to CI. The original race is timing-dependent; this change does not add a deterministic fault-injection test.
  • AI use

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: OpenAI Codex extracted the existing fixture fix, ran validation, and prepared this PR. The commit retains its Generated-by: OpenAI Codex trailer.

    Checklist

  • Tests cover the change and fail without it

  • Lint, format, typecheck and the affected suites pass locally
  • The existing owner-death suite covers both marker producers; reproducing the pre-fix empty-file race depends on scheduling.

    Does this PR entail a change in behavior?

  • Yes — described under Summary above

  • No
  • <details>
    <summary>点击展开中文</summary>

    Shell owner-death 测试的就绪标记先创建文件、再写入 JSON,轮询可能读到空文件并提前解析失败。此修复让两个测试 fixture 先把完整 JSON 写入临时文件,再通过重命名发布标记,保留原有的进程回收和延迟写入断言,不改变生产代码。

    该修复从 #6091 拆出,单独审查。

    验证:core、storage、runtime 构建成功;完整 owner-death 测试连续三轮通过,每轮 6 项,共 18 次执行,无失败或跳过;runtime 类型检查、变更文件 lint/格式检查,以及提交时的许可证、协议版本和空白检查通过。Windows 由 CI 验证。原竞态依赖调度时机,本次没有增加确定性的故障注入测试。

    </details>

    Diff: 251 lines (+188 / -63) across 3 files Reviewer: Astro-Han Review duration: 184m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 251 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.331
    Real PR Conversation Timeline
    1 comments
    "Review active on #6135"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39% (MEDIUM) · Higher = larger blast radius
    39%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.8% · Safe to merge
    20.8%
    Repository