@lazyingart/agintiflow 0.20.278 → 0.20.279
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/package.json +1 -1
- package/scripts/smoke-dynamic-step-budget.js +88 -0
- package/src/agent-runner.js +38 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lazyingart/agintiflow",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.279",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AgInTiFlow is a project-aware agent workspace for hybrid wet-dry R&D, hardware-aware intelligence, software automation, and industrial workflows.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -182,6 +182,94 @@ function toolMessage(payload) {
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
try {
|
|
185
|
+
const readOnlyVerificationGoal = [
|
|
186
|
+
"Continue this exact saved task in the same workspace. Do not start over and do",
|
|
187
|
+
"not modify source_brief.md, measurements.csv, prompt.txt, or TASK.md.",
|
|
188
|
+
"The prior run completed the task-owned repository repair. Run exactly `git status --short`.",
|
|
189
|
+
"Do not rebuild, rewrite, recommit, or restore obsolete outputs when the worktree is clean.",
|
|
190
|
+
].join("\n");
|
|
191
|
+
const readOnlyVerificationState = {
|
|
192
|
+
goal: readOnlyVerificationGoal,
|
|
193
|
+
messages: [
|
|
194
|
+
toolMessage({
|
|
195
|
+
toolName: "run_command",
|
|
196
|
+
ok: true,
|
|
197
|
+
exitCode: 0,
|
|
198
|
+
args: { command: "git commit -m 'Complete retained repair'" },
|
|
199
|
+
stdout: "[main abcdef1] Complete retained repair\n 1 file changed, 1 insertion(+)",
|
|
200
|
+
goalRevision: 13,
|
|
201
|
+
projectMutationRevision: 19,
|
|
202
|
+
}),
|
|
203
|
+
toolMessage({
|
|
204
|
+
toolName: "run_command",
|
|
205
|
+
ok: true,
|
|
206
|
+
exitCode: 0,
|
|
207
|
+
args: { command: "git status --short" },
|
|
208
|
+
stdout: "",
|
|
209
|
+
goalRevision: 15,
|
|
210
|
+
projectMutationRevision: 23,
|
|
211
|
+
}),
|
|
212
|
+
],
|
|
213
|
+
meta: {
|
|
214
|
+
goalContract: {
|
|
215
|
+
version: 3,
|
|
216
|
+
revision: 15,
|
|
217
|
+
activeGoalRevision: 15,
|
|
218
|
+
taskGoal: "Create the editable deck, commit the focused repair, and verify it.",
|
|
219
|
+
activeGoal: readOnlyVerificationGoal,
|
|
220
|
+
currentRequest: readOnlyVerificationGoal,
|
|
221
|
+
currentPreview: readOnlyVerificationGoal,
|
|
222
|
+
history: [{ revision: 15, refreshExecutionContract: true }],
|
|
223
|
+
},
|
|
224
|
+
activeExecutionContract: {
|
|
225
|
+
revision: 15,
|
|
226
|
+
startedMutationRevision: 22,
|
|
227
|
+
requiresWorkspaceMutation: false,
|
|
228
|
+
requiresFileMutation: false,
|
|
229
|
+
requiresSourceGrounding: false,
|
|
230
|
+
requiredProjectCommands: ["git status --short"],
|
|
231
|
+
},
|
|
232
|
+
projectVerification: {
|
|
233
|
+
mutationRevision: 23,
|
|
234
|
+
requiredCommands: ["git status --short"],
|
|
235
|
+
},
|
|
236
|
+
durableGitActions: ["commit", "status"],
|
|
237
|
+
durableGitEvidence: [
|
|
238
|
+
{ action: "commit", goalRevision: 13, mutationRevision: 19 },
|
|
239
|
+
{ action: "status", goalRevision: 15, mutationRevision: 23 },
|
|
240
|
+
],
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
const readOnlyVerificationContract = completionTaskContract(
|
|
244
|
+
{ taskProfile: "slides" },
|
|
245
|
+
readOnlyVerificationState
|
|
246
|
+
);
|
|
247
|
+
assert(
|
|
248
|
+
readOnlyVerificationContract.requiresWorkspaceMutation === false &&
|
|
249
|
+
readOnlyVerificationContract.requiresFileMutation === false &&
|
|
250
|
+
readOnlyVerificationContract.requiresSourceGrounding === false,
|
|
251
|
+
"a verification-only continuation inherited stale mutation requirements from retained task context"
|
|
252
|
+
);
|
|
253
|
+
assert(
|
|
254
|
+
readOnlyVerificationContract.requiredGitActions.includes("commit") &&
|
|
255
|
+
Number(readOnlyVerificationContract.requiredGitRevision || 0) === 0 &&
|
|
256
|
+
Number(readOnlyVerificationContract.requiredGitMutationRevision || 0) === 0,
|
|
257
|
+
"a verification-only continuation demanded a new commit instead of accepting retained same-task Git evidence"
|
|
258
|
+
);
|
|
259
|
+
const readOnlyGitEvaluation = evaluateScsEvidence(
|
|
260
|
+
{
|
|
261
|
+
...readOnlyVerificationContract,
|
|
262
|
+
requiresExternalEvidence: false,
|
|
263
|
+
requiredEvidence: [],
|
|
264
|
+
requiredProjectCommands: [],
|
|
265
|
+
},
|
|
266
|
+
buildScsEvidenceLedger({ state: readOnlyVerificationState })
|
|
267
|
+
);
|
|
268
|
+
assert(
|
|
269
|
+
readOnlyGitEvaluation.missingGitActions.length === 0,
|
|
270
|
+
"a prior verified same-task commit did not satisfy a read-only completion continuation"
|
|
271
|
+
);
|
|
272
|
+
|
|
185
273
|
const runLockConfig = {
|
|
186
274
|
sessionsDir: path.join(tempRoot, "run-lock-sessions"),
|
|
187
275
|
};
|
package/src/agent-runner.js
CHANGED
|
@@ -11319,6 +11319,19 @@ export function completionTaskContract(config = {}, state = {}) {
|
|
|
11319
11319
|
const currentContract = currentRequest
|
|
11320
11320
|
? deriveScsTaskContract({ goal: currentRequest, taskProfile })
|
|
11321
11321
|
: null;
|
|
11322
|
+
const authoritativeReadOnlyContinuation = Boolean(
|
|
11323
|
+
currentRequest &&
|
|
11324
|
+
refreshesExecutionContract &&
|
|
11325
|
+
activeExecutionContractIsAuthoritative &&
|
|
11326
|
+
activeExecutionContract.requiresWorkspaceMutation !== true &&
|
|
11327
|
+
activeExecutionContract.requiresFileMutation !== true &&
|
|
11328
|
+
activeExecutionContract.requiresSourceGrounding !== true &&
|
|
11329
|
+
currentContract?.requiresWorkspaceMutation !== true &&
|
|
11330
|
+
currentContract?.requiresFileMutation !== true &&
|
|
11331
|
+
currentContract?.requiresSourceGrounding !== true &&
|
|
11332
|
+
!(Array.isArray(currentContract?.requiredGitActions) &&
|
|
11333
|
+
currentContract.requiredGitActions.length > 0)
|
|
11334
|
+
);
|
|
11322
11335
|
if (
|
|
11323
11336
|
currentRequest &&
|
|
11324
11337
|
(refreshesExecutionContract || activeExecutionContractIsAuthoritative) &&
|
|
@@ -11383,12 +11396,15 @@ export function completionTaskContract(config = {}, state = {}) {
|
|
|
11383
11396
|
contract = {
|
|
11384
11397
|
...contract,
|
|
11385
11398
|
requiredEvidence: [...evidenceByCategory.values()],
|
|
11386
|
-
requiresWorkspaceMutation:
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
requiresFileMutation:
|
|
11390
|
-
|
|
11391
|
-
|
|
11399
|
+
requiresWorkspaceMutation: authoritativeReadOnlyContinuation
|
|
11400
|
+
? false
|
|
11401
|
+
: Boolean(contract.requiresWorkspaceMutation || currentContract?.requiresWorkspaceMutation),
|
|
11402
|
+
requiresFileMutation: authoritativeReadOnlyContinuation
|
|
11403
|
+
? false
|
|
11404
|
+
: Boolean(contract.requiresFileMutation || currentContract?.requiresFileMutation),
|
|
11405
|
+
requiresSourceGrounding: authoritativeReadOnlyContinuation
|
|
11406
|
+
? false
|
|
11407
|
+
: Boolean(contract.requiresSourceGrounding || currentContract?.requiresSourceGrounding),
|
|
11392
11408
|
currentEvidenceCategories: [...currentEvidenceCategories],
|
|
11393
11409
|
currentEvidenceRevision: currentGoalRevision,
|
|
11394
11410
|
currentMutationBaseline: startedMutationRevision,
|
|
@@ -11414,14 +11430,22 @@ export function completionTaskContract(config = {}, state = {}) {
|
|
|
11414
11430
|
if (Array.isArray(contract.requiredGitActions) && contract.requiredGitActions.length) {
|
|
11415
11431
|
contract = {
|
|
11416
11432
|
...contract,
|
|
11417
|
-
requiredGitRevision:
|
|
11418
|
-
Number(contract.requiredGitRevision || 0)
|
|
11419
|
-
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
|
|
11423
|
-
|
|
11424
|
-
|
|
11433
|
+
requiredGitRevision: authoritativeReadOnlyContinuation
|
|
11434
|
+
? Number(contract.requiredGitRevision || 0)
|
|
11435
|
+
: Math.max(
|
|
11436
|
+
Number(contract.requiredGitRevision || 0),
|
|
11437
|
+
Number(goalContract.activeGoalRevision || goalContract.revision || 0)
|
|
11438
|
+
),
|
|
11439
|
+
requiredGitMutationRevision: authoritativeReadOnlyContinuation
|
|
11440
|
+
? Number(contract.requiredGitMutationRevision || 0)
|
|
11441
|
+
: Math.max(
|
|
11442
|
+
Number(contract.requiredGitMutationRevision || 0),
|
|
11443
|
+
Number(
|
|
11444
|
+
contract.projectMutationRevision ||
|
|
11445
|
+
state.meta?.projectVerification?.mutationRevision ||
|
|
11446
|
+
0
|
|
11447
|
+
)
|
|
11448
|
+
),
|
|
11425
11449
|
};
|
|
11426
11450
|
}
|
|
11427
11451
|
return contract;
|