1.5 KiB
1.5 KiB
01. Fix loadConfig to return defaults gracefully when .ralph/config.yaml is missing
meta: id: ralph-loop-fixes-01 feature: ralph-loop-fixes priority: P1 depends_on: [] tags: [implementation, utils]
objective:
loadConfig()should returnDEFAULT_CONFIGsilently when.ralph/config.yamldoes not exist, without logging a warning to stderr
deliverables:
- Modified
src/utils.ts—loadConfig()function
steps:
- Open
src/utils.tsand locateloadConfig() - Add
fs.existsSync()check beforefs.readFileSync() - If config file does not exist, return a deep copy of
DEFAULT_CONFIGwithout any console output - If config file exists but is malformed, fall back to defaults silently
- Remove or suppress the
console.warn()call
tests:
- Manual: Run
/ralph resumein a project directory with no.ralph/directory — should not print warning - Manual: Run
/ralph runin a project with.ralph/progress.jsonbut noconfig.yaml— should proceed with defaults
acceptance_criteria:
- No console warning when config.yaml is missing
loadConfig()returns a validRalphConfigobject in all cases- Existing behavior with valid config.yaml is unchanged
validation:
- Check
src/utils.tsloadConfig function returns silently on missing file - Verify no
console.warnorconsole.errorin the missing-config path
notes:
- Current code at line ~145 in utils.ts:
fs.readFileSync(configPath, "utf-8")throws ENOENT - The try-catch does catch it but still logs the warning — the warning is noisy for normal usage where config is optional