fix(gsd): exclude closed slices from findMissingSummaries check
Skip slices with status skipped/complete/done when checking for missing SUMMARY files. Skipped slices never produce SUMMARYs by design, and legacy-complete slices may lack them after worktree merge failures. The DB status is authoritative — missing SUMMARY is a cosmetic gap, not evidence the slice was incomplete. Fixes #3620 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
b4c6229360
commit
236e9f1367
1 changed files with 13 additions and 5 deletions
|
|
@ -93,14 +93,22 @@ function missingSliceStop(mid: string, phase: string): DispatchAction {
|
|||
/**
|
||||
* Check for milestone slices missing SUMMARY files.
|
||||
* Returns array of missing slice IDs, or empty array if all present or DB unavailable.
|
||||
*
|
||||
* Excludes skipped slices (intentionally summary-less) and legacy-complete
|
||||
* slices whose DB status is authoritative even without on-disk SUMMARY (#3620).
|
||||
*/
|
||||
function findMissingSummaries(basePath: string, mid: string): string[] {
|
||||
if (!isDbAvailable()) return [];
|
||||
const sliceIds = getMilestoneSlices(mid).map(s => s.id);
|
||||
return sliceIds.filter(sid => {
|
||||
const summaryPath = resolveSliceFile(basePath, mid, sid, "SUMMARY");
|
||||
return !summaryPath || !existsSync(summaryPath);
|
||||
});
|
||||
const slices = getMilestoneSlices(mid);
|
||||
// Skipped slices never produce SUMMARYs; legacy-complete slices may lack them
|
||||
const CLOSED_STATUSES = new Set(["skipped", "complete", "done"]);
|
||||
return slices
|
||||
.filter(s => !CLOSED_STATUSES.has(s.status))
|
||||
.filter(s => {
|
||||
const summaryPath = resolveSliceFile(basePath, mid, s.id, "SUMMARY");
|
||||
return !summaryPath || !existsSync(summaryPath);
|
||||
})
|
||||
.map(s => s.id);
|
||||
}
|
||||
|
||||
// ─── Rewrite Circuit Breaker ──────────────────────────────────────────────
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue