4.3 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | must_haves | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 02-config-overlays | 02 | execute | 2 |
|
|
true |
|
Purpose: Give operators clear diagnostic feedback when their environment overlay is misconfigured, rather than a cryptic file-not-found error at startup.
Output: New doctor check in the existing checks array.
<execution_context> @/home/will/.config/opencode/get-shit-done/workflows/execute-plan.md @/home/will/.config/opencode/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/02-config-overlays/02-01-SUMMARY.md@src/cli/doctor.ts @src/cli/shared.ts
Task 1: Add checkOverlayExists to doctor.ts src/cli/doctor.ts Import `resolveOverlayPath` from `./shared.js` (add to existing import line).Create a new check function following the existing pattern:
const checkOverlayExists: Check = async (ctx) => {
const overlayPath = resolveOverlayPath(ctx.configPath);
if (!overlayPath) {
return { status: 'skip', label: 'Config overlay', detail: '(FLYNN_ENV not set)' };
}
const env = process.env.FLYNN_ENV;
if (existsSync(overlayPath)) {
return { status: 'pass', label: 'Config overlay', detail: `(${env}.yaml found)` };
}
return { status: 'fail', label: 'Config overlay', detail: `FLYNN_ENV=${env} but ${overlayPath} not found` };
};
Insert checkOverlayExists into the allChecks array — place it right after checkConfigExists and before checkConfigParses. This is the natural position: first check the base config exists, then check the overlay exists, then parse/validate the merged result.
The updated array should be:
const allChecks: Check[] = [
checkConfigExists,
checkOverlayExists, // <-- NEW
checkConfigParses,
checkConfigValidates,
checkEnvVars,
checkDataDir,
checkSessionDb,
checkModelConnectivity,
checkTelegram,
checkMcpServers,
checkSkills,
checkTailscale,
];
Note: existsSync is already imported at the top of doctor.ts. resolveOverlayPath needs to be added to the import from ./shared.js.
Run pnpm test:run to verify no regressions. Run pnpm typecheck for type safety.
Run pnpm typecheck — no type errors. Run pnpm test:run — full suite passes (1077+ tests).
checkOverlayExists added to doctor.ts checks array. When FLYNN_ENV is set, doctor reports pass/fail for overlay file existence with the overlay path in the detail. When FLYNN_ENV is not set, the check is skipped. Full test suite passes.
<success_criteria>
- checkOverlayExists is in the doctor checks array after checkConfigExists
- FLYNN_ENV=staging with no staging.yaml → doctor reports FAIL with "FLYNN_ENV=staging but /path/to/staging.yaml not found"
- No FLYNN_ENV → doctor skips the overlay check
- FLYNN_ENV=docker with docker.yaml present → doctor reports PASS
- Full test suite passes with zero regressions </success_criteria>