Skip to content

fix: populate checks for every failing step in buildLaunchStrictJsonReport; extract helper functions#63

Draft
Copilot wants to merge 3 commits into
codex/refactor-to-global-cli-and-daemonfrom
copilot/sub-pr-61-again
Draft

fix: populate checks for every failing step in buildLaunchStrictJsonReport; extract helper functions#63
Copilot wants to merge 3 commits into
codex/refactor-to-global-cli-and-daemonfrom
copilot/sub-pr-61-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 7, 2026

The report.steps loop in buildLaunchStrictJsonReport only pushed entries into fixes for failing steps — it never added a corresponding LaunchGateCheck entry. This meant gate steps like repo.preflight, codex.auth, mcp.up, and doctor.strict were silently absent from the checks array in the strict JSON output even when they failed.

Changes

  • Bug fix — checks population: Changed the loop condition from if (step.ok || !step.remediation) continue to always emit a { status: 'fail' } check for every failing step, then conditionally emit fixes only when a remediation string exists. Fallback detail now uses `${step.id} failed` instead of a generic string.
// Before: skipped steps with no remediation entirely
for (const step of report.steps) {
  if (step.ok || !step.remediation) continue;
  for (const command of splitRemediationCommands(step.remediation)) {
    fixes.push({ ... });
  }
}

// After: check always emitted, fix only when remediation present
for (const step of report.steps) {
  if (step.ok) continue;
  checks.push({ name: step.id, status: 'fail', detail: step.remediation || step.details || `${step.id} failed` });
  if (!step.remediation) continue;
  for (const command of splitRemediationCommands(step.remediation)) {
    fixes.push({ ... });
  }
}
  • Refactor — decompose buildLaunchStrictJsonReport: Extracted three focused helpers from the previously ~157-line monolith:

    • runRuntimeChecks(spawnCommand, cwd) — Node.js, npm, dependency integrity, optional engine detection; returns { checks, fixes, capabilityAdditions }
    • runRepoChecks(spawnCommand, cwd) — build, typecheck, test script checks
    • runInfraChecks(report, cwd) — daemon health, MCP config, worktree state location

    buildLaunchStrictJsonReport now composes their results, runs the fixed step loop, then computes ok/nextActions.

  • Tests: Added describe('buildLaunchStrictJsonReport') with 3 new targeted tests covering checks population for failing steps, fix emission gated on remediation presence, and passing steps excluded from checks.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits March 7, 2026 20:13
Co-authored-by: clduab11 <185000089+clduab11@users.noreply.github.com>
…; extract runRuntimeChecks/runRepoChecks/runInfraChecks helpers

Co-authored-by: clduab11 <185000089+clduab11@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor launch-gated global CLI/daemon appliance fix: populate checks for every failing step in buildLaunchStrictJsonReport; extract helper functions Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants