[PR #2482] [MERGED] fix(cli): normalize empty Windows profile before imports #5261

Closed
opened 2026-10-31 01:05:15 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2482
Author: @N0zoM1z0
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/windows-empty-profile-startup-2345


📝 Commits (2)

  • e3ce11c fix(cli): normalize empty Windows profile before imports
  • aca75a5 fix(ci): own the Windows home fallback regression scope

📊 Changes

4 files changed (+77 additions, -0 deletions)

View changed files

📝 .github/workflows/ci.yml (+1 -0)
➕ experiments/analysis-efficiency/windows-empty-profile.md (+69 -0)
📝 scripts/ci/scopes.mjs (+1 -0)
📝 scripts/rea.mjs (+6 -0)

📄 Description

Summary

Follow-up to #2345; thanks to @gefrezim for identifying the import-time Windows home lookup failure.

  • Treat USERPROFILE="" as unset at the executable dispatcher, before dependency imports. Windows Node otherwise throws uv_os_homedir during Incur import, before REA's existing account-home fallback can run.
  • Preserve every nonempty selection and use the existing home resolver. No new lookup, fallback abstraction, filesystem query, retry or cache.
  • Reuse tests/acceptance/setup/homeDirectoryFallback.test.ts in the actual Windows curated CI lane. Its public setup dry-run already covers the failure; no duplicate startup test is added.

Real Windows verification

Fresh main baseline 172407787f1842dedbcd27b5385177595f786ce4, Windows 11 10.0.22631.0, official Windows x64 Node 24.18.0, locked production dependencies:

Profile input (HOME empty) Baseline CLI version/help Corrected CLI version/help
Unset Both exit 0 Both exit 0
Empty Both exit 1, uv_os_homedir Both exit 0, no stderr
Nonempty owned profile Both exit 0 Both exit 0
  • Real setup dry runs with empty/nonempty selections choose the expected home, preserve existing configuration bytes and create no configuration under the working directory. No installation was performed.
  • Actual SDK 2.3.1 stdio MCP discovery passes all three inputs before and after: 187 tools, 2,545,790 serialized bytes, identical catalogue digest. MCP was already healthy; no MCP startup repair is claimed.
  • Nine related tests pass: existing home-fallback acceptance, production MCP doctor and curated CI path checks.
  • Runtime build, static gate and documentation checks pass.
  • No IDA or Ghidra engine was used for this CLI startup fix.

Efficiency and limits

Verification and resource record pins the tested dispatcher digest and scope. Version/help replies remain 6 / 15,497 bytes. Corrected single-CLI exit-time resource observations range from 7.968–9.874 seconds CPU and 299,956–301,852 KiB peak working set; these exclude the probe parent. Probes ran serially, BelowNormal, one CPU, 512 MiB child heaps. Baseline resources were not paired and caches were not normalized: no latency, CPU or memory improvement is claimed. Bytes are not model tokens; actual model usage was not measured. Personal paths and ambient environment were not included in the record.

Review / CI follow-up

The original CI shard correctly rejected our missing package-scope registration for the added Windows test entry. Fixed in aca75a5f0 by registering the path in SCOPES.package. All 84 CI scope tests and two curated-path checks now pass. Runtime source and its real-Windows tested dispatcher digest are unchanged.

Final current-head verification: Windows lane executes the home-fallback regression (one Windows test passes; the POSIX lifecycle case is intentionally skipped). The unrelated in-memory server identity 10-second timeout passed on a failed-job rerun without source changes; the current-head CI and coverage gates are green. Current-head Codex review completed with no further findings and the ownership thread is resolved.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2482 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/windows-empty-profile-startup-2345` --- ### 📝 Commits (2) - [`e3ce11c`](https://github.com/morluto/rea/commit/e3ce11c7b756f003c522302e4cf96c70d761dd9c) fix(cli): normalize empty Windows profile before imports - [`aca75a5`](https://github.com/morluto/rea/commit/aca75a5f0cdbfc8cd4ea19e731e58bc716fece55) fix(ci): own the Windows home fallback regression scope ### 📊 Changes **4 files changed** (+77 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+1 -0) ➕ `experiments/analysis-efficiency/windows-empty-profile.md` (+69 -0) 📝 `scripts/ci/scopes.mjs` (+1 -0) 📝 `scripts/rea.mjs` (+6 -0) </details> ### 📄 Description ## Summary Follow-up to #2345; thanks to @gefrezim for identifying the import-time Windows home lookup failure. - Treat `USERPROFILE=""` as unset at the executable dispatcher, before dependency imports. Windows Node otherwise throws `uv_os_homedir` during Incur import, before REA's existing account-home fallback can run. - Preserve every nonempty selection and use the existing home resolver. No new lookup, fallback abstraction, filesystem query, retry or cache. - Reuse `tests/acceptance/setup/homeDirectoryFallback.test.ts` in the actual Windows curated CI lane. Its public setup dry-run already covers the failure; no duplicate startup test is added. ## Real Windows verification Fresh main baseline `172407787f1842dedbcd27b5385177595f786ce4`, Windows 11 10.0.22631.0, official Windows x64 Node 24.18.0, locked production dependencies: | Profile input (`HOME` empty) | Baseline CLI version/help | Corrected CLI version/help | | --- | --- | --- | | Unset | Both exit 0 | Both exit 0 | | Empty | Both exit 1, `uv_os_homedir` | Both exit 0, no stderr | | Nonempty owned profile | Both exit 0 | Both exit 0 | - Real setup dry runs with empty/nonempty selections choose the expected home, preserve existing configuration bytes and create no configuration under the working directory. No installation was performed. - Actual SDK 2.3.1 stdio MCP discovery passes all three inputs before and after: 187 tools, 2,545,790 serialized bytes, identical catalogue digest. MCP was already healthy; no MCP startup repair is claimed. - Nine related tests pass: existing home-fallback acceptance, production MCP doctor and curated CI path checks. - Runtime build, static gate and documentation checks pass. - **No IDA or Ghidra engine was used** for this CLI startup fix. ## Efficiency and limits [Verification and resource record](https://github.com/morluto/rea/blob/aca75a5f0cdbfc8cd4ea19e731e58bc716fece55/experiments/analysis-efficiency/windows-empty-profile.md) pins the tested dispatcher digest and scope. Version/help replies remain 6 / 15,497 bytes. Corrected single-CLI exit-time resource observations range from 7.968–9.874 seconds CPU and 299,956–301,852 KiB peak working set; these exclude the probe parent. Probes ran serially, BelowNormal, one CPU, 512 MiB child heaps. Baseline resources were not paired and caches were not normalized: no latency, CPU or memory improvement is claimed. Bytes are not model tokens; actual model usage was not measured. Personal paths and ambient environment were not included in the record. ## Review / CI follow-up The original CI shard correctly rejected our missing package-scope registration for the added Windows test entry. Fixed in `aca75a5f0` by registering the path in `SCOPES.package`. All 84 CI scope tests and two curated-path checks now pass. Runtime source and its real-Windows tested dispatcher digest are unchanged. Final current-head verification: Windows lane executes the home-fallback regression (one Windows test passes; the POSIX lifecycle case is intentionally skipped). The unrelated in-memory server identity 10-second timeout passed on a failed-job rerun without source changes; the current-head CI and coverage gates are green. Current-head Codex review completed with no further findings and the ownership thread is resolved. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:05:15 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5261
No description provided.