- Extract buildResumeSection and buildCarryForwardSection for continue/carry-forward logic
- Extract checkNeedsReassessment and checkNeedsRunUat for adaptive replanning
- Consolidates workflow state checking and section building
- No behavior change; backward compatible via re-export pattern
- Reduces auto-prompts.js by ~260 LOC
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Extract buildSliceSummaryExcerpt to format slice summaries as excerpts
- Extract getPriorTaskSummaryPaths and getDependencyTaskSummaryPaths
- Extract isSummaryCleanForSkip for replan decision logic
- Consolidates summary extraction logic for reuse and testability
- No behavior change; backward compatible via re-export pattern
- Reduces auto-prompts.js by ~120 LOC
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Import querySmMemories from sm-client.js
- Merge cross-project memories into getRelevantMemoriesRanked
- Cap cross-project confidence at 0.8 with 0.9 reduction (conservative)
- Gracefully degrade: fail-open if SM unavailable
- Preserve cosine ranking with relation boost for merged pool
- Tests: 3821 passing, no regressions
Implements Tier 1.2 Phase 3: Cross-project memory recall via Singularity Memory.
Enables dispatch to leverage patterns from other projects while maintaining
local autonomy via fail-open semantics.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Schema version bumped to 36
- Add migrateCostUsdToMicroUsd() helper for safe migration
- Convert cost_usd REAL to cost_micro_usd INTEGER in gate_runs
- Migration: multiply USD values by 1,000,000 to avoid float drift
- Update insertGateRun() to support cost_micro_usd field
- Old cost_usd column retained for backward compatibility
Benefits:
- Eliminates floating-point drift on accumulated costs
- Easier reasoning about cost totals
- Integer arithmetic is faster and more predictable
- Idempotent migration (safe to re-run)
Migration runs automatically on first database open for schema < 36.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>