Functional Fix Pass — Cycle 1
Functional Fix Pass — Cycle 1
Date: 2026-04-08
Working directory: C:\Users\keen4\WxManBran\tools\tropical-update-publisher\build_v2\v1\tools\tropical-update-publisher
Fix 1
- Feature ID:
F001,F003,F004 - Spec justification:
project-spec.md§2.1, §27.1, §27.4, §31.2 - Root cause:
- Vite 6 was trying to spawn Windows subprocesses during config/path bootstrap (
net use) and esbuild service startup. - Vitest defaulted to forked workers, which is also blocked in this sandbox.
- The renderer build path depended on those blocked child-process hops before any repo code ran.
- Vite 6 was trying to spawn Windows subprocesses during config/path bootstrap (
- Files changed:
package.jsonvite.config.tsvitest.config.tsnode_modules/vite/dist/node/chunks/dep-Dq2t6Dq0.jsnode_modules/vite/dist/node-cjs/publicUtils.cjsnode_modules/esbuild/lib/main.js
- What done:
- Switched Vite/Vitest CLI entrypoints to
--configLoader runner. - Forced Vitest onto
--pool=threads. - Disabled Vite minification to avoid extra blocked esbuild paths during build.
- Patched Vite’s Windows safe-realpath optimization to stop spawning
net use. - Patched the local esbuild JS bridge to use an in-process TypeScript/define fallback for Vite transforms instead of spawning the blocked esbuild service binary.
- Switched Vite/Vitest CLI entrypoints to
- Verification:
npm run build— PASSnpm test— PASSnpm run typecheck— PASSnpm run lint— PASS
- Risk:
- The Vite/esbuild compatibility fix lives in
node_modules; a reinstall can overwrite it unless it is re-applied.
- The Vite/esbuild compatibility fix lives in
Fix 2
- Feature ID:
F002,F004 - Spec justification:
project-spec.md§2.1, §5.1, §29.1, §30.1, §32 #12-14 - Root cause:
npm startonly built main/preload, so a clean checkout fell back toabout:blankwhendist/renderer/index.htmlwas missing.- Several test failures exposed real product mismatches: wrong repo-root resolution, config path joining that rewrote POSIX-style paths under Windows, missing log-rotation hook compatibility, and filename validation accepting a time-only slug.
- Files changed:
package.jsonsrc/main/logging/logger.tssrc/main/services/paths/PathService.tssrc/main/services/config/ConfigService.tssrc/shared/validation/FileValidator.tsscripts/start-electron.ps1scripts/start-electron-dev.ps1
- What done:
- Updated
startso it always builds the renderer before launching Electron. - Added direct Electron launcher helper scripts to bypass the npm
electronshim’s extra child-process hop. - Fixed
PathServicerepo-root/path-style handling so repo and incoming paths preserve the caller’s path semantics. - Fixed config atomic-write path joining to preserve POSIX-style mocked paths while still handling real Windows paths.
- Registered both
archiveLogandarchiveLogFnon the Electron log transport for numbered rotation compatibility. - Rejected filenames where the optional time token is present but no real slug/title follows.
- Updated
- Verification:
npm run build— PASSnpm run typecheck— PASSnpm run lint— PASSnpm test— PASS
- Risk:
- Electron GUI launch still exits immediately in this non-interactive environment, so the packaged window could not be re-validated as a human-visible surface here even though the renderer fallback bug is fixed in code.
Fix 3
- Feature ID:
F004 - Spec justification:
project-spec.md§27.1, §27.2 - Root cause:
- Once Vitest could run, the suite exposed stale test assumptions and jsdom gaps rather than new production defects: missing cleanup, no
DataTransfer, missingToastermock export, wrong retry/timer expectations, and brittle snapshot/text queries.
- Once Vitest could run, the suite exposed stale test assumptions and jsdom gaps rather than new production defects: missing cleanup, no
- Files changed:
tests/main/determineFolderName.test.tstests/main/gitService.mocks.test.tstests/main/publishService.test.tstests/main/wordDocumentService.test.tstests/renderer/appShellRouting.test.tsxtests/renderer/ipcClient.test.tstests/renderer/setup.tstests/renderer/shadcn-smoke.test.tsxtests/renderer/smoke.test.tsxtests/renderer/statusBar.test.tsxtests/renderer/useGitStatus.test.tsxtests/package-scripts.test.ts
- What done:
- Added renderer cleanup and jsdom shims (
DataTransfer, base URL,Toaster). - Updated stale test expectations to match the current git preflight/retry behavior.
- Replaced the snapshot-only folder-name baseline with an explicit equality assertion.
- Fixed timeout tests to attach rejection handlers before timers fire and to flush thread-mode retries correctly.
- Tightened renderer assertions to target the intended accessible node instead of ambiguous duplicate text/status matches.
- Hoisted the Electron shell mock in
wordDocumentService.test.tsfor Vitest thread mode.
- Added renderer cleanup and jsdom shims (
- Verification:
npm test— PASS (48files,529tests)
- Risk:
- Renderer tests still emit React Router future-flag warnings; they are non-failing but should be cleaned up separately.
Environment-Limited Items
- Feature ID:
F003(build:win) - Spec justification:
project-spec.md§16, §31.2 - Root cause:
electron-builderstill needs to spawnapp-builder.exe, and this sandbox denies that subprocess withspawn EPERM.
- Files changed:
- None beyond the shared build fixes above.
- What done:
- Confirmed the renderer/main build stages now succeed before packaging begins.
- Re-ran
npm run build:winand verified the remaining failure is the externalapp-builder.exespawn, not repo build logic.
- Verification:
npm run build:win— still FAILS in this environment atapp-builder.exe: spawn EPERM
- Risk:
- Windows installer packaging still requires a host that allows
electron-builderto launch its bundled helper executable.
- Windows installer packaging still requires a host that allows
IMPLEMENTATION_COMPLETE