singularity-forge/web/components/sf
ace-pm c744bdf6c1
fix: atomic writes, parse radix, lossy json, silent worker spawn
8 fixes from 3rd-pass scan:

1. web/components/sf/tempCodeRunnerFile.tsx: remove orphan VS Code
   'Code Runner' artifact (850+ lines duplicated from shell-terminal.tsx).
   Unreferenced but compiled into tsc project.

2. sf/phase-anchor.ts: writePhaseAnchor used plain writeFileSync — a crash
   mid-write would corrupt the handoff checkpoint that readPhaseAnchor then
   silently returns null for, losing cross-phase context. Switched to
   atomicWriteSync (already used by sibling files).

3. sf/forensics.ts: same non-atomic writeFileSync on active-forensics.json
   marker. Race with a concurrent reader produces an empty object and the
   forensics session is lost. Switched to atomicWriteSync.

4. web/auto-dashboard-service.ts: paused-session.json existence was the
   intended signal but a corrupt body silently dropped the paused flag so
   the UI showed active. Now reports paused on file existence regardless
   of body integrity, and warns on corruption.

5. sf/visualizer-data.ts: doctor-history.jsonl parser did .map(JSON.parse)
   inside an outer catch. One corrupt line discarded 19 valid entries.
   Per-line try/catch preserves the valid rows.

6. sf/files.ts: three parseInt calls without radix (step, total_steps,
   totalSteps) — also missing || 0 fallback for NaN.

7. cli.ts: parseInt(process.versions.node) without radix. Split on '.' and
   use radix 10 explicitly.

8. sf/slice-parallel-orchestrator.ts: silent 'catch {}' around spawn()
   masked worker-spawn failures as 'no workers available'. Matches sibling
   parallel-orchestrator.ts pattern — now logs via logWarning.

Skipped from the scan (need a real lock mechanism, not safe as a one-line
fix):
- sf/auto-dispatch.ts:164 (UAT counter race)
- sf/captures.ts:107 (CAPTURES.md append race)

Deferred (low-value):
- preferences-models.ts, key-manager.ts, auto-timers.ts silent catches
- dead variable in visualizer-data.ts
- google-gemini-cli.ts maxTokens clamp interaction

tsc --noEmit green at root.
2026-04-21 02:13:10 +02:00
..
onboarding refactor: update log prefixes and string values from gsd- to sf- namespace 2026-04-15 15:37:12 +02:00
activity-view.tsx wip: rename gsd-parser dir + exports, fix native package.json 2026-04-15 14:22:21 +02:00
app-shell.tsx refactor: update log prefixes and string values from gsd- to sf- namespace 2026-04-15 15:37:12 +02:00
chat-mode.tsx refactor: update log prefixes and string values from gsd- to sf- namespace 2026-04-15 15:37:12 +02:00
code-editor.tsx refactor(forge): complete gsd → forge rebrand across native, logging, and build system 2026-04-15 14:11:45 +02:00
command-surface.tsx refactor: update log prefixes and string values from gsd- to sf- namespace 2026-04-15 15:37:12 +02:00
dashboard.tsx chore: sync workspace state after rebrand 2026-04-15 14:54:20 +02:00
diagnostics-panels.tsx wip: rename gsd-parser dir + exports, fix native package.json 2026-04-15 14:22:21 +02:00
dual-terminal.tsx refactor: update log prefixes and string values from gsd- to sf- namespace 2026-04-15 15:37:12 +02:00
file-content-viewer.tsx refactor: update log prefixes and string values from gsd- to sf- namespace 2026-04-15 15:37:12 +02:00
files-view.tsx refactor: update log prefixes and string values from gsd- to sf- namespace 2026-04-15 15:37:12 +02:00
focused-panel.tsx wip: rename gsd-parser dir + exports, fix native package.json 2026-04-15 14:22:21 +02:00
guided-dialog.tsx chore: sync workspace state after rebrand 2026-04-15 14:54:20 +02:00
knowledge-captures-panel.tsx wip: rename gsd-parser dir + exports, fix native package.json 2026-04-15 14:22:21 +02:00
loading-skeletons.tsx refactor(forge): complete gsd → forge rebrand across native, logging, and build system 2026-04-15 14:11:45 +02:00
main-session-terminal.tsx refactor(forge): complete gsd → forge rebrand across native, logging, and build system 2026-04-15 14:11:45 +02:00
onboarding-gate.tsx chore: sync workspace state after rebrand 2026-04-15 14:54:20 +02:00
project-welcome.tsx refactor: update log prefixes and string values from gsd- to sf- namespace 2026-04-15 15:37:12 +02:00
projects-view.tsx chore: sync workspace state after rebrand 2026-04-15 14:54:20 +02:00
remaining-command-panels.tsx refactor: update log prefixes and string values from gsd- to sf- namespace 2026-04-15 15:37:12 +02:00
roadmap.tsx refactor: update log prefixes and string values from gsd- to sf- namespace 2026-04-15 15:37:12 +02:00
scope-badge.tsx chore: sync workspace state after rebrand 2026-04-15 14:54:20 +02:00
settings-panels.tsx refactor: update log prefixes and string values from gsd- to sf- namespace 2026-04-15 15:37:12 +02:00
shell-terminal.tsx chore: sync workspace state after rebrand 2026-04-15 14:54:20 +02:00
sidebar.tsx refactor: update log prefixes and string values from gsd- to sf- namespace 2026-04-15 15:37:12 +02:00
status-bar.tsx wip: rename gsd-parser dir + exports, fix native package.json 2026-04-15 14:22:21 +02:00
terminal.tsx wip: rename gsd-parser dir + exports, fix native package.json 2026-04-15 14:22:21 +02:00
update-banner.tsx chore: sync workspace state after rebrand 2026-04-15 14:54:20 +02:00
visualizer-view.tsx refactor: update log prefixes and string values from gsd- to sf- namespace 2026-04-15 15:37:12 +02:00