@amistio/cli 0.1.53 → 0.1.54
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 +28 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10814,6 +10814,12 @@ var AMISTIO_HARNESS_ID = "amistio";
|
|
|
10814
10814
|
function harnessMutationPolicyForWorkKind(workKind) {
|
|
10815
10815
|
return workKind === "implementation" || workKind === "promptBatch" ? "mutating" : "readOnly";
|
|
10816
10816
|
}
|
|
10817
|
+
function harnessMutationPolicyForWorkItem(workItem) {
|
|
10818
|
+
if (workItem.implementationExpectedOutcome === "analysisOnly" || workItem.implementationExpectedOutcome === "verificationOnly") {
|
|
10819
|
+
return "readOnly";
|
|
10820
|
+
}
|
|
10821
|
+
return harnessMutationPolicyForWorkKind(workItem.workKind);
|
|
10822
|
+
}
|
|
10817
10823
|
function createHarnessConcurrencyMetadata(executionPolicy, preview) {
|
|
10818
10824
|
const serializedResourceKeys = /* @__PURE__ */ new Set([
|
|
10819
10825
|
`claim-lane:${executionPolicy.claimLaneId}`,
|
|
@@ -12105,7 +12111,7 @@ async function runNextWorkItem({
|
|
|
12105
12111
|
...resolvedModelConfig,
|
|
12106
12112
|
executionPolicy: {
|
|
12107
12113
|
executionRoot,
|
|
12108
|
-
mutationPolicy:
|
|
12114
|
+
mutationPolicy: harnessMutationPolicyForWorkItem(result.workItem),
|
|
12109
12115
|
claimLaneId
|
|
12110
12116
|
}
|
|
12111
12117
|
});
|
|
@@ -12517,7 +12523,15 @@ async function runNextWorkItem({
|
|
|
12517
12523
|
...finalError ? { error: finalError } : {}
|
|
12518
12524
|
};
|
|
12519
12525
|
try {
|
|
12520
|
-
const implementationFinalization = await
|
|
12526
|
+
const implementationFinalization = isNonMutatingImplementationOutcome(result.workItem) ? await submitNonMutatingImplementationCompletion(apiClient, {
|
|
12527
|
+
attempt: result.workItem.attempt,
|
|
12528
|
+
finalStatus,
|
|
12529
|
+
idempotencyKey: finalizationIdempotencyKey,
|
|
12530
|
+
projectId,
|
|
12531
|
+
runnerId,
|
|
12532
|
+
telemetry: finalizationTelemetry,
|
|
12533
|
+
workItemId: result.workItem.workItemId
|
|
12534
|
+
}) : await submitStagedImplementationFinalization(apiClient, {
|
|
12521
12535
|
accountId: commandContext.accountId,
|
|
12522
12536
|
attempt: result.workItem.attempt,
|
|
12523
12537
|
finalStatus,
|
|
@@ -12598,6 +12612,9 @@ function isImplementationHandoffWork(workItem) {
|
|
|
12598
12612
|
if (workItem.implementationExpectedOutcome === "analysisOnly" || workItem.implementationExpectedOutcome === "verificationOnly") return false;
|
|
12599
12613
|
return workKind === "implementation" || workKind === "promptBatch";
|
|
12600
12614
|
}
|
|
12615
|
+
function isNonMutatingImplementationOutcome(workItem) {
|
|
12616
|
+
return workItem.implementationExpectedOutcome === "analysisOnly" || workItem.implementationExpectedOutcome === "verificationOnly";
|
|
12617
|
+
}
|
|
12601
12618
|
async function loadWorkItemRepositoryLink(apiClient, projectId, repositoryLinkId) {
|
|
12602
12619
|
const { repositoryLinks } = await apiClient.listRepositoryLinks(projectId);
|
|
12603
12620
|
return repositoryLinks.find((link) => link.repositoryLinkId === repositoryLinkId && link.status !== "revoked");
|
|
@@ -13312,6 +13329,15 @@ async function submitStagedImplementationFinalization(apiClient, input) {
|
|
|
13312
13329
|
await upsertImplementationFinalizationEntry(entry);
|
|
13313
13330
|
return submitImplementationFinalizationEntry(apiClient, entry);
|
|
13314
13331
|
}
|
|
13332
|
+
async function submitNonMutatingImplementationCompletion(apiClient, input) {
|
|
13333
|
+
try {
|
|
13334
|
+
const response = await apiClient.updateWorkStatus(input.projectId, input.workItemId, input.finalStatus, input.idempotencyKey, input.runnerId, input.telemetry);
|
|
13335
|
+
return { status: "completed", workItem: response.workItem };
|
|
13336
|
+
} catch (error) {
|
|
13337
|
+
const detail = truncateLogExcerpt(errorMessage7(error));
|
|
13338
|
+
return { status: "failed", message: `Non-mutating implementation completion ${input.workItemId} could not be recorded for attempt ${input.attempt}: ${detail}`, retryable: isRetryableApiError(error) };
|
|
13339
|
+
}
|
|
13340
|
+
}
|
|
13315
13341
|
function implementationFinalizationTelemetry(telemetry) {
|
|
13316
13342
|
const isolationMode = telemetry.isolationMode === "none" || telemetry.isolationMode === "gitWorktree" ? telemetry.isolationMode : void 0;
|
|
13317
13343
|
return {
|