@akagilnc/pi-workflow-roles 0.1.4620 → 0.1.4631
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/README.zh-CN.md +1 -1
- package/dist/acp-host/production-host.js +231 -218
- package/dist/activation-ledger-topology.js +0 -4
- package/dist/headless-host/production-host.js +215 -202
- package/dist/pi/role-turn-host.js +0 -3
- package/dist/public-cli/auto-resume.js +26 -0
- package/dist/public-cli/main.js +1054 -780
- package/dist/public-cli/post-admission.js +101 -7
- package/dist/public-cli/process-cancel.js +57 -0
- package/package.json +1 -1
- package/scripts/build-package.mjs +0 -1
- package/src/activation-ledger-topology.ts +1 -6
- package/src/activation-ledger.ts +5 -236
- package/src/analyst-entry.ts +19 -2
- package/src/analyst-ledger.ts +111 -6
- package/src/archivist-record-entry.ts +1 -1
- package/src/pi/role-turn-host.ts +0 -3
- package/src/public-cli/auto-resume.ts +34 -0
- package/src/public-cli/cli.ts +30 -0
- package/src/public-cli/main.ts +25 -3
- package/src/public-cli/post-admission.ts +173 -6
- package/src/public-cli/process-cancel.ts +75 -0
- package/src/role-runtime.ts +4 -51
- package/dist/activation-reconciliation.js +0 -61
- package/src/activation-reconciliation.ts +0 -163
|
@@ -361,9 +361,6 @@ export function createPiRoleTurnHost(config) {
|
|
|
361
361
|
&& process.env.AK_ROLE_AUDITOR_SUBJECT.trim() !== "") {
|
|
362
362
|
env.AK_ROLE_AUDITOR_SUBJECT = process.env.AK_ROLE_AUDITOR_SUBJECT;
|
|
363
363
|
}
|
|
364
|
-
if (request.correlationId !== undefined && request.correlationId.trim() !== "") {
|
|
365
|
-
env.AK_CORRELATION_ID = request.correlationId;
|
|
366
|
-
}
|
|
367
364
|
if (config.recordLaunchedRolePackageIdentity !== undefined &&
|
|
368
365
|
config.observeLaunchedRolePackageIdentity !== undefined) {
|
|
369
366
|
await config.recordLaunchedRolePackageIdentity(request.runDirectory, await config.observeLaunchedRolePackageIdentity(config.packageRoot, roleEntry));
|
|
@@ -18,6 +18,7 @@ import { join } from "node:path";
|
|
|
18
18
|
import { roleRunArtifactsDirectory } from "../role-run-placement.js";
|
|
19
19
|
import { AUTO_RESUME_LIMIT, describeErrorIdentity, acquireRunWriterLease, markRunResumable, markRunTerminal, RunWriterLeaseHeldError, } from "./run-lifecycle.js";
|
|
20
20
|
import { parseAutoResumeLimit } from "./config.js";
|
|
21
|
+
import { processCancelSignalName } from "./process-cancel.js";
|
|
21
22
|
import { isLawfulTypedTerminalOutcome, formatTerminalResult } from "./terminal.js";
|
|
22
23
|
import { attachRecordedSubmissions, presentFailureTerminal, presentStructuralRejection, resolveControlledFailureResumeObservation, } from "./settlement.js";
|
|
23
24
|
const dummyIo = { stdout: () => { }, stderr: () => { } };
|
|
@@ -423,6 +424,12 @@ export async function runWithAutoResumeLoop(options) {
|
|
|
423
424
|
presentTerminal(terminal, options.io);
|
|
424
425
|
return result;
|
|
425
426
|
}
|
|
427
|
+
// #855: process cancel — stop even if dispatch forgot skipAutoResume.
|
|
428
|
+
if (processCancelSignalName(options.signal) !== undefined) {
|
|
429
|
+
if (terminal !== undefined)
|
|
430
|
+
presentTerminal(terminal, options.io);
|
|
431
|
+
return result;
|
|
432
|
+
}
|
|
426
433
|
}
|
|
427
434
|
if (result !== undefined) {
|
|
428
435
|
const terminal = result.terminal;
|
|
@@ -457,6 +464,25 @@ export async function runWithAutoResumeLoop(options) {
|
|
|
457
464
|
terminal,
|
|
458
465
|
};
|
|
459
466
|
}
|
|
467
|
+
// #855: process cancel on the throw path — do not re-dispatch; name the signal.
|
|
468
|
+
const cancelName = processCancelSignalName(options.signal);
|
|
469
|
+
if (cancelName !== undefined) {
|
|
470
|
+
const terminal = await attachDispatchExceptionTerminal(options.admitted, dispatchExceptionFailureTerminal({
|
|
471
|
+
role: options.admitted.role,
|
|
472
|
+
runId: options.admitted.runId,
|
|
473
|
+
causeError: lastThrownError,
|
|
474
|
+
errorFiles: retainedErrorFiles,
|
|
475
|
+
autoResumeAttempts,
|
|
476
|
+
endReason: `ak-role terminated by ${cancelName}`,
|
|
477
|
+
everyAttemptThrew,
|
|
478
|
+
}), options.io);
|
|
479
|
+
await finalizeExceptionRunBestEffort(options.admitted.runDirectory, options.io);
|
|
480
|
+
presentTerminal(terminal, options.io);
|
|
481
|
+
return {
|
|
482
|
+
exitCode: 1,
|
|
483
|
+
terminal,
|
|
484
|
+
};
|
|
485
|
+
}
|
|
460
486
|
if (!(await isPrincipalAvailable(options.admitted.principal))) {
|
|
461
487
|
const terminal = await attachDispatchExceptionTerminal(options.admitted, dispatchExceptionFailureTerminal({
|
|
462
488
|
role: options.admitted.role,
|