Skip to content

fix: preserve workspace config and make analysis portable - #1

Merged
mucjustin merged 1 commit into
mainfrom
codex/workspace-safety-portability
Oct 6, 2026
Merged

mucjustin merged 1 commit into
mainfrom
codex/workspace-safety-portability

Conversation

@mucjustin

@mucjustin mucjustin commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

变更说明

  • 初始化工作区时拒绝覆盖已有配置,并在创建目录前检查冲突;配置写入使用 CreateNew,避免并发覆盖。
  • 分析脚本根据自身位置定位仓库,移除开发机绝对路径。
  • 修正中英文 README 中的路由数量,补充已有配置的处理说明。
  • 增加已有配置及 WhatIf 冲突的回归测试。

变更类型

  • feat:新能力
  • fix:问题修正
  • docs:文档
  • test:测试
  • chore:工程化

自查清单

  • 本地运行 pwsh -NoProfile -File tests/Test-PublicSkill.ps1 通过;
  • 本地运行 pwsh -NoProfile -File tests/Test-WorkspaceScripts.ps1 通过;
  • 另外运行可靠性场景、基准清单测试与 git diff --check,均通过;
  • 未引入个人路径、账号、机构专属或其他隐私信息;
  • 未放宽安全停止条件(登录 / 验证码 / 付费墙 / 破坏性写入);
  • 如涉及 Skill 行为契约变更,已同步更新 tests/Test-PublicSkill.ps1(不适用:未改 SKILL.md);
  • 如需发版,已更新 CHANGELOG.md(本 PR 未发版)。

验证边界

从仓库外工作目录验证了分析脚本的输入文件定位。未重建图表:本地 research 环境缺少 jieba。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 298f00728d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +81 to +84
$stream = [IO.File]::Open($resolvedConfig, [IO.FileMode]::CreateNew, [IO.FileAccess]::Write)
try {
$writer = New-Object IO.StreamWriter($stream, $utf8)
$writer.Write($json + [Environment]::NewLine)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish the config only after its write succeeds

If serialization or the stream write fails—for example because the disk fills—or the process is interrupted after CreateNew, the destination remains as an empty or partial file. The new early Test-Path check then rejects every subsequent initialization attempt at the default path, turning a transient failure into a persistent invalid configuration; write to a temporary sibling and atomically move it into place without overwriting the destination.

Useful? React with 👍 / 👎.

@mucjustin
mucjustin merged commit eef9cf8 into main Oct 6, 2026
1 check passed
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.

1 participant