singularity-forge/src
TÂCHES a43836ffbb refactor(auto): decompose auto.ts into focused modules (#534)
* refactor(auto): decompose auto.ts into focused sub-modules (#518)

Extract ~730 lines from auto.ts (3,819 -> 3,097 lines) into three
focused modules:

- auto-recovery.ts: artifact resolution/verification, skip artifacts,
  completed-unit persistence, merge reconciliation, self-heal, loop
  remediation steps
- auto-dashboard.ts: progress widget, elapsed time formatting, unit
  description helpers, slice progress cache, footer factory
- auto-supervisor.ts: SIGTERM handling, working-tree activity detection

auto.ts retains all state machine logic (dispatchNextUnit, handleAgentEnd,
startAuto, stopAuto, pauseAuto, recoverTimedOutUnit) and the module-level
globals. Sub-modules are pure functions receiving parameters — no circular
dependencies or AutoContext abstraction.

All existing exports preserved via re-exports. Tests updated to reflect
the source file changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* refactor(auto): extract prompt builders + fix require() in recovery

- Extract 11 prompt builder functions, 6 inline helpers, 2 adaptive
  replanning checks, and text utilities into auto-prompts.ts (785 lines)
- Replace inline merge reconciliation block with reconcileMergeState()
  call (already existed in auto-recovery.ts but was duplicated)
- Fix CommonJS require("node:fs") in auto-recovery.ts → ESM import
- auto.ts: 3,819 → 2,321 lines (39% reduction)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Merge origin/main into refactor/518-decompose-auto-ts

Resolve conflicts in auto.ts:
- Keep PR's refactored imports (extracted to sub-modules)
- Add main's new BudgetEnforcementMode type import
- Add main's new sendDesktopNotification import
- Add main's budget alert functions (getBudgetAlertLevel, etc.)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 16:43:48 -06:00
..
resources refactor(auto): decompose auto.ts into focused modules (#534) 2026-03-15 16:43:48 -06:00
tests fix: guard against newer synced resources (#445) 2026-03-14 22:58:18 -06:00
app-paths.ts Initial commit 2026-03-10 22:28:37 -06:00
bundled-extension-paths.ts Fix packaging verification and path portability (#378) 2026-03-14 12:28:14 -06:00
cli.ts feat(config): session-internal /gsd config + fix key hydration 2026-03-15 08:35:27 +01:00
loader.ts Perf/gsd startup speed (#497) 2026-03-15 13:33:43 -06:00
logo.ts fix: abort squash-merge on conflict and stop auto-mode instead of looping (#merge-bug-fix) 2026-03-12 15:32:39 -06:00
onboarding.ts feat: add Ollama Cloud as model and web tool provider (#430) (#434) 2026-03-14 21:03:31 -06:00
pi-migration.ts Merge pull request #151 from dbachelder/fix/pi-provider-reuse-and-extension-loading 2026-03-12 22:25:15 -06:00
resource-loader.ts Perf/gsd startup speed (#497) 2026-03-15 13:33:43 -06:00
tool-bootstrap.ts fix: bootstrap managed tools and gh auth 2026-03-11 10:52:45 -06:00
update-check.ts feat: add startup update check with 24h cache 2026-03-13 14:28:43 -03:00
update-cmd.ts feat: add gsd update subcommand for self-update 2026-03-13 18:47:33 -03:00
wizard.ts feat: add Ollama Cloud as model and web tool provider (#430) (#434) 2026-03-14 21:03:31 -06:00