metheus-governance-mcp-cli 0.2.272 → 0.2.273
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/lib/runner-runtime.mjs
CHANGED
|
@@ -233,6 +233,12 @@ function resolveRunnerLocalInboundArtifactOwners({
|
|
|
233
233
|
.filter(Boolean),
|
|
234
234
|
));
|
|
235
235
|
if (explicitMentions.length > 0) {
|
|
236
|
+
if (normalizedUpdate.fromIsBot !== true) {
|
|
237
|
+
if (currentBotSelector && explicitMentions.includes(currentBotSelector) && currentOwner) {
|
|
238
|
+
return [currentOwner];
|
|
239
|
+
}
|
|
240
|
+
return [];
|
|
241
|
+
}
|
|
236
242
|
const explicitOwners = explicitMentions
|
|
237
243
|
.map((selector) => ownersBySelector.get(selector))
|
|
238
244
|
.filter((owner) => owner && owner.routeKey);
|
|
@@ -254,6 +260,26 @@ function resolveRunnerLocalInboundArtifactOwners({
|
|
|
254
260
|
return currentOwner ? [currentOwner] : [];
|
|
255
261
|
}
|
|
256
262
|
|
|
263
|
+
function currentRouteOwnsRunnerInboundUpdate({
|
|
264
|
+
update,
|
|
265
|
+
routeKey,
|
|
266
|
+
route,
|
|
267
|
+
bot,
|
|
268
|
+
managedConversationBots,
|
|
269
|
+
}) {
|
|
270
|
+
const normalizedRouteKey = String(routeKey || "").trim();
|
|
271
|
+
if (!normalizedRouteKey) {
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
return resolveRunnerLocalInboundArtifactOwners({
|
|
275
|
+
update,
|
|
276
|
+
routeKey: normalizedRouteKey,
|
|
277
|
+
route,
|
|
278
|
+
bot,
|
|
279
|
+
managedConversationBots,
|
|
280
|
+
}).some((owner) => String(safeObject(owner).routeKey || "").trim() === normalizedRouteKey);
|
|
281
|
+
}
|
|
282
|
+
|
|
257
283
|
function managedConversationBotTargetsCurrentRoute({
|
|
258
284
|
update,
|
|
259
285
|
bot,
|
|
@@ -789,6 +815,18 @@ async function archiveRunnerTelegramInboundUpdates({
|
|
|
789
815
|
if (!String(update.text || "").trim()) {
|
|
790
816
|
continue;
|
|
791
817
|
}
|
|
818
|
+
if (
|
|
819
|
+
update.fromIsBot !== true
|
|
820
|
+
&& !currentRouteOwnsRunnerInboundUpdate({
|
|
821
|
+
update,
|
|
822
|
+
routeKey,
|
|
823
|
+
route,
|
|
824
|
+
bot,
|
|
825
|
+
managedConversationBots,
|
|
826
|
+
})
|
|
827
|
+
) {
|
|
828
|
+
continue;
|
|
829
|
+
}
|
|
792
830
|
const dedupeKey = buildArchivedInboundMessageKey(update.chatID, update.messageID);
|
|
793
831
|
if (boolFromRaw(archivePolicy.dedupeInbound, true) && existingKeys.has(dedupeKey)) {
|
|
794
832
|
continue;
|
|
@@ -1649,12 +1649,13 @@ export async function runSelftestTelegramE2E(push, deps) {
|
|
|
1649
1649
|
const ryoai3Receipt = safeObject(
|
|
1650
1650
|
safeObject(safeObject(ownershipState.routes)[routeRyoai3Key]).recent_local_inbound_receipts?.[`${String(e2eDestination.chat_id)}:83`],
|
|
1651
1651
|
);
|
|
1652
|
+
const ownershipBodies = telegramE2EServer.state.comments.map((item) => String(item.body || ""));
|
|
1652
1653
|
push(
|
|
1653
|
-
"
|
|
1654
|
-
String(ryoai2Receipt.receipt_route_key || "")
|
|
1655
|
-
&& String(
|
|
1656
|
-
&&
|
|
1657
|
-
`owner=${JSON.stringify(ryoai2Receipt)} foreign=${JSON.stringify(ryoai3Receipt)}`,
|
|
1654
|
+
"telegram_human_inbound_does_not_fan_out_to_foreign_owner_routes",
|
|
1655
|
+
!String(ryoai2Receipt.receipt_route_key || "").trim()
|
|
1656
|
+
&& !String(ryoai3Receipt.receipt_route_key || "").trim()
|
|
1657
|
+
&& ownershipBodies.length === 0,
|
|
1658
|
+
`owner=${JSON.stringify(ryoai2Receipt)} foreign=${JSON.stringify(ryoai3Receipt)} comments=${ownershipBodies.join(" || ")}`,
|
|
1658
1659
|
);
|
|
1659
1660
|
} catch (err) {
|
|
1660
1661
|
push("telegram_runner_e2e_local_mock", false, String(err?.message || err));
|