omnius 1.0.521 → 1.0.523
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/index.js +221 -32
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -581447,26 +581447,26 @@ function classifyShellIntent(cmd) {
|
|
|
581447
581447
|
function verifyShellOutcome(command, ctx3, result) {
|
|
581448
581448
|
const cmd = (command ?? "").trim();
|
|
581449
581449
|
if (!cmd)
|
|
581450
|
-
return baseline("shell:empty");
|
|
581450
|
+
return withStatusChannels(baseline("shell:empty"), result.success);
|
|
581451
581451
|
const cwd4 = resolveCwd(cmd, ctx3.cwd);
|
|
581452
581452
|
const intent = classifyShellIntent(cmd);
|
|
581453
581453
|
const baseBucket = intentBucketFor(intent, cwd4);
|
|
581454
581454
|
if (!result.success) {
|
|
581455
|
-
return { trustworthy: true, intentBucket: baseBucket, outcomeClass: "broken" };
|
|
581455
|
+
return withStatusChannels({ trustworthy: true, intentBucket: baseBucket, outcomeClass: "broken" }, false);
|
|
581456
581456
|
}
|
|
581457
581457
|
if (intent.klass === "read" || intent.klass === "verify") {
|
|
581458
|
-
return { trustworthy: true, intentBucket: baseBucket, outcomeClass: "verified" };
|
|
581458
|
+
return withStatusChannels({ trustworthy: true, intentBucket: baseBucket, outcomeClass: "verified" }, true);
|
|
581459
581459
|
}
|
|
581460
581460
|
if (intent.klass !== "mutate") {
|
|
581461
|
-
return { trustworthy: true, intentBucket: baseBucket, outcomeClass: "unknown" };
|
|
581461
|
+
return withStatusChannels({ trustworthy: true, intentBucket: baseBucket, outcomeClass: "unknown" }, true);
|
|
581462
581462
|
}
|
|
581463
581463
|
const mtimeCheck = checkMutateMtimeDelta(intent, cwd4, ctx3, result);
|
|
581464
581464
|
const invariantCheck = checkManifestInvariant(cwd4, baseBucket);
|
|
581465
581465
|
if (!mtimeCheck.trustworthy)
|
|
581466
|
-
return mtimeCheck;
|
|
581466
|
+
return withStatusChannels(mtimeCheck, true);
|
|
581467
581467
|
if (!invariantCheck.trustworthy)
|
|
581468
|
-
return invariantCheck;
|
|
581469
|
-
return invariantCheck.outcomeClass !== "unknown" ? invariantCheck : mtimeCheck;
|
|
581468
|
+
return withStatusChannels(invariantCheck, true);
|
|
581469
|
+
return withStatusChannels(invariantCheck.outcomeClass !== "unknown" ? invariantCheck : mtimeCheck, true);
|
|
581470
581470
|
}
|
|
581471
581471
|
function checkMutateMtimeDelta(intent, cwd4, ctx3, _result) {
|
|
581472
581472
|
const bucket = intentBucketFor(intent, cwd4);
|
|
@@ -581731,6 +581731,19 @@ function intentBucketFor(intent, cwd4) {
|
|
|
581731
581731
|
function baseline(intentBucket) {
|
|
581732
581732
|
return { trustworthy: true, intentBucket, outcomeClass: "unknown" };
|
|
581733
581733
|
}
|
|
581734
|
+
function withStatusChannels(result, commandSuccess) {
|
|
581735
|
+
const environmentWarnings = result.trustworthy || !result.syntheticError ? [] : [result.syntheticError];
|
|
581736
|
+
return {
|
|
581737
|
+
...result,
|
|
581738
|
+
command_status: {
|
|
581739
|
+
success: commandSuccess,
|
|
581740
|
+
outcomeClass: result.outcomeClass,
|
|
581741
|
+
intentBucket: result.intentBucket
|
|
581742
|
+
},
|
|
581743
|
+
environment_warnings: environmentWarnings,
|
|
581744
|
+
policy_warnings: []
|
|
581745
|
+
};
|
|
581746
|
+
}
|
|
581734
581747
|
function resolveCwd(cmd, fallback) {
|
|
581735
581748
|
const cdMatch = cmd.match(/^cd\s+([^&\s]+)\s*&&/);
|
|
581736
581749
|
if (cdMatch && cdMatch[1])
|
|
@@ -583472,8 +583485,9 @@ var init_agenticRunner = __esm({
|
|
|
583472
583485
|
_fileWritesThisRun = 0;
|
|
583473
583486
|
_backwardPassCyclesUsed = 0;
|
|
583474
583487
|
// Completion compile/verify gate: count of times task_complete was blocked
|
|
583475
|
-
// because the configured verify command failed.
|
|
583476
|
-
//
|
|
583488
|
+
// because the configured verify command failed. After the retry budget is
|
|
583489
|
+
// spent, the run stops as incomplete_verification instead of completing with
|
|
583490
|
+
// stale or failing verifier evidence.
|
|
583477
583491
|
_completionVerifyRejections = 0;
|
|
583478
583492
|
// Diagnostics counter for the inference-driven resolution gate (the real
|
|
583479
583493
|
// bounded escape is the same-summary completion-hold counter / REG-54).
|
|
@@ -583835,6 +583849,34 @@ var init_agenticRunner = __esm({
|
|
|
583835
583849
|
result.failureDiagnosis = diagnosis;
|
|
583836
583850
|
return diagnosis;
|
|
583837
583851
|
}
|
|
583852
|
+
_buildStaleHashRetryGuidance(toolName, args, result) {
|
|
583853
|
+
if (result.success || !this._isProjectEditTool(toolName))
|
|
583854
|
+
return null;
|
|
583855
|
+
if (result.failureDiagnosis?.kind !== "stale_hash")
|
|
583856
|
+
return null;
|
|
583857
|
+
const path15 = this._extractToolTargetPaths(toolName, args, result)[0];
|
|
583858
|
+
const freshHash = typeof result.beforeHash === "string" && /^[a-f0-9]{64}$/i.test(result.beforeHash) ? result.beforeHash : null;
|
|
583859
|
+
if (!path15 || !freshHash)
|
|
583860
|
+
return null;
|
|
583861
|
+
const retry = {
|
|
583862
|
+
failure_family: "stale_hash",
|
|
583863
|
+
guardrail: "one_assisted_refresh_only",
|
|
583864
|
+
retry: {
|
|
583865
|
+
tool: toolName,
|
|
583866
|
+
args: { ...args, expected_hash: freshHash }
|
|
583867
|
+
},
|
|
583868
|
+
fresh_evidence: {
|
|
583869
|
+
path: path15,
|
|
583870
|
+
expected_hash: freshHash
|
|
583871
|
+
}
|
|
583872
|
+
};
|
|
583873
|
+
return [
|
|
583874
|
+
`[STALE_HASH_RETRY]`,
|
|
583875
|
+
`The edit failed only because expected_hash was stale. The runtime refreshed the current file hash once.`,
|
|
583876
|
+
`Retry the same targeted edit with this fresh expected_hash; if it fails again, re-read the exact target range instead of broadening the edit.`,
|
|
583877
|
+
JSON.stringify(retry)
|
|
583878
|
+
].join("\n");
|
|
583879
|
+
}
|
|
583838
583880
|
_failureRecoveryCardInput(diagnosis) {
|
|
583839
583881
|
return {
|
|
583840
583882
|
id: failureCardId(diagnosis),
|
|
@@ -586123,6 +586165,67 @@ Pick the SMALLEST concrete deliverable from the spec — typically the project e
|
|
|
586123
586165
|
}
|
|
586124
586166
|
return best;
|
|
586125
586167
|
}
|
|
586168
|
+
_pathsOverlapForVerifier(left, right) {
|
|
586169
|
+
const a2 = this._normalizeEvidencePath(left);
|
|
586170
|
+
const b = this._normalizeEvidencePath(right);
|
|
586171
|
+
if (!a2 || !b)
|
|
586172
|
+
return false;
|
|
586173
|
+
return a2 === b || a2.startsWith(`${b}/`) || b.startsWith(`${a2}/`);
|
|
586174
|
+
}
|
|
586175
|
+
_completionVerifierGapsAfterFinalMutation(todos, toolCallLog) {
|
|
586176
|
+
const gaps = [];
|
|
586177
|
+
for (const todo of todos) {
|
|
586178
|
+
if (todo.status !== "completed")
|
|
586179
|
+
continue;
|
|
586180
|
+
const verifyCommand = typeof todo.verifyCommand === "string" ? todo.verifyCommand.trim() : "";
|
|
586181
|
+
if (!verifyCommand)
|
|
586182
|
+
continue;
|
|
586183
|
+
const declaredArtifacts = Array.isArray(todo.declaredArtifacts) ? todo.declaredArtifacts.filter((p2) => typeof p2 === "string" && p2.trim().length > 0).map((p2) => this._normalizeEvidencePath(p2)) : [];
|
|
586184
|
+
let lastMutationTurn = -1;
|
|
586185
|
+
let lastMutationIndex = -1;
|
|
586186
|
+
for (const [index, entry] of toolCallLog.entries()) {
|
|
586187
|
+
if (!entry.mutated)
|
|
586188
|
+
continue;
|
|
586189
|
+
const turn = typeof entry.turn === "number" ? entry.turn : -1;
|
|
586190
|
+
const mutationPaths = Array.isArray(entry.mutatedFiles) ? entry.mutatedFiles.filter((p2) => typeof p2 === "string" && p2.trim().length > 0) : [];
|
|
586191
|
+
const relevant = declaredArtifacts.length === 0 ? true : mutationPaths.some((mutatedPath) => declaredArtifacts.some((artifactPath) => this._pathsOverlapForVerifier(mutatedPath, artifactPath)));
|
|
586192
|
+
if (relevant) {
|
|
586193
|
+
lastMutationIndex = Math.max(lastMutationIndex, index);
|
|
586194
|
+
lastMutationTurn = Math.max(lastMutationTurn, turn);
|
|
586195
|
+
}
|
|
586196
|
+
}
|
|
586197
|
+
const shellHistoryAfterMutation = toolCallLog.filter((entry) => entry.name === "shell" && toolCallLog.indexOf(entry) > lastMutationIndex).map((entry) => ({
|
|
586198
|
+
command: this._shellCommandFromArgsKey(entry.argsKey),
|
|
586199
|
+
success: entry.success === true
|
|
586200
|
+
}));
|
|
586201
|
+
if (!verifyCommandSatisfiedByShellHistory(verifyCommand, shellHistoryAfterMutation)) {
|
|
586202
|
+
gaps.push({
|
|
586203
|
+
todo,
|
|
586204
|
+
verifyCommand,
|
|
586205
|
+
declaredArtifacts,
|
|
586206
|
+
lastMutationTurn
|
|
586207
|
+
});
|
|
586208
|
+
}
|
|
586209
|
+
}
|
|
586210
|
+
return gaps;
|
|
586211
|
+
}
|
|
586212
|
+
_formatFreshVerifierGapFeedback(gaps) {
|
|
586213
|
+
const lines = gaps.slice(0, 8).map((gap) => {
|
|
586214
|
+
const artifacts = gap.declaredArtifacts.length ? ` artifacts=${gap.declaredArtifacts.join(", ")}` : " artifacts=(none declared; any later project mutation invalidates verifier evidence)";
|
|
586215
|
+
const mutation = gap.lastMutationTurn >= 0 ? ` last_relevant_mutation_turn=${gap.lastMutationTurn}` : " no_mutation_recorded";
|
|
586216
|
+
return ` - ${gap.todo.content.slice(0, 120)} :: verifyCommand=\`${gap.verifyCommand}\`;${mutation};${artifacts}`;
|
|
586217
|
+
});
|
|
586218
|
+
return [
|
|
586219
|
+
`[COMPLETION BLOCKED — fresh verifier required]`,
|
|
586220
|
+
`Completed todos with verifyCommand must have a live successful verifier after the final relevant mutation.`,
|
|
586221
|
+
`Prior verifier results are not accepted after a declared artifact changes.`,
|
|
586222
|
+
``,
|
|
586223
|
+
`Unverified completed todo(s):`,
|
|
586224
|
+
...lines,
|
|
586225
|
+
``,
|
|
586226
|
+
`Run the listed verifier command(s) now. If one fails, keep the todo in_progress or blocked and make one targeted fix before retrying.`
|
|
586227
|
+
].join("\n");
|
|
586228
|
+
}
|
|
586126
586229
|
_shellCommandFromArgsKey(argsKey) {
|
|
586127
586230
|
const parsed = this._parseExactArgsKey(argsKey);
|
|
586128
586231
|
return parsed.get("command") ?? parsed.get("cmd") ?? "";
|
|
@@ -586929,9 +587032,8 @@ ${shellLines.join("\n")}` : "Commands run: none"
|
|
|
586929
587032
|
* (e.g. a typecheck/build) before `task_complete` is accepted, but ONLY when
|
|
586930
587033
|
* the run actually modified code files. A non-zero exit blocks completion and
|
|
586931
587034
|
* feeds the error output back so the model fixes it before retrying. Bounded
|
|
586932
|
-
* by OMNIUS_COMPLETION_VERIFY_MAX rejections
|
|
586933
|
-
*
|
|
586934
|
-
* same anti-collapse philosophy as the backward-pass cycle cap).
|
|
587035
|
+
* by OMNIUS_COMPLETION_VERIFY_MAX rejections; after the budget is spent, the
|
|
587036
|
+
* run stops as incomplete_verification instead of accepting task_complete.
|
|
586935
587037
|
*
|
|
586936
587038
|
* Default OFF: unset command → `{ proceed: true }`, preserving the prior
|
|
586937
587039
|
* "no deterministic verification gate" behaviour for every existing caller.
|
|
@@ -586946,17 +587048,25 @@ ${shellLines.join("\n")}` : "Commands run: none"
|
|
|
586946
587048
|
return { proceed: true };
|
|
586947
587049
|
const maxRejections = parseInt(process.env["OMNIUS_COMPLETION_VERIFY_MAX"] || "3", 10) || 3;
|
|
586948
587050
|
if (this._completionVerifyRejections >= maxRejections) {
|
|
586949
|
-
|
|
586950
|
-
`
|
|
586951
|
-
|
|
587051
|
+
const summary = [
|
|
587052
|
+
`INCOMPLETE_VERIFICATION: declared completion verifier is still failing after ${this._completionVerifyRejections} attempt(s).`,
|
|
587053
|
+
``,
|
|
587054
|
+
`Verifier command: ${cmd}`,
|
|
587055
|
+
``,
|
|
587056
|
+
`Stop reason: verifier_still_failing`,
|
|
587057
|
+
`The task cannot be marked complete until this command succeeds after the final mutation.`
|
|
586952
587058
|
].join("\n");
|
|
587059
|
+
this._completionIncompleteVerification = {
|
|
587060
|
+
reason: "verifier_still_failing",
|
|
587061
|
+
summary
|
|
587062
|
+
};
|
|
586953
587063
|
this.emit({
|
|
586954
587064
|
type: "status",
|
|
586955
|
-
content: `completion verify gate exhausted after ${this._completionVerifyRejections}
|
|
587065
|
+
content: `completion verify gate exhausted after ${this._completionVerifyRejections} attempt(s); marking incomplete_verification`,
|
|
586956
587066
|
turn,
|
|
586957
587067
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
586958
587068
|
});
|
|
586959
|
-
return { proceed:
|
|
587069
|
+
return { proceed: false, feedback: summary };
|
|
586960
587070
|
}
|
|
586961
587071
|
const timeoutMs = parseInt(process.env["OMNIUS_COMPLETION_VERIFY_TIMEOUT_MS"] || "180000", 10) || 18e4;
|
|
586962
587072
|
const wd = this._workingDirectory || process.cwd();
|
|
@@ -587033,7 +587143,7 @@ ${outTail || "(no output captured)"}`,
|
|
|
587033
587143
|
"",
|
|
587034
587144
|
"You CANNOT call task_complete until this passes. Fix the errors below, then",
|
|
587035
587145
|
"re-run the verify command yourself (via shell) to confirm before completing.",
|
|
587036
|
-
`(attempt ${this._completionVerifyRejections}/${maxRejections} — after that the run
|
|
587146
|
+
`(attempt ${this._completionVerifyRejections}/${maxRejections} — after that the run stops as incomplete_verification)`,
|
|
587037
587147
|
"",
|
|
587038
587148
|
"--- verify output (tail) ---",
|
|
587039
587149
|
outTail || "(no output captured)"
|
|
@@ -591484,7 +591594,26 @@ TASK: ${scrubbedTask}` : scrubbedTask;
|
|
|
591484
591594
|
return true;
|
|
591485
591595
|
};
|
|
591486
591596
|
const holdUnresolvedVerificationTaskComplete = (turn) => {
|
|
591487
|
-
const
|
|
591597
|
+
const todos = this.readSessionTodos() || [];
|
|
591598
|
+
const freshVerifierGaps = this._completionVerifierGapsAfterFinalMutation(todos, toolCallLog);
|
|
591599
|
+
const gapContents = new Set(freshVerifierGaps.map((gap) => gap.todo.content));
|
|
591600
|
+
for (const todo of todos) {
|
|
591601
|
+
if (todo.status === "completed" && typeof todo.verifyCommand === "string" && todo.verifyCommand.trim().length > 0) {
|
|
591602
|
+
if (gapContents.has(todo.content)) {
|
|
591603
|
+
this._verifyCommandFailures.add(todo.content);
|
|
591604
|
+
} else {
|
|
591605
|
+
this._verifyCommandFailures.delete(todo.content);
|
|
591606
|
+
}
|
|
591607
|
+
this._refreshTodoVerificationFailure(todo.content);
|
|
591608
|
+
}
|
|
591609
|
+
}
|
|
591610
|
+
const freshGapFailures = freshVerifierGaps.map((gap) => gap.todo.content);
|
|
591611
|
+
const newFailures = [
|
|
591612
|
+
.../* @__PURE__ */ new Set([
|
|
591613
|
+
...[...this._verifyFailures].filter((f2) => !this._verifyFailuresBaseline.has(f2)),
|
|
591614
|
+
...freshGapFailures
|
|
591615
|
+
])
|
|
591616
|
+
];
|
|
591488
591617
|
if (newFailures.length === 0)
|
|
591489
591618
|
return false;
|
|
591490
591619
|
const failures = newFailures.slice(0, 8);
|
|
@@ -591492,6 +591621,8 @@ TASK: ${scrubbedTask}` : scrubbedTask;
|
|
|
591492
591621
|
`[COMPLETION BLOCKED — unresolved todo verification]`,
|
|
591493
591622
|
`The active todo list still contains completed items whose required evidence has not been satisfied by work done in THIS task.`,
|
|
591494
591623
|
``,
|
|
591624
|
+
freshVerifierGaps.length > 0 ? this._formatFreshVerifierGapFeedback(freshVerifierGaps) : "",
|
|
591625
|
+
freshVerifierGaps.length > 0 ? `` : "",
|
|
591495
591626
|
`Unresolved verification item(s) introduced this run:`,
|
|
591496
591627
|
...failures.map((item) => ` - ${item}`),
|
|
591497
591628
|
``,
|
|
@@ -591521,15 +591652,20 @@ TASK: ${scrubbedTask}` : scrubbedTask;
|
|
|
591521
591652
|
})();
|
|
591522
591653
|
const holdTaskCompleteGates = (args, turn) => {
|
|
591523
591654
|
if (this._completionHoldState.total >= completionHoldHardMax) {
|
|
591524
|
-
const
|
|
591525
|
-
`
|
|
591526
|
-
lastCompletionGateReason ? `Last unresolved gate: ${lastCompletionGateReason.slice(0, 300)}` : ""
|
|
591655
|
+
const incompleteSummary = [
|
|
591656
|
+
`INCOMPLETE_VERIFICATION: completion was requested after ${this._completionHoldState.total} gate hold(s), but required evidence is still missing.`,
|
|
591657
|
+
lastCompletionGateReason ? `Last unresolved gate: ${lastCompletionGateReason.slice(0, 300)}` : "",
|
|
591658
|
+
lastCompletionGateFeedback ? `
|
|
591659
|
+
Evidence:
|
|
591660
|
+
${lastCompletionGateFeedback.trim().slice(0, 4e3)}` : ""
|
|
591527
591661
|
].filter(Boolean).join("\n");
|
|
591528
|
-
this.
|
|
591529
|
-
|
|
591662
|
+
this._completionIncompleteVerification = {
|
|
591663
|
+
reason: lastCompletionGateCode === "todo_verification" ? "verifier_still_failing" : "completion_evidence_missing",
|
|
591664
|
+
summary: incompleteSummary
|
|
591665
|
+
};
|
|
591530
591666
|
this.emit({
|
|
591531
591667
|
type: "status",
|
|
591532
|
-
content: `Completion hold hard-escape:
|
|
591668
|
+
content: `Completion hold hard-escape: marking incomplete_verification after ${this._completionHoldState.total} total holds`,
|
|
591533
591669
|
turn,
|
|
591534
591670
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
591535
591671
|
});
|
|
@@ -591537,7 +591673,7 @@ ${caveat}` : caveat;
|
|
|
591537
591673
|
this._completionHoldState.lastKey = "";
|
|
591538
591674
|
this._completionHoldState.total = 0;
|
|
591539
591675
|
lastCompletionGateCode = "";
|
|
591540
|
-
return
|
|
591676
|
+
return true;
|
|
591541
591677
|
}
|
|
591542
591678
|
const held = holdUnresolvedVerificationTaskComplete(turn) || holdNoProgressTaskComplete(args, turn) || holdProvenanceTaskComplete(args, turn);
|
|
591543
591679
|
if (!held) {
|
|
@@ -595887,6 +596023,15 @@ ${bookkeepingGuidance}` : bookkeepingGuidance;
|
|
|
595887
596023
|
delete result.failureDiagnosis;
|
|
595888
596024
|
} else {
|
|
595889
596025
|
this._diagnoseToolFailure(tc.name, tc.arguments, result);
|
|
596026
|
+
const staleHashRetryGuidance = this._buildStaleHashRetryGuidance(tc.name, tc.arguments, result);
|
|
596027
|
+
if (staleHashRetryGuidance) {
|
|
596028
|
+
output += `
|
|
596029
|
+
|
|
596030
|
+
${staleHashRetryGuidance}`;
|
|
596031
|
+
runtimeSystemGuidance = runtimeSystemGuidance ? `${runtimeSystemGuidance}
|
|
596032
|
+
|
|
596033
|
+
${staleHashRetryGuidance}` : staleHashRetryGuidance;
|
|
596034
|
+
}
|
|
595890
596035
|
}
|
|
595891
596036
|
const currentLogEntry = toolCallLog[_toolLogTailIdx];
|
|
595892
596037
|
if (currentLogEntry) {
|
|
@@ -598806,8 +598951,14 @@ ${marker}` : marker);
|
|
|
598806
598951
|
return { args, patchedCount: 0 };
|
|
598807
598952
|
}
|
|
598808
598953
|
if (toolName === "file_edit") {
|
|
598809
|
-
|
|
598810
|
-
|
|
598954
|
+
const currentHash = this._normalizeExpectedHashValue(this._rawExpectedHashValue(args));
|
|
598955
|
+
if (currentHash) {
|
|
598956
|
+
const path16 = this.extractPrimaryToolPath(args);
|
|
598957
|
+
const fresh2 = path16 ? this._freshReadHashForEditPath(path16) : null;
|
|
598958
|
+
if (!fresh2 || fresh2.hash === currentHash) {
|
|
598959
|
+
return { args, patchedCount: 0 };
|
|
598960
|
+
}
|
|
598961
|
+
return { args: { ...args, expected_hash: fresh2.hash }, patchedCount: 1 };
|
|
598811
598962
|
}
|
|
598812
598963
|
const path15 = this.extractPrimaryToolPath(args);
|
|
598813
598964
|
const fresh = path15 ? this._freshReadHashForEditPath(path15) : null;
|
|
@@ -598833,11 +598984,15 @@ ${marker}` : marker);
|
|
|
598833
598984
|
if (!edit || typeof edit !== "object" || Array.isArray(edit))
|
|
598834
598985
|
return edit;
|
|
598835
598986
|
const rec = edit;
|
|
598836
|
-
if (this._normalizeExpectedHashValue(this._rawExpectedHashValue(rec))) {
|
|
598837
|
-
return rec;
|
|
598838
|
-
}
|
|
598839
598987
|
const path15 = typeof rec["path"] === "string" ? rec["path"] : typeof rec["file"] === "string" ? rec["file"] : "";
|
|
598840
598988
|
const fresh = path15 ? this._freshReadHashForEditPath(path15) : null;
|
|
598989
|
+
const currentHash = this._normalizeExpectedHashValue(this._rawExpectedHashValue(rec));
|
|
598990
|
+
if (currentHash) {
|
|
598991
|
+
if (!fresh || fresh.hash === currentHash)
|
|
598992
|
+
return rec;
|
|
598993
|
+
patchedCount++;
|
|
598994
|
+
return { ...rec, expected_hash: fresh.hash };
|
|
598995
|
+
}
|
|
598841
598996
|
if (!fresh)
|
|
598842
598997
|
return rec;
|
|
598843
598998
|
patchedCount++;
|
|
@@ -599067,6 +599222,40 @@ ${marker}` : marker);
|
|
|
599067
599222
|
return changed ? next : args;
|
|
599068
599223
|
}
|
|
599069
599224
|
_normalizeToolArgsForExecution(toolName, args) {
|
|
599225
|
+
if (toolName === "todo_write") {
|
|
599226
|
+
if (args["todos"] !== void 0)
|
|
599227
|
+
return args;
|
|
599228
|
+
const content = String(args["content"] ?? "").trim();
|
|
599229
|
+
if (!content)
|
|
599230
|
+
return args;
|
|
599231
|
+
const action = String(args["action"] ?? "").trim().toLowerCase();
|
|
599232
|
+
const rawStatus = String(args["status"] ?? "").trim();
|
|
599233
|
+
const status = ["pending", "in_progress", "completed", "blocked"].includes(rawStatus) ? rawStatus : action === "complete" || action === "completed" || action === "done" ? "completed" : action === "block" || action === "blocked" ? "blocked" : "in_progress";
|
|
599234
|
+
const todo = { content, status };
|
|
599235
|
+
if (typeof args["id"] === "string" && args["id"].trim()) {
|
|
599236
|
+
todo["id"] = args["id"].trim();
|
|
599237
|
+
}
|
|
599238
|
+
if (typeof args["parentId"] === "string" && args["parentId"].trim()) {
|
|
599239
|
+
todo["parentId"] = args["parentId"].trim();
|
|
599240
|
+
}
|
|
599241
|
+
const artifact = args["file"] ?? args["path"];
|
|
599242
|
+
if (typeof artifact === "string" && artifact.trim()) {
|
|
599243
|
+
todo["declaredArtifacts"] = [artifact.trim()];
|
|
599244
|
+
}
|
|
599245
|
+
if (typeof args["verifyCommand"] === "string" && args["verifyCommand"].trim()) {
|
|
599246
|
+
todo["verifyCommand"] = args["verifyCommand"].trim();
|
|
599247
|
+
}
|
|
599248
|
+
if (typeof args["blocker"] === "string" && args["blocker"].trim()) {
|
|
599249
|
+
todo["blocker"] = args["blocker"].trim();
|
|
599250
|
+
}
|
|
599251
|
+
const next2 = { todos: [todo] };
|
|
599252
|
+
if (typeof args["session_id"] === "string" && args["session_id"].trim()) {
|
|
599253
|
+
next2["session_id"] = args["session_id"].trim();
|
|
599254
|
+
} else if (typeof args["sessionId"] === "string" && args["sessionId"].trim()) {
|
|
599255
|
+
next2["session_id"] = args["sessionId"].trim();
|
|
599256
|
+
}
|
|
599257
|
+
return next2;
|
|
599258
|
+
}
|
|
599070
599259
|
if (toolName === "working_notes") {
|
|
599071
599260
|
let next2 = args;
|
|
599072
599261
|
const copy2 = () => {
|
|
@@ -599225,7 +599414,7 @@ ${marker}` : marker);
|
|
|
599225
599414
|
return [
|
|
599226
599415
|
"[EDIT FRESHNESS CONTRACT]",
|
|
599227
599416
|
"Exact replacement edits must be built from verified current file content, not remembered text.",
|
|
599228
|
-
"Before file_edit or batch_edit can run, each target must carry expected_hash from file_read. If the runner has fresh read evidence, it will attach that hash automatically; otherwise the edit tool verifies the provided hash against disk before mutating.",
|
|
599417
|
+
"Before file_edit or batch_edit can run, each target must carry expected_hash from file_read. If the runner has fresh read evidence, it will attach or refresh that hash automatically; otherwise the edit tool verifies the provided hash against disk before mutating.",
|
|
599229
599418
|
"For multiple edits to the same file, use one batch_edit against the same expected_hash so all replacements validate atomically before the file changes.",
|
|
599230
599419
|
"",
|
|
599231
599420
|
...problems.map((problem) => `- ${problem}`),
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.523",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.523",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED