metheus-governance-mcp-cli 0.2.267 → 0.2.268
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/cli.mjs +20 -14
- package/lib/selftest-runner-scenarios.mjs +62 -16
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -6223,20 +6223,26 @@ function markRunnerRequestLifecycle({
|
|
|
6223
6223
|
return String(existing.normalized_intent || "").trim().toLowerCase();
|
|
6224
6224
|
})();
|
|
6225
6225
|
const normalizedOutcome = String(outcome || "").trim().toLowerCase();
|
|
6226
|
-
const nextStatus = (() => {
|
|
6227
|
-
if (normalizedOutcome === "claimed") return "claimed";
|
|
6228
|
-
if (normalizedOutcome === "running") return "running";
|
|
6229
|
-
if (normalizedOutcome === "delivery_failed_after_generation") return "running";
|
|
6230
|
-
if (normalizedOutcome === "replied") {
|
|
6231
|
-
return shouldRemainRunningAfterReply ? "running" : "completed";
|
|
6232
|
-
}
|
|
6233
|
-
if (normalizedOutcome === "loop_closed") return "loop_closed";
|
|
6234
|
-
if (normalizedOutcome === "expired") return "expired";
|
|
6235
|
-
if (
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6226
|
+
const nextStatus = (() => {
|
|
6227
|
+
if (normalizedOutcome === "claimed") return "claimed";
|
|
6228
|
+
if (normalizedOutcome === "running") return "running";
|
|
6229
|
+
if (normalizedOutcome === "delivery_failed_after_generation") return "running";
|
|
6230
|
+
if (normalizedOutcome === "replied") {
|
|
6231
|
+
return shouldRemainRunningAfterReply ? "running" : "completed";
|
|
6232
|
+
}
|
|
6233
|
+
if (normalizedOutcome === "loop_closed") return "loop_closed";
|
|
6234
|
+
if (normalizedOutcome === "expired") return "expired";
|
|
6235
|
+
if (
|
|
6236
|
+
normalizedOutcome === "error"
|
|
6237
|
+
|| normalizedOutcome === "skipped"
|
|
6238
|
+
|| normalizedOutcome === "closed"
|
|
6239
|
+
|| normalizedOutcome === "execution_failed"
|
|
6240
|
+
|| normalizedOutcome === "policy_violation"
|
|
6241
|
+
) {
|
|
6242
|
+
return "closed";
|
|
6243
|
+
}
|
|
6244
|
+
return normalizeRunnerRequestStatus(existing.status);
|
|
6245
|
+
})();
|
|
6240
6246
|
const nowISO = new Date().toISOString();
|
|
6241
6247
|
const commentKind = String(parsed.kind || "").trim().toLowerCase();
|
|
6242
6248
|
const isRootHumanComment = ["telegram_message", "telegram_edited_message"].includes(commentKind);
|
|
@@ -2615,16 +2615,61 @@ export async function runSelftestRunnerScenarios(push, deps) {
|
|
|
2615
2615
|
executionContractTargets: ["@RyoAI3_bot"],
|
|
2616
2616
|
nextExpectedResponders: [],
|
|
2617
2617
|
});
|
|
2618
|
-
push(
|
|
2619
|
-
"runner_request_lifecycle_reply_ignores_session_state_when_continuation_targets_remain",
|
|
2620
|
-
String(continuedRequest?.status || "") === "running",
|
|
2621
|
-
`status=${String(continuedRequest?.status || "(none)")}`,
|
|
2622
|
-
);
|
|
2623
|
-
|
|
2624
|
-
saveBotRunnerState({
|
|
2625
|
-
routes: {
|
|
2626
|
-
[requestRouteKey]: {},
|
|
2627
|
-
},
|
|
2618
|
+
push(
|
|
2619
|
+
"runner_request_lifecycle_reply_ignores_session_state_when_continuation_targets_remain",
|
|
2620
|
+
String(continuedRequest?.status || "") === "running",
|
|
2621
|
+
`status=${String(continuedRequest?.status || "(none)")}`,
|
|
2622
|
+
);
|
|
2623
|
+
|
|
2624
|
+
saveBotRunnerState({
|
|
2625
|
+
routes: {
|
|
2626
|
+
[requestRouteKey]: {},
|
|
2627
|
+
},
|
|
2628
|
+
sharedInboxes: {},
|
|
2629
|
+
excludedComments: {},
|
|
2630
|
+
requests: {
|
|
2631
|
+
"request-key-2b": {
|
|
2632
|
+
request_key: "request-key-2b",
|
|
2633
|
+
project_id: selftestProjectID,
|
|
2634
|
+
provider: "telegram",
|
|
2635
|
+
chat_id: "-100123",
|
|
2636
|
+
source_message_id: 711,
|
|
2637
|
+
conversation_id: "conv-request-2b",
|
|
2638
|
+
status: "running",
|
|
2639
|
+
claimed_by_route: requestRouteKey,
|
|
2640
|
+
},
|
|
2641
|
+
},
|
|
2642
|
+
consumedComments: {},
|
|
2643
|
+
});
|
|
2644
|
+
const failedRequest = markRunnerRequestLifecycle({
|
|
2645
|
+
normalizedRoute: requestRoute,
|
|
2646
|
+
requestKey: "request-key-2b",
|
|
2647
|
+
selectedRecord: {
|
|
2648
|
+
id: "comment-request-finish-2b",
|
|
2649
|
+
parsedArchive: {
|
|
2650
|
+
kind: "bot_reply",
|
|
2651
|
+
chatID: "-100123",
|
|
2652
|
+
messageID: 712,
|
|
2653
|
+
conversationID: "conv-request-2b",
|
|
2654
|
+
},
|
|
2655
|
+
},
|
|
2656
|
+
routeKey: requestRouteKey,
|
|
2657
|
+
outcome: "execution_failed",
|
|
2658
|
+
closedReason: "worker step completed without any validated project artifacts",
|
|
2659
|
+
currentBotSelector: "@RyoAI_bot",
|
|
2660
|
+
});
|
|
2661
|
+
push(
|
|
2662
|
+
"runner_request_lifecycle_execution_failed_closes_request",
|
|
2663
|
+
String(failedRequest?.status || "") === "closed"
|
|
2664
|
+
&& String(failedRequest?.closed_reason || "") === "worker step completed without any validated project artifacts"
|
|
2665
|
+
&& String(failedRequest?.closed_at || "").trim().length > 0,
|
|
2666
|
+
`status=${String(failedRequest?.status || "(none)")} reason=${String(failedRequest?.closed_reason || "(none)")} closed_at=${String(failedRequest?.closed_at || "(none)")}`,
|
|
2667
|
+
);
|
|
2668
|
+
|
|
2669
|
+
saveBotRunnerState({
|
|
2670
|
+
routes: {
|
|
2671
|
+
[requestRouteKey]: {},
|
|
2672
|
+
},
|
|
2628
2673
|
sharedInboxes: {},
|
|
2629
2674
|
excludedComments: {},
|
|
2630
2675
|
requests: {
|
|
@@ -2679,12 +2724,13 @@ export async function runSelftestRunnerScenarios(push, deps) {
|
|
|
2679
2724
|
);
|
|
2680
2725
|
} catch (err) {
|
|
2681
2726
|
push("runner_request_claim_persists_request_and_consumed_comment", false, String(err?.message || err));
|
|
2682
|
-
push("runner_stale_open_session_cleanup_excludes_bot_reply_replay", false, String(err?.message || err));
|
|
2683
|
-
push("runner_request_lifecycle_reply_completes_without_continuation_targets", false, String(err?.message || err));
|
|
2684
|
-
push("runner_request_lifecycle_reply_ignores_session_state_when_continuation_targets_remain", false, String(err?.message || err));
|
|
2685
|
-
push("
|
|
2686
|
-
push("
|
|
2687
|
-
|
|
2727
|
+
push("runner_stale_open_session_cleanup_excludes_bot_reply_replay", false, String(err?.message || err));
|
|
2728
|
+
push("runner_request_lifecycle_reply_completes_without_continuation_targets", false, String(err?.message || err));
|
|
2729
|
+
push("runner_request_lifecycle_reply_ignores_session_state_when_continuation_targets_remain", false, String(err?.message || err));
|
|
2730
|
+
push("runner_request_lifecycle_execution_failed_closes_request", false, String(err?.message || err));
|
|
2731
|
+
push("runner_request_claim_preserves_authoritative_source_message_envelope", false, String(err?.message || err));
|
|
2732
|
+
push("runner_request_lifecycle_preserves_stronger_existing_source_ownership", false, String(err?.message || err));
|
|
2733
|
+
} finally {
|
|
2688
2734
|
if (typeof originalRequestLedgerHome === "string") {
|
|
2689
2735
|
process.env.HOME = originalRequestLedgerHome;
|
|
2690
2736
|
} else {
|