@miller-tech/uap 1.152.0 → 1.154.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/cli/deliver.d.ts.map +1 -1
- package/dist/cli/deliver.js +132 -133
- package/dist/cli/deliver.js.map +1 -1
- package/dist/delivery/changed-files.d.ts +23 -0
- package/dist/delivery/changed-files.d.ts.map +1 -0
- package/dist/delivery/changed-files.js +53 -0
- package/dist/delivery/changed-files.js.map +1 -0
- package/dist/delivery/ci-reconverge.d.ts +42 -0
- package/dist/delivery/ci-reconverge.d.ts.map +1 -0
- package/dist/delivery/ci-reconverge.js +65 -0
- package/dist/delivery/ci-reconverge.js.map +1 -0
- package/dist/delivery/convergence-loop.d.ts.map +1 -1
- package/dist/delivery/convergence-loop.js +3 -8
- package/dist/delivery/convergence-loop.js.map +1 -1
- package/dist/delivery/decompose.d.ts +8 -0
- package/dist/delivery/decompose.d.ts.map +1 -1
- package/dist/delivery/decompose.js +9 -1
- package/dist/delivery/decompose.js.map +1 -1
- package/dist/delivery/delivery-result.d.ts +11 -0
- package/dist/delivery/delivery-result.d.ts.map +1 -0
- package/dist/delivery/delivery-result.js +20 -0
- package/dist/delivery/delivery-result.js.map +1 -0
- package/dist/delivery/epic-controller.d.ts +19 -8
- package/dist/delivery/epic-controller.d.ts.map +1 -1
- package/dist/delivery/epic-controller.js +8 -3
- package/dist/delivery/epic-controller.js.map +1 -1
- package/dist/delivery/epic-mission.d.ts.map +1 -1
- package/dist/delivery/epic-mission.js +38 -9
- package/dist/delivery/epic-mission.js.map +1 -1
- package/dist/delivery/index.d.ts +3 -0
- package/dist/delivery/index.d.ts.map +1 -1
- package/dist/delivery/index.js +3 -0
- package/dist/delivery/index.js.map +1 -1
- package/dist/delivery/orchestrated-mission.d.ts +1 -4
- package/dist/delivery/orchestrated-mission.d.ts.map +1 -1
- package/dist/delivery/orchestrated-mission.js +4 -14
- package/dist/delivery/orchestrated-mission.js.map +1 -1
- package/dist/delivery/phased-mission.d.ts +55 -0
- package/dist/delivery/phased-mission.d.ts.map +1 -0
- package/dist/delivery/phased-mission.js +50 -0
- package/dist/delivery/phased-mission.js.map +1 -0
- package/dist/delivery/plan-check.d.ts.map +1 -1
- package/dist/delivery/plan-check.js +10 -1
- package/dist/delivery/plan-check.js.map +1 -1
- package/dist/delivery/run-state.d.ts +4 -0
- package/dist/delivery/run-state.d.ts.map +1 -1
- package/dist/delivery/run-state.js +51 -4
- package/dist/delivery/run-state.js.map +1 -1
- package/dist/delivery/verifier-ladder.d.ts +10 -0
- package/dist/delivery/verifier-ladder.d.ts.map +1 -1
- package/dist/delivery/verifier-ladder.js +16 -0
- package/dist/delivery/verifier-ladder.js.map +1 -1
- package/package.json +1 -1
- package/src/policies/enforcers/__pycache__/_common.cpython-312.pyc +0 -0
- package/templates/hooks/__pycache__/deliver_autoroute.cpython-312.pyc +0 -0
- package/tools/agents/scripts/__pycache__/toolcall_path_normalizer.cpython-312.pyc +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deliver.d.ts","sourceRoot":"","sources":["../../src/cli/deliver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAqBH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIzD,OAAO,EAA2E,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAKjJ;;;;;;;;;;;GAWG;AACH;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;IACzB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,GAAG;IAAE,iBAAiB,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAC;IAAC,YAAY,EAAE,OAAO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BAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAiB3E;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAyC3E;AAED,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBhG"}
|
package/dist/cli/deliver.js
CHANGED
|
@@ -94,7 +94,7 @@ export function resolveAcceptanceVerdict(r, acceptancePrimary) {
|
|
|
94
94
|
import { createAgenticExecutor, noopApplier, selectExecutorMode, lockContractFiles } from '../delivery/agentic-executor.js';
|
|
95
95
|
import { createRepairEscalation } from '../delivery/repair-escalation.js';
|
|
96
96
|
import { clearStop, isStopRequested, loadRunState, newRunId, saveRunState } from '../delivery/run-state.js';
|
|
97
|
-
import {
|
|
97
|
+
import { planDeliveryPhases, shouldDecompose } from '../delivery/decompose.js';
|
|
98
98
|
import { initLedger, markItem } from '../delivery/completion-ledger.js';
|
|
99
99
|
import { loadUapConfigRaw } from '../utils/config-loader.js';
|
|
100
100
|
import { buildUserPathsNote, createUserValidationRunner, resolveUserValidationMode, synthesizeUserValidationRung, } from '../delivery/user-validation.js';
|
|
@@ -120,6 +120,9 @@ import { autoMineHaloTraces, summarizeWeaknesses, weaknessGuidance, loadPersiste
|
|
|
120
120
|
import { createGitWorktreeProvider } from '../delivery/candidate-workspace.js';
|
|
121
121
|
import { createTaskWorkspaceManager, resolveParallelTasks } from '../delivery/task-workspace.js';
|
|
122
122
|
import { runOrchestratedMission as runOrchestratedMissionCore } from '../delivery/orchestrated-mission.js';
|
|
123
|
+
import { runCiReconverge } from '../delivery/ci-reconverge.js';
|
|
124
|
+
import { runPhasedMission as runPhasedMissionCore } from '../delivery/phased-mission.js';
|
|
125
|
+
import { changedFiles } from '../delivery/changed-files.js';
|
|
123
126
|
import { runEpicMission as runEpicMissionCore } from '../delivery/epic-mission.js';
|
|
124
127
|
import { createHaloDeliveryTracer } from '../delivery/halo-trace.js';
|
|
125
128
|
import { haloTracePath, isHaloTracingEnabled } from '../observability/halo-exporter.js';
|
|
@@ -127,7 +130,7 @@ import { createRunCoordinator } from '../delivery/run-coordinator.js';
|
|
|
127
130
|
import { readCuratedIdeas } from './ideate.js';
|
|
128
131
|
import { createEscalationController, defaultEscalationLadder } from '../delivery/escalation.js';
|
|
129
132
|
import { FilePracticeStore, defaultPracticePath, extractKeywords, retrievePracticesSemantic, } from '../delivery/practice.js';
|
|
130
|
-
import { detectRungs, runLadder, runTieredLadder, tierOf, TIER_ORDER, demoteBaselineFailures } from '../delivery/verifier-ladder.js';
|
|
133
|
+
import { detectRungs, mergeRedetectedRungs, runLadder, runTieredLadder, tierOf, TIER_ORDER, demoteBaselineFailures } from '../delivery/verifier-ladder.js';
|
|
131
134
|
import { runDeployDevLadder } from '../delivery/deploy-dev-gate.js';
|
|
132
135
|
import { commitPushAndWatch } from '../delivery/ci-watcher.js';
|
|
133
136
|
import { snapshotTree, restoreTree, disposeSnapshot } from '../delivery/snapshot.js';
|
|
@@ -164,28 +167,6 @@ function currentBranch(projectRoot) {
|
|
|
164
167
|
* agentic executor mutates the repo directly and returns an empty file set), so
|
|
165
168
|
* the watcher stages a known list instead of a blanket `git add -A`.
|
|
166
169
|
*/
|
|
167
|
-
function changedFiles(projectRoot) {
|
|
168
|
-
try {
|
|
169
|
-
const r = spawnSync('git', ['status', '--porcelain', '-z'], {
|
|
170
|
-
cwd: projectRoot,
|
|
171
|
-
encoding: 'utf-8',
|
|
172
|
-
});
|
|
173
|
-
if (r.status !== 0 || !r.stdout)
|
|
174
|
-
return [];
|
|
175
|
-
return r.stdout
|
|
176
|
-
.split('\0')
|
|
177
|
-
.filter(Boolean)
|
|
178
|
-
// porcelain lines are "XY <path>"; drop the 3-char status prefix.
|
|
179
|
-
.map((line) => line.slice(3))
|
|
180
|
-
.filter(Boolean)
|
|
181
|
-
// Harness-owned state (run checkpoints, traces, mined weaknesses) must
|
|
182
|
-
// never ride into the delivery commit on repos that don't ignore .uap/.
|
|
183
|
-
.filter((f) => !f.startsWith('.uap/') && !f.startsWith('.uap\\'));
|
|
184
|
-
}
|
|
185
|
-
catch {
|
|
186
|
-
return [];
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
170
|
function fail(message) {
|
|
190
171
|
console.error(chalk.red(message));
|
|
191
172
|
process.exitCode = 2;
|
|
@@ -1507,7 +1488,11 @@ async function runDeliver(instruction, options) {
|
|
|
1507
1488
|
envDecompose: process.env.UAP_DELIVER_DECOMPOSE,
|
|
1508
1489
|
heuristic: () => shouldDecompose(instruction, autoPlan?.complexity),
|
|
1509
1490
|
});
|
|
1510
|
-
|
|
1491
|
+
// Skipped when the epic path owns the mission: runEpicMission re-plans via
|
|
1492
|
+
// planEpics, so this call would burn an evaluator pass (+ thought
|
|
1493
|
+
// experiment) on a phases array the dispatch never uses. Kept for resume
|
|
1494
|
+
// and the --no-epics paths.
|
|
1495
|
+
if (!phases && decomposeWanted && !resumeState && !epicsEnabled) {
|
|
1511
1496
|
console.log(chalk.cyan('🧩 decompose: planning sequential delivery phases…'));
|
|
1512
1497
|
// ExpertOrchestrator lifecycle chain → phase-shaping hints (fail-soft).
|
|
1513
1498
|
let lifecycleHints;
|
|
@@ -1702,18 +1687,12 @@ async function runDeliver(instruction, options) {
|
|
|
1702
1687
|
},
|
|
1703
1688
|
isMergeBlocked: (f) => mergeProtected.has(f.toLowerCase()),
|
|
1704
1689
|
verifyCombined: () => {
|
|
1705
|
-
//
|
|
1706
|
-
//
|
|
1707
|
-
// from-scratch build's mid-mission gates must be re-merged here or
|
|
1690
|
+
// Redetection REASSIGNS the loop's local rungs and never mutates this
|
|
1691
|
+
// captured t0 array — re-merge (same pure policy the loop uses) or
|
|
1708
1692
|
// the combined tree is verified against stale t0 gates only.
|
|
1709
1693
|
let combinedRungs = rungs;
|
|
1710
1694
|
try {
|
|
1711
|
-
|
|
1712
|
-
const have = new Set(rungs.map((r) => r.id));
|
|
1713
|
-
const allow = loopConfig.redetectFilter ?? ((r) => tierOf(r) === 'fast' || tierOf(r) === 'runtime');
|
|
1714
|
-
const added = detected.filter((r) => !have.has(r.id) && allow(r));
|
|
1715
|
-
if (added.length > 0)
|
|
1716
|
-
combinedRungs = [...rungs, ...added];
|
|
1695
|
+
combinedRungs = mergeRedetectedRungs(rungs, detectRungs(projectRoot), loopConfig.redetectFilter);
|
|
1717
1696
|
}
|
|
1718
1697
|
catch {
|
|
1719
1698
|
// detection unavailable - verify against the t0 rungs
|
|
@@ -1757,57 +1736,54 @@ async function runDeliver(instruction, options) {
|
|
|
1757
1736
|
const parallelTasks = resolveParallelTasks(cfgRaw.deliver?.parallelTasks);
|
|
1758
1737
|
return runOrchestratedMissionCore(buildOrchestratedDeps(instruction, phases, parallelTasks));
|
|
1759
1738
|
};
|
|
1739
|
+
/**
|
|
1740
|
+
* Wire deliver's ambient context into the extracted phased runner
|
|
1741
|
+
* (src/delivery/phased-mission.ts) — the cursor-honoring resume path and
|
|
1742
|
+
* the fallback when orchestration is explicitly disabled.
|
|
1743
|
+
*/
|
|
1760
1744
|
const runPhasedMission = async () => {
|
|
1761
|
-
const
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
break;
|
|
1804
|
-
}
|
|
1805
|
-
phaseSummaries.push(`${phase.title}: ${phase.goal.slice(0, 140)} (delivered in ${phaseResult.turns} turn(s))`);
|
|
1806
|
-
runState.phaseSummaries = [...phaseSummaries];
|
|
1807
|
-
runState.checkpoint = undefined; // belongs to the finished phase
|
|
1808
|
-
saveRunState(runState);
|
|
1809
|
-
}
|
|
1810
|
-
return all;
|
|
1745
|
+
const startCheckpoint = resumeCheckpoint;
|
|
1746
|
+
return runPhasedMissionCore({
|
|
1747
|
+
instruction,
|
|
1748
|
+
phases: phases,
|
|
1749
|
+
startIndex: phaseIndex,
|
|
1750
|
+
initialSummaries: [...phaseSummaries],
|
|
1751
|
+
hasResumeCheckpoint: Boolean(startCheckpoint),
|
|
1752
|
+
resumedTurns: startCheckpoint?.history.length ?? 0,
|
|
1753
|
+
runPhaseLoop: async ({ prompt, resume }) => {
|
|
1754
|
+
const loop = new ConvergenceLoop({
|
|
1755
|
+
...loopConfig,
|
|
1756
|
+
baselineCheck: false,
|
|
1757
|
+
resumeFrom: resume ? startCheckpoint : undefined,
|
|
1758
|
+
onIteration: makeIterationHook(),
|
|
1759
|
+
},
|
|
1760
|
+
// The interrupted run may have escalated models; only the RESUMED
|
|
1761
|
+
// loop re-binds the escalated executor (historic behavior).
|
|
1762
|
+
resume && startCheckpoint ? runExecutor : executor, seams);
|
|
1763
|
+
if (resume)
|
|
1764
|
+
resumeCheckpoint = undefined; // consumed by this loop
|
|
1765
|
+
return loop.deliver(prompt);
|
|
1766
|
+
},
|
|
1767
|
+
setPhaseSpec: (spec) => {
|
|
1768
|
+
acceptanceSpec = spec;
|
|
1769
|
+
specChangeEvidence.writes = 0;
|
|
1770
|
+
},
|
|
1771
|
+
openTask: (title) => openDeliveryTask(title, projectRoot, missionTask?.id),
|
|
1772
|
+
completeTask: (record, r) => completeDeliveryTask(record, r),
|
|
1773
|
+
persistCursor: (index) => {
|
|
1774
|
+
phaseIndex = index;
|
|
1775
|
+
runState.phaseIndex = index;
|
|
1776
|
+
saveRunState(runState);
|
|
1777
|
+
},
|
|
1778
|
+
persistCompleted: (summaries) => {
|
|
1779
|
+
phaseSummaries.length = 0;
|
|
1780
|
+
phaseSummaries.push(...summaries);
|
|
1781
|
+
runState.phaseSummaries = [...summaries];
|
|
1782
|
+
runState.checkpoint = undefined; // belongs to the finished phase
|
|
1783
|
+
saveRunState(runState);
|
|
1784
|
+
},
|
|
1785
|
+
note: (line) => console.log(line.startsWith('▶') ? chalk.bold(line) : chalk.dim(line)),
|
|
1786
|
+
});
|
|
1811
1787
|
};
|
|
1812
1788
|
/**
|
|
1813
1789
|
* P7 — epic controller: run a massive mission as a SEQUENCE of epics. Each
|
|
@@ -1961,75 +1937,98 @@ async function runDeliver(instruction, options) {
|
|
|
1961
1937
|
console.log(chalk.dim(' lazy attempt did not pass — engaging the full convergence stack'));
|
|
1962
1938
|
}
|
|
1963
1939
|
}
|
|
1940
|
+
// Resume downgrade warning: resumes always take a cursor-honoring
|
|
1941
|
+
// sequential path — phased when a phase plan was persisted, otherwise the
|
|
1942
|
+
// single flat loop — but the ORIGINAL run may have executed as epic or
|
|
1943
|
+
// orchestrated: different prompts, no contract publication, DAG flattened
|
|
1944
|
+
// to linear order. Loud, never silent — and NOT gated on the phases
|
|
1945
|
+
// array, because epic runs never persist one and interrupted epic runs
|
|
1946
|
+
// are the most common resume case.
|
|
1947
|
+
if (resumeState?.runnerKind) {
|
|
1948
|
+
const resumeTarget = phases && phases.length >= 2 ? 'phased' : 'single';
|
|
1949
|
+
if (resumeState.runnerKind !== resumeTarget) {
|
|
1950
|
+
const targetDesc = resumeTarget === 'phased'
|
|
1951
|
+
? 'sequential phased path (the only cursor-honoring runner)'
|
|
1952
|
+
: 'single-loop path (no phase plan was persisted by the original run)';
|
|
1953
|
+
console.log(chalk.yellow(` ⚠ resume: the interrupted run executed as '${resumeState.runnerKind}'; resuming on the ${targetDesc} — prompts and per-phase context will differ from the original execution model.`));
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1964
1956
|
if (lazySolved) {
|
|
1957
|
+
runState.runnerKind = 'single';
|
|
1958
|
+
saveRunState(runState);
|
|
1965
1959
|
result = result;
|
|
1966
1960
|
}
|
|
1967
1961
|
else if (epicsEnabled) {
|
|
1962
|
+
runState.runnerKind = 'epic';
|
|
1963
|
+
saveRunState(runState);
|
|
1968
1964
|
result = await runEpicMission();
|
|
1969
1965
|
}
|
|
1970
|
-
else if (phases && phases.length >= 2 && orchestrateEnabled) {
|
|
1966
|
+
else if (phases && phases.length >= 2 && orchestrateEnabled && !resumeState) {
|
|
1967
|
+
// A RESUMED phased run must not route here: the orchestrated runner
|
|
1968
|
+
// ignores phaseIndex/resumeCheckpoint and would restart the DAG from
|
|
1969
|
+
// scratch. runPhasedMission below is the only cursor-honoring path.
|
|
1970
|
+
runState.runnerKind = 'orchestrated';
|
|
1971
|
+
saveRunState(runState);
|
|
1971
1972
|
result = await runOrchestratedMission();
|
|
1972
1973
|
}
|
|
1973
1974
|
else if (phases && phases.length >= 2) {
|
|
1975
|
+
runState.runnerKind = 'phased';
|
|
1976
|
+
saveRunState(runState);
|
|
1974
1977
|
result = await runPhasedMission();
|
|
1975
1978
|
}
|
|
1976
1979
|
else {
|
|
1980
|
+
runState.runnerKind = 'single';
|
|
1981
|
+
saveRunState(runState);
|
|
1977
1982
|
if (resumeCheckpoint)
|
|
1978
1983
|
loopConfig.resumeFrom = resumeCheckpoint;
|
|
1979
1984
|
const loop = new ConvergenceLoop(loopConfig, runExecutor, seams);
|
|
1980
1985
|
result = await loop.deliver(instruction);
|
|
1981
1986
|
}
|
|
1982
1987
|
// CI watch boundary + re-converge: once local tiers are green, commit/push
|
|
1983
|
-
// the worktree branch and watch the CI run
|
|
1984
|
-
//
|
|
1985
|
-
// turn 1 always runs the model — local gates already pass). Bounded by
|
|
1986
|
-
// --ci-passes. Skipped when nothing changed (alreadyDelivered).
|
|
1988
|
+
// the worktree branch and watch the CI run — extracted policy, see
|
|
1989
|
+
// src/delivery/ci-reconverge.ts. Skipped when nothing changed.
|
|
1987
1990
|
if (watchCi && result.success && !result.alreadyDelivered) {
|
|
1991
|
+
// Re-point the judge at the MISSION: epic/phased runners leave
|
|
1992
|
+
// acceptanceSpec on the LAST epic/phase spec, and a re-converge pass
|
|
1993
|
+
// would otherwise be judged against that stale slice.
|
|
1994
|
+
acceptanceSpec = instruction;
|
|
1995
|
+
specChangeEvidence.writes = 0; // evidence resets wherever the spec re-points
|
|
1988
1996
|
const branch = currentBranch(projectRoot) ?? undefined;
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
}
|
|
2025
|
-
console.log(chalk.cyan(' ⟲ re-converging against CI feedback…'));
|
|
2026
|
-
const reconvergeLoop = new ConvergenceLoop({ ...loopConfig, baselineCheck: false, resumeFrom: undefined, onCheckpoint: undefined }, executor, seams);
|
|
2027
|
-
result = await reconvergeLoop.deliver(`${instruction}\n\n${watch.feedback ?? ''}`);
|
|
2028
|
-
if (!result.success) {
|
|
2029
|
-
console.log(chalk.red(' re-converge did not reach local-green; stopping watch-ci.'));
|
|
2030
|
-
break;
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
1997
|
+
result = await runCiReconverge({
|
|
1998
|
+
instruction,
|
|
1999
|
+
initial: result,
|
|
2000
|
+
ciPasses,
|
|
2001
|
+
changedFiles: () => changedFiles(projectRoot),
|
|
2002
|
+
greenDetail: watchEnvironments ? ` (${watchEnvironments.join('/')} deploy verified)` : '',
|
|
2003
|
+
commitAndWatch: async (files) => {
|
|
2004
|
+
console.log(chalk.cyan(`☁ watch-ci: committing & pushing ${branch ?? 'current branch'}, watching CI…`));
|
|
2005
|
+
const watch = await commitPushAndWatch({
|
|
2006
|
+
projectRoot,
|
|
2007
|
+
branch,
|
|
2008
|
+
commitMessage: `feat(delivery): ${instruction.slice(0, 72)}`,
|
|
2009
|
+
files,
|
|
2010
|
+
timeoutMs: ciTimeoutMs,
|
|
2011
|
+
watchEnvironments,
|
|
2012
|
+
onProgress: (m) => console.log(chalk.dim(` ${m}`)),
|
|
2013
|
+
});
|
|
2014
|
+
if (watch.runUrl)
|
|
2015
|
+
console.log(chalk.dim(` run: ${watch.runUrl}`));
|
|
2016
|
+
return watch;
|
|
2017
|
+
},
|
|
2018
|
+
reconverge: async (prompt) => {
|
|
2019
|
+
const reconvergeLoop = new ConvergenceLoop({ ...loopConfig, baselineCheck: false, resumeFrom: undefined, onCheckpoint: undefined }, executor, seams);
|
|
2020
|
+
return reconvergeLoop.deliver(prompt);
|
|
2021
|
+
},
|
|
2022
|
+
note: (line) => console.log(line.startsWith(' ✓')
|
|
2023
|
+
? chalk.green(line)
|
|
2024
|
+
: line.startsWith(' ⚠') || line.startsWith(' ✗')
|
|
2025
|
+
? chalk.yellow(line)
|
|
2026
|
+
: line.startsWith(' ⟲')
|
|
2027
|
+
? chalk.cyan(line)
|
|
2028
|
+
: line.includes('exhausted') || line.includes('did not reach')
|
|
2029
|
+
? chalk.red(line)
|
|
2030
|
+
: chalk.dim(line)),
|
|
2031
|
+
});
|
|
2033
2032
|
}
|
|
2034
2033
|
}
|
|
2035
2034
|
catch (err) {
|