looply-cli 0.5.5 → 0.5.7
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/.src-hash +1 -1
- package/dist/checkout-carry.d.ts +2 -0
- package/dist/checkout-carry.d.ts.map +1 -1
- package/dist/checkout-carry.js +25 -2
- package/dist/checkout-carry.js.map +1 -1
- package/dist/daemon-cmd.d.ts.map +1 -1
- package/dist/daemon-cmd.js +37 -23
- package/dist/daemon-cmd.js.map +1 -1
- package/dist/git-driver.d.ts +10 -0
- package/dist/git-driver.d.ts.map +1 -1
- package/dist/git-driver.js +22 -0
- package/dist/git-driver.js.map +1 -1
- package/dist/goal-adaptive.d.ts +12 -0
- package/dist/goal-adaptive.d.ts.map +1 -1
- package/dist/goal-adaptive.js +19 -4
- package/dist/goal-adaptive.js.map +1 -1
- package/dist/goal-compile.d.ts +7 -0
- package/dist/goal-compile.d.ts.map +1 -1
- package/dist/goal-compile.js +3 -0
- package/dist/goal-compile.js.map +1 -1
- package/dist/goal-execution-evidence.d.ts +28 -2
- package/dist/goal-execution-evidence.d.ts.map +1 -1
- package/dist/goal-execution-evidence.js +30 -5
- package/dist/goal-execution-evidence.js.map +1 -1
- package/dist/goal-reproof.d.ts +42 -0
- package/dist/goal-reproof.d.ts.map +1 -0
- package/dist/goal-reproof.js +35 -0
- package/dist/goal-reproof.js.map +1 -0
- package/dist/plan-recovery.d.ts +70 -0
- package/dist/plan-recovery.d.ts.map +1 -0
- package/dist/plan-recovery.js +131 -0
- package/dist/plan-recovery.js.map +1 -0
- package/dist/run-cmd.d.ts.map +1 -1
- package/dist/run-cmd.js +64 -9
- package/dist/run-cmd.js.map +1 -1
- package/dist/workspace-provisioner.d.ts +47 -3
- package/dist/workspace-provisioner.d.ts.map +1 -1
- package/dist/workspace-provisioner.js +73 -2
- package/dist/workspace-provisioner.js.map +1 -1
- package/dist/workspace.d.ts +36 -0
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +173 -8
- package/dist/workspace.js.map +1 -1
- package/package.json +2 -2
- package/win/contained-node.cjs +27 -4
package/dist/goal-adaptive.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ADAPTIVE_MAX_STEPS = exports.MAX_PLAN_REVISIONS_PER_GOAL_VERSION = void 0;
|
|
3
|
+
exports.ADAPTIVE_MAX_STEPS = exports.DIRECT_FALLBACK_REVISION = exports.MAX_PLAN_REVISIONS_PER_GOAL_VERSION = void 0;
|
|
4
4
|
exports.decideAdaptive = decideAdaptive;
|
|
5
5
|
exports.gapText = gapText;
|
|
6
6
|
exports.describeAdaptive = describeAdaptive;
|
|
7
7
|
const core_1 = require("@looply/core");
|
|
8
|
+
const plan_recovery_1 = require("./plan-recovery");
|
|
8
9
|
/**
|
|
9
10
|
* WHETHER TO TRY AGAIN, ONCE.
|
|
10
11
|
*
|
|
@@ -38,6 +39,18 @@ const core_1 = require("@looply/core");
|
|
|
38
39
|
* goal's ability to try a different approach.
|
|
39
40
|
*/
|
|
40
41
|
exports.MAX_PLAN_REVISIONS_PER_GOAL_VERSION = 3;
|
|
42
|
+
/**
|
|
43
|
+
* ONE MORE REVISION, AND IT IS NOT A PLAN: THE DIRECT ATTEMPT.
|
|
44
|
+
*
|
|
45
|
+
* Three structured plans that did not reach the goal used to end it
|
|
46
|
+
* `budget_exhausted` — the ticket went back to a person. The owner's rule is
|
|
47
|
+
* that a ticket goes back EXTREMELY rarely, and pasting the same ticket into a
|
|
48
|
+
* chat fixes most of them, so before giving up the goal gets one last revision
|
|
49
|
+
* holding a single step: do what the ticket asks, with its full text and what
|
|
50
|
+
* the evaluator says is still missing. It is gated and proved like any round.
|
|
51
|
+
* Only after that does the budget run out.
|
|
52
|
+
*/
|
|
53
|
+
exports.DIRECT_FALLBACK_REVISION = exports.MAX_PLAN_REVISIONS_PER_GOAL_VERSION + 1;
|
|
41
54
|
/**
|
|
42
55
|
* How many steps an adaptive plan may contain.
|
|
43
56
|
*
|
|
@@ -173,10 +186,11 @@ async function decideAdaptive(input, deps) {
|
|
|
173
186
|
? { kind: 'satisfied' }
|
|
174
187
|
: { kind: 'satisfied', summary: verdict.summary };
|
|
175
188
|
}
|
|
176
|
-
// Incomplete. One more plan, if there is one left.
|
|
177
|
-
if (input.currentRevision >= exports.
|
|
189
|
+
// Incomplete. One more plan, if there is one left; then the direct attempt; then nothing.
|
|
190
|
+
if (input.currentRevision >= exports.DIRECT_FALLBACK_REVISION) {
|
|
178
191
|
return { kind: 'budget-exhausted', revision: input.currentRevision, gaps: verdict.gaps };
|
|
179
192
|
}
|
|
193
|
+
const direct = input.currentRevision >= exports.MAX_PLAN_REVISIONS_PER_GOAL_VERSION;
|
|
180
194
|
// Authority is re-checked HERE, after the evaluation and before anything
|
|
181
195
|
// durable is written. The evaluation may have taken minutes, and a goal that
|
|
182
196
|
// has been amended or given up in that time must not receive work planned
|
|
@@ -188,7 +202,8 @@ async function decideAdaptive(input, deps) {
|
|
|
188
202
|
: { kind: 'stale', reason: still.reason, lapse: still.lapse };
|
|
189
203
|
}
|
|
190
204
|
const revision = input.currentRevision + 1;
|
|
191
|
-
|
|
205
|
+
// The direct revision asks no compiler: its one step is the ticket itself, with what is still missing.
|
|
206
|
+
const steps = direct ? (0, plan_recovery_1.directFixOutcome)(gapText(input.goalText, verdict.gaps)) : await deps.compile({
|
|
192
207
|
goalId: input.goalId,
|
|
193
208
|
goalVersion: input.goalVersion,
|
|
194
209
|
goalText: gapText(input.goalText, verdict.gaps),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goal-adaptive.js","sourceRoot":"","sources":["../src/goal-adaptive.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"goal-adaptive.js","sourceRoot":"","sources":["../src/goal-adaptive.ts"],"names":[],"mappings":";;;AAyLA,wCA8LC;AAUD,0BAGC;AAoDD,4CAqJC;AA7kB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BACL,QAAQ,EAAE,IAAI;gBACd,sEAAsE;gBACtE,gEAAgE;gBAChE,4DAA4D;gBAC5D,IAAI,EAAE,8BAA8B;gBACpC,OAAO,EACL,QAAQ,CAAC,WAAW,KAAK,SAAS;oBAChC,CAAC,CAAC,0BAA0B,QAAQ,CAAC,KAAK,CAAC,MAAM,sCAAsC;wBACrF,iCAAiC;oBACnC,CAAC,CAAC,2EAA2E;wBAC3E,uEAAuE;aAC9E,CAAC;QACJ,KAAK,OAAO;YACV,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,yEAAyE;gBACzE,oEAAoE;gBACpE,sBAAsB;gBACtB,IAAI,EAAE,QAAQ,CAAC,KAAK,KAAK,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,iBAAiB;gBAC3E,OAAO,EAAE,iDAAiD,QAAQ,CAAC,MAAM,EAAE;aAC5E,CAAC;QACJ,KAAK,aAAa;YAChB;;;;;;;;;;;;;;;eAeG;YACH,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,sEAAsE;gBACtE,sEAAsE;gBACtE,kCAAkC;gBAClC,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,sDAAsD,QAAQ,CAAC,MAAM,EAAE;aACjF,CAAC;QACJ,KAAK,aAAa;YAChB,wEAAwE;YACxE,oDAAoD;YACpD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,gCAAgC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;QAC9G,OAAO,CAAC,CAAC,CAAC;YACR,uEAAuE;YACvE,MAAM,SAAS,GAAU,QAAQ,CAAC;YAClC,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/goal-compile.d.ts
CHANGED
|
@@ -279,6 +279,13 @@ export interface CompileGoalInput {
|
|
|
279
279
|
* claim could say, and the prompt is exactly the prompt of before.
|
|
280
280
|
*/
|
|
281
281
|
readonly checks?: readonly string[];
|
|
282
|
+
/**
|
|
283
|
+
* WHY THE PREVIOUS ANSWER TO THIS SAME QUESTION COULD NOT BE USED — set only
|
|
284
|
+
* on a second ask (`plan-recovery.ts`): the steps whose cited evidence did not
|
|
285
|
+
* hold at the tree, or a plan that came back empty for a ticket worded as a
|
|
286
|
+
* statement. Absent renders exactly the prompt of before.
|
|
287
|
+
*/
|
|
288
|
+
readonly retryContext?: string;
|
|
282
289
|
}
|
|
283
290
|
/** Why there was no plan: the transport gave up, the transport failed, or the answer could not be read as a plan. */
|
|
284
291
|
export type CompileFailure = 'timed-out' | 'failed' | 'unreadable';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goal-compile.d.ts","sourceRoot":"","sources":["../src/goal-compile.ts"],"names":[],"mappings":"AACA,OAAO,EAA2E,KAAK,QAAQ,EAAE,KAAK,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAClJ,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAEnC,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,QAAiB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,yDAAyD;AACzD,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,WAAW;AACrB;;;;;;;;;GASG;AACD;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,QAAQ,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,K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EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,cAAc,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtG,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,EAAE,QAAQ,SAAoB,GAAG,MAAM,CA+DhG;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CA6CrG;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,GAAG,EAAE;IACH,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAClC;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GACA,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,CA2BzB"}
|
package/dist/goal-compile.js
CHANGED
|
@@ -316,6 +316,9 @@ function buildCompilePrompt(input, maxSteps = exports.COMPILE_MAX_STEPS) {
|
|
|
316
316
|
...(input.memory === undefined || input.memory === null
|
|
317
317
|
? []
|
|
318
318
|
: ['WHAT THIS PROJECT HAS ALREADY ESTABLISHED:', input.memory, '']),
|
|
319
|
+
...(input.retryContext === undefined || input.retryContext.trim() === ''
|
|
320
|
+
? []
|
|
321
|
+
: ['YOUR PREVIOUS PLAN FOR THIS GOAL COULD NOT BE USED:', input.retryContext, '']),
|
|
319
322
|
'Read the repository as it actually is. Decide the smallest set of separate,',
|
|
320
323
|
`independently-completable pieces of work that move this project toward that goal.`,
|
|
321
324
|
'',
|
package/dist/goal-compile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goal-compile.js","sourceRoot":"","sources":["../src/goal-compile.ts"],"names":[],"mappings":";;;AAwHA,0BAEC;AAUD,wCAEC;AAmBD,wDAOC;AAQD,oCAEC;AAyBD,gCAuBC;AAoBD,oCAQC;AAQD,gCAIC;AAcD,kCAYC;AAkCD,sCA6BC;
|
|
1
|
+
{"version":3,"file":"goal-compile.js","sourceRoot":"","sources":["../src/goal-compile.ts"],"names":[],"mappings":";;;AAwHA,0BAEC;AAUD,wCAEC;AAmBD,wDAOC;AAQD,oCAEC;AAyBD,gCAuBC;AAoBD,oCAQC;AAQD,gCAIC;AAcD,kCAYC;AAkCD,sCA6BC;AAuED,gDA+DC;AASD,kCA6CC;AAcD,kCA4CC;AAjlBD,6CAAyC;AACzC,uCAAkJ;AAElJ,qDAAkD;AAElD;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACU,QAAA,iBAAiB,GAAG,CAAC,CAAC;AAEnC,mEAAmE;AACtD,QAAA,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAyDjD;;;;;;;;;;;;;;;;;GAiBG;AACH,SAAgB,OAAO,CAAC,KAAa;IACnC,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,MAAc,EAAE,WAAmB,EAAE,GAAW;IAC7E,OAAO,IAAA,gBAAS,EAAC,MAAM,EAAE,IAAA,aAAM,EAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,sBAAsB,CACpC,MAAc,E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C,KAAK;QACd,GAAG,EAAE,CAAC,CAAC,GAAG;QACV,KAAK,EAAE,OAAgB;QACvB,0EAA0E;QAC1E,mEAAmE;QACnE,MAAM,EAAE,MAAe;QACvB,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,yEAAyE;QACzE,wEAAwE;QACxE,0BAA0B;QAC1B,sBAAsB,EAAE,GAAG,CAAC,WAAW;QACvC,0EAA0E;QAC1E,4EAA4E;QAC5E,uEAAuE;QACvE,GAAG,CAAC,QAAQ,GAAG,0BAAmB,CAAC,CAAC,CAAC,EAAE,uBAAuB,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChF,oEAAoE;QACpE,0CAA0C;QAC1C,QAAQ,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;QAC3B,QAAQ,EAAE,CAAC;KACZ,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Item, type RunScope } from '@looply/core';
|
|
1
|
+
import { type GateStepResult, type Item, type RunScope } from '@looply/core';
|
|
2
2
|
import type { RoundRecord } from './round-records';
|
|
3
3
|
/**
|
|
4
4
|
* KEY 2 — THE HALF OF "THIS GOAL IS MET" THAT CANNOT BE TALKED INTO AN ANSWER.
|
|
@@ -96,6 +96,24 @@ export interface GoalExecutionInput {
|
|
|
96
96
|
* a person's own `git commit` can never qualify.
|
|
97
97
|
*/
|
|
98
98
|
countManualWork?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* THE GATES, RUN AGAIN AT THE CURRENT HEAD, when the tree moved on since this
|
|
101
|
+
* plan was delivered (`goal-reproof.ts`).
|
|
102
|
+
*
|
|
103
|
+
* 🔴 WHY: TAB-B-57, 63 and 64 (2026-10-15) delivered every step of their plans,
|
|
104
|
+
* and the next Start found another ticket's run had moved this checkout's HEAD
|
|
105
|
+
* in between — stacked on top of their own commits. KEY 2 answered "the code
|
|
106
|
+
* has moved on … what is here now was never checked", which was TRUE, and the
|
|
107
|
+
* goal went back to a person for it. The honest repair is not to relax (2)
|
|
108
|
+
* above but to do the checking: run every required step at the tree that is
|
|
109
|
+
* here now. Accepted only when a committed round of this plan is CONTAINED in
|
|
110
|
+
* that tree (`contains`: the plan's committed shas that are ancestors of HEAD),
|
|
111
|
+
* so a re-proof can never vouch for a tree that lacks the work.
|
|
112
|
+
*/
|
|
113
|
+
rechecked?: {
|
|
114
|
+
readonly contains: ReadonlySet<string>;
|
|
115
|
+
readonly steps: readonly GateStepResult[];
|
|
116
|
+
};
|
|
99
117
|
}
|
|
100
118
|
export type GoalExecutionOutcome = {
|
|
101
119
|
ok: true;
|
|
@@ -116,11 +134,19 @@ export type GoalExecutionOutcome = {
|
|
|
116
134
|
* gate record is the only one that can speak for it.
|
|
117
135
|
*/
|
|
118
136
|
delivered: readonly string[];
|
|
119
|
-
|
|
137
|
+
/** Set when the answer rests on a re-proof at HEAD: the steps that ran there, which speak for this tree. */
|
|
138
|
+
reproved?: readonly GateStepResult[];
|
|
139
|
+
}
|
|
140
|
+
/** `moved`: the only refusal a re-proof at the current tree can answer (see `rechecked`). */
|
|
141
|
+
| {
|
|
120
142
|
ok: false;
|
|
121
143
|
because: string;
|
|
144
|
+
moved?: true;
|
|
122
145
|
};
|
|
146
|
+
export declare const CODE_MOVED_ON = "the code has moved on since this plan was delivered, so what is here now was never checked";
|
|
123
147
|
export declare function confirmGoalExecutionEvidence(input: GoalExecutionInput): GoalExecutionOutcome;
|
|
148
|
+
/** The commits this plan's delivered work made — what a re-proof asks git about (`rechecked.contains`). */
|
|
149
|
+
export declare function committedShasOf(input: Pick<GoalExecutionInput, 'scope' | 'items' | 'rounds' | 'countManualWork'>): string[];
|
|
124
150
|
/** A committed round, as a goal-met Start locates it: its commit and the run that made it. */
|
|
125
151
|
export interface DeliveredTip {
|
|
126
152
|
readonly sha: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goal-execution-evidence.d.ts","sourceRoot":"","sources":["../src/goal-execution-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"goal-execution-evidence.d.ts","sourceRoot":"","sources":["../src/goal-execution-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,cAAc,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE1G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;OASG;IACH,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IACvB,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,0EAA0E;IAC1E,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,EAAE;QACV,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QACvC,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;KAC3C,CAAC;CACH;AAED,MAAM,MAAM,oBAAoB,GAC5B;IACE,EAAE,EAAE,IAAI,CAAC;IACT,KAAK,EAAE,WAAW,CAAC;IACnB;;;;;;;;;;;;;;OAcG;IACH,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;CACtC;AACH,6FAA6F;GAC3F;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEjD,eAAO,MAAM,aAAa,+FACoE,CAAC;AAE/F,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,kBAAkB,GAAG,oBAAoB,CAkH5F;AA8CD,2GAA2G;AAC3G,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,iBAAiB,CAAC,GAAG,MAAM,EAAE,CAM3H;AAED,8FAA8F;AAC9F,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,iBAAiB,CAAC,GAChF,YAAY,GAAG,IAAI,CAOrB"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CODE_MOVED_ON = void 0;
|
|
3
4
|
exports.confirmGoalExecutionEvidence = confirmGoalExecutionEvidence;
|
|
5
|
+
exports.committedShasOf = committedShasOf;
|
|
4
6
|
exports.deliveredTipOf = deliveredTipOf;
|
|
5
7
|
const core_1 = require("@looply/core");
|
|
6
8
|
const goal_compile_1 = require("./goal-compile");
|
|
9
|
+
exports.CODE_MOVED_ON = 'the code has moved on since this plan was delivered, so what is here now was never checked';
|
|
7
10
|
function confirmGoalExecutionEvidence(input) {
|
|
8
11
|
const { scope, currentHead } = input;
|
|
9
12
|
if (scope === null)
|
|
@@ -49,11 +52,23 @@ function confirmGoalExecutionEvidence(input) {
|
|
|
49
52
|
const atHead = committed.filter((r) => r.sha === currentHead);
|
|
50
53
|
if (atHead.length === 0) {
|
|
51
54
|
// Deliberately not "close enough". Something has moved the repository since
|
|
52
|
-
// this plan landed, and nothing here has checked that the goal survived it
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
// this plan landed, and nothing here has checked that the goal survived it —
|
|
56
|
+
// unless the gates were run again at this tree, and the plan's work is in it.
|
|
57
|
+
const rechecked = input.rechecked;
|
|
58
|
+
if (rechecked === undefined)
|
|
59
|
+
return { ok: false, because: exports.CODE_MOVED_ON, moved: true };
|
|
60
|
+
const contained = committed.filter((r) => {
|
|
61
|
+
const item = mineById.get(r.itemId);
|
|
62
|
+
return r.sha !== undefined && rechecked.contains.has(r.sha) && item !== undefined && !(0, goal_compile_1.isPlanMarker)(item);
|
|
63
|
+
});
|
|
64
|
+
if (contained.length === 0) {
|
|
65
|
+
return { ok: false, because: 'the code has moved on since this plan was delivered, and its work is not in the tree that is here now' };
|
|
66
|
+
}
|
|
67
|
+
const permitted = (0, core_1.mayCommit)({ steps: [...rechecked.steps], requiredSteps: input.requiredSteps, proofEnabled: false });
|
|
68
|
+
if (!permitted.ok) {
|
|
69
|
+
return { ok: false, because: `the gates were run again at the current tree, and ${permitted.reason ?? 'they did not pass'}` };
|
|
70
|
+
}
|
|
71
|
+
return { ok: true, round: contained[contained.length - 1], delivered: [...deliveredIds], reproved: rechecked.steps };
|
|
57
72
|
}
|
|
58
73
|
// An EXISTS, not a FOR-ALL, and that is the whole reachability argument: a
|
|
59
74
|
// plan of five steps produces five commits and only the last is HEAD, so
|
|
@@ -141,6 +156,16 @@ function committedOfPlan(input, scope) {
|
|
|
141
156
|
}
|
|
142
157
|
return { ok: true, committed, deliveredIds, mineById };
|
|
143
158
|
}
|
|
159
|
+
/** The commits this plan's delivered work made — what a re-proof asks git about (`rechecked.contains`). */
|
|
160
|
+
function committedShasOf(input) {
|
|
161
|
+
const { scope } = input;
|
|
162
|
+
if (scope === null || scope.planRevision === undefined)
|
|
163
|
+
return [];
|
|
164
|
+
const plan = committedOfPlan(input, scope);
|
|
165
|
+
if (!plan.ok)
|
|
166
|
+
return [];
|
|
167
|
+
return plan.committed.flatMap((r) => (r.sha === undefined ? [] : [r.sha]));
|
|
168
|
+
}
|
|
144
169
|
/**
|
|
145
170
|
* The plan's NEWEST committed round — the delivered tree a goal-met Start judges while the
|
|
146
171
|
* lane has not moved it (F27). Null wherever KEY 2 would find nothing to confirm, and when
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goal-execution-evidence.js","sourceRoot":"","sources":["../src/goal-execution-evidence.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"goal-execution-evidence.js","sourceRoot":"","sources":["../src/goal-execution-evidence.ts"],"names":[],"mappings":";;;AAsJA,oEAkHC;AA+CD,0CAMC;AAaD,wCASC;AAnVD,uCAA0G;AAC1G,iDAA8C;AAkJjC,QAAA,aAAa,GACxB,4FAA4F,CAAC;AAE/F,SAAgB,4BAA4B,CAAC,KAAyB;IACpE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IACrC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC;IACrF,IAAI,KAAK,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACrC,wEAAwE;QACxE,wEAAwE;QACxE,mCAAmC;QACnC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,uEAAuE,EAAE,CAAC;IACzG,CAAC;IACD,IAAI,WAAW,KAAK,EAAE;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;IAE9F;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,KAAK,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrC,OAAO;YACL,EAAE,EAAE,KAAK;YACT,OA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EjF,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IACxB,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,YAAY,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACpE,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC3C,IAAI,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IAC1B,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC;IAC9E,OAAO,MAAM,EAAE,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { GateStepResult } from '@looply/core';
|
|
2
|
+
/**
|
|
3
|
+
* RE-CHECK THE TREE THAT IS HERE NOW, RATHER THAN HAND A DELIVERED GOAL BACK.
|
|
4
|
+
*
|
|
5
|
+
* KEY 2 (`goal-execution-evidence.ts`) refuses a "goal met" verdict when HEAD is
|
|
6
|
+
* not the commit the plan's last round made: nothing has checked the tree that
|
|
7
|
+
* is here now. On 2026-10-15 that refusal ended three Tabsy tickets whose every
|
|
8
|
+
* step had been delivered, gated and proved (TAB-B-57, 63, 64) — another
|
|
9
|
+
* ticket's run had been cut on top of their commits in the same checkout, so
|
|
10
|
+
* HEAD had moved on and the goal went back to a person.
|
|
11
|
+
*
|
|
12
|
+
* This does the missing check instead: when the plan's work is contained in
|
|
13
|
+
* HEAD and the working tree is clean, every gate step runs again at HEAD, and
|
|
14
|
+
* KEY 2 is asked again with what those steps say. A tree without the work, a
|
|
15
|
+
* dirty tree, or a red gate still refuses — with the reason.
|
|
16
|
+
*
|
|
17
|
+
* Every verb is injected, so production and the tests run this same code.
|
|
18
|
+
*/
|
|
19
|
+
export interface ReproofDeps {
|
|
20
|
+
/** Uncommitted paths in the working tree. */
|
|
21
|
+
changedPaths(): Promise<readonly string[]>;
|
|
22
|
+
isAncestor(ancestor: string, of: string): Promise<boolean>;
|
|
23
|
+
changedPathsBetween(fromSha: string, toSha: string): Promise<readonly string[]>;
|
|
24
|
+
/** Run the project's gate at the current tree; `changedPaths` feeds the steps' `when:` filters. */
|
|
25
|
+
runGates(changedPaths: readonly string[]): Promise<readonly GateStepResult[]>;
|
|
26
|
+
}
|
|
27
|
+
export type ReproofOutcome = {
|
|
28
|
+
readonly ok: true;
|
|
29
|
+
readonly contains: ReadonlySet<string>;
|
|
30
|
+
readonly steps: readonly GateStepResult[];
|
|
31
|
+
} | {
|
|
32
|
+
readonly ok: false;
|
|
33
|
+
readonly because: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* `committed` is the plan's committed shas in ledger order (`committedShasOf`).
|
|
37
|
+
* The `when:` paths are everything from the parent of the plan's first
|
|
38
|
+
* contained commit to HEAD, so a step filtered to the files this plan touched
|
|
39
|
+
* still runs.
|
|
40
|
+
*/
|
|
41
|
+
export declare function reproveAtHead(head: string, committed: readonly string[], deps: ReproofDeps): Promise<ReproofOutcome>;
|
|
42
|
+
//# sourceMappingURL=goal-reproof.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-reproof.d.ts","sourceRoot":"","sources":["../src/goal-reproof.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,WAAW;IAC1B,6CAA6C;IAC7C,YAAY,IAAI,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IAC3C,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC3D,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IAChF,mGAAmG;IACnG,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,cAAc,EAAE,CAAC,CAAC;CAC/E;AAED,MAAM,MAAM,cAAc,GACtB;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,cAAc,EAAE,CAAA;CAAE,GACxG;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAoB1H"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reproveAtHead = reproveAtHead;
|
|
4
|
+
/**
|
|
5
|
+
* `committed` is the plan's committed shas in ledger order (`committedShasOf`).
|
|
6
|
+
* The `when:` paths are everything from the parent of the plan's first
|
|
7
|
+
* contained commit to HEAD, so a step filtered to the files this plan touched
|
|
8
|
+
* still runs.
|
|
9
|
+
*/
|
|
10
|
+
async function reproveAtHead(head, committed, deps) {
|
|
11
|
+
if (head === '')
|
|
12
|
+
return { ok: false, because: 'the current commit could not be read' };
|
|
13
|
+
const dirty = await deps.changedPaths();
|
|
14
|
+
if (dirty.length > 0) {
|
|
15
|
+
return { ok: false, because: `the working tree has ${dirty.length} uncommitted change(s), so it is not the tree a gate would check` };
|
|
16
|
+
}
|
|
17
|
+
const contains = [];
|
|
18
|
+
for (const sha of committed) {
|
|
19
|
+
if (sha === head || (await deps.isAncestor(sha, head).catch(() => false)))
|
|
20
|
+
contains.push(sha);
|
|
21
|
+
}
|
|
22
|
+
if (contains.length === 0)
|
|
23
|
+
return { ok: false, because: 'none of this plan’s commits is in the tree that is here now' };
|
|
24
|
+
let paths = [];
|
|
25
|
+
try {
|
|
26
|
+
paths = await deps.changedPathsBetween(`${contains[0]}~1`, head);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// A plan whose first commit is the repository's root has no parent: the plan's own commits still name its files.
|
|
30
|
+
paths = await deps.changedPathsBetween(contains[0], head).catch(() => []);
|
|
31
|
+
}
|
|
32
|
+
const steps = await deps.runGates(paths);
|
|
33
|
+
return { ok: true, contains: new Set(contains), steps };
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=goal-reproof.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-reproof.js","sourceRoot":"","sources":["../src/goal-reproof.ts"],"names":[],"mappings":";;AAsCA,sCAoBC;AA1BD;;;;;GAKG;AACI,KAAK,UAAU,aAAa,CAAC,IAAY,EAAE,SAA4B,EAAE,IAAiB;IAC/F,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,sCAAsC,EAAE,CAAC;IACvF,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;IACxC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,wBAAwB,KAAK,CAAC,MAAM,kEAAkE,EAAE,CAAC;IACxI,CAAC;IACD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC5B,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChG,CAAC;IACD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,6DAA6D,EAAE,CAAC;IACxH,IAAI,KAAK,GAAsB,EAAE,CAAC;IAClC,IAAI,CAAC;QACH,KAAK,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACpE,CAAC;IAAC,MAAM,CAAC;QACP,iHAAiH;QACjH,KAAK,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAE,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IAC7E,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { CheckedPlan, CheckedStep } from './compile-check';
|
|
2
|
+
import { type CompileGoalInput, type CompileOutcome, type PlanStep } from './goal-compile';
|
|
3
|
+
/**
|
|
4
|
+
* A PLAN THAT CANNOT BE USED AS IT CAME BACK IS ASKED AGAIN, NOT HANDED TO A PERSON.
|
|
5
|
+
*
|
|
6
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
7
|
+
* WHY (Tabsy, 2026-10-15)
|
|
8
|
+
*
|
|
9
|
+
* A ticket pasted into a chat with the same model is fixed nine times in ten.
|
|
10
|
+
* The same tickets given to Looply ended `human_required` for reasons that had
|
|
11
|
+
* nothing to do with the work:
|
|
12
|
+
* - TAB-B-60: the one step of the plan cited `TableBillLink.tsx:201`, the line
|
|
13
|
+
* did not exist at the committed tree, the step was refused, nothing was
|
|
14
|
+
* queued, and the run had nothing to do;
|
|
15
|
+
* - TAB-B-45: "shouldn't a fully paid table automatically become closed? —
|
|
16
|
+
* closing a session is only done manually as of now" was read as a remark,
|
|
17
|
+
* the plan came back empty, and "nothing here can move without you".
|
|
18
|
+
*
|
|
19
|
+
* Neither is a question only a person can answer. So:
|
|
20
|
+
* 1. a step whose citation does not hold is RE-PLANNED: the compiler is asked
|
|
21
|
+
* once more, shown each refusal, and told to read the current tree;
|
|
22
|
+
* 2. a step refused again keeps its place WITHOUT the citation that failed —
|
|
23
|
+
* a citation is a pointer, not the work, and the verify pass still confirms
|
|
24
|
+
* every draft against the code before a round may pick it;
|
|
25
|
+
* 3. an empty plan is asked again with the ticket read as an instruction;
|
|
26
|
+
* 4. an empty plan after that becomes ONE direct step — "do what this ticket
|
|
27
|
+
* asks" — and the implementer is handed the person's full wording (it
|
|
28
|
+
* always is, see `buildImplementerPrompt`). It is gated and proved like
|
|
29
|
+
* every other round, so nothing here lowers the bar for what lands.
|
|
30
|
+
*
|
|
31
|
+
* ⚠️ WHAT IS NOT RECOVERED: a compiler that failed, timed out or answered in a
|
|
32
|
+
* shape nobody could read. Those already spend nothing and the next Start asks
|
|
33
|
+
* again, which is the right answer to a transport problem.
|
|
34
|
+
*
|
|
35
|
+
* PURE apart from the two injected calls, so production and the tests run the
|
|
36
|
+
* same code.
|
|
37
|
+
*/
|
|
38
|
+
export interface RecoveryDeps {
|
|
39
|
+
compile(input: CompileGoalInput): Promise<CompileOutcome>;
|
|
40
|
+
check(steps: readonly PlanStep[]): Promise<CheckedPlan>;
|
|
41
|
+
log?(line: string): void;
|
|
42
|
+
}
|
|
43
|
+
export interface RecoveredPlan {
|
|
44
|
+
/** The answer whose steps are the ones to queue (`steps` already recovered). */
|
|
45
|
+
readonly compiled: CompileOutcome;
|
|
46
|
+
/**
|
|
47
|
+
* `admitted` is every step to queue; `refused` is what the FIRST check refused,
|
|
48
|
+
* kept so the compile record shows the claim beside what was there.
|
|
49
|
+
*/
|
|
50
|
+
readonly checked: CheckedPlan | null;
|
|
51
|
+
/** What recovery did, for the log; empty when the first answer was used as it came. */
|
|
52
|
+
readonly notes: readonly string[];
|
|
53
|
+
}
|
|
54
|
+
export declare const DIRECT_STEP_PREFIX = "Do what this ticket asks, as written";
|
|
55
|
+
/** The context for a re-plan after refusals: each refused step, and why. */
|
|
56
|
+
export declare function refusalContext(refused: readonly CheckedStep[]): string;
|
|
57
|
+
/** The context for a re-plan after an empty plan: read the ticket as an instruction. */
|
|
58
|
+
export declare const STATEMENT_CONTEXT: string;
|
|
59
|
+
/** The one step a ticket gets when structured planning produced nothing usable. */
|
|
60
|
+
export declare function directFixStep(goalText: string): PlanStep;
|
|
61
|
+
/** A compile answer made of the direct step alone, for a caller that needs a `CompileOutcome`. */
|
|
62
|
+
export declare function directFixOutcome(goalText: string): CompileOutcome;
|
|
63
|
+
/** A refused step with the citations that failed taken off it. */
|
|
64
|
+
export declare function withoutRefuted(r: CheckedStep): PlanStep;
|
|
65
|
+
/**
|
|
66
|
+
* Compile, check, and recover. `maxSteps` bounds what is queued, whatever the
|
|
67
|
+
* recovery added, so a re-plan never makes a plan bigger than the cap it was asked under.
|
|
68
|
+
*/
|
|
69
|
+
export declare function compileWithRecovery(input: CompileGoalInput, deps: RecoveryDeps, maxSteps: number): Promise<RecoveredPlan>;
|
|
70
|
+
//# sourceMappingURL=plan-recovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-recovery.d.ts","sourceRoot":"","sources":["../src/plan-recovery.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,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H"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.STATEMENT_CONTEXT = exports.DIRECT_STEP_PREFIX = void 0;
|
|
4
|
+
exports.refusalContext = refusalContext;
|
|
5
|
+
exports.directFixStep = directFixStep;
|
|
6
|
+
exports.directFixOutcome = directFixOutcome;
|
|
7
|
+
exports.withoutRefuted = withoutRefuted;
|
|
8
|
+
exports.compileWithRecovery = compileWithRecovery;
|
|
9
|
+
const node_crypto_1 = require("node:crypto");
|
|
10
|
+
const goal_compile_1 = require("./goal-compile");
|
|
11
|
+
/** The longest direct-step title: the verify pass and the phone both show it. */
|
|
12
|
+
const DIRECT_TITLE_MAX = 240;
|
|
13
|
+
exports.DIRECT_STEP_PREFIX = 'Do what this ticket asks, as written';
|
|
14
|
+
/** The context for a re-plan after refusals: each refused step, and why. */
|
|
15
|
+
function refusalContext(refused) {
|
|
16
|
+
const lines = refused.map((r) => `- ${JSON.stringify(r.step.title)}: ${r.verdict.ok ? 'admitted' : r.verdict.because}`);
|
|
17
|
+
return [
|
|
18
|
+
'These steps cited code that is not there at the current tree:',
|
|
19
|
+
...lines,
|
|
20
|
+
'The repository has moved since you looked, or the citation was wrong. Open those files again at the',
|
|
21
|
+
'current tree and plan against what is there now. Cite a line only after reading it.',
|
|
22
|
+
].join('\n');
|
|
23
|
+
}
|
|
24
|
+
/** The context for a re-plan after an empty plan: read the ticket as an instruction. */
|
|
25
|
+
exports.STATEMENT_CONTEXT = [
|
|
26
|
+
'It came back with no steps. This goal is a ticket a person wrote, and people often word a',
|
|
27
|
+
'ticket as a remark, a complaint or a question ("X is only done manually", "Y is not tracking",',
|
|
28
|
+
'"shouldn\'t Z happen automatically?"). Read it as an instruction: make the code behave the way',
|
|
29
|
+
'the ticket implies it should. Return no steps only if the repository already does that, and',
|
|
30
|
+
'then cite the code that shows it.',
|
|
31
|
+
].join('\n');
|
|
32
|
+
/** The person's own first line, which is the ticket's title when AutoRyn sent it. */
|
|
33
|
+
function firstLine(text) {
|
|
34
|
+
return (text.split(/\r?\n/).find((l) => l.trim() !== '') ?? '').trim();
|
|
35
|
+
}
|
|
36
|
+
/** The one step a ticket gets when structured planning produced nothing usable. */
|
|
37
|
+
function directFixStep(goalText) {
|
|
38
|
+
const head = firstLine(goalText);
|
|
39
|
+
const title = head === '' ? exports.DIRECT_STEP_PREFIX : `${exports.DIRECT_STEP_PREFIX}: ${head}`;
|
|
40
|
+
return {
|
|
41
|
+
title: title.length > DIRECT_TITLE_MAX ? `${title.slice(0, DIRECT_TITLE_MAX - 1)}…` : title,
|
|
42
|
+
tag: 'goal',
|
|
43
|
+
evidence: [],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** A compile answer made of the direct step alone, for a caller that needs a `CompileOutcome`. */
|
|
47
|
+
function directFixOutcome(goalText) {
|
|
48
|
+
const step = directFixStep(goalText);
|
|
49
|
+
return {
|
|
50
|
+
ok: true,
|
|
51
|
+
steps: [step],
|
|
52
|
+
dropped: 0,
|
|
53
|
+
malformed: 0,
|
|
54
|
+
transcript: '',
|
|
55
|
+
requestDigest: (0, node_crypto_1.createHash)('sha256').update(`direct:${goalText}`, 'utf8').digest('hex'),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/** A refused step with the citations that failed taken off it. */
|
|
59
|
+
function withoutRefuted(r) {
|
|
60
|
+
const refuted = r.verdict.ok ? [] : r.verdict.refuted;
|
|
61
|
+
return { ...r.step, evidence: r.step.evidence.filter((e) => !refuted.includes(e)) };
|
|
62
|
+
}
|
|
63
|
+
function dedupe(steps, max) {
|
|
64
|
+
const seen = new Set();
|
|
65
|
+
const out = [];
|
|
66
|
+
for (const s of steps) {
|
|
67
|
+
const k = (0, goal_compile_1.stepKey)(s.title);
|
|
68
|
+
if (seen.has(k))
|
|
69
|
+
continue;
|
|
70
|
+
seen.add(k);
|
|
71
|
+
out.push(s);
|
|
72
|
+
}
|
|
73
|
+
return out.slice(0, max);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Compile, check, and recover. `maxSteps` bounds what is queued, whatever the
|
|
77
|
+
* recovery added, so a re-plan never makes a plan bigger than the cap it was asked under.
|
|
78
|
+
*/
|
|
79
|
+
async function compileWithRecovery(input, deps, maxSteps) {
|
|
80
|
+
const notes = [];
|
|
81
|
+
const say = (line) => {
|
|
82
|
+
notes.push(line);
|
|
83
|
+
deps.log?.(line);
|
|
84
|
+
};
|
|
85
|
+
const first = await deps.compile(input);
|
|
86
|
+
// A failed or unreadable answer is not a plan to recover: it spends nothing and is asked again.
|
|
87
|
+
if (!first.ok || (first.steps.length === 0 && first.malformed > 0))
|
|
88
|
+
return { compiled: first, checked: null, notes };
|
|
89
|
+
const firstChecked = await deps.check(first.steps);
|
|
90
|
+
let answer = first;
|
|
91
|
+
let queued = [...firstChecked.admitted];
|
|
92
|
+
if (firstChecked.refused.length > 0) {
|
|
93
|
+
say(`${firstChecked.refused.length} step(s) cited code that is not at the tree — planning again against the current tree`);
|
|
94
|
+
const again = await deps.compile({ ...input, retryContext: refusalContext(firstChecked.refused) });
|
|
95
|
+
if (again.ok && again.steps.length > 0) {
|
|
96
|
+
const checkedAgain = await deps.check(again.steps);
|
|
97
|
+
answer = again;
|
|
98
|
+
queued = [...queued, ...checkedAgain.admitted, ...checkedAgain.refused.map(withoutRefuted)];
|
|
99
|
+
if (checkedAgain.refused.length > 0) {
|
|
100
|
+
say(`${checkedAgain.refused.length} re-planned step(s) still cite code that is not there — kept without those citations; the verify pass checks them`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
queued = [...queued, ...firstChecked.refused.map(withoutRefuted)];
|
|
105
|
+
say('the re-plan gave nothing usable — keeping the refused steps without their citations; the verify pass checks them');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (queued.length === 0) {
|
|
109
|
+
say('the plan came back empty — asking again with the ticket read as an instruction');
|
|
110
|
+
const again = await deps.compile({ ...input, retryContext: exports.STATEMENT_CONTEXT });
|
|
111
|
+
if (again.ok && again.steps.length > 0) {
|
|
112
|
+
const checkedAgain = await deps.check(again.steps);
|
|
113
|
+
answer = again;
|
|
114
|
+
queued = [...checkedAgain.admitted, ...checkedAgain.refused.map(withoutRefuted)];
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (queued.length === 0) {
|
|
118
|
+
say('still no plan — queuing one direct step: do what the ticket asks, with its full text');
|
|
119
|
+
const direct = directFixOutcome(input.goalText);
|
|
120
|
+
answer = { ...direct, requestDigest: answer.ok ? answer.requestDigest : direct.requestDigest };
|
|
121
|
+
queued = direct.ok ? direct.steps : [];
|
|
122
|
+
}
|
|
123
|
+
const steps = dedupe(queued, maxSteps);
|
|
124
|
+
const compiled = answer.ok ? { ...answer, steps } : answer;
|
|
125
|
+
return {
|
|
126
|
+
compiled,
|
|
127
|
+
checked: { admitted: steps, refused: firstChecked.refused, treeSha: firstChecked.treeSha },
|
|
128
|
+
notes,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=plan-recovery.js.map
|